]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/carbon/toplevel.h
forward SetFocus() to the directory tree (replaces patch 1831210)
[wxWidgets.git] / include / wx / mac / carbon / toplevel.h
CommitLineData
8cf73271 1///////////////////////////////////////////////////////////////////////////////
fb5246be 2// Name: wx/mac/carbon/toplevel.h
8cf73271
SC
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
65571936 9// Licence: wxWindows licence
8cf73271
SC
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_MSW_TOPLEVEL_H_
13#define _WX_MSW_TOPLEVEL_H_
14
8cf73271
SC
15#if wxUSE_SYSTEM_OPTIONS
16 #define wxMAC_WINDOW_PLAIN_TRANSITION _T("mac.window-plain-transition")
17#endif
18
19// ----------------------------------------------------------------------------
20// wxTopLevelWindowMac
21// ----------------------------------------------------------------------------
22
23class WXDLLEXPORT wxTopLevelWindowMac : public wxTopLevelWindowBase
24{
25public:
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
4f305456
SC
52 virtual wxPoint GetClientAreaOrigin() const;
53
3feeb1e1
SC
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
8cf73271 58 // implement base class pure virtuals
fb5246be 59 virtual void Maximize(bool maximize = true);
8cf73271 60 virtual bool IsMaximized() const;
fb5246be 61 virtual void Iconize(bool iconize = true);
8cf73271 62 virtual bool IsIconized() const;
eb83d250
SC
63#ifndef __WXUNIVERSAL__
64 virtual void SetIcons(const wxIconBundle& icons);
65#endif
8cf73271
SC
66 virtual void Restore();
67
68 virtual bool SetShape(const wxRegion& region);
69
2fa2b08e
SC
70 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) ;
71 virtual bool IsFullScreen() const ;
8cf73271 72
07880314
RD
73 virtual bool SetTransparent(wxByte alpha);
74 virtual bool CanSetTransparent();
50f3c41d 75
4488a1d3 76 virtual bool SetBackgroundStyle(wxBackgroundStyle style);
50f3c41d 77
8cf73271
SC
78 // implementation from now on
79 // --------------------------
80
81 static void MacDelayedDeactivation(long timestamp);
82 virtual void MacCreateRealWindow( const wxString& title,
83 const wxPoint& pos,
84 const wxSize& size,
85 long style,
86 const wxString& name ) ;
8cf73271 87 virtual void ClearBackground() ;
4f305456 88
8cf73271
SC
89 WXWindow MacGetWindowRef() { return m_macWindow ; }
90 virtual void MacActivate( long timestamp , bool inIsActivating ) ;
92346151 91 virtual void MacPerformUpdates() ;
4f305456 92
fb5246be
WS
93 virtual void SetTitle( const wxString& title);
94 virtual wxString GetTitle() const;
95
8cf73271
SC
96 virtual void Raise();
97 virtual void Lower();
fb5246be 98 virtual bool Show( bool show = true );
4f305456 99
8ec0a8fa
SC
100 virtual void SetExtraStyle(long exStyle) ;
101
4f305456
SC
102 virtual void MacSetBackgroundBrush( const wxBrush &brush ) ;
103
aa4d3151 104 virtual void MacInstallTopLevelWindowEventHandler() ;
8cf73271 105
5171553c 106 bool MacGetMetalAppearance() const ;
893727e5 107 bool MacGetUnifiedAppearance() const ;
4f305456
SC
108
109 void MacChangeWindowAttributes( wxUint32 attributesToSet , wxUint32 attributesToClear ) ;
110 wxUint32 MacGetWindowAttributes() const ;
111
8cf73271 112 WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; }
4f305456 113
f5ea731f
SC
114 virtual void MacGetContentAreaInset( int &left , int &top , int &right , int &bottom ) ;
115
8cf73271
SC
116protected:
117 // common part of all ctors
118 void Init();
119
4f305456
SC
120 virtual void DoGetPosition( int *x, int *y ) const;
121 virtual void DoGetSize( int *width, int *height ) const;
122 virtual void DoMoveWindow(int x, int y, int width, int height);
123 virtual void DoGetClientSize(int *width, int *height) const;
eb83d250 124 virtual void DoCentre(int dir);
4f305456 125
8cf73271
SC
126 // is the frame currently iconized?
127 bool m_iconized;
128
129 // should the frame be maximized when it will be shown? set by Maximize()
130 // when it is called while the frame is hidden
131 bool m_maximizeOnShow;
f18dcf04 132
8cf73271 133 WXWindow m_macWindow ;
4f305456 134
8cf73271 135 wxWindowMac* m_macFocus ;
2fa2b08e 136 void *m_macFullScreenData ;
8cf73271 137
8cf73271 138 static wxTopLevelWindowMac *s_macDeactivateWindow;
8cf73271 139private :
fb3234e5
KH
140 // KH: We cannot let this be called directly since the metal appearance is now managed by an
141 // extra style. Calling this function directly can result in blank white window backgrounds.
142 // This is because the ExtraStyle flags get out of sync with the metal appearance and the metal
143 // logic & checks cease to work as expected. To set the metal appearance, use SetExtraStyle.
144 void MacSetMetalAppearance( bool on ) ;
893727e5 145 void MacSetUnifiedAppearance( bool on ) ;
eb83d250
SC
146 // binary compatible workaround TODO REPLACE
147 void DoMacCreateRealWindow( wxWindow *parent, const wxString& title,
148 const wxPoint& pos,
149 const wxSize& size,
150 long style,
151 const wxString& name );
fb3234e5 152
8cf73271 153 WXEVENTHANDLERREF m_macEventHandler ;
4f305456
SC
154
155 DECLARE_EVENT_TABLE()
8cf73271
SC
156};
157
158// list of all frames and modeless dialogs
eb83d250 159extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows;
8cf73271 160
8cf73271 161#endif // _WX_MSW_TOPLEVEL_H_