fltk  1.3.5-source
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
  Fossies Dox: fltk-1.3.5-source.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Fl_Spinner Class Reference

#include <Fl_Spinner.H>

Inheritance diagram for Fl_Spinner:
[legend]
Collaboration diagram for Fl_Spinner:
[legend]

Public Member Functions

 Fl_Spinner (int X, int Y, int W, int H, const char *L=0)
 
const char * format ()
 
void format (const char *f)
 
int handle (int event)
 
double maxinum () const
 
double maximum () const
 
void maximum (double m)
 
double mininum () const
 
double minimum () const
 
void minimum (double m)
 
void range (double a, double b)
 
void resize (int X, int Y, int W, int H)
 
double step () const
 
void step (double s)
 
Fl_Color textcolor () const
 
void textcolor (Fl_Color c)
 
Fl_Font textfont () const
 
void textfont (Fl_Font f)
 
Fl_Fontsize textsize () const
 
void textsize (Fl_Fontsize s)
 
uchar type () const
 
void type (uchar v)
 
double value () const
 
void value (double v)
 
void color (Fl_Color v)
 
Fl_Color color () const
 
void selection_color (Fl_Color val)
 
Fl_Color selection_color () const
 
- Public Member Functions inherited from Fl_Group
void begin ()
 
void end ()
 
int children () const
 
Fl_Widgetchild (int n) const
 
int find (const Fl_Widget *) const
 
int find (const Fl_Widget &o) const
 
Fl_Widget *constarray () const
 
 Fl_Group (int, int, int, int, const char *=0)
 
virtual ~Fl_Group ()
 
void add (Fl_Widget &)
 
void add (Fl_Widget *o)
 
void insert (Fl_Widget &, int i)
 
void insert (Fl_Widget &o, Fl_Widget *before)
 
void remove (int index)
 
void remove (Fl_Widget &)
 
void remove (Fl_Widget *o)
 
void clear ()
 
void resizable (Fl_Widget &o)
 
void resizable (Fl_Widget *o)
 
Fl_Widgetresizable () const
 
void add_resizable (Fl_Widget &o)
 
void init_sizes ()
 
void clip_children (int c)
 
unsigned int clip_children ()
 
virtual Fl_Groupas_group ()
 
void focus (Fl_Widget *W)
 
Fl_Widget *& _ddfdesign_kludge ()
 
void forms_end ()
 
- Public Member Functions inherited from Fl_Widget
virtual ~Fl_Widget ()
 
int is_label_copied () const
 
Fl_Groupparent () const
 
void parent (Fl_Group *p)
 
uchar type () const
 
void type (uchar t)
 
int x () const
 
int y () const
 
int w () const
 
int h () const
 
int damage_resize (int, int, int, int)
 
void position (int X, int Y)
 
void size (int W, int H)
 
Fl_Align align () const
 
void align (Fl_Align alignment)
 
Fl_Boxtype box () const
 
void box (Fl_Boxtype new_box)
 
Fl_Color color () const
 
void color (Fl_Color bg)
 
Fl_Color selection_color () const
 
void selection_color (Fl_Color a)
 
void color (Fl_Color bg, Fl_Color sel)
 
const char * label () const
 
void label (const char *text)
 
void copy_label (const char *new_label)
 
void label (Fl_Labeltype a, const char *b)
 
Fl_Labeltype labeltype () const
 
void labeltype (Fl_Labeltype a)
 
Fl_Color labelcolor () const
 
void labelcolor (Fl_Color c)
 
Fl_Font labelfont () const
 
void labelfont (Fl_Font f)
 
Fl_Fontsize labelsize () const
 
void labelsize (Fl_Fontsize pix)
 
Fl_Imageimage ()
 
const Fl_Imageimage () const
 
void image (Fl_Image *img)
 
void image (Fl_Image &img)
 
Fl_Imagedeimage ()
 
const Fl_Imagedeimage () const
 
void deimage (Fl_Image *img)
 
void deimage (Fl_Image &img)
 
const char * tooltip () const
 
void tooltip (const char *text)
 
void copy_tooltip (const char *text)
 
Fl_Callback_p callback () const
 
void callback (Fl_Callback *cb, void *p)
 
void callback (Fl_Callback *cb)
 
void callback (Fl_Callback0 *cb)
 
void callback (Fl_Callback1 *cb, long p=0)
 
void * user_data () const
 
void user_data (void *v)
 
long argument () const
 
void argument (long v)
 
Fl_When when () const
 
void when (uchar i)
 
unsigned int visible () const
 
int visible_r () const
 
virtual void show ()
 
virtual void hide ()
 
void set_visible ()
 
void clear_visible ()
 
unsigned int active () const
 
int active_r () const
 
void activate ()
 
void deactivate ()
 
unsigned int output () const
 
void set_output ()
 
void clear_output ()
 
unsigned int takesevents () const
 
unsigned int changed () const
 
void set_changed ()
 
void clear_changed ()
 
void clear_active ()
 
void set_active ()
 
int take_focus ()
 
void set_visible_focus ()
 
void clear_visible_focus ()
 
void visible_focus (int v)
 
unsigned int visible_focus ()
 
void do_callback ()
 
void do_callback (Fl_Widget *o, long arg)
 
void do_callback (Fl_Widget *o, void *arg=0)
 
int test_shortcut ()
 
void _set_fullscreen ()
 
void _clear_fullscreen ()
 
int contains (const Fl_Widget *w) const
 
int inside (const Fl_Widget *wgt) const
 
void redraw ()
 
void redraw_label ()
 
uchar damage () const
 
void clear_damage (uchar c=0)
 
void damage (uchar c)
 
void damage (uchar c, int x, int y, int w, int h)
 
void draw_label (int, int, int, int, Fl_Align) const
 
void measure_label (int &ww, int &hh) const
 
Fl_Windowwindow () const
 
Fl_Windowtop_window () const
 
Fl_Windowtop_window_offset (int &xoff, int &yoff) const
 
virtual Fl_Windowas_window ()
 
virtual class Fl_Gl_Windowas_gl_window ()
 
int use_accents_menu ()
 
Fl_Color color2 () const
 
void color2 (unsigned a)
 

Private Member Functions

void update ()
 

Static Private Member Functions

static void sb_cb (Fl_Widget *w, Fl_Spinner *sb)
 

Private Attributes

double value_
 
double minimum_
 
double maximum_
 
double step_
 
const char * format_
 
Fl_Input input_
 
Fl_Repeat_Button up_button_
 
Fl_Repeat_Button down_button_
 

Additional Inherited Members

- Static Public Member Functions inherited from Fl_Group
static Fl_Groupcurrent ()
 
static void current (Fl_Group *g)
 
- Static Public Member Functions inherited from Fl_Widget
static void default_callback (Fl_Widget *cb, void *d)
 
static unsigned int label_shortcut (const char *t)
 
static int test_shortcut (const char *, const bool require_alt=false)
 
- Protected Types inherited from Fl_Widget
enum  {
  INACTIVE = 1<<0, INVISIBLE = 1<<1, OUTPUT = 1<<2, NOBORDER = 1<<3,
  FORCE_POSITION = 1<<4, NON_MODAL = 1<<5, SHORTCUT_LABEL = 1<<6, CHANGED = 1<<7,
  OVERRIDE = 1<<8, VISIBLE_FOCUS = 1<<9, COPIED_LABEL = 1<<10, CLIP_CHILDREN = 1<<11,
  MENU_WINDOW = 1<<12, TOOLTIP_WINDOW = 1<<13, MODAL = 1<<14, NO_OVERLAY = 1<<15,
  GROUP_RELATIVE = 1<<16, COPIED_TOOLTIP = 1<<17, FULLSCREEN = 1<<18, MAC_USE_ACCENTS_MENU = 1<<19,
  USERFLAG3 = 1<<29, USERFLAG2 = 1<<30, USERFLAG1 = 1<<31
}
 
- Protected Member Functions inherited from Fl_Group
void draw ()
 
void draw_child (Fl_Widget &widget) const
 
void draw_children ()
 
void draw_outside_label (const Fl_Widget &widget) const
 
void update_child (Fl_Widget &widget) const
 
int * sizes ()
 
- Protected Member Functions inherited from Fl_Widget
 Fl_Widget (int x, int y, int w, int h, const char *label=0L)
 
void x (int v)
 
void y (int v)
 
void w (int v)
 
void h (int v)
 
unsigned int flags () const
 
void set_flag (unsigned int c)
 
void clear_flag (unsigned int c)
 
void draw_box () const
 
void draw_box (Fl_Boxtype t, Fl_Color c) const
 
void draw_box (Fl_Boxtype t, int x, int y, int w, int h, Fl_Color c) const
 
void draw_backdrop () const
 
void draw_focus ()
 
void draw_focus (Fl_Boxtype t, int x, int y, int w, int h) const
 
void draw_label () const
 
void draw_label (int, int, int, int) const
 

Detailed Description

This widget is a combination of the input widget and repeat buttons. The user can either type into the input area or use the buttons to change the value.

Fl_Spinner widget

Definition at line 45 of file Fl_Spinner.H.

Constructor & Destructor Documentation

◆ Fl_Spinner()

Fl_Spinner::Fl_Spinner ( int  X,
int  Y,
int  W,
int  H,
const char *  L = 0 
)

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

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

Definition at line 851 of file Fl_Group.cxx.

References Fl_Widget::align(), Fl_Widget::callback(), down_button_, Fl_Group::end(), FL_ALIGN_LEFT, FL_INT_INPUT, FL_WHEN_ENTER_KEY, FL_WHEN_RELEASE, format_, input_, maximum_, minimum_, sb_cb(), step_, Fl_Widget::type(), up_button_, Fl_Input_::value(), value_, and Fl_Widget::when().

Member Function Documentation

◆ color() [1/2]

Fl_Color Fl_Spinner::color ( ) const
inline

Return the background color of the spinner widget's input field.

Definition at line 244 of file Fl_Spinner.H.

References Fl_Widget::color().

◆ color() [2/2]

void Fl_Spinner::color ( Fl_Color  v)
inline

Change the background color of the spinner widget's input field.

Definition at line 240 of file Fl_Spinner.H.

References Fl_Widget::color().

Referenced by Fl_Widget_Type::write_widget_code().

◆ format() [1/2]

const char* Fl_Spinner::format ( )
inline

Sets or returns the format string for the value.

Definition at line 128 of file Fl_Spinner.H.

◆ format() [2/2]

void Fl_Spinner::format ( const char *  f)
inline

Sets or returns the format string for the value.

Definition at line 130 of file Fl_Spinner.H.

References f.

◆ handle()

int Fl_Spinner::handle ( int  event)
inlinevirtual

Handles the specified event. You normally don't call this method directly, but instead let FLTK do it when the user interacts with the widget.

When implemented in a widget, this function must return 0 if the widget does not use the event or 1 otherwise.

Most of the time, you want to call the inherited handle() method in your overridden method so that you don't short-circuit events that you don't handle. In this last case you should return the callee retval.

Parameters
[in]eventthe kind of event received
Return values
0if the event was not used or understood
1if the event was used and can be deleted
See also
Fl_Event

Reimplemented from Fl_Group.

Definition at line 132 of file Fl_Spinner.H.

References Fl::event_key(), FL_Down, FL_FOCUS, FL_KEYDOWN, FL_SHORTCUT, FL_Up, Fl_Group::handle(), and Fl_Widget::take_focus().

◆ maximum() [1/2]

double Fl_Spinner::maximum ( ) const
inline

Gets the maximum value of the widget.

Definition at line 155 of file Fl_Spinner.H.

Referenced by Fl_Widget_Type::copy_properties(), make_settings_window(), Fl_Widget_Type::write_properties(), and Fl_Widget_Type::write_widget_code().

◆ maximum() [2/2]

void Fl_Spinner::maximum ( double  m)
inline

Sets the maximum value of the widget.

Definition at line 157 of file Fl_Spinner.H.

◆ maxinum()

double Fl_Spinner::maxinum ( ) const
inline

Speling mistakes retained for source compatibility

Deprecated:

Definition at line 153 of file Fl_Spinner.H.

◆ minimum() [1/2]

double Fl_Spinner::minimum ( ) const
inline

Gets the minimum value of the widget.

Definition at line 161 of file Fl_Spinner.H.

Referenced by Fl_Widget_Type::copy_properties(), Fl_Widget_Type::write_properties(), and Fl_Widget_Type::write_widget_code().

◆ minimum() [2/2]

void Fl_Spinner::minimum ( double  m)
inline

Sets the minimum value of the widget.

Definition at line 163 of file Fl_Spinner.H.

◆ mininum()

double Fl_Spinner::mininum ( ) const
inline

Speling mistakes retained for source compatibility

Deprecated:

Definition at line 159 of file Fl_Spinner.H.

◆ range()

void Fl_Spinner::range ( double  a,
double  b 
)
inline

Sets the minimum and maximum values for the widget.

Definition at line 165 of file Fl_Spinner.H.

References b.

◆ resize()

void Fl_Spinner::resize ( int  X,
int  Y,
int  W,
int  H 
)
inlinevirtual

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.

Definition at line 166 of file Fl_Spinner.H.

References H, Fl_Group::resize(), Fl_Input_::resize(), and Y.

◆ sb_cb()

static void Fl_Spinner::sb_cb ( Fl_Widget w,
Fl_Spinner sb 
)
inlinestaticprivate

◆ selection_color() [1/2]

Fl_Color Fl_Spinner::selection_color ( ) const
inline

Return the selection color of the spinner widget's input field.

Definition at line 252 of file Fl_Spinner.H.

References Fl_Widget::selection_color().

◆ selection_color() [2/2]

void Fl_Spinner::selection_color ( Fl_Color  val)
inline

Change the selection color of the spinner widget's input field.

Definition at line 248 of file Fl_Spinner.H.

References Fl_Widget::selection_color().

Referenced by Fl_Widget_Type::write_widget_code().

◆ step() [1/2]

double Fl_Spinner::step ( ) const
inline

Sets or returns the amount to change the value when the user clicks a button. Before setting step to a non-integer value, the spinner type() should be changed to floating point.

Definition at line 179 of file Fl_Spinner.H.

Referenced by Fl_Widget_Type::copy_properties(), Fl_Widget_Type::write_properties(), and Fl_Widget_Type::write_widget_code().

◆ step() [2/2]

void Fl_Spinner::step ( double  s)
inline

See double Fl_Spinner::step() const

Definition at line 181 of file Fl_Spinner.H.

References FL_FLOAT_INPUT, FL_INT_INPUT, and Fl_Widget::type().

◆ textcolor() [1/2]

Fl_Color Fl_Spinner::textcolor ( ) const
inline

Gets the color of the text in the input field.

Definition at line 188 of file Fl_Spinner.H.

References Fl_Input_::textcolor().

Referenced by Fl_Spinner_Type::textstuff().

◆ textcolor() [2/2]

void Fl_Spinner::textcolor ( Fl_Color  c)
inline

Sets the color of the text in the input field.

Definition at line 192 of file Fl_Spinner.H.

References Fl_Input_::textcolor().

◆ textfont() [1/2]

Fl_Font Fl_Spinner::textfont ( ) const
inline

Gets the font of the text in the input field.

Definition at line 196 of file Fl_Spinner.H.

References Fl_Input_::textfont().

Referenced by Fl_Spinner_Type::ideal_size(), and Fl_Spinner_Type::textstuff().

◆ textfont() [2/2]

void Fl_Spinner::textfont ( Fl_Font  f)
inline

Sets the font of the text in the input field.

Definition at line 200 of file Fl_Spinner.H.

References f, and Fl_Input_::textfont().

◆ textsize() [1/2]

Fl_Fontsize Fl_Spinner::textsize ( ) const
inline

Gets the size of the text in the input field.

Definition at line 204 of file Fl_Spinner.H.

References Fl_Input_::textsize().

Referenced by Fl_Spinner_Type::ideal_size(), and Fl_Spinner_Type::textstuff().

◆ textsize() [2/2]

void Fl_Spinner::textsize ( Fl_Fontsize  s)
inline

Sets the size of the text in the input field.

Definition at line 208 of file Fl_Spinner.H.

References Fl_Input_::textsize().

◆ type() [1/2]

uchar Fl_Spinner::type ( ) const
inline

Gets the numeric representation in the input field.

See also
Fl_Spinner::type(uchar)

Definition at line 214 of file Fl_Spinner.H.

References Fl_Widget::type().

Referenced by Fl_Widget_Type::write_widget_code().

◆ type() [2/2]

void Fl_Spinner::type ( uchar  v)
inline

Sets the numeric representation in the input field. Valid values are FL_INT_INPUT and FL_FLOAT_INPUT. Also changes the format() template. Setting a new spinner type via a superclass pointer will not work.

Note
type is not a virtual function.

Definition at line 221 of file Fl_Spinner.H.

References FL_FLOAT_INPUT, and Fl_Widget::type().

◆ update()

void Fl_Spinner::update ( )
inlineprivate

Definition at line 98 of file Fl_Spinner.H.

References Fl_Input_::value().

Referenced by sb_cb().

◆ value() [1/2]

double Fl_Spinner::value ( ) const
inline

◆ value() [2/2]

void Fl_Spinner::value ( double  v)
inline

Sets the current value of the widget. Before setting value to a non-integer value, the spinner type() should be changed to floating point.

Definition at line 236 of file Fl_Spinner.H.

Member Data Documentation

◆ down_button_

Fl_Repeat_Button Fl_Spinner::down_button_
private

Definition at line 59 of file Fl_Spinner.H.

Referenced by Fl_Spinner(), and sb_cb().

◆ format_

const char* Fl_Spinner::format_
private

Definition at line 51 of file Fl_Spinner.H.

Referenced by Fl_Spinner().

◆ input_

Fl_Input Fl_Spinner::input_
private

Definition at line 57 of file Fl_Spinner.H.

Referenced by Fl_Spinner(), and sb_cb().

◆ maximum_

double Fl_Spinner::maximum_
private

Definition at line 49 of file Fl_Spinner.H.

Referenced by Fl_Spinner(), and sb_cb().

◆ minimum_

double Fl_Spinner::minimum_
private

Definition at line 48 of file Fl_Spinner.H.

Referenced by Fl_Spinner(), and sb_cb().

◆ step_

double Fl_Spinner::step_
private

Definition at line 50 of file Fl_Spinner.H.

Referenced by Fl_Spinner(), and sb_cb().

◆ up_button_

Fl_Repeat_Button Fl_Spinner::up_button_
private

Definition at line 59 of file Fl_Spinner.H.

Referenced by Fl_Spinner(), and sb_cb().

◆ value_

double Fl_Spinner::value_
private

Definition at line 47 of file Fl_Spinner.H.

Referenced by Fl_Spinner(), and sb_cb().


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