本文整理汇总了C++中ListBox::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ ListBox::Clear方法的具体用法?C++ ListBox::Clear怎么用?C++ ListBox::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListBox
的用法示例。
在下文中一共展示了ListBox::Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleMenu
void HandleMenu(HWND hWnd, DWORD opt) {
switch(opt) {
case ID_SCALE_CONNECT:
cEditBox.SetText("Trying to communicate with the scale...");
mScale.EditItem(ID_SCALE_CONNECT, "&Connecting...", MF_DISABLED);
_beginthread(ScaleConnect, 0, (void*) hWnd);
break;
case ID_FILE_NEW:
if (!bSaved && vMealItems.size() > 0) {
switch(MessageBox(hWnd, "You haven't saved the current meal, would you like to?","Hold Up!", MB_YESNOCANCEL | MB_ICONINFORMATION)) {
case IDYES:
if (CheckAndSave()==-1) break;
case IDNO:
cListBox.Clear();
vMealItems.clear();
strcpy(cSaveName, "");
cWindow.SetTitle("MealTrack - Untitled");
cButton.SetText("Start Meal");
break;
case IDCANCEL:
default:
break;
}
} else {
cListBox.Clear();
vMealItems.clear();
strcpy(cSaveName, "");
cWindow.SetTitle("MealTrack - Untitled");
cButton.SetText("Start Meal");
}
break;
case ID_FILE_SAVE:
GetSaveFile(hWnd);
if (vMealItems.size() >= 1) CheckAndSave();
char tmp[313];
sprintf(tmp, "MealTrack - %s", strrchr(cSaveName,'\\') + 1);
cWindow.SetTitle(tmp);
break;
case ID_FILE_EXIT:
PostMessage(hWnd, WM_CLOSE, 0, 0);
break;
case ID_SCALE_ZERO:
if (scale != NULL) scale->Zero();
break;
}
}
示例2: Begin
void UfopaediaCategory::Begin()
{
Label* infolabel = ((Label*)menuform->FindControl("TEXT_INFO"));
ListBox* entrylist = ((ListBox*)menuform->FindControl("LISTBOX_SHORTCUTS"));
entrylist->Clear();
entrylist->ItemHeight = infolabel->GetFont()->GetFontHeight() + 2;
int idx = 1;
for( auto entry = Entries.begin(); entry != Entries.end(); entry++ )
{
std::shared_ptr<UfopaediaEntry> e = (std::shared_ptr<UfopaediaEntry>)*entry;
TextButton* tb = new TextButton( fw, nullptr, fw.gamecore->GetString(e->Title), infolabel->GetFont() );
tb->Name = "Index" + Strings::FromInteger( idx );
tb->RenderStyle = TextButton::TextButtonRenderStyles::SolidButtonStyle;
tb->TextHAlign = HorizontalAlignment::Left;
tb->TextVAlign = VerticalAlignment::Centre;
tb->BackgroundColour.a = 0;
entrylist->AddItem( tb );
idx++;
}
SetupForm();
SetTopic( 0 );
}