Flatening menu for Smartphones when menubar has only one menu
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		@@ -350,13 +350,9 @@ bool MyApp::OnInit()
 | 
			
		||||
    file_menu->AppendSeparator();
 | 
			
		||||
    file_menu->Append(wxID_EXIT, _T("E&xit\tAlt-X"));
 | 
			
		||||
 | 
			
		||||
#if !defined( __SMARTPHONE__ )
 | 
			
		||||
    wxMenuBar *menu_bar = new wxMenuBar;
 | 
			
		||||
    menu_bar->Append(file_menu, _T("&File"));
 | 
			
		||||
    frame->SetMenuBar(menu_bar);
 | 
			
		||||
#else
 | 
			
		||||
    frame->SetRightMenu(wxID_ANY, _T("Menu"), file_menu);
 | 
			
		||||
#endif // __SMARTPHONE__
 | 
			
		||||
 | 
			
		||||
    myCanvas = new MyCanvas(frame);
 | 
			
		||||
    myCanvas->SetBackgroundColour(*wxWHITE);
 | 
			
		||||
 
 | 
			
		||||
@@ -319,7 +319,17 @@ void wxFrame::PositionStatusBar()
 | 
			
		||||
void wxFrame::AttachMenuBar(wxMenuBar *menubar)
 | 
			
		||||
{
 | 
			
		||||
#if defined(__SMARTPHONE__)
 | 
			
		||||
    wxMenu *autoMenu = new wxMenu;
 | 
			
		||||
 | 
			
		||||
    wxMenu *autoMenu = NULL;
 | 
			
		||||
 | 
			
		||||
    if( menubar->GetMenuCount() == 1 )
 | 
			
		||||
    {
 | 
			
		||||
        autoMenu = wxTopLevelWindowMSW::ButtonMenu::DuplicateMenu(menubar->GetMenu(0));
 | 
			
		||||
        SetRightMenu(wxID_ANY, menubar->GetLabelTop(0), autoMenu);
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        autoMenu = new wxMenu;
 | 
			
		||||
 | 
			
		||||
        for( size_t n = 0; n < menubar->GetMenuCount(); n++ )
 | 
			
		||||
        {
 | 
			
		||||
@@ -330,6 +340,8 @@ void wxFrame::AttachMenuBar(wxMenuBar *menubar)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        SetRightMenu(wxID_ANY, _("Menu"), autoMenu);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#elif defined(WINCE_WITHOUT_COMMANDBAR)
 | 
			
		||||
    if (!GetToolBar())
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user