]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxDialog::GetToolBar for PocketPC
authorJulian Smart <julian@anthemion.co.uk>
Sat, 19 Mar 2005 12:06:56 +0000 (12:06 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sat, 19 Mar 2005 12:06:56 +0000 (12:06 +0000)
Added note about creating installers for PPC

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32908 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
docs/latex/wx/dialog.tex
docs/latex/wx/wxmsw.tex
include/wx/msw/dialog.h
include/wx/msw/toplevel.h
src/msw/dialog.cpp
src/msw/toplevel.cpp
src/msw/wince/tbarwce.cpp

index 0f6ce4a398894a0236a6836ac8ee5723c90144e4..5a64ce5bcd5853f45f4ceb8a2906f3509d71a810 100644 (file)
@@ -61,6 +61,8 @@ wxWinCE:
 - 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
 -----
index 37da8f71123a0e61c4b82b545e50c634bf5eb4c8..2fb1789b7812e0a0df3166142ad640586ddd9262 100644 (file)
@@ -242,6 +242,16 @@ a code to the application.
 
 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}}
index 4f22b9b3aebe143ab65152544ad4cbcb25ce6d1e..d936a5733e5a1cd8fc5dace0b32a20858666704c 100644 (file)
@@ -176,7 +176,7 @@ intended to co-exist with the main application frame.
 \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,
@@ -193,8 +193,16 @@ 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.
+\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
@@ -227,6 +235,32 @@ This section is currently incomplete.
 
 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}
 
@@ -245,7 +279,7 @@ icons, should be implemented. This will be quite straightforward.
 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.
index f89e7ef11a3b7ca800cef9815459bae73d13ce0d..319cd2bcc4626529c0d2a7eabdfd1dcde459a50e 100644 (file)
@@ -22,6 +22,10 @@ extern WXDLLEXPORT_DATA(const wxChar*) wxDialogNameStr;
 
 class WXDLLEXPORT wxDialogModalData;
 
+#if wxUSE_TOOLBAR && (defined(__SMARTPHONE__) || defined(__POCKETPC__))
+class WXDLLEXPORT wxToolBar;
+#endif
+
 // Dialog boxes
 class WXDLLEXPORT wxDialog : public wxDialogBase
 {
@@ -59,6 +63,20 @@ public:
     // 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
     // -------------------------------
 
@@ -123,10 +141,13 @@ private:
     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)
index 377a446cce4cc9f77e16e7402ccd8d7db98e1a3d..2033fb0d4e4b8b55116791d6c6195ea8992ff741 100644 (file)
@@ -165,11 +165,6 @@ protected:
     void ReloadAllButtons();
 #endif // __SMARTPHONE__ && __WXWINCE__
 
-    // Empty menubar for dialogs
-#ifdef __POCKETPC__
-    WXHWND                   m_menuBarHWND;
-#endif
-
     DECLARE_EVENT_TABLE()
     DECLARE_NO_COPY_CLASS(wxTopLevelWindowMSW)
 };
index a42c6494aac1390c501118ca8f6da1807d1ab5d8..33f2cbf86f4abd4499a8a0c085ef75dca99db29c 100644 (file)
     #include "wx/msw/wince/resources.h"
 #endif // __SMARTPHONE__ && __WXWINCE__
 
+#if wxUSE_TOOLBAR && defined(__POCKETPC__)
+#include "wx/toolbar.h"
+#endif
+
 // ----------------------------------------------------------------------------
 // wxWin macros
 // ----------------------------------------------------------------------------
@@ -160,6 +164,9 @@ void wxDialog::Init()
     m_isShown = false;
     m_modalData = NULL;
     m_endModalCalled = false;
+#if wxUSE_TOOLBAR && defined(__POCKETPC__)
+    m_dialogToolBar = NULL;
+#endif
 }
 
 bool wxDialog::Create(wxWindow *parent,
@@ -187,6 +194,9 @@ bool wxDialog::Create(wxWindow *parent,
 #if defined(__SMARTPHONE__) && defined(__WXWINCE__)
     SetLeftMenu(wxID_OK, _("OK"));
 #endif
+#if wxUSE_TOOLBAR && defined(__POCKETPC__)
+    CreateToolBar();
+#endif
 
     return true;
 }
@@ -457,6 +467,25 @@ bool wxDialog::DoOK()
 }
 #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
index 09e60871b188c478e10252f4b87d6a0107570da1..f5ae3f72e864bd285939af67a62433d317e6ed22 100644 (file)
@@ -148,10 +148,6 @@ void wxTopLevelWindowMSW::Init()
 #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
@@ -419,27 +415,6 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
         ::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__
@@ -588,15 +563,6 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent,
 
 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
index c2d6df75b04fbfaec57dfc11f5c22c94dde628c0..33f429e3066015ca5a2bddf156e4a4d451d16d41 100644 (file)
@@ -414,7 +414,7 @@ bool wxToolMenuBar::Realize()
 
                 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);