GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
#include <string.h>
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/display.h>
Go to the source code of this file.
Macros | |
#define | Y_BORDER 5 |
#define | X_BORDER 5 |
Functions | |
int | D_popup (int back_colr, int text_colr, int div_colr, int top, int left, int percent_per_line, char *options[]) |
pop-up menu More... | |
int D_popup | ( | int | back_colr, |
int | text_colr, | ||
int | div_colr, | ||
int | top, | ||
int | left, | ||
int | percent_per_line, | ||
char * | options[] | ||
) |
pop-up menu
This routine provides a pop-up type menu on the graphics screen. The bcolor specifies the background color. The tcolor is the text color. The dcolor specifies the color of the line used to divide the menu items. The top and left specify the placement of the top left corner of the menu on the screen. 0,0 is at the bottom left of the screen, and 100,100 is at the top right. The size of the text is given as a percentage of the vertical size of the screen. The options array is a NULL terminated array of character strings. The first is a menu title and the rest are the menu options (i.e., options[0] is the menu title, and options[1], options[2], etc., are the menu options). The last option must be the NULL pointer. The coordinates of the bottom right of the menu are calculated based on the top left coordinates, the size, the number of options, and the longest option text length. If necessary, the menu coordinates are adjusted to make sure the menu is on the screen. D_popup(~) does the following:
bcolor | |
tcolor | |
dcolor | |
top | |
left | |
size | |
options[] |
Definition at line 80 of file popup.c.
References b, G_fatal_error(), G_tempfile(), height, int, l, n, NULL, r, R_box_abs(), R_cont_abs(), R_cont_rel(), R_flush(), R_get_location_with_pointer(), R_move_abs(), R_panel_delete(), R_panel_restore(), R_panel_save(), R_screen_bot(), R_screen_left(), R_screen_rite(), R_screen_top(), R_set_window(), R_standard_color(), R_text(), R_text_size(), dialogs::width, point::x, X_BORDER, y, and Y_BORDER.