]>
git.saurik.com Git - wxWidgets.git/blob - src/osx/toplevel_osx.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/toplevel.cpp
3 // Purpose: implements wxTopLevelWindow for Mac
4 // Author: Stefan Csomor
8 // Copyright: (c) 2001-2004 Stefan Csomor
9 // License: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
27 #include "wx/toplevel.h"
32 #include "wx/string.h"
35 #include "wx/settings.h"
36 #include "wx/strconv.h"
37 #include "wx/control.h"
40 #include "wx/tooltip.h"
43 #if wxUSE_SYSTEM_OPTIONS
44 #include "wx/sysopt.h"
48 #include "wx/osx/private.h"
50 // ============================================================================
51 // wxTopLevelWindowMac implementation
52 // ============================================================================
54 BEGIN_EVENT_TABLE(wxTopLevelWindowMac
, wxTopLevelWindowBase
)
57 // ----------------------------------------------------------------------------
58 // wxTopLevelWindowMac creation
59 // ----------------------------------------------------------------------------
62 void wxTopLevelWindowMac::Init()
65 m_maximizeOnShow
= false;
68 bool wxTopLevelWindowMac::Create(wxWindow
*parent
,
70 const wxString
& title
,
76 if ( !wxNonOwnedWindow::Create(parent
, id
, pos
, size
, style
, name
) )
79 wxWindow::SetLabel( title
) ;
80 m_nowpeer
->SetTitle(title
, GetFont().GetEncoding() );
81 wxTopLevelWindows
.Append(this);
86 wxTopLevelWindowMac::~wxTopLevelWindowMac()
91 // ----------------------------------------------------------------------------
92 // wxTopLevelWindowMac maximize/minimize
93 // ----------------------------------------------------------------------------
95 void wxTopLevelWindowMac::Maximize(bool maximize
)
97 if ( IsMaximized() != maximize
)
98 m_nowpeer
->Maximize(maximize
);
101 bool wxTopLevelWindowMac::IsMaximized() const
103 return m_nowpeer
->IsMaximized();
106 void wxTopLevelWindowMac::Iconize(bool iconize
)
108 if ( IsIconized() != iconize
)
109 m_nowpeer
->Iconize(iconize
);
112 bool wxTopLevelWindowMac::IsIconized() const
114 return m_nowpeer
->IsIconized();
117 void wxTopLevelWindowMac::Restore()
121 else if ( IsIconized() )
125 // ----------------------------------------------------------------------------
126 // wxTopLevelWindowMac misc
127 // ----------------------------------------------------------------------------
129 wxPoint
wxTopLevelWindowMac::GetClientAreaOrigin() const
131 return wxPoint(0, 0) ;
134 void wxTopLevelWindowMac::SetTitle(const wxString
& title
)
136 wxWindow::SetLabel( title
) ;
137 m_nowpeer
->SetTitle(title
, GetFont().GetEncoding() );
140 wxString
wxTopLevelWindowMac::GetTitle() const
142 return wxWindow::GetLabel();
145 bool wxTopLevelWindowMac::ShowFullScreen(bool show
, long style
)
147 return m_nowpeer
->ShowFullScreen(show
, style
);
150 bool wxTopLevelWindowMac::IsFullScreen() const
152 return m_nowpeer
->IsFullScreen();
155 void wxTopLevelWindowMac::RequestUserAttention(int flags
)
157 return m_nowpeer
->RequestUserAttention(flags
);