Example #1
0
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;
}
Example #2
0
//-----------------------------------------------------------------------------------
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();
}
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);
}
Example #4
0
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();
  }
}
Example #5
0
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;
	}
}
Example #6
0
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();
}
Example #7
0
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);
    }
}
Example #8
0
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();
}
Example #9
0
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;
}
Example #10
0
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);
}
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;
}
Example #12
0
CheckBox* CheckBox::create(const char* id, Theme::Style* style)
{
    CheckBox* cb = new CheckBox();
    cb->_id = id ? id : "";
    cb->initialize("CheckBox", style, NULL);
    return cb;
}
Example #13
0
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);
}
Example #14
0
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;
}
Example #15
0
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;
}
Example #16
0
void RadioBox::AddChoice(const std::string& Choice)
{
	CheckBox* cb = new CheckBox();
	cb->SetText(Choice);
	
	_FlowContainer.AddControl(*cb);
	_Checkboxes.push_back(std::make_tuple(cb, Choice));
}
int                     CheckBox::setDisabledCheckedParamsG(lua_State *l)
{
	CheckBox  *v = ftlua::pop<CheckBox*>(l, 1);
	// CheckBox  *v = ftlua::retrieveSelf<CheckBox>(l, 1);

	v->setDisabledCheckedParams(CheckBox::retrieveParams(l));
	return 0;
}
Example #18
0
void ConfigureTools::onTiledClick()
{
  bool flag = m_tiled->isSelected();

  UIContext::instance()->getSettings()->setTiledMode(flag ? TILED_BOTH: TILED_NONE);

  m_tiledX->setSelected(flag);
  m_tiledY->setSelected(flag);
}
/// Get the button
void GameEconomicGameClient::HandlerConfigurationWindowButtonPressed(StringHash eventType, VariantMap& eventData)
{
    /// Get needed resources
    Renderer* renderer = GetSubsystem<Renderer>();
    ResourceCache* cache = GetSubsystem<ResourceCache>();
    UI* ui_ = GetSubsystem<UI>();

    UIElement * UIRoot = ui_->GetRoot();

    GameStateHandlerComponent * gamestatehandlercomponent_ = GetSubsystem<GameStateHandlerComponent>();

    /// get the button that was clicked
    Button* clicked = static_cast<Button*>(eventData[UIMouseClick::P_ELEMENT].GetPtr());

    /// Get TheName
    String ClickedButton(clicked->GetName().ToLower());

    /// If exit was clicked
    if (ClickedButton.Contains("apply")==true)
    {
        /// Get parameters
        Slider * VideoBloomParam1= (Slider *)UIRoot->GetChild("VideoBloomParam1Slider",true);
        Slider * VideoBloomParam2= (Slider *)UIRoot->GetChild("VideoBloomParam2Slider",true);

        float VideoBloomParam1Value = VideoBloomParam1->GetValue();
        float VideoBloomParam2Value = VideoBloomParam2->GetValue();

        /// Set parameter
        effectRenderPath->SetShaderParameter("BloomMix", Vector2(VideoBloomParam1Value,VideoBloomParam2Value));

        return;
    }

    /// If exit was clicked
    if (ClickedButton.Contains("save")==true)
    {
        /// Get parameters
        Slider * VideoBloomParam1= (Slider *)UIRoot->GetChild("VideoBloomParam1Slider",true);
        Slider * VideoBloomParam2= (Slider *)UIRoot->GetChild("VideoBloomParam2Slider",true);
        CheckBox * GameForceTabletModeCheckBox = (CheckBox *) UIRoot->GetChild("GameForceTabletModeCheckBox",true);

        ///Create new config
        Configuration SaveNewConfig;

        /// Copy info
        SaveNewConfig.GameModeForceTablet=  GameForceTabletModeCheckBox->IsChecked();
        SaveNewConfig.VideoBloomParam1 = VideoBloomParam1->GetValue();
        SaveNewConfig.VideoBloomParam2 = VideoBloomParam2->GetValue();

        /// Save new config
        SaveConfiguration(SaveNewConfig);

        return;
    }

    return;
}
    /////////////////////////////////////////////////////////////////////////////////////////
    // ThemedSkin::measure const
    //! Measures a standard CheckBox control 
    //! 
    //! \param[in,out] &chk - CheckBox to be measured
    //! \param[in,out] &dc - Output device context
    //! \return SizeL - Required size
    /////////////////////////////////////////////////////////////////////////////////////////
    SizeL measure(CheckBox<ENC>& chk, DeviceContext& dc) const override
    {
      Theme theme(chk.handle(), L"Button");

      // Measure checkbox + text + edges
      return theme.measure(dc, BP_CHECKBOX, CBS_UNCHECKEDNORMAL) 
           + dc.measure(chk.Text()) 
           + SizeL(3*Metrics::WindowEdge.Width, 0);
    }
static int lua_cocos2dx_CheckBox_addEventListenerCheckBox(lua_State* L)
{
    if (nullptr == L)
        return 0;
    
    int argc = 0;
    CheckBox* self = nullptr;
    
#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
	if (!tolua_isusertype(L,1,"ccui.CheckBox",0,&tolua_err)) goto tolua_lerror;
#endif
    
    self = static_cast<CheckBox*>(tolua_tousertype(L,1,0));
    
#if COCOS2D_DEBUG >= 1
	if (nullptr == self) {
		tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_CheckBox_addEventListenerCheckBox'\n", NULL);
		return 0;
	}
#endif
    argc = lua_gettop(L) - 1;
    if (1 == argc)
    {
#if COCOS2D_DEBUG >= 1
        if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err))
        {
            goto tolua_lerror;
        }
#endif
        LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create();
        if (nullptr == listener)
        {
            tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL);
            return 0;
        }
        
        LUA_FUNCTION handler = (  toluafix_ref_function(L,2,0));
        
        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER);
        
        self->setUserObject(listener);        
        self->addEventListenerCheckBox(listener, checkboxselectedeventselector(LuaCocoStudioEventListener::eventCallbackFunc));
        
        return 0;
    }
    
    CCLOG("'addEventListenerCheckBox' function of CheckBox has wrong number of arguments: %d, was expecting %d\n", argc, 1);
    return 0;
    
#if COCOS2D_DEBUG >= 1
tolua_lerror:
    tolua_error(L,"#ferror in function 'addEventListenerCheckBox'.",&tolua_err);
    return 0;
#endif
}
void UICheckBoxTest_Editor::configureGUIScene()
{
    UIScene_Editor::configureGUIScene();
    
    Layout* root = static_cast<Layout*>(_layout->getChildByName("root_Panel"));

    CheckBox* checkbox = static_cast<CheckBox*>(Helper::seekWidgetByName(root, "CheckBox_540"));
    checkbox->addEventListener(CC_CALLBACK_2(UICheckBoxTest_Editor::selectedStateEvent, this));
    
}
Example #23
0
CheckBox* check_button_new(const char *text, int b1, int b2, int b3, int b4)
{
    CheckBox* widget = new CheckBox(text, kButtonWidget);

    widget->setAlign(JI_CENTER | JI_MIDDLE);

    setup_mini_look(widget);
    setup_bevels(widget, b1, b2, b3, b4);
    return widget;
}
Example #24
0
Set<String> FindInFilesDialog::get_filter() const {
	Set<String> filters;
	for (int i = 0; i < _filters.size(); ++i) {
		CheckBox *cb = _filters[i];
		if (cb->is_pressed()) {
			filters.insert(_filters[i]->get_text());
		}
	}
	return filters;
}
Example #25
0
void BaseApp::InitGUI()
{
	m_pGui = new Gui(m_pFont);

	CheckBox::LoadTextures("data\\textures\\checkbox.bmp", "data\\textures\\checkbox_mark.bmp");

	CheckBox *checkBox;
	checkBox = new CheckBox(false, "Wireframe", m_pGui);
	checkBox->AddCallBack(twfCallback);
	m_pGui->AddWidget(checkBox);

	CheckBox *checkBox2;
	checkBox2 = new CheckBox(false, "Render Quadtree Bounding Boxes", m_pGui);
	checkBox2->AddCallBack(QuadtreeBoundingBoxesCallback);
	m_pGui->AddWidget(checkBox2);

	CheckBox *checkBox3;
	checkBox3 = new CheckBox(true, "Usar Vertex Buffer Objects", m_pGui);
	checkBox3->AddCallBack(UseVBOSCallback);
	m_pGui->AddWidget(checkBox3);

	CheckBox *checkBox4;
	checkBox4 = new CheckBox(true, "Usar Geomipmaps", m_pGui);
	checkBox4->AddCallBack(UseGeoMorphingCallback);
	m_pGui->AddWidget(checkBox4);

	CheckBox *checkBox5;
	checkBox5 = new CheckBox(false, "Freeze visibility culling", m_pGui);
	checkBox5->AddCallBack(FreezeVisibCallback);
	m_pGui->AddWidget(checkBox5);



	Slider::LoadTextures("data\\textures\\slider.bmp", "data\\textures\\slider_btn.bmp");

	Slider *slider;
	slider = new Slider(m_pGui, 200, 0.1f, 180.0f, 50.0f, "FOV");
	slider->AddCallBack(fovCallback);
	m_pGui->AddWidget(slider);
/*
	Slider *slider2;
	slider2 = new Slider(m_pGui, 200, 0.0f, 20.0f, 0.2f, "Wind speed");
	slider2->AddCallBack(WindSpeedCallback);
	m_pGui->AddWidget(slider2);

	Slider *slider3;
	slider3 = new Slider(m_pGui, 200, 0.0f, 100.0f, 1.0f, "Wind strength");
	slider3->AddCallBack(WindStrengthCallback);
	m_pGui->AddWidget(slider3);
*/
	Slider *slider4;
	slider4 = new Slider(m_pGui, 200, 0.0f, 0.1f, 0.005f, "Blur offset");
	slider4->AddCallBack(BlurOffsetCallback);
	m_pGui->AddWidget(slider4);
}
Example #26
0
CheckBox* CheckBox::create()
{
    CheckBox* widget = new CheckBox();
    if (widget && widget->init())
    {
        widget->autorelease();
        return widget;
    }
    CC_SAFE_DELETE(widget);
    return nullptr;
}
Example #27
0
CheckBox* CheckBox::create(const char* id, Theme::Style* style)
{
    GP_ASSERT(style);

    CheckBox* checkBox = new CheckBox();
    if (id)
        checkBox->_id = id;
    checkBox->setStyle(style);

    return checkBox;
}
Example #28
0
CheckBox* CheckBox::create(Theme::Style* style, Properties* properties)
{
    GP_ASSERT(properties);

    CheckBox* checkBox = new CheckBox();
    checkBox->initialize(style, properties);
    properties->getVector2("imageSize", &checkBox->_imageSize);
    checkBox->_checked = properties->getBool("checked");

    return checkBox;
}
Example #29
0
    KinematicsBarSetupDialog() {

        setWindowTitle(_("Kinematics Operation Setup"));
        
        QVBoxLayout* vbox = new QVBoxLayout();
        setLayout(vbox);
        
        QHBoxLayout* hbox = new QHBoxLayout();
        hbox->addWidget(new QLabel(_("Snap thresholds:")));
        hbox->addSpacing(10);
        
        hbox->addWidget(new QLabel(_("distance")));
        snapDistanceSpin.setAlignment(Qt::AlignCenter);
        snapDistanceSpin.setDecimals(3);
        snapDistanceSpin.setRange(0.0, 0.999);
        snapDistanceSpin.setSingleStep(0.001);
        snapDistanceSpin.setValue(0.025);
        hbox->addWidget(&snapDistanceSpin);
        hbox->addWidget(new QLabel(_("[m]")));

        hbox->addSpacing(5);
        hbox->addWidget(new QLabel(_("angle")));
        snapAngleSpin.setAlignment(Qt::AlignCenter);
        snapAngleSpin.setRange(0, 90);
        snapAngleSpin.setValue(30);
        hbox->addWidget(&snapAngleSpin);
        hbox->addWidget(new QLabel(_("[deg]")));
        vbox->addLayout(hbox);

        hbox = new QHBoxLayout();
        hbox->addWidget(new QLabel(_("Penetration block depth")));
        penetrationBlockDepthSpin.setAlignment(Qt::AlignCenter);
        penetrationBlockDepthSpin.setDecimals(4);
        penetrationBlockDepthSpin.setRange(0.0, 0.0099);
        penetrationBlockDepthSpin.setSingleStep(0.0001);
        penetrationBlockDepthSpin.setValue(0.0005);
        hbox->addWidget(&penetrationBlockDepthSpin);
        hbox->addWidget(new QLabel(_("[m]")));
        vbox->addLayout(hbox);

        hbox = new QHBoxLayout();
        lazyCollisionDetectionModeCheck.setText(_("Lazy collision detection mode"));
        lazyCollisionDetectionModeCheck.setChecked(true);
        hbox->addWidget(&lazyCollisionDetectionModeCheck);
        vbox->addLayout(hbox);

        hbox = new QHBoxLayout();
        okButton.setText(_("OK"));
        okButton.setDefault(true);
        hbox->addWidget(&okButton);
        vbox->addLayout(hbox);
    }
Example #30
0
    /// Insert a child element into a specific position in the child list.
    void InsertChild(unsigned index, UIElement* element)
    {
        // Insert the overlay at the same index position to the overlay container
        CheckBox* overlay = static_cast<CheckBox*>(overlayContainer_->CreateChild(CheckBox::GetTypeStatic(), String::EMPTY, index));
        overlay->SetStyle("HierarchyListViewOverlay");
        int baseIndent = listView_->GetBaseIndent();
        int indent = element->GetIndent() - baseIndent - 1;
        overlay->SetIndent(indent);
        overlay->SetFixedWidth((indent + 1) * element->GetIndentSpacing());

        // Then insert the element as child as per normal
        UIElement::InsertChild(index, element);
    }