X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1169a91932273bc84c23ed9dbd0a2da064d59d66..07502d7351ab56770752ad01ee28af497cf2ab9c:/include/wx/univ/toolbar.h?ds=sidebyside diff --git a/include/wx/univ/toolbar.h b/include/wx/univ/toolbar.h index c4770ccf66..1743a174fb 100644 --- a/include/wx/univ/toolbar.h +++ b/include/wx/univ/toolbar.h @@ -12,10 +12,6 @@ #ifndef _WX_UNIV_TOOLBAR_H_ #define _WX_UNIV_TOOLBAR_H_ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "univtoolbar.h" -#endif - #include "wx/button.h" // for wxStdButtonInputHandler class WXDLLEXPORT wxToolBarTool; @@ -36,16 +32,21 @@ class WXDLLEXPORT wxToolBarTool; // ---------------------------------------------------------------------------- class WXDLLEXPORT wxToolBar : public wxToolBarBase -{ +{ public: // construction/destruction - wxToolBar(); + wxToolBar() { Init(); } wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxToolBarNameStr); + const wxString& name = wxToolBarNameStr) + { + Init(); + + Create(parent, id, pos, size, style, name); + } bool Create( wxWindow *parent, wxWindowID id, @@ -53,11 +54,13 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxToolBarNameStr ); - + virtual ~wxToolBar(); virtual bool Realize(); + virtual void SetWindowStyleFlag( long style ); + virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; virtual void SetToolShortHelp(int id, const wxString& helpString); @@ -65,7 +68,16 @@ public: virtual void SetMargins(int x, int y); void SetMargins(const wxSize& size) { SetMargins((int) size.x, (int) size.y); } - + + virtual bool PerformAction(const wxControlAction& action, + long numArg = -1, + const wxString& strArg = wxEmptyString); + static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef); + virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) + { + return GetStdInputHandler(handlerDef); + } + protected: // common part of all ctors void Init(); @@ -88,10 +100,6 @@ protected: const wxString& longHelp); virtual wxToolBarToolBase *CreateTool(wxControl *control); - // implement wxUniversal methods - virtual bool PerformAction(const wxControlAction& action, - long numArg = -1, - const wxString& strArg = wxEmptyString); virtual wxSize DoGetBestClientSize() const; virtual void DoSetSize(int x, int y, int width, int height, @@ -105,9 +113,9 @@ protected: void RefreshTool(wxToolBarToolBase *tool); // (re)calculate the tool positions, should only be called if it is - // necessary to do it, i.e. m_needsLayout == TRUE + // necessary to do it, i.e. m_needsLayout == true void DoLayout(); - + // get the rect limits depending on the orientation: top/bottom for a // vertical toolbar, left/right for a horizontal one void GetRectLimits(const wxRect& rect, wxCoord *start, wxCoord *end) const; @@ -127,29 +135,4 @@ private: DECLARE_DYNAMIC_CLASS(wxToolBar) }; -// ---------------------------------------------------------------------------- -// wxStdToolbarInputHandler: translates SPACE and ENTER keys and the left mouse -// click into button press/release actions -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdToolbarInputHandler : public wxStdInputHandler -{ -public: - wxStdToolbarInputHandler(wxInputHandler *inphand); - - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event); - virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event); - virtual bool HandleActivation(wxInputConsumer *consumer, bool activated); - -private: - wxWindow *m_winCapture; - wxToolBarToolBase *m_toolCapture; - wxToolBarToolBase *m_toolLast; -}; - #endif // _WX_UNIV_TOOLBAR_H_