- Sends wxEVT_HIBERNATE event.
- Now fakes wxEVT_ACTIVATE_APP to be symmetrical with wxEVT_HIBERNATE.
- Added wxTE_CAPITALIZE for CAPEDIT controls.
+- wxDialog::GetToolBar can be used if you need to add buttons
+ to the dialog's toolbar.
2.5.4
-----
Returns the title of the dialog box.
+\membersection{wxDialog::GetToolBar}\label{wxdialoggettoolbar}
+
+\constfunc{wxToolBar*}{GetToolBar}{\void}
+
+On PocketPC, a dialog is automatically provided with an empty toolbar. GetToolBar
+allows you to access the toolbar and add tools to it. Removing tools and adding
+arbitrary controls are not currently supported.
+
+This function is not available on any other platform.
+
\membersection{wxDialog::Iconize}\label{wxdialogiconized}
\func{void}{Iconize}{\param{const bool}{ iconize}}
\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
+An empty menubar/toolbar 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,
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.
+\item For speed, colours are not remapped to the system colours as they are
+in wxMSW. Provide the tool bitmaps either with the correct system button background,
+or with transparency (for example, using XPMs).
\end{itemize}
+Unlike in all other ports, a wxDialog has a wxToolBar, automatically created
+for you. You may either leave it blank, or access it with wxDialog::GetToolBar
+and add buttons, then calling wxToolBar::Realize. You cannot set or recreate
+the toolbar.
+
\wxheading{Menubars and toolbars in Smartphone}
On Smartphone, there are only two menu buttons, so a menubar is simulated
You can use the help controller wxWinceHelpController which controls
simple {\tt .htm} files, usually installed in the Windows directory.
+See the Windows CE reference for how to format the HTML files.
+
+\subsubsection{Installing your PocketPC and Smartphone applications}
+
+To install your application, you need to build a CAB file using
+the parameters defined in a special .inf file. The CabWiz program
+in your SDK will compile the CAB file from the .inf file and
+files that it specifies.
+
+For delivery, you can simply ask the user to copy the CAB file to the
+device and execute the CAB file using File Explorer. Or, you can
+write a program for the desktop PC that will find the ActiveSync
+Application Manager and install the CAB file on the device,
+which is obviously much easier for the user.
+
+Here are some links that may help.
+
+\itemsep=0pt
+\begin{itemize}
+\item A setup builder that takes CABs and builds a setup program is at \urlref{http://www.eskimo.com/~scottlu/win/index.html}{http://www.eskimo.com/~scottlu/win/index.html}.
+\item Sample installation files can be found in {\tt Windows CE Tools/wce420/POCKET PC 2003/Samples/Win32/AppInst}.
+\item An installer generator using wxPython can be found at \urlref{http://ppcquicksoft.iespana.es/ppcquicksoft/myinstall.html}{http://ppcquicksoft.iespana.es/ppcquicksoft/myinstall.html}.
+\item Miscellaneous Windows CE resources can be found at \urlref{http://www.orbworks.com/pcce/resources.html}{http://www.orbworks.com/pcce/resources.html}.
+\item Installer creation instructions with a setup.exe for installing to PPC can be found at \urlref{http://www.pocketpcdn.com/articles/creatingsetup.html}{http://www.pocketpcdn.com/articles/creatingsetup.html}.
+\item Microsoft instructions are at \urlref{http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnce30/html/appinstall30.asp?frame=true&hidetoc=true}{http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnce30/html/appinstall30.asp?frame=true&hidetoc=true}.
+\end{itemize}
\subsubsection{Remaining issues}
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
the {\it Programming Windows CE} guide for more on this, and how to have dialogs
-show the SIP automatically using the WC_SIPREF control.
+show the SIP automatically using the WC\_SIPREF control.
\item {\bf Drawing.} The "Life!" demo shows some droppings being left on the window,
indicating that drawing works a bit differently between desktop and mobile versions of
Win32.
class WXDLLEXPORT wxDialogModalData;
+#if wxUSE_TOOLBAR && (defined(__SMARTPHONE__) || defined(__POCKETPC__))
+class WXDLLEXPORT wxToolBar;
+#endif
+
// Dialog boxes
class WXDLLEXPORT wxDialog : public wxDialogBase
{
// may be called to terminate the dialog with the given return code
virtual void EndModal(int retCode);
+#if wxUSE_TOOLBAR && defined(__POCKETPC__)
+ // create main toolbar by calling OnCreateToolBar()
+ virtual wxToolBar* CreateToolBar(long style = -1,
+ wxWindowID winid = wxID_ANY,
+ const wxString& name = wxToolBarNameStr);
+ // return a new toolbar
+ virtual wxToolBar *OnCreateToolBar(long style,
+ wxWindowID winid,
+ const wxString& name );
+
+ // get the main toolbar
+ wxToolBar *GetToolBar() const { return m_dialogToolBar; }
+#endif
+
// implementation only from now on
// -------------------------------
wxWindow* m_oldFocus;
bool m_endModalCalled; // allow for closing within InitDialog
+#if wxUSE_TOOLBAR && defined(__POCKETPC__)
+ wxToolBar* m_dialogToolBar;
+#endif
+
// this pointer is non-NULL only while the modal event loop is running
wxDialogModalData *m_modalData;
-
DECLARE_DYNAMIC_CLASS(wxDialog)
DECLARE_EVENT_TABLE()
DECLARE_NO_COPY_CLASS(wxDialog)
void ReloadAllButtons();
#endif // __SMARTPHONE__ && __WXWINCE__
- // Empty menubar for dialogs
-#ifdef __POCKETPC__
- WXHWND m_menuBarHWND;
-#endif
-
DECLARE_EVENT_TABLE()
DECLARE_NO_COPY_CLASS(wxTopLevelWindowMSW)
};
#include "wx/msw/wince/resources.h"
#endif // __SMARTPHONE__ && __WXWINCE__
+#if wxUSE_TOOLBAR && defined(__POCKETPC__)
+#include "wx/toolbar.h"
+#endif
+
// ----------------------------------------------------------------------------
// wxWin macros
// ----------------------------------------------------------------------------
m_isShown = false;
m_modalData = NULL;
m_endModalCalled = false;
+#if wxUSE_TOOLBAR && defined(__POCKETPC__)
+ m_dialogToolBar = NULL;
+#endif
}
bool wxDialog::Create(wxWindow *parent,
#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
SetLeftMenu(wxID_OK, _("OK"));
#endif
+#if wxUSE_TOOLBAR && defined(__POCKETPC__)
+ CreateToolBar();
+#endif
return true;
}
}
#endif
+#if wxUSE_TOOLBAR && defined(__POCKETPC__)
+// create main toolbar by calling OnCreateToolBar()
+wxToolBar* wxDialog::CreateToolBar(long style, wxWindowID winid, const wxString& name)
+{
+ m_dialogToolBar = OnCreateToolBar(style, winid, name);
+
+ return m_dialogToolBar;
+}
+
+// return a new toolbar
+wxToolBar *wxDialog::OnCreateToolBar(long style,
+ wxWindowID winid,
+ const wxString& name)
+{
+ return new wxToolMenuBar(this, winid,
+ wxDefaultPosition, wxDefaultSize,
+ style, name);
+}
+#endif
// ---------------------------------------------------------------------------
// dialog window proc
#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
m_MenuBarHWND = 0;
#endif
-#ifdef __POCKETPC__
- // A dummy menubar for dialogs
- m_menuBarHWND = 0;
-#endif
}
WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const
::SetWindowText(GetHwnd(), title);
}
-#ifdef __POCKETPC__
- // Create an empty menubar so that we don't see the menubar underneath
- SHMENUBARINFO mbi;
-
- memset (&mbi, 0, sizeof (SHMENUBARINFO));
- mbi.cbSize = sizeof (SHMENUBARINFO);
- mbi.hwndParent = (HWND) GetParent()->GetHWND();
- mbi.nToolBarId = 5000;
- mbi.nBmpId = 0;
- mbi.cBmpImages = 0;
- mbi.dwFlags = 0 ; // SHCMBF_EMPTYBAR;
- mbi.hInstRes = wxGetInstance();
-
- if (!SHCreateMenuBar(&mbi))
- {
- wxFAIL_MSG( _T("SHCreateMenuBar failed") );
- }
-
- m_menuBarHWND = (WXHWND) mbi.hwndMB;
-#endif
-
SubclassWin(m_hWnd);
#ifdef __SMARTPHONE__
wxTopLevelWindowMSW::~wxTopLevelWindowMSW()
{
-#ifdef __POCKETPC__
- // Destroy the dummy menubar for dialogs
- if (m_menuBarHWND)
- {
- ::DestroyWindow((HWND) m_menuBarHWND);
- m_menuBarHWND = 0;
- }
-#endif
-
// after destroying an owned window, Windows activates the next top level
// window in Z order but it may be different from our owner (to reproduce
// this simply Alt-TAB to another application and back before closing the
wxBitmap bmpToUse = bmp;
- if (bmp.GetWidth() < 16 || bmp.GetHeight() < 16)
+ if (bmp.GetWidth() < 16 || bmp.GetHeight() < 16 || bmp.GetMask() != NULL)
{
wxMemoryDC memDC;
wxBitmap b(16,16);