#include <omUIButton.h>
Inheritance diagram for omUIButton:
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. | |
omObject * | upper |
Upper button (joystick UP). | |
omObject * | lower |
Lower button (joystick DOWN). | |
omObject * | left |
Left button (joystick LEFT). | |
omObject * | right |
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. |
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.
|
The constructor. Build the window and put it 'alwais on top' if onTop is true.
|
|
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".
|
|
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.
|
|
wxWindows descrutor of the class. Deallocates all allocated objects. |
|
Reimplemented in maiaButton. |
|
Hide the window without destroy it. |
|
Use System specific Api to determine if the passed window handler belongs to this window.
Reimplemented from omObject. |
|
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. |
|
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. |
|
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. |
|
Called when the button is clicked. This is a virtual function and must be overriden to handle the signal. Reimplemented in maiaButton. |
|
Called when the button is focused Reimplemented in maiaButton. |
|
Left mouse click internal handler. |
|
Redraw the current bitmap on OnPain event. |
|
Called when the button is scratched. This is a virtual function and must be overriden to handle the signal. |
|
OnFocus internal event handler. |
|
Pain the default picture of the window. This is a virtual function and must be implemented by the child Reimplemented in maiaButton. |
|
Play the sound stored in the index position.
|
|
System dependent PlaySound method.
|
|
Put the window on the top of other windows |
|
Render the image stored in the index position.
|
|
System dependent check window handler.
|
|
System dependent PutOnTop method.
|
|
Show the window and put 'on top' if required. This is necessary under linux because X11 needs GTK window handler. Reimplemented in maiaButton. |
|
Current image displayed.
|
|
height.
|
|
Vector of paths of images to render.
|
|
Vector of images to render.
|
|
onTop flag.
|
|
Left button (joystick LEFT).
|
|
Lower button (joystick DOWN).
|
|
Number of stored images.
|
|
Number of stored sounds.
|
|
Right button (joystick RIGHT).
|
|
|
|
Upper button (joystick UP).
|
|
width.
|
|
x position.
|
|
y position.
|
Copyright © by Luca Clivio |