FLTK 1.3.0
Fl_Input_Choice Class Reference

A combination of the input widget and a menu button. More...

#include <Fl_Input_Choice.H>

Inheritance diagram for Fl_Input_Choice:
Fl_Group Fl_Widget

List of all members.

Classes

class  InputMenuButton

Public Member Functions

void add (const char *s)
 Adds an item to the menu.
int changed () const
 Checks if the widget value changed since the last callback.
void clear ()
 Removes all items from the menu.
void clear_changed ()
 Marks the value of the widget as unchanged.
Fl_Boxtype down_box () const
 Gets the box type of the menu button.
void down_box (Fl_Boxtype b)
 Sets the box type of the menu button.
 Fl_Input_Choice (int x, int y, int w, int h, const char *l=0)
 Creates a new Fl_Input_Choice widget using the given position, size, and label string.
Fl_Inputinput ()
 Returns a reference to the internal Fl_Input widget.
const Fl_Menu_Itemmenu ()
 Gets the Fl_Menu_Item array used for the menu.
void menu (const Fl_Menu_Item *m)
 Sets the Fl_Menu_Item array used for the menu.
Fl_Menu_Buttonmenubutton ()
 Returns a reference to the internal Fl_Menu_Button widget.
void resize (int X, int Y, int W, int H)
 Resizes the Fl_Group widget and all of its children.
void set_changed ()
 Marks the value of the widget as changed.
Fl_Color textcolor () const
 Gets the encapsulated input text color attributes.
void textcolor (Fl_Color c)
 Sets the encapsulated input text color attributes.
Fl_Font textfont () const
 Gets the encapsulated input text font attributes.
void textfont (Fl_Font f)
 Sets the encapsulated input text font attributes.
Fl_Fontsize textsize () const
 Gets the encapsulated input size attributes.
void textsize (Fl_Fontsize s)
 Sets the encapsulated input size attributes.
const char * value () const
 See void Fl_Input_Choice::value(const char *s)
void value (const char *val)
 Sets or returns the input widget's current contents.
void value (int val)
 See void Fl_Input_Choice::value(const char *s)

Detailed Description

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.

The application can directly access both the input and menu widgets directly, using the menubutton() and input() accessor methods.


Constructor & Destructor Documentation

Fl_Input_Choice::Fl_Input_Choice ( int  x,
int  y,
int  w,
int  h,
const char *  l = 0 
) [inline]

Creates a new Fl_Input_Choice widget using the given position, size, and label string.

Inherited destructor Destroys the widget and any value associated with it.


Member Function Documentation

void Fl_Input_Choice::add ( const char *  s) [inline]

Adds an item to the menu.

int Fl_Input_Choice::changed ( ) const [inline]

Checks if the widget value changed since the last callback.

"Changed" is a flag that is turned on when the user changes the value stored in the widget. This is only used by subclasses of Fl_Widget that store values, but is in the base class so it is easier to scan all the widgets in a panel and do_callback() on the changed ones in response to an "OK" button.

Most widgets turn this flag off when they do the callback, and when the program sets the stored value.

Return values:
0if the value did not change
See also:
set_changed(), clear_changed()

Reimplemented from Fl_Widget.

void Fl_Input_Choice::clear ( ) [inline]

Removes all items from the menu.

Reimplemented from Fl_Group.

void Fl_Input_Choice::clear_changed ( ) [inline]

Marks the value of the widget as unchanged.

See also:
changed(), set_changed()

Reimplemented from Fl_Widget.

Fl_Input* Fl_Input_Choice::input ( ) [inline]

Returns a reference to the internal Fl_Input widget.

const Fl_Menu_Item* Fl_Input_Choice::menu ( ) [inline]

Gets the Fl_Menu_Item array used for the menu.

void Fl_Input_Choice::menu ( const Fl_Menu_Item m) [inline]

Sets the Fl_Menu_Item array used for the menu.

Fl_Menu_Button* Fl_Input_Choice::menubutton ( ) [inline]

Returns a reference to the internal Fl_Menu_Button widget.

void Fl_Input_Choice::resize ( int  X,
int  Y,
int  W,
int  H 
) [inline, virtual]

Resizes the Fl_Group widget and all of its children.

The Fl_Group widget first resizes itself, and then it moves and resizes all its children according to the rules documented for Fl_Group::resizable(Fl_Widget*)

See also:
Fl_Group::resizable(Fl_Widget*)
Fl_Group::resizable()
Fl_Widget::resize(int,int,int,int)

Reimplemented from Fl_Group.

void Fl_Input_Choice::set_changed ( ) [inline]

Marks the value of the widget as changed.

See also:
changed(), clear_changed()

Reimplemented from Fl_Widget.

void Fl_Input_Choice::value ( const char *  val) [inline]

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.


The documentation for this class was generated from the following file: