Exemple #1
0
void
Licensor::init (Gtk::Tooltips& tt, Registry& wr)
{
    /* add license-specific metadata entry areas */
    rdf_work_entity_t* entity = rdf_find_entity ( "license_uri" );
    _eentry = EntityEntry::create (entity, tt, wr);

    LicenseItem *i;
    wr.setUpdating (true);
    i = manage (new LicenseItem (&_proprietary_license, _eentry, wr));
    add (*i);
    LicenseItem *pd = i;

    for (struct rdf_license_t * license = rdf_licenses;
            license && license->name;
            license++) {
        i = manage (new LicenseItem (license, _eentry, wr));
        add(*i);
    }
    // add Other at the end before the URI field for the confused ppl.
    LicenseItem *io = manage (new LicenseItem (&_other_license, _eentry, wr));
    add (*io);

    pd->set_active();
    wr.setUpdating (false);

    Gtk::HBox *box = manage (new Gtk::HBox);
    pack_start (*box, true, true, 0);

    box->pack_start (_eentry->_label, false, false, 5);
    box->pack_start (*_eentry->_packable, true, true, 0);

    show_all_children();
}
void WarningListDialog::add_warning(const Glib::ustring& warning)
{
  Gtk::HBox* hb = Gtk::manage(new Gtk::HBox);
  Gtk::Label* l = Gtk::manage(new Gtk::Label);
  hb->show();
  hb->set_spacing(LENGTH_BORDER_WIDTH*2);

  if(warning_icon)
  {
    Gtk::Image* img = Gtk::manage(new Gtk::Image(warning_icon));
    hb->pack_start(*img, false, false);
  }
  l->set_markup(warning);
  l->set_alignment(0., 0.5);
  l->set_line_wrap(true);
  hb->pack_start(*l);

  if(warnings.get_children().size())
  {
    Gtk::HSeparator* s = Gtk::manage(new Gtk::HSeparator);
    s->show();
    warnings.pack_start(*s, false, false, LENGTH_SMALLSPACE);
  }

  hb->show_all_children();
  warnings.pack_start(*hb, false, false);
}
// 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;
}
Exemple #4
0
/**
 * Creates a combobox widget for an enumeration parameter.
 */
Gtk::Widget *ParamComboBox::get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal)
{
    if (_gui_hidden) {
        return NULL;
    }

    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
    Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_START));
    label->show();
    hbox->pack_start(*label, false, false, _indent);

    ParamComboBoxEntry * combo = Gtk::manage(new ParamComboBoxEntry(this, doc, node, changeSignal));
    // add choice strings:
    Glib::ustring settext;
    for (GSList * list = choices; list != NULL; list = g_slist_next(list)) {
        enumentry * entr = reinterpret_cast<enumentry *>(list->data);
        Glib::ustring text = entr->guitext;
        combo->append(text);

        if ( _value && !entr->value.compare(_value) ) {
            settext = entr->guitext;
        }
    }
    if (!settext.empty()) {
        combo->set_active_text(settext);
    }

    combo->show();
    hbox->pack_start(*combo, true, true);

    hbox->show();

    return dynamic_cast<Gtk::Widget *>(hbox);
}
PaletteWindow::PaletteWindow () :
	Gtk::Window()
{
	this->set_title("Meteor - Palette");
	this->set_resizable(false);

	m_bgPalette.set_size_request(161, 161);
	m_objPalette.set_size_request(161, 161);

	Gtk::Frame* bgframe = manage(new Gtk::Frame("BG palette"));
	bgframe->add(m_bgPalette);
	Gtk::Frame* objframe = manage(new Gtk::Frame("OBJ palette"));
	objframe->add(m_objPalette);

	Gtk::HBox* mainhbox = manage(new Gtk::HBox);
	mainhbox->pack_start(*bgframe);
	mainhbox->pack_start(*objframe);

	this->add(*mainhbox);

	m_bgPalette.signal_expose_event().connect(sigc::mem_fun(*this,
				&PaletteWindow::on_bg_expose));
	m_objPalette.signal_expose_event().connect(sigc::mem_fun(*this,
				&PaletteWindow::on_obj_expose));
	m_vblank_conn = AMeteor::_lcd.sig_vblank.connect(syg::mem_fun(*this,
				&PaletteWindow::on_vblank));
}
void StatusBarManager::addTextElement(const std::string& name, const std::string& icon, int pos)
{
	// Get a free position
	int freePos = getFreePosition(pos);

	Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox(false, 6));

	if (!icon.empty())
	{
		Gtk::Image* img = Gtk::manage(new Gtk::Image(
			GlobalUIManager().getLocalPixbuf(icon)
		));
		hbox->pack_start(*img, false, false, 0);
	}

	Gtk::Label* label = Gtk::manage(new Gtk::Label);
	hbox->pack_start(*label, false, false, 0);

	StatusBarElementPtr element(new StatusBarElement(Gtk::manage(new gtkutil::FramedWidget(*hbox)), label));

	// Store this element
	_elements.insert(ElementMap::value_type(name, element));
	_positions.insert(PositionMap::value_type(freePos, element));

	rebuildStatusBar();
}
WindowLevelToolButton::WindowLevelToolButton() {
	Gtk::HBox* hbox = manage(new Gtk::HBox);

	Gtk::Image* image = manage(new Gtk::Image);
	Glib::RefPtr<Gdk::Pixbuf> p = Aeskulap::IconFactory::load_from_file("cursor_windowlevel.png");
	if(p) {
		image->set(p);
	}
	image->show();
	//image->set_padding(6, 0);

	m_invert = manage(new Gtk::ToggleToolButton(*image));
	m_invert->set_size_request(32, 32);
	m_invert->set_tooltip(m_tooltips, gettext("Invert windowlevel"));
	m_invert->show();
	m_invert->signal_toggled().connect(sigc::mem_fun(*this, &WindowLevelToolButton::on_invert));

	Gtk::VBox* vbox = manage(new Gtk::VBox);

	vbox->pack_start(*m_invert, true, false);
	vbox->show();

	hbox->pack_start(*vbox, Gtk::PACK_SHRINK);

	vbox = manage(new Gtk::VBox);
	vbox->show();

	m_combo = manage(new Gtk::ComboBoxText);
	m_combo->set_size_request(-1, 32);
	m_combo->show();
	m_combo->signal_changed().connect(sigc::mem_fun(*this, &WindowLevelToolButton::on_changed));

	vbox->pack_start(*m_combo, true, false);

	hbox->pack_start(*vbox, Gtk::PACK_SHRINK);

	vbox = manage(new Gtk::VBox);
	vbox->show();

	image = manage(new Gtk::Image(Gtk::Stock::ADD, Gtk::ICON_SIZE_SMALL_TOOLBAR));
	image->show();

	Gtk::ToolButton* btn = manage(new Gtk::ToolButton(*image));
	btn->set_size_request(32, 32);
	btn->set_tooltip(m_tooltips, gettext("Add new windowlevel preset"));
	btn->show();
	btn->signal_clicked().connect(sigc::mem_fun(*this, &WindowLevelToolButton::on_add));

	vbox->pack_start(*btn, true, false);
	hbox->pack_start(*vbox, true,false);
	
	hbox->show();

	add(*hbox);

	update();
	m_widgetlist.insert(this);
}
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;
}
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 ();

		}
	}
}
void c_PreferencesDlg::InitControls()
{
    for (const Utils::Const::Language_t &lang: Utils::Const::languages)
    {
        m_UILanguage.append(lang.name == Utils::Const::SYSTEM_DEFAULT_LANG ? _("System language") : lang.name);
        if (lang.langId == std::string(Configuration::UILanguage))
            m_UILanguage.set_active(m_UILanguage.get_model()->children().size()-1);
    }

    get_content_area()->pack_start(*Utils::PackIntoBox<Gtk::HBox>( {
                                        Gtk::manage(new Gtk::Label(_("User interface language:"))),
                                        &m_UILanguage } ),
                                   Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels);

    int iconSizePx;
    Gtk::IconSize::lookup(Configuration::GetToolIconSize(), iconSizePx, iconSizePx);
    m_ToolIconSize.set_adjustment(Gtk::Adjustment::create(iconSizePx, MIN_ICON_SIZE_PIX, MAX_ICON_SIZE_PIX));
    m_ToolIconSize.set_digits(0);
    m_ToolIconSize.set_value_pos(Gtk::PositionType::POS_LEFT);
    for (unsigned sizeMark: { 8, 16, 24, 32, 40, 64, 80, 100, 128 })
        m_ToolIconSize.add_mark(sizeMark, Gtk::PositionType::POS_TOP, Glib::ustring::format(sizeMark));

    Gtk::HBox *boxToolIconSize = Gtk::manage(new Gtk::HBox());
    boxToolIconSize->pack_start(*Gtk::manage(new Gtk::Label(_("Tool icon size:"))), Gtk::PackOptions::PACK_SHRINK);
    boxToolIconSize->pack_start(m_ToolIconSize);
    boxToolIconSize->set_spacing(10);
    boxToolIconSize->show_all();

    get_content_area()->pack_start(*boxToolIconSize, Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels);

    m_ExportInactiveFramesQuality.set_label(_("Include inactive frames when exporting quality data"));
    m_ExportInactiveFramesQuality.set_active(Configuration::ExportInactiveFramesQuality);
    m_ExportInactiveFramesQuality.show();
    get_content_area()->pack_start(m_ExportInactiveFramesQuality, Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels);

    m_NumQualHistBins.set_adjustment(Gtk::Adjustment::create(Configuration::NumQualityHistogramBins, 10, Utils::Const::MaxQualityHistogramBins,
            1, 10, 10));
    get_content_area()->pack_start(*Utils::PackIntoBox<Gtk::HBox>(
            { Gtk::manage(new Gtk::Label(_("Number of frame quality histogram bins:"))),
              &m_NumQualHistBins }),
            Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels);

    auto separator = Gtk::manage(new Gtk::Separator());
    separator->show();
    get_content_area()->pack_end(*separator, Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels);

    add_button(_("OK"), Gtk::RESPONSE_OK);
    add_button(_("Cancel"), Gtk::RESPONSE_CANCEL);

    //FIXME: not working when a Gtk::Entry has focus! #### set_default(*get_widget_for_response(Gtk::ResponseType::RESPONSE_OK));
}
SelectionSetToolmenu::SelectionSetToolmenu() :
	Gtk::ToolItem(),
	_listStore(Gtk::ListStore::create(_columns)),
	_clearSetsButton(NULL),
	_entry(Gtk::manage(new Gtk::ComboBoxEntry(_listStore, _columns.name)))
{
	// Hbox containing all our items
	Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox(false, 3));
	add(*hbox);

	// Pack Label
	hbox->pack_start(
		*Gtk::manage(new gtkutil::LeftAlignedLabel(_("Selection Set: "))),
		false, false, 0);

	// Pack Combo Box
	hbox->pack_start(*_entry, true, true, 0);

	// Add tooltip
	_entry->set_tooltip_markup(_(ENTRY_TOOLTIP));

	// Add clear button
	{
		Gtk::Image* image = Gtk::manage(new Gtk::Image(GlobalUIManager().getLocalPixbufWithMask("delete.png")));
		image->show();

		_clearSetsButton = Gtk::manage(new Gtk::ToolButton(*image, _("Clear Selection Sets")));

		// Set tooltip
		_clearSetsButton->set_tooltip_text(_("Clear Selection Sets"));

		// Connect event
		_clearSetsButton->signal_clicked().connect(sigc::mem_fun(*this, &SelectionSetToolmenu::onDeleteAllSetsClicked));

		hbox->pack_start(*_clearSetsButton, false, false, 0);
	}

	// Connect the signals
	Gtk::Entry* childEntry = _entry->get_entry();
	childEntry->signal_activate().connect(sigc::mem_fun(*this, &SelectionSetToolmenu::onEntryActivated));

	_entry->signal_changed().connect(sigc::mem_fun(*this, &SelectionSetToolmenu::onSelectionChanged));

	// Populate the list
	update();

	// Add self as observer
	GlobalSelectionSetManager().addObserver(*this);

	show_all();
}
Exemple #12
0
void VRGuiVectorEntry::init(string placeholder, string label,  sigc::slot<void, OSG::Vec3f&> sig) {
    Gtk::Fixed* ph;
    VRGuiBuilder()->get_widget(placeholder.c_str(), ph);
    Gtk::Container* frame = ph->get_parent();
    frame->remove(*ph);

    Gtk::HBox* hb = new Gtk::HBox();
    frame->add(*hb);

    Gtk::Label* lbl = new Gtk::Label();
    lbl->set_text(label.c_str());
    lbl->set_size_request(50, -1);

    ex = new Gtk::Entry();
    ey = new Gtk::Entry();
    ez = new Gtk::Entry();
    ex->set_has_frame(false);
    ey->set_has_frame(false);
    ez->set_has_frame(false);
    ex->set_size_request(50, -1);
    ey->set_size_request(50, -1);
    ez->set_size_request(50, -1);

    Gtk::VSeparator *s1, *s2, *s3;
    s1 = new Gtk::VSeparator();
    s2 = new Gtk::VSeparator();
    s3 = new Gtk::VSeparator();

    hb->pack_start(*lbl, false, false, 2);
    hb->pack_start(*s1, false, false, 0);
    hb->pack_start(*ex, false, false, 0);
    hb->pack_start(*s2, false, false, 0);
    hb->pack_start(*ey, false, false, 0);
    hb->pack_start(*s3, false, false, 0);
    hb->pack_start(*ez, false, false, 0);
    frame->show_all();

    sigc::slot<bool,GdkEventFocus*> sif = sigc::bind(&VRGuiVectorEntry::proxy, sig, ex, ey, ez);
    ex->signal_focus_out_event().connect( sif );
    ey->signal_focus_out_event().connect( sif );
    ez->signal_focus_out_event().connect( sif );

    sigc::slot<bool> sia_b = sigc::bind<GdkEventFocus*>(&VRGuiVectorEntry::proxy, 0, sig, ex, ey, ez);
    sigc::slot<void> sia = sigc::hide_return( sia_b );
    ex->signal_activate().connect(sia);
    ey->signal_activate().connect(sia);
    ez->signal_activate().connect(sia);
}
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));
}
// Main constructor
TexturePropertyEditor::TexturePropertyEditor(Entity* entity,
											 const std::string& name,
											 const std::string& options)
: PropertyEditor(entity),
  _prefixes(options),
  _key(name)
{
	// Construct the main widget (will be managed by the base class)
	Gtk::VBox* mainVBox = new Gtk::VBox(false, 6);

	// Register the main widget in the base class
	setMainWidget(mainVBox);

	Gtk::VBox* outer = Gtk::manage(new Gtk::VBox(false, 0));
	Gtk::HBox* editBox = Gtk::manage(new Gtk::HBox(false, 3));

	// Create the browse button
	Gtk::Button* browseButton = Gtk::manage(new Gtk::Button(_("Choose texture...")));
	browseButton->set_image(*Gtk::manage(new Gtk::Image(
		PropertyEditorFactory::getPixbufFor("texture"))));

	browseButton->signal_clicked().connect(
		sigc::mem_fun(*this, &TexturePropertyEditor::_onBrowse));

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

	mainVBox->pack_start(*outer, true, true, 0);
}
std::string DialogBoxFactory::showTextEntryDialog(Glib::ustring MessageText,
    Glib::ustring LabelText)
{
  Gtk::Dialog Dialog;

  Gtk::Label Message(MessageText);

  Gtk::Label Label(LabelText);
  Gtk::Entry Entry;
  Gtk::HBox Box;
  Box.pack_start(Label);
  Box.pack_start(Entry);

  Dialog.get_vbox()->pack_start(Message, true, true, 10);
  Dialog.get_vbox()->pack_start(Box, true, true, 10);

  Dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
  Dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);

  Dialog.show_all_children();

  if (Dialog.run() == Gtk::RESPONSE_OK)
    return Entry.get_text();

  return "";
}
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();
}
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);
}
// Main constructor
SkinPropertyEditor::SkinPropertyEditor(Entity* entity,
									   const std::string& name,
									   const std::string& options)
: PropertyEditor(entity),
  _key(name)
{
	// Construct the main widget (will be managed by the base class)
	Gtk::VBox* mainVBox = new Gtk::VBox(false, 6);

	// Register the main widget in the base class
	setMainWidget(mainVBox);

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

	// Create the browse button
	Gtk::Button* browseButton = Gtk::manage(new Gtk::Button(_("Choose skin...")));
	browseButton->set_image(*Gtk::manage(new Gtk::Image(
		PropertyEditorFactory::getPixbufFor("skin"))));

	browseButton->signal_clicked().connect(
		sigc::mem_fun(*this, &SkinPropertyEditor::_onBrowseButton));

	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);

	mainVBox->pack_start(*vbx, true, true, 0);
}
Exemple #19
0
/** \brief  Create a label for the description */
Gtk::Widget *
ParamDescription::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal<void> * /*changeSignal*/)
{
	if (_gui_hidden) {
        return NULL;
    }

    Glib::ustring newguitext;

    if (_context != NULL) {
        newguitext = g_dpgettext2(NULL, _context, _value);
    } else {
        newguitext = _(_value);
    }
    
    Gtk::Label * label;
    int padding = 12 + _indent;
    if (_mode == HEADER) {
        label = Gtk::manage(new Gtk::Label(Glib::ustring("<b>") +newguitext + Glib::ustring("</b>"), Gtk::ALIGN_START));
        label->set_padding(0,5);
        label->set_use_markup(true);
        padding = _indent;
    } else {
        label = Gtk::manage(new Gtk::Label(newguitext, Gtk::ALIGN_START));
    }
    label->set_line_wrap();
    label->show();

    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));
    hbox->pack_start(*label, true, true, padding);
    hbox->show();

    return hbox;
}
// Create the main conversation editing widgets
Gtk::Widget& ConversationDialog::createConversationsPanel()
{
	// Tree view
	_convView = Gtk::manage(new Gtk::TreeView(_convList));
	_convView->set_headers_visible(true);

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

	// Key and value text columns
	_convView->append_column(*Gtk::manage(new gtkutil::TextColumn("#", _convColumns.index, false)));
	_convView->append_column(*Gtk::manage(new gtkutil::TextColumn(_("Name"), _convColumns.name, false)));

	// Beside the list is an vbox containing add, edit, delete and clear buttons
	_convButtonPanel = Gtk::manage(new Gtk::VBox(false, 6));

    // Buttons panel box is disabled by default, enabled once an Entity is selected.
    _convButtonPanel->set_sensitive(false);

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

	_editConvButton = Gtk::manage(new Gtk::Button(Gtk::Stock::EDIT));
	_editConvButton->set_sensitive(false); // not enabled without selection
	_editConvButton->signal_clicked().connect(sigc::mem_fun(*this, &ConversationDialog::onEditConversation));

	_delConvButton = Gtk::manage(new Gtk::Button(Gtk::Stock::DELETE));
	_delConvButton->set_sensitive(false); // not enabled without selection
	_delConvButton->signal_clicked().connect(sigc::mem_fun(*this, &ConversationDialog::onDeleteConversation));

	_clearConvButton = Gtk::manage(new Gtk::Button(Gtk::Stock::CLEAR));
	_clearConvButton->set_sensitive(false); // requires >0 conversations
	_clearConvButton->signal_clicked().connect(sigc::mem_fun(*this, &ConversationDialog::onClearConversations));

	_convButtonPanel->pack_start(*addButton, false, false, 0);
	_convButtonPanel->pack_start(*_editConvButton, false, false, 0);
	_convButtonPanel->pack_start(*_delConvButton, false, false, 0);
	_convButtonPanel->pack_start(*_clearConvButton, false, false, 0);

	// Pack the list and the buttons into an hbox
	Gtk::HBox* hbx = Gtk::manage(new Gtk::HBox(false, 6));

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

	return *hbx;
}
MD5AnimationViewer::MD5AnimationViewer() :
	gtkutil::BlockingTransientWindow(_("MD5 Animation Viewer"), GlobalMainFrame().getTopLevelWindow()),
	_modelList(Gtk::TreeStore::create(_modelColumns)),
	_modelPopulator(_modelList),
	_animList(Gtk::ListStore::create(_animColumns)),
	_preview(new AnimationPreview)
{
	// Set the default border width in accordance to the HIG
	set_border_width(12);
	set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);

	// Set the default size of the window
	const Glib::RefPtr<Gtk::Window>& mainWindow = GlobalMainFrame().getTopLevelWindow();

	Gdk::Rectangle rect = gtkutil::MultiMonitor::getMonitorForWindow(mainWindow);
	int height = static_cast<int>(rect.get_height() * 0.6f);

	set_default_size(
		static_cast<int>(rect.get_width() * 0.8f), height
	);

	// Set the default size of the window
	_preview->setSize(rect.get_width() * 0.2f, height);

	// Main dialog vbox
	Gtk::VBox* vbox = Gtk::manage(new Gtk::VBox(false, 12));

	// Create a horizontal box to pack the treeview on the left and the preview on the right
	Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox(false, 6));

	hbox->pack_start(createListPane(), true, true, 0);

	Gtk::VBox* previewBox = Gtk::manage(new Gtk::VBox(false, 0));
	previewBox->pack_start(*_preview, true, true, 0);

	hbox->pack_start(*previewBox, true, true, 0);

	vbox->pack_start(*hbox, true, true, 0);
	vbox->pack_end(createButtons(), false, false, 0);

	// Add main vbox to dialog
	add(*vbox);

	// Populate with model names
	populateModelList();
}
Exemple #22
0
void InitWindow::FillMainBox()
{
	Gtk::VBox* 		vbox = get_vbox();
	Gtk::HBox*		hbox = Gtk::manage( new Gtk::HBox );

	// Add table editor
	//
	Gtk::Frame* charFrame = Gtk::manage( new Gtk::Frame( gettext("Characters") ) );
	//
	charFrame->add( f_charTable );
	//
	hbox->pack_start( *charFrame );

	Gtk::Frame* monsterFrame = Gtk::manage( new Gtk::Frame( gettext("Monsters") ) );
	//
	monsterFrame->add( f_monsterTable );
	//
	hbox->pack_start( *monsterFrame );
	vbox->pack_start( *hbox );

	const bool alternative_order = alternative_button_order( Glib::RefPtr<const Gdk::Screen>(0) );
	//
	if( alternative_order )
	{
		// Windows order, OK on the left, Cancel on the right
		f_acceptButton = add_button( Gtk::Stock::APPLY , Gtk::RESPONSE_OK );
	}
	//
	if( f_allowCancel )
	{
		f_cancelButton = add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL );
	}
	else
	{
		f_resetButton = add_button( Gtk::Stock::REVERT_TO_SAVED, Gtk::RESPONSE_REJECT );
	}
	//
	if( !alternative_order )
	{
		// Other order like Gnome2 or MacOS
		//
		f_acceptButton = add_button( Gtk::Stock::APPLY , Gtk::RESPONSE_OK );
	}

	show_all_children();
}
Exemple #23
0
int
NetLogGuiGtkWindow::on_service_added(fawkes::NetworkService *service)
{
  if ( ntb_logviewers.get_n_pages() == 0 ) {
    lab_no_connection->hide();
    //Gtk::Container *thiscon = this;
    //thiscon->remove(lab_no_connection);
    //add(ntb_logviewers);
    ntb_logviewers.show();
  }

  Gtk::HBox *hbox = Gtk::manage(new Gtk::HBox(false, 4));
  Gtk::Button *button = Gtk::manage(new Gtk::Button());
  Gtk::Image *image = Gtk::manage(new Gtk::Image(Gtk::Stock::CONNECT, Gtk::ICON_SIZE_BUTTON));
  button->add(*image);
  button->set_relief(Gtk::RELIEF_NONE);
  Gtk::Label *label = Gtk::manage(new Gtk::Label());
  label->set_markup(Glib::ustring("<b>") + service->host() + "</b>\n" + service->addr_string());
  label->set_line_wrap();
  Gtk::Label *invisible = Gtk::manage(new Gtk::Label(Glib::ustring(service->name()) + "::" + service->type() + "::" + service->domain()));
  Gtk::ScrolledWindow *scrolled = Gtk::manage(new Gtk::ScrolledWindow());
  scrolled->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
  LogView *logview =
    Gtk::manage(new LogView(service->addr_string().c_str(), service->port()));
  //scrolled->add(*logview);

  hbox->pack_start(*button);
  hbox->pack_start(*label);
  hbox->pack_start(*invisible);

  button->signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &NetLogGuiGtkWindow::on_connbut_clicked), image, logview));
  logview->get_connection_dispatcher()->signal_connected().connect(sigc::bind(sigc::mem_fun(*this, &NetLogGuiGtkWindow::on_connected), image));
  logview->get_connection_dispatcher()->signal_disconnected().connect(sigc::bind(sigc::mem_fun(*this, &NetLogGuiGtkWindow::on_disconnected), image));

  scrolled->show();
  label->show();
  image->show();
  button->show();
  logview->show();
  hbox->show();

  int rv = ntb_logviewers.append_page(*logview, *hbox);

  return rv;
}
void EffectEditor::populateWindow()
{
	// Create the overall vbox
	_dialogVBox = Gtk::manage(new Gtk::VBox(false, 3));
	add(*_dialogVBox);

	Gtk::HBox* effectHBox = Gtk::manage(new Gtk::HBox(false, 0));

	_effectTypeCombo = Gtk::manage(new Gtk::ComboBox(static_cast<const Glib::RefPtr<Gtk::TreeModel>&>(_effectStore)));

	// Add the cellrenderer for the caption
	Gtk::CellRendererText* captionRenderer = Gtk::manage(new Gtk::CellRendererText);
	_effectTypeCombo->pack_start(*captionRenderer, false);
	_effectTypeCombo->add_attribute(captionRenderer->property_text(), _effectColumns.caption);

	Gtk::Label* effectLabel = Gtk::manage(new gtkutil::LeftAlignedLabel(_("Effect:")));

	effectHBox->pack_start(*effectLabel, false, false, 0);
	effectHBox->pack_start(*Gtk::manage(new gtkutil::LeftAlignment(*_effectTypeCombo, 12, 1.0f)),
		true, true, 0
	);

	_dialogVBox->pack_start(*effectHBox, false, false, 3);

	_stateToggle = Gtk::manage(new Gtk::CheckButton(_("Active")));
	_stateToggle->signal_toggled().connect(sigc::mem_fun(*this, &EffectEditor::onStateToggle));

	_dialogVBox->pack_start(*_stateToggle, false, false, 3);

	Gtk::Label* argLabel =
		Gtk::manage(new gtkutil::LeftAlignedLabel(std::string("<b>") + _("Arguments") + "</b>"));
	_dialogVBox->pack_start(*argLabel, false, false, 0);

	Gtk::Button* saveButton = Gtk::manage(new Gtk::Button(Gtk::Stock::APPLY));
	saveButton->signal_clicked().connect(sigc::mem_fun(*this, &EffectEditor::onSave));

	Gtk::Button* cancelButton = Gtk::manage(new Gtk::Button(Gtk::Stock::CANCEL));
	cancelButton->signal_clicked().connect(sigc::mem_fun(*this, &EffectEditor::onCancel));

	Gtk::HBox* buttonHBox = Gtk::manage(new Gtk::HBox(false, 0));
	buttonHBox->pack_end(*saveButton, false, false, 0);
	buttonHBox->pack_end(*cancelButton, false, false, 6);

	_dialogVBox->pack_end(*buttonHBox, false, false, 3);
}
Gtk::Widget& CustomStimEditor::createListButtons()
{
	Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox(true, 6));

	_listButtons.add = Gtk::manage(new Gtk::Button(_("Add Stim Type")));
	_listButtons.add->set_image(*Gtk::manage(new Gtk::Image(Gtk::Stock::ADD, Gtk::ICON_SIZE_BUTTON)));

	_listButtons.remove = Gtk::manage(new Gtk::Button(_("Remove Stim Type")));
	_listButtons.remove->set_image(*Gtk::manage(new Gtk::Image(Gtk::Stock::DELETE, Gtk::ICON_SIZE_BUTTON)));

	hbox->pack_start(*_listButtons.add, true, true, 0);
	hbox->pack_start(*_listButtons.remove, true, true, 0);

	_listButtons.add->signal_clicked().connect(sigc::mem_fun(*this, &CustomStimEditor::onAddStimType));
	_listButtons.remove->signal_clicked().connect(sigc::mem_fun(*this, &CustomStimEditor::onRemoveStimType));

	return *hbox;
}
void TabAdminConfigConsultas::initTabConfig() {
    get_widget(ENTRY_TAB_LABEL, pEntryTabLabel);
    get_widget_derived(VBOX_TAB_CONFIG, pTabVista);

    Gtk::HBox* pHBoxTabSelec;
    get_widget(HBOX_TAB_SELEC, pHBoxTabSelec);
    pHBoxTabSelec->pack_start(comboTabSelec, false, false);
    comboTabSelec.show();
}
Exemple #27
0
TreeViewTooltips::TreeViewTooltips(BuddyView* view): m_buddyview(view)
                , Window(Gtk::WINDOW_POPUP)
{
        this->set_decorated(false);
        this->set_skip_pager_hint(true);
        this->set_skip_taskbar_hint(true);
        this->set_name("gtk-tooltips");
        this->set_position(Gtk::WIN_POS_MOUSE);
        this->set_resizable(false);
        this->set_border_width(4);
        this->set_app_paintable(true);
        this->property_can_focus() = false;

        m_label = Gtk::manage(new Gtk::Label());
        m_label->set_line_wrap(true);
        m_label->set_alignment(0.5, 0.5);
        m_label->set_use_markup(true);

        m_avatar = Gtk::manage(new Gtk::Image());
        Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox());
        Gtk::Image* logo = getImage("default.png");
        hbox->pack_start(*logo);
        hbox->pack_start(*m_label);
        hbox->pack_start(*m_avatar);
        hbox->show_all();

        add
                (*hbox);

        add_events(Gdk::POINTER_MOTION_MASK);

        this->signal_expose_event().connect(sigc::mem_fun(*this,
                                            &TreeViewTooltips::on_expose_event));

	/*
        this->signal_motion_notify_event().connect(sigc::mem_fun(
                                *this, &TreeViewTooltips::on_motion_event), false);

        this->signal_leave_notify_event().connect(sigc::mem_fun(
                                *this, &TreeViewTooltips::on_leave_event), false);
	*/

}
CreadorNivel::CreadorNivel(int idProximoNivel,
		InformableSeleccion* informable) {
	this->idProximoNivel = idProximoNivel;
	this->informable = informable;
	// Widgets sin funcionalidad
	Gtk::Label* etiquetaTamanio = manage(new Gtk::Label(
						"Seleccione el tamaño que tendra el escenario: "));
	Gtk::Label* etiquetaDuracion = manage(new Gtk::Label(
						"Seleccione la duración del nivel (en segundos): "));
	Gtk::Label* etiquetaImagen = manage(new Gtk::Label(
						"Seleccione la imagen de fondo del nivel: "));
	Gtk::Label* etiquetaImagenSuelo = manage(new Gtk::Label(
						"Seleccione la imagen del suelo del nivel: "));
	// Widgets con funcionalidad
	selectorTamanio.append_text("Chico");
	selectorTamanio.append_text("Mediano");
	selectorTamanio.append_text("Grande");
	selectorTamanio.set_active_text("Mediano");
	ajuste = new Gtk::Adjustment(1.0, 15.0, MAXIMA_DURACION_NIVEL);
	selectorDuracion = new Gtk::SpinButton(*ajuste);
	selectorDuracion->set_editable(false);
	archivoImagenFondo = new Gtk::Entry();
	archivoImagenSuelo = new Gtk::Entry();
	archivoImagenFondo->set_editable(false);
	archivoImagenSuelo->set_editable(false);
	botonExaminarFondo = new Gtk::Button("Examinar...");
	botonExaminarSuelo = new Gtk::Button("Examinar...");
	// Contenedores
	Gtk::HBox* cajaHorizontalUno = manage(new Gtk::HBox(false, 20));
	cajaHorizontalUno->pack_start(*etiquetaTamanio);
	cajaHorizontalUno->pack_start(selectorTamanio);
	Gtk::HBox* cajaHorizontalDos = manage(new Gtk::HBox(false, 20));
	cajaHorizontalDos->pack_start(*etiquetaDuracion);
	cajaHorizontalDos->pack_start(*selectorDuracion);
	Gtk::HBox* cajaHorizontalTres = manage(new Gtk::HBox(false, 20));
	cajaHorizontalTres->pack_start(*etiquetaImagen);
	cajaHorizontalTres->pack_start(*botonExaminarFondo);
	Gtk::HBox* cajaHorizontalCuatro = manage(new Gtk::HBox(false, 20));
	cajaHorizontalCuatro->pack_start(*etiquetaImagenSuelo);
	cajaHorizontalCuatro->pack_start(*botonExaminarSuelo);
	Gtk::VBox* cajaVerticalAuxiliar = manage(new Gtk::VBox(false, 20));
	cajaVerticalAuxiliar->pack_start(*cajaHorizontalTres);
	cajaVerticalAuxiliar->pack_start(*archivoImagenFondo);
	Gtk::VBox* cajaVerticalAuxiliarDos = manage(new Gtk::VBox(false, 20));
	cajaVerticalAuxiliarDos->pack_start(*cajaHorizontalCuatro);
	cajaVerticalAuxiliarDos->pack_start(*archivoImagenSuelo);
	Gtk::VBox* cajaVertical = manage(new Gtk::VBox(false, 30));
	cajaVertical->pack_start(*cajaHorizontalUno);
	cajaVertical->pack_start(*cajaHorizontalDos);
	cajaVertical->pack_start(*cajaVerticalAuxiliar);
	cajaVertical->pack_start(*cajaVerticalAuxiliarDos);
	add(*cajaVertical);
	// Seniales
	botonExaminarFondo->signal_clicked().connect(sigc::mem_fun(*this,
										&CreadorNivel::botonExaminarClickeado));
	botonExaminarSuelo->signal_clicked().connect(sigc::mem_fun(*this,
								&CreadorNivel::botonExaminarClickeadoSuelo));
}
Exemple #29
0
/**
    \brief  Creates a Float Adjustment for a float parameter

    Builds a hbox with a label and a float adjustment in it.
*/
Gtk::Widget *
ParamFloat::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal)
{
	if (_gui_hidden) return NULL;

    Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4));

    Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_LEFT));
    label->show();
    hbox->pack_start(*label, true, true);

    ParamFloatAdjustment * fadjust = Gtk::manage(new ParamFloatAdjustment(this, doc, node, changeSignal));
    Gtk::SpinButton * spin = Gtk::manage(new Gtk::SpinButton(*fadjust, 0.1, _precision));
    spin->show();
    hbox->pack_start(*spin, false, false);

    hbox->show();

    return dynamic_cast<Gtk::Widget *>(hbox);
}
ParticlesChooser::ParticlesChooser() :
	gtkutil::BlockingTransientWindow(_("Choose particles"), GlobalMainFrame().getTopLevelWindow()),
	_particlesList(Gtk::ListStore::create(COLUMNS())),
	_selectedParticle(""),
	_preview(new gtkutil::ParticlePreview)
{
	set_border_width(12);

	// Set the default size of the window
	const Glib::RefPtr<Gtk::Window>& mainWindow = GlobalMainFrame().getTopLevelWindow();

	Gdk::Rectangle rect = gtkutil::MultiMonitor::getMonitorForWindow(mainWindow);
	int height = static_cast<int>(rect.get_height() * 0.6f);

	set_default_size(
		static_cast<int>(rect.get_width() * 0.4f), height
	);

	// Set the default size of the window
	_preview->setSize(rect.get_width() * 0.2f, height);

	// Main dialog vbox
	Gtk::VBox* vbox = Gtk::manage(new Gtk::VBox(false, 12));

	// Create a horizontal box to pack the treeview on the left and the preview on the right
	Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox(false, 6));

	hbox->pack_start(createTreeView(), true, true, 0);

	Gtk::VBox* previewBox = Gtk::manage(new Gtk::VBox(false, 0));
	previewBox->pack_start(*_preview, true, true, 0);

	hbox->pack_start(*previewBox, true, true, 0);

	vbox->pack_start(*hbox, true, true, 0);
	vbox->pack_end(createButtons(), false, false, 0);

	// Add main vbox to dialog
	add(*vbox);
}