frame.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/univ/frame.h
  3. // Purpose: wxFrame class for wxUniversal
  4. // Author: Vadim Zeitlin
  5. // Modified by:
  6. // Created: 19.05.01
  7. // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_UNIV_FRAME_H_
  11. #define _WX_UNIV_FRAME_H_
  12. // ----------------------------------------------------------------------------
  13. // wxFrame
  14. // ----------------------------------------------------------------------------
  15. class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
  16. {
  17. public:
  18. wxFrame() {}
  19. wxFrame(wxWindow *parent,
  20. wxWindowID id,
  21. const wxString& title,
  22. const wxPoint& pos = wxDefaultPosition,
  23. const wxSize& size = wxDefaultSize,
  24. long style = wxDEFAULT_FRAME_STYLE,
  25. const wxString& name = wxFrameNameStr)
  26. {
  27. Create(parent, id, title, pos, size, style, name);
  28. }
  29. bool Create(wxWindow *parent,
  30. wxWindowID id,
  31. const wxString& title,
  32. const wxPoint& pos = wxDefaultPosition,
  33. const wxSize& size = wxDefaultSize,
  34. long style = wxDEFAULT_FRAME_STYLE,
  35. const wxString& name = wxFrameNameStr);
  36. virtual wxPoint GetClientAreaOrigin() const;
  37. virtual bool Enable(bool enable = true);
  38. #if wxUSE_STATUSBAR
  39. virtual wxStatusBar* CreateStatusBar(int number = 1,
  40. long style = wxSTB_DEFAULT_STYLE,
  41. wxWindowID id = 0,
  42. const wxString& name = wxStatusLineNameStr);
  43. #endif // wxUSE_STATUSBAR
  44. #if wxUSE_TOOLBAR
  45. // create main toolbar bycalling OnCreateToolBar()
  46. virtual wxToolBar* CreateToolBar(long style = -1,
  47. wxWindowID id = wxID_ANY,
  48. const wxString& name = wxToolBarNameStr);
  49. #endif // wxUSE_TOOLBAR
  50. virtual wxSize GetMinSize() const;
  51. protected:
  52. void OnSize(wxSizeEvent& event);
  53. void OnSysColourChanged(wxSysColourChangedEvent& event);
  54. virtual void DoGetClientSize(int *width, int *height) const;
  55. virtual void DoSetClientSize(int width, int height);
  56. #if wxUSE_MENUS
  57. // override to update menu bar position when the frame size changes
  58. virtual void PositionMenuBar();
  59. virtual void DetachMenuBar();
  60. virtual void AttachMenuBar(wxMenuBar *menubar);
  61. #endif // wxUSE_MENUS
  62. #if wxUSE_STATUSBAR
  63. // override to update statusbar position when the frame size changes
  64. virtual void PositionStatusBar();
  65. #endif // wxUSE_MENUS
  66. protected:
  67. #if wxUSE_TOOLBAR
  68. virtual void PositionToolBar();
  69. #endif // wxUSE_TOOLBAR
  70. DECLARE_EVENT_TABLE()
  71. DECLARE_DYNAMIC_CLASS(wxFrame)
  72. };
  73. #endif // _WX_UNIV_FRAME_H_