X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c74e7fe1de14f32dcd6f3c9cdd727de540bbd0e..864db5de611f630d8b64dec6b648117187381d99:/include/wx/mac/mdi.h diff --git a/include/wx/mac/mdi.h b/include/wx/mac/mdi.h index 93038739f8..1114ee525d 100644 --- a/include/wx/mac/mdi.h +++ b/include/wx/mac/mdi.h @@ -3,34 +3,33 @@ // Purpose: MDI (Multiple Document Interface) classes. // This doesn't have to be implemented just like Windows, // it could be a tabbed design as in wxGTK. -// Author: AUTHOR +// Author: Stefan Csomor // Modified by: -// Created: ??/??/98 +// Created: 1998-01-01 // RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence +// Copyright: (c) Stefan Csomor +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_MDI_H_ #define _WX_MDI_H_ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "mdi.h" #endif #include "wx/frame.h" -WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr; -WXDLLEXPORT_DATA(extern const char*) wxStatusLineNameStr; +WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr; +WXDLLEXPORT_DATA(extern const wxChar*) wxStatusLineNameStr; class WXDLLEXPORT wxMDIClientWindow; class WXDLLEXPORT wxMDIChildFrame; class WXDLLEXPORT wxMDIParentFrame: public wxFrame { -DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) + DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) - friend class WXDLLEXPORT wxMDIChildFrame; public: wxMDIParentFrame(); @@ -55,17 +54,15 @@ public: long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, const wxString& name = wxFrameNameStr); - void OnSize(wxSizeEvent& event); + // Mac OS activate event + virtual void MacActivate(long timestamp, bool activating); + + // wxWindows activate event void OnActivate(wxActivateEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event); void SetMenuBar(wxMenuBar *menu_bar); - // Gets the size available for subwindows after menu size, toolbar size - // and status bar size have been subtracted. If you want to manage your own - // toolbar(s), don't call SetToolBar. - void DoGetClientSize(int *width, int *height) const; - // Get the active MDI child window (Windows only) wxMDIChildFrame *GetActiveChild() const ; @@ -87,7 +84,14 @@ protected: // TODO maybe have this member wxMDIClientWindow *m_clientWindow; + wxMDIChildFrame * m_currentChild; + wxMenu* m_windowMenu; + // TRUE if MDI Frame is intercepting commands, not child + bool m_parentFrameActive; + +private: + friend class WXDLLEXPORT wxMDIChildFrame; DECLARE_EVENT_TABLE() }; @@ -105,6 +109,7 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) { + Init() ; Create(parent, id, title, pos, size, style, name); } @@ -118,16 +123,21 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); + // Mac OS activate event + virtual void MacActivate(long timestamp, bool activating); + // Set menu bar void SetMenuBar(wxMenuBar *menu_bar); - void SetClientSize(int width, int height); - void GetPosition(int *x, int *y) const ; // MDI operations virtual void Maximize(); virtual void Maximize( bool ){ Maximize() ; } // this one is inherited from wxFrame virtual void Restore(); virtual void Activate(); +protected: + + // common part of all ctors + void Init(); }; /* The client window is a child of the parent MDI frame, and itself @@ -153,6 +163,11 @@ class WXDLLEXPORT wxMDIClientWindow: public wxWindow // Note: this is virtual, to allow overridden behaviour. virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL); + // Gets the size available for subwindows after menu size, toolbar size + // and status bar size have been subtracted. If you want to manage your own + // toolbar(s), don't call SetToolBar. + void DoGetClientSize(int *width, int *height) const; + // Explicitly call default scroll behaviour void OnScroll(wxScrollEvent& event);