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


C++ gtk::VBox类代码示例

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


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

示例1:

EntityChooser::EntityChooser() :
	gtkutil::DialogElement(), // create an Element without label
	_entityStore(Gtk::ListStore::create(_listColumns))
{
	Gtk::VBox* vbox = Gtk::manage(new Gtk::VBox(false, 6));
	_widgets[WIDGET_TOPLEVEL] = vbox;

	// Initialise the base class
	DialogElement::setValueWidget(_widgets[WIDGET_TOPLEVEL]);

	Gtk::TreeView* treeView = Gtk::manage(new Gtk::TreeView(_entityStore));
	_widgets[WIDGET_TREEVIEW] = treeView;

	treeView->set_headers_visible(false);

	// Use the TreeModel's full string search function
	treeView->set_search_equal_func(sigc::ptr_fun(&gtkutil::TreeModel::equalFuncStringContains));

	// Head Name column
	treeView->append_column("", _listColumns.name);

	// Set the tree store to sort on this column
	_entityStore->set_sort_column_id(_listColumns.name, Gtk::SORT_ASCENDING);

	_selection = treeView->get_selection();
	_selection->signal_changed().connect(sigc::mem_fun(*this, &EntityChooser::onSelectionChanged));

	// Scrolled Frame
	vbox->pack_start(*Gtk::manage(new gtkutil::ScrolledFrame(*treeView)), true, true, 0);

	populateEntityList();
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:32,代码来源:EntityChooser.cpp

示例2: while

/**
 * This *creates* a new widget, management of deletion should be done by the caller
 */
Gtk::Widget *
Effect::newWidget(Gtk::Tooltips * tooltips)
{
    // use manage here, because after deletion of Effect object, others might still be pointing to this widget.
    Gtk::VBox * vbox = Gtk::manage( new Gtk::VBox() );

    vbox->set_border_width(5);

    std::vector<Parameter *>::iterator it = param_vector.begin();
    while (it != param_vector.end()) {
        if ((*it)->widget_is_visible) {
            Parameter * param = *it;
            Gtk::Widget * widg = param->param_newWidget(tooltips);
            Glib::ustring * tip = param->param_getTooltip();
            if (widg) {
                vbox->pack_start(*widg, true, true, 2);
                if (tip != NULL) {
                    tooltips->set_tip(*widg, *tip);
                }
            }
        }

        it++;
    }

    return dynamic_cast<Gtk::Widget *>(vbox);
}
开发者ID:wdmchaft,项目名称:DoonSketch,代码行数:30,代码来源:effect.cpp

示例3: AttrWidget

DualSpinScale::DualSpinScale(const char* label1, const char* label2, double value, double lower, double upper, double step_inc,
                               double climb_rate, int digits, const SPAttributeEnum a, char* tip_text1, char* tip_text2)
    : AttrWidget(a),
      _s1(label1, value, lower, upper, step_inc, climb_rate, digits, SP_ATTR_INVALID, tip_text1),
      _s2(label2, value, lower, upper, step_inc, climb_rate, digits, SP_ATTR_INVALID, tip_text2),
      //TRANSLATORS: "Link" means to _link_ two sliders together
      _link(C_("Sliders", "Link"))
{
    signal_value_changed().connect(signal_attr_changed().make_slot());

    _s1.get_adjustment()->signal_value_changed().connect(_signal_value_changed.make_slot());
    _s2.get_adjustment()->signal_value_changed().connect(_signal_value_changed.make_slot());
    _s1.get_adjustment()->signal_value_changed().connect(sigc::mem_fun(*this, &DualSpinScale::update_linked));

    _link.signal_toggled().connect(sigc::mem_fun(*this, &DualSpinScale::link_toggled));

    Gtk::VBox* vb = Gtk::manage(new Gtk::VBox);
    vb->add(_s1);
    vb->add(_s2);
    pack_start(*vb);
    pack_start(_link, false, false);
    _link.set_active(true);

    show_all();
}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:25,代码来源:spin-scale.cpp

示例4: decorate_object_editor

//------------------------------------------------------------------------------
void DbMySQLTableEditor::decorate_object_editor()
{
  if (is_editing_live_object())
  {
    PluginEditorBase::decorate_object_editor();
    Gtk::HBox* header_part = 0;
    xml()->get_widget("header_part", header_part);

    if (header_part->get_parent() == NULL)
    {
      decorator_control()->pack_start(*header_part, false, true);
      decorator_control()->reorder_child(*header_part, 0);

      Gtk::Button *hide_button = 0;
      xml()->get_widget("hide_button", hide_button);
      Gtk::Image* hide_image = Gtk::manage(new Gtk::Image(ImageCache::get_instance()->image_from_filename("EditorExpanded.png", false)));
      Gtk::Image* show_image = Gtk::manage(new Gtk::Image(ImageCache::get_instance()->image_from_filename("EditorCollapsed.png", false)));
      hide_image->show();
      Gtk::VBox* box = Gtk::manage(new Gtk::VBox());
      box->pack_start(*hide_image, false, false);
      box->pack_start(*show_image, false, false);
      box->show();
      show_image->hide();
      hide_button->set_image(*box);
      hide_button->signal_clicked().connect(sigc::mem_fun(this, &DbMySQLTableEditor::toggle_header_part));
      toggle_header_part();
    }
  }
}
开发者ID:alMysql,项目名称:mysql-workbench,代码行数:30,代码来源:mysql_table_editor_fe.cpp

示例5: init

void JointVelocityControlWidget::init(ref<BasicEnvironment> env, ref<Robot> robot, Int index, ref<ControlInterface> interface)
{
  velInterface = interface; 

  // Joint velocity controls
  Gtk::VBox* jointControlBox = new Gtk::VBox(false,5);

  Int dof =  velInterface->inputSize();
  velAdjustments.clear();
  for(Int j=0; j<dof; j++) {
    Gtk::HBox* hbox = new Gtk::HBox();
    Gtk::Label* label = new Gtk::Label(base::intToString(j)+":");
    hbox->pack_start(*manage(label), Gtk::PACK_SHRINK,5);
    Gtk::Adjustment* adj = new Gtk::Adjustment(0,-3,3,0.01,0.1);
    velAdjustments.push_back(adj);
    Gtk::HScale* scale = new Gtk::HScale(*manage(adj));
    scale->set_draw_value(true);
    scale->set_digits(2);
    scale->set_value_pos(Gtk::POS_LEFT);
    scale->set_update_policy(Gtk::UPDATE_CONTINUOUS);
    scale->set_size_request(100,-1);
    hbox->pack_end(*manage(scale));
    jointControlBox->pack_start(*manage(hbox),false,false);
    adj->signal_value_changed().connect( SigC::bind<Int>( SigC::slot(*this, &JointVelocityControlWidget::jointVelScaleChanged ), j) );
  }
  
  pack_start(*manage(jointControlBox));
}
开发者ID:davidljung,项目名称:opensim,代码行数:28,代码来源:JointVelocityControlWidget.cpp

示例6:

void
ExpireDialog::init()
{
    _spinner.set_numeric (true);
    _spinner.set_digits (1);
    _spinner.set_range (0, 30);
    _spinner.set_snap_to_ticks();
    _spinner.set_adjustment (_adj);
    _spinner.set_value (AppContext::get().get_expire());

    Gtk::VBox *vbox = get_vbox();
    vbox->pack_start (_label1, Gtk::PACK_SHRINK, 10);
    _box.add (*new Gtk::HBox);
    _box.pack_start (_spinner, Gtk::PACK_SHRINK, 10);
    _box.pack_start (_label2, Gtk::PACK_SHRINK, 0);
    _box.add (*new Gtk::HBox);
    vbox->pack_start (_box, Gtk::PACK_EXPAND_PADDING, 10);

    add_button (_("Do expire"), 1);
    add_button (Gtk::Stock::CANCEL, 0);

    /// Move focus to Do button
    cwidget_list_t list = get_action_area()->get_children();
    for (cwidget_list_t::iterator it = list.begin(); it != list.end(); ++it)
        if (get_response_for_widget (**it) == 1)
        { const_cast<Widget&>(**it).grab_focus(); break; }
    
    _changed_connection = _adj.signal_value_changed().connect (
            sigc::mem_fun (*this, &ExpireDialog::on_value_changed));
    
    show_all();
}
开发者ID:BackupTheBerlios,项目名称:calo-svn,代码行数:32,代码来源:ExpireDialog.cpp

示例7: MakeBoxHIGed

void MakeBoxHIGed(Gtk::VBox& vbox)
{
//     vbox.set_border_width(12);
//     vbox.set_spacing(24);
    vbox.set_border_width(0);
    vbox.set_spacing(WDG_BORDER_WDH);
}
开发者ID:cargabsj175,项目名称:bombono-dvd,代码行数:7,代码来源:mviewer.cpp

示例8: Dialog

// Specifies the parent window of the dialog box and the title of the dialog box.
StartDialogBox::StartDialogBox( MainWindow & parentWindow, string title) : Dialog( title, parentWindow, true, true ) {
	this->set_default_size(300,300);

	window_ = &parentWindow;
	Gtk::VBox* contentArea = this->get_vbox();
	
	// Set up checkbuttons, one for each player to indicate human
	for ( int i = 0; i < 4; i++ ) {
		std::ostringstream oss;
		oss << "Player " << (i+1);
		button[i].set_label(oss.str());
		contentArea->add(button[i]);
	} 
	
	// Add a standard "ok" buttons with the appropriate responses when clicked.
    add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);

	show_all_children();
	
	int result = run();
    switch (result) {
        case Gtk::RESPONSE_OK: //If ok is clicked
            for (int i = 0; i < 4; i++) {
				window_->humanPlayer[i] = button[i].get_active(); //keep track of which buttons were seleced
			} 
            break;
    } 
} 
开发者ID:AaronMorais,项目名称:CS247_Straights,代码行数:29,代码来源:StartDialogBox.cpp

示例9:

// Create the conversation entity panel
Gtk::Widget& ConversationDialog::createEntitiesPanel()
{
	// Hbox containing the entity list and the buttons vbox
	Gtk::HBox* hbx = Gtk::manage(new Gtk::HBox(false, 6));

	// Tree view listing the conversation_info entities
	_entityView = Gtk::manage(new Gtk::TreeView(_convEntityList));
	_entityView->set_headers_visible(false);

	Glib::RefPtr<Gtk::TreeSelection> sel = _entityView->get_selection();
	sel->signal_changed().connect(sigc::mem_fun(*this, &ConversationDialog::onEntitySelectionChanged));

	// Entity Name column
	_entityView->append_column(*Gtk::manage(new gtkutil::TextColumn("", _convEntityColumns.displayName)));

	hbx->pack_start(*Gtk::manage(new gtkutil::ScrolledFrame(*_entityView)), true, true, 0);

	// Vbox for the buttons
	Gtk::VBox* buttonBox = Gtk::manage(new Gtk::VBox(false, 6));

	Gtk::Button* addButton = Gtk::manage(new Gtk::Button(Gtk::Stock::ADD));
	addButton->signal_clicked().connect(sigc::mem_fun(*this, &ConversationDialog::onAddEntity));
	buttonBox->pack_start(*addButton, true, true, 0);

	_deleteEntityButton = Gtk::manage(new Gtk::Button(Gtk::Stock::DELETE));
	_deleteEntityButton->set_sensitive(false); // disabled at start
	_deleteEntityButton->signal_clicked().connect(sigc::mem_fun(*this, &ConversationDialog::onDeleteEntity));

	buttonBox->pack_start(*_deleteEntityButton, true, true, 0);

	hbx->pack_start(*buttonBox, false, false, 0);

	return *hbx;
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:35,代码来源:ConversationDialog.cpp

示例10: lvScriptPreview

ScriptAddDlgGtk::ScriptAddDlgGtk()
	: lvScriptPreview(1)
	, lblScriptSelection(gettext("Script to insert:")
	, Gtk::ALIGN_LEFT)
	, lblScriptPreview(gettext("Preview:"), Gtk::ALIGN_LEFT)
{
	this->set_title(gettext("Add script"));
	this->set_icon_name("gpc");
	this->set_default_size(400, 300);
	Gtk::VBox* vbScriptAddDlg = this->get_vbox();
	vbScriptAddDlg->set_spacing(10);
	vbScriptAddDlg->pack_start(hbScriptSelection, Gtk::PACK_SHRINK);
	hbScriptSelection.set_border_width(10);
	hbScriptSelection.pack_start(lblScriptSelection);
	hbScriptSelection.pack_start(cbScriptSelection);
	vbScriptAddDlg->pack_start(vbScriptPreview);
	vbScriptPreview.pack_start(lblScriptPreview, Gtk::PACK_SHRINK);
	vbScriptPreview.pack_start(scrScriptPreview);
	scrScriptPreview.add(lvScriptPreview);
	vbScriptPreview.set_border_width(10);
	scrScriptPreview.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
	scrScriptPreview.set_shadow_type(Gtk::SHADOW_IN);
	lvScriptPreview.set_column_title(0, gettext("Entry"));
	lvScriptPreview.set_headers_visible(false);
	
	this->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
	this->add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);

	this->signal_response().connect(sigc::mem_fun(this, &ScriptAddDlgGtk::signal_scriptAddDlg_response));
	cbScriptSelection.signal_changed().connect(sigc::mem_fun(this, &ScriptAddDlgGtk::signal_script_selection_changed));
}
开发者ID:Sebi55,项目名称:GPC,代码行数:31,代码来源:scriptAddDlgGtk.cpp

示例11: mOgreWidget

    OgreWindow::OgreWindow() :
        mOgreWidget(),
        mExited(false)
        //mRobot()
    {
      set_border_width(1);

      Gtk::VBox *vb = new Gtk::VBox(false,0);

//      Gtk::Button *mb = new Gtk::Button("Avanzar");
//      mb->signal_clicked().connect(sigc::mem_fun(*this,&OgreWindow::avanzar));
//      Gtk::Button *mb2 = new Gtk::Button("Retroceder");
//      mb2->signal_clicked().connect(sigc::mem_fun(*this,&OgreWindow::retroceder));
//      Gtk::Button *mb3 = new Gtk::Button("Giro derecha");
//      mb3->signal_clicked().connect(sigc::mem_fun(*this,&OgreWindow::derecha));
//      Gtk::Button *mb4 = new Gtk::Button("Giro izquierda");
//      mb4->signal_clicked().connect(sigc::mem_fun(*this,&OgreWindow::izquierda));
//      vb->pack_start(*mb,true,true,0);
//      vb->pack_start(*mb2,true,true,0);
//      vb->pack_start(*mb3,true,true,0);
//      vb->pack_start(*mb4,true,true,0);
      vb->pack_start(mOgreWidget,true,true,10);

      add(*vb);
      show_all();
    }
开发者ID:rovertpd,项目名称:simrovime,代码行数:26,代码来源:ogrewindow.cpp

示例12:

AIHeadPropertyEditor::AIHeadPropertyEditor(Entity* entity, const std::string& key, const std::string& options) :
	_entity(entity)
{
	_widget = Gtk::manage(new Gtk::HBox(false, 0));
	_widget->set_border_width(6);

	// Horizontal box contains the browse button
	Gtk::HBox* hbx = Gtk::manage(new Gtk::HBox(false, 3));
	hbx->set_border_width(3);

	// Browse button for models
	Gtk::Button* browseButton = Gtk::manage(new Gtk::Button(_("Choose AI head...")));

	browseButton->set_image(
		*Gtk::manage(new Gtk::Image(GlobalUIManager().getLocalPixbuf("icon_model.png")))
	);
	browseButton->signal_clicked().connect(sigc::mem_fun(*this, &AIHeadPropertyEditor::onChooseButton));

	hbx->pack_start(*browseButton, true, false, 0);

	// Pack hbox into vbox (to limit vertical size), then edit frame
	Gtk::VBox* vbx = Gtk::manage(new Gtk::VBox(false, 0));
	vbx->pack_start(*hbx, true, false, 0);
	_widget->pack_start(*vbx, true, true, 0);
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:25,代码来源:AIHeadPropertyEditor.cpp

示例13: GlobalMainFrame

// Construct the dialog
LightTextureChooser::LightTextureChooser()
:	gtkutil::BlockingTransientWindow(_("Choose texture"), GlobalMainFrame().getTopLevelWindow()),
	_selector(Gtk::manage(new ShaderSelector(this, getPrefixList(), true))) // true >> render a light texture
{
	// Set the default size of the window
	Gdk::Rectangle rect;

	if (GlobalGroupDialog().getDialogWindow()->is_visible())
	{
		rect = gtkutil::MultiMonitor::getMonitorForWindow(GlobalGroupDialog().getDialogWindow());
	}
	else
	{
		rect = gtkutil::MultiMonitor::getMonitorForWindow(GlobalMainFrame().getTopLevelWindow());
	}

	set_default_size(static_cast<int>(rect.get_width()*0.6f), static_cast<int>(rect.get_height()*0.6f));

	// Construct main VBox, and pack in ShaderSelector and buttons panel
	Gtk::VBox* vbx = Gtk::manage(new Gtk::VBox(false, 6));

	vbx->pack_start(*_selector, true, true, 0);
	vbx->pack_start(createButtons(), false, false, 0);

	add(*vbx);
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:27,代码来源:LightTextureChooser.cpp

示例14:

ScriptWindow::ScriptWindow() :
	Gtk::VBox(false, 6),
	_outView(Gtk::manage(new gtkutil::ConsoleView)),
	_view(Gtk::manage(new gtkutil::SourceView(SCRIPT_LANGUAGE_ID, false))) // allow editing
{
	_view->unset_focus_chain();

	Gtk::Button* runButton = Gtk::manage(new Gtk::Button(_("Run Script")));
	runButton->signal_clicked().connect(sigc::mem_fun(*this, &ScriptWindow::onRunScript));

	Gtk::HBox* buttonBar = Gtk::manage(new Gtk::HBox(false, 6));
	buttonBar->pack_start(*runButton, false, false, 0);

	Gtk::VBox* inputVBox = Gtk::manage(new Gtk::VBox(false, 3));
	inputVBox->pack_start(*Gtk::manage(new gtkutil::LeftAlignedLabel(_("Python Script Input"))), false, false, 0);
	inputVBox->pack_start(*_view, true, true, 0);
	inputVBox->pack_start(*buttonBar, false, false, 0);

	// Pack the scrolled textview and the entry box to the vbox
	Gtk::VPaned* paned = Gtk::manage(new Gtk::VPaned);
	paned->add1(*inputVBox);
	paned->add2(*_outView);

	pack_start(*paned, true, true, 0);
	show_all();
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:26,代码来源:ScriptWindow.cpp

示例15: ShaderSelector

// Construct the dialog
ShaderChooser::ShaderChooser(const Glib::RefPtr<Gtk::Window>& parent,
							 Gtk::Entry* targetEntry) :
	gtkutil::BlockingTransientWindow(_(LABEL_TITLE), parent),
	_targetEntry(targetEntry),
	_selector(Gtk::manage(new ShaderSelector(this, SHADER_PREFIXES)))
{
	set_border_width(12);

	if (_targetEntry != NULL)
	{
		_initialShader = targetEntry->get_text();

		// Set the cursor of the tree view to the currently selected shader
		_selector->setSelection(_initialShader);
	}

	// Set the default size and position of the window
	set_default_size(DEFAULT_SIZE_X, DEFAULT_SIZE_Y);

	// Connect the key handler to catch the ESC event
	signal_key_press_event().connect(sigc::mem_fun(*this, &ShaderChooser::onKeyPress), false);

	// Construct main VBox, and pack in the ShaderSelector and buttons panel
	Gtk::VBox* vbx = Gtk::manage(new Gtk::VBox(false, 3));
	vbx->pack_start(*_selector, true, true, 0);
	vbx->pack_start(createButtons(), false, false, 0);

	add(*vbx);

	// Connect the window position tracker
	_windowPosition.loadFromPath(RKEY_WINDOW_STATE);

	_windowPosition.connect(this);
	_windowPosition.applyPosition();
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:36,代码来源:ShaderChooser.cpp


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