]>
git.saurik.com Git - wxWidgets.git/blob - src/dfb/toplevel.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/dfb/toplevel.cpp
3 // Purpose: Top level window, abstraction of wxFrame and wxDialog
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2006 REA Elektronik GmbH
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
14 #include "wx/toplevel.h"
20 #include "wx/dfb/private.h"
22 // ============================================================================
23 // wxTopLevelWindowDFB
24 // ============================================================================
26 // ----------------------------------------------------------------------------
27 // creation & destruction
28 // ----------------------------------------------------------------------------
30 void wxTopLevelWindowDFB::Init()
32 m_isMaximized
= false;
33 m_fsIsShowing
= false;
36 bool wxTopLevelWindowDFB::Create(wxWindow
*parent
,
38 const wxString
& title
,
39 const wxPoint
& posOrig
,
40 const wxSize
& sizeOrig
,
44 // always create a frame of some reasonable, even if arbitrary, size (at
45 // least for MSW compatibility)
46 wxSize
size(sizeOrig
);
47 if ( size
.x
== wxDefaultCoord
|| size
.y
== wxDefaultCoord
)
49 wxSize sizeDefault
= GetDefaultSize();
50 if ( size
.x
== wxDefaultCoord
)
51 size
.x
= sizeDefault
.x
;
52 if ( size
.y
== wxDefaultCoord
)
53 size
.y
= sizeDefault
.y
;
57 if ( pos
.x
== wxDefaultCoord
)
59 if ( pos
.y
== wxDefaultCoord
)
62 if ( !wxNonOwnedWindow::Create(parent
, id
, pos
, size
, style
, name
) )
65 wxTopLevelWindows
.Append(this);
71 // ----------------------------------------------------------------------------
73 // ----------------------------------------------------------------------------
75 #warning "FIXME: the rest of this file is almost same as for MGL, merge it"
76 bool wxTopLevelWindowDFB::ShowFullScreen(bool show
, long style
)
78 if ( show
== m_fsIsShowing
)
85 m_fsSaveStyle
= m_windowStyle
;
87 GetPosition(&m_fsSaveFrame
.x
, &m_fsSaveFrame
.y
);
88 GetSize(&m_fsSaveFrame
.width
, &m_fsSaveFrame
.height
);
90 if ( style
& wxFULLSCREEN_NOCAPTION
)
91 m_windowStyle
&= ~wxCAPTION
;
92 if ( style
& wxFULLSCREEN_NOBORDER
)
93 m_windowStyle
= wxSIMPLE_BORDER
;
96 wxDisplaySize(&x
, &y
);
101 m_windowStyle
= m_fsSaveStyle
;
102 SetSize(m_fsSaveFrame
.x
, m_fsSaveFrame
.y
,
103 m_fsSaveFrame
.width
, m_fsSaveFrame
.height
);
109 bool wxTopLevelWindowDFB::SetTransparent(wxByte alpha
)
113 if ( !m_dfbwin
->SetOpacity(alpha
) )
121 // ----------------------------------------------------------------------------
122 // maximize, minimize etc.
123 // ----------------------------------------------------------------------------
125 void wxTopLevelWindowDFB::Maximize(bool maximize
)
128 wxClientDisplayRect(&x
, &y
, &w
, &h
);
130 if ( maximize
&& !m_isMaximized
)
132 m_isMaximized
= true;
134 GetPosition(&m_savedFrame
.x
, &m_savedFrame
.y
);
135 GetSize(&m_savedFrame
.width
, &m_savedFrame
.height
);
139 else if ( !maximize
&& m_isMaximized
)
141 m_isMaximized
= false;
142 SetSize(m_savedFrame
.x
, m_savedFrame
.y
,
143 m_savedFrame
.width
, m_savedFrame
.height
);
147 bool wxTopLevelWindowDFB::IsMaximized() const
149 return m_isMaximized
;
152 void wxTopLevelWindowDFB::Restore()
160 void wxTopLevelWindowDFB::Iconize(bool WXUNUSED(iconize
))
162 wxFAIL_MSG(wxT("Iconize not supported under wxDFB"));
165 bool wxTopLevelWindowDFB::IsIconized() const