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


C++ VBox::set_border_width方法代码示例

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


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

示例1: 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

示例2: 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

示例3: createPanelBox

Gtk::Box* PreferencesPanel::createPanelBox()
{
  Gtk::VBox* PanelBox = Gtk::manage(new Gtk::VBox(false, 5));

  PanelBox->set_border_width(10);

  PanelBox->set_visible(true);

  return PanelBox;
}
开发者ID:VaysseB,项目名称:openfluid,代码行数:10,代码来源:PreferencesPanel.cpp

示例4:

Gtk::Widget& DifficultyEditor::createTreeView()
{
	// First, create the treeview
	_settingsView = Gtk::manage(new Gtk::TreeView(_settings->getTreeStore()));
	_settingsView->set_size_request(TREE_VIEW_MIN_WIDTH, -1);

	// Connect the tree view selection
	Glib::RefPtr<Gtk::TreeSelection> selection = _settingsView->get_selection();
	selection->signal_changed().connect(sigc::mem_fun(*this, &DifficultyEditor::onSettingSelectionChange));

	// Add columns to this view
	Gtk::CellRendererText* textRenderer = Gtk::manage(new Gtk::CellRendererText);

	Gtk::TreeViewColumn* settingCol = Gtk::manage(new Gtk::TreeViewColumn);
	settingCol->pack_start(*textRenderer, false);

    settingCol->set_title(_("Setting"));
	settingCol->set_sizing(Gtk::TREE_VIEW_COLUMN_AUTOSIZE);
    settingCol->set_spacing(3);

	_settingsView->append_column(*settingCol);

	settingCol->add_attribute(textRenderer->property_text(), _settings->getColumns().description);
	settingCol->add_attribute(textRenderer->property_foreground(), _settings->getColumns().colour);
	settingCol->add_attribute(textRenderer->property_strikethrough(), _settings->getColumns().isOverridden);

	Gtk::ScrolledWindow* frame = Gtk::manage(new gtkutil::ScrolledFrame(*_settingsView));

	// Create the action buttons
	Gtk::HBox* buttonHBox = Gtk::manage(new Gtk::HBox(false, 6));

	// Create button
	_createSettingButton = Gtk::manage(new Gtk::Button(Gtk::Stock::ADD));
	_createSettingButton->signal_clicked().connect(sigc::mem_fun(*this, &DifficultyEditor::onSettingCreate));

	// Delete button
	_deleteSettingButton = Gtk::manage(new Gtk::Button(Gtk::Stock::DELETE));
	_deleteSettingButton->signal_clicked().connect(sigc::mem_fun(*this, &DifficultyEditor::onSettingDelete));

	_refreshButton = Gtk::manage(new Gtk::Button(Gtk::Stock::REFRESH));
	_refreshButton->signal_clicked().connect(sigc::mem_fun(*this, &DifficultyEditor::onRefresh));

	buttonHBox->pack_start(*_createSettingButton, true, true, 0);
	buttonHBox->pack_start(*_deleteSettingButton, true, true, 0);
	buttonHBox->pack_start(*_refreshButton, true, true, 0);

	Gtk::VBox* vbox = Gtk::manage(new Gtk::VBox(false, 6));
	vbox->pack_start(*frame, true, true, 0);
	vbox->pack_start(*buttonHBox, false, false, 0);

	vbox->set_border_width(12);

	return *vbox;
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:54,代码来源:DifficultyEditor.cpp

示例5: onNewExtraField

void DocumentProperties::onNewExtraField ()
{
	Gtk::Dialog dialog ("New Field", *dialog_, true, false);

	Gtk::VBox *vbox = dialog.get_vbox ();

	Gtk::HBox hbox;
	hbox.set_spacing (12);
	vbox->pack_start (hbox, true, true, 0);

	Gtk::Label label ("Field name:", false);
	hbox.pack_start (label, false, false, 0);

	Gtk::Entry entry;
	entry.set_activates_default (true);
	hbox.pack_start (entry, true, true, 0);

	dialog.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
	dialog.add_button (Gtk::Stock::OK, Gtk::RESPONSE_ACCEPT);
	dialog.set_default_response (Gtk::RESPONSE_ACCEPT);

	dialog.show_all ();
	vbox->set_border_width (12);

	if (dialog.run () == Gtk::RESPONSE_ACCEPT) {

		Gtk::ListStore::iterator it = extrafieldsstore_->children().begin ();
		Gtk::ListStore::iterator const end = extrafieldsstore_->children().end ();
		bool key_isnew = true;
		for (; it != end; ++it)
			if (Utility::firstCap ((*it)[extrakeycol_]) == Utility::firstCap (entry.get_text ())) {
				key_isnew = false;
			}
		if ( key_isnew ) {
			Gtk::ListStore::iterator row = extrafieldsstore_->append ();
			(*row)[extrakeycol_] = Utility::firstCap (entry.get_text ());
			(*row)[extravalcol_] = "";
		} else {
			Glib::ustring message;
			message = String::ucompose (
			"<b><big>%1</big></b>",
			_("This key already exists.\n"));
			Gtk::MessageDialog dialog (

			message, true,
			Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true);

			dialog.run ();

		}
	}
}
开发者ID:mcraveiro,项目名称:referencer,代码行数:52,代码来源:DocumentProperties.C

示例6: while

Gtk::Widget *
LPESimplify::newWidget()
{
    // 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(Effect::newWidget()) );
    
    vbox->set_border_width(5);
    vbox->set_homogeneous(false);
    vbox->set_spacing(2);
    std::vector<Parameter *>::iterator it = param_vector.begin();
    Gtk::HBox * buttons = Gtk::manage(new Gtk::HBox(true,0));
    while (it != param_vector.end()) {
        if ((*it)->widget_is_visible) {
            Parameter * param = *it;
            Gtk::Widget * widg = dynamic_cast<Gtk::Widget *>(param->param_newWidget());
            if (param->param_key == "simplify_individual_paths" ||
                    param->param_key == "simplify_just_coalesce") {
                Glib::ustring * tip = param->param_getTooltip();
                if (widg) {
                    buttons->pack_start(*widg, true, true, 2);
                    if (tip) {
                        widg->set_tooltip_text(*tip);
                    } else {
                        widg->set_tooltip_text("");
                        widg->set_has_tooltip(false);
                    }
                }
            } else {
                Glib::ustring * tip = param->param_getTooltip();
                if (widg) {
                    Gtk::HBox * horizontal_box = dynamic_cast<Gtk::HBox *>(widg);
                    std::vector< Gtk::Widget* > child_list = horizontal_box->get_children();
                    Gtk::Entry* entry_widg = dynamic_cast<Gtk::Entry *>(child_list[1]);
                    entry_widg->set_width_chars(8);
                    vbox->pack_start(*widg, true, true, 2);
                    if (tip) {
                        widg->set_tooltip_text(*tip);
                    } else {
                        widg->set_tooltip_text("");
                        widg->set_has_tooltip(false);
                    }
                }
            }
        }

        ++it;
    }
    vbox->pack_start(*buttons,true, true, 2);
    return dynamic_cast<Gtk::Widget *>(vbox);
}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:50,代码来源:lpe-simplify.cpp

示例7: resolutionToString

ResolutionDialog::ResolutionDialog( Gtk::Widget * widget )
:	Dialog			( _("Resolution") ),
	m_resetButton	( Gtk::Stock::UNDO ),
	m_applyButton	( Gtk::Stock::APPLY ),
	m_widget		( widget ),
	m_oldResolution	( widget->get_width(), widget->get_height() ),
	m_newResolution	( 0, 0 )
{
	// Creates the main layout.
	Gtk::Label	* label = Gtk::manage( new Gtk::Label(_("Select, in the list bellow, a resolution to apply, \nor specify your own."), 0, 0) );
	Gtk::VBox	* box	= Gtk::manage( new Gtk::VBox(false, 8) );
	
	box->set_border_width( 12 );
	box->pack_start( *label, Gtk::PACK_SHRINK );
	box->pack_start( m_resolutions, Gtk::PACK_SHRINK );
	get_vbox()->add( *box );
	
	
	// Adds buttons.
	get_action_area()->add( m_resetButton );
	get_action_area()->add( m_applyButton );
	add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE );
	
	m_applyButton.set_sensitive( false );
	
	
	// Connects to some signals.
	m_applyButton.signal_clicked().connect( sigc::mem_fun(this, &ResolutionDialog::applyClicked) );
	m_resetButton.signal_clicked().connect( sigc::mem_fun(this, &ResolutionDialog::resetClicked) );
	m_resolutions.get_entry()->signal_changed().connect( sigc::mem_fun(this, &ResolutionDialog::resolutionChanged) );
	
	
	// Fills the resolution box with predefined resolutions.
	m_resolutions.append_text(_("1024x768"));
	m_resolutions.append_text(_("800x600"));
	m_resolutions.append_text(_("720x576"));
	m_resolutions.append_text(_("640x480"));
	
	
	// Shows the whole things
	show_all();
	
	
	// Assigns the initial resolution.
	m_resolutions.get_entry()->set_text( resolutionToString(m_oldResolution.first, m_oldResolution.second) );
}
开发者ID:npapier,项目名称:vgsdk,代码行数:46,代码来源:ResolutionDialog.cpp


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