FloatInput Class Reference

Inherits NumericInput.

Inherited by IntInput.

List of all members.

Public Types

enum  { FLOAT, INT }

Public Member Functions

 FloatInput (int x, int y, int w, int h, const char *l=0)
long lvalue () const
int ivalue () const
double fvalue () const


Detailed Description

A subclass of NumericInput that only allows the user to type floating point numbers (sign, digits, decimal point, more digits, 'E' or 'e', sign, digits), or hex constants that start with "0x". This is done by overriding the replace() method. Besides editing the text the user can use the up/down arrow keys to change the digits.

You may want a ValueInput widget instead. It has up/down buttons (what is called a "Spinner" in some toolkits).

If you change when() to WHEN_ENTER_KEY the callback is only done when the user hits the up/down arrow keys or when the user types the Enter key. This may be more useful than the default setting of WHEN_CHANGED which can make the callback happen when partially-edited numbers are in the field.

The type() can either be either FloatInput::FLOAT or FloatInput::INT. Setting it to INT makes this act like the IntInput subclass.


Member Function Documentation

double FloatInput::fvalue  )  const
 

Convert the string to a double using strtod()

long FloatInput::lvalue  )  const
 

Convert the string to a long using strtol()


The documentation for this class was generated from the following files:
Sun Jan 7 00:55:17 2007. FLTK ©2006 Bill Spitzak and others.
Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.