Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 4bc66056a634db26a1f4d0845dc41ca6 > files > 174

mrpt-doc-0.9.5-0.1.20110925svn2670.fc16.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>CBaseGUIWindow.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<div align="left"><a href="http://www.mrpt.org/">Main MRPT website</a> &gt; <b>C++ reference</b> </div>
<div align="right">
<a href="index.html"><img border="0" src="mrpt_logo.png" alt="MRPT logo"></a>
</div>
<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
          <div class="left">
            <form id="FSearchBox" action="search.php" method="get">
              <img id="MSearchSelect" src="search/mag.png" alt=""/>
              <input type="text" id="MSearchField" name="query" value="Search" size="20" accesskey="S" 
                     onfocus="searchBox.OnSearchFieldFocus(true)" 
                     onblur="searchBox.OnSearchFieldFocus(false)"/>
            </form>
          </div><div class="right"></div>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">CBaseGUIWindow.h</div>  </div>
</div>
<div class="contents">
<a href="_c_base_g_u_i_window_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* +---------------------------------------------------------------------------+</span>
<a name="l00002"></a>00002 <span class="comment">   |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |</span>
<a name="l00003"></a>00003 <span class="comment">   |                                                                           |</span>
<a name="l00004"></a>00004 <span class="comment">   |                       http://www.mrpt.org/                                |</span>
<a name="l00005"></a>00005 <span class="comment">   |                                                                           |</span>
<a name="l00006"></a>00006 <span class="comment">   |   Copyright (C) 2005-2011  University of Malaga                           |</span>
<a name="l00007"></a>00007 <span class="comment">   |                                                                           |</span>
<a name="l00008"></a>00008 <span class="comment">   |    This software was written by the Machine Perception and Intelligent    |</span>
<a name="l00009"></a>00009 <span class="comment">   |      Robotics Lab, University of Malaga (Spain).                          |</span>
<a name="l00010"></a>00010 <span class="comment">   |    Contact: Jose-Luis Blanco  &lt;jlblanco@ctima.uma.es&gt;                     |</span>
<a name="l00011"></a>00011 <span class="comment">   |                                                                           |</span>
<a name="l00012"></a>00012 <span class="comment">   |  This file is part of the MRPT project.                                   |</span>
<a name="l00013"></a>00013 <span class="comment">   |                                                                           |</span>
<a name="l00014"></a>00014 <span class="comment">   |     MRPT is free software: you can redistribute it and/or modify          |</span>
<a name="l00015"></a>00015 <span class="comment">   |     it under the terms of the GNU General Public License as published by  |</span>
<a name="l00016"></a>00016 <span class="comment">   |     the Free Software Foundation, either version 3 of the License, or     |</span>
<a name="l00017"></a>00017 <span class="comment">   |     (at your option) any later version.                                   |</span>
<a name="l00018"></a>00018 <span class="comment">   |                                                                           |</span>
<a name="l00019"></a>00019 <span class="comment">   |   MRPT is distributed in the hope that it will be useful,                 |</span>
<a name="l00020"></a>00020 <span class="comment">   |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |</span>
<a name="l00021"></a>00021 <span class="comment">   |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |</span>
<a name="l00022"></a>00022 <span class="comment">   |     GNU General Public License for more details.                          |</span>
<a name="l00023"></a>00023 <span class="comment">   |                                                                           |</span>
<a name="l00024"></a>00024 <span class="comment">   |     You should have received a copy of the GNU General Public License     |</span>
<a name="l00025"></a>00025 <span class="comment">   |     along with MRPT.  If not, see &lt;http://www.gnu.org/licenses/&gt;.         |</span>
<a name="l00026"></a>00026 <span class="comment">   |                                                                           |</span>
<a name="l00027"></a>00027 <span class="comment">   +---------------------------------------------------------------------------+ */</span>
<a name="l00028"></a>00028 <span class="preprocessor">#ifndef  CBaseGUIWindow_H</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define  CBaseGUIWindow_H</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;<a class="code" href="synch_8h.html">mrpt/synch.h</a>&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="_c_serializable_8h.html">mrpt/utils/CSerializable.h</a>&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="_c_observable_8h.html">mrpt/utils/CObservable.h</a>&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;<a class="code" href="safe__pointers_8h.html">mrpt/utils/safe_pointers.h</a>&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;<a class="code" href="_t_pixel_coord_8h.html">mrpt/utils/TPixelCoord.h</a>&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;<a class="code" href="keycodes_8h.html">mrpt/gui/keycodes.h</a>&gt;</span>
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;<a class="code" href="gui_2include_2mrpt_2gui_2link__pragmas_8h.html">mrpt/gui/link_pragmas.h</a>&gt;</span>
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 <span class="keyword">namespace </span>mrpt
<a name="l00042"></a>00042 {
<a name="l00043"></a><a class="code" href="namespacemrpt_1_1gui.html">00043</a>         <span class="keyword">namespace </span>gui
<a name="l00044"></a>00044         {
<a name="l00045"></a>00045                 <span class="keyword">using namespace </span>mrpt::utils;
<a name="l00046"></a>00046 
<a name="l00047"></a>00047                 <span class="keyword">class </span>CWindowDialog;
<a name="l00048"></a>00048                 <span class="keyword">class </span>CWindowDialogPlots;
<a name="l00049"></a>00049                 <span class="keyword">class </span>C3DWindowDialog;
<a name="l00050"></a>00050 
<a name="l00051"></a><a class="code" href="structmrpt_1_1gui_1_1_c_base_g_u_i_window_ptr.html#ab815ca98ebdee1ce80940d68f0c0cd0a">00051</a>                 <a class="code" href="_c_serializable_8h.html#a4f65adffe92332a1a157f834338b1d49" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_LINKAGE</a>( <a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html" title="The base class for GUI window classes.">CBaseGUIWindow</a>, <a class="code" href="gui_2include_2mrpt_2gui_2link__pragmas_8h.html#a69a861d20c11137851da0fe69a66d7b6">GUI_IMPEXP</a> )
<a name="l00052"></a>00052 
<a name="l00053"></a>00053                 <span class="comment">/** The base class for GUI window classes.</span>
<a name="l00054"></a>00054 <span class="comment">                  *</span>
<a name="l00055"></a>00055 <span class="comment">                  *   This class can be observed (see mrpt::utils::CObserver) for the following events (see mrpt::utils::mrptEvent):</span>
<a name="l00056"></a>00056 <span class="comment">                  *   - mrpt::gui::mrptEventWindowChar</span>
<a name="l00057"></a>00057 <span class="comment">                  *   - mrpt::gui::mrptEventWindowResize</span>
<a name="l00058"></a>00058 <span class="comment">                  *   - mrpt::gui::mrptEventMouseDown</span>
<a name="l00059"></a>00059 <span class="comment">                  *</span>
<a name="l00060"></a>00060 <span class="comment">                  *  See derived classes to check if they emit other additional events.</span>
<a name="l00061"></a>00061 <span class="comment">                  *</span>
<a name="l00062"></a>00062 <span class="comment">                  *  IMPORTANTE NOTICE: Event handlers in your observer class will be invoked from the wxWidgets internal MRPT thread,</span>
<a name="l00063"></a>00063 <span class="comment">                  *    so all your code in the handler must be thread safe.</span>
<a name="l00064"></a>00064 <span class="comment">                  * \ingroup mrpt_gui_grp</span>
<a name="l00065"></a>00065 <span class="comment">                  */</span>
<a name="l00066"></a>00066                 class <a class="code" href="gui_2include_2mrpt_2gui_2link__pragmas_8h.html#a69a861d20c11137851da0fe69a66d7b6">GUI_IMPEXP</a> <a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html" title="The base class for GUI window classes.">CBaseGUIWindow</a> :
<a name="l00067"></a>00067                         public mrpt::utils::<a class="code" href="classmrpt_1_1utils_1_1_c_object.html" title="The virtual base class of all MRPT classes with a unified RTTI system.">CObject</a>,
<a name="l00068"></a>00068                         public mrpt::utils::<a class="code" href="classmrpt_1_1utils_1_1_c_observable.html" title="Inherit from this class for those objects capable of being observed by a CObserver class...">CObservable</a>
<a name="l00069"></a>00069                 {
<a name="l00070"></a>00070                         <span class="comment">// This must be added to any CSerializable derived class:</span>
<a name="l00071"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a6fec28a53e20dfc1c4d046c26f9f7b48">00071</a>                         <a class="code" href="_c_serializable_8h.html#a5876f72cf51bfb66a82bf81cc493febc" title="This declaration must be inserted in virtual CSerializable classes definition:">DEFINE_VIRTUAL_SERIALIZABLE</a>( <a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html" title="The base class for GUI window classes.">CBaseGUIWindow</a> )
<a name="l00072"></a>00072 
<a name="l00073"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a0a4caba1199fdb1b990d4f1dd5abedf6">00073</a>                         friend class CWindowDialog;
<a name="l00074"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#af363eff8a66db772f89467af51a862bb">00074</a>                         friend class C3DWindowDialog;
<a name="l00075"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a0eab80c3eb0251b2f663e3d0e010573e">00075</a>                         friend class CWindowDialogPlots;
<a name="l00076"></a>00076 
<a name="l00077"></a>00077                 private:
<a name="l00078"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#ace70a6051ade6e900df8f2236ac4c67d">00078</a>                         const <span class="keywordtype">int</span>       m_CMD_CREATE_WIN;  <span class="comment">//!&lt; can be 200,300,400... See WxSubsystem</span>
<a name="l00079"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a4800fd97c857ceaf790a87ec52b5c7cb">00079</a> <span class="comment"></span>                        const <span class="keywordtype">int</span>       m_CMD_DESTROY_WIN;  <span class="comment">//!&lt; can be 299,399,499... See WxSubsystem</span>
<a name="l00080"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a2135444d2a6c4d1fd1cee63e361a9004">00080</a> <span class="comment"></span>                        <span class="keywordtype">void</span>*           m_winobj_voidptr;
<a name="l00081"></a>00081 
<a name="l00082"></a>00082                 protected:
<a name="l00083"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#ab6436ed238c7c83c5c7683342eeb2949">00083</a>                         synch::CSemaphore       m_semThreadReady;       <span class="comment">//!&lt; This semaphore will be signaled when the wx window is built and ready.</span>
<a name="l00084"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a7184a4e0fd8ddb22c4759d02434cda8d">00084</a> <span class="comment"></span>                        synch::CSemaphore       m_semWindowDestroyed; <span class="comment">//!&lt; This semaphore will be signaled when the wx window is destroyed.</span>
<a name="l00085"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a207639d38e14fbc7c6e85b479c7b9051">00085</a> <span class="comment"></span>                        std::<span class="keywordtype">string</span>                     m_caption;      <span class="comment">//!&lt; The caption of the window</span>
<a name="l00086"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a2dd4af8ac076bd4f893025eb1d98bf7b">00086</a> <span class="comment"></span>                        <a class="code" href="structmrpt_1_1utils_1_1non__copiable__ptr__basic.html">void_ptr_noncopy</a>        m_hwnd; <span class="comment">//!&lt; The window handle</span>
<a name="l00087"></a>00087 <span class="comment"></span>
<a name="l00088"></a>00088                         <span class="comment">/* Auxiliary */</span>
<a name="l00089"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#ada8b99456263a89ffce9ca28e3f3c102">00089</a>                         volatile <span class="keywordtype">bool</span>             m_keyPushed;
<a name="l00090"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a92fb3fbae072d0387e72fc8e5fa409ac">00090</a>                         volatile <span class="keywordtype">int</span>              m_keyPushedCode;
<a name="l00091"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#aa181ad72efea9497dbbaa13020afa5c4">00091</a>                         volatile <a class="code" href="namespacemrpt_1_1gui.html#a1957927b66a163637ab90d2bf3220e11">mrptKeyModifier</a>  m_keyPushedModifier;
<a name="l00092"></a>00092 
<a name="l00093"></a>00093                         <span class="keywordtype">void</span> createWxWindow(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> initialWidth, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> initialHeight); <span class="comment">//!&lt; Must be called by child classes just within the constructor.</span>
<a name="l00094"></a>00094 <span class="comment"></span>                        <span class="keywordtype">void</span> destroyWxWindow(); <span class="comment">//!&lt; Must be called by child classes in their destructors. The code cannot be put into this class&#39; destructor.</span>
<a name="l00095"></a>00095 <span class="comment"></span>
<a name="l00096"></a>00096                 public:
<a name="l00097"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a5093996f5b658744cad949d8ed541a5e">00097</a>                         <span class="keywordtype">void</span> * getWxObject() { <span class="keywordflow">return</span> m_hwnd.<a class="code" href="structmrpt_1_1utils_1_1non__copiable__ptr__basic.html#ab3b8e5ee20a16dac0fe5ffc3ed8945e0">get</a>(); } <span class="comment">//!&lt; Read-only access to the wxDialog object.</span>
<a name="l00098"></a>00098 <span class="comment"></span>                        <span class="keywordtype">void</span> notifyChildWindowDestruction();    <span class="comment">//!&lt; Called by wx main thread to set m_hwnd to NULL.</span>
<a name="l00099"></a>00099 <span class="comment"></span>                        <span class="keywordtype">void</span> notifySemThreadReady();    <span class="comment">//!&lt; Called by wx main thread to signal the semaphore that the wx window is built and ready.</span>
<a name="l00100"></a>00100 <span class="comment"></span>
<a name="l00101"></a>00101                 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00102"></a>00102 <span class="comment">                        /** CMD_DESTROY_WIN can be 299,399,499... See WxSubsystem */</span>
<a name="l00103"></a>00103 
<a name="l00104"></a>00104                         <a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html" title="The base class for GUI window classes.">CBaseGUIWindow</a>(<span class="keywordtype">void</span>* winobj_voidptr, <span class="keywordtype">int</span> CMD_CREATE_WIN, <span class="keywordtype">int</span> CMD_DESTROY_WIN, <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;initial_caption = <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>() );
<a name="l00105"></a>00105                         <span class="keyword">virtual</span> ~<a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html" title="The base class for GUI window classes.">CBaseGUIWindow</a>();
<a name="l00106"></a>00106 <span class="comment"></span>
<a name="l00107"></a>00107 <span class="comment">                        /** Returns false if the user has already closed the window.</span>
<a name="l00108"></a>00108 <span class="comment">                          */</span>
<a name="l00109"></a>00109                         <span class="keywordtype">bool</span> isOpen();
<a name="l00110"></a>00110 <span class="comment"></span>
<a name="l00111"></a>00111 <span class="comment">                        /** Resizes the window, stretching the image to fit into the display area.</span>
<a name="l00112"></a>00112 <span class="comment">                         */</span>
<a name="l00113"></a>00113                         <span class="keyword">virtual</span> <span class="keywordtype">void</span>  resize( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height ) = 0;
<a name="l00114"></a>00114 <span class="comment"></span>
<a name="l00115"></a>00115 <span class="comment">                        /** Changes the position of the window on the screen.</span>
<a name="l00116"></a>00116 <span class="comment">                         */</span>
<a name="l00117"></a>00117                         <span class="keyword">virtual</span> <span class="keywordtype">void</span>  setPos( <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a> ) = 0;
<a name="l00118"></a>00118 <span class="comment"></span>
<a name="l00119"></a>00119 <span class="comment">                        /** Changes the window title text.</span>
<a name="l00120"></a>00120 <span class="comment">                          */</span>
<a name="l00121"></a>00121                         <span class="keyword">virtual</span> <span class="keywordtype">void</span> setWindowTitle( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;str )=0;
<a name="l00122"></a>00122 <span class="comment"></span>
<a name="l00123"></a>00123 <span class="comment">                        /** Gets the last x,y pixel coordinates of the mouse. \return False if the window is closed. */</span>
<a name="l00124"></a>00124                         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> getLastMousePosition(<span class="keywordtype">int</span> &amp;x, <span class="keywordtype">int</span> &amp;<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>) <span class="keyword">const</span> = 0;
<a name="l00125"></a>00125 <span class="comment"></span>
<a name="l00126"></a>00126 <span class="comment">                        /** Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true) */</span>
<a name="l00127"></a>00127                         <span class="keyword">virtual</span> <span class="keywordtype">void</span> setCursorCross(<span class="keywordtype">bool</span> cursorIsCross) = 0;
<a name="l00128"></a>00128 <span class="comment"></span>
<a name="l00129"></a>00129 <span class="comment">                        /** Waits for any key to be pushed on the image or the console, and returns the key code.</span>
<a name="l00130"></a>00130 <span class="comment">                          *  This method remove key strokes previous to its call, so it will always wait. To get</span>
<a name="l00131"></a>00131 <span class="comment">                          *   the latest pushed key, see</span>
<a name="l00132"></a>00132 <span class="comment">                          *</span>
<a name="l00133"></a>00133 <span class="comment">                          * \param ignoreControlKeys If set to false, any push of shift, cmd, control, etc... will make this method to return.</span>
<a name="l00134"></a>00134 <span class="comment">                          * \param out_pushModifier If set to !=NULL, the modifiers of the key stroke will be saved here.</span>
<a name="l00135"></a>00135 <span class="comment">                          * \return The virtual key code, as defined in mrptKeyCode (a replication of wxWidgets key codes).</span>
<a name="l00136"></a>00136 <span class="comment">                          *</span>
<a name="l00137"></a>00137 <span class="comment">                          * \sa getPushedKey, Key codes in the enum mrptKeyCode</span>
<a name="l00138"></a>00138 <span class="comment">                          */</span>
<a name="l00139"></a>00139                         <span class="keywordtype">int</span>  waitForKey(<span class="keywordtype">bool</span> ignoreControlKeys = <span class="keyword">true</span>, <a class="code" href="namespacemrpt_1_1gui.html#a1957927b66a163637ab90d2bf3220e11">mrptKeyModifier</a> *out_pushModifier=NULL);
<a name="l00140"></a>00140 <span class="comment"></span>
<a name="l00141"></a>00141 <span class="comment">                        /** Returns true if a key has been pushed, without blocking waiting for a new key being pushed.</span>
<a name="l00142"></a>00142 <span class="comment">                          * \sa waitForKey, clearKeyHitFlag</span>
<a name="l00143"></a>00143 <span class="comment">                          */</span>
<a name="l00144"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a3efeaeb6155ab518c50e54568b7d9858">00144</a>                         <span class="keywordtype">bool</span>  <a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a3efeaeb6155ab518c50e54568b7d9858" title="Returns true if a key has been pushed, without blocking waiting for a new key being pushed...">keyHit</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_keyPushed; }
<a name="l00145"></a>00145 <span class="comment"></span>
<a name="l00146"></a>00146 <span class="comment">                        /** Assure that &quot;keyHit&quot; will return false until the next pushed key.</span>
<a name="l00147"></a>00147 <span class="comment">                          * \sa keyHit, waitForKey</span>
<a name="l00148"></a>00148 <span class="comment">                          */</span>
<a name="l00149"></a><a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a80f82740d0cc3b394fbcb7dbc26cd1a4">00149</a>                         <span class="keywordtype">void</span>  <a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html#a80f82740d0cc3b394fbcb7dbc26cd1a4" title="Assure that &quot;keyHit&quot; will return false until the next pushed key.">clearKeyHitFlag</a>() { m_keyPushed = <span class="keyword">false</span>; }
<a name="l00150"></a>00150 <span class="comment"></span>
<a name="l00151"></a>00151 <span class="comment">                        /** Returns the latest pushed key, or 0 if there is no new key stroke.</span>
<a name="l00152"></a>00152 <span class="comment">                          * \param out_pushModifier If set to !=NULL, the modifiers of the key stroke will be saved here.</span>
<a name="l00153"></a>00153 <span class="comment">                          * \return The virtual key code, as defined in &lt;mrpt/gui/keycodes.h&gt; (a replication of wxWidgets key codes).</span>
<a name="l00154"></a>00154 <span class="comment">                          *</span>
<a name="l00155"></a>00155 <span class="comment">                          * \sa keyHit, waitForKey</span>
<a name="l00156"></a>00156 <span class="comment">                          */</span>
<a name="l00157"></a>00157                         <span class="keywordtype">int</span> getPushedKey(<a class="code" href="namespacemrpt_1_1gui.html#a1957927b66a163637ab90d2bf3220e11">mrptKeyModifier</a> *out_pushModifier=NULL);
<a name="l00158"></a>00158 
<a name="l00159"></a>00159 
<a name="l00160"></a>00160                 }; <span class="comment">// End of class def.</span>
<a name="l00161"></a>00161 
<a name="l00162"></a>00162 <span class="comment"></span>
<a name="l00163"></a>00163 <span class="comment">                /** @name Events common to all GUI windows:</span>
<a name="l00164"></a>00164 <span class="comment">                        @{  */</span>
<a name="l00165"></a>00165 <span class="comment"></span>
<a name="l00166"></a>00166 <span class="comment">                /**  An event sent by a window upon a char pressed by the user.</span>
<a name="l00167"></a>00167 <span class="comment">                  *</span>
<a name="l00168"></a>00168 <span class="comment">                  *  IMPORTANTE NOTICE: Event handlers in your observer class will be invoked from the wxWidgets internal MRPT thread,</span>
<a name="l00169"></a>00169 <span class="comment">                  *    so all your code in the handler must be thread safe.</span>
<a name="l00170"></a>00170 <span class="comment">                  */</span>
<a name="l00171"></a>00171                 <span class="keyword">class </span><a class="code" href="gui_2include_2mrpt_2gui_2link__pragmas_8h.html#a69a861d20c11137851da0fe69a66d7b6">GUI_IMPEXP</a> mrptEventWindowChar : <span class="keyword">public</span> <a class="code" href="classmrpt_1_1utils_1_1mrpt_event.html" title="The basic event type for the observer-observable pattern in MRPT.">mrptEvent</a>
<a name="l00172"></a>00172                 {
<a name="l00173"></a>00173                 <span class="keyword">protected</span>:
<a name="l00174"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_char.html#a92bc871ddd8b7ed913da2d8e4f352597">00174</a>                         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_char.html#a92bc871ddd8b7ed913da2d8e4f352597" title="Just to allow this class to be polymorphic.">do_nothing</a>() { } <span class="comment">//!&lt; Just to allow this class to be polymorphic</span>
<a name="l00175"></a>00175 <span class="comment"></span>                <span class="keyword">public</span>:
<a name="l00176"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_char.html#acb6b780ea12d1e062d689d793b5264f2">00176</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_char.html" title="An event sent by a window upon a char pressed by the user.">mrptEventWindowChar</a>(
<a name="l00177"></a>00177                                 <a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html" title="The base class for GUI window classes.">CBaseGUIWindow</a> *obj,
<a name="l00178"></a>00178                                 <span class="keywordtype">int</span>     _char_code,
<a name="l00179"></a>00179                                 <a class="code" href="namespacemrpt_1_1gui.html#a1957927b66a163637ab90d2bf3220e11">mrptKeyModifier</a> _key_mod
<a name="l00180"></a>00180                                 ) : source_object(obj), char_code(_char_code), key_modifiers(_key_mod) { }
<a name="l00181"></a>00181 
<a name="l00182"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_char.html#aca2f2b3a6063497f6e3490f409b4f0d5">00182</a>                         <a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html" title="The base class for GUI window classes.">CBaseGUIWindow</a> *<a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_char.html#aca2f2b3a6063497f6e3490f409b4f0d5">source_object</a>;
<a name="l00183"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_char.html#aae6b4890ca3c2dfabc0d4e65b42f0240">00183</a>                         <span class="keywordtype">int</span>                     <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_char.html#aae6b4890ca3c2dfabc0d4e65b42f0240" title="The virtual key code, as defined in &lt;mrpt/gui/keycodes.h&gt; (a replication of wxWidgets key codes)...">char_code</a>; <span class="comment">//!&lt; The virtual key code, as defined in &lt;mrpt/gui/keycodes.h&gt; (a replication of wxWidgets key codes).</span>
<a name="l00184"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_char.html#a070eb323032e86f5e3c95e5ca3128889">00184</a> <span class="comment"></span>                        <a class="code" href="namespacemrpt_1_1gui.html#a1957927b66a163637ab90d2bf3220e11">mrptKeyModifier</a> <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_char.html#a070eb323032e86f5e3c95e5ca3128889" title="Modifiers (Shift, Control, etc...)">key_modifiers</a>; <span class="comment">//!&lt; Modifiers (Shift, Control, etc...)</span>
<a name="l00185"></a>00185 <span class="comment"></span>                }; <span class="comment">// End of class def.</span>
<a name="l00186"></a>00186 <span class="comment"></span>
<a name="l00187"></a>00187 <span class="comment">                /**  An event sent by a window upon resize.</span>
<a name="l00188"></a>00188 <span class="comment">                  *</span>
<a name="l00189"></a>00189 <span class="comment">                  *  IMPORTANTE NOTICE: Event handlers in your observer class will be invoked from the wxWidgets internal MRPT thread,</span>
<a name="l00190"></a>00190 <span class="comment">                  *    so all your code in the handler must be thread safe.</span>
<a name="l00191"></a>00191 <span class="comment">                  */</span>
<a name="l00192"></a>00192                 <span class="keyword">class </span><a class="code" href="gui_2include_2mrpt_2gui_2link__pragmas_8h.html#a69a861d20c11137851da0fe69a66d7b6">GUI_IMPEXP</a> <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_resize.html" title="An event sent by a window upon resize.">mrptEventWindowResize</a> : <span class="keyword">public</span> <a class="code" href="classmrpt_1_1utils_1_1mrpt_event.html" title="The basic event type for the observer-observable pattern in MRPT.">mrptEvent</a>
<a name="l00193"></a>00193                 {
<a name="l00194"></a>00194                 <span class="keyword">protected</span>:
<a name="l00195"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_resize.html#a551f070ee9724b870f4ee52aea566ff1">00195</a>                         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_resize.html#a551f070ee9724b870f4ee52aea566ff1" title="Just to allow this class to be polymorphic.">do_nothing</a>() { } <span class="comment">//!&lt; Just to allow this class to be polymorphic</span>
<a name="l00196"></a>00196 <span class="comment"></span>                <span class="keyword">public</span>:
<a name="l00197"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_resize.html#a3c25c4550ab160e92bfdfb0787e6e5e7">00197</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_resize.html" title="An event sent by a window upon resize.">mrptEventWindowResize</a>(
<a name="l00198"></a>00198                                 <a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html" title="The base class for GUI window classes.">CBaseGUIWindow</a> *obj,
<a name="l00199"></a>00199                                 <span class="keywordtype">size_t</span> _new_width,
<a name="l00200"></a>00200                                 <span class="keywordtype">size_t</span> _new_height) : source_object(obj), new_width(_new_width), new_height(_new_width) { }
<a name="l00201"></a>00201 
<a name="l00202"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_resize.html#abd614d84c109ad0508da7645197f771d">00202</a>                         <a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html" title="The base class for GUI window classes.">CBaseGUIWindow</a> *<a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_resize.html#abd614d84c109ad0508da7645197f771d">source_object</a>;
<a name="l00203"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_resize.html#a03a838e94db06c22c8933b16dd9355de">00203</a>                         <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_window_resize.html#a03a838e94db06c22c8933b16dd9355de">new_width</a>, new_height;
<a name="l00204"></a>00204                 }; <span class="comment">// End of class def.</span>
<a name="l00205"></a>00205 <span class="comment"></span>
<a name="l00206"></a>00206 <span class="comment">                /**  An event sent by a window upon a mouse click, giving the (x,y) pixel coordinates.</span>
<a name="l00207"></a>00207 <span class="comment">                  *</span>
<a name="l00208"></a>00208 <span class="comment">                  *  IMPORTANTE NOTICE: Event handlers in your observer class will be invoked from the wxWidgets internal MRPT thread,</span>
<a name="l00209"></a>00209 <span class="comment">                  *    so all your code in the handler must be thread safe.</span>
<a name="l00210"></a>00210 <span class="comment">                  *</span>
<a name="l00211"></a>00211 <span class="comment">                  * \sa mrptEventMouseDown</span>
<a name="l00212"></a>00212 <span class="comment">                  */</span>
<a name="l00213"></a>00213                 <span class="keyword">class </span><a class="code" href="gui_2include_2mrpt_2gui_2link__pragmas_8h.html#a69a861d20c11137851da0fe69a66d7b6">GUI_IMPEXP</a> <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html" title="An event sent by a window upon a mouse click, giving the (x,y) pixel coordinates.">mrptEventMouseDown</a> : <span class="keyword">public</span> <a class="code" href="classmrpt_1_1utils_1_1mrpt_event.html" title="The basic event type for the observer-observable pattern in MRPT.">mrptEvent</a>
<a name="l00214"></a>00214                 {
<a name="l00215"></a>00215                 <span class="keyword">protected</span>:
<a name="l00216"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html#ab27ba5fb02d35e41abc881119e9b25b3">00216</a>                         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html#ab27ba5fb02d35e41abc881119e9b25b3" title="Just to allow this class to be polymorphic.">do_nothing</a>() { } <span class="comment">//!&lt; Just to allow this class to be polymorphic</span>
<a name="l00217"></a>00217 <span class="comment"></span>                <span class="keyword">public</span>:
<a name="l00218"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html#af9ece1bec54108a1dadf7eb24963e393">00218</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html" title="An event sent by a window upon a mouse click, giving the (x,y) pixel coordinates.">mrptEventMouseDown</a> (
<a name="l00219"></a>00219                                 <a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html" title="The base class for GUI window classes.">CBaseGUIWindow</a> *obj,
<a name="l00220"></a>00220                                 <a class="code" href="structmrpt_1_1utils_1_1_t_pixel_coord.html" title="A pair (x,y) of pixel coordinates (integer resolution).">mrpt::utils::TPixelCoord</a>  _coords,
<a name="l00221"></a>00221                                 <span class="keywordtype">bool</span>   _leftButton,
<a name="l00222"></a>00222                                 <span class="keywordtype">bool</span>   _rightButton
<a name="l00223"></a>00223                                 ) : source_object(obj), coords(_coords), leftButton(_leftButton), rightButton(_rightButton)
<a name="l00224"></a>00224                         { }
<a name="l00225"></a>00225 
<a name="l00226"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html#ac733f37d83364cea8a0a45d633caf97b">00226</a>                         <a class="code" href="classmrpt_1_1gui_1_1_c_base_g_u_i_window.html" title="The base class for GUI window classes.">CBaseGUIWindow</a> *<a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html#ac733f37d83364cea8a0a45d633caf97b">source_object</a>;
<a name="l00227"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html#a18e18dcde44b87b1a0cba8378112e65b">00227</a>                         mrpt<a class="code" href="structmrpt_1_1utils_1_1_t_pixel_coord.html" title="A pair (x,y) of pixel coordinates (integer resolution).">::utils::TPixelCoord</a>  <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html#a18e18dcde44b87b1a0cba8378112e65b">coords</a>;
<a name="l00228"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html#ae820bb746b5e654fadcd251892e10726">00228</a>                         <span class="keywordtype">bool</span>   <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html#ae820bb746b5e654fadcd251892e10726">leftButton</a>;
<a name="l00229"></a><a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html#a8b83ef4f7c864d42555e1dd0cfdda827">00229</a>                         <span class="keywordtype">bool</span>   <a class="code" href="classmrpt_1_1gui_1_1mrpt_event_mouse_down.html#a8b83ef4f7c864d42555e1dd0cfdda827">rightButton</a>;
<a name="l00230"></a>00230                 }; <span class="comment">// End of class def.</span>
<a name="l00231"></a>00231 <span class="comment"></span>
<a name="l00232"></a>00232 <span class="comment">                /**  @} */</span>
<a name="l00233"></a>00233 
<a name="l00234"></a>00234         } <span class="comment">// End of namespace</span>
<a name="l00235"></a>00235 
<a name="l00236"></a>00236 } <span class="comment">// End of namespace</span>
<a name="l00237"></a>00237 
<a name="l00238"></a>00238 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<br><hr><br> <table border="0" width="100%"> <tr> <td> Page generated by <a href="http://www.doxygen.org" target="_blank">Doxygen 1.7.5</a> for MRPT 0.9.5 SVN: at Sun Sep 25 17:20:18 UTC 2011</td><td></td> <td width="100"> </td> <td width="150">  </td></tr> </table>  </body></html>