]>
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"
34 #include "wx/statusbr.h"
37 // ============================================================================
39 // ============================================================================
41 BEGIN_EVENT_TABLE(wxFrame
, wxFrameBase
)
42 EVT_SIZE(wxFrame::OnSize
)
45 IMPLEMENT_DYNAMIC_CLASS(wxFrame
, wxTopLevelWindow
)
47 // ----------------------------------------------------------------------------
49 // ----------------------------------------------------------------------------
51 bool wxFrame::Create(wxWindow
*parent
,
53 const wxString
& title
,
59 return wxTopLevelWindow::Create(parent
, id
, title
, pos
, size
, style
, name
);
63 // ----------------------------------------------------------------------------
65 // ----------------------------------------------------------------------------
67 void wxFrame::OnSize(wxSizeEvent
& event
)
74 #endif // wxUSE_STATUSBAR
81 void wxFrame::PositionMenuBar()
85 // the menubar is positioned above the client size, hence the negative
87 wxCoord heightMbar
= m_frameMenuBar
->GetSize().y
;
88 m_frameMenuBar
->SetSize(0, -heightMbar
,
89 GetClientSize().x
, heightMbar
);
97 void wxFrame::PositionStatusBar()
99 if ( m_frameStatusBar
)
101 wxCoord heightBar
= m_frameStatusBar
->GetSize().y
;
102 m_frameStatusBar
->SetSize(0, GetClientSize().y
,
103 GetClientSize().x
, heightBar
);
107 #endif // wxUSE_STATUSBAR
109 wxPoint
wxFrame::GetClientAreaOrigin() const
111 wxPoint pt
= wxFrameBase::GetClientAreaOrigin();
114 if ( m_frameMenuBar
)
116 pt
.y
+= m_frameMenuBar
->GetSize().y
;
118 #endif // wxUSE_MENUS
123 void wxFrame::DoGetClientSize(int *width
, int *height
) const
125 wxFrameBase::DoGetClientSize(width
, height
);
128 if ( m_frameMenuBar
&& height
)
130 (*height
) -= m_frameMenuBar
->GetSize().y
;
132 #endif // wxUSE_MENUS
135 if ( m_frameStatusBar
&& height
)
137 (*height
) -= m_frameStatusBar
->GetSize().y
;
139 #endif // wxUSE_STATUSBAR
142 void wxFrame::DoSetClientSize(int width
, int height
)
145 if ( m_frameMenuBar
)
147 height
+= m_frameMenuBar
->GetSize().y
;
149 #endif // wxUSE_MENUS
152 if ( m_frameStatusBar
)
154 height
+= m_frameStatusBar
->GetSize().y
;
156 #endif // wxUSE_STATUSBAR
158 wxFrameBase::DoSetClientSize(width
, height
);
161 bool wxFrame::Enable(bool enable
)
163 if (!wxFrameBase::Enable(enable
))
165 #ifdef __WXMICROWIN__
167 m_frameMenuBar
->Enable(enable
);