Logo Search packages:      
Sourcecode: ygraph version File versions  Download package

void legend_draw ( Plot plot  ) 

Put the legend data onto the window.

Parameters:
plot The plot for which the legend is to be drawn.

Definition at line 381 of file legend.c.

References _Legend::gc, _Legend::height, _Plot::i_origin, _Plot::i_size, _Plot::j_origin, _Plot::j_size, _Plot::legend, legend_create(), legend_pixmap_create(), _Legend::pixmap, _Plot::pixmap, _Legend::position, _Legend::rebuild, and _Legend::width.

Referenced by all_windows_draw(), plot_window_display_all(), plot_window_draw_all(), plot_window_draw_current_frame(), and plot_window_expose().

{
  Legend* legend;

  legend = plot->legend;
  if ((legend == NULL) || (legend->position == LEGEND_OFF))
    return;

  if (legend->rebuild == TRUE)
      legend_create(plot);
  legend = plot->legend;

  legend_pixmap_create(plot, legend);

  /*
   * Copy the legend pixmap onto the plot_area pixmap so it will be displayed
   * when the plot_area is updated.
   */
  if (legend->position == LEGEND_RIGHT)
    gdk_draw_pixmap(plot->pixmap, legend->gc, legend->pixmap, 0, 0,
                    plot->i_origin + plot->i_size,
                    plot->j_origin - plot->j_size,
                    -1, -1);
  else if (legend->position == LEGEND_TOP)
    gdk_draw_pixmap(plot->pixmap, legend->gc, legend->pixmap, 0, 0,
                    plot->i_origin + plot->i_size - legend->width,
                    plot->j_origin - plot->j_size - legend->height,
                    -1, -1);
  else if (legend->position == LEGEND_OVER)
    gdk_draw_pixmap(plot->pixmap, legend->gc, legend->pixmap, 0, 0,
                    plot->i_origin + plot->i_size - legend->width,
                    plot->j_origin - plot->j_size,
                    -1, -1);
}


Generated by  Doxygen 1.6.0   Back to index