]> git.saurik.com Git - wxWidgets.git/blob - include/wx/palmos/toplevel.h
wxPaletteBase introduction. wxPalette::GetColoursCount() in interface of all platform...
[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 #ifdef __PALMOS__
20 #include <PalmOS.h>
21 #endif
22
23 // ----------------------------------------------------------------------------
24 // wxTopLevelWindowPalm
25 // ----------------------------------------------------------------------------
26
27 class WXDLLEXPORT wxTopLevelWindowPalm : public wxTopLevelWindowBase
28 {
29 public:
30 // constructors and such
31 wxTopLevelWindowPalm() { Init(); }
32
33 wxTopLevelWindowPalm(wxWindow *parent,
34 wxWindowID id,
35 const wxString& title,
36 const wxPoint& pos = wxDefaultPosition,
37 const wxSize& size = wxDefaultSize,
38 long style = wxDEFAULT_FRAME_STYLE,
39 const wxString& name = wxFrameNameStr)
40 {
41 Init();
42
43 (void)Create(parent, id, title, pos, size, style, name);
44 }
45
46 bool Create(wxWindow *parent,
47 wxWindowID id,
48 const wxString& title,
49 const wxPoint& pos = wxDefaultPosition,
50 const wxSize& size = wxDefaultSize,
51 long style = wxDEFAULT_FRAME_STYLE,
52 const wxString& name = wxFrameNameStr);
53
54 bool Create(wxWindow *parent,
55 wxWindowID id,
56 const wxString& title,
57 const wxPoint& pos,
58 const wxSize& size,
59 long style,
60 const wxString& name,
61 wxFrame* PFrame);
62
63 virtual ~wxTopLevelWindowPalm();
64
65 // implement base class pure virtuals
66 virtual void Maximize(bool maximize = TRUE);
67 virtual bool IsMaximized() const;
68 virtual void Iconize(bool iconize = TRUE);
69 virtual bool IsIconized() const;
70 virtual void SetIcon(const wxIcon& icon);
71 virtual void SetIcons(const wxIconBundle& icons );
72 virtual void Restore();
73
74 #ifndef __WXWINCE__
75 virtual bool SetShape(const wxRegion& region);
76 #endif // __WXWINCE__
77
78 virtual bool Show(bool show = TRUE);
79
80 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
81 virtual bool IsFullScreen() const { return m_fsIsShowing; }
82
83 // wxPalm only: EnableCloseButton(FALSE) may be used to remove the "Close"
84 // button from the title bar
85 bool EnableCloseButton(bool enable = TRUE);
86
87 // implementation from now on
88 // --------------------------
89
90 // event handlers
91 void OnActivate(wxActivateEvent& event);
92
93 // called by wxWindow whenever it gets focus
94 void SetLastFocus(wxWindow *win) { m_winLastFocused = win; }
95 wxWindow *GetLastFocus() const { return m_winLastFocused; }
96
97 protected:
98 // common part of all ctors
99 void Init();
100
101 // create a new frame, return FALSE if it couldn't be created
102 bool CreateFrame(const wxString& title,
103 const wxPoint& pos,
104 const wxSize& size);
105
106 // create a new dialog using the given dialog template from resources,
107 // return FALSE if it couldn't be created
108 bool CreateDialog(const void *dlgTemplate,
109 const wxString& title,
110 const wxPoint& pos,
111 const wxSize& size);
112
113 // common part of Iconize(), Maximize() and Restore()
114 void DoShowWindow(int nShowCmd);
115
116 // translate wxWidgets flags to Windows ones
117 virtual WXDWORD PalmGetStyle(long flags, WXDWORD *exstyle) const;
118
119 // choose the right parent to use with CreateWindow()
120 virtual WXHWND PalmGetParent() const;
121
122 // is the window currently iconized?
123 bool m_iconized;
124
125 // should the frame be maximized when it will be shown? set by Maximize()
126 // when it is called while the frame is hidden
127 bool m_maximizeOnShow;
128
129 // Data to save/restore when calling ShowFullScreen
130 long m_fsStyle; // Passed to ShowFullScreen
131 wxRect m_fsOldSize;
132 long m_fsOldWindowStyle;
133 bool m_fsIsMaximized;
134 bool m_fsIsShowing;
135
136 // the last focused child: we restore focus to it on activation
137 wxWindow *m_winLastFocused;
138
139 DECLARE_EVENT_TABLE()
140 DECLARE_NO_COPY_CLASS(wxTopLevelWindowPalm)
141 };
142
143 static Boolean FrameFormHandleEvent(EventType* pEvent);
144
145 #endif // _WX_PALMOS_TOPLEVEL_H_
146