Simplify wxMSW wxMenuBar title management.
Store the titles of the menu bar menus in the menu objects themselves. This makes wxMenu::GetTitle() return the expected result for them (which also fixes the current unit test failures for wxMSW) and makes wxMenuBar code simpler. This removes the wxMenuInfo class which existed for XTI purposes only but as it was apparently unfinished and MSW-specific it shouldn't be a big loss. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -154,25 +154,6 @@ private:
|
||||
// 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
|
||||
{
|
||||
public:
|
||||
@@ -186,9 +167,6 @@ public:
|
||||
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 Insert(size_t pos, wxMenu *menu, const wxString& title);
|
||||
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
|
||||
@@ -234,9 +212,6 @@ protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
wxArrayString m_titles;
|
||||
wxMenuInfoList m_menuInfos;
|
||||
|
||||
WXHMENU m_hMenu;
|
||||
|
||||
// Return the MSW position for a wxMenu which is sometimes different from
|
||||
|
Reference in New Issue
Block a user