SkyGI::Button Class Reference

Inheritance diagram for SkyGI::Button:
[legend]
Collaboration diagram for SkyGI::Button:
[legend]
List of all members.

Public Member Functions

 Button (Window *pParent, const Point pPos, const String &pLabel, unsigned int nWindowLayoutFlags, MessageCommand *pMessage=NULL)
 Button (Window *pParent, const Rect rFrame, const String &pLabel, unsigned int nWindowLayoutFlags, MessageCommand *pMessage=NULL)
 ~Button ()
virtual void MouseDown (const InputEvent &nInputEvent)
virtual void MouseUp (const InputEvent &nInputEvent)
virtual void MouseEnter (const InputEvent &nInputEvent)
virtual void MouseLeave (const InputEvent &nInputEvent)
virtual bool FocusLost ()
virtual void Paint (const Rect &rDirty)
virtual void OnClicked (const InputEvent &nInputEvent)
virtual bool IsDown ()
virtual bool IsHover ()
virtual String GetCaption ()
virtual void SetCaption (const String &cString)
Point GetSizeHint (enumSizeHint nSizeHint)
void KeyDown (const InputEvent &nInputEvent)
void KeyUp (const InputEvent &nInputEvent)
void Enable (bool bEnable)
void SetTextFlags (TextFlags nTextFlags)
TextFlags GetTextFlags ()
void SetImage (Image *pImage, int iImageSpacing=5)
void KeepImage (bool bKeep)
ImageGetImage ()
void SetTextColor (Color nTextColor)
MessageCommandGetMessageCommand ()

Public Attributes

signal0 Clicked
signal1< const InputEvent & > ClickedEvent

Classes

class  Private

Detailed Description

Examples:

button.cpp, listview.cpp, messagebox.cpp, splitter.cpp, tabview.cpp, and textview.cpp.


Constructor & Destructor Documentation

Button::Button ( Window pParent,
const Point  pPos,
const String pLabel,
unsigned int  nWindowLayoutFlags,
MessageCommand pMessage = NULL 
)

Button::Button ( Window pParent,
const Rect  rFrame,
const String pLabel,
unsigned int  nWindowLayoutFlags,
MessageCommand pMessage = NULL 
)

Button::~Button (  ) 


Member Function Documentation

void Button::MouseDown ( const InputEvent nInputEvent  )  [virtual]

Mouse pressed

Description:
This function gets called when a mouse press occured inside this window.
Overload this member function to react on mouse presses.
Parameters:
nButton - MouseButton which was pressed
nMouseButtonMask - Mask showing which mouse buttons were pressed when the mouse press occured
nInputEvent - INPUT_EVENT_MOUSE_PRESS for a single and INPUTE_EVENT_MOUSE_DOUBLECLICK for a doubleclick

Reimplemented from SkyGI::Window.

Reimplemented in SkyGI::ImageButton.

void Button::MouseUp ( const InputEvent nInputEvent  )  [virtual]

Mouse release

Description:
This function gets called when a mouse release occured inside this window.
Overload this member function to react on mouse releases.
Parameters:
nButton - MouseButton which was released
nMouseButtonMask - Mask showing which additional mouse buttons were pressed when the mouse release occured
nInputEvent - INPUT_EVENT_MOUSE_RELEASE

Reimplemented from SkyGI::Window.

Reimplemented in SkyGI::ImageButton.

void Button::MouseEnter ( const InputEvent nInputEvent  )  [virtual]

Mouse enter

Description:
This function gets called when the mouse first enters the window.
Overload this member function to react on mouse enter events.
Parameters:
pPosEnter - Position the mouse cursor entered the window
nMouseButtonMask - Mask showing which mouse buttons were pressed when the mouse enter occured

Reimplemented from SkyGI::Window.

Reimplemented in SkyGI::ImageButton.

void Button::MouseLeave ( const InputEvent nInputEvent  )  [virtual]

Mouse leave

Description:
This function gets called when the mouse leaves the window.
Overload this member function to react on mouse leave events.
Parameters:
pPosLeave - Position the mouse cursor leaved the window at
nMouseButtonMask - Mask showing which mouse buttons were pressed when the mouse leave occured

Reimplemented from SkyGI::Window.

Reimplemented in SkyGI::ImageButton.

bool Button::FocusLost (  )  [virtual]

Reimplemented from SkyGI::Window.

Reimplemented in SkyGI::ImageButton.

void Button::Paint ( const Rect rDirty  )  [virtual]

Paint window content

Description:
This function gets called whenever an area of the window has to be redrawn. Usually you should only draw from inside the Paint function. If you need to redraw a window (when lets say some content must be updated), simply call Invalidate() which will then (asynchronly) call this paint function.

Usually you should draw the background using Window::DrawBackground(rDirty) and the border with DrawBorder(rRect). This way the user has full control over the appearance of your window, meaning he can change the background and border style.
The window content area itself is defined by the border margin and the window margin. Every window may define a margin. If you draw content into this window always make sure to not draw into the margin area. Additionally, the border has a margin too. As the user has full control to select any border for your window make sure to user the current borders margin when drawing window content. the dra Window::Paint() just redraws the background using DrawBackground. Overload this member function to add custom dawing code
Overload this member function to add custom dawing code
Parameters:
rDirty - Dirty rectangular region which has to be redrawn. Prior entering this function the painters clip region is automatically set to this dirty region.
See also:
DrawBorder, DrawBackground, Border, GetBorder, GetBorder::Margin, GetMargin

Reimplemented from SkyGI::Window.

Reimplemented in SkyGI::ImageButton.

void Button::OnClicked ( const InputEvent nInputEvent  )  [virtual]

bool Button::IsDown (  )  [virtual]

bool Button::IsHover (  )  [virtual]

String Button::GetCaption (  )  [virtual]

void Button::SetCaption ( const String cString  )  [virtual]

Point Button::GetSizeHint ( enumSizeHint  nSizeHint  )  [virtual]

Get size hint

Description:
Overload this member function for derived classes to inform the GUI about size hints for your widget.
SIZE_HINT_PREFERRED
Return the preferred size of the widget (may depend on the actual content)
SIZE_HINT_MINIMUM
Return the minimum size the widget needs to display a proper content
Note:
If you want to get the minimum or preferred size of a window always use GetMinimumSize or GetPreferredSize. Don't call GetSizeHint directly
See also:
GetPreferredSize, GetMinimumSize, SetMinimumSize

Reimplemented from SkyGI::Window.

Reimplemented in SkyGI::ImageButton.

void Button::KeyDown ( const InputEvent nInputEvent  )  [virtual]

Reimplemented from SkyGI::Window.

void Button::KeyUp ( const InputEvent nInputEvent  )  [virtual]

Reimplemented from SkyGI::Window.

void Button::Enable ( bool  bEnable  )  [virtual]

Reimplemented from SkyGI::Window.

void Button::SetTextFlags ( TextFlags  nTextFlags  ) 

TextFlags Button::GetTextFlags (  ) 

void Button::SetImage ( Image pImage,
int  iImageSpacing = 5 
)

void Button::KeepImage ( bool  bKeep  ) 

Reimplemented in SkyGI::ImageButton.

Image * Button::GetImage (  ) 

Reimplemented in SkyGI::ImageButton.

void Button::SetTextColor ( Color  nTextColor  ) 

MessageCommand * Button::GetMessageCommand (  ) 


Member Data Documentation

signal0 SkyGI::Button::Clicked

Emitted when the button gets clicked

Description:
OnClicked will emit this signal if not overloaded and the button was pressed with either the left mouse button or using the VKEY_ENTER key
See also:
ClickedEvent
Examples:
button.cpp, listview.cpp, and messagebox.cpp.

signal1<const InputEvent&> SkyGI::Button::ClickedEvent

Emitted when the button gets clicked

Description:
OnClicked will emit this signal if not overloaded
Parameters:
nInputEvent InputEvent with details about the click event (click with mouse, keyboard, ...)
See also:
Clicked


Generated on Thu Dec 13 18:14:16 2007 for SkyGI by  doxygen 1.5.1-p1