]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/combox.h
The new combox code.
[lyx.git] / src / frontends / xforms / combox.h
1 /**
2  * \file combox.h
3  * \author Angus Leeming
4  *
5  * A combination of two objects (a button and a browser) is encapsulated to
6  * get a combobox-like object.
7  */
8
9 #ifndef FL_COMBOX_H
10 #define FL_COMBOX_H
11
12 #if defined(__cplusplus)
13 extern "C"
14 {
15 #endif
16
17 /** This will eventually be moved into the enum of in-built widgets
18     in forms.h. */
19 enum {
20     FL_COMBOX = 200
21 };
22
23 /** The types of combox. At the moment, there's only one. */
24 enum {
25     FL_DROPLIST_COMBOX
26 };
27
28 /** A function to create a combox widget.
29  *  \param type is, as yet, unused. there is only one type of combox.
30  *  \param x, \param y: the x,y coordinates of the upper left hand corner
31  *  of the widget, relative to the parent form'd origin.
32  *  \param w, \param h: the widget's dimensions.
33  *  \param label: the widget's label as it appears on the GUI.
34  */
35 FL_EXPORT FL_OBJECT *
36 fl_create_combox(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h,
37                  char const * label);
38
39 /** A function to create a combox widget and add it to the parent form.
40  *  \see fl_create_combox() for an explanation of the argument list.
41  */
42 FL_EXPORT FL_OBJECT *
43 fl_add_combox(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h,
44               char const * label);
45
46 /** The combox browser has a default height of 100 pixels. Adjust to suit. */
47 FL_EXPORT void fl_set_combox_browser_height(FL_OBJECT * ob, int bh);
48
49 /** The browser will be displayed either below or above the button,
50  *  dependent upon \param position.
51  */
52 FL_EXPORT void fl_set_combox_position(FL_OBJECT * ob, int position);
53
54 /** Empty the browser and the combox, \param ob. */
55 FL_EXPORT void fl_clear_combox(FL_OBJECT * ob);
56
57 /** Add a line to the combox browser.*/
58 FL_EXPORT void fl_addto_combox(FL_OBJECT * ob, char const * text);
59
60 /** Set the combox to return line \param choice of the combox browser. */
61 FL_EXPORT void fl_set_combox(FL_OBJECT * ob, int choice);
62
63 /** \return the currently selected line of the combox browser. */
64 FL_EXPORT int fl_get_combox(FL_OBJECT * ob);
65
66 /** \return the contents of the combox.
67  *  (Also the contents of currently selected line of the combox browser.)
68  */
69 FL_EXPORT char const * fl_get_combox_text(FL_OBJECT * ob);
70
71 /** \return the contents of \param line of the combox browser. */
72 FL_EXPORT char const * fl_get_combox_line(FL_OBJECT * ob, int line);
73
74 /** \return the number of items in the combox browser. */
75 FL_EXPORT int fl_get_combox_maxitems(FL_OBJECT * ob);
76
77 /** Show the browser */
78 void fl_show_combox_browser(FL_OBJECT * ob);
79
80 /** Hide the browser */
81 void fl_hide_combox_browser(FL_OBJECT * ob);
82
83 #if defined(__cplusplus)
84 }
85 #endif
86
87 #endif