本文整理汇总了C++中TextButton::SetText方法的典型用法代码示例。如果您正苦于以下问题:C++ TextButton::SetText方法的具体用法?C++ TextButton::SetText怎么用?C++ TextButton::SetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextButton
的用法示例。
在下文中一共展示了TextButton::SetText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RefreshPopup
// Refresh the list of files or macros in the Files popup window
void FileSet::RefreshPopup()
{
if (which >= 0)
{
FileListIndex& fileIndex = fileIndices[which];
// 1. Sort the file list
fileIndex.sort(StringGreaterThan);
// 2. Make sure the scroll position is still sensible
if (scrollOffset < 0)
{
scrollOffset = 0;
}
else if ((unsigned int)scrollOffset >= fileIndex.size())
{
scrollOffset = ((fileIndex.size() - 1)/numFileRows) * numFileRows;
}
// 3. Display the scroll buttons if needed
mgr.Show(scrollFilesLeftButton, scrollOffset != 0);
mgr.Show(scrollFilesRightButton, scrollOffset + (numFileRows * numFileColumns) < fileIndex.size());
mgr.Show(filesUpButton, IsInSubdir());
// 4. Display the file list
for (size_t i = 0; i < numDisplayedFiles; ++i)
{
TextButton *f = filenameButtons[i];
if (i + scrollOffset < fileIndex.size())
{
const char *text = fileIndex[i + scrollOffset];
f->SetText(text);
f->SetEvent(fileEvent, text);
mgr.Show(f, true);
}
else
{
f->SetText("");
mgr.Show(f, false);
}
}
displayedFileSet = this;
}
else
{
mgr.Show(scrollFilesLeftButton, false);
mgr.Show(scrollFilesRightButton, false);
for (size_t i = 0; i < numDisplayedFiles; ++i)
{
mgr.Show(filenameButtons[i], false);
}
}
}
示例2: Create
TextButton* TextButton::Create(Window *parent, float x, float y, const string_t &text, const char *font)
{
TextButton *res = new TextButton(parent);
res->Move(x, y);
res->SetText(text);
res->SetFont(font);
return res;
}
示例3: main
int main()
{
Label label;
label.SetText( "This is a label" );
Button button;
button.SetDimensions( 10, 5 );
TextButton textButton;
textButton.SetText( "Click Me" );
textButton.SetDimensions( 10, 5 );
cout << endl << endl << "LABEL" << endl;
label.Draw();
cout << endl << endl << "BUTTON" << endl;
button.Draw();
cout << endl << endl << "TEXT BUTTON" << endl;
textButton.Draw();
return 0;
}