2002-03-11 17:00:41 +00:00
|
|
|
/**
|
|
|
|
* \file combox.h
|
2003-04-03 09:21:11 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2003-04-02 14:20:30 +00:00
|
|
|
* \author Angus Leeming
|
2002-03-11 17:00:41 +00:00
|
|
|
*
|
2003-04-03 09:21:11 +00:00
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
*
|
2003-04-02 14:20:30 +00:00
|
|
|
* A combination of two objects (a button and a browser) is encapsulated to
|
|
|
|
* get a combobox-like object.
|
2002-03-21 21:21:28 +00:00
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
#ifndef FL_COMBOX_H
|
|
|
|
#define FL_COMBOX_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** This will eventually be moved into the enum of in-built widgets
|
|
|
|
in forms.h. */
|
|
|
|
enum {
|
|
|
|
FL_COMBOX = 200
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
2003-04-03 09:21:11 +00:00
|
|
|
/** The various types of combox. */
|
|
|
|
typedef enum {
|
|
|
|
FL_NORMAL_COMBOX,
|
2003-04-02 14:20:30 +00:00
|
|
|
FL_DROPLIST_COMBOX
|
2003-04-03 09:21:11 +00:00
|
|
|
} FL_COMBOX_TYPE;
|
|
|
|
|
|
|
|
/** How the browser should be displayed relative to the buttons. */
|
|
|
|
typedef enum {
|
|
|
|
FL_COMBOX_BELOW,
|
|
|
|
FL_COMBOX_ABOVE
|
|
|
|
} FL_COMBOX_POSITION;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** A function to create a combox widget.
|
|
|
|
* \param type is, as yet, unused. there is only one type of combox.
|
|
|
|
* \param x, \param y: the x,y coordinates of the upper left hand corner
|
|
|
|
* of the widget, relative to the parent form'd origin.
|
|
|
|
* \param w, \param h: the widget's dimensions.
|
|
|
|
* \param label: the widget's label as it appears on the GUI.
|
|
|
|
*/
|
|
|
|
FL_EXPORT FL_OBJECT *
|
2003-04-03 09:21:11 +00:00
|
|
|
fl_create_combox(FL_COMBOX_TYPE type,
|
|
|
|
FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h,
|
2003-04-02 14:20:30 +00:00
|
|
|
char const * label);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** A function to create a combox widget and add it to the parent form.
|
|
|
|
* \see fl_create_combox() for an explanation of the argument list.
|
|
|
|
*/
|
|
|
|
FL_EXPORT FL_OBJECT *
|
2003-04-03 09:21:11 +00:00
|
|
|
fl_add_combox(FL_COMBOX_TYPE type,
|
|
|
|
FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h,
|
2003-04-02 14:20:30 +00:00
|
|
|
char const * label);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** The combox browser has a default height of 100 pixels. Adjust to suit. */
|
|
|
|
FL_EXPORT void fl_set_combox_browser_height(FL_OBJECT * ob, int bh);
|
2000-02-04 09:38:32 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** The browser will be displayed either below or above the button,
|
|
|
|
* dependent upon \param position.
|
|
|
|
*/
|
2003-04-03 09:21:11 +00:00
|
|
|
FL_EXPORT void fl_set_combox_position(FL_OBJECT * ob,
|
|
|
|
FL_COMBOX_POSITION position);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** Empty the browser and the combox, \param ob. */
|
|
|
|
FL_EXPORT void fl_clear_combox(FL_OBJECT * ob);
|
2000-02-04 09:38:32 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** Add a line to the combox browser.*/
|
|
|
|
FL_EXPORT void fl_addto_combox(FL_OBJECT * ob, char const * text);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** Set the combox to return line \param choice of the combox browser. */
|
|
|
|
FL_EXPORT void fl_set_combox(FL_OBJECT * ob, int choice);
|
2000-02-04 09:38:32 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** \return the currently selected line of the combox browser. */
|
|
|
|
FL_EXPORT int fl_get_combox(FL_OBJECT * ob);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** \return the contents of the combox.
|
|
|
|
* (Also the contents of currently selected line of the combox browser.)
|
|
|
|
*/
|
|
|
|
FL_EXPORT char const * fl_get_combox_text(FL_OBJECT * ob);
|
2000-02-04 09:38:32 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** \return the contents of \param line of the combox browser. */
|
|
|
|
FL_EXPORT char const * fl_get_combox_line(FL_OBJECT * ob, int line);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** \return the number of items in the combox browser. */
|
|
|
|
FL_EXPORT int fl_get_combox_maxitems(FL_OBJECT * ob);
|
2000-02-04 09:38:32 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** Show the browser */
|
|
|
|
void fl_show_combox_browser(FL_OBJECT * ob);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
/** Hide the browser */
|
|
|
|
void fl_hide_combox_browser(FL_OBJECT * ob);
|
2000-02-04 09:38:32 +00:00
|
|
|
|
2003-04-02 14:20:30 +00:00
|
|
|
#if defined(__cplusplus)
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
2003-04-02 14:20:30 +00:00
|
|
|
#endif
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#endif
|