]>
git.saurik.com Git - wxWidgets.git/blob - src/x11/toplevel.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: x11/toplevel.cpp
3 // Purpose: implements wxTopLevelWindow for X11
4 // Author: Julian Smart
8 // Copyright: (c) 2002 Julian Smart
9 // License: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "toplevel.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
33 #include "wx/toplevel.h"
34 #include "wx/string.h"
40 #include "wx/x11/private.h"
42 // ----------------------------------------------------------------------------
44 // ----------------------------------------------------------------------------
46 // list of all frames and modeless dialogs
47 // wxWindowList wxModelessWindows;
49 // ----------------------------------------------------------------------------
50 // wxTopLevelWindowX11 creation
51 // ----------------------------------------------------------------------------
53 void wxTopLevelWindowX11::Init()
56 m_maximizeOnShow
= FALSE
;
58 // unlike (almost?) all other windows, frames are created hidden
61 // Data to save/restore when calling ShowFullScreen
63 m_fsIsMaximized
= FALSE
;
64 m_fsIsShowing
= FALSE
;
67 bool wxTopLevelWindowX11::CreateDialog(const wxString
& title
,
75 bool wxTopLevelWindowX11::CreateFrame(const wxString
& title
,
83 bool wxTopLevelWindowX11::Create(wxWindow
*parent
,
85 const wxString
& title
,
94 m_windowStyle
= style
;
98 m_windowId
= id
== -1 ? NewControlId() : id
;
100 wxTopLevelWindows
.Append(this);
103 parent
->AddChild(this);
105 if ( GetExtraStyle() & wxTOPLEVEL_EX_DIALOG
)
107 return CreateDialog(title
, pos
, size
);
111 return CreateFrame(title
, pos
, size
);
115 wxTopLevelWindowX11::~wxTopLevelWindowX11()
117 wxTopLevelWindows
.DeleteObject(this);
119 if ( wxModelessWindows
.Find(this) )
120 wxModelessWindows
.DeleteObject(this);
122 // If this is the last top-level window, exit.
123 if ( wxTheApp
&& (wxTopLevelWindows
.Number() == 0) )
125 wxTheApp
->SetTopWindow(NULL
);
127 if (wxTheApp
->GetExitOnFrameDelete())
129 // Signal to the app that we're going to close
130 wxTheApp
->ExitMainLoop();
135 // ----------------------------------------------------------------------------
136 // wxTopLevelWindowX11 showing
137 // ----------------------------------------------------------------------------
139 bool wxTopLevelWindowX11::Show(bool show
)
141 if ( !wxWindowBase::Show(show
) )
149 // ----------------------------------------------------------------------------
150 // wxTopLevelWindowX11 maximize/minimize
151 // ----------------------------------------------------------------------------
153 void wxTopLevelWindowX11::Maximize(bool maximize
)
158 bool wxTopLevelWindowX11::IsMaximized() const
164 void wxTopLevelWindowX11::Iconize(bool iconize
)
169 bool wxTopLevelWindowX11::IsIconized() const
175 void wxTopLevelWindowX11::Restore()
180 // ----------------------------------------------------------------------------
181 // wxTopLevelWindowX11 fullscreen
182 // ----------------------------------------------------------------------------
184 bool wxTopLevelWindowX11::ShowFullScreen(bool show
, long style
)
191 m_fsIsShowing
= TRUE
;
203 m_fsIsShowing
= FALSE
;
210 // ----------------------------------------------------------------------------
211 // wxTopLevelWindowX11 misc
212 // ----------------------------------------------------------------------------
214 void wxTopLevelWindowX11::SetIcon(const wxIcon
& icon
)
217 wxTopLevelWindowBase::SetIcon(icon
);