1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/toplevel.h
3 // Purpose: wxTopLevelWindowCocoa is the Cocoa implementation of wxTLW
4 // Author: David Elliott
8 // Copyright: (c) 2002 David Elliott
9 // Licence: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef __WX_COCOA_TOPLEVEL_H__
13 #define __WX_COCOA_TOPLEVEL_H__
15 #include "wx/hashmap.h"
16 #include "wx/cocoa/NSWindow.h"
18 // ========================================================================
19 // wxTopLevelWindowCocoa
20 // ========================================================================
21 class WXDLLEXPORT wxTopLevelWindowCocoa
: public wxTopLevelWindowBase
, protected wxCocoaNSWindow
23 DECLARE_EVENT_TABLE();
24 DECLARE_NO_COPY_CLASS(wxTopLevelWindowCocoa
);
25 // ------------------------------------------------------------------------
27 // ------------------------------------------------------------------------
29 inline wxTopLevelWindowCocoa() { Init(); }
31 inline wxTopLevelWindowCocoa(wxWindow
*parent
,
33 const wxString
& title
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
36 long style
= wxDEFAULT_FRAME_STYLE
,
37 const wxString
& name
= wxFrameNameStr
)
40 Create(parent
, winid
, title
, pos
, size
, style
, name
);
43 bool Create(wxWindow
*parent
,
45 const wxString
& title
,
46 const wxPoint
& pos
= wxDefaultPosition
,
47 const wxSize
& size
= wxDefaultSize
,
48 long style
= wxDEFAULT_FRAME_STYLE
,
49 const wxString
& name
= wxFrameNameStr
);
51 virtual ~wxTopLevelWindowCocoa();
54 // common part of all ctors
57 // ------------------------------------------------------------------------
59 // ------------------------------------------------------------------------
61 inline WX_NSWindow
GetNSWindow() { return m_cocoaNSWindow
; }
62 virtual void Cocoa_close(void);
63 virtual bool Cocoa_windowShouldClose(void);
64 virtual void Cocoa_wxMenuItemAction(wxMenuItem
& item
);
66 void SetNSWindow(WX_NSWindow cocoaNSWindow
);
67 WX_NSWindow m_cocoaNSWindow
;
68 static wxCocoaNSWindowHash sm_cocoaHash
;
70 // ------------------------------------------------------------------------
72 // ------------------------------------------------------------------------
75 virtual void Maximize(bool maximize
= true);
76 virtual bool IsMaximized() const;
77 virtual void Iconize(bool iconize
= true);
78 virtual bool IsIconized() const;
79 virtual void Restore();
80 virtual bool ShowFullScreen(bool show
, long style
= wxFULLSCREEN_ALL
);
81 virtual bool IsFullScreen() const;
83 virtual bool Show( bool show
= true );
84 virtual bool Close( bool force
= false );
85 virtual void OnCloseWindow(wxCloseEvent
& event
);
86 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
87 virtual void DoGetSize(int *width
, int *height
) const;
88 virtual void DoGetPosition(int *x
, int *y
) const;
91 // Things I may/may not do
92 // virtual void SetIcon(const wxIcon& icon);
93 // virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); }
94 // virtual void Clear() ;
95 // virtual void Raise();
96 // virtual void Lower();
97 // virtual void SetTitle( const wxString& title);
99 // is the frame currently iconized?
101 // has the frame been closed
103 // should the frame be maximized when it will be shown? set by Maximize()
104 // when it is called while the frame is hidden
105 bool m_maximizeOnShow
;
108 // list of all frames and modeless dialogs
109 extern WXDLLEXPORT_DATA(wxWindowList
) wxModelessWindows
;
111 #endif // __WX_COCOA_TOPLEVEL_H__