Vaca::SpinButton Class Reference

#include <SpinButton.h>

Inheritance diagram for Vaca::SpinButton:

Vaca::Widget Vaca::Component Vaca::Referenceable Vaca::NonCopyable

List of all members.


Detailed Description

A couple of buttons to up or down a value.

Win32 Specific:
This is a wrapper for the Up-Down(W32) control.

Public Member Functions

 SpinButton (Widget *parent, Style style=SpinButtonStyle)
 SpinButton (int minValue, int maxValue, int value, Widget *parent, Style style=SpinButtonStyle)
virtual ~SpinButton ()
bool isHorizontal ()
bool isVertical ()
int getMinimum ()
int getMaximum ()
void getRange (int &minValue, int &maxValue)
void setRange (int minValue, int maxValue)
int getValue ()
void setValue (int value)
int getBase ()
 Returns the radix base used in the buddy widget (an Edit generally).
void setBase (int base)
 Sets the radix base to be used in the buddy widget (an Edit generally).
WidgetgetBuddy ()
void setBuddy (Widget *buddy)

Public Attributes

Signal1< void, SpinButtonEvent & > Change

Protected Member Functions

virtual void onPreferredSize (Size &sz)
 It should calculates the preferred size for this widget.
virtual void onChange (SpinButtonEvent &ev)
virtual bool onReflectedNotify (LPNMHDR lpnmhdr, LRESULT &lResult)
 This method can be used to handle notifications (WM_NOTIFY(W32)) reflected from the parent.

Constructor & Destructor Documentation

SpinButton::SpinButton ( Widget parent,
Style  style = SpinButtonStyle 
)

SpinButton::SpinButton ( int  minValue,
int  maxValue,
int  value,
Widget parent,
Style  style = SpinButtonStyle 
)

SpinButton::~SpinButton (  )  [virtual]


Member Function Documentation

bool SpinButton::isHorizontal (  ) 

bool SpinButton::isVertical (  ) 

int SpinButton::getMinimum (  ) 

int SpinButton::getMaximum (  ) 

void SpinButton::getRange ( int &  minValue,
int &  maxValue 
)

void SpinButton::setRange ( int  minValue,
int  maxValue 
)

int SpinButton::getValue (  ) 

void SpinButton::setValue ( int  value  ) 

int SpinButton::getBase (  ) 

Returns the radix base used in the buddy widget (an Edit generally).

void SpinButton::setBase ( int  base  ) 

Sets the radix base to be used in the buddy widget (an Edit generally).

This can be 10 for decimal or 16 for hexadecimal.

Widget * SpinButton::getBuddy (  ) 

void SpinButton::setBuddy ( Widget buddy  ) 

void SpinButton::onPreferredSize ( Size sz  )  [protected, virtual]

It should calculates the preferred size for this widget.

Parameters:
sz It's for input and output. You should put the preferred size in this value, but also you should read the input value to know if you must to fit the widget in some size. The possible values for sz are:
  • sz = Size(0, 0) to calculate the preferred size without restrictions.
  • sz = Size(width, 0) to calculate the preferred size with restricted <= width.
  • sz = Size(0, height) to calculate the preferred size with restricted <= height.

Reimplemented from Vaca::Widget.

void SpinButton::onChange ( SpinButtonEvent ev  )  [protected, virtual]

bool SpinButton::onReflectedNotify ( LPNMHDR  lpnmhdr,
LRESULT &  lResult 
) [protected, virtual]

This method can be used to handle notifications (WM_NOTIFY(W32)) reflected from the parent.

Parameters:
lpnmhdr Information about the notification message.
lResult Result to return by the wndProc method.
Returns:
False if it doesn't use the notification.

Reimplemented from Vaca::Widget.


Member Data Documentation