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


C++ CheckBox类代码示例

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


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

示例1: CheckBox

CheckBox* CheckBox::Create(Window *parent, float x, float y, const string_t &text)
{
	CheckBox *res = new CheckBox(parent);
	res->Move(x, y);
	res->SetText(text);
	return res;
}
开发者ID:Asqwel,项目名称:TZOD-Modified,代码行数:7,代码来源:Button.cpp

示例2: setupControls

//-----------------------------------------------------------------------------------
void Sample_Compositor::setupControls(void) 
{
	mTrayMgr->createButton(TL_TOPLEFT, "PageButton", "Compositors", 175);

	for (size_t i=0; i < COMPOSITORS_PER_PAGE; i++)
	{
		String checkBoxName = "Compositor_" + Ogre::StringConverter::toString(i);
		CheckBox* cb = mTrayMgr->createCheckBox(TL_TOPLEFT, checkBoxName, "Compositor", 175);
		cb->hide();
	}

	changePage(0);
	
	mDebugTextureSelectMenu = mTrayMgr->createThickSelectMenu(TL_TOPRIGHT, "DebugRTTSelectMenu", "Debug RTT", 180, 5);
	mDebugTextureSelectMenu->addItem("None");

	mTrayMgr->createSeparator(TL_TOPRIGHT, "DebugRTTSep1");  // this is a hack to give the debug RTT a bit more room

	DecorWidget* debugRTTPanel = mTrayMgr->createDecorWidget(TL_NONE, "DebugRTTPanel", "SdkTrays/Picture");
	OverlayContainer* debugRTTContainer = (OverlayContainer*)debugRTTPanel->getOverlayElement();
	mDebugTextureTUS = debugRTTContainer->getMaterial()->getBestTechnique()->getPass(0)->getTextureUnitState(0);
	//mDebugTextureTUS->setTextureName("CompositorDemo/DebugView");
	debugRTTContainer->setDimensions(128, 128);
	debugRTTContainer->getChild("DebugRTTPanel/PictureFrame")->setDimensions(144, 144);
	debugRTTPanel->hide();

	mTrayMgr->createSeparator(TL_TOPRIGHT, "DebugRTTSep2");  // this is a hack to give the debug RTT a bit more room

	mTrayMgr->showCursor();
	mTrayMgr->showLogo(TL_BOTTOMLEFT);
	mTrayMgr->toggleAdvancedFrameStats();
}
开发者ID:MrLobo,项目名称:El-Rayo-de-Zeus,代码行数:33,代码来源:Compositor.cpp

示例3: showEvent

void ProjectCreatePopup::showEvent(QShowEvent *) {
  int i;
  QString fldName;
  for (i = 0; i < m_folderFlds.size(); i++) {
    fldName = QString::fromStdString(m_folderFlds[i].first);
    m_folderFlds[i].second->setPath(fldName);
  }
  for (i = 0; i < m_useScenePathCbs.size(); i++) {
    CheckBox *cb                = m_useScenePathCbs[i].second;
    bool signalesAlreadyBlocked = cb->blockSignals(true);
    cb->setChecked(false);
    cb->blockSignals(signalesAlreadyBlocked);
  }

  m_nameFld->setText("");
  // Must refresh the tree.
  DvDirModelNode *rootNode = m_model->getNode(QModelIndex());
  QModelIndex index        = m_model->getIndexByNode(rootNode);
  m_model->refreshFolderChild(index);
  // Select the first Item in the treeView
  QItemSelectionModel *selection = new QItemSelectionModel(m_model);
  index                          = m_model->index(0, 0, QModelIndex());
  selection->select(index, QItemSelectionModel::Select);
  m_treeView->setSelectionModel(selection);
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:25,代码来源:projectpopup.cpp

示例4: file

void ZipViewer::show()
{
  ViewRender *renderer(m_view.renderer());
  renderer->doTitle(nds::File::base(m_view.document().uri().c_str()));
  ZipFile file(this);
  file.open(m_filename.c_str());

  vector<string> contents;
  file.list(contents);
  m_fileCount = contents.size();
  if (not contents.empty())
  {
    // add an "unzip" button!
    Button * unzipButton = new Button(T("unzip"));
    unzipButton->setListener(this);
    renderer->add(unzipButton);
    m_unzip = unzipButton;
    renderer->textArea()->appendText(T(" "));

    renderer->insertNewline();
  }

  for (vector<string>::const_iterator it(contents.begin()); it != contents.end(); ++it)
  {
    const string & u(*it);
    CheckBox * cb = new CheckBox;
    cb->setSelected();
    renderer->add(cb);
    m_checkboxes.push_back(cb);
    renderer->textArea()->appendText(u);
    renderer->insertNewline();
  }
}
开发者ID:deeice,项目名称:bunjalloo,代码行数:33,代码来源:ZipViewer.cpp

示例5: lprintfln

void SaveScreen::keyPressEvent(int keyCode, int nativeCode) {
#if DEBUG >= 1
	lprintfln("Index: %d (%d / %d)", listBox->getSelectedIndex(), keyCode, nativeCode);
#endif

	switch(keyCode) {
		case MAK_HASH:
			// Hash (#) key - ask the moblet to close the application
			maExit(0);
			break;

		case MAK_LEFT:
		case MAK_SOFTRIGHT:
			ScreenTransition::makeTransition(this, previous, -1, 400);
			break;

		case MAK_RIGHT:
		case MAK_FIRE:
			CheckBox * cb = (CheckBox *)((Label*)listBox->getChildren()[listBox->getSelectedIndex()])->getChildren()[0];
			cb->flip();
			break;

		case MAK_DOWN:
			listBox->selectNextItem();
			break;

		case MAK_UP:
			listBox->selectPreviousItem();
			break;
	}
}
开发者ID:FransUrbo,项目名称:LastBerakning,代码行数:31,代码来源:SaveScreen.cpp

示例6: PrepareConfigurationDialog

static void
PrepareConfigurationDialog()
{
  gcc_unused ScopeBusyIndicator busy;

  wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
                  Layout::landscape ? _T("IDR_XML_CONFIGURATION_L") :
                                      _T("IDR_XML_CONFIGURATION"));
  if (wf == NULL)
    return;

  wf->SetKeyDownNotify(FormKeyDown);

  bool expert_mode = false;
  Profile::Get(szProfileUserLevel, expert_mode);

  CheckBox *cb = (CheckBox *)wf->FindByName(_T("Expert"));
  cb->set_checked(expert_mode);
  wf->FilterAdvanced(expert_mode);

  ((WndButton *)wf->FindByName(_T("cmdClose")))->SetOnClickNotify(OnCloseClicked);

  configuration_tabbed = ((TabbedControl *)wf->FindByName(_T("tabbed")));
  assert(configuration_tabbed != NULL);

  setVariables();

  /* restore previous page */
  configuration_tabbed->SetCurrentPage((unsigned)current_page);
  PageSwitched();
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:31,代码来源:dlgConfiguration.cpp

示例7: CheckBox

void UI::build(const Settings& settings)
{
    _checkboxes.push_back(new CheckBox(settings.drawShapes, "Draw shapes"));
    /*
    _checkboxes.push_back(new CheckBox());
    _checkboxes.push_back(new CheckBox());
    _checkboxes.push_back(new CheckBox());
    _checkboxes.push_back(new CheckBox());
    _checkboxes.push_back(new CheckBox());
    //*/

    /*
    sf::Vector2f windowSize(window->getSize());

    float xRatio = 0.5 * getSize().x / (float)windowSize.x;
    float yRatio = 0.5 * getSize().y / (float)windowSize.y;

    text.setScale(sf::Vector2f(xRatio, yRatio));

    std::vector<CheckBox*>::iterator it;
    for (it=_checkboxes.begin(); it!=_checkboxes.end(); it++)
    	(*it)->setScale(sf::Vector2f(xRatio, yRatio));
    */

    const unsigned int start = 5, step = 15;

    for (unsigned int i=0; i<_checkboxes.size(); i++)
    {
        CheckBox* cb = _checkboxes[i];
        cb->setPosition(5, start + i*step);
        cb->setPosition(0, 0);
        cb->setScale(100, 100);
    }
}
开发者ID:Jairard,项目名称:Brotato,代码行数:34,代码来源:ui.cpp

示例8: CheckBox

void HelloGUI::InitControls()
{
    // Create a CheckBox
    CheckBox* checkBox = new CheckBox(context_);
    checkBox->SetName("CheckBox");

    // Create a Button
    Button* button = new Button(context_);
    button->SetName("Button");
    button->SetMinHeight(24);

    // Create a LineEdit
    LineEdit* lineEdit = new LineEdit(context_);
    lineEdit->SetName("LineEdit");
    lineEdit->SetMinHeight(24);

    // Add controls to Window
    window_->AddChild(checkBox);
    window_->AddChild(button);
    window_->AddChild(lineEdit);

    // Apply previously set default style
    checkBox->SetStyleAuto();
    button->SetStyleAuto();
    lineEdit->SetStyleAuto();
}
开发者ID:nonconforme,项目名称:Urho3D,代码行数:26,代码来源:HelloGUI.cpp

示例9: init

bool UICheckBoxCopyTest::init()
{
    if (UIScene::init())
    {
        Size widgetSize = _widget->getContentSize();;

        // Add a label in which the checkbox events will be displayed
        _displayValueLabel = Text::create("No Event", "fonts/Marker Felt.ttf", 32);
        _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1));
        _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
        _uiLayer->addChild(_displayValueLabel);

        // Add the alert
        Text* alert = Text::create("Two checkbox are identical.","fonts/Marker Felt.ttf",20 );
        alert->setColor(Color3B(159, 168, 176));
        alert->setPosition(Vec2(widgetSize.width / 2.0f,
                                widgetSize.height / 2.0f - alert->getContentSize().height * 1.75f));
        _uiLayer->addChild(alert);

        // Create the checkbox
        CheckBox* checkBox = CheckBox::create("cocosui/check_box_normal.png",
                                              "cocosui/check_box_active.png");
        checkBox->setPosition(Vec2(widgetSize.width / 2.0f - 50, widgetSize.height / 2.0f));

        _uiLayer->addChild(checkBox);

        auto checkboxCopy = checkBox->clone();
        checkboxCopy->setPosition(checkBox->getPosition() + Vec2(50,0));
        _uiLayer->addChild(checkboxCopy);


        return true;
    }
    return false;
}
开发者ID:asuo1986,项目名称:own,代码行数:35,代码来源:UICheckBoxTest.cpp

示例10: PrepareConfigurationDialog

static void
PrepareConfigurationDialog()
{
  gcc_unused ScopeBusyIndicator busy;

  wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
                  Layout::landscape ? _T("IDR_XML_CONFIGURATION_L") :
                                      _T("IDR_XML_CONFIGURATION"));
  if (wf == NULL)
    return;

  wf->SetKeyDownNotify(FormKeyDown);

  bool expert_mode = CommonInterface::GetUISettings().dialog.expert;
  CheckBox *cb = (CheckBox *)wf->FindByName(_T("Expert"));
  cb->SetState(expert_mode);
  wf->FilterAdvanced(expert_mode);

  PrepareConfigurationMenu();

  wTabMenu->GotoMenuPage();
  /* restore last selected menu item */
  static bool Initialized = false;
  if (!Initialized)
    Initialized = true;
  else
    wTabMenu->SetLastContentPage(current_page);
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:28,代码来源:dlgConfiguration.cpp

示例11: init

bool UICheckBoxTest::init()
{
    if (UIScene::init())
    {
        Size widgetSize = _widget->getContentSize();;
        
        // Add a label in which the checkbox events will be displayed
        _displayValueLabel = Text::create("No Event", "fonts/Marker Felt.ttf", 32);
        _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1));
        _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
        _uiLayer->addChild(_displayValueLabel);
        
        // Add the alert
        Text* alert = Text::create("CheckBox","fonts/Marker Felt.ttf",30 );
        alert->setColor(Color3B(159, 168, 176));
        alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getContentSize().height * 1.75f));
        _uiLayer->addChild(alert);        
        
        // Create the checkbox
        CheckBox* checkBox = CheckBox::create("cocosui/check_box_normal.png",
                                              "cocosui/check_box_normal_press.png",
                                              "cocosui/check_box_active.png",
                                              "cocosui/check_box_normal_disable.png",
                                              "cocosui/check_box_active_disable.png");
        checkBox->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
        
        checkBox->addEventListener(CC_CALLBACK_2(UICheckBoxTest::selectedEvent, this));
        _uiLayer->addChild(checkBox);
        
        return true;
    }
    return false;
}
开发者ID:SPUDevelopers,项目名称:Naturalize,代码行数:33,代码来源:UICheckBoxTest.cpp

示例12: CheckBox

CheckBox* CheckBox::create(const char* id, Theme::Style* style)
{
    CheckBox* cb = new CheckBox();
    cb->_id = id ? id : "";
    cb->initialize("CheckBox", style, NULL);
    return cb;
}
开发者ID:rgngl,项目名称:GamePlay,代码行数:7,代码来源:CheckBox.cpp

示例13: CustomControl

ImageRecipe::ImageRecipe(Container *parent) :
		CustomControl(parent) {
	// Get the UIConfig object in order to use resolution independent sizes.
	UIConfig *ui = this->ui();

	// Create the ImageView with an image in the assets folder as imageSource.
	Container *recipeContainer = Container::create().top(ui->du(2)).left(
			ui->du(2)).right(ui->du(2));

    DockLayout *recipeContainerLayout = new DockLayout();
    recipeContainer->setLayout(recipeContainerLayout);

	mImage = ImageView::create("asset:///images/peach_big.png").scalingMethod(
			ScalingMethod::AspectFit);
	mImage->setHorizontalAlignment(HorizontalAlignment::Center);
	mImage->setVerticalAlignment(VerticalAlignment::Center);

	// A checkbox so that we can turn on and off the filterColor property
	CheckBox *filterColorCheckBox = CheckBox::create().text("filterColor");
	filterColorCheckBox->setVerticalAlignment(VerticalAlignment::Bottom);

	connect(filterColorCheckBox, SIGNAL(checkedChanged(bool)), this,
			SLOT(onCheckedChanged(bool)));

	recipeContainer->add(mImage);
	recipeContainer->add(filterColorCheckBox);

	setRoot(recipeContainer);
}
开发者ID:13natty,项目名称:Cascades-Samples,代码行数:29,代码来源:imagerecipe.cpp

示例14: Property

PropertyBool::PropertyBool( QString name, bool value ) :
    Property( name, value )
{
    CheckBox* widget = new CheckBox( m_name );
    widget->setChecked( value );
    connect( widget, SIGNAL( stateChanged( int, int ) ), this, SLOT( widgetChanged( int, int ) ) );
    m_widget = widget;
}
开发者ID:dmastrovito,项目名称:braingl,代码行数:8,代码来源:propertybool.cpp

示例15: CheckBox

CheckBox *Options::create_checkbox(int xpos, int ypos, const char *name, bool state)
{
	CheckBox *checkbox = new CheckBox(this);
	checkbox->set_geometry(Rect(xpos, ypos , Size(300, 16)));
	checkbox->set_text(name);
	checkbox->set_checked(state);
	return checkbox;
}
开发者ID:Cassie90,项目名称:ClanLib,代码行数:8,代码来源:options.cpp


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