The base class for GUI window classes.
This class can be observed (see mrpt::utils::CObserver) for the following events (see mrpt::utils::mrptEvent):
IMPORTANTE NOTICE: Event handlers in your observer class will be invoked from the wxWidgets internal MRPT thread, so all your code in the handler must be thread safe.
Definition at line 58 of file CBaseGUIWindow.h.
#include <mrpt/gui/CBaseGUIWindow.h>
Public Member Functions | |
void * | getWxObject () |
Read-only access to the wxDialog object. | |
void | notifyChildWindowDestruction () |
Called by wx main thread to set m_hwnd to NULL. | |
void | notifySemThreadReady () |
Called by wx main thread to signal the semaphore that the wx window is built and ready. | |
CBaseGUIWindow (void *winobj_voidptr, int CMD_CREATE_WIN, int CMD_DESTROY_WIN, const std::string &initial_caption=std::string()) | |
CMD_DESTROY_WIN can be 299,399,499... | |
virtual | ~CBaseGUIWindow () |
bool | isOpen () |
Returns false if the user has already closed the window. | |
virtual void | resize (unsigned int width, unsigned int height)=0 |
Resizes the window, stretching the image to fit into the display area. | |
virtual void | setPos (int x, int y)=0 |
Changes the position of the window on the screen. | |
virtual void | setWindowTitle (const std::string &str)=0 |
Changes the window title text. | |
virtual bool | getLastMousePosition (int &x, int &y) const =0 |
Gets the last x,y pixel coordinates of the mouse. | |
virtual void | setCursorCross (bool cursorIsCross)=0 |
Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true). | |
int | waitForKey (bool ignoreControlKeys=true, mrptKeyModifier *out_pushModifier=NULL) |
Waits for any key to be pushed on the image or the console, and returns the key code. | |
bool | keyHit () const |
Returns true if a key has been pushed, without blocking waiting for a new key being pushed. | |
void | clearKeyHitFlag () |
Assure that "keyHit" will return false until the next pushed key. | |
int | getPushedKey (mrptKeyModifier *out_pushModifier=NULL) |
Returns the latest pushed key, or 0 if there is no new key stroke. | |
Protected Member Functions | |
void | createWxWindow (unsigned int initialWidth, unsigned int initialHeight) |
Must be called by child classes just within the constructor. | |
Protected Attributes | |
synch::CSemaphore | m_semThreadReady |
This semaphore will be signaled when the wx window is built and ready. | |
synch::CSemaphore | m_semWindowDestroyed |
This semaphore will be signaled when the wx window is destroyed. | |
std::string | m_caption |
The caption of the window. | |
void_ptr_noncopy | m_hwnd |
The window handle. | |
volatile bool | m_keyPushed |
volatile int | m_keyPushedCode |
volatile mrptKeyModifier | m_keyPushedModifier |
Private Attributes | |
const int | m_CMD_CREATE_WIN |
can be 200,300,400... See WxSubsystem | |
const int | m_CMD_DESTROY_WIN |
can be 299,399,499... See WxSubsystem | |
void * | m_winobj_voidptr |
Friends | |
class | CWindowDialog |
class | C3DWindowDialog |
class | CWindowDialogPlots |
RTTI stuff | |
| |
static const mrpt::utils::TRuntimeClassId | classCBaseGUIWindow |
class | mrpt::utils::CStream |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
Returns information about the class of an object in runtime. |
mrpt::gui::CBaseGUIWindow::CBaseGUIWindow | ( | void * | winobj_voidptr, | |
int | CMD_CREATE_WIN, | |||
int | CMD_DESTROY_WIN, | |||
const std::string & | initial_caption = std::string() | |||
) |
CMD_DESTROY_WIN can be 299,399,499...
See WxSubsystem
virtual mrpt::gui::CBaseGUIWindow::~CBaseGUIWindow | ( | ) | [virtual] |
static const mrpt::utils::TRuntimeClassId* mrpt::gui::CBaseGUIWindow::_GetBaseClass | ( | ) | [static, protected] |
Reimplemented from mrpt::utils::CObject.
Reimplemented in mrpt::gui::CDisplayWindow, mrpt::gui::CDisplayWindow3D, and mrpt::gui::CDisplayWindowPlots.
void mrpt::gui::CBaseGUIWindow::clearKeyHitFlag | ( | ) | [inline] |
Assure that "keyHit" will return false until the next pushed key.
Definition at line 140 of file CBaseGUIWindow.h.
void mrpt::gui::CBaseGUIWindow::createWxWindow | ( | unsigned int | initialWidth, | |
unsigned int | initialHeight | |||
) | [protected] |
Must be called by child classes just within the constructor.
virtual bool mrpt::gui::CBaseGUIWindow::getLastMousePosition | ( | int & | x, | |
int & | y | |||
) | const [pure virtual] |
Gets the last x,y pixel coordinates of the mouse.
Implemented in mrpt::gui::CDisplayWindow, mrpt::gui::CDisplayWindow3D, and mrpt::gui::CDisplayWindowPlots.
int mrpt::gui::CBaseGUIWindow::getPushedKey | ( | mrptKeyModifier * | out_pushModifier = NULL |
) |
Returns the latest pushed key, or 0 if there is no new key stroke.
out_pushModifier | If set to !=NULL, the modifiers of the key stroke will be saved here. |
virtual const mrpt::utils::TRuntimeClassId* mrpt::gui::CBaseGUIWindow::GetRuntimeClass | ( | ) | const [virtual] |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::utils::CObject.
Reimplemented in mrpt::gui::CDisplayWindow, mrpt::gui::CDisplayWindow3D, and mrpt::gui::CDisplayWindowPlots.
void* mrpt::gui::CBaseGUIWindow::getWxObject | ( | ) | [inline] |
Read-only access to the wxDialog object.
Definition at line 88 of file CBaseGUIWindow.h.
References mrpt::utils::non_copiable_ptr_basic< T >::get().
bool mrpt::gui::CBaseGUIWindow::isOpen | ( | ) |
Returns false if the user has already closed the window.
bool mrpt::gui::CBaseGUIWindow::keyHit | ( | ) | const [inline] |
Returns true if a key has been pushed, without blocking waiting for a new key being pushed.
Definition at line 135 of file CBaseGUIWindow.h.
void mrpt::gui::CBaseGUIWindow::notifyChildWindowDestruction | ( | ) |
Called by wx main thread to set m_hwnd to NULL.
void mrpt::gui::CBaseGUIWindow::notifySemThreadReady | ( | ) |
Called by wx main thread to signal the semaphore that the wx window is built and ready.
virtual void mrpt::gui::CBaseGUIWindow::resize | ( | unsigned int | width, | |
unsigned int | height | |||
) | [pure virtual] |
Resizes the window, stretching the image to fit into the display area.
Implemented in mrpt::gui::CDisplayWindow, mrpt::gui::CDisplayWindow3D, and mrpt::gui::CDisplayWindowPlots.
virtual void mrpt::gui::CBaseGUIWindow::setCursorCross | ( | bool | cursorIsCross | ) | [pure virtual] |
Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true).
Implemented in mrpt::gui::CDisplayWindow, mrpt::gui::CDisplayWindow3D, and mrpt::gui::CDisplayWindowPlots.
virtual void mrpt::gui::CBaseGUIWindow::setPos | ( | int | x, | |
int | y | |||
) | [pure virtual] |
Changes the position of the window on the screen.
Implemented in mrpt::gui::CDisplayWindow, mrpt::gui::CDisplayWindow3D, and mrpt::gui::CDisplayWindowPlots.
virtual void mrpt::gui::CBaseGUIWindow::setWindowTitle | ( | const std::string & | str | ) | [pure virtual] |
Changes the window title text.
Implemented in mrpt::gui::CDisplayWindow, mrpt::gui::CDisplayWindow3D, and mrpt::gui::CDisplayWindowPlots.
int mrpt::gui::CBaseGUIWindow::waitForKey | ( | bool | ignoreControlKeys = true , |
|
mrptKeyModifier * | out_pushModifier = NULL | |||
) |
Waits for any key to be pushed on the image or the console, and returns the key code.
This method remove key strokes previous to its call, so it will always wait. To get the latest pushed key, see
ignoreControlKeys | If set to false, any push of shift, cmd, control, etc... will make this method to return. | |
out_pushModifier | If set to !=NULL, the modifiers of the key stroke will be saved here. |
friend class C3DWindowDialog [friend] |
Reimplemented in mrpt::gui::CDisplayWindow3D.
Definition at line 66 of file CBaseGUIWindow.h.
friend class CWindowDialog [friend] |
Definition at line 65 of file CBaseGUIWindow.h.
friend class CWindowDialogPlots [friend] |
Reimplemented in mrpt::gui::CDisplayWindowPlots.
Definition at line 67 of file CBaseGUIWindow.h.
friend class mrpt::utils::CStream [friend] |
Definition at line 63 of file CBaseGUIWindow.h.
Definition at line 63 of file CBaseGUIWindow.h.
std::string mrpt::gui::CBaseGUIWindow::m_caption [protected] |
The caption of the window.
Definition at line 77 of file CBaseGUIWindow.h.
const int mrpt::gui::CBaseGUIWindow::m_CMD_CREATE_WIN [private] |
can be 200,300,400... See WxSubsystem
Definition at line 70 of file CBaseGUIWindow.h.
const int mrpt::gui::CBaseGUIWindow::m_CMD_DESTROY_WIN [private] |
can be 299,399,499... See WxSubsystem
Definition at line 71 of file CBaseGUIWindow.h.
void_ptr_noncopy mrpt::gui::CBaseGUIWindow::m_hwnd [protected] |
The window handle.
Definition at line 78 of file CBaseGUIWindow.h.
volatile bool mrpt::gui::CBaseGUIWindow::m_keyPushed [protected] |
Definition at line 81 of file CBaseGUIWindow.h.
volatile int mrpt::gui::CBaseGUIWindow::m_keyPushedCode [protected] |
Definition at line 82 of file CBaseGUIWindow.h.
volatile mrptKeyModifier mrpt::gui::CBaseGUIWindow::m_keyPushedModifier [protected] |
Definition at line 83 of file CBaseGUIWindow.h.
This semaphore will be signaled when the wx window is built and ready.
Definition at line 75 of file CBaseGUIWindow.h.
This semaphore will be signaled when the wx window is destroyed.
Definition at line 76 of file CBaseGUIWindow.h.
void* mrpt::gui::CBaseGUIWindow::m_winobj_voidptr [private] |
Definition at line 72 of file CBaseGUIWindow.h.
Page generated by Doxygen 1.7.1 for MRPT 0.9.4 SVN: at Mon Jan 10 23:33:19 UTC 2011 |