这篇教程C++ wxStripMenuCodes函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wxStripMenuCodes函数的典型用法代码示例。如果您正苦于以下问题:C++ wxStripMenuCodes函数的具体用法?C++ wxStripMenuCodes怎么用?C++ wxStripMenuCodes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wxStripMenuCodes函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wxASSERT_MSGwxMenuItem::wxMenuItem(wxMenu *pParentMenu, int id, const wxString& t, const wxString& strHelp, wxItemKind kind, wxMenu *pSubMenu) :wxMenuItemBase(pParentMenu, id, t, strHelp, kind, pSubMenu){ wxASSERT_MSG( id != 0 || pSubMenu != NULL , wxT("A MenuItem ID of Zero does not work under Mac") ) ; // In other languages there is no difference in naming the Exit/Quit menu item between MacOS and Windows guidelines // therefore these item must not be translated if (pParentMenu != NULL && !pParentMenu->GetNoEventsMode()) if ( wxStripMenuCodes(m_text).Upper() == wxT("EXIT") ) m_text = wxT("Quit/tCtrl+Q") ; m_radioGroup.start = -1; m_isRadioGroupStart = false; wxString text = wxStripMenuCodes(m_text, (pParentMenu != NULL && pParentMenu->GetNoEventsMode()) ? wxStrip_Accel : wxStrip_All); if (text.IsEmpty() && !IsSeparator()) { wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?")); text = wxGetStockLabel(GetId(), wxSTOCK_WITH_ACCELERATOR|wxSTOCK_WITH_MNEMONIC); } wxAcceleratorEntry *entry = wxAcceleratorEntry::Create( m_text ) ; // use accessors for ID and Kind because they might have been changed in the base constructor m_peer = wxMenuItemImpl::Create( this, pParentMenu, GetId(), text, entry, strHelp, GetKind(), pSubMenu ); delete entry;}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:31,
示例2: wxStripMenuCodes//// Find the itemString in menuString, and return the item id or wxNOT_FOUND//int wxMenuBar::FindMenuItem( const wxString& rMenuString, const wxString& rItemString) const{ wxString sMenuLabel = wxStripMenuCodes(rMenuString); size_t nCount = GetMenuCount(), i; wxMenuList::const_iterator it;#if defined(__INTEL_COMPILER) && 1 // VDM auto patch# pragma ivdep# pragma swp# pragma unroll#endif#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */# pragma ivdep# pragma swp# pragma unroll# pragma prefetch# if 0# pragma simd noassert# endif#endif /* VDM auto patch */ for (i = 0, it = m_menus.begin(); i < nCount; i++, it++) { wxString sTitle = wxStripMenuCodes(m_titles[i]); if (rMenuString == sTitle) return (*it)->FindItem(rItemString); } return wxNOT_FOUND;} // end of wxMenuBar::FindMenuItem
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:34,
示例3: switchvoid wxGISToolBar::AddCommand(wxGISCommand* pCmd){ switch(pCmd->GetKind()) { case enumGISCommandMenu: return; case enumGISCommandSeparator: case enumGISCommandCheck: case enumGISCommandRadio: case enumGISCommandNormal: { wxBitmap Bitmap = pCmd->GetBitmap(); if(!Bitmap.IsOk()) Bitmap = wxBitmap(tool_16_xpm); AddTool(pCmd->GetID(), wxStripMenuCodes(pCmd->GetCaption()), Bitmap, wxBitmap(), (wxItemKind)pCmd->GetKind(), pCmd->GetTooltip(), pCmd->GetMessage(), NULL); } break; case enumGISCommandDropDown: { wxBitmap Bitmap = pCmd->GetBitmap(); if(!Bitmap.IsOk()) Bitmap = wxBitmap(tool_16_xpm); AddTool(pCmd->GetID(), wxStripMenuCodes(pCmd->GetCaption()), Bitmap, wxBitmap(), (wxItemKind)enumGISCommandNormal, pCmd->GetTooltip(), pCmd->GetMessage(), NULL); SetToolDropDown(pCmd->GetID(), true); } break; case enumGISCommandControl: { IToolControl* pToolCtrl = dynamic_cast<IToolControl*>(pCmd); if(pToolCtrl) { IToolBarControl* pToolBarControl = pToolCtrl->GetControl(); wxControl* pControl = dynamic_cast<wxControl*>(pToolBarControl); if(pControl) { if(pToolCtrl->HasToolLabel()) { wxString sToolLabel = pToolCtrl->GetToolLabel(); AddLabel(wxID_ANY, sToolLabel, sToolLabel.Len() * 5); } pControl->Reparent(this); AddControl(pControl); //add ctrl to remove map m_RemControlMap[m_CommandArray.size()] = pToolBarControl; } else return; } else return; } break; default: return; } wxGISCommandBar::AddCommand(pCmd); Realize();}
开发者ID:Mileslee,项目名称:wxgis,代码行数:57,
示例4: wxStripMenuCodes// Find the menu menuString, item itemString, and return the item id.// Returns -1 if none found.int wxMenuBar::FindMenuItem(const wxString& menuString, const wxString& itemString) const{ const wxString stripped = wxStripMenuCodes(menuString); size_t menuCount = GetMenuCount(); for (size_t i = 0; i < menuCount; i++) { if ( wxStripMenuCodes(m_titles[i]) == stripped ) return m_menus.Item(i)->GetData()->FindItem (itemString); } return wxNOT_FOUND;}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:14,
示例5: wxStripMenuCodes// Find the itemString in menuString, and return the item id or wxNOT_FOUNDint wxMenuBar::FindMenuItem(const wxString& menuString, const wxString& itemString) const{ wxString menuLabel = wxStripMenuCodes(menuString); size_t count = GetMenuCount(); for ( size_t i = 0; i < count; i++ ) { wxString title = wxStripMenuCodes(m_titles[i]); if ( menuLabel == title ) return _wxMenuAt(m_menus, i)->FindItem(itemString); } return wxNOT_FOUND;}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:15,
示例6: MacPreControlCreatebool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], int majorDim, long style, const wxValidator& val, const wxString& name){ if ( !wxControl::Create(parent, id, pos, size, style, val, name) ) return false; int i; m_noItems = n; m_noRowsOrCols = majorDim; m_radioButtonCycle = NULL; if (majorDim==0) m_majorDim = n ; else m_majorDim = majorDim ; Rect bounds ; Str255 title ; MacPreControlCreate( parent , id , wxStripMenuCodes(label) , pos , size ,style, val , name , &bounds , title ) ; m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, kControlGroupBoxTextTitleProc , (long) this ) ; for (i = 0; i < n; i++) { wxRadioButton *radBtn = new wxRadioButton ( this, wxID_ANY, wxStripMenuCodes(choices[i]), wxPoint(5,20*i+10), wxDefaultSize, i == 0 ? wxRB_GROUP : 0 ); if ( i == 0 ) m_radioButtonCycle = radBtn ; // m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle); } SetSelection(0); MacPostControlCreate() ; return true;}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:49,
示例7: wxFindMnemonicvoid wxMenuItem::SetItemLabel(const wxString& label){ char mnem = wxFindMnemonic (label); wxString label2 = wxStripMenuCodes(label); m_text = label; if (m_buttonWidget) { wxXmString label_str(label2); XtVaSetValues ((Widget) m_buttonWidget, XmNlabelString, label_str(), NULL); if (mnem != 0) XtVaSetValues ((Widget) m_buttonWidget, XmNmnemonic, mnem, NULL); char *accel = wxFindAccelerator (label2); if (accel) XtVaSetValues ((Widget) m_buttonWidget, XmNaccelerator, accel, NULL); XmString accel_str = wxFindAcceleratorText (label2); if (accel_str) { XtVaSetValues ((Widget) m_buttonWidget, XmNacceleratorText, accel_str, NULL); XmStringFree (accel_str); } }}
开发者ID:chromylei,项目名称:third_party,代码行数:27,
示例8: GetCountwxSize wxRadioBox::GetMaxButtonSize() const{ // calculate the max button size int widthMax = 0, heightMax = 0; const int count = GetCount(); for ( int i = 0 ; i < count; i++ ) { int width, height; if ( m_radioWidth[i] < 0 ) { GetTextExtent(wxStripMenuCodes(wxGetWindowText((*m_radioButtons)[i])), &width, &height); // adjust the size to take into account the radio box itself // FIXME this is totally bogus! width += RADIO_SIZE; height *= 3; height /= 2; } else { width = m_radioWidth[i]; height = m_radioHeight[i]; } if ( widthMax < width ) widthMax = width; if ( heightMax < height ) heightMax = height; } return wxSize(widthMax, heightMax);}
开发者ID:Duion,项目名称:Torsion,代码行数:33,
示例9: wxCHECK_MSGwxString wxMenuBar::GetLabelTop(size_t pos) const{ wxCHECK_MSG( pos < GetMenuCount(), wxEmptyString, wxT("invalid menu index in wxMenuBar::GetLabelTop") ); return wxStripMenuCodes(m_titles[pos]);}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:7,
示例10: wxStripMenuCodesbool wxStaticText::Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxString& name){ m_macIsUserPane = FALSE ; m_label = wxStripMenuCodes(label) ; if ( !wxControl::Create( parent, id, pos, size, style, wxDefaultValidator , name ) ) { return false; } Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; wxMacCFStringHolder str(m_label,m_font.GetEncoding() ) ; m_peer = new wxMacControl(this) ; verify_noerr(CreateStaticTextControl(MAC_WXHWND(parent->MacGetTopLevelWindowRef()),&bounds, str , NULL , m_peer->GetControlRefAddr() ) ) ; MacPostControlCreate(pos,size) ; return true;}
开发者ID:gitrider,项目名称:wxsj2,代码行数:27,
示例11: wxGetWindowTextwxSize wxToggleButton::DoGetBestSize() const{ wxString label = wxGetWindowText(GetHWND()); int wBtn; GetTextExtent(wxStripMenuCodes(label), &wBtn, NULL); int wChar, hChar; wxGetCharSize(GetHWND(), &wChar, &hChar, GetFont()); // add a margin - the button is wider than just its label wBtn += 3*wChar; // the button height is proportional to the height of the font used int hBtn = BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hChar);#if wxUSE_BUTTON wxSize sz = wxButton::GetDefaultSize(); if (wBtn > sz.x) sz.x = wBtn; if (hBtn > sz.y) sz.y = hBtn;#else wxSize sz(wBtn, hBtn);#endif CacheBestSize(sz); return sz;}
开发者ID:Duion,项目名称:Torsion,代码行数:28,
示例12: GetFontToUsebool wxOwnerDrawnBase::OnMeasureItem(size_t *width, size_t *height){ if ( IsOwnerDrawn() ) { wxMemoryDC dc; wxFont font; GetFontToUse(font); dc.SetFont(font); // item name/text without mnemonics wxString name = wxStripMenuCodes(GetName(), wxStrip_Mnemonics); wxCoord w, h; dc.GetTextExtent(name, &w, &h); *width = w + m_margin; *height = h; } else { *width = 0; *height = 0; } return true;}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:26,
示例13: wxCHECK_MSGbool wxMenuBar::Append(wxMenu *menu, const wxString& title){ WXHMENU submenu = menu ? menu->GetHMenu() : 0; wxCHECK_MSG( submenu, false, wxT("can't append invalid menu to menubar") ); if ( !wxMenuBarBase::Append(menu, title) ) return false; menu->wxMenuBase::SetTitle(title);#if defined(WINCE_WITHOUT_COMMANDBAR) if (IsAttached())#else if (GetHmenu())#endif {#if defined(WINCE_WITHOUT_COMMANDBAR) if (!GetToolBar()) return false; TBBUTTON tbButton; memset(&tbButton, 0, sizeof(TBBUTTON)); tbButton.iBitmap = I_IMAGENONE; tbButton.fsState = TBSTATE_ENABLED; tbButton.fsStyle = TBSTYLE_DROPDOWN | TBSTYLE_NO_DROPDOWN_ARROW | TBSTYLE_AUTOSIZE; size_t pos = GetMenuCount(); HMENU hPopupMenu = (HMENU) menu->GetHMenu() ; tbButton.dwData = (DWORD)hPopupMenu; wxString label = wxStripMenuCodes(title); tbButton.iString = (int) label.wx_str(); tbButton.idCommand = NewControlId(); if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_INSERTBUTTON, pos, (LPARAM)&tbButton)) { wxLogLastError(wxT("TB_INSERTBUTTON")); return false; }#else if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING, (UINT_PTR)submenu, title.wx_str()) ) { wxLogLastError(wxT("AppendMenu")); }#endif#if wxUSE_ACCEL if ( menu->HasAccels() ) { // need to rebuild accelerator table RebuildAccelTable(); }#endif // wxUSE_ACCEL if (IsAttached()) Refresh(); } return true;}
开发者ID:Zombiebest,项目名称:Dolphin,代码行数:59,
示例14: wxStripMenuCodes//// Find the itemString in menuString, and return the item id or wxNOT_FOUND//int wxMenuBar::FindMenuItem( const wxString& rMenuString, const wxString& rItemString) const{ wxString sMenuLabel = wxStripMenuCodes(rMenuString); size_t nCount = GetMenuCount(), i; wxMenuList::const_iterator it; for (i = 0, it = m_menus.begin(); i < nCount; i++, it++) { wxString sTitle = wxStripMenuCodes(m_titles[i]); if (rMenuString == sTitle) return (*it)->FindItem(rItemString); } return wxNOT_FOUND;} // end of wxMenuBar::FindMenuItem
开发者ID:chromylei,项目名称:third_party,代码行数:20,
示例15: wxMacGetBoundsForControlbool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], int majorDim, long style, const wxValidator& val, const wxString& name){ m_macIsUserPane = false ; if ( !wxControl::Create(parent, id, pos, size, style, val, name) ) return false; int i; m_noItems = n; m_noRowsOrCols = majorDim; m_radioButtonCycle = NULL; if (majorDim==0) m_majorDim = n ; else m_majorDim = majorDim ; m_label = label ; Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; if( bounds.right <= bounds.left ) bounds.right = bounds.left + 100 ; if ( bounds.bottom <= bounds.top ) bounds.bottom = bounds.top + 100 ; m_peer = new wxMacControl(this) ; verify_noerr(CreateGroupBoxControl(MAC_WXHWND(parent->MacGetTopLevelWindowRef()),&bounds, CFSTR("") , true /*primary*/ , m_peer->GetControlRefAddr() ) ) ; for (i = 0; i < n; i++) { wxRadioButton *radBtn = new wxRadioButton ( this, wxID_ANY, wxStripMenuCodes(choices[i]), wxPoint(5,20*i+10), wxDefaultSize, i == 0 ? wxRB_GROUP : 0 ); if ( i == 0 ) m_radioButtonCycle = radBtn ; // m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle); } SetSelection(0); MacPostControlCreate(pos,size) ; return true;}
开发者ID:Duion,项目名称:Torsion,代码行数:57,
示例16: UMANewMenuMenuRef UMANewMenu( SInt16 id , const wxString& title , wxFontEncoding encoding ){ wxString str = wxStripMenuCodes( title ) ; MenuRef menu ; CreateNewMenu( id , 0 , &menu ) ; SetMenuTitleWithCFString( menu , wxCFStringRef(str , encoding ) ) ; return menu ;}
开发者ID:beanhome,项目名称:dev,代码行数:10,
示例17: wxStripMenuCodesvoid wxControl::SetLabel(const wxString& title){ m_label = wxStripMenuCodes(title) ; if ( m_macControl ) { UMASetControlTitle( (ControlHandle) m_macControl , m_label , m_font.GetEncoding() ) ; } Refresh() ;}
开发者ID:Duion,项目名称:Torsion,代码行数:10,
示例18: wxCHECK_MSGbool wxNotebook::SetPageText(size_t nPage, const wxString& strText){ wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("SetPageText: invalid notebook page") ); wxNotebookPage *page = m_pages[nPage]; page->SetLabel(wxStripMenuCodes(strText)); MacSetupTabs(); return true;}
开发者ID:cwalther,项目名称:wxWidgets,代码行数:10,
示例19: PreCreation// Create menubarbool wxMenuBar::CreateMenuBar(wxFrame* parent){ m_parent = parent; // bleach... override it! PreCreation(); m_parent = NULL; if (m_mainWidget) { XtVaSetValues((Widget) parent->GetMainWidget(), XmNmenuBar, (Widget) m_mainWidget, NULL); /* if (!XtIsManaged((Widget) m_mainWidget)) XtManageChild((Widget) m_mainWidget); */ XtMapWidget((Widget) m_mainWidget); return true; } Widget menuBarW = XmCreateMenuBar ((Widget) parent->GetMainWidget(), wxMOTIF_STR("MenuBar"), NULL, 0); m_mainWidget = (WXWidget) menuBarW; size_t menuCount = GetMenuCount(); for (size_t i = 0; i < menuCount; i++) { wxMenu *menu = GetMenu(i); wxString title(m_titles[i]); menu->SetButtonWidget(menu->CreateMenu (this, menuBarW, menu, i, title, true)); if (strcmp (wxStripMenuCodes(title), "Help") == 0) XtVaSetValues ((Widget) menuBarW, XmNmenuHelpWidget, (Widget) menu->GetButtonWidget(), NULL); // tear off menu support#if (XmVersion >= 1002) if ( menu->IsTearOff() ) { XtVaSetValues(GetWidget(menu), XmNtearOffModel, XmTEAR_OFF_ENABLED, NULL); Widget tearOff = XmGetTearOffControl(GetWidget(menu)); wxDoChangeForegroundColour((Widget) tearOff, m_foregroundColour); wxDoChangeBackgroundColour((Widget) tearOff, m_backgroundColour, true); }#endif } PostCreation(); XtVaSetValues((Widget) parent->GetMainWidget(), XmNmenuBar, (Widget) m_mainWidget, NULL); XtRealizeWidget ((Widget) menuBarW); XtManageChild ((Widget) menuBarW); SetMenuBarFrame(parent); return true;}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:55,
示例20: UMASetMenuItemTextvoid UMASetMenuItemText( MenuRef menu, MenuItemIndex item, const wxString& title , wxFontEncoding encoding){ wxString str = wxStripMenuCodes( title ) ;#if TARGET_CARBON SetMenuItemTextWithCFString( menu , item , wxMacCFStringHolder(str , encoding) ) ;#else Str255 ptitle ; wxMacStringToPascal( str , ptitle ) ; SetMenuItemText( menu , item , ptitle ) ;#endif}
开发者ID:gitrider,项目名称:wxsj2,代码行数:11,
示例21: wxASSERT_MSG// same as AddPage() but does it at given positionbool wxNotebook::InsertPage(size_t nPage, wxNotebookPage *pPage, const wxString& strText, bool bSelect, int imageId ){ if ( !wxNotebookBase::InsertPage( nPage, pPage, strText, bSelect, imageId ) ) return false; wxASSERT_MSG( pPage->GetParent() == this, wxT("notebook pages must have notebook as parent") ); // don't show pages by default (we'll need to adjust their size first) pPage->Show( false ) ; pPage->SetLabel( wxStripMenuCodes(strText) ); m_images.Insert( imageId, nPage ); MacSetupTabs(); wxRect rect = GetPageRect() ; pPage->SetSize( rect ); if ( pPage->GetAutoLayout() ) pPage->Layout(); // now deal with the selection // --------------------------- // if the inserted page is before the selected one, we must update the // index of the selected page if ( int(nPage) <= m_nSelection ) { m_nSelection++; // while this still is the same page showing, we need to update the tabs m_peer->SetValue( m_nSelection + 1 ) ; } // some page should be selected: either this one or the first one if there // is still no selection int selNew = -1; if ( bSelect ) selNew = nPage; else if ( m_nSelection == -1 ) selNew = 0; if ( selNew != -1 ) SetSelection( selNew ); InvalidateBestSize(); return true;}
开发者ID:jonntd,项目名称:dynamica,代码行数:55,
示例22: CPPUNIT_ASSERTvoid MenuTestCase::TranslatedMnemonics(){ // Check that appended mnemonics are correctly stripped; // see https://trac.wxwidgets.org/ticket/16736 wxTranslations trans; trans.SetLanguage(wxLANGUAGE_JAPANESE); wxFileTranslationsLoader::AddCatalogLookupPathPrefix("./intl"); CPPUNIT_ASSERT( trans.AddCatalog("internat") ); // Check the translation is being used: CPPUNIT_ASSERT( wxString("&File") != GetTranslatedString(trans, "&File") ); wxString filemenu = m_frame->GetMenuBar()->GetMenuLabel(0); CPPUNIT_ASSERT_EQUAL ( wxStripMenuCodes(GetTranslatedString(trans, "&File")), wxStripMenuCodes(GetTranslatedString(trans, filemenu)) ); // Test strings that have shortcuts. Duplicate non-mnemonic translations // exist for both "Edit" and "View", for ease of comparison CPPUNIT_ASSERT_EQUAL ( GetTranslatedString(trans, "Edit"), wxStripMenuCodes(GetTranslatedString(trans, "E&dit/tCtrl+E")) ); // "Vie&w" also has a space before the (&W) CPPUNIT_ASSERT_EQUAL ( GetTranslatedString(trans, "View"), wxStripMenuCodes(GetTranslatedString(trans, "Vie&w/tCtrl+V")) ); // Test a 'normal' mnemonic too: the translation is "Preten&d" CPPUNIT_ASSERT_EQUAL ( "Pretend", wxStripMenuCodes(GetTranslatedString(trans, "B&ogus")) );}
开发者ID:jfiguinha,项目名称:Regards,代码行数:41,
示例23: wxTvoid MacroCommandDialog::PopulateOrExchange(ShuttleGui &S){ S.StartVerticalLay(true); { S.StartMultiColumn(4, wxEXPAND); { S.SetStretchyCol(1); mCommand = S.AddTextBox(_("&Command"), wxT(""), 20); mCommand->SetEditable(false); mEditParams = S.Id(EditParamsButtonID).AddButton(_("&Edit Parameters")); mEditParams->Enable(false); // disable button as box is empty mUsePreset = S.Id(UsePresetButtonID).AddButton(_("&Use Preset")); mUsePreset->Enable(false); // disable button as box is empty } S.EndMultiColumn(); S.StartMultiColumn(2, wxEXPAND); { S.SetStretchyCol(1); mParameters = S.AddTextBox(_("&Parameters"), wxT(""), 0); mParameters->SetEditable(false); wxString prompt{_("&Details")}; S.Prop(0).AddPrompt(prompt); mDetails = S.AddTextWindow( wxT("")); mDetails->SetEditable(false); mDetails->SetName(wxStripMenuCodes(prompt)); } S.EndMultiColumn(); S.Prop(10).StartStatic(_("Choose command"), true); { S.SetStyle(wxSUNKEN_BORDER | wxLC_LIST | wxLC_SINGLE_SEL); mChoices = S.Id(CommandsListID).AddListControl(); } S.EndStatic(); } S.EndVerticalLay(); S.AddStandardButtons( eOkButton | eCancelButton | eHelpButton); PopulateCommandList(); if (mChoices->GetItemCount() > 0) { // set first item to be selected (and the focus when the // list first becomes the focus) mChoices->SetItemState(0, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED); } SetMinSize(wxSize(780, 560)); Fit(); Center();}
开发者ID:SteveDaulton,项目名称:audacity,代码行数:52,
示例24: strvoid wxMenuBar::GtkAppend(wxMenu* menu, const wxString& title, int pos){ menu->SetLayoutDirection(GetLayoutDirection());#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2 // if the menu has only one item, append it directly to the top level menu // instead of inserting a useless submenu if ( menu->GetMenuItemCount() == 1 ) { wxMenuItem * const item = menu->FindItemByPosition(0); // remove both mnemonics and accelerator: neither is useful under Maemo const wxString str(wxStripMenuCodes(item->GetItemLabel())); if ( item->IsSubMenu() ) { GtkAppend(item->GetSubMenu(), str, pos); return; } menu->m_owner = gtk_menu_item_new_with_mnemonic( wxGTK_CONV( str ) ); g_signal_connect(menu->m_owner, "activate", G_CALLBACK(menuitem_activate), item); item->SetMenuItem(menu->m_owner); } else#endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2 /!wxUSE_LIBHILDON && !wxUSE_LIBHILDON2 { const wxString str(wxConvertMnemonicsToGTK(title)); // This doesn't have much effect right now. menu->SetTitle( str ); // The "m_owner" is the "menu item" menu->m_owner = gtk_menu_item_new_with_mnemonic( wxGTK_CONV( str ) ); gtk_menu_item_set_submenu( GTK_MENU_ITEM(menu->m_owner), menu->m_menu ); } g_object_ref(menu->m_owner); gtk_widget_show( menu->m_owner ); if (pos == -1) gtk_menu_shell_append( GTK_MENU_SHELL(m_menubar), menu->m_owner ); else gtk_menu_shell_insert( GTK_MENU_SHELL(m_menubar), menu->m_owner, pos ); if ( m_menuBarFrame ) AttachToFrame( menu, m_menuBarFrame );}
开发者ID:mael15,项目名称:wxWidgets,代码行数:51,
示例25: UMANewMenuMenuRef UMANewMenu( SInt16 id , const wxString& title , wxFontEncoding encoding ){ wxString str = wxStripMenuCodes( title ) ; MenuRef menu ;#if TARGET_CARBON CreateNewMenu( id , 0 , &menu ) ; SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str , encoding ) ) ;#else Str255 ptitle ; wxMacStringToPascal( str , ptitle ) ; menu = ::NewMenu( id , ptitle ) ;#endif return menu ;}
开发者ID:gitrider,项目名称:wxsj2,代码行数:14,
注:本文中的wxStripMenuCodes函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ wxStrlcpy函数代码示例 C++ wxStringTokenize函数代码示例 |