// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWidgets licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ===========================================================================
{
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
}
{
// 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
// 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
{
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
// 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;
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;
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;
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))
#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
#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();