]>
Commit | Line | Data |
---|---|---|
ffecfa5a JS |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/palmos/toplevel.h | |
3 | // Purpose: wxTopLevelWindow | |
e1d63b79 | 4 | // Author: William Osborne - minimal working wxPalmOS port |
db101bd3 | 5 | // Modified by: Wlodzimierz ABX Skiba - more than minimal functionality |
ffecfa5a | 6 | // Created: 10/13/04 |
e1d63b79 | 7 | // RCS-ID: $Id$ |
db101bd3 | 8 | // Copyright: (c) William Osborne, Wlodzimierz Skiba |
ffecfa5a JS |
9 | // Licence: wxWindows licence |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_PALMOS_TOPLEVEL_H_ | |
13 | #define _WX_PALMOS_TOPLEVEL_H_ | |
14 | ||
ffecfa5a JS |
15 | // ---------------------------------------------------------------------------- |
16 | // wxTopLevelWindowPalm | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
19 | class WXDLLEXPORT wxTopLevelWindowPalm : public wxTopLevelWindowBase | |
20 | { | |
21 | public: | |
22 | // constructors and such | |
23 | wxTopLevelWindowPalm() { Init(); } | |
24 | ||
25 | wxTopLevelWindowPalm(wxWindow *parent, | |
26 | wxWindowID id, | |
27 | const wxString& title, | |
28 | const wxPoint& pos = wxDefaultPosition, | |
29 | const wxSize& size = wxDefaultSize, | |
30 | long style = wxDEFAULT_FRAME_STYLE, | |
31 | const wxString& name = wxFrameNameStr) | |
32 | { | |
33 | Init(); | |
34 | ||
35 | (void)Create(parent, id, title, pos, size, style, name); | |
36 | } | |
37 | ||
38 | bool Create(wxWindow *parent, | |
39 | wxWindowID id, | |
40 | const wxString& title, | |
41 | const wxPoint& pos = wxDefaultPosition, | |
42 | const wxSize& size = wxDefaultSize, | |
43 | long style = wxDEFAULT_FRAME_STYLE, | |
44 | const wxString& name = wxFrameNameStr); | |
4055ed82 | 45 | |
ffecfa5a JS |
46 | virtual ~wxTopLevelWindowPalm(); |
47 | ||
48 | // implement base class pure virtuals | |
4055ed82 | 49 | virtual void Maximize(bool maximize = true); |
ffecfa5a | 50 | virtual bool IsMaximized() const; |
4055ed82 | 51 | virtual void Iconize(bool iconize = true); |
ffecfa5a JS |
52 | virtual bool IsIconized() const; |
53 | virtual void SetIcon(const wxIcon& icon); | |
54 | virtual void SetIcons(const wxIconBundle& icons ); | |
55 | virtual void Restore(); | |
56 | ||
57 | #ifndef __WXWINCE__ | |
58 | virtual bool SetShape(const wxRegion& region); | |
59 | #endif // __WXWINCE__ | |
60 | ||
4055ed82 | 61 | virtual bool Show(bool show = true); |
ffecfa5a JS |
62 | |
63 | virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); | |
64 | virtual bool IsFullScreen() const { return m_fsIsShowing; } | |
65 | ||
4055ed82 | 66 | // wxPalm only: EnableCloseButton(false) may be used to remove the "Close" |
ffecfa5a | 67 | // button from the title bar |
4055ed82 | 68 | bool EnableCloseButton(bool enable = true); |
ffecfa5a JS |
69 | |
70 | // implementation from now on | |
71 | // -------------------------- | |
72 | ||
73 | // event handlers | |
74 | void OnActivate(wxActivateEvent& event); | |
75 | ||
76 | // called by wxWindow whenever it gets focus | |
77 | void SetLastFocus(wxWindow *win) { m_winLastFocused = win; } | |
78 | wxWindow *GetLastFocus() const { return m_winLastFocused; } | |
79 | ||
bdb54365 | 80 | // interface to native frame structure |
20bc5ad8 | 81 | WXFORMPTR GetForm() const; |
bdb54365 | 82 | |
721a9626 | 83 | // handle native events |
20bc5ad8 WS |
84 | bool HandleControlSelect(WXEVENTPTR event); |
85 | bool HandleControlRepeat(WXEVENTPTR event); | |
86 | bool HandleSize(WXEVENTPTR event); | |
a152561c | 87 | |
324eeecb WS |
88 | virtual WXWINHANDLE GetWinHandle() const; |
89 | ||
ffecfa5a JS |
90 | protected: |
91 | // common part of all ctors | |
92 | void Init(); | |
93 | ||
808e3bce WS |
94 | // getting and setting sizes |
95 | virtual void DoGetSize( int *width, int *height ) const; | |
96 | ||
ffecfa5a JS |
97 | // common part of Iconize(), Maximize() and Restore() |
98 | void DoShowWindow(int nShowCmd); | |
99 | ||
100 | // translate wxWidgets flags to Windows ones | |
101 | virtual WXDWORD PalmGetStyle(long flags, WXDWORD *exstyle) const; | |
102 | ||
ffecfa5a JS |
103 | // is the window currently iconized? |
104 | bool m_iconized; | |
105 | ||
106 | // should the frame be maximized when it will be shown? set by Maximize() | |
107 | // when it is called while the frame is hidden | |
108 | bool m_maximizeOnShow; | |
109 | ||
110 | // Data to save/restore when calling ShowFullScreen | |
111 | long m_fsStyle; // Passed to ShowFullScreen | |
112 | wxRect m_fsOldSize; | |
113 | long m_fsOldWindowStyle; | |
114 | bool m_fsIsMaximized; | |
115 | bool m_fsIsShowing; | |
116 | ||
117 | // the last focused child: we restore focus to it on activation | |
118 | wxWindow *m_winLastFocused; | |
119 | ||
120 | DECLARE_EVENT_TABLE() | |
121 | DECLARE_NO_COPY_CLASS(wxTopLevelWindowPalm) | |
122 | }; | |
123 | ||
ffecfa5a JS |
124 | #endif // _WX_PALMOS_TOPLEVEL_H_ |
125 |