Applied new master define for CommandBar vs. PocketPC mixed bar.
This also works now under Handheld PC 2000. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -318,7 +318,7 @@ void wxFrame::PositionStatusBar()
|
|||||||
|
|
||||||
void wxFrame::AttachMenuBar(wxMenuBar *menubar)
|
void wxFrame::AttachMenuBar(wxMenuBar *menubar)
|
||||||
{
|
{
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||||
if (!GetToolBar())
|
if (!GetToolBar())
|
||||||
{
|
{
|
||||||
wxToolBar* toolBar = new wxToolBar(this, -1,
|
wxToolBar* toolBar = new wxToolBar(this, -1,
|
||||||
@@ -354,7 +354,7 @@ void wxFrame::AttachMenuBar(wxMenuBar *menubar)
|
|||||||
}
|
}
|
||||||
else // set new non NULL menu bar
|
else // set new non NULL menu bar
|
||||||
{
|
{
|
||||||
#if !defined(__WXWINCE__) || (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
|
#if !defined(__WXWINCE__) || defined(WINCE_WITH_COMMANDBAR)
|
||||||
// Can set a menubar several times.
|
// Can set a menubar several times.
|
||||||
if ( menubar->GetHMenu() )
|
if ( menubar->GetHMenu() )
|
||||||
{
|
{
|
||||||
@@ -417,7 +417,8 @@ bool wxFrame::ShowFullScreen(bool show, long style)
|
|||||||
if (show)
|
if (show)
|
||||||
{
|
{
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
|
||||||
|
#if defined(WINCE_WITH_COMMANDBAR)
|
||||||
// TODO: hide commandbar
|
// TODO: hide commandbar
|
||||||
#else
|
#else
|
||||||
wxToolBar *theToolBar = GetToolBar();
|
wxToolBar *theToolBar = GetToolBar();
|
||||||
@@ -462,7 +463,7 @@ bool wxFrame::ShowFullScreen(bool show, long style)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||||
// TODO: show commandbar
|
// TODO: show commandbar
|
||||||
#else
|
#else
|
||||||
wxToolBar *theToolBar = GetToolBar();
|
wxToolBar *theToolBar = GetToolBar();
|
||||||
@@ -508,7 +509,7 @@ bool wxFrame::ShowFullScreen(bool show, long style)
|
|||||||
|
|
||||||
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
|
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
|
||||||
{
|
{
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||||
// We may already have a toolbar from calling SetMenuBar.
|
// We may already have a toolbar from calling SetMenuBar.
|
||||||
if (GetToolBar())
|
if (GetToolBar())
|
||||||
return GetToolBar();
|
return GetToolBar();
|
||||||
@@ -526,7 +527,7 @@ void wxFrame::PositionToolBar()
|
|||||||
wxToolBar *toolbar = GetToolBar();
|
wxToolBar *toolbar = GetToolBar();
|
||||||
if ( toolbar && toolbar->IsShown() )
|
if ( toolbar && toolbar->IsShown() )
|
||||||
{
|
{
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||||
// We want to do something different in WinCE, because
|
// We want to do something different in WinCE, because
|
||||||
// the toolbar should be associated with the commandbar,
|
// the toolbar should be associated with the commandbar,
|
||||||
// and not an independent window.
|
// and not an independent window.
|
||||||
@@ -547,7 +548,7 @@ void wxFrame::PositionToolBar()
|
|||||||
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
#if defined(__WXWINCE__)
|
#if defined(WINCE_WITH_COMMANDBAR)
|
||||||
// We're using a commandbar - so we have to allow for it.
|
// We're using a commandbar - so we have to allow for it.
|
||||||
if (GetMenuBar() && GetMenuBar()->GetCommandBar())
|
if (GetMenuBar() && GetMenuBar()->GetCommandBar())
|
||||||
{
|
{
|
||||||
@@ -805,7 +806,7 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id)
|
|||||||
PositionToolBar();
|
PositionToolBar();
|
||||||
#endif // wxUSE_TOOLBAR
|
#endif // wxUSE_TOOLBAR
|
||||||
|
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
|
#if defined(WINCE_WITH_COMMANDBAR)
|
||||||
// Position the menu command bar
|
// Position the menu command bar
|
||||||
if (GetMenuBar() && GetMenuBar()->GetCommandBar())
|
if (GetMenuBar() && GetMenuBar()->GetCommandBar())
|
||||||
{
|
{
|
||||||
@@ -1027,7 +1028,7 @@ wxPoint wxFrame::GetClientAreaOrigin() const
|
|||||||
}
|
}
|
||||||
#endif // wxUSE_TOOLBAR
|
#endif // wxUSE_TOOLBAR
|
||||||
|
|
||||||
#if defined(__WXWINCE__) && defined(__WINCE_STANDARDSDK__)
|
#if defined(WINCE_WITH_COMMANDBAR)
|
||||||
if (GetMenuBar() && GetMenuBar()->GetCommandBar())
|
if (GetMenuBar() && GetMenuBar()->GetCommandBar())
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
@@ -676,13 +676,13 @@ void wxMenuBar::Init()
|
|||||||
{
|
{
|
||||||
m_eventHandler = this;
|
m_eventHandler = this;
|
||||||
m_hMenu = 0;
|
m_hMenu = 0;
|
||||||
#if wxUSE_TOOLBAR && defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
#if wxUSE_TOOLBAR && defined(__WXWINCE__)
|
||||||
m_toolBar = NULL;
|
m_toolBar = NULL;
|
||||||
#endif
|
#endif
|
||||||
// Not using a combined wxToolBar/wxMenuBar? then use
|
// Not using a combined wxToolBar/wxMenuBar? then use
|
||||||
// a commandbar in WinCE .NET just to implement the
|
// a commandbar in WinCE .NET just to implement the
|
||||||
// menubar.
|
// menubar.
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
|
#if defined(WINCE_WITH_COMMANDBAR)
|
||||||
m_commandBar = NULL;
|
m_commandBar = NULL;
|
||||||
m_adornmentsAdded = false;
|
m_adornmentsAdded = false;
|
||||||
#endif
|
#endif
|
||||||
@@ -717,7 +717,7 @@ wxMenuBar::~wxMenuBar()
|
|||||||
{
|
{
|
||||||
// In Windows CE (not .NET), the menubar is always associated
|
// In Windows CE (not .NET), the menubar is always associated
|
||||||
// with a toolbar, which destroys the menu implicitly.
|
// with a toolbar, which destroys the menu implicitly.
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||||
if (GetToolBar())
|
if (GetToolBar())
|
||||||
GetToolBar()->SetMenuBar(NULL);
|
GetToolBar()->SetMenuBar(NULL);
|
||||||
#else
|
#else
|
||||||
@@ -725,7 +725,7 @@ wxMenuBar::~wxMenuBar()
|
|||||||
// which happens if we're attached to a frame
|
// which happens if we're attached to a frame
|
||||||
if (m_hMenu && !IsAttached())
|
if (m_hMenu && !IsAttached())
|
||||||
{
|
{
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
|
#if defined(WINCE_WITH_COMMANDBAR)
|
||||||
::DestroyWindow((HWND) m_commandBar);
|
::DestroyWindow((HWND) m_commandBar);
|
||||||
m_commandBar = (WXHWND) NULL;
|
m_commandBar = (WXHWND) NULL;
|
||||||
#else
|
#else
|
||||||
@@ -744,12 +744,12 @@ void wxMenuBar::Refresh()
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( IsAttached(), wxT("can't refresh unattached menubar") );
|
wxCHECK_RET( IsAttached(), wxT("can't refresh unattached menubar") );
|
||||||
|
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
#if defined(WINCE_WITH_COMMANDBAR)
|
||||||
if (GetToolBar())
|
if (GetToolBar())
|
||||||
{
|
{
|
||||||
CommandBar_DrawMenuBar((HWND) GetToolBar()->GetHWND(), 0);
|
CommandBar_DrawMenuBar((HWND) GetToolBar()->GetHWND(), 0);
|
||||||
}
|
}
|
||||||
#elif defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
|
#elif defined(WINCE_WITHOUT_COMMANDBAR)
|
||||||
if (m_commandBar)
|
if (m_commandBar)
|
||||||
DrawMenuBar((HWND) m_commandBar);
|
DrawMenuBar((HWND) m_commandBar);
|
||||||
#else
|
#else
|
||||||
@@ -763,8 +763,7 @@ WXHMENU wxMenuBar::Create()
|
|||||||
// since you have to use resources.
|
// since you have to use resources.
|
||||||
// We'll have to find another way to add a menu
|
// We'll have to find another way to add a menu
|
||||||
// by changing/adding menu items to an existing menu.
|
// by changing/adding menu items to an existing menu.
|
||||||
#if defined(__WXWINCE__) && !defined(__HANDHELDPC__) \
|
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||||
(_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
|
||||||
if ( m_hMenu != 0 )
|
if ( m_hMenu != 0 )
|
||||||
return m_hMenu;
|
return m_hMenu;
|
||||||
|
|
||||||
@@ -1000,7 +999,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
|
|||||||
|
|
||||||
if ( IsAttached() )
|
if ( IsAttached() )
|
||||||
{
|
{
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
#if defined(WINCE_WITHOUT_COMMANDAR)
|
||||||
if (!GetToolBar())
|
if (!GetToolBar())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
TBBUTTON tbButton;
|
TBBUTTON tbButton;
|
||||||
@@ -1054,7 +1053,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
|
|||||||
|
|
||||||
if ( IsAttached() )
|
if ( IsAttached() )
|
||||||
{
|
{
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
#if defined(WINCE_WITHOUT_COMMANDAR)
|
||||||
if (!GetToolBar())
|
if (!GetToolBar())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
TBBUTTON tbButton;
|
TBBUTTON tbButton;
|
||||||
@@ -1105,7 +1104,7 @@ wxMenu *wxMenuBar::Remove(size_t pos)
|
|||||||
|
|
||||||
if ( IsAttached() )
|
if ( IsAttached() )
|
||||||
{
|
{
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
#if defined(WINCE_WITHOUT_COMMANDAR)
|
||||||
if (GetToolBar())
|
if (GetToolBar())
|
||||||
{
|
{
|
||||||
if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_DELETEBUTTON, (UINT) pos, (LPARAM) 0))
|
if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_DELETEBUTTON, (UINT) pos, (LPARAM) 0))
|
||||||
@@ -1175,7 +1174,7 @@ void wxMenuBar::Attach(wxFrame *frame)
|
|||||||
#if defined(__WXWINCE__)
|
#if defined(__WXWINCE__)
|
||||||
if (!m_hMenu)
|
if (!m_hMenu)
|
||||||
this->Create();
|
this->Create();
|
||||||
#if _WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)
|
#if defined(WINCE_WITHOUT_COMMANDAR)
|
||||||
|
|
||||||
// No idea why this was here, but it seems to be obsolete.
|
// No idea why this was here, but it seems to be obsolete.
|
||||||
// Remove after testing with other WinCE combinations - April 2004
|
// Remove after testing with other WinCE combinations - April 2004
|
||||||
@@ -1212,7 +1211,7 @@ void wxMenuBar::Attach(wxFrame *frame)
|
|||||||
#endif // wxUSE_ACCEL
|
#endif // wxUSE_ACCEL
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
|
#if defined(WINCE_WITH_COMMANDAR)
|
||||||
bool wxMenuBar::AddAdornments(long style)
|
bool wxMenuBar::AddAdornments(long style)
|
||||||
{
|
{
|
||||||
if (m_adornmentsAdded || !m_commandBar)
|
if (m_adornmentsAdded || !m_commandBar)
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
#include "wx/module.h"
|
#include "wx/module.h"
|
||||||
|
|
||||||
#include "wx/msw/private.h"
|
#include "wx/msw/private.h"
|
||||||
#if defined(__WXWINCE__)
|
#if defined(__WXWINCE__) && !defined(__HANDHELDPC__)
|
||||||
#include <ole2.h>
|
#include <ole2.h>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
// Standard SDK doesn't have aygshell.dll: see include/wx/msw/wince/libraries.h
|
// Standard SDK doesn't have aygshell.dll: see include/wx/msw/wince/libraries.h
|
||||||
@@ -413,9 +413,9 @@ bool wxTopLevelWindowMSW::CreateFrame(const wxString& title,
|
|||||||
WXDWORD exflags;
|
WXDWORD exflags;
|
||||||
WXDWORD flags = MSWGetCreateWindowFlags(&exflags);
|
WXDWORD flags = MSWGetCreateWindowFlags(&exflags);
|
||||||
|
|
||||||
#if (defined(_WIN32_WCE) && _WIN32_WCE < 400) || \
|
#if !defined(__HANDHELDPC__) && ((defined(_WIN32_WCE) && _WIN32_WCE < 400) || \
|
||||||
defined(__POCKETPC__) || \
|
defined(__POCKETPC__) || \
|
||||||
defined(__SMARTPHONE__)
|
defined(__SMARTPHONE__))
|
||||||
// Always expand to fit the screen in PocketPC or SmartPhone
|
// Always expand to fit the screen in PocketPC or SmartPhone
|
||||||
wxSize sz(wxDefaultSize);
|
wxSize sz(wxDefaultSize);
|
||||||
#else // other (including normal desktop) Windows
|
#else // other (including normal desktop) Windows
|
||||||
@@ -758,7 +758,7 @@ bool wxTopLevelWindowMSW::ShowFullScreen(bool show, long style)
|
|||||||
rect.x, rect.y, rect.width, rect.height,
|
rect.x, rect.y, rect.width, rect.height,
|
||||||
flags);
|
flags);
|
||||||
|
|
||||||
#if defined(__WXWINCE__) && _WIN32_WCE < 400
|
#if !defined(__HANDHELDPC__) && (defined(__WXWINCE__) && (_WIN32_WCE < 400))
|
||||||
::SHFullScreen(GetHwnd(), SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);
|
::SHFullScreen(GetHwnd(), SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -768,7 +768,7 @@ bool wxTopLevelWindowMSW::ShowFullScreen(bool show, long style)
|
|||||||
}
|
}
|
||||||
else // stop showing full screen
|
else // stop showing full screen
|
||||||
{
|
{
|
||||||
#if defined(__WXWINCE__) && _WIN32_WCE < 400
|
#if !defined(__HANDHELDPC__) && (defined(__WXWINCE__) && (_WIN32_WCE < 400))
|
||||||
::SHFullScreen(GetHwnd(), SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON);
|
::SHFullScreen(GetHwnd(), SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON);
|
||||||
#endif
|
#endif
|
||||||
Maximize(m_fsIsMaximized);
|
Maximize(m_fsIsMaximized);
|
||||||
@@ -964,7 +964,7 @@ wxDlgProc(HWND hDlg,
|
|||||||
|
|
||||||
// Standard SDK doesn't have aygshell.dll: see
|
// Standard SDK doesn't have aygshell.dll: see
|
||||||
// include/wx/msw/wince/libraries.h
|
// include/wx/msw/wince/libraries.h
|
||||||
#if defined(__WXWINCE__) && !defined(__WINCE_STANDARDSDK__)
|
#if defined(__WXWINCE__) && !defined(__WINCE_STANDARDSDK__) && !defined(__HANDHELDPC__)
|
||||||
SHINITDLGINFO shidi;
|
SHINITDLGINFO shidi;
|
||||||
shidi.dwMask = SHIDIM_FLAGS;
|
shidi.dwMask = SHIDIM_FLAGS;
|
||||||
shidi.dwFlags = SHIDIF_DONEBUTTON |
|
shidi.dwFlags = SHIDIF_DONEBUTTON |
|
||||||
|
@@ -56,7 +56,7 @@
|
|||||||
#include <ole2.h>
|
#include <ole2.h>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#if !defined(__HANDHELDPC__) && ((_WIN32_WCE < 400) || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||||
#include <aygshell.h>
|
#include <aygshell.h>
|
||||||
#endif
|
#endif
|
||||||
#include "wx/msw/wince/missing.h"
|
#include "wx/msw/wince/missing.h"
|
||||||
@@ -249,7 +249,7 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuB
|
|||||||
if (m_menuBar)
|
if (m_menuBar)
|
||||||
m_menuBar->SetToolBar(this);
|
m_menuBar->SetToolBar(this);
|
||||||
|
|
||||||
#if !defined(__HANDHELDPC__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||||
// Create the menubar.
|
// Create the menubar.
|
||||||
SHMENUBARINFO mbi;
|
SHMENUBARINFO mbi;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user