frame.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk1/frame.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling, Julian Smart
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef __GTKFRAMEH__
  9. #define __GTKFRAMEH__
  10. //-----------------------------------------------------------------------------
  11. // classes
  12. //-----------------------------------------------------------------------------
  13. class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
  14. class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
  15. class WXDLLIMPEXP_FWD_CORE wxMenu;
  16. class WXDLLIMPEXP_FWD_CORE wxMenuBar;
  17. class WXDLLIMPEXP_FWD_CORE wxToolBar;
  18. class WXDLLIMPEXP_FWD_CORE wxStatusBar;
  19. //-----------------------------------------------------------------------------
  20. // wxFrame
  21. //-----------------------------------------------------------------------------
  22. class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
  23. {
  24. public:
  25. // construction
  26. wxFrame() { Init(); }
  27. wxFrame(wxWindow *parent,
  28. wxWindowID id,
  29. const wxString& title,
  30. const wxPoint& pos = wxDefaultPosition,
  31. const wxSize& size = wxDefaultSize,
  32. long style = wxDEFAULT_FRAME_STYLE,
  33. const wxString& name = wxFrameNameStr)
  34. {
  35. Init();
  36. Create(parent, id, title, pos, size, style, name);
  37. }
  38. bool Create(wxWindow *parent,
  39. wxWindowID id,
  40. const wxString& title,
  41. const wxPoint& pos = wxDefaultPosition,
  42. const wxSize& size = wxDefaultSize,
  43. long style = wxDEFAULT_FRAME_STYLE,
  44. const wxString& name = wxFrameNameStr);
  45. virtual ~wxFrame();
  46. #if wxUSE_STATUSBAR
  47. virtual void PositionStatusBar();
  48. virtual wxStatusBar* CreateStatusBar(int number = 1,
  49. long style = wxSTB_DEFAULT_STYLE,
  50. wxWindowID id = 0,
  51. const wxString& name = wxStatusLineNameStr);
  52. void SetStatusBar(wxStatusBar *statbar);
  53. #endif // wxUSE_STATUSBAR
  54. #if wxUSE_TOOLBAR
  55. virtual wxToolBar* CreateToolBar(long style = -1,
  56. wxWindowID id = -1,
  57. const wxString& name = wxToolBarNameStr);
  58. void SetToolBar(wxToolBar *toolbar);
  59. #endif // wxUSE_TOOLBAR
  60. wxPoint GetClientAreaOrigin() const { return wxPoint(0, 0); }
  61. // implementation from now on
  62. // --------------------------
  63. // GTK callbacks
  64. virtual void GtkOnSize( int x, int y, int width, int height );
  65. virtual void OnInternalIdle();
  66. bool m_menuBarDetached;
  67. int m_menuBarHeight;
  68. bool m_toolBarDetached;
  69. protected:
  70. // common part of all ctors
  71. void Init();
  72. // override wxWindow methods to take into account tool/menu/statusbars
  73. virtual void DoSetClientSize(int width, int height);
  74. virtual void DoGetClientSize( int *width, int *height ) const;
  75. #if wxUSE_MENUS_NATIVE
  76. virtual void DetachMenuBar();
  77. virtual void AttachMenuBar(wxMenuBar *menubar);
  78. public:
  79. // Menu size is dynamic now, call this whenever it might change.
  80. void UpdateMenuBarSize();
  81. #endif // wxUSE_MENUS_NATIVE
  82. DECLARE_DYNAMIC_CLASS(wxFrame)
  83. };
  84. #endif // __GTKFRAMEH__