]> git.saurik.com Git - wxWidgets.git/blob - include/wx/palmos/toplevel.h
blind fix for GCC compilation when #pragmas are honored
[wxWidgets.git] / include / wx / palmos / toplevel.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/palmos/toplevel.h
3 // Purpose: wxTopLevelWindow
4 // Author: William Osborne
5 // Modified by:
6 // Created: 10/13/04
7 // RCS-ID: $Id:
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_PALMOS_TOPLEVEL_H_
13 #define _WX_PALMOS_TOPLEVEL_H_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "toplevel.h"
17 #endif
18
19 // ----------------------------------------------------------------------------
20 // wxTopLevelWindowPalm
21 // ----------------------------------------------------------------------------
22
23 class WXDLLEXPORT wxTopLevelWindowPalm : public wxTopLevelWindowBase
24 {
25 public:
26 // constructors and such
27 wxTopLevelWindowPalm() { Init(); }
28
29 wxTopLevelWindowPalm(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 bool Create(wxWindow *parent,
51 wxWindowID id,
52 const wxString& title,
53 const wxPoint& pos,
54 const wxSize& size,
55 long style,
56 const wxString& name,
57 wxFrame* PFrame);
58
59 virtual ~wxTopLevelWindowPalm();
60
61 // implement base class pure virtuals
62 virtual void Maximize(bool maximize = true);
63 virtual bool IsMaximized() const;
64 virtual void Iconize(bool iconize = true);
65 virtual bool IsIconized() const;
66 virtual void SetIcon(const wxIcon& icon);
67 virtual void SetIcons(const wxIconBundle& icons );
68 virtual void Restore();
69
70 #ifndef __WXWINCE__
71 virtual bool SetShape(const wxRegion& region);
72 #endif // __WXWINCE__
73
74 virtual bool Show(bool show = true);
75
76 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
77 virtual bool IsFullScreen() const { return m_fsIsShowing; }
78
79 // wxPalm only: EnableCloseButton(false) may be used to remove the "Close"
80 // button from the title bar
81 bool EnableCloseButton(bool enable = true);
82
83 // implementation from now on
84 // --------------------------
85
86 // event handlers
87 void OnActivate(wxActivateEvent& event);
88
89 // called by wxWindow whenever it gets focus
90 void SetLastFocus(wxWindow *win) { m_winLastFocused = win; }
91 wxWindow *GetLastFocus() const { return m_winLastFocused; }
92
93 protected:
94 // common part of all ctors
95 void Init();
96
97 // create a new frame, return false if it couldn't be created
98 bool CreateFrame(const wxString& title,
99 const wxPoint& pos,
100 const wxSize& size);
101
102 // create a new dialog using the given dialog template from resources,
103 // return false if it couldn't be created
104 bool CreateDialog(const void *dlgTemplate,
105 const wxString& title,
106 const wxPoint& pos,
107 const wxSize& size);
108
109 // common part of Iconize(), Maximize() and Restore()
110 void DoShowWindow(int nShowCmd);
111
112 // translate wxWidgets flags to Windows ones
113 virtual WXDWORD PalmGetStyle(long flags, WXDWORD *exstyle) const;
114
115 // choose the right parent to use with CreateWindow()
116 virtual WXHWND PalmGetParent() const;
117
118 // is the window 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
125 // Data to save/restore when calling ShowFullScreen
126 long m_fsStyle; // Passed to ShowFullScreen
127 wxRect m_fsOldSize;
128 long m_fsOldWindowStyle;
129 bool m_fsIsMaximized;
130 bool m_fsIsShowing;
131
132 // the last focused child: we restore focus to it on activation
133 wxWindow *m_winLastFocused;
134
135 DECLARE_EVENT_TABLE()
136 DECLARE_NO_COPY_CLASS(wxTopLevelWindowPalm)
137 };
138
139 static Boolean FrameFormHandleEvent(EventType* pEvent);
140
141 #endif // _WX_PALMOS_TOPLEVEL_H_
142