collpane.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk/collpane.h
  3. // Purpose: wxCollapsiblePane
  4. // Author: Francesco Montorsi
  5. // Modified by:
  6. // Created: 8/10/2006
  7. // Copyright: (c) Francesco Montorsi
  8. // Licence: wxWindows Licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_COLLAPSABLE_PANEL_H_GTK_
  11. #define _WX_COLLAPSABLE_PANEL_H_GTK_
  12. // ----------------------------------------------------------------------------
  13. // wxCollapsiblePane
  14. // ----------------------------------------------------------------------------
  15. class WXDLLIMPEXP_CORE wxCollapsiblePane : public wxCollapsiblePaneBase
  16. {
  17. public:
  18. wxCollapsiblePane() { Init(); }
  19. wxCollapsiblePane(wxWindow *parent,
  20. wxWindowID winid,
  21. const wxString& label,
  22. const wxPoint& pos = wxDefaultPosition,
  23. const wxSize& size = wxDefaultSize,
  24. long style = wxCP_DEFAULT_STYLE,
  25. const wxValidator& val = wxDefaultValidator,
  26. const wxString& name = wxCollapsiblePaneNameStr)
  27. {
  28. Init();
  29. Create(parent, winid, label, pos, size, style, val, name);
  30. }
  31. bool Create(wxWindow *parent,
  32. wxWindowID winid,
  33. const wxString& label,
  34. const wxPoint& pos = wxDefaultPosition,
  35. const wxSize& size = wxDefaultSize,
  36. long style = wxCP_DEFAULT_STYLE,
  37. const wxValidator& val = wxDefaultValidator,
  38. const wxString& name = wxCollapsiblePaneNameStr);
  39. virtual void Collapse(bool collapse = true);
  40. virtual bool IsCollapsed() const;
  41. virtual void SetLabel(const wxString& str);
  42. virtual wxWindow *GetPane() const { return m_pPane; }
  43. virtual wxString GetLabel() const { return m_strLabel; }
  44. protected:
  45. virtual wxSize DoGetBestSize() const;
  46. public: // used by GTK callbacks
  47. bool m_bIgnoreNextChange;
  48. wxSize m_szCollapsed;
  49. wxWindow *m_pPane;
  50. // the button label without ">>" or "<<"
  51. wxString m_strLabel;
  52. private:
  53. void Init()
  54. {
  55. m_bIgnoreNextChange = false;
  56. }
  57. void OnSize(wxSizeEvent&);
  58. virtual void AddChildGTK(wxWindowGTK* child);
  59. GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
  60. DECLARE_DYNAMIC_CLASS(wxCollapsiblePane)
  61. DECLARE_EVENT_TABLE()
  62. };
  63. #endif // _WX_COLLAPSABLE_PANEL_H_GTK_