]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/combox.h
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / combox.h
1 /**
2  * \file combox.h
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS.
9  *
10  * A combination of two objects (a button and a browser) is encapsulated to
11  * get a combobox-like object.
12  */
13
14 #ifndef FL_COMBOX_H
15 #define FL_COMBOX_H
16
17 #include "lyx_forms.h"
18
19 #if defined(__cplusplus)
20 extern "C"
21 {
22 #endif
23
24 /** This will eventually be moved into the enum of in-built widgets
25     in forms.h. */
26 enum {
27     FL_COMBOX = 200
28 };
29
30 /** The various types of combox. */
31 typedef enum {
32     FL_NORMAL_COMBOX,
33     FL_DROPLIST_COMBOX
34 } FL_COMBOX_TYPE;
35
36 /** How the browser should be displayed relative to the buttons. */
37 typedef enum {
38     FL_COMBOX_BELOW,
39     FL_COMBOX_ABOVE
40 } FL_COMBOX_POSITION;
41
42 /** A function to create a combox widget.
43  *  \param type is, as yet, unused. there is only one type of combox.
44  *  \param x the x coordinate of the upper left hand corner of the widget,
45  *  relative to the parent form's origin.
46  *  \param y the y coordinate of the upper left hand corner of the widget,
47  *  relative to the parent form's origin.
48  *  \param w the widget's width
49  *  \param h the widget's height
50  *  \param label the widget's label as it appears on the GUI.
51  */
52 FL_EXPORT FL_OBJECT *
53 fl_create_combox(FL_COMBOX_TYPE type,
54                  FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h,
55                  char const * label);
56
57 /** A function to create a combox widget and add it to the parent form.
58  *  \see fl_create_combox() for an explanation of the argument list.
59  */
60 FL_EXPORT FL_OBJECT *
61 fl_add_combox(FL_COMBOX_TYPE type,
62               FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h,
63               char const * label);
64
65 /** The combox browser has a default height of 100 pixels. Adjust to suit. */
66 FL_EXPORT void
67 fl_set_combox_browser_height(FL_OBJECT * ob, int bh);
68
69 /** The browser will be displayed either below or above the button,
70  *  dependent upon \c position.
71  */
72 FL_EXPORT void
73 fl_set_combox_position(FL_OBJECT * ob, FL_COMBOX_POSITION position);
74
75 /** Empty the browser and the combox. */
76 FL_EXPORT void
77 fl_clear_combox(FL_OBJECT * ob);
78
79 /** Add a line to the combox browser. */
80 FL_EXPORT void
81 fl_addto_combox(FL_OBJECT * ob, char const * text);
82
83 /** Set the combox to return line \c choice of the combox browser. */
84 FL_EXPORT void
85 fl_set_combox(FL_OBJECT * ob, int choice);
86
87 /** \return the currently selected line of the combox browser. */
88 FL_EXPORT int
89 fl_get_combox(FL_OBJECT * ob);
90
91 /** \return the contents of the combox.
92  *  (Also the contents of currently selected line of the combox browser.)
93  */
94 FL_EXPORT char const *
95 fl_get_combox_text(FL_OBJECT * ob);
96
97 /** \return the contents of \c line of the combox browser. */
98 FL_EXPORT char const *
99 fl_get_combox_line(FL_OBJECT * ob, int line);
100
101 /** \return the number of items in the combox browser. */
102 FL_EXPORT int
103 fl_get_combox_maxitems(FL_OBJECT * ob);
104
105 /** Show the browser */
106 FL_EXPORT void
107 fl_show_combox_browser(FL_OBJECT * ob);
108
109 /** Hide the browser */
110 FL_EXPORT void
111 fl_hide_combox_browser(FL_OBJECT * ob);
112
113 #if defined(__cplusplus)
114 }
115 #endif
116
117 #endif /* NOT FL_COMBOX_H */