X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d7da7f13eb27c6416b13aab8af4a7431a9ed1d67..6726a6b09748c707351987da56226ac0316d1a00:/src/msw/wince/tbarwce.cpp diff --git a/src/msw/wince/tbarwce.cpp b/src/msw/wince/tbarwce.cpp index fe77c87875..4cb447f393 100644 --- a/src/msw/wince/tbarwce.cpp +++ b/src/msw/wince/tbarwce.cpp @@ -41,7 +41,7 @@ // 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 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) #include "wx/toolbar.h" @@ -56,7 +56,7 @@ #include #include #include -#if _WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#if defined(WINCE_WITHOUT_COMMANDBAR) #include #endif #include "wx/msw/wince/missing.h" @@ -226,11 +226,11 @@ bool wxToolBar::Create(wxWindow *parent, { // common initialisation if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) - return FALSE; + return false; // MSW-specific initialisation if ( !MSWCreateToolbar(pos, size, menuBar) ) - return FALSE; + return false; // set up the colors and fonts SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR)); @@ -243,13 +243,13 @@ bool wxToolBar::Create(wxWindow *parent, #define TBSTYLE_NO_DROPDOWN_ARROW 0x0080 #endif -bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuBar* menuBar) +bool wxToolBar::MSWCreateToolbar(const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size), wxMenuBar* menuBar) { SetMenuBar(menuBar); if (m_menuBar) m_menuBar->SetToolBar(this); -#if _WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#if defined(WINCE_WITHOUT_COMMANDBAR) // Create the menubar. SHMENUBARINFO mbi; @@ -269,7 +269,7 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuB if (!SHCreateMenuBar(&mbi)) { wxFAIL_MSG( _T("SHCreateMenuBar failed") ); - return FALSE; + return false; } SetHWND((WXHWND) mbi.hwndMB); @@ -278,7 +278,7 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuB SetHWND((WXHWND) hWnd); #endif - // install wxWindows window proc for this window + // install wxWidgets window proc for this window SubclassWin(m_hWnd); if (menuBar) @@ -368,12 +368,17 @@ wxSize wxToolBar::DoGetBestSize() const // Return HMENU for the menu associated with the commandbar WXHMENU wxToolBar::GetHMenu() { +#if defined(__HANDHELDPC__) + // TODO ??? + return 0; +#else if (GetHWND()) { return (WXHMENU) (HMENU)::SendMessage((HWND) GetHWND(), SHCMBM_GETMENU, (WPARAM)0, (LPARAM)0); } else return 0; +#endif } @@ -489,7 +494,7 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool) { wxLogLastError(wxT("TB_DELETEBUTTON")); - return FALSE; + return false; } } @@ -570,8 +575,6 @@ bool wxToolBar::Realize() return TRUE; } - const bool isVertical = HasFlag(wxTB_VERTICAL); - #if 0 // delete all old buttons, if any for ( size_t pos = 0; pos < m_nButtons; pos++ ) @@ -581,7 +584,7 @@ bool wxToolBar::Realize() wxLogDebug(wxT("TB_DELETEBUTTON failed")); } } -#endif +#endif // 0 // add the buttons and separators // ------------------------------ @@ -595,7 +598,7 @@ bool wxToolBar::Realize() // this array will hold the indices of all controls in the toolbar wxArrayInt controlIds; - bool lastWasRadio = FALSE; + bool lastWasRadio = false; int i = 0; wxToolBarToolsList::Node* node; for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) @@ -608,7 +611,7 @@ bool wxToolBar::Realize() wxZeroMemory(button); - bool isRadio = FALSE; + bool isRadio = false; switch ( tool->GetStyle() ) { case wxTOOL_STYLE_CONTROL: @@ -641,7 +644,7 @@ bool wxToolBar::Realize() button.iBitmap = winceId; } else - processedThis = FALSE; + processedThis = false; if ( tool->IsEnabled() ) button.fsState |= TBSTATE_ENABLED; @@ -697,6 +700,9 @@ bool wxToolBar::Realize() delete [] buttons; #if 0 + + const bool isVertical = HasFlag(wxTB_VERTICAL); + // Deal with the controls finally // ------------------------------ @@ -841,9 +847,9 @@ bool wxToolBar::Realize() SetRows(m_nButtons); } } -#endif +#endif // 0 - return TRUE; + return true; } // ---------------------------------------------------------------------------- @@ -913,11 +919,12 @@ bool wxToolBar::MSWOnNotify(int WXUNUSED(idCtrl), wxToolBarToolBase *tool = FindById(id); if ( !tool ) - return FALSE; + return false; return HandleTooltipNotify(code, lParam, tool->GetShortHelp()); #else - return FALSE; + wxUnusedVar(lParam); + return false; #endif } @@ -1128,7 +1135,7 @@ void wxToolBar::OnMouseEvent(wxMouseEvent& event) } } -void wxToolBar::HandleMouseMove(WXWPARAM wParam, WXLPARAM lParam) +void wxToolBar::HandleMouseMove(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam) { wxCoord x = GET_X_LPARAM(lParam), y = GET_Y_LPARAM(lParam);