]>
Commit | Line | Data |
---|---|---|
4514447c FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: platdetails.h | |
3 | // Purpose: Platform details page of the Doxygen manual | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
526954c5 | 6 | // Licence: wxWindows licence |
4514447c FM |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
9 | ||
880efa2a | 10 | /** |
4514447c | 11 | |
29f86fc1 | 12 | @page page_port Platform Details |
4514447c | 13 | |
e7054054 BP |
14 | @tableofcontents |
15 | ||
928f1a07 FM |
16 | wxWidgets defines a common API across platforms, but uses the native graphical |
17 | user interface (GUI) on each platform, so your program will take on the native | |
18 | look and feel that users are familiar with. Unfortunately native toolkits and | |
19 | hardware do not always support the functionality that the wxWidgets API | |
e7054054 BP |
20 | requires. This chapter collects notes about differences among supported |
21 | platforms and ports. | |
4514447c FM |
22 | |
23 | ||
24 | ||
928f1a07 | 25 | @section page_port_wxgtk wxGTK |
469e56bf | 26 | |
e7054054 BP |
27 | @htmlonly<div class="logo">@endhtmlonly |
28 | @image html logo_gtk.png | |
29 | @htmlonly</div>@endhtmlonly | |
3c4f71cc | 30 | |
e7054054 BP |
31 | wxGTK is a port of wxWidgets using the GTK+ library. It makes use of GTK+'s |
32 | native widgets wherever possible and uses wxWidgets' generic controls when | |
33 | needed. GTK+ itself has been ported to a number of systems, but so far only the | |
34 | original X11 version is supported. Support for other GTK+ backends is planned, | |
928f1a07 | 35 | such as the new DirectFB backend. |
3c4f71cc | 36 | |
e7054054 BP |
37 | All work is being done on GTK+ version 2.0 and above. Support for GTK+ 1.2 will |
38 | be deprecated in a later release. | |
3c4f71cc | 39 | |
5bb7884b | 40 | You will need GTK+ 2.6 or higher which is available from: |
3c4f71cc | 41 | |
928f1a07 | 42 | http://www.gtk.org |
3c4f71cc | 43 | |
e7054054 BP |
44 | The newer version of GTK+ you use, the more native widgets and features will be |
45 | utilized. We have gone to great lengths to allow compiling wxWidgets | |
46 | applications with the latest version of GTK+, with the resulting binary working | |
47 | on systems even with a much earlier version of GTK+. You will have to ensure | |
48 | that the application is launched with lazy symbol binding for that. | |
3c4f71cc | 49 | |
e7054054 BP |
50 | In order to configure wxWidgets to compile wxGTK you will need use the |
51 | @c --with-gtk argument to the @c configure script. This is the default for many | |
52 | systems. | |
3c4f71cc | 53 | |
e7054054 BP |
54 | GTK+ 1.2 can still be used, albeit discouraged. For that you can pass |
55 | @c --with-gtk=1 to the @c configure script. | |
3c4f71cc | 56 | |
dc26e984 PC |
57 | Support for GTK+ 3 is available starting with wxWidgets 2.9.4, use @c configure |
58 | option @c --with-gtk=3 to enable it. It is still under development and may have | |
59 | significant bugs or missing features, and should be considered experimental. | |
60 | ||
e7054054 BP |
61 | For further information, please see the files in @c docs/gtk in the |
62 | distribution. | |
63 | ||
3c4f71cc VS |
64 | |
65 | ||
0f6c9085 | 66 | @section page_port_wxosx wxOSX |
3c4f71cc | 67 | |
e7054054 BP |
68 | @htmlonly<div class="logo">@endhtmlonly |
69 | @image html logo_osxleopard.png | |
70 | @htmlonly</div>@endhtmlonly | |
469e56bf | 71 | |
0f6c9085 KO |
72 | @subsection page_port_wxosx_carbon wxOSX/Carbon |
73 | ||
e7054054 BP |
74 | wxOSX/Carbon is a port of wxWidgets for the Macintosh OS platform. Currently |
75 | MacOS X 10.5 or higher are supported. wxOSX/Carbon can be compiled both using | |
76 | Apple's command line developer tools as well as Apple's Xcode IDE. wxOSX/Carbon | |
77 | supports both the Intel and PowerPC architectures and can be used to produce | |
78 | "universal binaries" in order create application which can run both | |
79 | architecture. Unfortunately, wxOSX/Carbon does not support any 64-bit | |
80 | architecture since Apple decided not to port its Carbon API entirely to 64-bit. | |
81 | ||
82 | @note Carbon has been deprecated by Apple as of OS X 10.5 and will likely be | |
83 | removed entirely in a future OS version. It's recommended you look into | |
0f6c9085 KO |
84 | switching your app over to wxOSX/Cocoa as soon as possible. |
85 | ||
e7054054 BP |
86 | For further information, please see the files in @c docs/osx in the |
87 | distribution. | |
3c4f71cc VS |
88 | |
89 | ||
90 | ||
0f6c9085 | 91 | @subsection page_port_wxosx_cocoa wxOSX/Cocoa |
5bb7884b | 92 | |
e7054054 BP |
93 | wxOSX/Cocoa is another port of wxWidgets for the Macintosh OS platform. |
94 | Currently MacOS X 10.5 or higher are supported. In contrast to wxOSX/Carbon, | |
95 | it uses the Cocoa API in place of Carbon. Much work has gone into this port | |
96 | and many controls are functional, but the port has not reached the maturity of | |
97 | the wxOSX/Carbon port yet. It is possible to use wxOSX/Cocoa on 64-bit | |
98 | architectures. | |
5bb7884b | 99 | |
e7054054 | 100 | In order to configure wxWidgets to compile wxOSX/Cocoa you will need to type: |
0f6c9085 KO |
101 | |
102 | @verbatim configure --with-osx_cocoa @endverbatim | |
103 | ||
e7054054 BP |
104 | For further information, please see the files in @c docs/osx in the |
105 | distribution. | |
1dfb6ff0 | 106 | |
e7054054 BP |
107 | @note There was a previous effort towards a Cocoa port called wxCocoa, which |
108 | was implemented totally with Cocoa API unlike the OSX/Cocoa port which uses OS | |
109 | X C APIs to share code, and while it is no longer being actively developed, | |
110 | docs for it are available in @c docs/cocoa in the distribution. | |
2b8471fb KO |
111 | |
112 | ||
3c4f71cc | 113 | |
928f1a07 | 114 | @section page_port_wxos2 wxOS2 |
469e56bf | 115 | |
928f1a07 FM |
116 | wxOS2 is a port of wxWidgets for the IBM OS/2 Warp3 and Warp4 platforms. |
117 | This port is currently under construction and in beta phase. | |
469e56bf | 118 | |
1dfb6ff0 FM |
119 | For further information, please see the files in @c docs/os2 |
120 | in the distribution. | |
121 | ||
3c4f71cc VS |
122 | |
123 | ||
928f1a07 | 124 | @section page_port_wxx11 wxX11 |
469e56bf | 125 | |
e7054054 BP |
126 | @htmlonly<div class="logo">@endhtmlonly |
127 | @image html logo_x11.png | |
128 | @htmlonly</div>@endhtmlonly | |
469e56bf | 129 | |
e7054054 BP |
130 | wxX11 is a port of wxWidgets using X11 (The X Window System) as the underlying |
131 | graphics backend. wxX11 draws its widgets using the wxUniversal widget set | |
132 | which is now part of wxWidgets. wxX11 is well-suited for a number of special | |
133 | applications such as those running on systems with few resources (PDAs) or for | |
bbc5b7f8 | 134 | applications which need to use a special themed look. |
3c4f71cc | 135 | |
e7054054 | 136 | In order to configure wxWidgets to compile wxX11 you will need to type: |
3c4f71cc | 137 | |
928f1a07 | 138 | @verbatim configure --with-x11 --with-universal @endverbatim |
3c4f71cc | 139 | |
e7054054 BP |
140 | For further information, please see the files in @c docs/x11 in the |
141 | distribution. There is also a page on the use of wxWidgets for embedded | |
142 | applications on the wxWidgets web site. | |
3c4f71cc VS |
143 | |
144 | ||
145 | ||
1dfb6ff0 FM |
146 | @section page_port_wxmotif wxMotif |
147 | ||
e7054054 BP |
148 | @htmlonly<div class="logo">@endhtmlonly |
149 | @image html logo_motif.png | |
150 | @htmlonly</div>@endhtmlonly | |
1dfb6ff0 | 151 | |
e7054054 BP |
152 | wxMotif is a port of wxWidgets for X11 systems using Motif libraries. Motif |
153 | libraries provide a clean and fast user interface at the expense of the beauty | |
154 | and candy of newer interfaces like GTK. | |
1dfb6ff0 | 155 | |
e7054054 BP |
156 | For further information, please see the files in @c docs/motif in the |
157 | distribution. | |
1dfb6ff0 | 158 | |
3c4f71cc VS |
159 | |
160 | ||
928f1a07 | 161 | @section page_port_wxmsw wxMSW |
469e56bf | 162 | |
e7054054 BP |
163 | @htmlonly<div class="logo">@endhtmlonly |
164 | @image html logo_win.png | |
165 | @htmlonly</div>@endhtmlonly | |
469e56bf | 166 | |
7ecc54df | 167 | wxMSW is a port of wxWidgets for the Windows platforms including Windows 95, |
e7054054 BP |
168 | 98, ME, 2000, NT, XP and Vista in ANSI and Unicode modes (for Windows 9x and ME |
169 | through the MSLU extension library). wxMSW ensures native look and feel for XP | |
170 | when using wxWidgets version 2.3.3 or higher. wxMSW can be compiled with a | |
7ecc54df BP |
171 | great variety of compilers including Microsoft Studio VC++, Borland 5.5, |
172 | MinGW32, Cygwin and Watcom as well as cross-compilation with a Linux-hosted | |
928f1a07 | 173 | MinGW32 tool chain. |
3c4f71cc | 174 | |
e7054054 BP |
175 | For further information, please see the files in docs/msw in the distribution. |
176 | ||
177 | @subsection page_port_wxmsw_themedborders Themed Borders | |
178 | ||
179 | Starting with wxWidgets 2.8.5, you can specify the @c wxBORDER_THEME style to | |
180 | have wxWidgets use a themed border. Using the default XP theme, this is a thin | |
181 | 1-pixel blue border, with an extra 1-pixel border in the window client | |
182 | background colour (usually white) to separate the client area's scrollbars from | |
183 | the border. | |
184 | ||
185 | If you don't specify a border style for a wxTextCtrl in rich edit mode, | |
186 | wxWidgets now gives the control themed borders automatically, where previously | |
187 | they would take the Windows 95-style sunken border. Other native controls such | |
188 | as wxTextCtrl in non-rich edit mode, and wxComboBox already paint themed | |
189 | borders where appropriate. To use themed borders on other windows, such as | |
190 | wxPanel, pass the @c wxBORDER_THEME style, or (apart from wxPanel) pass no | |
191 | border style. | |
192 | ||
193 | In general, specifying @c wxBORDER_THEME will cause a border of some kind to be | |
194 | used, chosen by the platform and control class. To leave the border decision | |
195 | entirely to wxWidgets, pass @c wxBORDER_DEFAULT. This is not to be confused | |
196 | with specifying @c wxBORDER_NONE, which says that there should definitely be | |
197 | @e no border. | |
198 | ||
199 | @subsubsection page_port_wxmsw_themedborders_details Internal Border Implementation | |
200 | ||
201 | The way that wxMSW decides whether to apply a themed border is as follows. The | |
202 | theming code calls wxWindow::GetBorder() to obtain a border. If no border style | |
203 | has been passed to the window constructor, GetBorder() calls GetDefaultBorder() | |
204 | for this window. If wxBORDER_THEME was passed to the window constructor, | |
205 | GetBorder() calls GetDefaultBorderForControl(). | |
206 | ||
207 | The implementation of wxWindow::GetDefaultBorder() on wxMSW calls | |
208 | wxWindow::CanApplyThemeBorder() which is a virtual function that tells | |
209 | wxWidgets whether a control can have a theme applied explicitly (some native | |
210 | controls already paint a theme in which case we should not apply it ourselves). | |
211 | Note that wxPanel is an exception to this rule because in many cases we wish to | |
212 | create a window with no border (for example, notebook pages). So wxPanel | |
213 | overrides GetDefaultBorder() in order to call the generic | |
214 | wxWindowBase::GetDefaultBorder(), returning wxBORDER_NONE. | |
3c4f71cc | 215 | |
928f1a07 | 216 | @subsection page_port_wxmsw_wince wxWinCE |
3c4f71cc | 217 | |
e7054054 BP |
218 | wxWinCE is the name given to wxMSW when compiled on Windows CE devices; most of |
219 | wxMSW is common to Win32 and Windows CE but there are some simplifications, | |
220 | enhancements, and differences in behaviour. | |
3c4f71cc | 221 | |
e7054054 BP |
222 | For building instructions, see docs/msw/wince in the distribution, also the |
223 | section about Visual Studio 2005 project files below. The rest of this section | |
224 | documents issues you need to be aware of when programming for Windows CE | |
225 | devices. | |
3c4f71cc | 226 | |
e7054054 | 227 | @subsubsection page_port_wxmsw_wince_ General Issues for wxWinCE |
3c4f71cc | 228 | |
e7054054 BP |
229 | Mobile applications generally have fewer features and simpler user interfaces. |
230 | Simply omit whole sizers, static lines and controls in your dialogs, and use | |
231 | comboboxes instead of listboxes where appropriate. You also need to reduce the | |
232 | amount of spacing used by sizers, for which you can use a macro such as this: | |
3c4f71cc | 233 | |
3ed3a1c8 | 234 | @code |
928f1a07 FM |
235 | #if defined(__WXWINCE__) |
236 | #define wxLARGESMALL(large,small) small | |
237 | #else | |
238 | #define wxLARGESMALL(large,small) large | |
239 | #endif | |
3c4f71cc | 240 | |
928f1a07 FM |
241 | // Usage |
242 | topsizer->Add( CreateTextSizer( message ), 0, wxALL, wxLARGESMALL(10,0) ); | |
3ed3a1c8 | 243 | @endcode |
3c4f71cc | 244 | |
e7054054 BP |
245 | There is only ever one instance of a Windows CE application running, and |
246 | wxWidgets will take care of showing the current instance and shutting down the | |
247 | second instance if necessary. | |
3c4f71cc | 248 | |
e7054054 BP |
249 | You can test the return value of wxSystemSettings::GetScreenType() for a |
250 | qualitative assessment of what kind of display is available, or use | |
251 | wxGetDisplaySize() if you need more information. | |
3c4f71cc | 252 | |
e7054054 BP |
253 | You can also use wxGetOsVersion to test for a version of Windows CE at run-time |
254 | (see the next section). However, because different builds are currently | |
255 | required to target different kinds of device, these values are hard-wired | |
256 | according to the build, and you cannot dynamically adapt the same executable | |
257 | for different major Windows CE platforms. This would require a different | |
258 | approach to the way wxWidgets adapts its behaviour (such as for menubars) to | |
259 | suit the style of device. | |
928f1a07 | 260 | |
e7054054 BP |
261 | See the "Life!" example (demos/life) for an example of an application that has |
262 | been tailored for PocketPC and Smartphone use. | |
928f1a07 | 263 | |
e7054054 BP |
264 | @note Don't forget to have this line in your .rc file, |
265 | as for desktop Windows applications: | |
928f1a07 FM |
266 | |
267 | @verbatim #include "wx/msw/wx.rc" @endverbatim | |
268 | ||
269 | @subsubsection page_port_wxmsw_wince_sdk Testing for WinCE SDKs | |
270 | ||
e7054054 | 271 | Use these preprocessor symbols to test for the different types of devices: |
928f1a07 FM |
272 | |
273 | @li @b __SMARTPHONE__ Generic mobile devices with phone buttons and a small display | |
274 | @li @b __PDA__ Generic mobile devices with no phone | |
275 | @li @b __HANDHELDPC__ Generic mobile device with a keyboard | |
276 | @li @b __WXWINCE__ Microsoft-powered Windows CE devices, whether PocketPC, Smartphone or Standard SDK | |
277 | @li @b WIN32_PLATFORM_WFSP Microsoft-powered smartphone | |
278 | @li @b __POCKETPC__ Microsoft-powered PocketPC devices with touch-screen | |
279 | @li @b __WINCE_STANDARDSDK__ Microsoft-powered Windows CE devices, for generic Windows CE applications | |
280 | @li @b __WINCE_NET__ Microsoft-powered Windows CE .NET devices (_WIN32_WCE is 400 or greater) | |
281 | ||
e7054054 | 282 | wxGetOsVersion() will return these values: |
928f1a07 FM |
283 | |
284 | @li @b wxWINDOWS_POCKETPC The application is running under PocketPC. | |
285 | @li @b wxWINDOWS_SMARTPHONE The application is running under Smartphone. | |
286 | @li @b wxWINDOWS_CE The application is running under Windows CE (built with the Standard SDK). | |
287 | ||
928f1a07 FM |
288 | @subsubsection page_port_wxmsw_wince_sizing Window sizing in wxWinCE |
289 | ||
e7054054 BP |
290 | Top level windows (dialogs, frames) are created always full-screen. Fit() of |
291 | sizers will not rescale top level windows but instead will scale window | |
292 | content. | |
928f1a07 | 293 | |
e7054054 BP |
294 | If the screen orientation changes, the windows will automatically be resized so |
295 | no further action needs to be taken (unless you want to change the layout | |
296 | according to the orientation, which you could detect in idle time, for | |
297 | example). When input panel (SIP) is shown, top level windows (frames and | |
298 | dialogs) resize accordingly (see wxTopLevelWindow::HandleSettingChange()). | |
928f1a07 | 299 | |
e7054054 | 300 | @subsubsection page_port_wxmsw_wince_toplevel Closing Top-level Windows in wxWinCE |
928f1a07 | 301 | |
e7054054 BP |
302 | You won't get a wxCloseEvent when the user clicks on the X in the titlebar on |
303 | Smartphone and PocketPC; the window is simply hidden instead. However the | |
304 | system may send the event to force the application to close down. | |
928f1a07 FM |
305 | |
306 | @subsubsection page_port_wxmsw_wince_hibernation Hibernation in wxWinCE | |
307 | ||
e7054054 BP |
308 | Smartphone and PocketPC will send a @c wxEVT_HIBERNATE to the application |
309 | object in low memory conditions. Your application should release memory and | |
310 | close dialogs, and wake up again when the next @c wxEVT_ACTIVATE or | |
311 | @c wxEVT_ACTIVATE_APP message is received. (@c wxEVT_ACTIVATE_APP is generated | |
312 | whenever a @c wxEVT_ACTIVATE event is received in Smartphone and PocketPC, | |
313 | since these platforms do not support @c WM_ACTIVATEAPP.) | |
928f1a07 | 314 | |
e7054054 | 315 | @subsubsection page_port_wxmsw_wince_hwbutt Hardware Buttons in wxWinCE |
928f1a07 | 316 | |
3ed3a1c8 | 317 | Special hardware buttons are sent to a window via the @c wxEVT_HOTKEY event |
e7054054 BP |
318 | under Smartphone and PocketPC. You should first register each required button |
319 | with wxWindow::RegisterHotKey(), and unregister the button when you're done | |
320 | with it. For example: | |
928f1a07 | 321 | |
3ed3a1c8 | 322 | @code |
928f1a07 FM |
323 | win->RegisterHotKey(0, wxMOD_WIN, WXK_SPECIAL1); |
324 | win->UnregisterHotKey(0); | |
3ed3a1c8 | 325 | @endcode |
928f1a07 | 326 | |
e7054054 BP |
327 | You may have to register the buttons in a @c wxEVT_ACTIVATE event handler since |
328 | other applications will grab the buttons. | |
928f1a07 | 329 | |
e7054054 BP |
330 | There is currently no method of finding out the names of the special buttons or |
331 | how many there are. | |
3c4f71cc | 332 | |
928f1a07 | 333 | @subsubsection page_port_wxmsw_wince_dialogs Dialogs in wxWinCE |
3c4f71cc | 334 | |
928f1a07 | 335 | PocketPC dialogs have an OK button on the caption, and so you should generally |
e7054054 BP |
336 | not repeat an OK button on the dialog. You can add a Cancel button if |
337 | necessary, but some dialogs simply don't offer you the choice (the guidelines | |
338 | recommend you offer an Undo facility to make up for it). When the user clicks | |
339 | on the OK button, your dialog will receive a @c wxID_OK event by default. If | |
340 | you wish to change this, call wxDialog::SetAffirmativeId() with the required | |
341 | identifier to be used. Or, override wxDialog::DoOK() (return @false to have | |
342 | wxWidgets simply call Close to dismiss the dialog). | |
3c4f71cc | 343 | |
928f1a07 | 344 | Smartphone dialogs do @e not have an OK button on the caption, and are closed |
e7054054 BP |
345 | using one of the two menu buttons. You need to assign these using |
346 | wxTopLevelWindow::SetLeftMenu and wxTopLevelWindow::SetRightMenu(), for | |
347 | example: | |
3c4f71cc | 348 | |
3ed3a1c8 | 349 | @code |
928f1a07 FM |
350 | #ifdef __SMARTPHONE__ |
351 | SetLeftMenu(wxID_OK); | |
352 | SetRightMenu(wxID_CANCEL, _("Cancel")); | |
353 | #elif defined(__POCKETPC__) | |
354 | // No OK/Cancel buttons on PocketPC, OK on caption will close | |
355 | #else | |
356 | topsizer->Add( CreateButtonSizer( wxOK|wxCANCEL ), 0, wxEXPAND | wxALL, 10 ); | |
357 | #endif | |
3ed3a1c8 | 358 | @endcode |
3c4f71cc | 359 | |
e7054054 BP |
360 | For implementing property sheets (flat tabs), use a wxNotebook with |
361 | @c wxNB_FLAT|wxNB_BOTTOM and have the notebook left, top and right sides | |
362 | overlap the dialog by about 3 pixels to eliminate spurious borders. You can do | |
363 | this by using a negative spacing in your sizer Add() call. The cross-platform | |
364 | property sheet dialog wxPropertySheetDialog is provided, to show settings in | |
365 | the correct style on PocketPC and on other platforms. | |
3c4f71cc | 366 | |
928f1a07 FM |
367 | Notifications (bubble HTML text with optional buttons and links) will also be |
368 | implemented in the future for PocketPC. | |
3c4f71cc | 369 | |
928f1a07 FM |
370 | Modeless dialogs probably don't make sense for PocketPC and Smartphone, since |
371 | frames and dialogs are normally full-screen, and a modeless dialog is normally | |
372 | intended to co-exist with the main application frame. | |
3c4f71cc | 373 | |
e7054054 | 374 | @subsubsection page_port_wxmsw_wince_ppc Menubars and Toolbars in PocketPC |
3c4f71cc | 375 | |
e7054054 BP |
376 | On PocketPC, a frame must always have a menubar, even if it's empty. An empty |
377 | menubar/toolbar is automatically provided for dialogs, to hide any existing | |
378 | menubar for the duration of the dialog. | |
928f1a07 | 379 | |
e7054054 BP |
380 | Menubars and toolbars are implemented using a combined control, but you can use |
381 | essentially the usual wxWidgets API; wxWidgets will combine the menubar and | |
382 | toolbar. However, there are some restrictions: | |
928f1a07 | 383 | |
3ed3a1c8 | 384 | @li You must create the frame's primary toolbar with wxFrame::CreateToolBar(), |
b15e29d6 BP |
385 | because this uses the special wxToolMenuBar class (derived from wxToolBar) |
386 | to implement the combined toolbar and menubar. Otherwise, you can create | |
387 | and manage toolbars using the wxToolBar class as usual, for example to | |
388 | implement an optional formatting toolbar above the menubar as Pocket Word | |
389 | does. But don't assign a wxToolBar to a frame using SetToolBar - you should | |
390 | always use CreateToolBar for the main frame toolbar. | |
e7054054 | 391 | @li Deleting and adding tools to wxToolMenuBar after Realize is called is not |
b15e29d6 | 392 | supported. |
e7054054 | 393 | @li For speed, colours are not remapped to the system colours as they are in |
b15e29d6 BP |
394 | wxMSW. Provide the tool bitmaps either with the correct system button |
395 | background, or with transparency (for example, using XPMs). | |
e7054054 | 396 | @li Adding controls to wxToolMenuBar is not supported. However, wxToolBar |
b15e29d6 | 397 | supports controls. |
e7054054 BP |
398 | |
399 | Unlike in all other ports, a wxDialog has a wxToolBar automatically created for | |
400 | you. You may either leave it blank, or access it with wxDialog::GetToolBar() | |
3ed3a1c8 | 401 | and add buttons, then calling wxToolBar::Realize(). You cannot set or recreate |
928f1a07 FM |
402 | the toolbar. |
403 | ||
e7054054 | 404 | @subsubsection page_port_wxmsw_wince_smart Menubars and Toolbars in Smartphone |
928f1a07 | 405 | |
e7054054 BP |
406 | On Smartphone, there are only two menu buttons, so a menubar is simulated using |
407 | a nested menu on the right menu button. Any toolbars are simply ignored on | |
928f1a07 FM |
408 | Smartphone. |
409 | ||
e7054054 | 410 | @subsubsection page_port_wxmsw_wince_closing Closing Windows in wxWinCE |
928f1a07 | 411 | |
e7054054 BP |
412 | The guidelines state that applications should not have a Quit menu item, since |
413 | the user should not have to know whether an application is in memory or not. | |
414 | The close button on a window does not call the window's close handler; it | |
415 | simply hides the window. However, the guidelines say that the Ctrl+Q | |
416 | accelerator can be used to quit the application, so wxWidgets defines this | |
417 | accelerator by default and if your application handles wxID_EXIT, it will do | |
418 | the right thing. | |
928f1a07 | 419 | |
e7054054 | 420 | @subsubsection page_port_wxmsw_wince_ctx Context Menus in wxWinCE |
928f1a07 | 421 | |
e7054054 BP |
422 | To enable context menus in PocketPC, you currently need to call |
423 | wxWindow::EnableContextMenu(), a wxWinCE-only function. Otherwise the context | |
424 | menu event (wxContextMenuEvent) will never be sent. This API is subject to | |
425 | change. | |
928f1a07 FM |
426 | |
427 | Context menus are not supported in Smartphone. | |
428 | ||
e7054054 | 429 | @subsubsection page_port_wxmsw_wince_ctrl Control Differences on wxWinCE |
928f1a07 FM |
430 | |
431 | These controls and styles are specific to wxWinCE: | |
432 | ||
e7054054 BP |
433 | @li wxTextCtrl The @c wxTE_CAPITALIZE style causes a CAPEDIT control to be |
434 | created, which capitalizes the first letter. | |
928f1a07 FM |
435 | |
436 | These controls are missing from wxWinCE: | |
437 | ||
438 | @li MDI classes MDI is not supported under Windows CE. | |
439 | @li wxMiniFrame Not supported under Windows CE. | |
440 | ||
e7054054 BP |
441 | Tooltips are not currently supported for controls, since on PocketPC controls |
442 | with tooltips are distinct controls, and it will be hard to add dynamic tooltip | |
443 | support. | |
928f1a07 FM |
444 | |
445 | Control borders on PocketPC and Smartphone should normally be specified with | |
3ed3a1c8 | 446 | @c wxBORDER_SIMPLE instead of @c wxBORDER_SUNKEN. Controls will usually adapt |
e7054054 BP |
447 | appropriately by virtue of their GetDefaultBorder() function, but if you wish |
448 | to specify a style explicitly you can use @c wxDEFAULT_CONTROL_BORDER which | |
449 | will give a simple border on PocketPC and Smartphone, and the sunken border on | |
928f1a07 FM |
450 | other platforms. |
451 | ||
e7054054 | 452 | @subsubsection page_port_wxmsw_wince_help Online Help in wxWinCE |
928f1a07 | 453 | |
e7054054 BP |
454 | You can use the help controller wxWinceHelpController which controls simple |
455 | @c .htm files, usually installed in the Windows directory. See the Windows CE | |
456 | reference for how to format the HTML files. | |
928f1a07 | 457 | |
e7054054 | 458 | @subsubsection page_port_wxmsw_wince_install Installing your PocketPC and Smartphone Applications |
928f1a07 | 459 | |
e7054054 BP |
460 | To install your application, you need to build a CAB file using the parameters |
461 | defined in a special .inf file. The CabWiz program in your SDK will compile the | |
462 | CAB file from the .inf file and files that it specifies. | |
928f1a07 | 463 | |
e7054054 BP |
464 | For delivery, you can simply ask the user to copy the CAB file to the device |
465 | and execute the CAB file using File Explorer. Or, you can write a program for | |
466 | the desktop PC that will find the ActiveSync Application Manager and install | |
467 | the CAB file on the device, which is obviously much easier for the user. | |
928f1a07 FM |
468 | |
469 | Here are some links that may help. | |
470 | ||
471 | @li A setup builder that takes CABs and builds a setup program is at | |
472 | http://www.eskimo.com/~scottlu/win/index.html. | |
473 | @li Sample installation files can be found in | |
474 | <tt>Windows CE Tools/wce420/POCKET PC 2003/Samples/Win32/AppInst</tt>. | |
475 | @li An installer generator using wxPython can be found at | |
476 | http://ppcquicksoft.iespana.es/ppcquicksoft/myinstall.html. | |
477 | @li Miscellaneous Windows CE resources can be found at | |
478 | http://www.orbworks.com/pcce/resources.html. | |
479 | @li Installer creation instructions with a setup.exe for installing to PPC can be found at | |
480 | http://www.pocketpcdn.com/articles/creatingsetup.html. | |
481 | @li Microsoft instructions are at | |
482 | http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnce30/html/appinstall30.asp?frame=true | |
483 | @li Troubleshooting WinCE application installations: | |
484 | http://support.microsoft.com/default.aspx?scid=KB;en-us;q181007 | |
485 | ||
e7054054 BP |
486 | You may also check out <tt>demos/life/setup/wince</tt> which contains scripts |
487 | to create a PocketPC installation for ARM-based devices. In particular, | |
488 | @c build.bat builds the distribution and copies it to a directory called | |
489 | @c Deliver. | |
928f1a07 FM |
490 | |
491 | @subsubsection page_port_wxmsw_wince_filedlg wxFileDialog in PocketPC | |
492 | ||
e7054054 BP |
493 | Allowing the user to access files on memory cards, or on arbitrary parts of the |
494 | filesystem, is a pain; the standard file dialog only shows folders under My | |
495 | Documents or folders on memory cards (not the system or card root directory, | |
496 | for example). This is a known problem for PocketPC developers. | |
928f1a07 | 497 | |
e7054054 BP |
498 | If you need a file dialog that allows access to all folders, you can use |
499 | wxGenericFileDialog instead. You will need to include @c wx/generic/filedlgg.h. | |
928f1a07 FM |
500 | |
501 | @subsubsection page_port_wxmsw_wince_evc Embedded Visual C++ Issues | |
502 | ||
503 | <b>Run-time type information</b> | |
504 | ||
e7054054 BP |
505 | If you wish to use runtime type information (RTTI) with eVC++ 4, you need to |
506 | download an extra library, @c ccrtrtti.lib, and link with it. At the time of | |
928f1a07 FM |
507 | writing you can get it from here: |
508 | ||
509 | @verbatim | |
510 | http://support.microsoft.com/kb/830482/en-us | |
511 | @endverbatim | |
512 | ||
513 | Otherwise you will get linker errors similar to this: | |
514 | ||
515 | @verbatim | |
516 | wxwince26d.lib(control.obj) : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@) | |
517 | @endverbatim | |
518 | ||
519 | <b>Windows Mobile 5.0 emulator</b> | |
520 | ||
e7054054 BP |
521 | Note that there is no separate emulator configuration for Windows Mobile 5.0: |
522 | the emulator runs the ARM code directly. | |
928f1a07 FM |
523 | |
524 | <b>Visual Studio 2005 project files</b> | |
525 | ||
e7054054 BP |
526 | Unfortunately, Visual Studio 2005, required to build Windows Mobile 5.0 |
527 | applications, doesn't do a perfect job of converting the project files from | |
528 | eVC++ format. | |
928f1a07 | 529 | |
e7054054 BP |
530 | When you have converted the wxWidgets workspace, edit the configuration |
531 | properties for each configuration and in the Librarian, add a relative path | |
b15e29d6 BP |
532 | |
533 | @verbatim ..\..\lib @endverbatim | |
534 | ||
535 | to each library path. For example: | |
536 | ||
537 | @verbatim ..\$(PlatformName)\$(ConfigurationName)\wx_mono.lib @endverbatim | |
928f1a07 FM |
538 | |
539 | Then, for a sample you want to compile, edit the configuration properties | |
540 | and make sure | |
b15e29d6 BP |
541 | |
542 | @verbatim ..\..\lib\$(PlatformName)\$(ConfigurationName) @endverbatim | |
543 | ||
544 | is in the Linker/General/Additional Library Directories property. Also change | |
545 | the Linker/Input/Additional Dependencies property to something like | |
546 | ||
547 | @verbatim | |
548 | coredll.lib wx_mono.lib wx_wxjpeg.lib wx_wxpng.lib wx_wxzlib.lib wx_wxexpat.lib commctrl.lib winsock.lib wininet.lib | |
549 | @endverbatim | |
550 | ||
551 | since the library names in the wxWidgets workspace were changed by VS 2005. | |
928f1a07 | 552 | |
7ecc54df | 553 | Alternately, you could edit all the names to be identical to the original eVC++ |
928f1a07 FM |
554 | names, but this will probably be more fiddly. |
555 | ||
e7054054 | 556 | @subsubsection page_port_wxmsw_wince_issues Remaining Issues |
928f1a07 FM |
557 | |
558 | These are some of the remaining problems to be sorted out, and features | |
559 | to be supported. | |
560 | ||
561 | @li <b>Windows Mobile 5 issues.</b> It is not possible to get the HMENU for | |
562 | the command bar on Mobile 5, so the menubar functions need to be rewritten | |
563 | to get the individual menus without use of a menubar handle. Also the | |
564 | new Mobile 5 convention of using only two menus (and no bitmap buttons) needs to be | |
565 | considered. | |
566 | @li <b>Sizer speed.</b> Particularly for dialogs containing notebooks, | |
567 | layout seems slow. Some analysis is required. | |
568 | @li <b>Notification boxes.</b> The balloon-like notification messages, and their | |
569 | icons, should be implemented. This will be quite straightforward. | |
570 | @li <b>SIP size.</b> We need to be able to get the area taken up by the SIP (input panel), | |
571 | and the remaining area, by calling SHSipInfo. We also may need to be able to show and hide | |
572 | the SIP programmatically, with SHSipPreference. See also the <em>Input Dialogs</em> topic in | |
573 | the <em>Programming Windows CE</em> guide for more on this, and how to have dialogs | |
3ed3a1c8 | 574 | show the SIP automatically using the @c WC_SIPREF control. |
928f1a07 FM |
575 | @li <b>wxStaticBitmap.</b> The About box in the "Life!" demo shows a bitmap that is |
576 | the correct size on the emulator, but too small on a VGA Pocket Loox device. | |
577 | @li <b>wxStaticLine.</b> Lines don't show up, and the documentation suggests that | |
3ed3a1c8 | 578 | missing styles are implemented with @c WM_PAINT. |
928f1a07 FM |
579 | @li <b>HTML control.</b> PocketPC has its own HTML control which can be used for showing |
580 | local pages or navigating the web. We should create a version of wxHtmlWindow that uses this | |
581 | control, or have a separately-named control (wxHtmlCtrl), with a syntax as close as possible | |
582 | to wxHtmlWindow. | |
583 | @li <b>Tooltip control.</b> PocketPC uses special TTBUTTON and TTSTATIC controls for adding | |
584 | tooltips, with the tooltip separated from the label with a double tilde. We need to support | |
585 | this using SetToolTip.(Unfortunately it does not seem possible to dynamically remove the tooltip, | |
586 | so an extra style may be required.) | |
587 | @li <b>Focus.</b> In the wxPropertySheetDialog demo on Smartphone, it's not possible to navigate | |
588 | between controls. The focus handling in wxWidgets needs investigation. See in particular | |
589 | src/common/containr.cpp, and note that the default OnActivate handler in src/msw/toplevel.cpp | |
590 | sets the focus to the first child of the dialog. | |
591 | @li <b>OK button.</b> We should allow the OK button on a dialog to be optional, perhaps | |
3ed3a1c8 | 592 | by using @c wxCLOSE_BOX to indicate when the OK button should be displayed. |
928f1a07 FM |
593 | @li <b>Dynamic adaptation.</b> We should probably be using run-time tests more |
594 | than preprocessor tests, so that the same WinCE application can run on different | |
595 | versions of the operating system. | |
596 | @li <b>Modeless dialogs.</b> When a modeless dialog is hidden with the OK button, it doesn't restore the | |
597 | frame's menubar. See for example the find dialog in the dialogs sample. However, the menubar is restored | |
598 | if pressing Cancel (the window is closed). This reflects the fact that modeless dialogs are | |
599 | not very useful on Windows CE; however, we could perhaps destroy/restore a modeless dialog's menubar | |
600 | on deactivation and activation. | |
601 | @li <b>Home screen plugins.</b> Figure out how to make home screen plugins for use with wxWidgets | |
602 | applications (see http://www.codeproject.com/ce/CTodayWindow.asp for inspiration). | |
603 | Although we can't use wxWidgets to create the plugin (too large), we could perhaps write | |
604 | a generic plugin that takes registry information from a given application, with | |
605 | options to display information in a particular way using icons and text from | |
606 | a specified location. | |
607 | @li <b>Further abstraction.</b> We should be able to abstract away more of the differences | |
608 | between desktop and mobile applications, in particular for sizer layout. | |
609 | @li <b>Dialog captions.</b> The blue, bold captions on dialogs - with optional help button - | |
610 | should be catered for, either by hard-wiring the capability into all dialogs and panels, | |
611 | or by providing a standard component and sizer. | |
612 | ||
613 | ||
e7054054 BP |
614 | |
615 | @section page_port_nativedocs Native Toolkit Documentation | |
928f1a07 FM |
616 | |
617 | It's sometimes useful to interface directly with the underlying toolkit | |
618 | used by wxWidgets to e.g. use toolkit-specific features. | |
619 | In such case (or when you want to e.g. write a port-specific patch) it can be | |
620 | necessary to use the underlying toolkit API directly: | |
621 | ||
bce3699f FM |
622 | - wxMSW port uses win32 API: see MSDN docs at http://msdn2.microsoft.com/en-us/library/ms649779.aspx |
623 | - wxGTK port uses GTK+ and other lower-level libraries; see | |
624 | - GTK+ docs at http://library.gnome.org/devel/gtk/unstable/ | |
625 | - GDK docs at http://library.gnome.org/devel/gdk/unstable/ | |
626 | - GLib docs at http://library.gnome.org/devel/glib/unstable/ | |
627 | - GObject docs at http://library.gnome.org/devel/gobject/unstable/ | |
628 | - Pango docs at http://library.gnome.org/devel/pango/unstable/ | |
629 | - wxMac port uses the Carbon API: see Carbon docs at http://developer.apple.com/carbon | |
630 | - wxCocoa port uses the Cocoa API: see Cocoa docs at http://developer.apple.com/cocoa | |
4514447c FM |
631 | |
632 | */ |