]>
Commit | Line | Data |
---|---|---|
fe08e597 SC |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/mac/toplevel.h | |
3 | // Purpose: wxTopLevelWindowMac is the MSW implementation of wxTLW | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 20.09.01 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) | |
9 | // Licence: wxWindows licence | |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_MSW_TOPLEVEL_H_ | |
13 | #define _WX_MSW_TOPLEVEL_H_ | |
14 | ||
15 | #ifdef __GNUG__ | |
16 | #pragma interface "toplevel.h" | |
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 | // implement base class pure virtuals | |
53 | virtual void Maximize(bool maximize = TRUE); | |
54 | virtual bool IsMaximized() const; | |
55 | virtual void Iconize(bool iconize = TRUE); | |
56 | virtual bool IsIconized() const; | |
57 | virtual void SetIcon(const wxIcon& icon); | |
58 | virtual void Restore(); | |
59 | ||
60 | virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) { return FALSE; } | |
61 | virtual bool IsFullScreen() const { return FALSE; } | |
62 | ||
63 | // implementation from now on | |
64 | // -------------------------- | |
65 | ||
6ed63f8b SC |
66 | virtual void MacCreateRealWindow( const wxString& title, |
67 | const wxPoint& pos, | |
68 | const wxSize& size, | |
69 | long style, | |
70 | const wxString& name ) ; | |
71 | static WindowRef MacGetWindowInUpdate() { return s_macWindowInUpdate ; } | |
72 | virtual void MacGetPortParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin ) ; | |
73 | virtual void MacDoGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin) ; | |
74 | virtual void Clear() ; | |
75 | virtual ControlHandle MacGetContainerForEmbedding() ; | |
76 | WindowRef MacGetWindowRef() { return m_macWindow ; } | |
77 | virtual void MacActivate( EventRecord *ev , bool inIsActivating ) ; | |
78 | virtual void MacUpdate( long timestamp ) ; | |
79 | virtual void MacMouseDown( EventRecord *ev , short windowPart ) ; | |
80 | virtual void MacMouseUp( EventRecord *ev , short windowPart ) ; | |
81 | virtual void MacMouseMoved( EventRecord *ev , short windowPart ) ; | |
82 | virtual void MacKeyDown( EventRecord *ev ) ; | |
83 | virtual void MacFireMouseEvent( EventRecord *ev ) ; | |
84 | virtual void Raise(); | |
85 | virtual void Lower(); | |
86 | virtual void SetTitle( const wxString& title); | |
87 | virtual bool Show( bool show = TRUE ); | |
88 | virtual void DoMoveWindow(int x, int y, int width, int height); | |
89 | void MacInvalidate( const Rect * rect, bool eraseBackground ) ; | |
fe08e597 SC |
90 | protected: |
91 | // common part of all ctors | |
92 | void Init(); | |
93 | ||
94 | // is the frame currently iconized? | |
95 | bool m_iconized; | |
96 | ||
97 | // should the frame be maximized when it will be shown? set by Maximize() | |
98 | // when it is called while the frame is hidden | |
99 | bool m_maximizeOnShow; | |
6ed63f8b SC |
100 | |
101 | SInt16 m_macWindowBackgroundTheme ; | |
102 | WindowRef m_macWindow ; | |
103 | ControlHandle m_macRootControl ; | |
104 | wxWindowMac* m_macFocus ; | |
105 | RgnHandle m_macNoEraseUpdateRgn ; | |
106 | bool m_macNeedsErasing ; | |
107 | ||
108 | static WindowRef s_macWindowInUpdate ; | |
fe08e597 SC |
109 | }; |
110 | ||
111 | // list of all frames and modeless dialogs | |
112 | extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows; | |
113 | ||
6ed63f8b SC |
114 | // associate mac windows with wx counterparts |
115 | ||
116 | wxTopLevelWindowMac* wxFindWinFromMacWindow( WindowRef inWindow ) ; | |
117 | void wxAssociateWinWithMacWindow(WindowRef inWindow, wxTopLevelWindowMac *win) ; | |
118 | void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) ; | |
119 | ||
120 | ||
fe08e597 SC |
121 | #endif // _WX_MSW_TOPLEVEL_H_ |
122 |