having menu classinfo at one place
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -103,25 +103,6 @@ private:
|
|||||||
// Menu Bar (a la Windows)
|
// Menu Bar (a la Windows)
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxMenuInfo : public wxObject
|
|
||||||
{
|
|
||||||
public :
|
|
||||||
wxMenuInfo() { m_menu = NULL ; }
|
|
||||||
virtual ~wxMenuInfo() { }
|
|
||||||
|
|
||||||
void Create( wxMenu *menu , const wxString &title )
|
|
||||||
{ m_menu = menu ; m_title = title ; }
|
|
||||||
wxMenu* GetMenu() const { return m_menu ; }
|
|
||||||
wxString GetTitle() const { return m_title ; }
|
|
||||||
private :
|
|
||||||
wxMenu *m_menu ;
|
|
||||||
wxString m_title ;
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxMenuInfo) ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
WX_DECLARE_EXPORTED_LIST(wxMenuInfo, wxMenuInfoList );
|
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxMenuBar : public wxMenuBarBase
|
class WXDLLIMPEXP_CORE wxMenuBar : public wxMenuBarBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -134,10 +115,6 @@ public:
|
|||||||
wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long style = 0);
|
wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long style = 0);
|
||||||
virtual ~wxMenuBar();
|
virtual ~wxMenuBar();
|
||||||
|
|
||||||
// menubar construction
|
|
||||||
bool Append( wxMenuInfo *info ) { return Append( info->GetMenu() , info->GetTitle() ) ; }
|
|
||||||
const wxMenuInfoList& GetMenuInfos() const ;
|
|
||||||
|
|
||||||
virtual bool Append( wxMenu *menu, const wxString &title );
|
virtual bool Append( wxMenu *menu, const wxString &title );
|
||||||
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
|
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
|
||||||
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
|
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
|
||||||
|
@@ -41,8 +41,6 @@
|
|||||||
// wxMenu implementation
|
// wxMenu implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
|
|
||||||
|
|
||||||
bool wxMenu::Create(const wxString& title, long style)
|
bool wxMenu::Create(const wxString& title, long style)
|
||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
wxAutoNSAutoreleasePool pool;
|
||||||
@@ -115,7 +113,6 @@ void wxMenu::Cocoa_dealloc()
|
|||||||
// ============================================================================
|
// ============================================================================
|
||||||
// wxMenuBar implementation
|
// wxMenuBar implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow)
|
|
||||||
|
|
||||||
bool wxMenuBar::Create(long style)
|
bool wxMenuBar::Create(long style)
|
||||||
{
|
{
|
||||||
|
@@ -82,7 +82,6 @@ WX_IMPLEMENT_GET_OBJC_CLASS(wxNSMenuItemTarget,NSObject)
|
|||||||
// ============================================================================
|
// ============================================================================
|
||||||
// wxMenuItemCocoa implementation
|
// wxMenuItemCocoa implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
|
|
||||||
wxMenuItemCocoaHash wxMenuItemCocoa::sm_cocoaHash;
|
wxMenuItemCocoaHash wxMenuItemCocoa::sm_cocoaHash;
|
||||||
|
|
||||||
wxObjcAutoRefFromAlloc<struct objc_object *> wxMenuItemCocoa::sm_cocoaTarget = [[WX_GET_OBJC_CLASS(wxNSMenuItemTarget) alloc] init];
|
wxObjcAutoRefFromAlloc<struct objc_object *> wxMenuItemCocoa::sm_cocoaTarget = [[WX_GET_OBJC_CLASS(wxNSMenuItemTarget) alloc] init];
|
||||||
|
@@ -52,10 +52,6 @@ WX_DEFINE_LIST(wxMenuItemList)
|
|||||||
// XTI for wxMenu(Bar)
|
// XTI for wxMenu(Bar)
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if wxUSE_EXTENDED_RTTI
|
|
||||||
|
|
||||||
WX_DEFINE_LIST( wxMenuInfoList )
|
|
||||||
|
|
||||||
wxDEFINE_FLAGS( wxMenuStyle )
|
wxDEFINE_FLAGS( wxMenuStyle )
|
||||||
wxBEGIN_FLAGS( wxMenuStyle )
|
wxBEGIN_FLAGS( wxMenuStyle )
|
||||||
wxFLAGS_MEMBER(wxMENU_TEAROFF)
|
wxFLAGS_MEMBER(wxMENU_TEAROFF)
|
||||||
@@ -105,6 +101,9 @@ bool wxMenuBarStreamingCallback( const wxObject *WXUNUSED(object), wxObjectWrite
|
|||||||
wxIMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxMenuBar, wxWindow, "wx/menu.h", \
|
wxIMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxMenuBar, wxWindow, "wx/menu.h", \
|
||||||
wxMenuBarStreamingCallback)
|
wxMenuBarStreamingCallback)
|
||||||
|
|
||||||
|
#if wxUSE_EXTENDED_RTTI
|
||||||
|
|
||||||
|
WX_DEFINE_LIST( wxMenuInfoList )
|
||||||
wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxMenuInfo, wxObject, "wx/menu.h")
|
wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxMenuInfo, wxObject, "wx/menu.h")
|
||||||
|
|
||||||
wxBEGIN_PROPERTIES_TABLE(wxMenuInfo)
|
wxBEGIN_PROPERTIES_TABLE(wxMenuInfo)
|
||||||
@@ -127,15 +126,6 @@ template<> void wxCollectionToVariantArray( wxMenuInfoList const &theList,
|
|||||||
wxListCollectionToAnyList<wxMenuInfoList::compatibility_iterator>( theList, value ) ;
|
wxListCollectionToAnyList<wxMenuInfoList::compatibility_iterator>( theList, value ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBEGIN_PROPERTIES_TABLE(wxMenuBar)
|
|
||||||
wxPROPERTY_COLLECTION( MenuInfos, wxMenuInfoList, wxMenuInfo*, AppendMenuInfo, \
|
|
||||||
GetMenuInfos, 0 /*flags*/, wxT("Helpstring"), wxT("group"))
|
|
||||||
wxEND_PROPERTIES_TABLE()
|
|
||||||
|
|
||||||
wxEMPTY_HANDLERS_TABLE(wxMenuBar)
|
|
||||||
|
|
||||||
wxCONSTRUCTOR_DUMMY( wxMenuBar )
|
|
||||||
|
|
||||||
const wxMenuInfoList& wxMenuBarBase::GetMenuInfos() const
|
const wxMenuInfoList& wxMenuBarBase::GetMenuInfos() const
|
||||||
{
|
{
|
||||||
wxMenuInfoList* list = const_cast< wxMenuInfoList* > (& m_menuInfos);
|
wxMenuInfoList* list = const_cast< wxMenuInfoList* > (& m_menuInfos);
|
||||||
@@ -149,18 +139,16 @@ const wxMenuInfoList& wxMenuBarBase::GetMenuInfos() const
|
|||||||
return m_menuInfos;
|
return m_menuInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<wxMenu**>)
|
|
||||||
WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<wxMenuItem**>)
|
|
||||||
WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<wxMenuBar**>)
|
|
||||||
WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<wxMenuInfo**>)
|
|
||||||
*/
|
|
||||||
#else
|
|
||||||
// IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
|
|
||||||
// IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow)
|
|
||||||
// IMPLEMENT_DYNAMIC_CLASS(wxMenuInfo, wxObject)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
wxBEGIN_PROPERTIES_TABLE(wxMenuBar)
|
||||||
|
wxPROPERTY_COLLECTION( MenuInfos, wxMenuInfoList, wxMenuInfo*, AppendMenuInfo, \
|
||||||
|
GetMenuInfos, 0 /*flags*/, wxT("Helpstring"), wxT("group"))
|
||||||
|
wxEND_PROPERTIES_TABLE()
|
||||||
|
|
||||||
|
wxEMPTY_HANDLERS_TABLE(wxMenuBar)
|
||||||
|
|
||||||
|
wxCONSTRUCTOR_DUMMY( wxMenuBar )
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// XTI for wxMenuItem
|
// XTI for wxMenuItem
|
||||||
|
@@ -58,8 +58,6 @@ static void DoCommonMenuCallbackCode(wxMenu *menu, wxMenuEvent& event)
|
|||||||
// wxMenuBar
|
// wxMenuBar
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow)
|
|
||||||
|
|
||||||
void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long style)
|
void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long style)
|
||||||
{
|
{
|
||||||
#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
|
#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
|
||||||
@@ -519,8 +517,6 @@ static void menuitem_deselect(GtkWidget*, wxMenuItem* item)
|
|||||||
// wxMenuItem
|
// wxMenuItem
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
|
|
||||||
|
|
||||||
wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu,
|
wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu,
|
||||||
int id,
|
int id,
|
||||||
const wxString& name,
|
const wxString& name,
|
||||||
@@ -678,8 +674,6 @@ static gboolean can_activate_accel(GtkWidget*, guint, wxMenu* menu)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
|
|
||||||
|
|
||||||
void wxMenu::Init()
|
void wxMenu::Init()
|
||||||
{
|
{
|
||||||
m_popupShown = false;
|
m_popupShown = false;
|
||||||
|
@@ -175,8 +175,6 @@ static void gtk_menu_close_callback( GtkWidget *WXUNUSED(widget), wxMenuBar *men
|
|||||||
// wxMenuBar
|
// wxMenuBar
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow)
|
|
||||||
|
|
||||||
void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long style)
|
void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long style)
|
||||||
{
|
{
|
||||||
// the parent window is known after wxFrame::SetMenu()
|
// the parent window is known after wxFrame::SetMenu()
|
||||||
@@ -693,8 +691,6 @@ static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu )
|
|||||||
// wxMenuItem
|
// wxMenuItem
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
|
|
||||||
|
|
||||||
wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu,
|
wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu,
|
||||||
int id,
|
int id,
|
||||||
const wxString& name,
|
const wxString& name,
|
||||||
@@ -918,8 +914,6 @@ bool wxMenuItem::IsChecked() const
|
|||||||
// wxMenu
|
// wxMenu
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
|
|
||||||
|
|
||||||
void wxMenu::Init()
|
void wxMenu::Init()
|
||||||
{
|
{
|
||||||
m_accel = gtk_accel_group_new();
|
m_accel = gtk_accel_group_new();
|
||||||
|
@@ -52,9 +52,6 @@
|
|||||||
// other standard headers
|
// other standard headers
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler)
|
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// implementation
|
// implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@@ -63,8 +63,6 @@ static void wxMenuItemDisarmCallback(Widget w, XtPointer clientData, XtPointer p
|
|||||||
// dynamic classes implementation
|
// dynamic classes implementation
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxMenuItem
|
// wxMenuItem
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -55,9 +55,6 @@ USHORT wxMenu::m_nextMenuId = 0;
|
|||||||
// macros
|
// macros
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler)
|
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// implementation
|
// implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@@ -58,8 +58,6 @@
|
|||||||
// dynamic classes implementation
|
// dynamic classes implementation
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxMenuItem
|
// wxMenuItem
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -43,9 +43,6 @@ wxMenuImpl::~wxMenuImpl()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler)
|
|
||||||
|
|
||||||
// the (popup) menu title has this special id
|
// the (popup) menu title has this special id
|
||||||
static const int idMenuTitle = -3;
|
static const int idMenuTitle = -3;
|
||||||
|
|
||||||
|
@@ -29,8 +29,6 @@ wxMenuItemImpl::~wxMenuItemImpl()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
|
|
||||||
|
|
||||||
wxMenuItem::wxMenuItem(wxMenu *pParentMenu,
|
wxMenuItem::wxMenuItem(wxMenu *pParentMenu,
|
||||||
int id,
|
int id,
|
||||||
const wxString& t,
|
const wxString& t,
|
||||||
|
@@ -69,100 +69,6 @@ static const int idMenuTitle = -3;
|
|||||||
// implementation
|
// implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
#include "wx/listimpl.cpp"
|
|
||||||
|
|
||||||
WX_DEFINE_LIST( wxMenuInfoList )
|
|
||||||
|
|
||||||
#if wxUSE_EXTENDED_RTTI
|
|
||||||
|
|
||||||
WX_DEFINE_FLAGS( wxMenuStyle )
|
|
||||||
|
|
||||||
wxBEGIN_FLAGS( wxMenuStyle )
|
|
||||||
wxFLAGS_MEMBER(wxMENU_TEAROFF)
|
|
||||||
wxEND_FLAGS( wxMenuStyle )
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxMenu, wxEvtHandler,"wx/menu.h")
|
|
||||||
|
|
||||||
wxCOLLECTION_TYPE_INFO( wxMenuItem * , wxMenuItemList ) ;
|
|
||||||
|
|
||||||
template<> void wxCollectionToVariantArray( wxMenuItemList const &theList, wxxVariantArray &value)
|
|
||||||
{
|
|
||||||
wxListCollectionToVariantArray<wxMenuItemList::compatibility_iterator>( theList , value ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxBEGIN_PROPERTIES_TABLE(wxMenu)
|
|
||||||
wxEVENT_PROPERTY( Select , wxEVT_COMMAND_MENU_SELECTED , wxCommandEvent)
|
|
||||||
wxPROPERTY( Title, wxString , SetTitle, GetTitle, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
|
||||||
wxREADONLY_PROPERTY_FLAGS( MenuStyle , wxMenuStyle , long , GetStyle , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
|
||||||
wxPROPERTY_COLLECTION( MenuItems , wxMenuItemList , wxMenuItem* , Append , GetMenuItems , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
|
||||||
wxEND_PROPERTIES_TABLE()
|
|
||||||
|
|
||||||
wxBEGIN_HANDLERS_TABLE(wxMenu)
|
|
||||||
wxEND_HANDLERS_TABLE()
|
|
||||||
|
|
||||||
wxDIRECT_CONSTRUCTOR_2( wxMenu , wxString , Title , long , MenuStyle )
|
|
||||||
|
|
||||||
WX_DEFINE_FLAGS( wxMenuBarStyle )
|
|
||||||
|
|
||||||
wxBEGIN_FLAGS( wxMenuBarStyle )
|
|
||||||
wxFLAGS_MEMBER(wxMB_DOCKABLE)
|
|
||||||
wxEND_FLAGS( wxMenuBarStyle )
|
|
||||||
|
|
||||||
// the negative id would lead the window (its superclass !) to vetoe streaming out otherwise
|
|
||||||
bool wxMenuBarStreamingCallback( const wxObject *WXUNUSED(object), wxWriter * , wxPersister * , wxxVariantArray & )
|
|
||||||
{
|
|
||||||
return true ;
|
|
||||||
}
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxMenuBar, wxWindow ,"wx/menu.h",wxMenuBarStreamingCallback)
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxMenuInfo, wxObject , "wx/menu.h" )
|
|
||||||
|
|
||||||
wxBEGIN_PROPERTIES_TABLE(wxMenuInfo)
|
|
||||||
wxREADONLY_PROPERTY( Menu , wxMenu* , GetMenu , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
|
||||||
wxREADONLY_PROPERTY( Title , wxString , GetTitle , wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
|
||||||
wxEND_PROPERTIES_TABLE()
|
|
||||||
|
|
||||||
wxBEGIN_HANDLERS_TABLE(wxMenuInfo)
|
|
||||||
wxEND_HANDLERS_TABLE()
|
|
||||||
|
|
||||||
wxCONSTRUCTOR_2( wxMenuInfo , wxMenu* , Menu , wxString , Title )
|
|
||||||
|
|
||||||
wxCOLLECTION_TYPE_INFO( wxMenuInfo * , wxMenuInfoList ) ;
|
|
||||||
|
|
||||||
template<> void wxCollectionToVariantArray( wxMenuInfoList const &theList, wxxVariantArray &value)
|
|
||||||
{
|
|
||||||
wxListCollectionToVariantArray<wxMenuInfoList::compatibility_iterator>( theList , value ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxBEGIN_PROPERTIES_TABLE(wxMenuBar)
|
|
||||||
wxPROPERTY_COLLECTION( MenuInfos , wxMenuInfoList , wxMenuInfo* , Append , GetMenuInfos , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
|
||||||
wxEND_PROPERTIES_TABLE()
|
|
||||||
|
|
||||||
wxBEGIN_HANDLERS_TABLE(wxMenuBar)
|
|
||||||
wxEND_HANDLERS_TABLE()
|
|
||||||
|
|
||||||
wxCONSTRUCTOR_DUMMY( wxMenuBar )
|
|
||||||
|
|
||||||
#else
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuInfo, wxObject)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const wxMenuInfoList& wxMenuBar::GetMenuInfos() const
|
|
||||||
{
|
|
||||||
wxMenuInfoList* list = const_cast< wxMenuInfoList* >( &m_menuInfos ) ;
|
|
||||||
WX_CLEAR_LIST( wxMenuInfoList , *list ) ;
|
|
||||||
for( size_t i = 0 ; i < GetMenuCount() ; ++i )
|
|
||||||
{
|
|
||||||
wxMenuInfo* info = new wxMenuInfo() ;
|
|
||||||
info->Create( const_cast<wxMenuBar*>(this)->GetMenu(i) , GetMenuLabel(i) ) ;
|
|
||||||
list->Append( info ) ;
|
|
||||||
}
|
|
||||||
return m_menuInfos ;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// wxMenu construction, adding and removing menu items
|
// wxMenu construction, adding and removing menu items
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@@ -58,53 +58,6 @@
|
|||||||
// implementation
|
// implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// dynamic classes implementation
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#if wxUSE_EXTENDED_RTTI
|
|
||||||
|
|
||||||
bool wxMenuItemStreamingCallback( const wxObject *object, wxWriter * , wxPersister * , wxxVariantArray & )
|
|
||||||
{
|
|
||||||
const wxMenuItem * mitem = dynamic_cast<const wxMenuItem*>(object) ;
|
|
||||||
if ( mitem->GetMenu() && !mitem->GetMenu()->GetTitle().empty() )
|
|
||||||
{
|
|
||||||
// we don't stream out the first two items for menus with a title, they will be reconstructed
|
|
||||||
if ( mitem->GetMenu()->FindItemByPosition(0) == mitem || mitem->GetMenu()->FindItemByPosition(1) == mitem )
|
|
||||||
return false ;
|
|
||||||
}
|
|
||||||
return true ;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxBEGIN_ENUM( wxItemKind )
|
|
||||||
wxENUM_MEMBER( wxITEM_SEPARATOR )
|
|
||||||
wxENUM_MEMBER( wxITEM_NORMAL )
|
|
||||||
wxENUM_MEMBER( wxITEM_CHECK )
|
|
||||||
wxENUM_MEMBER( wxITEM_RADIO )
|
|
||||||
wxEND_ENUM( wxItemKind )
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxMenuItem, wxObject,"wx/menuitem.h",wxMenuItemStreamingCallback)
|
|
||||||
|
|
||||||
wxBEGIN_PROPERTIES_TABLE(wxMenuItem)
|
|
||||||
wxPROPERTY( Parent,wxMenu*, SetMenu, GetMenu, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
|
||||||
wxPROPERTY( Id,int, SetId, GetId, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
|
||||||
wxPROPERTY( Text, wxString , SetText, GetText, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
|
||||||
wxPROPERTY( Help, wxString , SetHelp, GetHelp, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
|
||||||
wxREADONLY_PROPERTY( Kind, wxItemKind , GetKind , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
|
||||||
wxPROPERTY( SubMenu,wxMenu*, SetSubMenu, GetSubMenu, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
|
||||||
wxPROPERTY( Enabled , bool , Enable , IsEnabled , wxxVariant((bool)true) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
|
||||||
wxPROPERTY( Checked , bool , Check , IsChecked , wxxVariant((bool)false) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
|
||||||
wxPROPERTY( Checkable , bool , SetCheckable , IsCheckable , wxxVariant((bool)false) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
|
||||||
wxEND_PROPERTIES_TABLE()
|
|
||||||
|
|
||||||
wxBEGIN_HANDLERS_TABLE(wxMenuItem)
|
|
||||||
wxEND_HANDLERS_TABLE()
|
|
||||||
|
|
||||||
wxDIRECT_CONSTRUCTOR_6( wxMenuItem , wxMenu* , Parent , int , Id , wxString , Text , wxString , Help , wxItemKind , Kind , wxMenu* , SubMenu )
|
|
||||||
#else
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxMenuItem
|
// wxMenuItem
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -281,10 +281,6 @@ private:
|
|||||||
// wxWin macros
|
// wxWin macros
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxPopupMenuWindow, wxPopupTransientWindow)
|
BEGIN_EVENT_TABLE(wxPopupMenuWindow, wxPopupTransientWindow)
|
||||||
EVT_KEY_DOWN(wxPopupMenuWindow::OnKeyDown)
|
EVT_KEY_DOWN(wxPopupMenuWindow::OnKeyDown)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user