X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..5c45e86bac1d3f0b08a452f6436481824f79fe5a:/src/msw/wince/tbarwce.cpp diff --git a/src/msw/wince/tbarwce.cpp b/src/msw/wince/tbarwce.cpp index 22cd6ffe97..f5b7b164ef 100644 --- a/src/msw/wince/tbarwce.cpp +++ b/src/msw/wince/tbarwce.cpp @@ -39,7 +39,9 @@ #include "wx/control.h" #endif -#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE +// Use the WinCE-specific toolbar only if we're either compiling +// with a WinCE earlier than 4, or we wish to emulate a PocketPC-style UI +#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE && (_WIN32_WCE < 400 || wxUSE_POCKETPC_UI) #include "wx/toolbar.h" @@ -52,8 +54,12 @@ #include #include #include +#include #include -#include +#if _WIN32_WCE < 400 + #include +#endif +#include "wx/msw/wince/missing.h" #include "wx/msw/winundef.h" @@ -121,7 +127,7 @@ // wxWin macros // ---------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxToolBarBase) +IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl) BEGIN_EVENT_TABLE(wxToolBar, wxToolBarBase) EVT_MOUSE_EVENTS(wxToolBar::OnMouseEvent) @@ -255,6 +261,10 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuB if (m_menuBar) m_menuBar->SetToolBar(this); +#if _WIN32_WCE >= 400 + HWND hWnd = CommandBar_Create(wxGetInstance(), (HWND) GetParent()->GetHWND(), GetId()); + SetHWND((WXHWND) hWnd); +#else // Create the menubar. SHMENUBARINFO mbi; @@ -278,12 +288,8 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuB } SetHWND((WXHWND) mbi.hwndMB); -/* - if (!::SendMessage((HWND) GetHWND(), TB_DELETEBUTTON, 0, (LPARAM) 0)) - { - wxLogLastError(wxT("TB_DELETEBUTTON")); - } -*/ +#endif + // install wxWindows window proc for this window SubclassWin(m_hWnd);