Main Page | Modules | Class Hierarchy | Data Structures | File List | Data Fields | Globals | Related Pages

omUIButton Class Reference
[USER INTERFACE classes of the OpenMAIA Library]

#include <omUIButton.h>

Inheritance diagram for omUIButton:

omObject maiaButton

Public Member Functions

 omUIButton (bool, wxWindow *, int, int, int, int)
virtual bool Destroy ()
void Show ()
void Hide ()
void PutOnTop ()
bool IsYourWindow (void *)
virtual void PaintDefaultPicture ()
virtual void LightOn ()
virtual void LightOnSingle ()
virtual void LightOff ()
virtual void Execute ()

Data Fields

int x
 x position.

int y
 y position.

int w
 width.

int h
 height.

omObjectupper
 Upper button (joystick UP).

omObjectlower
 Lower button (joystick DOWN).

omObjectleft
 Left button (joystick LEFT).

omObjectright
 Right button (joystick RIGHT).


Protected Member Functions

int AddSound (wxString)
int AddImage (wxString)
void PlaySound (int)
void RenderImage (int)
virtual void OnClick ()
virtual void OnScratch ()
virtual void OnFocus ()

Protected Attributes

int curImage
 Current image displayed.


Private Member Functions

void OnMouseButtonUp (wxCommandEvent &event)
void OnPaint (wxPaintEvent &event)
void OnSetFocus (wxFocusEvent &event)
void SDPutOnTop ()
 System dependent PutOnTop method.

bool SDIsYourWindow (void *)
 System dependent check window handler.

void PlaySoundSD (wxString, bool)
 System dependent PlaySound method.


Private Attributes

bool isOnTop
 onTop flag.

std::vector< wxString > image_paths
 Vector of paths of images to render.

std::vector< wxBitmap * > images
 Vector of images to render.

std::vector< wxString > sounds
int nsounds
 Number of stored sounds.

int nimages
 Number of stored images.


Detailed Description

OpenMAIA User Interface Button.

This class is a super class for an OpenMAIA User interface virtual button. The class descends from wxFrame and implements a window with no borders and with stay on top feature. The stay on top feature works correctly under windows but have some problems with GNU/Linux GTK 1.X and doesn't work with GNU/Linux GTK 2.X. With GNU/Linux stay on top works correctly with WindowMaker and with GNOME 2.4 (metacity), some problems occours with KDE. In particular KDE freezes sometimes.
The events handled by this object are listed above:

The object can also handle images and sounds.

Todo:
Implement onScratch method


Constructor & Destructor Documentation

omUIButton::omUIButton bool  onTop,
wxWindow *  parent,
int  xp,
int  yp,
int  wp,
int  hp
 

The constructor. Build the window and put it 'alwais on top' if onTop is true.

Parameters:
onTop Put on top flag
parent Pointer of the parent window
xp x position
yp y position
wp width
hp height


Member Function Documentation

int omUIButton::AddImage wxString  path  )  [protected]
 

Add an image path to panel and returns the index of the inserted image. Load the bitmap in a wxBitmap object and store the wxBitmap obj in the button "memory".

Parameters:
path of the image file, can be jpg, tiff, bmp or png
Returns:
Index of the added image.

int omUIButton::AddSound wxString  path  )  [protected]
 

Add a sound path to button and return the index of the added sound. It's not convenient to store all the sound in memory because it can be very large so we store only the path of the sound file and we play them when required.

Parameters:
path Path of the sound file
Returns:
Index of sound added.

bool omUIButton::Destroy  )  [virtual]
 

wxWindows descrutor of the class. Deallocates all allocated objects.

void omUIButton::Execute  )  [virtual]
 

Reimplemented in maiaButton.

void omUIButton::Hide  ) 
 

Hide the window without destroy it.

bool omUIButton::IsYourWindow void *  wh  )  [virtual]
 

Use System specific Api to determine if the passed window handler belongs to this window.

Parameters:
wh system specific window handler to check

Reimplemented from omObject.

void omUIButton::LightOff  )  [virtual]
 

Called to turn off the highlighted mode of the in automatic scan mode. This is a virtual function and must be overriden to handle the signal.

Reimplemented in maiaButton.

void omUIButton::LightOn  )  [virtual]
 

Called to turn on the highlighted mode of the window in automatic scan mode. This is a virtual function and must be overriden to handle the signal.

Reimplemented in maiaButton.

void omUIButton::LightOnSingle  )  [virtual]
 

Called to turn on the highlighted mode of the window in automatic scan mode. This signal is generated when the button is scanned alone and is not part of a group of bottons. This is a virtual function and must be overriden to handle the signal.

Reimplemented in maiaButton.

void omUIButton::OnClick  )  [protected, virtual]
 

Called when the button is clicked. This is a virtual function and must be overriden to handle the signal.

Reimplemented in maiaButton.

void omUIButton::OnFocus  )  [protected, virtual]
 

Called when the button is focused

Reimplemented in maiaButton.

void omUIButton::OnMouseButtonUp wxCommandEvent &  event  )  [private]
 

Left mouse click internal handler.

void omUIButton::OnPaint wxPaintEvent &  event  )  [private]
 

Redraw the current bitmap on OnPain event.

void omUIButton::OnScratch  )  [protected, virtual]
 

Called when the button is scratched. This is a virtual function and must be overriden to handle the signal.

void omUIButton::OnSetFocus wxFocusEvent &  event  )  [private]
 

OnFocus internal event handler.

void omUIButton::PaintDefaultPicture  )  [virtual]
 

Pain the default picture of the window. This is a virtual function and must be implemented by the child

Reimplemented in maiaButton.

void omUIButton::PlaySound int  index  )  [protected]
 

Play the sound stored in the index position.

Parameters:
index index of the sound to play

Todo:
In linux must debug wxWindows wave handling.

void omUIButton::PlaySoundSD wxString  ,
bool 
[private]
 

System dependent PlaySound method.

void omUIButton::PutOnTop  ) 
 

Put the window on the top of other windows

void omUIButton::RenderImage int  index  )  [protected]
 

Render the image stored in the index position.

Parameters:
index of the image to render

bool omUIButton::SDIsYourWindow void *   )  [private]
 

System dependent check window handler.

void omUIButton::SDPutOnTop  )  [private]
 

System dependent PutOnTop method.

void omUIButton::Show  ) 
 

Show the window and put 'on top' if required. This is necessary under linux because X11 needs GTK window handler.

Reimplemented in maiaButton.


Field Documentation

int omUIButton::curImage [protected]
 

Current image displayed.

int omUIButton::h
 

height.

std::vector<wxString> omUIButton::image_paths [private]
 

Vector of paths of images to render.

std::vector<wxBitmap *> omUIButton::images [private]
 

Vector of images to render.

bool omUIButton::isOnTop [private]
 

onTop flag.

omObject* omUIButton::left
 

Left button (joystick LEFT).

omObject* omUIButton::lower
 

Lower button (joystick DOWN).

int omUIButton::nimages [private]
 

Number of stored images.

int omUIButton::nsounds [private]
 

Number of stored sounds.

omObject* omUIButton::right
 

Right button (joystick RIGHT).

std::vector<wxString> omUIButton::sounds [private]
 

omObject* omUIButton::upper
 

Upper button (joystick UP).

int omUIButton::w
 

width.

int omUIButton::x
 

x position.

int omUIButton::y
 

y position.


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