当前位置: 首页>>代码示例>>C++>>正文


C++ wxMenu::AppendCheckItem方法代码示例

本文整理汇总了C++中wxMenu::AppendCheckItem方法的典型用法代码示例。如果您正苦于以下问题:C++ wxMenu::AppendCheckItem方法的具体用法?C++ wxMenu::AppendCheckItem怎么用?C++ wxMenu::AppendCheckItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxMenu的用法示例。


在下文中一共展示了wxMenu::AppendCheckItem方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createMenu

void ddColumnOptionIcon::createMenu(wxMenu &mnu)
{
	wxMenuItem *item;

	item = mnu.AppendCheckItem(MNU_COLNULL, _("NULL"));
	item->Check(colOption == null);
	item->Enable(!getOwnerColumn()->isGeneratedForeignKey());
	item = mnu.AppendCheckItem(MNU_COLNOTNULL, _("Not NULL"));
	item->Check(colOption == notnull);
	item->Enable(!getOwnerColumn()->isGeneratedForeignKey());
}
开发者ID:GHnubsST,项目名称:pgadmin3,代码行数:11,代码来源:ddColumnOptionIcon.cpp

示例2: createMenu

void ddTextTableItemFigure::createMenu(wxMenu &mnu)
{
	wxMenu *submenu;
	wxMenuItem *item;

	mnu.Append(MNU_DDADDCOLUMN, _("Add a column..."));
	item = mnu.Append(MNU_DELCOLUMN, _("Delete the selected column..."));
	if(getOwnerColumn()->isGeneratedForeignKey())
		item->Enable(false);
	mnu.Append(MNU_RENAMECOLUMN, _("Rename the selected column..."));
	if(getOwnerColumn()->isGeneratedForeignKey() && !getOwnerColumn()->isFkNameGenerated())
		mnu.Append(MNU_AUTONAMCOLUMN, _("Activate fk auto-naming..."));
	mnu.AppendSeparator();
	item = mnu.AppendCheckItem(MNU_NOTNULL, _("Not NULL constraint"));
	if(getOwnerColumn()->isNotNull())
		item->Check(true);
	if(getOwnerColumn()->isGeneratedForeignKey())
		item->Enable(false);
	mnu.AppendSeparator();
	item = mnu.AppendCheckItem(MNU_PKEY, _("Primary Key"));
	if(getOwnerColumn()->isPrimaryKey())
		item->Check(true);
	if(getOwnerColumn()->isGeneratedForeignKey())
		item->Enable(false);
	item = mnu.AppendCheckItem(MNU_UKEY, _("Unique Key"));
	if(getOwnerColumn()->isUniqueKey())
		item->Check(true);
	mnu.AppendSeparator();
	submenu = new wxMenu();
	item = mnu.AppendSubMenu(submenu, _("Column datatype"));
	if(getOwnerColumn()->isGeneratedForeignKey())
		item->Enable(false);
	item = submenu->AppendCheckItem(MNU_TYPESERIAL, _("serial"));
	item->Check(columnType == dt_bigint);
	item = submenu->AppendCheckItem(MNU_TYPEBOOLEAN, _("boolean"));
	item->Check(columnType == dt_boolean);
	item = submenu->AppendCheckItem(MNU_TYPEINTEGER, _("integer"));
	item->Check(columnType == dt_integer);
	item = submenu->AppendCheckItem(MNU_TYPEMONEY, _("money"));
	item->Check(columnType == dt_money);
	item = submenu->AppendCheckItem(MNU_TYPEVARCHAR, _("varchar(n)"));
	item->Check(columnType == dt_varchar);
	item = submenu->Append(MNU_TYPEOTHER, _("Choose another datatype..."));
	mnu.AppendSeparator();
	mnu.Append(MNU_TYPEPKEY_CONSTRAINTNAME, _("Primary Key Constraint name..."));
	mnu.Append(MNU_TYPEUKEY_CONSTRAINTNAME, _("Unique Key Constraint name..."));
	mnu.AppendSeparator();
	mnu.Append(MNU_DELTABLE, _("Delete table..."));
};
开发者ID:xiul,项目名称:pgadmin3,代码行数:49,代码来源:ddTextTableItemFigure.cpp

示例3: AppendAdditionalMenuItems

void CompilerMessages::AppendAdditionalMenuItems(wxMenu &menu)
{
    menu.Append(idMenuFit, _("Fit text"), _("Makes the whole text visible"));
    menu.AppendCheckItem(idMenuAutoFit, _("Fit automatically"),
                         _("Automatically makes the whole text visible during compilation"));
    menu.Check(idMenuAutoFit, m_autoFit);
}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:7,代码来源:compilermessages.cpp

示例4: AppendWindowMenuItems

void DebuggerMenuHandler::AppendWindowMenuItems(wxMenu &menu)
{
    std::map<wxString, long> sortedNames;

    for (WindowMenuItemsMap::iterator it = m_windowMenuItems.begin(); it != m_windowMenuItems.end(); ++it)
        sortedNames[it->second.name] = it->first;

    for (std::map<wxString, long>::iterator it = sortedNames.begin(); it != sortedNames.end(); ++it)
        menu.AppendCheckItem(it->second, it->first, m_windowMenuItems[it->second].help);
}
开发者ID:stahta01,项目名称:codeblocks_backup,代码行数:10,代码来源:debuggermenu.cpp

示例5: AddColumnsItems

void wxHeaderCtrlBase::AddColumnsItems(wxMenu& menu, int idColumnsBase)
{
    const unsigned count = GetColumnCount();
    for ( unsigned n = 0; n < count; n++ )
    {
        const wxHeaderColumn& col = GetColumn(n);
        menu.AppendCheckItem(idColumnsBase + n, col.GetTitle());
        if ( col.IsShown() )
            menu.Check(n, true);
    }
}
开发者ID:yinglang,项目名称:newton-dynamics,代码行数:11,代码来源:headerctrlcmn.cpp

示例6: PopulateMenu

void Scrubber::PopulateMenu(wxMenu &menu)
{
   int id = CMD_ID;
   auto cm = mProject->GetCommandManager();
   const MenuItem *checkedItem =
      HasStartedScrubbing()
         ? &FindMenuItem(mSmoothScrollingScrub, mAlwaysSeeking)
         : nullptr;
   for (const auto &item : menuItems) {
      if (cm->GetEnabled(item.name)) {
#ifdef CHECKABLE_SCRUB_MENU_ITEMS
         menu.AppendCheckItem(id, item.label);
         if(&item == checkedItem)
            menu.FindItem(id)->Check();
#else
         menu.Append(id, item.label);
#endif
      }
      ++id;
   }
}
开发者ID:MisterZeus,项目名称:audacity,代码行数:21,代码来源:Scrubbing.cpp

示例7: AddMenuItem

void AudioKaraoke::AddMenuItem(wxMenu &menu, std::string const& tag, wxString const& help, std::string const& selected) {
	wxMenuItem *item = menu.AppendCheckItem(-1, to_wx(tag), help);
	menu.Bind(wxEVT_COMMAND_MENU_SELECTED, std::bind(&AudioKaraoke::SetTagType, this, tag), item->GetId());
	item->Check(tag == selected);
}
开发者ID:liloneum,项目名称:Aegisub,代码行数:5,代码来源:audio_karaoke.cpp

示例8: createViewMenu

void hdDrawingView::createViewMenu(wxMenu &mnu)
{
    wxMenuItem *item;
    item = mnu.AppendCheckItem(1000, _("Sample Item"));
    item->Check(true);
}
开发者ID:dragansah,项目名称:pgadmin3,代码行数:6,代码来源:hdDrawingView.cpp

示例9: setTextPopUpList

//Hack to allow use (events) of wxmenu inside a tool like simpletexttool
void ddDrawingView::setTextPopUpList(wxArrayString &strings, wxMenu &mnu)
{
	//DD-TODO: choose a better id for event
	mnu.Disconnect(wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)(wxEventFunction) (wxCommandEventFunction) &ddDrawingView::OnTextPopupClick,NULL,this);
	int sz = strings.size();  //to avoid warning
	wxMenuItem *item = NULL;
	wxMenu *submenu = NULL;
	bool isSubItem;
	bool subItemsDisable=false;
	for(int i=0 ; i < sz ; i++){
			//DD-TODO: only create options for what I need, this can be improved later
			//String "--submenu##menu item**sub menu title" and "--subitem--" create and add items to last created submenu
			isSubItem=false;
			item=NULL;
			if(strings[i].Contains(wxT("--submenu"))) 
			{
				if(strings[i].Contains(wxT("--disable"))) 
					subItemsDisable=true;
				else
					subItemsDisable=false;
				submenu = new wxMenu(strings[i].SubString(strings[i].find(wxT("**"))+2,strings[i].length())); 
				mnu.AppendSubMenu(submenu,strings[i].SubString(strings[i].find(wxT("##"))+2,strings[i].find(wxT("**"))-1));
			}
			else if(strings[i].Contains(wxT("--subitem")))
			{
				isSubItem=true;
				if(submenu)
				{
					if(strings[i].Contains(wxT("--checked")))
					{
						item=submenu->AppendCheckItem(i,strings[i].SubString(strings[i].find(wxT("**"))+2,strings[i].length()));
					}
					else
					{
						item=submenu->Append(i,strings[i].SubString(strings[i].find(wxT("**"))+2,strings[i].length()));
					}
				}
				else
				{
					wxMessageDialog *error = new wxMessageDialog(NULL, wxT("Error setting text popup strings list"), wxT("Error!"), wxOK | wxICON_ERROR);
					error->ShowModal();
					delete error;
				}
			}
			else if(strings[i].Contains(wxT("--separator--")))
			{
				mnu.AppendSeparator();
			}
			else if(strings[i].Contains(wxT("--checked")))
			{
				item = mnu.AppendCheckItem(i, strings[i].SubString(strings[i].find(wxT("**"))+2,strings[i].length()));
			}
			else if(strings[i].Contains(wxT("**")))
			{
				item = mnu.Append(i, strings[i].SubString(strings[i].find(wxT("**"))+2,strings[i].length()));
			}
			else 
			{
				item = mnu.Append(i, strings[i]);
			}

			if(item && strings[i].Contains(wxT("--checked")))
			{
				item->Check(true);
			}
			if(   item &&  ( strings[i].Contains(wxT("--disable")) || (submenu && isSubItem && subItemsDisable) )   )
			{
				item->Enable(false);
			}

		}
//DD-TODO: create a better version of this hack
	mnu.Connect(wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)(wxEventFunction) (wxCommandEventFunction) &ddDrawingView::OnTextPopupClick,NULL,this);
}
开发者ID:xiul,项目名称:Database-Designer-for-pgAdmin,代码行数:75,代码来源:ddDrawingView.cpp


注:本文中的wxMenu::AppendCheckItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。