1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: univ/frame.cpp
3 // Purpose: wxFrame class for wxUniversal
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ===========================================================================
14 // ===========================================================================
16 // ---------------------------------------------------------------------------
18 // ---------------------------------------------------------------------------
21 #pragma implementation "univframe.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
36 // ============================================================================
38 // ============================================================================
40 BEGIN_EVENT_TABLE(wxFrame
, wxFrameBase
)
41 EVT_SIZE(wxFrame
::OnSize
)
44 IMPLEMENT_DYNAMIC_CLASS(wxFrame
, wxTopLevelWindow
)
46 // ----------------------------------------------------------------------------
48 // ----------------------------------------------------------------------------
50 bool wxFrame
::Create(wxWindow
*parent
,
52 const wxString
& title
,
59 return wxTopLevelWindow
::Create(parent
, id
, title
, pos
, size
, style
, name
);
63 // ----------------------------------------------------------------------------
65 // ----------------------------------------------------------------------------
67 void wxFrame
::OnSize(wxSizeEvent
& event
)
78 void wxFrame
::PositionMenuBar()
82 // the menubar is positioned above the client size, hence the negative
84 wxCoord heightMbar
= m_frameMenuBar
->GetSize().y
;
85 m_frameMenuBar
->SetSize(0, -heightMbar
,
86 GetClientSize().x
, heightMbar
);
92 wxPoint wxFrame
::GetClientAreaOrigin() const
94 wxPoint pt
= wxFrameBase
::GetClientAreaOrigin();
99 pt
.y
+= m_frameMenuBar
->GetSize().y
;
101 #endif // wxUSE_MENUS
106 void wxFrame
::DoGetClientSize(int *width
, int *height
) const
108 wxFrameBase
::DoGetClientSize(width
, height
);
110 if ( m_frameMenuBar
&& height
)
112 (*height
) -= m_frameMenuBar
->GetSize().y
;
114 #endif // wxUSE_MENUS
117 void wxFrame
::DoSetClientSize(int width
, int height
)
120 if ( m_frameMenuBar
)
122 height
+= m_frameMenuBar
->GetSize().y
;
124 #endif // wxUSE_MENUS
125 wxFrameBase
::DoSetClientSize(width
, height
);
128 bool wxFrame
::Enable(bool enable
)
130 if (!wxFrameBase
::Enable(enable
))
132 #ifdef __WXMICROWIN__
134 m_frameMenuBar
->Enable(enable
);