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