toolbar.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/motif/toolbar.h
  3. // Purpose: wxToolBar class
  4. // Author: Julian Smart
  5. // Modified by: 13.12.99 by VZ during toolbar classes reorganization
  6. // Created: 17/09/98
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_TOOLBAR_H_
  11. #define _WX_TOOLBAR_H_
  12. class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
  13. {
  14. public:
  15. // ctors and dtor
  16. wxToolBar() { Init(); }
  17. wxToolBar(wxWindow *parent,
  18. wxWindowID id,
  19. const wxPoint& pos = wxDefaultPosition,
  20. const wxSize& size = wxDefaultSize,
  21. long style = wxTB_HORIZONTAL,
  22. const wxString& name = wxToolBarNameStr)
  23. {
  24. Init();
  25. Create(parent, id, pos, size, style, name);
  26. }
  27. bool Create(wxWindow *parent,
  28. wxWindowID id,
  29. const wxPoint& pos = wxDefaultPosition,
  30. const wxSize& size = wxDefaultSize,
  31. long style = wxTB_HORIZONTAL,
  32. const wxString& name = wxToolBarNameStr);
  33. virtual ~wxToolBar();
  34. // override/implement base class virtuals
  35. virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
  36. virtual bool Realize();
  37. // implementation from now on
  38. // find tool by widget
  39. wxToolBarToolBase *FindToolByWidget(WXWidget w) const;
  40. private:
  41. // common part of all ctors
  42. void Init();
  43. // implement base class pure virtuals
  44. virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
  45. virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
  46. virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
  47. virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
  48. virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
  49. virtual wxToolBarToolBase *CreateTool(int id,
  50. const wxString& label,
  51. const wxBitmap& bmpNormal,
  52. const wxBitmap& bmpDisabled,
  53. wxItemKind kind,
  54. wxObject *clientData,
  55. const wxString& shortHelp,
  56. const wxString& longHelp);
  57. virtual wxToolBarToolBase *CreateTool(wxControl *control,
  58. const wxString& label);
  59. virtual void DoSetSize(int x, int y,
  60. int width, int height,
  61. int sizeFlags = wxSIZE_AUTO);
  62. private:
  63. DECLARE_DYNAMIC_CLASS(wxToolBar)
  64. };
  65. #endif
  66. // _WX_TOOLBAR_H_