From: Stefan Csomor Date: Sun, 30 Sep 2001 09:16:31 +0000 (+0000) Subject: mac toplevel window added X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fe08e597048268b58f76f240e3f3dff52cdd6ffe?ds=sidebyside;hp=93b4dc4b149e153e817bd2aeb95551ef00c0a575 mac toplevel window added git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/mac/dialog.h b/include/wx/mac/dialog.h index 78d8942e7c..6ae557e927 100644 --- a/include/wx/mac/dialog.h +++ b/include/wx/mac/dialog.h @@ -66,10 +66,6 @@ public: virtual bool Destroy(); bool Show(bool show); - void Iconize(bool iconize); - virtual bool IsIconized() const; - - virtual bool IsTopLevel() const { return TRUE; } void SetModal(bool flag); virtual bool IsModal() const; diff --git a/include/wx/mac/frame.h b/include/wx/mac/frame.h index c71cf5fee5..c3032d69f0 100644 --- a/include/wx/mac/frame.h +++ b/include/wx/mac/frame.h @@ -58,14 +58,6 @@ public: virtual ~wxFrameMac(); - // implement base class pure virtuals - virtual void Maximize(bool maximize = TRUE); - virtual bool IsMaximized() const; - virtual void Iconize(bool iconize = TRUE); - virtual bool IsIconized() const; - virtual void Restore(); - virtual void SetIcon(const wxIcon& icon); - // implementation only from now on // ------------------------------- @@ -120,7 +112,6 @@ protected: virtual void DoSetClientSize(int width, int height); protected: - bool m_iconized; #if wxUSE_STATUSBAR static bool m_useNativeStatusBar; #endif // wxUSE_STATUSBAR diff --git a/include/wx/mac/toplevel.h b/include/wx/mac/toplevel.h new file mode 100644 index 0000000000..d9ccdc26d8 --- /dev/null +++ b/include/wx/mac/toplevel.h @@ -0,0 +1,82 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/mac/toplevel.h +// Purpose: wxTopLevelWindowMac is the MSW implementation of wxTLW +// Author: Vadim Zeitlin +// Modified by: +// Created: 20.09.01 +// RCS-ID: $Id$ +// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_MSW_TOPLEVEL_H_ +#define _WX_MSW_TOPLEVEL_H_ + +#ifdef __GNUG__ + #pragma interface "toplevel.h" +#endif + +// ---------------------------------------------------------------------------- +// wxTopLevelWindowMac +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxTopLevelWindowMac : public wxTopLevelWindowBase +{ +public: + // constructors and such + wxTopLevelWindowMac() { Init(); } + + wxTopLevelWindowMac(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(); + + (void)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); + + virtual ~wxTopLevelWindowMac(); + + // implement base class pure virtuals + virtual void Maximize(bool maximize = TRUE); + virtual bool IsMaximized() const; + virtual void Iconize(bool iconize = TRUE); + virtual bool IsIconized() const; + virtual void SetIcon(const wxIcon& icon); + virtual void Restore(); + + virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) { return FALSE; } + virtual bool IsFullScreen() const { return FALSE; } + + // implementation from now on + // -------------------------- + +protected: + // common part of all ctors + void Init(); + + // is the frame currently iconized? + bool m_iconized; + + // should the frame be maximized when it will be shown? set by Maximize() + // when it is called while the frame is hidden + bool m_maximizeOnShow; +}; + +// list of all frames and modeless dialogs +extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows; + +#endif // _WX_MSW_TOPLEVEL_H_ + diff --git a/src/mac/carbon/dialog.cpp b/src/mac/carbon/dialog.cpp index 044002d970..1490247378 100644 --- a/src/mac/carbon/dialog.cpp +++ b/src/mac/carbon/dialog.cpp @@ -24,7 +24,7 @@ // Lists to keep track of windows, so we can disable/enable them // for modal dialogs wxList wxModalDialogs; -wxList wxModelessWindows; // Frames and modeless dialogs +//wxList wxModelessWindows; // Frames and modeless dialogs extern wxList wxPendingDelete; #if !USE_SHARED_LIBRARY @@ -129,16 +129,6 @@ void wxDialog::OnCharHook(wxKeyEvent& event) event.Skip(); } -void wxDialog::Iconize(bool WXUNUSED(iconize)) -{ - // mac dialogs cannot be iconized -} - -bool wxDialog::IsIconized() const -{ - // mac dialogs cannot be iconized - return FALSE; -} void wxDialog::DoSetClientSize(int width, int height) { diff --git a/src/mac/carbon/filedlg.cpp b/src/mac/carbon/filedlg.cpp index 144cdee796..1d6fd58d44 100644 --- a/src/mac/carbon/filedlg.cpp +++ b/src/mac/carbon/filedlg.cpp @@ -560,7 +560,11 @@ pascal Boolean CrossPlatformFilterCallback ( if (theItem->descriptorType == typeFSS && !theInfo->isFolder) { FSSpec spec; - memcpy( &spec , *theItem->dataHandle , sizeof(FSSpec) ) ; +#if TARGET_CARBON + ::AEGetDescData(theItem, &spec, sizeof(FSSpec) ) ; +#else + memcpy( &spec , (*theItem->dataHandle) , sizeof(FSSpec) ) ; +#endif display = CheckFile( spec.name , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ; } } diff --git a/src/mac/carbon/frame.cpp b/src/mac/carbon/frame.cpp index 8a589cbf54..04776b8cb1 100644 --- a/src/mac/carbon/frame.cpp +++ b/src/mac/carbon/frame.cpp @@ -25,7 +25,7 @@ #include -extern wxList wxModelessWindows; +extern wxWindowList wxModelessWindows; extern wxList wxPendingDelete; #if !USE_SHARED_LIBRARY @@ -164,39 +164,6 @@ bool wxFrameMac::Enable(bool enable) return TRUE; } -// Equivalent to maximize/restore in Windows -void wxFrameMac::Maximize(bool maximize) -{ - // TODO -} - -bool wxFrameMac::IsIconized() const -{ - // TODO - return FALSE; -} - -void wxFrameMac::Iconize(bool iconize) -{ - // TODO -} - -// Is the frame maximized? -bool wxFrameMac::IsMaximized(void) const -{ - // TODO - return FALSE; -} - -void wxFrameMac::Restore() -{ - // TODO -} - -void wxFrameMac::SetIcon(const wxIcon& icon) -{ - wxFrameBase::SetIcon(icon); -} wxStatusBar *wxFrameMac::OnCreateStatusBar(int number, long style, wxWindowID id, const wxString& name) diff --git a/src/mac/carbon/mdi.cpp b/src/mac/carbon/mdi.cpp index 79197cdecd..f0d2f53138 100644 --- a/src/mac/carbon/mdi.cpp +++ b/src/mac/carbon/mdi.cpp @@ -17,7 +17,7 @@ #include "wx/menu.h" #include "wx/settings.h" -extern wxList wxModelessWindows; +extern wxWindowList wxModelessWindows; #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame) diff --git a/src/mac/dialog.cpp b/src/mac/dialog.cpp index 044002d970..1490247378 100644 --- a/src/mac/dialog.cpp +++ b/src/mac/dialog.cpp @@ -24,7 +24,7 @@ // Lists to keep track of windows, so we can disable/enable them // for modal dialogs wxList wxModalDialogs; -wxList wxModelessWindows; // Frames and modeless dialogs +//wxList wxModelessWindows; // Frames and modeless dialogs extern wxList wxPendingDelete; #if !USE_SHARED_LIBRARY @@ -129,16 +129,6 @@ void wxDialog::OnCharHook(wxKeyEvent& event) event.Skip(); } -void wxDialog::Iconize(bool WXUNUSED(iconize)) -{ - // mac dialogs cannot be iconized -} - -bool wxDialog::IsIconized() const -{ - // mac dialogs cannot be iconized - return FALSE; -} void wxDialog::DoSetClientSize(int width, int height) { diff --git a/src/mac/filedlg.cpp b/src/mac/filedlg.cpp index 144cdee796..1d6fd58d44 100644 --- a/src/mac/filedlg.cpp +++ b/src/mac/filedlg.cpp @@ -560,7 +560,11 @@ pascal Boolean CrossPlatformFilterCallback ( if (theItem->descriptorType == typeFSS && !theInfo->isFolder) { FSSpec spec; - memcpy( &spec , *theItem->dataHandle , sizeof(FSSpec) ) ; +#if TARGET_CARBON + ::AEGetDescData(theItem, &spec, sizeof(FSSpec) ) ; +#else + memcpy( &spec , (*theItem->dataHandle) , sizeof(FSSpec) ) ; +#endif display = CheckFile( spec.name , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ; } } diff --git a/src/mac/frame.cpp b/src/mac/frame.cpp index 8a589cbf54..04776b8cb1 100644 --- a/src/mac/frame.cpp +++ b/src/mac/frame.cpp @@ -25,7 +25,7 @@ #include -extern wxList wxModelessWindows; +extern wxWindowList wxModelessWindows; extern wxList wxPendingDelete; #if !USE_SHARED_LIBRARY @@ -164,39 +164,6 @@ bool wxFrameMac::Enable(bool enable) return TRUE; } -// Equivalent to maximize/restore in Windows -void wxFrameMac::Maximize(bool maximize) -{ - // TODO -} - -bool wxFrameMac::IsIconized() const -{ - // TODO - return FALSE; -} - -void wxFrameMac::Iconize(bool iconize) -{ - // TODO -} - -// Is the frame maximized? -bool wxFrameMac::IsMaximized(void) const -{ - // TODO - return FALSE; -} - -void wxFrameMac::Restore() -{ - // TODO -} - -void wxFrameMac::SetIcon(const wxIcon& icon) -{ - wxFrameBase::SetIcon(icon); -} wxStatusBar *wxFrameMac::OnCreateStatusBar(int number, long style, wxWindowID id, const wxString& name) diff --git a/src/mac/mdi.cpp b/src/mac/mdi.cpp index 79197cdecd..f0d2f53138 100644 --- a/src/mac/mdi.cpp +++ b/src/mac/mdi.cpp @@ -17,7 +17,7 @@ #include "wx/menu.h" #include "wx/settings.h" -extern wxList wxModelessWindows; +extern wxWindowList wxModelessWindows; #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame) diff --git a/src/makemac7.mcp b/src/makemac7.mcp new file mode 100644 index 0000000000..f7b351e732 Binary files /dev/null and b/src/makemac7.mcp differ