]> git.saurik.com Git - wxWidgets.git/blame - include/wx/palmos/toplevel.h
(harmless) VC++ warning fixes
[wxWidgets.git] / include / wx / palmos / toplevel.h
CommitLineData
ffecfa5a
JS
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/palmos/toplevel.h
3// Purpose: wxTopLevelWindow
e1d63b79 4// Author: William Osborne - minimal working wxPalmOS port
ffecfa5a
JS
5// Modified by:
6// Created: 10/13/04
e1d63b79 7// RCS-ID: $Id$
ffecfa5a
JS
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
ffecfa5a
JS
19// ----------------------------------------------------------------------------
20// wxTopLevelWindowPalm
21// ----------------------------------------------------------------------------
22
23class WXDLLEXPORT wxTopLevelWindowPalm : public wxTopLevelWindowBase
24{
25public:
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);
4055ed82 49
ffecfa5a
JS
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);
4055ed82 58
ffecfa5a
JS
59 virtual ~wxTopLevelWindowPalm();
60
61 // implement base class pure virtuals
4055ed82 62 virtual void Maximize(bool maximize = true);
ffecfa5a 63 virtual bool IsMaximized() const;
4055ed82 64 virtual void Iconize(bool iconize = true);
ffecfa5a
JS
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
4055ed82 74 virtual bool Show(bool show = true);
ffecfa5a
JS
75
76 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
77 virtual bool IsFullScreen() const { return m_fsIsShowing; }
78
4055ed82 79 // wxPalm only: EnableCloseButton(false) may be used to remove the "Close"
ffecfa5a 80 // button from the title bar
4055ed82 81 bool EnableCloseButton(bool enable = true);
ffecfa5a
JS
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
93protected:
94 // common part of all ctors
95 void Init();
96
4055ed82 97 // create a new frame, return false if it couldn't be created
ffecfa5a
JS
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,
4055ed82 103 // return false if it couldn't be created
ffecfa5a
JS
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
139static Boolean FrameFormHandleEvent(EventType* pEvent);
140
141#endif // _WX_PALMOS_TOPLEVEL_H_
142