FlexiWidget Class Reference

Base element for the gui. More...

#include <FlexiWidget.h>

Inheritance diagram for FlexiWidget:

Inheritance graph
[legend]
Collaboration diagram for FlexiWidget:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 FlexiWidget (const FlexiPosition &p, const FlexiSize &s, FlexiWidget *prnt)
virtual ~FlexiWidget ()
void setName (const std::string &newName)
const std::string & getName () const
FlexiWidgetgetParent ()
bool reparent (FlexiWidget *newParent)
bool isContainer ()
void addChild (FlexiWidget *child)
const std::list< FlexiWidget * > getChildren () const
const FlexiPositiongetPosition ()
const FlexiSizegetSize ()
virtual const FlexiPosition getAbsPosition ()
const FlexiPosition getOriginalPosition ()
virtual void resize (const FlexiPosition &p, const FlexiSize &s)
void setPosition (const FlexiPosition &p)
void setSize (const FlexiSize &s)
void show ()
void hide ()
void activate ()
void deactivate ()
bool isVisible ()
bool isActive ()
void setFocusable (bool focusable)
void setFocus ()
bool isFocusable ()
bool isFocused ()
void setHilighted (bool hilight)
bool isHilighted ()
void dispatchFocusEvent (FlexiFocusEvent *event)
void dispatchMouseEvent (FlexiMouseEvent *event)
void setFlags (int flags, bool value)
bool getFlags (int flags)
void setBackImage (FlexiImage *image, int gridBagType=FlexiGridBag::FLX_GRIDBAG_1X1)
bool setSensitiveArea (FlexiSensitiveArea *sensitive_area)
bool isMouseOver (int mouseX, int mouseY)
void setTag (long value)
long getTag ()
void addActionListener (FlexiActionListener *listener)
void addFocusListener (FlexiFocusListener *listener)
void addKeyListener (FlexiKeyListener *listener)
void addMouseListener (FlexiMouseListener *listener)
void addUserActionListener (FlexiActionListener *listener)
void addUserFocusListener (FlexiFocusListener *listener)
void addUserKeyListener (FlexiKeyListener *listener)
void addUserMouseListener (FlexiMouseListener *listener)
void callActionListener (FlexiActionEvent *event)
void callFocusListener (FlexiFocusEvent *event)
void callKeyListener (FlexiKeyEvent *event)
void callMouseListener (FlexiMouseEvent *event)
virtual void paint ()


Detailed Description

Base element for the gui.

Author:
Alessandro Rasulo (mailto: alex9978@gmail.com)

Constructor & Destructor Documentation

FlexiWidget::FlexiWidget ( const FlexiPosition p,
const FlexiSize s,
FlexiWidget prnt 
)

Constructor

Parameters:
p position
s size
prnt parent widget

FlexiWidget::~FlexiWidget (  )  [virtual]

Destructor


Member Function Documentation

void FlexiWidget::setName ( const std::string &  newName  )  [inline]

Sets the name of the widget

Parameters:
newName The new name of the widget

const std::string & FlexiWidget::getName (  )  const [inline]

Gets the name of the widget

Returns:
the name

FlexiWidget * FlexiWidget::getParent (  )  [inline]

Gets the parent of the widget

Returns:
the parent

bool FlexiWidget::reparent ( FlexiWidget newParent  ) 

Reparents the widget to another parent

Parameters:
newparent the new parent widget
Returns:
true if success

bool FlexiWidget::isContainer (  )  [inline]

Return if the widget is a container

Returns:
true if is a container

void FlexiWidget::addChild ( FlexiWidget child  ) 

Add a child to the widget, if this widget is a container

Parameters:
child the new child

const std::list< FlexiWidget * > FlexiWidget::getChildren (  )  const

Return the list of all children

Returns:
the list of all children

const FlexiPosition & FlexiWidget::getPosition (  )  [inline]

Gets the position of the widget

Returns:
the position

const FlexiSize & FlexiWidget::getSize (  )  [inline]

Gets the size of the widget

Returns:
the size

const FlexiPosition FlexiWidget::getAbsPosition (  )  [virtual]

Gets the absolute position of the widget (not relative to parent)

Returns:
the absolute position on the screen

const FlexiPosition FlexiWidget::getOriginalPosition (  )  [inline]

Gets the original position of the widget (without any translation)

Returns:
the original position

void FlexiWidget::resize ( const FlexiPosition p,
const FlexiSize s 
) [virtual]

Resize the widget

Parameters:
p the new position
s the new size

Todo:
resize all children

Reimplemented in FlexiButton, FlexiFrame, FlexiLabel, and FlexiWindow.

void FlexiWidget::setPosition ( const FlexiPosition p  )  [inline]

Sets the widget's position

Parameters:
p the new position

void FlexiWidget::setSize ( const FlexiSize s  )  [inline]

Sets the widget's size

Parameters:
s the new size

void FlexiWidget::show (  ) 

Shows the widget

void FlexiWidget::hide (  ) 

Hides the widget

void FlexiWidget::activate (  ) 

Activate the widget

void FlexiWidget::deactivate (  ) 

Deactivate the widget

bool FlexiWidget::isVisible (  )  [inline]

Returns if the widget is visible

Returns:
true if is visible

bool FlexiWidget::isActive (  )  [inline]

Returns if the widget is active

Returns:
true if is active

void FlexiWidget::setFocusable ( bool  focusable  )  [inline]

Set if a widget can receive focus

Parameters:
focuseable true if the widget can get focused

void FlexiWidget::setFocus (  )  [inline]

Sets the focus to the widget

bool FlexiWidget::isFocusable (  )  [inline]

Gets if the widget can receive focus

Returns:
true if is focusable

bool FlexiWidget::isFocused (  )  [inline]

Returns if the widget is focused

Returns:
true if the widget is focused

void FlexiWidget::setHilighted ( bool  hilight  )  [inline]

Sets the widget hilight status

Parameters:
hilight true if hilighted

bool FlexiWidget::isHilighted (  )  [inline]

Returns if the widget is hilighted

Returns:
true if hilighted

void FlexiWidget::dispatchFocusEvent ( FlexiFocusEvent *  event  ) 

Dispatch a focus event to all the children

Parameters:
event the focus event

void FlexiWidget::dispatchMouseEvent ( FlexiMouseEvent *  event  ) 

Dispatch a mouse event to all the children

Parameters:
event the mouse event

void FlexiWidget::setFlags ( int  flags,
bool  value 
)

Sets the one or more flags of the widget

Parameters:
flags the flags to be set
value true or false

bool FlexiWidget::getFlags ( int  flags  ) 

Gets one or more flags of the widget

Parameters:
flags the flags to be read
Returns:
flags status

void FlexiWidget::setBackImage ( FlexiImage image,
int  gridBagType = FlexiGridBag::FLX_GRIDBAG_1X1 
)

Sets the background image of the widget

Parameters:
image the image
gridBagType the type of gridbag to use
See also:
FlexiGridBag

bool FlexiWidget::setSensitiveArea ( FlexiSensitiveArea sensitive_area  ) 

Set the sensitive area of the widget

Parameters:
sensitive_area the sensitive area
Returns:
true if success

bool FlexiWidget::isMouseOver ( int  mouseX,
int  mouseY 
)

Tells if mouse is over the sensitive area of the widget

Returns:
true if the mouse is over

void FlexiWidget::setTag ( long  value  )  [inline]

Sets the widget's tag data

Parameters:
value the tag

long FlexiWidget::getTag (  )  [inline]

Gets the widget's tag data

Returns:
the tag

void FlexiWidget::addActionListener ( FlexiActionListener listener  ) 

Add a default action listener to the widget

Parameters:
listener an action listener

void FlexiWidget::addFocusListener ( FlexiFocusListener listener  ) 

Add a default focus listener to the widget

Parameters:
listener a focus listener

void FlexiWidget::addKeyListener ( FlexiKeyListener listener  ) 

Add a default key listener to the widget

Parameters:
listener a key listener

void FlexiWidget::addMouseListener ( FlexiMouseListener listener  ) 

Add a default mouse listener to the widget

Parameters:
listener a mouse listener

void FlexiWidget::addUserActionListener ( FlexiActionListener listener  ) 

Add an user defined action listener to the widget

Parameters:
listener an action listener

void FlexiWidget::addUserFocusListener ( FlexiFocusListener listener  ) 

Add an user defined focus listener to the widget

Parameters:
listener a focus listener

void FlexiWidget::addUserKeyListener ( FlexiKeyListener listener  ) 

Add an user defined key listener to the widget

Parameters:
listener a key listener

void FlexiWidget::addUserMouseListener ( FlexiMouseListener listener  ) 

Add an user defined mouse listener to the widget

Parameters:
listener a mouse listener

void FlexiWidget::callActionListener ( FlexiActionEvent *  event  ) 

Calls the associated action listener of this widget

Parameters:
event an action event

void FlexiWidget::callFocusListener ( FlexiFocusEvent *  event  ) 

Calls the associated focus listener of this widget

Parameters:
event a focus event

void FlexiWidget::callKeyListener ( FlexiKeyEvent *  event  ) 

Calls the associated key listener of this widget

Parameters:
event a key event

void FlexiWidget::callMouseListener ( FlexiMouseEvent *  event  ) 

Calls the associated mouse listener of this widget

Parameters:
event a mouse event

void FlexiWidget::paint (  )  [virtual]

Paint the widget

Reimplemented in FlexiButton, FlexiFrame, FlexiLabel, and FlexiWindow.


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

Generated on Sat Nov 15 01:34:31 2008 for FlexiSense by  doxygen 1.5.6