golib  0.5
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
goGUI::VectorInput Class Reference

Input for a vector. More...

#include <vectorinput.h>

Public Member Functions

 VectorInput (const char *title=0, int n=4, int direction=0)
 Constructor. More...
 
void getVector (goVectorf &v) const
 Get the vector. More...
 
void getVector (goVectord &v) const
 Get the vector. More...
 
void setVector (const goVectorf &v)
 Set the vector values. More...
 
void setVector (const goVectord &v)
 Set the vector values. More...
 
void setDigits (int d)
 Set the number of digits shown. More...
 
void setRange (double low, double high, double step=0.1, double large_step=1.0)
 Set the value range. More...
 
void valueChangedSlot ()
 Called when a value changed. More...
 
void connectAll ()
 Connects all input elements to the valueChangedSlot() method.
 
void disconnectAll ()
 Disconnects all input elements so no signals are sent on change.
 
sigc::signal< void > & signalChanged ()
 Emitted each time an input element changes. More...
 

Detailed Description

Input for a vector.

For each entry in the vector, a spin button is created. Each time an entry changes, signalChanged() is emitted.

Constructor & Destructor Documentation

◆ VectorInput()

goGUI::VectorInput::VectorInput ( const char *  title = 0,
int  n = 4,
int  direction = 0 
)

Constructor.

Parameters
titleTitle shown in the frame around the input (default: 0)
nNumber of elements in the vector (default: 4)
directionIf 0, elements are laid out horizontally (default), otherwise they are laid out vertically.

Member Function Documentation

◆ getVector() [1/2]

void goGUI::VectorInput::getVector ( goVectord v) const

Get the vector.

Parameters
vOn return, contains the vector elements. If its size does not match the number of input elements, v will be resized.

◆ getVector() [2/2]

void goGUI::VectorInput::getVector ( goVectorf v) const

Get the vector.

Parameters
vOn return, contains the vector elements. If its size does not match the number of input elements, v will be resized.

◆ setDigits()

void goGUI::VectorInput::setDigits ( int  d)

Set the number of digits shown.

Parameters
dNumber of digits shown in the input elements.

◆ setRange()

void goGUI::VectorInput::setRange ( double  low,
double  high,
double  step = 0.1,
double  large_step = 1.0 
)

Set the value range.

All values are for all the input elements. If setRange is not called, the minimal and maximal values of the double type are used, and 0.01 and 0.1 are used as steps.

Parameters
lowMinimal value
highMaximal value
stepStep
large_stepPage step

◆ setVector() [1/2]

void goGUI::VectorInput::setVector ( const goVectord v)

Set the vector values.

Parameters
vThe vector. If v.getSize() is larger than the number of input elements, only the values of v up to the number of input elements are used.

◆ setVector() [2/2]

void goGUI::VectorInput::setVector ( const goVectorf v)

Set the vector values.

Parameters
vThe vector. If v.getSize() is larger than the number of input elements, only the values of v up to the number of input elements are used.

◆ signalChanged()

sigc::signal< void > & goGUI::VectorInput::signalChanged ( )

Emitted each time an input element changes.

Returns

◆ valueChangedSlot()

void goGUI::VectorInput::valueChangedSlot ( )

Called when a value changed.

Emits the signalChanged() signal.


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