frame.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/motif/frame.h
  3. // Purpose: wxFrame class
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 17/09/98
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_MOTIF_FRAME_H_
  11. #define _WX_MOTIF_FRAME_H_
  12. class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
  13. {
  14. public:
  15. wxFrame() { Init(); }
  16. wxFrame(wxWindow *parent,
  17. wxWindowID id,
  18. const wxString& title,
  19. const wxPoint& pos = wxDefaultPosition,
  20. const wxSize& size = wxDefaultSize,
  21. long style = wxDEFAULT_FRAME_STYLE,
  22. const wxString& name = wxFrameNameStr)
  23. {
  24. Init();
  25. Create(parent, id, title, pos, size, style, name);
  26. }
  27. bool Create(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. virtual ~wxFrame();
  35. virtual bool Show(bool show = true);
  36. // Set menu bar
  37. void SetMenuBar(wxMenuBar *menu_bar);
  38. // Set title
  39. void SetTitle(const wxString& title);
  40. // Set icon
  41. virtual void SetIcons(const wxIconBundle& icons);
  42. #if wxUSE_STATUSBAR
  43. virtual void PositionStatusBar();
  44. #endif // wxUSE_STATUSBAR
  45. // Create toolbar
  46. #if wxUSE_TOOLBAR
  47. virtual wxToolBar* CreateToolBar(long style = -1,
  48. wxWindowID id = wxID_ANY,
  49. const wxString& name = wxToolBarNameStr);
  50. virtual void SetToolBar(wxToolBar *toolbar);
  51. virtual void PositionToolBar();
  52. #endif // wxUSE_TOOLBAR
  53. // Implementation only from now on
  54. // -------------------------------
  55. void OnSysColourChanged(wxSysColourChangedEvent& event);
  56. void OnActivate(wxActivateEvent& event);
  57. virtual void ChangeFont(bool keepOriginalSize = true);
  58. virtual void ChangeBackgroundColour();
  59. virtual void ChangeForegroundColour();
  60. WXWidget GetMenuBarWidget() const;
  61. WXWidget GetShellWidget() const { return m_frameShell; }
  62. WXWidget GetWorkAreaWidget() const { return m_workArea; }
  63. WXWidget GetClientAreaWidget() const { return m_clientArea; }
  64. WXWidget GetTopWidget() const { return m_frameShell; }
  65. virtual WXWidget GetMainWidget() const { return m_mainWidget; }
  66. // The widget that can have children on it
  67. WXWidget GetClientWidget() const;
  68. bool GetVisibleStatus() const { return m_visibleStatus; }
  69. void SetVisibleStatus( bool status ) { m_visibleStatus = status; }
  70. bool PreResize();
  71. // for generic/mdig.h
  72. virtual void DoGetClientSize(int *width, int *height) const;
  73. private:
  74. // common part of all ctors
  75. void Init();
  76. // set a single icon for the frame
  77. void DoSetIcon( const wxIcon& icon );
  78. //// Motif-specific
  79. WXWidget m_frameShell;
  80. WXWidget m_workArea;
  81. WXWidget m_clientArea;
  82. bool m_visibleStatus;
  83. bool m_iconized;
  84. virtual void DoGetSize(int *width, int *height) const;
  85. virtual void DoSetSize(int x, int y,
  86. int width, int height,
  87. int sizeFlags = wxSIZE_AUTO);
  88. virtual void DoSetClientSize(int width, int height);
  89. private:
  90. virtual bool XmDoCreateTLW(wxWindow* parent,
  91. wxWindowID id,
  92. const wxString& title,
  93. const wxPoint& pos,
  94. const wxSize& size,
  95. long style,
  96. const wxString& name);
  97. DECLARE_EVENT_TABLE()
  98. DECLARE_DYNAMIC_CLASS(wxFrame)
  99. };
  100. #endif // _WX_MOTIF_FRAME_H_