9 #ifndef CBaseGUIWindow_H
10 #define CBaseGUIWindow_H
31 class CWindowDialogPlots;
32 class C3DWindowDialog;
57 friend class CWindowDialog;
58 friend class C3DWindowDialog;
59 friend class CWindowDialogPlots;
62 const
int m_CMD_CREATE_WIN;
63 const
int m_CMD_DESTROY_WIN;
64 void* m_winobj_voidptr;
67 synch::CSemaphore m_semThreadReady;
68 synch::CSemaphore m_semWindowDestroyed;
69 std::
string m_caption;
73 volatile
bool m_keyPushed;
74 volatile
int m_keyPushedCode;
77 void createWxWindow(
unsigned int initialWidth,
unsigned int initialHeight);
78 void destroyWxWindow();
81 void * getWxObject() {
return m_hwnd.
get(); }
82 void notifyChildWindowDestruction();
83 void notifySemThreadReady();
88 CBaseGUIWindow(
void* winobj_voidptr,
int CMD_CREATE_WIN,
int CMD_DESTROY_WIN,
const std::string &initial_caption = std::string() );
97 virtual void resize(
unsigned int width,
unsigned int height ) = 0;
101 virtual void setPos(
int x,
int y ) = 0;
105 virtual void setWindowTitle(
const std::string &str )=0;
108 virtual bool getLastMousePosition(
int &x,
int &y)
const = 0;
111 virtual void setCursorCross(
bool cursorIsCross) = 0;
123 int waitForKey(
bool ignoreControlKeys =
true,
mrptKeyModifier *out_pushModifier=NULL);
128 bool keyHit()
const {
return m_keyPushed; }
165 ) : source_object(obj), char_code(_char_code), key_modifiers(_key_mod) { }
185 size_t _new_height) : source_object(obj), new_width(_new_width), new_height(_new_height) { }
208 ) : source_object(obj), coords(_coords), leftButton(_leftButton), rightButton(_rightButton)
233 bool _allow_close =
true )
234 : source_object(obj), allow_close(_allow_close)
An event sent by a window upon resize.
CBaseGUIWindow * source_object
An event sent by a window upon a mouse click, giving the (x,y) pixel coordinates. ...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
The basic event type for the observer-observable pattern in MRPT.
A pair (x,y) of pixel coordinates (integer resolution).
mrptEventWindowResize(CBaseGUIWindow *obj, size_t _new_width, size_t _new_height)
virtual void do_nothing()
Just to allow this class to be polymorphic.
An event sent by a window upon when it's about to be closed, either manually by the user or programat...
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
bool keyHit() const
Returns true if a key has been pushed, without blocking waiting for a new key being pushed...
mrpt::utils::TPixelCoord coords
virtual void do_nothing()
Just to allow this class to be polymorphic.
virtual void do_nothing()
Just to allow this class to be polymorphic.
CBaseGUIWindow * source_object
An event sent by a window upon a char pressed by the user.
CBaseGUIWindow * source_object
mrptEventWindowClosed(CBaseGUIWindow *obj, bool _allow_close=true)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrptEventMouseDown(CBaseGUIWindow *obj, mrpt::utils::TPixelCoord _coords, bool _leftButton, bool _rightButton)
mrptKeyModifier key_modifiers
Modifiers (Shift, Control, etc...)
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_LINKAGE(class_name, _LINKAGE_)
mrptEventWindowChar(CBaseGUIWindow *obj, int _char_code, mrptKeyModifier _key_mod)
virtual void do_nothing()
Just to allow this class to be polymorphic.
CBaseGUIWindow * source_object
The virtual base class of all MRPT classes with a unified RTTI system.
Inherit from this class for those objects capable of being observed by a CObserver class...
int char_code
The virtual key code, as defined in (a replication of wxWidgets key codes)...
#define DEFINE_MRPT_OBJECT_POST_CUSTOM_LINKAGE(class_name, _LINKAGE_)
The base class for GUI window classes.
void clearKeyHitFlag()
Assure that "keyHit" will return false until the next pushed key.