summaryrefslogtreecommitdiff
path: root/FL/Fl_Input_Choice.H
diff options
context:
space:
mode:
authorFabien Costantini <fabien@onepost.net>2008-09-15 11:10:51 +0000
committerFabien Costantini <fabien@onepost.net>2008-09-15 11:10:51 +0000
commit8701883e54d4e7e842d4cb27c17019c03cd33f55 (patch)
treeef86259413498fce96df97ea1decedc7e30515a6 /FL/Fl_Input_Choice.H
parentb9ca1333769f87c029430a9d14a7a9937d400f93 (diff)
Doxygen documentation WP9 Done.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6251 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Input_Choice.H')
-rw-r--r--FL/Fl_Input_Choice.H104
1 files changed, 59 insertions, 45 deletions
diff --git a/FL/Fl_Input_Choice.H b/FL/Fl_Input_Choice.H
index be502a1d3..5f9161602 100644
--- a/FL/Fl_Input_Choice.H
+++ b/FL/Fl_Input_Choice.H
@@ -30,6 +30,8 @@
// http://www.fltk.org/str.php
//
+
+
#ifndef Fl_Input_Choice_H
#define Fl_Input_Choice_H
@@ -40,6 +42,17 @@
#include <FL/fl_draw.H>
#include <string.h>
+/**
+ A combination of the input widget and a menu button.
+ The user can either type into the input area, or use the
+ menu button chooser on the right, which loads the input area
+ with predefined text. Normally it is drawn with an inset box
+ and a white background.
+ <P>
+ The application can directly access both the input and menu
+ widgets directly, using the menubutton()
+ and input() accessor methods.
+*/
class Fl_Input_Choice : public Fl_Group {
// Private class to handle slightly 'special' behavior of menu button
class InputMenuButton : public Fl_Menu_Button {
@@ -112,6 +125,11 @@ class Fl_Input_Choice : public Fl_Group {
inline int menu_h() { return(h() - Fl::box_dh(box())); }
public:
+ /**
+ Creates a new Fl_Input_Choice widget using the given position, size,
+ and label string.
+ <P> Inherited destructor Destroys the widget and any value associated with it.
+ */
Fl_Input_Choice (int x,int y,int w,int h,const char*l=0) : Fl_Group(x,y,w,h,l) {
Fl_Group::box(FL_DOWN_BOX);
align(FL_ALIGN_LEFT); // default like Fl_Input
@@ -126,12 +144,10 @@ public:
menu_->box(FL_FLAT_BOX); // cosmetic
end();
}
- void add(const char *s) {
- menu_->add(s);
- }
- int changed() const {
- return inp_->changed() | Fl_Widget::changed();
- }
+
+ /** Adds an item to the menu.*/
+ void add(const char *s) { menu_->add(s); }
+ int changed() const { return inp_->changed() | Fl_Widget::changed();}
void clear_changed() {
inp_->clear_changed();
Fl_Widget::clear_changed();
@@ -140,55 +156,53 @@ public:
inp_->set_changed();
// no need to call Fl_Widget::set_changed()
}
- void clear() {
- menu_->clear();
- }
- Fl_Boxtype down_box() const {
- return (menu_->down_box());
- }
- void down_box(Fl_Boxtype b) {
- menu_->down_box(b);
- }
- const Fl_Menu_Item *menu() {
- return (menu_->menu());
- }
- void menu(const Fl_Menu_Item *m) {
- menu_->menu(m);
- }
+ /** Removes all items from the menu. */
+ void clear() { menu_->clear(); }
+ /** Gets the box type of the menu button */
+ Fl_Boxtype down_box() const { return (menu_->down_box()); }
+ /** Sets the box type of the menu button */
+ void down_box(Fl_Boxtype b) { menu_->down_box(b); }
+ /** Gets the Fl_Menu_Item array used for the menu. */
+ const Fl_Menu_Item *menu() { return (menu_->menu()); }
+ /** Sets the Fl_Menu_Item array used for the menu. */
+ void menu(const Fl_Menu_Item *m) { menu_->menu(m); }
void resize(int X, int Y, int W, int H) {
Fl_Group::resize(X,Y,W,H);
inp_->resize(inp_x(), inp_y(), inp_w(), inp_h());
menu_->resize(menu_x(), menu_y(), menu_w(), menu_h());
}
- Fl_Color textcolor() const {
- return (inp_->textcolor());
- }
- void textcolor(Fl_Color c) {
- inp_->textcolor(c);
- }
- Fl_Font textfont() const {
- return (inp_->textfont());
- }
- void textfont(Fl_Font f) {
- inp_->textfont(f);
- }
- Fl_Fontsize textsize() const {
- return (inp_->textsize());
- }
- void textsize(Fl_Fontsize s) {
- inp_->textsize(s);
- }
- const char* value() const {
- return (inp_->value());
- }
- void value(const char *val) {
- inp_->value(val);
- }
+ /** Gets the encapsulated input text color attributes */
+ Fl_Color textcolor() const { return (inp_->textcolor());}
+ /** Sets the encapsulated input text color attributes */
+ void textcolor(Fl_Color c) { inp_->textcolor(c);}
+ /** Gets the encapsulated input text font attributes */
+ Fl_Font textfont() const { return (inp_->textfont());}
+ /** Sets the encapsulated input text font attributes */
+ void textfont(Fl_Font f) { inp_->textfont(f);}
+ /** Gets the encapsulated input size attributes */
+ Fl_Fontsize textsize() const { return (inp_->textsize()); }
+ /** Sets the encapsulated input size attributes */
+ void textsize(Fl_Fontsize s) { inp_->textsize(s); }
+ /** See void Fl_Input_Choice::value(const char *s) */
+ const char* value() const { return (inp_->value()); }
+ /**
+ Sets or returns the input widget's current contents. The
+ second form sets the contents using the index into the menu
+ which you can set as an integer. Setting the value effectively
+ 'chooses' this menu item, and sets it as the new input text,
+ deleting the previous text.
+ */
+ void value(const char *val) { inp_->value(val); }
+ /** See void Fl_Input_Choice::value(const char *s) */
void value(int val) {
menu_->value(val);
inp_->value(menu_->text(val));
}
+ /** Returns a reference to the internal Fl_Menu_Button widget. */
Fl_Menu_Button *menubutton() { return menu_; }
+ /**
+ Returns a reference to the internal Fl_Input widget.</p>
+ */
Fl_Input *input() { return inp_; }
};