Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

Spinner: A Numerical Value Entry

Provides a field for entering numerical values, along with buttons to increment and decrement the value. More...

Data Structures

struct  Ewl_Spinner
 Inherits from Ewl_Container and adds an entry box that can only contain numerical values as well as buttons for manipulating that value. More...


Defines

#define EWL_SPINNER(spinner)   ((Ewl_Spinner *) spinner)
 Typecasts a pointer to an Ewl_Spinner pointer.


Typedefs

typedef Ewl_Spinner Ewl_Spinner
 A combination of entry and increment/decrement buttons for adjusting numerical values.


Functions

Ewl_Widgetewl_spinner_new (void)
 Allocate a new spinner widget.

int ewl_spinner_init (Ewl_Spinner *s)
 Initialize a spinner to default values and callbacks.

void ewl_spinner_value_set (Ewl_Spinner *s, double value)
 Set the current value of a spinner widget.

double ewl_spinner_value_get (Ewl_Spinner *s)
 Get the current value of a spinner widget.

void ewl_spinner_digits_set (Ewl_Spinner *s, unsigned char digits)
 Set the number of digits displayed by a spinner.

double ewl_spinner_min_val_get (Ewl_Spinner *s)
 Retrieves the minimum value for the spinner.

void ewl_spinner_min_val_set (Ewl_Spinner *s, double val)
 Set the minimum value possible for a spinner.

double ewl_spinner_max_val_get (Ewl_Spinner *s)
 Retrieves the maximum value for the spinner.

void ewl_spinner_max_val_set (Ewl_Spinner *s, double val)
 Set the maximum value possible for a spinner.

void ewl_spinner_step_set (Ewl_Spinner *s, double step)
 Returns no value. Set the increment between each click of the spinner.


Detailed Description

Provides a field for entering numerical values, along with buttons to increment and decrement the value.


Function Documentation

void ewl_spinner_digits_set Ewl_Spinner s,
unsigned char  digits
 

Set the number of digits displayed by a spinner.

Parameters:
s: the widget to change the number of digits displayed
digits: the number of digits to display for the spinner s
Returns:
Returns no value.
Changes the digits displayed by s to digits.

int ewl_spinner_init Ewl_Spinner s  ) 
 

Initialize a spinner to default values and callbacks.

Parameters:
s: the spinner to initialize
Returns:
Returns no value.
Sets the fields and callbacks of the spinner s their default values.

double ewl_spinner_max_val_get Ewl_Spinner s  ) 
 

Retrieves the maximum value for the spinner.

Parameters:
s: the spinner to retrieve maximum value
Returns:
Returns the currently set maximum value for the specified spinner.

void ewl_spinner_max_val_set Ewl_Spinner s,
double  val
 

Set the maximum value possible for a spinner.

Parameters:
s: the spinner to change the maximum possible value
val: the new maximum possible value for s
Returns:
Returns no value.
Sets the largest value that s can obtain to val.

double ewl_spinner_min_val_get Ewl_Spinner s  ) 
 

Retrieves the minimum value for the spinner.

Parameters:
s: the spinner to retrieve minimum value
Returns:
Returns the currently set minimum value for the specified spinner.

void ewl_spinner_min_val_set Ewl_Spinner s,
double  val
 

Set the minimum value possible for a spinner.

Parameters:
s: the spinner to change the minimum possible value
val: the new minimum possible value for s
Returns:
Returns no value.
Sets the smallest value that s can obtain to val.

Ewl_Widget* ewl_spinner_new void   ) 
 

Allocate a new spinner widget.

Returns:
Returns a new spinner widget on success, NULL on failure.

void ewl_spinner_step_set Ewl_Spinner s,
double  step
 

Returns no value. Set the increment between each click of the spinner.

Parameters:
s: the spinner to change increment step
step: the new increment between clicks of the spinner s

Changes the increment that s changes by with each click of it's spinner buttons to step.

double ewl_spinner_value_get Ewl_Spinner s  ) 
 

Get the current value of a spinner widget.

Parameters:
s: the spinner widget to retrieve the value
Returns:
Returns the current value in s on success, 0.0 on failure.

void ewl_spinner_value_set Ewl_Spinner s,
double  value
 

Set the current value of a spinner widget.

Parameters:
s: the spinner widget to set the current value
value: the value to set for the spinner s
Returns:
Returns no value.
Sets the current value of the spinner s to value.