]> git.saurik.com Git - wxWidgets.git/commitdiff
partial implementation of wxTopLevelWindow for wXUniv
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 18 Sep 2001 22:37:08 +0000 (22:37 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 18 Sep 2001 22:37:08 +0000 (22:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/univ/toplevel.h
src/univ/topluniv.cpp [new file with mode: 0644]

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..5d2aa3161fe26ea509ddce7f4f46554f2b118215 100644 (file)
@@ -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 (file)
index 0000000..d948509
--- /dev/null
@@ -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
+}
+