1///////////////////////////////////////////////////////////////////////////// 2// Name: toolbar.h 3// Purpose: wxToolBar class 4// Author: Stefan Csomor 5// Modified by: 6// Created: 1998-01-01 7// RCS-ID: $Id: toolbar.h 41020 2006-09-05 20:47:48Z VZ $ 8// Copyright: (c) Stefan Csomor 9// Licence: wxWindows licence 10///////////////////////////////////////////////////////////////////////////// 11 12#ifndef _WX_TOOLBAR_H_ 13#define _WX_TOOLBAR_H_ 14 15#if wxUSE_TOOLBAR 16 17#include "wx/tbarbase.h" 18#include "wx/dynarray.h" 19 20WXDLLEXPORT_DATA(extern const wxChar) wxToolBarNameStr[]; 21 22class WXDLLEXPORT wxToolBar: public wxToolBarBase 23{ 24 DECLARE_DYNAMIC_CLASS(wxToolBar) 25 public: 26 /* 27 * Public interface 28 */ 29 30 wxToolBar() { Init(); } 31 32 33 inline wxToolBar(wxWindow *parent, wxWindowID id, 34 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, 35 long style = wxNO_BORDER|wxTB_HORIZONTAL, 36 const wxString& name = wxToolBarNameStr) 37 { 38 Init(); 39 Create(parent, id, pos, size, style, name); 40 } 41 virtual ~wxToolBar(); 42 43 bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, 44 long style = wxNO_BORDER|wxTB_HORIZONTAL, 45 const wxString& name = wxToolBarNameStr); 46 47 // override/implement base class virtuals 48 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; 49 50 virtual bool Realize(); 51 52 virtual void SetToolBitmapSize(const wxSize& size); 53 virtual wxSize GetToolSize() const; 54 55 virtual void SetRows(int nRows); 56 57 // Add all the buttons 58 59 virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; 60 virtual wxString MacGetToolTipString( wxPoint &where ) ; 61 void OnPaint(wxPaintEvent& event) ; 62 void OnMouse(wxMouseEvent& event) ; 63 virtual void MacSuperChangedPosition() ; 64protected: 65 // common part of all ctors 66 void Init(); 67 68 // implement base class pure virtuals 69 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); 70 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); 71 72 virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable); 73 virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle); 74 virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle); 75 76 virtual wxToolBarToolBase *CreateTool(int id, 77 const wxString& label, 78 const wxBitmap& bmpNormal, 79 const wxBitmap& bmpDisabled, 80 wxItemKind kind, 81 wxObject *clientData, 82 const wxString& shortHelp, 83 const wxString& longHelp); 84 virtual wxToolBarToolBase *CreateTool(wxControl *control); 85 86 DECLARE_EVENT_TABLE() 87}; 88 89#endif // wxUSE_TOOLBAR 90 91#endif 92 // _WX_TOOLBAR_H_ 93