Go to the documentation of this file.
9 #ifndef CBaseGUIWindow_H
10 #define CBaseGUIWindow_H
46 public
mrpt::utils::CObservable
51 friend class CWindowDialog;
52 friend class C3DWindowDialog;
53 friend class CWindowDialogPlots;
56 const
int m_CMD_CREATE_WIN;
57 const
int m_CMD_DESTROY_WIN;
58 void* m_winobj_voidptr;
61 synch::CSemaphore m_semThreadReady;
62 synch::CSemaphore m_semWindowDestroyed;
63 std::
string m_caption;
67 volatile
bool m_keyPushed;
68 volatile
int m_keyPushedCode;
71 void createWxWindow(
unsigned int initialWidth,
unsigned int initialHeight);
72 void destroyWxWindow();
75 void * getWxObject() {
return m_hwnd.
get(); }
82 CBaseGUIWindow(
void* winobj_voidptr,
int CMD_CREATE_WIN,
int CMD_DESTROY_WIN,
const std::string &initial_caption = std::string() );
91 virtual void resize(
unsigned int width,
unsigned int height ) = 0;
95 virtual void setPos(
int x,
int y ) = 0;
122 bool keyHit()
const {
return m_keyPushed; }
159 ) : source_object(obj), char_code(_char_code), key_modifiers(_key_mod) { }
179 size_t _new_height) : source_object(obj), new_width(_new_width), new_height(_new_height) { }
202 ) : source_object(obj), coords(_coords), leftButton(_leftButton), rightButton(_rightButton)
227 bool _allow_close =
true )
228 : source_object(obj), allow_close(_allow_close)
class BASE_IMPEXP CObject
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.
The basic event type for the observer-observable pattern in MRPT.
mrptEventMouseDown(CBaseGUIWindow *obj, mrpt::utils::TPixelCoord _coords, bool _leftButton, bool _rightButton)
virtual void do_nothing() MRPT_OVERRIDE
Just to allow this class to be polymorphic.
virtual void setCursorCross(bool cursorIsCross)=0
Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true)
CBaseGUIWindow * source_object
An event sent by a window upon a char pressed by the user.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_MRPT_OBJECT_POST_CUSTOM_LINKAGE(class_name, _LINKAGE_)
An event sent by a window upon resize.
void clearKeyHitFlag()
Assure that "keyHit" will return false until the next pushed key.
virtual void do_nothing() MRPT_OVERRIDE
Just to allow this class to be polymorphic.
The base class for GUI window classes.
An event sent by a window upon a mouse click, giving the (x,y) pixel coordinates.
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 void resize(unsigned int width, unsigned int height)=0
Resizes the window, stretching the image to fit into the display area.
virtual void do_nothing() MRPT_OVERRIDE
Just to allow this class to be polymorphic.
void notifySemThreadReady()
Called by wx main thread to signal the semaphore that the wx window is built and ready.
CBaseGUIWindow * source_object
mrptEventWindowChar(CBaseGUIWindow *obj, int _char_code, mrptKeyModifier _key_mod)
CBaseGUIWindow * source_object
mrptKeyModifier key_modifiers
Modifiers (Shift, Control, etc...)
virtual void setWindowTitle(const std::string &str)=0
Changes the window title text.
int char_code
The virtual key code, as defined in <mrpt/gui/keycodes.h> (a replication of wxWidgets key codes).
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_LINKAGE(class_name, _LINKAGE_)
virtual bool getLastMousePosition(int &x, int &y) const =0
Gets the last x,y pixel coordinates of the mouse.
mrptEventWindowClosed(CBaseGUIWindow *obj, bool _allow_close=true)
A pair (x,y) of pixel coordinates (integer resolution).
non_copiable_ptr_basic< void > void_ptr_noncopy
void notifyChildWindowDestruction()
Called by wx main thread to set m_hwnd to NULL.
mrpt::utils::TPixelCoord coords
int getPushedKey(mrptKeyModifier *out_pushModifier=NULL)
Returns the latest pushed key, or 0 if there is no new key stroke.
virtual ~CBaseGUIWindow()
bool isOpen()
Returns false if the user has already closed the window.
bool keyHit() const
Returns true if a key has been pushed, without blocking waiting for a new key being pushed.
An event sent by a window upon when it's about to be closed, either manually by the user or programat...
virtual void setPos(int x, int y)=0
Changes the position of the window on the screen.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
virtual void do_nothing() MRPT_OVERRIDE
Just to allow this class to be polymorphic.
mrptEventWindowResize(CBaseGUIWindow *obj, size_t _new_width, size_t _new_height)
CBaseGUIWindow * source_object
Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020 | | |