]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/mac/toplevel.h
Implemented wxButton::DoGetBestSize for wxMotif. Now normal buttons
[wxWidgets.git] / include / wx / mac / toplevel.h
... / ...
CommitLineData
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/mac/toplevel.h
3// Purpose: wxTopLevelWindowMac is the Mac 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#if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "toplevel.h"
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
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 SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); }
59 virtual void Restore();
60
61 virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style) = wxFULLSCREEN_ALL)
62 { return FALSE; }
63 virtual bool IsFullScreen() const { return FALSE; }
64
65 // implementation from now on
66 // --------------------------
67
68 virtual void MacCreateRealWindow( const wxString& title,
69 const wxPoint& pos,
70 const wxSize& size,
71 long style,
72 const wxString& name ) ;
73 static WXWindow MacGetWindowInUpdate() { return s_macWindowInUpdate ; }
74 virtual void MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin ) ;
75 virtual void Clear() ;
76 virtual WXWidget MacGetContainerForEmbedding() ;
77 WXWindow MacGetWindowRef() { return m_macWindow ; }
78 virtual void MacActivate( long timestamp , bool inIsActivating ) ;
79 virtual void MacUpdate( long timestamp ) ;
80#if !TARGET_CARBON
81 virtual void MacMouseDown( WXEVENTREF ev , short windowPart ) ;
82 virtual void MacMouseUp( WXEVENTREF ev , short windowPart ) ;
83 virtual void MacMouseMoved( WXEVENTREF ev , short windowPart ) ;
84 virtual void MacKeyDown( WXEVENTREF ev ) ;
85#endif
86 virtual void MacFireMouseEvent( wxUint16 kind , wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp ) ;
87 virtual void Raise();
88 virtual void Lower();
89 virtual void SetTitle( const wxString& title);
90 virtual bool Show( bool show = TRUE );
91 virtual void DoMoveWindow(int x, int y, int width, int height);
92 void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ;
93 short MacGetWindowBackgroundTheme() const { return m_macWindowBackgroundTheme ; }
94
95#if TARGET_CARBON
96 WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; }
97#endif
98protected:
99 // common part of all ctors
100 void Init();
101
102 // is the frame currently iconized?
103 bool m_iconized;
104
105 // should the frame be maximized when it will be shown? set by Maximize()
106 // when it is called while the frame is hidden
107 bool m_maximizeOnShow;
108
109 short m_macWindowBackgroundTheme ;
110 WXWindow m_macWindow ;
111 WXWidget m_macRootControl ;
112 wxWindowMac* m_macFocus ;
113 WXHRGN m_macNoEraseUpdateRgn ;
114 bool m_macNeedsErasing ;
115
116 static WXWindow s_macWindowInUpdate ;
117private :
118#if TARGET_CARBON
119 WXEVENTHANDLERREF m_macEventHandler ;
120#endif
121};
122
123// list of all frames and modeless dialogs
124extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows;
125
126// associate mac windows with wx counterparts
127
128wxTopLevelWindowMac* wxFindWinFromMacWindow( WXWindow inWindow ) ;
129void wxAssociateWinWithMacWindow(WXWindow inWindow, wxTopLevelWindowMac *win) ;
130void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) ;
131
132
133#endif // _WX_MSW_TOPLEVEL_H_
134