3 * Copyright 1995-1996 Alejandro Aguilar Sierra
4 * Read the file COPYING
6 * \author Alejandro Aguilar Sierra
8 * Full author contact details are available in file CREDITS
11 /* A bitmap table uses a single bitmap to simulate a 2d array
12 * of bitmap buttons. It can be used to build bitmap menus.
22 #include FORMS_H_LOCATION
24 #if defined(__cplusplus)
30 #define FL_BMTABLE 1500
31 /* A flat bitmap table */
32 #define FL_BMTABLE_FLAT 0
33 /* A grided bitmap table */
34 #define FL_BMTABLE_GRID 1
37 /* Same as fl_bitmapbutton */
41 * normal bmtable default
43 #define FL_BMTABLE_BOXTYPE FL_UP_BOX
47 FL_OBJECT *fl_create_bmtable(int, FL_Coord, FL_Coord,
48 FL_Coord, FL_Coord, char const *);
50 FL_OBJECT *fl_add_bmtable(int, FL_Coord, FL_Coord,
51 FL_Coord, FL_Coord, char const *);
53 /** Same as fl_get_button_numb() */
54 int fl_get_bmtable_numb(FL_OBJECT *ob);
56 void fl_set_bmtable(FL_OBJECT *, int pushed, int pos);
58 /** Number of columns and rows, and the background bitmap */
59 void fl_set_bmtable_data(FL_OBJECT *, int, int, int, int, unsigned char const *);
61 void fl_set_bmtable_pixmap_data(FL_OBJECT *, int, int, char **);
63 void fl_set_bmtable_file(FL_OBJECT *, int, int, char const *);
65 void fl_set_bmtable_pixmap_file(FL_OBJECT *, int, int, char const *);
67 /** Adjust bitmap origin (ox, oy) and cell dimensions (dx, dy) incrementally */
68 void fl_set_bmtable_adjust(FL_OBJECT *, int ox, int oy, int dx, int dy);
70 /** The number of items is by default nc x nr, but you can change it */
71 void fl_set_bmtable_maxitems(FL_OBJECT *, int);
73 int fl_get_bmtable_maxitems(FL_OBJECT *);
75 /** Returns the index of the selected item or -1 if none was selected */
76 int fl_get_bmtable(FL_OBJECT *);
78 /** Replace an item's sub_bitmap at id position */
79 void fl_replace_bmtable_item(FL_OBJECT *ob, int id, int cw, int ch, char *data);
81 /** Get the sub_bitmap from id position. You must alloc memory for the data. */
82 void fl_get_bmtable_item(FL_OBJECT *ob, int id, int *cw, int *ch, char *data);
84 /** Returns a pixmap from the table, if available. */
85 Pixmap fl_get_bmtable_pixmap(FL_OBJECT *);
87 /** Draws a single item on a drawable */
88 void fl_draw_bmtable_item(FL_OBJECT *ob, int i, Drawable d, int xx, int yy);
90 /** Free the current bitmap in preparation for installing a new one */
91 void fl_free_bmtable_bitmap(FL_OBJECT *ob);
93 /** Free the current pixmap in preparation for installing a new one */
94 void fl_free_bmtable_pixmap(FL_OBJECT *ob);
96 #if defined(__cplusplus)
100 #endif /* BMTABLE_H */