本文整理汇总了C++中ListBox::setItemsTextLayout方法的典型用法代码示例。如果您正苦于以下问题:C++ ListBox::setItemsTextLayout方法的具体用法?C++ ListBox::setItemsTextLayout怎么用?C++ ListBox::setItemsTextLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListBox
的用法示例。
在下文中一共展示了ListBox::setItemsTextLayout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initGUI
void ExplosionGenerator::initGUI()
{
Control::init("", 25, SCREEN_WIDTH, SCREEN_HEIGHT);
int X_OFFSET = 600;
int SLIDER_HEIGHT = 35;
int BUTTON_WIDTH = 200;
int BUTTON_HEIGHT = 30;
Control* temp;
temp = new Label("GAME OF LIFE",
X_OFFSET, 0,
BUTTON_WIDTH, 120,
BLACK);
temp->setFont(50, WHITE);
temp->setTextLayout(true, CENTER, CENTER);
m_gui.addGUIComponent(temp);
string golDescription = "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.";
temp = new Label(golDescription,
X_OFFSET, 120,
BUTTON_WIDTH, 100,
BLACK);
temp->setFont(15, WHITE);
temp->setTextLayout(true, CENTER, TOP_ALIGNED);
m_gui.addGUIComponent(temp);
ListBox* lb = new ListBox("", X_OFFSET, 220,
200, 400,
WHITE, BLACK, 2,
std::bind(&ExplosionGenerator::GOLModelListBoxCB, this));
lb->setItemFont(14, GREEN);
lb->setContent(m_GOLModelManager.getModels());
lb->setItemsTextLayout(CENTER, CENTER);
m_gui.addGUIComponent(lb);
temp = new Button("Start", X_OFFSET, 535,
BUTTON_WIDTH, BUTTON_HEIGHT,
GRAY, BLACK, DARK_BLUE,
std::bind(&ExplosionGenerator::startCB, this));
temp->setFont(25, GREEN);
temp->setTextLayout(false, CENTER, CENTER);
m_gui.addGUIComponent(temp);
temp = new Button("Reset", X_OFFSET, 570,
BUTTON_WIDTH, BUTTON_HEIGHT,
GRAY, BLACK, DARK_BLUE,
std::bind(&ExplosionGenerator::resetGameBoardCB, this));
temp->setFont(25, GREEN);
temp->setTextLayout(false, CENTER, CENTER);
m_gui.addGUIComponent(temp);
/*
temp = new Label("ABCDL_gyp", 0, 100,
SCREEN_WIDTH, 25,
LIGHT_GRAY);
temp->setFont(25, BLACK);
temp->setTextLayout(false, CENTER, CENTER);
m_gui.addGUIComponent(temp);
temp = new Label("ABCDL_gyp", 0, 140,
SCREEN_WIDTH, 35,
LIGHT_GRAY);
temp->setFont(35, BLACK);
temp->setTextLayout(false, CENTER, CENTER);
m_gui.addGUIComponent(temp);
temp = new Label("ABCDL_gyp", 0, 180,
SCREEN_WIDTH, 50,
LIGHT_GRAY);
temp->setFont(50, BLACK);
temp->setTextLayout(false, CENTER, CENTER);
m_gui.addGUIComponent(temp);
*/
}