~Combox();
/** To add this object to a form. Note that there are two heights
- for normal (button) and expanded (browser) mode each.
+ for normal (button) and expanded (browser) mode each.
+ The optional tabfolder arguments are needed to overcome an
+ xforms bug when repositioning a combox in a tab folder.
+ tabfolder1_ is the folder holding the combox.
+ If using nested tabfolders, tabfolder2_ is the "base" folder
+ holding tabfolder1_.
*/
- void add(int x, int y, int w, int hmin, int hmax);
+ void add(int x, int y, int w, int hmin, int hmax,
+ FL_OBJECT * tabfolder1_ = 0, FL_OBJECT * tabfolder2_ = 0);
/// Add lines. Same as for fl_browser object
void addline(string const &);
void addto(string const &);
/// Returns the selected item
- int get();
+ int get() const;
/// Returns a pointer to the selected line of text
- string const getline();
+ string const getline() const;
/// Select an arbitrary item
void select(int);
void clear();
/// Is the combox cleared (empty)
- bool empty() { return is_empty; }
+ bool empty() const { return is_empty; }
/// Remove the objects from the form they are in.
void remove();
///
combox_type type;
///
- int bw, bh;
+ int bw;
+ ///
+ int bh;
///
int sel;
///
FL_OBJECT * label;
///
FL_FORM* form;
+ ///
+ FL_OBJECT * tabfolder1;
+ ///
+ FL_OBJECT * tabfolder2;
};
inline
-int Combox::get()
+int Combox::get() const
{
return sel;
}
inline
-string const Combox::getline()
+string const Combox::getline() const
{
if (type == FL_COMBOX_INPUT)
return fl_get_input(label);
else
- return (browser && sel > 0) ? fl_get_browser_line(browser, sel) : string();
+ return (browser && sel > 0) ?
+ string(fl_get_browser_line(browser, sel)) : string();
}
#endif