Smartphone menus.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27832 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-06-16 06:37:55 +00:00
parent 665b71b17c
commit fb8a56b77c
9 changed files with 393 additions and 136 deletions

View File

@@ -81,6 +81,12 @@ public:
void SetLastFocus(wxWindow *win) { m_winLastFocused = win; }
wxWindow *GetLastFocus() const { return m_winLastFocused; }
#ifdef __SMARTPHONE__
void SetLeftMenu(int id = wxID_ANY, const wxString& label = wxEmptyString, wxMenu *subMenu = NULL);
void SetRightMenu(int id = wxID_ANY, const wxString& label = wxEmptyString, wxMenu *subMenu = NULL);
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
#endif // __SMARTPHONE__
protected:
// common part of all ctors
void Init();
@@ -123,6 +129,41 @@ protected:
// the last focused child: we restore focus to it on activation
wxWindow *m_winLastFocused;
#ifdef __SMARTPHONE__
class ButtonMenu
{
public:
ButtonMenu();
~ButtonMenu();
void SetButton(int id = wxID_ANY,
const wxString& label = wxEmptyString,
wxMenu *subMenu = NULL);
bool IsAssigned() const {return m_assigned;}
bool IsMenu() const {return m_menu!=NULL;}
int GetId() const {return m_id;}
wxMenu* GetMenu() const {return m_menu;}
wxString GetLabel() {return m_label;}
static wxMenu *DuplicateMenu(wxMenu *menu);
protected:
int m_id;
wxString m_label;
wxMenu *m_menu;
bool m_assigned;
};
ButtonMenu m_LeftButton;
ButtonMenu m_RightButton;
HWND m_MenuBarHWND;
void ReloadButton(ButtonMenu& button, UINT menuID);
void ReloadAllButtons();
#endif // __SMARTPHONE__
DECLARE_EVENT_TABLE()
DECLARE_NO_COPY_CLASS(wxTopLevelWindowMSW)
};

View File

@@ -522,7 +522,11 @@
// Default is 1
//
// Recommended setting: 1
#ifdef __SMARTPHONE__
#define wxUSE_STATUSBAR 0
#else
#define wxUSE_STATUSBAR 1
#endif
// Two status bar implementations are available under Win32: the generic one
// or the wrapper around native control. For native look and feel the native

View File

@@ -30,13 +30,13 @@
/////////////////////////////////////////////////////////////////////////////
#if (defined( __GNUWIN32__ ) && !defined(__TWIN32__)) || defined(__MWERKS__)
#include <wx/msw/gnuwin32/winresrc.h>
#include <wx/msw/gnuwin32/winresrc.h>
#else
#include <windows.h>
#include <windows.h>
#endif
#if defined(_WIN32_WCE)
#include <commctrl.h>
#include "wx\msw\wince\wince.rc"
#endif
//////////////////////////////////////////////////////////////////////////////
@@ -57,95 +57,6 @@ BEGIN
END
END
#ifdef _WIN32_WCE
// Dummy menubar/toolbar for WinCE
5000 RCDATA DISCARDABLE
BEGIN
// Popup menu name
5000,
// Count of items to put on the menu
0
END
5000 MENU DISCARDABLE
BEGIN
POPUP "Dummy"
BEGIN
MENUITEM "Dummy" 99
END
END
// A menubar for Smartphone, which can only have 1 or 2 menu buttons.
#define IDR_SMARTPHONE_MENUBAR 5002
#define ID_FIRST_BUTTON 40001
#define ID_SECOND_BUTTON 40002
#define IDS_CAP_MENU 40003
#define ID_MENU_TEST 40004
#define IDS_DONE 40006
STRINGTABLE DISCARDABLE
BEGIN
5001 "Dummy menu"
IDS_DONE "Done"
IDS_CAP_MENU "Menu"
END
#ifndef I_IMAGENONE
#define I_IMAGENONE (-2)
#endif
#ifndef NOMENU
#define NOMENU 0xFFFF
#endif
#ifndef wxID_EXIT
#define wxID_EXIT 5006
#endif
// A resource for a one-button menubar
/*
IDR_SMARTPHONE_MENUBAR MENU DISCARDABLE
BEGIN
MENUITEM "Done", wxID_EXIT
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_DONE "Done"
IDS_CAP_MENU "Menu"
END
IDR_SMARTPHONE_MENUBAR RCDATA DISCARDABLE
BEGIN
IDR_SMARTPHONE_MENUBAR, 1,
I_IMAGENONE, wxID_EXIT, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE, IDS_DONE, 0, NOMENU,
END
*/
// A resource for a two-button menubar
IDR_SMARTPHONE_MENUBAR MENU DISCARDABLE
BEGIN
MENUITEM "Done", wxID_EXIT
POPUP "Menu"
BEGIN
MENUITEM "OK", wxID_EXIT
END
END
IDR_SMARTPHONE_MENUBAR RCDATA DISCARDABLE
BEGIN
IDR_SMARTPHONE_MENUBAR, 2,
I_IMAGENONE, wxID_EXIT, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE, IDS_DONE, 0, NOMENU,
I_IMAGENONE, ID_SECOND_BUTTON, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_MENU, 0, 1,
END
#endif
//////////////////////////////////////////////////////////////////////////////
//
// Standard wxWindows Cursors