From: Václav Slavík Date: Tue, 18 Sep 2001 22:37:08 +0000 (+0000) Subject: partial implementation of wxTopLevelWindow for wXUniv X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0f1bf77d3d18378fceb6a39ee9c39d39e58a3edf partial implementation of wxTopLevelWindow for wXUniv git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/univ/toplevel.h b/include/wx/univ/toplevel.h index e69de29bb2..5d2aa3161f 100644 --- a/include/wx/univ/toplevel.h +++ b/include/wx/univ/toplevel.h @@ -0,0 +1,62 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/toplevel.h +// Purpose: Top level window, abstraction of wxFrame and wxDialog +// Author: Vaclav Slavik +// Id: $Id$ +// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + + +#ifndef __WX_UNIV_TOPLEVEL_H__ +#define __WX_UNIV_TOPLEVEL_H__ + +#ifdef __GNUG__ + #pragma interface "univtoplevel.h" +#endif + + +//----------------------------------------------------------------------------- +// wxTopLevelWindow +//----------------------------------------------------------------------------- + +class wxTopLevelWindow : public wxTopLevelWindowNative +{ +public: + // construction + wxTopLevelWindow() { Init(); } + wxTopLevelWindow(wxWindow *parent, + wxWindowID id, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE, + const wxString& name = wxFrameNameStr) + { + Init(); + + Create(parent, id, title, pos, size, style, name); + } + + bool Create(wxWindow *parent, + wxWindowID id, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE, + const wxString& name = wxFrameNameStr); + + // implement base class pure virtuals + virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); + + // implementation from now on + // -------------------------- + + DECLARE_DYNAMIC_CLASS(wxTopLevelWindow) + +protected: + // common part of all ctors + void Init(); +}; + +#endif // __WX_UNIV_TOPLEVEL_H__ diff --git a/src/univ/topluniv.cpp b/src/univ/topluniv.cpp new file mode 100644 index 0000000000..d948509858 --- /dev/null +++ b/src/univ/topluniv.cpp @@ -0,0 +1,74 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: topluniv.cpp +// Author: Vaclav Slavik +// Id: $Id$ +// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#ifdef __GNUG__ + #pragma implementation "univtoplevel.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#include "wx/defs.h" +#include "wx/toplevel.h" + + +// ---------------------------------------------------------------------------- +// event tables +// ---------------------------------------------------------------------------- + +IMPLEMENT_DYNAMIC_CLASS(wxTopLevelWindow, wxWindow) + + +// ============================================================================ +// implementation +// ============================================================================ + +void wxTopLevelWindow::Init() +{ +} + +bool wxTopLevelWindow::Create(wxWindow *parent, + wxWindowID id, + const wxString& title, + const wxPoint& pos, + const wxSize& sizeOrig, + long style, + const wxString &name) +{ + if ( !wxTopLevelWindowNative::Create(parent, id, title, pos, + sizeOrig, style, name) ) + return FALSE; + + // FIXME_MGL -- this is temporary; we assume for now that native TLW + // can do decorations, which is not true for MGL + + return TRUE; +} + +bool wxTopLevelWindow::ShowFullScreen(bool show, long style) +{ + if ( show == IsFullScreen() ) return FALSE; + + return wxTopLevelWindowNative::ShowFullScreen(show, style); + + // FIXME_MGL -- must handle caption hiding here if not in + // native decorations mode +} +