X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/960b193e59a7700570cfcae914ef2f698e6ba3b8..be698f50301674b969cacecc683ffac5ba6e2e16:/src/msw/menu.cpp diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 385c7fb320..a2162b9064 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -676,14 +676,15 @@ void wxMenuBar::Init() { m_eventHandler = this; m_hMenu = 0; -#if wxUSE_TOOLBAR && defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if wxUSE_TOOLBAR && defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) m_toolBar = NULL; #endif // Not using a combined wxToolBar/wxMenuBar? then use // a commandbar in WinCE .NET just to implement the // menubar. -#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) m_commandBar = NULL; + m_adornmentsAdded = false; #endif } @@ -716,7 +717,7 @@ wxMenuBar::~wxMenuBar() { // In Windows CE (not .NET), the menubar is always associated // with a toolbar, which destroys the menu implicitly. -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if (GetToolBar()) GetToolBar()->SetMenuBar(NULL); #else @@ -724,7 +725,7 @@ wxMenuBar::~wxMenuBar() // which happens if we're attached to a frame if (m_hMenu && !IsAttached()) { -#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) ::DestroyWindow((HWND) m_commandBar); m_commandBar = (WXHWND) NULL; #else @@ -743,12 +744,12 @@ void wxMenuBar::Refresh() { wxCHECK_RET( IsAttached(), wxT("can't refresh unattached menubar") ); -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if (GetToolBar()) { CommandBar_DrawMenuBar((HWND) GetToolBar()->GetHWND(), 0); } -#elif defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)) +#elif defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) if (m_commandBar) DrawMenuBar((HWND) m_commandBar); #else @@ -762,7 +763,7 @@ WXHMENU wxMenuBar::Create() // since you have to use resources. // We'll have to find another way to add a menu // by changing/adding menu items to an existing menu. -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if ( m_hMenu != 0 ) return m_hMenu; @@ -998,7 +999,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) if ( IsAttached() ) { -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if (!GetToolBar()) return FALSE; TBBUTTON tbButton; @@ -1052,7 +1053,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title) if ( IsAttached() ) { -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if (!GetToolBar()) return FALSE; TBBUTTON tbButton; @@ -1103,7 +1104,7 @@ wxMenu *wxMenuBar::Remove(size_t pos) if ( IsAttached() ) { -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if (GetToolBar()) { if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_DELETEBUTTON, (UINT) pos, (LPARAM) 0)) @@ -1173,7 +1174,7 @@ void wxMenuBar::Attach(wxFrame *frame) #if defined(__WXWINCE__) if (!m_hMenu) this->Create(); -#if _WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#if _WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__) // No idea why this was here, but it seems to be obsolete. // Remove after testing with other WinCE combinations - April 2004 @@ -1210,6 +1211,23 @@ void wxMenuBar::Attach(wxFrame *frame) #endif // wxUSE_ACCEL } +#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) +bool wxMenuBar::AddAdornments(long style) +{ + if (m_adornmentsAdded || !m_commandBar) + return false; + + if (style & wxCLOSE_BOX) + { + if (!CommandBar_AddAdornments((HWND) m_commandBar, 0, 0)) + wxLogLastError(wxT("CommandBar_AddAdornments")); + else + return true; + } + return false; +} +#endif + void wxMenuBar::Detach() { wxMenuBarBase::Detach();