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


C++ ListBox::setItemFont方法代码示例

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


在下文中一共展示了ListBox::setItemFont方法的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);
    */
}
开发者ID:maestro92,项目名称:GameOfLife,代码行数:85,代码来源:main.cpp


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