X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d697657f1ec08e787f06bbb36be3d1bb4858101d..e91e1e3d5cab263883c1cee1689c898b8f7c4ecd:/include/wx/os2/toolbar.h?ds=inline diff --git a/include/wx/os2/toolbar.h b/include/wx/os2/toolbar.h index 5b3fb460c8..d0fc1a1c7d 100644 --- a/include/wx/os2/toolbar.h +++ b/include/wx/os2/toolbar.h @@ -1,10 +1,9 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: toolbar.h +// Name: wx/os2/toolbar.h // Purpose: wxToolBar class // Author: David Webster // Modified by: // Created: 10/17/98 -// RCS-ID: $Id$ // Copyright: (c) David Webster // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -13,24 +12,32 @@ #define _WX_TOOLBAR_H_ #if wxUSE_TOOLBAR +#include "wx/timer.h" #include "wx/tbarbase.h" -class WXDLLEXPORT wxToolBar: public wxToolBarBase +#define ID_TOOLTIMER 100 +#define ID_TOOLEXPTIMER 101 + +class WXDLLIMPEXP_CORE wxToolBar: public wxToolBarBase { public: /* * Public interface */ - wxToolBar() { Init(); } + wxToolBar() + : m_vToolTimer(this, ID_TOOLTIMER) + , m_vToolExpTimer(this, ID_TOOLEXPTIMER) + { Init(); } inline wxToolBar( wxWindow* pParent ,wxWindowID vId ,const wxPoint& rPos = wxDefaultPosition ,const wxSize& rSize = wxDefaultSize - ,long lStyle = wxNO_BORDER | wxTB_HORIZONTAL + ,long lStyle = wxTB_HORIZONTAL ,const wxString& rName = wxToolBarNameStr - ) + ) : m_vToolTimer(this, ID_TOOLTIMER) + , m_vToolExpTimer(this, ID_TOOLEXPTIMER) { Init(); Create( pParent @@ -47,7 +54,7 @@ public: ,wxWindowID vId ,const wxPoint& rPos = wxDefaultPosition ,const wxSize& rSize = wxDefaultSize - ,long lStyle = wxNO_BORDER | wxTB_HORIZONTAL + ,long lStyle = wxTB_HORIZONTAL ,const wxString& rName = wxToolBarNameStr ); @@ -61,6 +68,47 @@ public: virtual bool Realize(void); virtual void SetRows(int nRows); + // + // Special overrides for OS/2 + // + virtual wxToolBarToolBase* InsertControl( size_t nPos + ,wxControl* pControl + ); + virtual wxToolBarToolBase* InsertSeparator(size_t nPos); + virtual wxToolBarToolBase* InsertTool( size_t nPos + ,int nId + ,const wxString& rsLabel + ,const wxBitmap& rBitmap + ,const wxBitmap& rBmpDisabled = wxNullBitmap + ,wxItemKind eKind = wxITEM_NORMAL + ,const wxString& rsShortHelp = wxEmptyString + ,const wxString& rsLongHelp = wxEmptyString + ,wxObject* pClientData = NULL + ); + wxToolBarToolBase* InsertTool( size_t nPos + ,int nId + ,const wxBitmap& rBitmap + ,const wxBitmap& rBmpDisabled = wxNullBitmap + ,bool bToggle = FALSE + ,wxObject* pClientData = NULL + ,const wxString& rsShortHelp = wxEmptyString + ,const wxString& rsLongHelp = wxEmptyString + ) + { + return InsertTool( nPos + ,nId + ,wxEmptyString + ,rBitmap + ,rBmpDisabled + ,bToggle ? wxITEM_CHECK : wxITEM_NORMAL + ,rsShortHelp + ,rsLongHelp + ,pClientData + ); + } + virtual bool DeleteTool(int nId); + virtual bool DeleteToolByPos(size_t nPos); + // // Event handlers // @@ -116,7 +164,8 @@ protected: ,const wxString& rsShortHelp ,const wxString& rsLongHelp ); - virtual wxToolBarToolBase* CreateTool(wxControl* pControl); + virtual wxToolBarToolBase* CreateTool(wxControl* pControl, + const wxString& label); // // Helpers @@ -146,9 +195,25 @@ private: void RaiseTool( wxToolBarToolBase* pTool ,bool bRaise = TRUE ); + void OnTimer(wxTimerEvent& rEvent); static bool m_bInitialized; + wxTimer m_vToolTimer; + wxTimer m_vToolExpTimer; + wxToolTip* m_pToolTip; + wxCoord m_vXMouse; + wxCoord m_vYMouse; + + // + // Virtual function hiding supression + virtual wxToolBarToolBase *InsertTool (size_t nPos, wxToolBarToolBase* pTool) + { + return( wxToolBarBase::InsertTool( nPos + ,pTool + )); + } + DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxToolBar) };