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:
parent
b3900fb51a
commit
3d4875664f
@ -318,7 +318,7 @@ void wxFrame::PositionStatusBar()
|
||||
|
||||
void wxFrame::AttachMenuBar(wxMenuBar *menubar)
|
||||
{
|
||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||
if (!GetToolBar())
|
||||
{
|
||||
wxToolBar* toolBar = new wxToolBar(this, -1,
|
||||
@ -354,7 +354,7 @@ void wxFrame::AttachMenuBar(wxMenuBar *menubar)
|
||||
}
|
||||
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.
|
||||
if ( menubar->GetHMenu() )
|
||||
{
|
||||
@ -417,7 +417,8 @@ bool wxFrame::ShowFullScreen(bool show, long style)
|
||||
if (show)
|
||||
{
|
||||
#if wxUSE_TOOLBAR
|
||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
||||
|
||||
#if defined(WINCE_WITH_COMMANDBAR)
|
||||
// TODO: hide commandbar
|
||||
#else
|
||||
wxToolBar *theToolBar = GetToolBar();
|
||||
@ -462,7 +463,7 @@ bool wxFrame::ShowFullScreen(bool show, long style)
|
||||
else
|
||||
{
|
||||
#if wxUSE_TOOLBAR
|
||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||
// TODO: show commandbar
|
||||
#else
|
||||
wxToolBar *theToolBar = GetToolBar();
|
||||
@ -508,7 +509,7 @@ bool wxFrame::ShowFullScreen(bool show, long style)
|
||||
|
||||
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.
|
||||
if (GetToolBar())
|
||||
return GetToolBar();
|
||||
@ -526,7 +527,7 @@ void wxFrame::PositionToolBar()
|
||||
wxToolBar *toolbar = GetToolBar();
|
||||
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
|
||||
// the toolbar should be associated with the commandbar,
|
||||
// and not an independent window.
|
||||
@ -547,7 +548,7 @@ void wxFrame::PositionToolBar()
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
#if defined(__WXWINCE__)
|
||||
#if defined(WINCE_WITH_COMMANDBAR)
|
||||
// We're using a commandbar - so we have to allow for it.
|
||||
if (GetMenuBar() && GetMenuBar()->GetCommandBar())
|
||||
{
|
||||
@ -805,7 +806,7 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id)
|
||||
PositionToolBar();
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITH_COMMANDBAR)
|
||||
// Position the menu command bar
|
||||
if (GetMenuBar() && GetMenuBar()->GetCommandBar())
|
||||
{
|
||||
@ -1027,7 +1028,7 @@ wxPoint wxFrame::GetClientAreaOrigin() const
|
||||
}
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
#if defined(__WXWINCE__) && defined(__WINCE_STANDARDSDK__)
|
||||
#if defined(WINCE_WITH_COMMANDBAR)
|
||||
if (GetMenuBar() && GetMenuBar()->GetCommandBar())
|
||||
{
|
||||
RECT rect;
|
||||
|
@ -676,13 +676,13 @@ void wxMenuBar::Init()
|
||||
{
|
||||
m_eventHandler = this;
|
||||
m_hMenu = 0;
|
||||
#if wxUSE_TOOLBAR && defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
||||
#if wxUSE_TOOLBAR && defined(__WXWINCE__)
|
||||
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(__POCKETPC__) && !defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITH_COMMANDBAR)
|
||||
m_commandBar = NULL;
|
||||
m_adornmentsAdded = false;
|
||||
#endif
|
||||
@ -717,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(__POCKETPC__) || defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||
if (GetToolBar())
|
||||
GetToolBar()->SetMenuBar(NULL);
|
||||
#else
|
||||
@ -725,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(__POCKETPC__) && !defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITH_COMMANDBAR)
|
||||
::DestroyWindow((HWND) m_commandBar);
|
||||
m_commandBar = (WXHWND) NULL;
|
||||
#else
|
||||
@ -744,12 +744,12 @@ void wxMenuBar::Refresh()
|
||||
{
|
||||
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())
|
||||
{
|
||||
CommandBar_DrawMenuBar((HWND) GetToolBar()->GetHWND(), 0);
|
||||
}
|
||||
#elif defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
|
||||
#elif defined(WINCE_WITHOUT_COMMANDBAR)
|
||||
if (m_commandBar)
|
||||
DrawMenuBar((HWND) m_commandBar);
|
||||
#else
|
||||
@ -763,8 +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__) && !defined(__HANDHELDPC__) \
|
||||
(_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||
if ( m_hMenu != 0 )
|
||||
return m_hMenu;
|
||||
|
||||
@ -1000,7 +999,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
|
||||
|
||||
if ( IsAttached() )
|
||||
{
|
||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITHOUT_COMMANDAR)
|
||||
if (!GetToolBar())
|
||||
return FALSE;
|
||||
TBBUTTON tbButton;
|
||||
@ -1054,7 +1053,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
|
||||
|
||||
if ( IsAttached() )
|
||||
{
|
||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITHOUT_COMMANDAR)
|
||||
if (!GetToolBar())
|
||||
return FALSE;
|
||||
TBBUTTON tbButton;
|
||||
@ -1105,7 +1104,7 @@ wxMenu *wxMenuBar::Remove(size_t pos)
|
||||
|
||||
if ( IsAttached() )
|
||||
{
|
||||
#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITHOUT_COMMANDAR)
|
||||
if (GetToolBar())
|
||||
{
|
||||
if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_DELETEBUTTON, (UINT) pos, (LPARAM) 0))
|
||||
@ -1175,7 +1174,7 @@ void wxMenuBar::Attach(wxFrame *frame)
|
||||
#if defined(__WXWINCE__)
|
||||
if (!m_hMenu)
|
||||
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.
|
||||
// Remove after testing with other WinCE combinations - April 2004
|
||||
@ -1212,7 +1211,7 @@ void wxMenuBar::Attach(wxFrame *frame)
|
||||
#endif // wxUSE_ACCEL
|
||||
}
|
||||
|
||||
#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITH_COMMANDAR)
|
||||
bool wxMenuBar::AddAdornments(long style)
|
||||
{
|
||||
if (m_adornmentsAdded || !m_commandBar)
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include "wx/module.h"
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
#if defined(__WXWINCE__)
|
||||
#if defined(__WXWINCE__) && !defined(__HANDHELDPC__)
|
||||
#include <ole2.h>
|
||||
#include <shellapi.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 flags = MSWGetCreateWindowFlags(&exflags);
|
||||
|
||||
#if (defined(_WIN32_WCE) && _WIN32_WCE < 400) || \
|
||||
#if !defined(__HANDHELDPC__) && ((defined(_WIN32_WCE) && _WIN32_WCE < 400) || \
|
||||
defined(__POCKETPC__) || \
|
||||
defined(__SMARTPHONE__)
|
||||
defined(__SMARTPHONE__))
|
||||
// Always expand to fit the screen in PocketPC or SmartPhone
|
||||
wxSize sz(wxDefaultSize);
|
||||
#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,
|
||||
flags);
|
||||
|
||||
#if defined(__WXWINCE__) && _WIN32_WCE < 400
|
||||
#if !defined(__HANDHELDPC__) && (defined(__WXWINCE__) && (_WIN32_WCE < 400))
|
||||
::SHFullScreen(GetHwnd(), SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);
|
||||
#endif
|
||||
|
||||
@ -768,7 +768,7 @@ bool wxTopLevelWindowMSW::ShowFullScreen(bool show, long style)
|
||||
}
|
||||
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);
|
||||
#endif
|
||||
Maximize(m_fsIsMaximized);
|
||||
@ -964,7 +964,7 @@ wxDlgProc(HWND hDlg,
|
||||
|
||||
// Standard SDK doesn't have aygshell.dll: see
|
||||
// include/wx/msw/wince/libraries.h
|
||||
#if defined(__WXWINCE__) && !defined(__WINCE_STANDARDSDK__)
|
||||
#if defined(__WXWINCE__) && !defined(__WINCE_STANDARDSDK__) && !defined(__HANDHELDPC__)
|
||||
SHINITDLGINFO shidi;
|
||||
shidi.dwMask = SHIDIM_FLAGS;
|
||||
shidi.dwFlags = SHIDIF_DONEBUTTON |
|
||||
|
@ -56,7 +56,7 @@
|
||||
#include <ole2.h>
|
||||
#include <shellapi.h>
|
||||
#include <commctrl.h>
|
||||
#if !defined(__HANDHELDPC__) && ((_WIN32_WCE < 400) || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||
#include <aygshell.h>
|
||||
#endif
|
||||
#include "wx/msw/wince/missing.h"
|
||||
@ -249,7 +249,7 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuB
|
||||
if (m_menuBar)
|
||||
m_menuBar->SetToolBar(this);
|
||||
|
||||
#if !defined(__HANDHELDPC__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__))
|
||||
#if defined(WINCE_WITHOUT_COMMANDBAR)
|
||||
// Create the menubar.
|
||||
SHMENUBARINFO mbi;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user