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


C++ GuiControl::setEnabled方法代码示例

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


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

示例1: buttonSize

DeveloperWindow::DeveloperWindow
(GApp*                                      app,
 const shared_ptr<FirstPersonManipulator>&   manualManipulator,
 const shared_ptr<UprightSplineManipulator>& trackManipulator,
 const Pointer< shared_ptr<Manipulator> >&   cameraManipulator,
 const shared_ptr<Camera>&                  debugCamera,
 const shared_ptr<Scene>&                   scene,
 const shared_ptr<Film>&                    film,
 const shared_ptr<GuiTheme>&                theme,
 const shared_ptr<GConsole>&                console,
 const Pointer<bool>&                       debugVisible,
 bool*                                      showStats,
 bool*                                      showText,
 const std::string&                         screenshotPrefix) :
    GuiWindow("Developer (F11)", theme, Rect2D::xywh(600, 80, 0, 0), GuiTheme::TOOL_WINDOW_STYLE, HIDE_ON_CLOSE), consoleWindow(console) {

    alwaysAssertM(this != NULL, "Memory corruption");
    alwaysAssertM(notNull(debugCamera), "NULL camera");

    cameraControlWindow = CameraControlWindow::create(manualManipulator, trackManipulator, cameraManipulator,
                          debugCamera, film, theme);

    cameraControlWindow->moveTo(Point2(app->window()->width() - cameraControlWindow->rect().width(), 0));

    videoRecordDialog = VideoRecordDialog::create(theme, screenshotPrefix, app);

    profilerWindow = ProfilerWindow::create(theme);
    app->addWidget(profilerWindow);
    profilerWindow->setVisible(false);

    if (notNull(scene)) {
        sceneEditorWindow = SceneEditorWindow::create(app, scene, theme);
        sceneEditorWindow->moveTo(cameraControlWindow->rect().x0y1() + Vector2(0, 15));
    }

    // For texture windows
    m_app      = app;
    m_theme    = theme;

    GuiPane* root = pane();

    const float iconSize = 32;
    Vector2 buttonSize(iconSize, iconSize);

    shared_ptr<IconSet> iconSet = IconSet::fromFile(System::findDataFile("icon/tango.icn"));
    GuiText cameraIcon(iconSet->get("22x22/devices/camera-photo.png"));
    GuiText movieIcon(iconSet->get("22x22/categories/applications-multimedia.png"));
    GuiText consoleIcon(iconSet->get("22x22/apps/utilities-terminal.png"));
    GuiText statsIcon(iconSet->get("22x22/apps/utilities-system-monitor.png"));
    GuiText debugIcon(iconSet->get("22x22/categories/preferences-desktop.png"));
    GuiText sceneIcon(iconSet->get("22x22/categories/preferences-system.png"));
    GuiText textIcon(iconSet->get("22x22/mimetypes/text-x-generic.png"));
    GuiText textureBrowserIcon(iconSet->get("22x22/actions/window-new.png"));
    GuiText profilerIcon(iconSet->get("22x22/actions/appointment-new.png"));

    Pointer<bool> ptr = Pointer<bool>((shared_ptr<GuiWindow>)cameraControlWindow, &GuiWindow::visible, &GuiWindow::setVisible);
    GuiControl* cameraButton = root->addCheckBox(cameraIcon, ptr, GuiTheme::TOOL_CHECK_BOX_STYLE);
    cameraButton->setSize(buttonSize);
    cameraButton->setPosition(0, 0);

    Pointer<bool> ptr2 = Pointer<bool>((shared_ptr<GuiWindow>)videoRecordDialog, &GuiWindow::visible, &GuiWindow::setVisible);
    GuiControl* movieButton = root->addCheckBox(movieIcon, ptr2, GuiTheme::TOOL_CHECK_BOX_STYLE);
    movieButton->setSize(buttonSize);

    static bool ignore = false;
    if (notNull(scene)) {
        Pointer<bool> ptr3 = Pointer<bool>((shared_ptr<GuiWindow>)sceneEditorWindow, &GuiWindow::visible, &GuiWindow::setVisible);
        GuiControl* sceneButton = root->addCheckBox(sceneIcon, ptr3, GuiTheme::TOOL_CHECK_BOX_STYLE);
        sceneButton->setSize(buttonSize);
    } else {
        GuiControl* sceneButton = root->addCheckBox(sceneIcon, &ignore, GuiTheme::TOOL_CHECK_BOX_STYLE);
        sceneButton->setSize(buttonSize);
        sceneButton->setEnabled(false);
    }

    Pointer<bool> profilePtr = Pointer<bool>((shared_ptr<GuiWindow>)profilerWindow, &GuiWindow::visible, &GuiWindow::setVisible);
    GuiControl* profilerButton = root->addCheckBox(profilerIcon, profilePtr, GuiTheme::TOOL_CHECK_BOX_STYLE);
    profilerButton->setSize(buttonSize);

    GuiControl* textureBrowserButton = root->addButton(textureBrowserIcon, this, &DeveloperWindow::makeNewTexturePane, GuiTheme::TOOL_BUTTON_STYLE);
    textureBrowserButton->setSize(buttonSize);

    GuiControl* consoleButton = root->addCheckBox(consoleIcon, Pointer<bool>(consoleWindow, &GConsole::active, &GConsole::setActive), GuiTheme::TOOL_CHECK_BOX_STYLE);
    consoleButton->setSize(buttonSize);

    GuiControl* debugButton = root->addCheckBox(debugIcon, debugVisible, GuiTheme::TOOL_CHECK_BOX_STYLE);
    debugButton->setSize(buttonSize);

    GuiControl* statsButton = root->addCheckBox(statsIcon, showStats, GuiTheme::TOOL_CHECK_BOX_STYLE);
    statsButton->setSize(buttonSize);

    GuiControl* printButton = root->addCheckBox(textIcon, showText, GuiTheme::TOOL_CHECK_BOX_STYLE);
    printButton->setSize(buttonSize);

    cameraControlWindow->setVisible(true);
    videoRecordDialog->setVisible(false);
    pack();

}
开发者ID:jackpoz,项目名称:G3D-backup,代码行数:99,代码来源:DeveloperWindow.cpp


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