]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/toplevel.h
[wxGTK] Support changing the wxSTAY_ON_TOP style value run-time through wxWindow...
[wxWidgets.git] / include / wx / mac / carbon / toplevel.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/toplevel.h
3 // Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 20.09.01
7 // RCS-ID: $Id$
8 // Copyright: (c) 2001 Stefan Csomor
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_MSW_TOPLEVEL_H_
13 #define _WX_MSW_TOPLEVEL_H_
14
15 #if wxUSE_SYSTEM_OPTIONS
16 #define wxMAC_WINDOW_PLAIN_TRANSITION _T("mac.window-plain-transition")
17 #endif
18
19 // ----------------------------------------------------------------------------
20 // wxTopLevelWindowMac
21 // ----------------------------------------------------------------------------
22
23 class WXDLLEXPORT wxTopLevelWindowMac : public wxTopLevelWindowBase
24 {
25 public:
26 // constructors and such
27 wxTopLevelWindowMac() { Init(); }
28
29 wxTopLevelWindowMac(wxWindow *parent,
30 wxWindowID id,
31 const wxString& title,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 long style = wxDEFAULT_FRAME_STYLE,
35 const wxString& name = wxFrameNameStr)
36 {
37 Init();
38
39 (void)Create(parent, id, title, pos, size, style, name);
40 }
41
42 bool Create(wxWindow *parent,
43 wxWindowID id,
44 const wxString& title,
45 const wxPoint& pos = wxDefaultPosition,
46 const wxSize& size = wxDefaultSize,
47 long style = wxDEFAULT_FRAME_STYLE,
48 const wxString& name = wxFrameNameStr);
49
50 virtual ~wxTopLevelWindowMac();
51
52 virtual wxPoint GetClientAreaOrigin() const;
53
54 // Attracts the users attention to this window if the application is
55 // inactive (should be called when a background event occurs)
56 virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
57
58 // implement base class pure virtuals
59 virtual void Maximize(bool maximize = true);
60 virtual bool IsMaximized() const;
61 virtual void Iconize(bool iconize = true);
62 virtual bool IsIconized() const;
63 virtual void SetIcon(const wxIcon& icon);
64 virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); }
65 virtual void Restore();
66
67 virtual bool SetShape(const wxRegion& region);
68
69 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) ;
70 virtual bool IsFullScreen() const ;
71
72 // implementation from now on
73 // --------------------------
74
75 static void MacDelayedDeactivation(long timestamp);
76 virtual void MacCreateRealWindow( const wxString& title,
77 const wxPoint& pos,
78 const wxSize& size,
79 long style,
80 const wxString& name ) ;
81 virtual void ClearBackground() ;
82
83 WXWindow MacGetWindowRef() { return m_macWindow ; }
84 virtual void MacActivate( long timestamp , bool inIsActivating ) ;
85 virtual void MacPerformUpdates() ;
86
87 virtual void SetTitle( const wxString& title);
88 virtual wxString GetTitle() const;
89
90 virtual void Raise();
91 virtual void Lower();
92 virtual bool Show( bool show = true );
93
94 virtual void MacSetBackgroundBrush( const wxBrush &brush ) ;
95
96 bool MacUsesCompositing() { return m_macUsesCompositing; }
97 virtual void MacInstallTopLevelWindowEventHandler() ;
98
99 void MacSetMetalAppearance( bool on ) ;
100 bool MacGetMetalAppearance() const ;
101
102 void MacChangeWindowAttributes( wxUint32 attributesToSet , wxUint32 attributesToClear ) ;
103 wxUint32 MacGetWindowAttributes() const ;
104
105 WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; }
106
107 virtual void MacGetContentAreaInset( int &left , int &top , int &right , int &bottom ) ;
108
109 protected:
110 // common part of all ctors
111 void Init();
112
113 virtual void DoGetPosition( int *x, int *y ) const;
114 virtual void DoGetSize( int *width, int *height ) const;
115 virtual void DoMoveWindow(int x, int y, int width, int height);
116 virtual void DoGetClientSize(int *width, int *height) const;
117
118 // is the frame currently iconized?
119 bool m_iconized;
120
121 // should the frame be maximized when it will be shown? set by Maximize()
122 // when it is called while the frame is hidden
123 bool m_maximizeOnShow;
124 bool m_macUsesCompositing ;
125
126 WXWindow m_macWindow ;
127
128 wxWindowMac* m_macFocus ;
129 void *m_macFullScreenData ;
130
131 static wxTopLevelWindowMac *s_macDeactivateWindow;
132 private :
133 WXEVENTHANDLERREF m_macEventHandler ;
134
135 DECLARE_EVENT_TABLE()
136 };
137
138 // list of all frames and modeless dialogs
139 extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows;
140
141 #endif // _WX_MSW_TOPLEVEL_H_