use a macro such as this:
\begin{verbatim}
-#if defined(__WXWINCE__
+#if defined(__WXWINCE__)
#define wxLARGESMALL(large,small) small
#else
#define wxLARGESMALL(large,small) large
for a qualitative assessment of what kind of display is available,
or use wxGetDisplaySize() if you need more information.
+You can also use wxGetOsVersion to test for a version of Windows CE at
+run-time (see the next section). However, because different builds
+are currently required to target different kinds of device, these
+values are hard-wired according to the build, and you cannot
+dynamically adapt the same executable for different major Windows CE
+platforms. This would require a different approach to the way
+wxWidgets adapts its behaviour (such as for menubars) to suit the
+style of device.
+
See the "Life!" example (demos/life) for an example of
-an application that has been tailored for Windows CE use.
+an application that has been tailored for PocketPC and Smartphone use.
\subsubsection{Testing for WinCE SDKs}
\twocolitem{\_\_WINCE\_NET\_\_}{Microsoft-powered Windows CE .NET devices (\_WIN32\_WCE is 400 or greater)}
\end{twocollist}
+wxGetOsVersion will return these values:
+
+\begin{twocollist}\itemsep=0pt
+\twocolitem{wxWINDOWS\_POCKETPC}{The application is running under PocketPC.}
+\twocolitem{wxWINDOWS\_SMARTPHONE}{The application is running under Smartphone.}
+\twocolitem{wxWINDOWS\_CE}{The application is running under Windows CE (built with the Standard SDK).}
+\end{twocollist}
+
\subsubsection{Window sizing in wxWinCE}
When creating frames and dialogs, create them with wxDefaultPosition and
However, if the input panel (SIP) is shown, windows do not yet resize accordingly. This will
be implemented soon.
+\subsubsection{Closing top-level windows in wxWinCE}
+
+You won't get a wxCloseEvent when the user clicks on the X in the titlebar
+on Smartphone and PocketPC; the window is simply hidden instead. However the system may send the
+event to force the application to close down.
+
+\subsubsection{Hibernation in wxWinCE}
+
+Smartphone and PocketPC will send a wxEVT\_HIBERNATE to the application object in low
+memory conditions. Your application should release memory and close dialogs,
+and wake up again when the next wxEVT\_ACTIVATE or wxEVT\_ACTIVATE\_APP message is received.
+(wxEVT\_ACTIVATE\_APP is generated whenever a wxEVT\_ACTIVATE event is received
+in Smartphone and PocketPC, since these platforms do not support WM\_ACTIVATEAPP.)
+
+\subsubsection{Hardware buttons in wxWinCE}
+
+Special hardware buttons are sent to a window via the wxEVT\_HOTKEY event
+under Smartphone and PocketPC. You should first register each required button with \helpref{wxWindow::RegisterHotKey}{wxwindowregisterhotkey},
+and unregister the button when you're done with it. For example:
+
+\begin{verbatim}
+ win->RegisterHotKey(0, wxMOD_WIN, WXK_SPECIAL1);
+ win->UnregisterHotKey(0);
+\end{verbatim}
+
+You may have to register the buttons in a wxEVT_ACTIVATE event handler
+since other applications will grab the buttons.
+
+There is currently no method of finding out the names of the special
+buttons or how many there are.
+
\subsubsection{Dialogs in wxWinCE}
PocketPC dialogs have an OK button on the caption, and so you should generally
Notifications (bubble HTML text with optional buttons and links) will also be
implemented in the future for PocketPC.
-\subsubsection{Menubars and toolbars in wxWinCE}
+Modeless dialogs probably don't make sense for PocketPC and Smartphone, since
+frames and dialogs are normally full-screen, and a modeless dialog is normally
+intended to co-exist with the main application frame.
-Menubars and toolbars can only be implemented using a combined control,
-but you can use the same syntax as before; wxWidgets will combine the menubar
-and toolbar. However, you cannot at present use arbitrary toolbar bitmaps
-(since they have to be loaded from a Windows resource), so only standard
-identifiers will work (wxID\_OPEN, wxID\_SAVE, wxID\_COPY and so on).
+\subsubsection{Menubars and toolbars in wxWinCE}
-The wxWidgets API doesn't currently provide us with a method of passing resource
-identifiers to AddTool, which is something that needs to be addressed.
+\wxheading{Menubars and toolbars in PocketPC}
On PocketPC, a frame must always have a menubar, even if it's empty.
+An empty menubar is automatically provided for dialogs, to hide
+any existing menubar for the duration of the dialog.
+
+Menubars and toolbars are implemented using a combined control,
+but you can use essentially the usual wxWidgets API; wxWidgets will combine the menubar
+and toolbar. However, there are some restrictions:
+
+\itemsep=0pt
+\begin{itemize}
+\item You must create the frame's primary toolbar with wxFrame::CreateToolBar,
+because this uses the special wxToolMenuBar class (derived from wxToolBar)
+to implement the combined toolbar and menubar. Otherwise, you can create and manage toolbars
+using the wxToolBar class as usual, for example to implement an optional
+formatting toolbar above the menubar as Pocket Word does. But don't assign
+a wxToolBar to a frame using SetToolBar - you should always use CreateToolBar
+for the main frame toolbar.
+\item Deleting and adding tools to wxToolMenuBar is not supported.
+\end{itemize}
+
+\wxheading{Menubars and toolbars in Smartphone}
On Smartphone, there are only two menu buttons, so a menubar is simulated
-using a nested menu on the right menu button.
+using a nested menu on the right menu button. Any toolbars are simply ignored on
+Smartphone.
\subsubsection{Closing windows in wxWinCE}
\subsubsection{Control differences on wxWinCE}
-This section is to be written.
+These controls are missing from wxWinCE:
+
+\itemsep=0pt
+\begin{itemize}
+\item {\bf wxCheckListBox} This can be implemented using a wxListCtrl in report mode
+with checked/unchecked images.
+\end{itemize}
-Can someone remind us why wxChoice was rewritten for Smartphone?
+This section is currently incomplete.
\subsubsection{Online help in wxWinCE}
\itemsep=0pt
\begin{itemize}
-\item {\bf Custom toolbar buttons.} The bitmaps could be loaded from a resource
-named using the string normally used for a tool caption. Currently only buttons with
-standard identifiers can be used.
\item {\bf Font dialog.} The generic font dialog is currently used, which
needs to be simplified (and speeded up).
\item {\bf Sizer speed.} Particularly for dialogs containing notebooks,
layout seems slow. Some analysis is required.
\item {\bf Notification boxes.} The balloon-like notification messages, and their
icons, should be implemented. This will be quite straightforward.
-\item {\bf WM\_SETTINGCHANGE.} This message needs to be handled by calling SHHandleWMSettingChange.
-\item {\bf WM\_ACTIVATE.} This message needs to be handled by calling SHHandleWMActivate.
-\item {\bf WM\_HIBERNATE.} We need to handle this message.
\item {\bf SIP size.} We need to be able to get the area taken up by the SIP (input panel),
and the remaining area, by calling SHSipInfo. We also may need to be able to show and hide
the SIP programmatically, with SHSipPreference. See also the {\it Input Dialogs} topic in
Win32.
\item {\bf wxStaticBitmap.} The About box in the "Life!" demo shows a bitmap that is
the correct size on the emulator, but too small on a VGA Pocket Loox device.
+\item {\bf wxStaticLine.} Lines don't show up, and the documentation suggests that
+missing styles are implemented with WM\_PAINT.
+\item {\bf wxCheckListBox.} This class needs to be implemented in terms of a wxListCtrl
+in report mode, using icons for checkbox states. This is necessary because owner-draw listboxes
+are not supported on Windows CE.
\item {\bf OK button.} We should allow the OK button on a dialog to be optional, perhaps
by using wxCLOSE\_BOX to indicate when the OK button should be displayed.
-\item {\bf Data storage.} Methods for saving data on Smartphone need to be supported and documented.
\item {\bf Dynamic adaptation.} We should probably be using run-time tests more
than preprocessor tests, so that the same WinCE application can run on different
versions of the operating system.