]>
git.saurik.com Git - wxWidgets.git/blob - src/univ/framuniv.cpp
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
,
58 return wxTopLevelWindow::Create(parent
, id
, title
, pos
, size
, style
, name
);
62 // ----------------------------------------------------------------------------
64 // ----------------------------------------------------------------------------
66 void wxFrame::OnSize(wxSizeEvent
& event
)
77 void wxFrame::PositionMenuBar()
81 // the menubar is positioned above the client size, hence the negative
83 wxCoord heightMbar
= m_frameMenuBar
->GetSize().y
;
84 m_frameMenuBar
->SetSize(0, -heightMbar
,
85 GetClientSize().x
, heightMbar
);
91 wxPoint
wxFrame::GetClientAreaOrigin() const
93 wxPoint pt
= wxFrameBase::GetClientAreaOrigin();
98 pt
.y
+= m_frameMenuBar
->GetSize().y
;
100 #endif // wxUSE_MENUS
105 void wxFrame::DoGetClientSize(int *width
, int *height
) const
107 wxFrameBase::DoGetClientSize(width
, height
);
109 if ( m_frameMenuBar
&& height
)
111 (*height
) -= m_frameMenuBar
->GetSize().y
;
113 #endif // wxUSE_MENUS
116 void wxFrame::DoSetClientSize(int width
, int height
)
119 if ( m_frameMenuBar
)
121 height
+= m_frameMenuBar
->GetSize().y
;
123 #endif // wxUSE_MENUS
124 wxFrameBase::DoSetClientSize(width
, height
);
127 bool wxFrame::Enable(bool enable
)
129 if (!wxFrameBase::Enable(enable
))
131 #ifdef __WXMICROWIN__
133 m_frameMenuBar
->Enable(enable
);