// 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);
}
Example #2
0
void Audiotheque::GetAlbums(Glib::ustring artist)
{
	std::vector<Gtk::Widget*> children = hbox.get_children();
	for(std::vector<Gtk::Widget*>::iterator it=children.begin()+1; it!=children.end(); it++)
		hbox.remove(**it);

	vbox = Gtk::manage(new Gtk::VBox(false,2));
	vbox->set_size_request(300,0);

	Gtk::Button* button;
	std::string path = dirpath+"/"+artist;
	DIR* rep = opendir(path.c_str());

	button = Gtk::manage(new Gtk::Button("Tous les albums"));
	button->signal_clicked().connect(sigc::bind<Glib::ustring>(sigc::mem_fun(*this,&Audiotheque::GetAllSongsBy),artist));
	vbox->pack_start(*button,Gtk::PACK_SHRINK);

	if(rep!=NULL) {
		struct dirent* ent;
		std::string here = ".";
		std::string parent = "..";
		while((ent=readdir(rep))!=NULL) {
			if(here.compare(ent->d_name)!=0 && parent.compare(ent->d_name)!=0) {
				button = Gtk::manage(new Gtk::Button(ent->d_name));
				button->signal_clicked().connect(sigc::bind<Glib::ustring>(sigc::mem_fun(*this,&Audiotheque::GetSongs),artist+"/"+ent->d_name));
				vbox->pack_start(*button,Gtk::PACK_SHRINK);
			}
		}
		closedir(rep);
	}	

	hbox.pack_start(*vbox,Gtk::PACK_SHRINK);

	hbox.show_all_children();
}
void dialog::operate4(Image imag,std::string filename)
{
    set_default_size(300, 50);
    set_border_width(10);
    set_position(Gtk::WIN_POS_CENTER);
    set_resizable(false);

    Gtk::Box *vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0));
    add(*vbox);

    Gtk::Grid *grid = Gtk::manage(new Gtk::Grid);
    vbox->add(*grid);

    Gtk::Label *label = Gtk::manage(new Gtk::Label("File Name :"));
    grid->attach(*label,0,0,1,1);
    Gtk::Entry *bvalue = Gtk::manage(new Gtk::Entry());
    grid->attach(*bvalue, 1, 0, 1, 1);
    Gtk::Label *label2 = Gtk::manage(new Gtk::Label(".bmp"));
    grid->attach(*label2,2,0,1,1);

    set_title("Save As");
    bvalue->set_text("Untitled");
    bvalue->set_max_length(50);

    Gtk::Button *bok = Gtk::manage(new Gtk::Button("OK"));
    bok->signal_clicked().connect(sigc::bind<Gtk::Entry*>(sigc::mem_fun(*this, &dialog::on_bok4_click), bvalue,imag,filename));
    grid->attach(*bok, 2, 2, 1, 1);
    show_all_children();
}
    virtual void do_refresh_form_data()
    {
        Gtk::Entry *entry;
        xml()->get_widget("name_entry", entry);

        Gtk::TextView *tview;
        xml()->get_widget("text_view", tview);

        Gtk::ComboBox *combo;
        xml()->get_widget("collation_combo", combo);

        Gtk::Button *btn;
        xml()->get_widget("refactor_btn", btn);

        if (_be)
        {
            set_selected_combo_item(combo, _be->get_schema_option_by_name("CHARACTER SET - COLLATE"));

            _old_name = _be->get_name();
            entry->set_text(_old_name);

            tview->get_buffer()->set_text(_be->get_comment());

            bool is_editing_live_obj= is_editing_live_object();
            tview->set_sensitive(!is_editing_live_obj);
            Gtk::Label *tlabel;
            xml()->get_widget("label5", tlabel);
            tlabel->set_sensitive(!is_editing_live_obj);
            btn->set_sensitive(_be->refactor_possible());
        }
    }
Example #5
0
void Audiotheque::GetArtists()
{
	vbox = Gtk::manage(new Gtk::VBox(false,2));
	vbox->set_size_request(300,0);

	Gtk::Button* button;
	DIR* rep = opendir(dirpath.c_str());

	button = Gtk::manage(new Gtk::Button("Tous les artistes"));
	button->signal_clicked().connect(sigc::mem_fun(*this,&Audiotheque::GetAllAlbums));
	vbox->pack_start(*button,Gtk::PACK_SHRINK);

	if(rep!=NULL) {
		struct dirent* ent;
		std::string here = ".";
		std::string parent = "..";
		while((ent=readdir(rep))!=NULL) {
			if(here.compare(ent->d_name)!=0 && parent.compare(ent->d_name)!=0) {
				button = Gtk::manage(new Gtk::Button(ent->d_name));
				button->signal_clicked().connect(sigc::bind<Glib::ustring>(sigc::mem_fun(*this,&Audiotheque::GetAlbums),ent->d_name));
				vbox->pack_start(*button,Gtk::PACK_SHRINK);
			}
		}
		closedir(rep);
	}
}
// 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);
}
Example #7
0
Glib::ustring Document::keyReplaceDialog (
	Glib::ustring const &original,
	Glib::ustring const &replacement,
	const char *message_text)
{
	Glib::ustring message = String::ucompose (
		"<big><b>%1</b></big>\n\n%2",
		_("Key naming conflict"),
		String::ucompose (
			message_text,
			original, replacement));

	Gtk::MessageDialog dialog (message, true, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, true);
	Gtk::Button *button;

	button = dialog.add_button (_("_Ignore"), Gtk::RESPONSE_CANCEL);
	Gtk::Image *noImage = Gtk::manage (new Gtk::Image (Gtk::Stock::NO, Gtk::ICON_SIZE_BUTTON));
	button->set_image (*noImage);

	button = dialog.add_button (_("_Replace"), Gtk::RESPONSE_ACCEPT);
	Gtk::Image *yesImage = Gtk::manage (new Gtk::Image (Gtk::Stock::YES, Gtk::ICON_SIZE_BUTTON));
	button->set_image (*yesImage);
	dialog.set_default_response (Gtk::RESPONSE_ACCEPT);

	if (dialog.run () == Gtk::RESPONSE_ACCEPT)
		return replacement;
	else
		return original;
}
// 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;
}
Example #9
0
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();
}
SnalpAddLanguageDialog::SnalpAddLanguageDialog( GladeRef gladeref , boost::shared_ptr<SnalpSignals> _signals )
: dialog(0),entry(0),signals(_signals)
{
    try
    {
        Gtk::Button * button = 0;
        gladeref->get_widget<Gtk::Dialog>("AddLanguageDialog",dialog);
        gladeref->get_widget<Gtk::Entry>("LanguageDialogEntry",entry);
        gladeref->get_widget<Gtk::Button>("AddLanguageDialogOkButton",button);
        button->signal_clicked().connect(sigc::mem_fun(*this,&SnalpAddLanguageDialog::OnAccept));        
        gladeref->get_widget<Gtk::Button>("AddLanguageDialogCancelButton",button);
        button->signal_clicked().connect(sigc::mem_fun(*dialog,&Gtk::Dialog::hide));        
        
    }
    catch( Gnome::Glade::XmlError const & xml_error )
    {
        THROW_SNALP_EXCEPTION(SnalpFatalException,xml_error.what());
    }
    catch( std::exception const & e )
    {
        THROW_SNALP_EXCEPTION(SnalpFatalException,e.what());
    }
    catch( Glib::Exception const & e )
    {
        THROW_SNALP_EXCEPTION(SnalpFatalException,e.what());
    }
    catch( ... )
    {
        THROW_SNALP_EXCEPTION(SnalpFatalException, "Unknown exception caught" );
    }
}
Example #11
0
GtkMainWindow::GtkMainWindow() :
	m_core(Application::getSingleton()->getCore())
{
	this->set_position(Gtk::WIN_POS_CENTER);
	this->set_default_size(800, 500);

	header = Gtk::manage(new Gtk::HeaderBar());
	header->set_title("gTorrent");
	header->set_show_close_button(true);

	// This needs to be refactored

	Gtk::Button *btn = Gtk::manage(new Gtk::Button());
	btn->set_label("Add");
	btn->signal_clicked().connect(sigc::mem_fun(*this, &GtkMainWindow::onAddBtnClicked));
	header->add(*btn);

	Gtk::Button *btn_m = Gtk::manage(new Gtk::Button());
	btn_m->set_label("Add Link");
	btn_m->signal_clicked().connect(sigc::mem_fun(*this, &GtkMainWindow::onAddMagnetBtnClicked));
	header->add(*btn_m);

	this->set_titlebar(*header);

	m_treeview = Gtk::manage(new GtkTorrentTreeView());
	this->add(*m_treeview);

	Glib::signal_timeout().connect(sigc::mem_fun(*this, &GtkMainWindow::onSecTick), 10);
	this->signal_delete_event().connect(sigc::mem_fun(*this, &GtkMainWindow::onDestroy));

	this->show_all();
}
// Main constructor
ModalProgressDialog::ModalProgressDialog(const Glib::RefPtr<Gtk::Window>& parent, const std::string& title)
: gtkutil::TransientWindow(title, GlobalMainFrame().getTopLevelWindow()),
  _label(Gtk::manage(new Gtk::Label)),
  _progressBar(Gtk::manage(new Gtk::ProgressBar)),
  _aborted(false)
{
  	// Window properties
	set_modal(true);
	set_position(Gtk::WIN_POS_CENTER_ON_PARENT);
	set_default_size(360, 80);
	set_border_width(12);

	// Create a vbox
	Gtk::VBox* vbx = Gtk::manage(new Gtk::VBox(false, 12));

	// Pack a progress bar into the window
	vbx->pack_start(*_progressBar, false, false, 0);

	// Pack the label into the window
	vbx->pack_start(*_label, true, false, 0);
	add(*vbx);

	// Pack a right-aligned cancel button at the bottom
	Gtk::Button* cancelButton = Gtk::manage(new Gtk::Button(Gtk::Stock::CANCEL));
	cancelButton->signal_clicked().connect(sigc::mem_fun(*this, &ModalProgressDialog::_onCancel));

	vbx->pack_end(*Gtk::manage(new gtkutil::RightAlignment(*cancelButton)), false, false, 0);

	// Connect the realize signal to remove the window decorations
	signal_realize().connect(sigc::mem_fun(*this, &ModalProgressDialog::_onRealize));

	// Show the window
	show_all();
	handleEvents();
}
Example #13
0
  AxisRow(Model *model, int axis) :
    m_inhibit_update(false), m_model(model), m_axis(axis)
  {
    add(*(new Gtk::Label(axis_names[axis])));
    Gtk::Button *home = new Gtk::Button("Home");
    home->signal_clicked().connect
      (sigc::mem_fun (*this, &AxisRow::home_clicked));
    add (*home);

    add_nudge_button (-10.0);
    add_nudge_button (-1.0);
    add_nudge_button (-0.1);
    m_target = new Gtk::SpinButton();
    m_target->set_digits (1);
    m_target->set_increments (0.1, 1);
    m_target->set_range(-200.0, +200.0);
    m_target->set_value(0.0);
    add (*m_target);
    m_target->signal_value_changed().connect
      (sigc::mem_fun(*this, &AxisRow::spin_value_changed));

    add_nudge_button (+0.1);
    add_nudge_button (+1.0);
    add_nudge_button (+10.0);
  }
Example #14
0
SelectJackControlPgm::SelectJackControlPgm(BaseObjectType* cobject, Glib::RefPtr<GxBuilder> bld, gx_engine::GxMachineBase& m)
    : Gtk::Window(cobject),
      description(),
      customstarter(),
      startercombo(),
      dontask(),
      machine(m),
      close() {
    signal_delete_event().connect(sigc::mem_fun(*this, &SelectJackControlPgm::on_delete_event));
    bld->find_widget("description", description);
    bld->find_widget("customstarter", customstarter);
    customstarter->set_text(machine.get_parameter_value<string>("ui.jack_starter"));
    bld->find_widget("startercombo", startercombo);
    const char *v_id = machine.get_parameter("ui.jack_starter_idx").getValueNames()[machine.get_parameter_value<int>("ui.jack_starter_idx")].value_id;
    int n = 0;
    Glib::RefPtr<Gtk::TreeModel> model = startercombo->get_model();
    for (Gtk::TreeIter i = model->children().begin(); i; ++i, ++n) {
	Glib::ustring s;
	i->get_value(1, s);
	if (s == v_id) {
	    startercombo->set_active(n);
	}
    }
    startercombo->signal_changed().connect(sigc::mem_fun(*this, &SelectJackControlPgm::on_starter_changed));
    bld->find_widget("dontask", dontask);
    dontask->set_active(!machine.get_parameter_value<bool>("ui.ask_for_jack_starter"));
    Gtk::Button *button;
    bld->find_widget("ok_button", button);
    button->signal_clicked().connect(
	sigc::mem_fun(*this, &SelectJackControlPgm::on_ok_button));
    bld->find_widget("cancel_button", button);
    button->signal_clicked().connect(
	sigc::mem_fun(*this, &SelectJackControlPgm::on_cancel_button));
    on_starter_changed();
}
Example #15
0
int main(int argc, char* argv[])
{

	const std::string mainLocation = std::string(argv[0]);
	std::size_t pos = mainLocation.find_last_of("/");

	const std::string mainFolder = mainLocation.substr(0, pos);
	const std::string uiFileLocation = mainFolder + "/../Source/Ui.glade";

	// Create application and builder
	Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv);
	Glib::RefPtr<Gtk::Builder> builder = Gtk::Builder::create_from_file(uiFileLocation);

	// Get main window
	Gui::MainWindow* mainWindow = nullptr;
	builder->get_widget_derived("MainWindow", mainWindow);

	// Create controller
	std::shared_ptr<Gui::MainController> controller = std::make_shared<Gui::MainController>(builder, mainFolder);

	// Handle quit button signal
	Gtk::Button* quitButton = nullptr;
	builder->get_widget("QuitButton", quitButton);
	quitButton->signal_clicked().connect(sigc::mem_fun(mainWindow, &Gui::MainWindow::hide));

	// Run application
	int ret = app->run(*mainWindow);

	// Delete pointers (dialogs and windows)
	delete mainWindow;

	return ret;
}
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);
}
// Callback for objective entity selection changed in list box
void ObjectivesEditor::_onEntitySelectionChanged()
{
	// Clear the objectives list
	_objectiveList->clear();
	
    Gtk::Button* delEntityButton = gladeWidget<Gtk::Button>(
        "deleteEntityButton"
    );
    Gtk::Widget* objButtonPanel = gladeWidget<Gtk::Widget>(
        "objButtonPanel"
    );

	// Get the selection
    Gtk::TreeView* entityList = gladeWidget<Gtk::TreeView>(
        "entitiesTreeView"
    );
	Gtk::TreeModel::iterator iter = entityList->get_selection()->get_selected();
	if (iter) 
    {
		// Get name of the entity and find the corresponding ObjectiveEntity in
		// the map
		std::string name = Glib::ustring((*iter)[_objEntityColumns.entityName]);

		// Save the current selection and refresh the objectives list
		_curEntity = _entities.find(name);
		refreshObjectivesList();

		// Enable the delete button and objectives panel
		delEntityButton->set_sensitive(true);
        objButtonPanel->set_sensitive(true);

        // Enable mission logic button
        gladeWidget<Gtk::Widget>(
            "editSuccessLogicButton"
        )->set_sensitive(true);

		// Enable obj condition button
        gladeWidget<Gtk::Widget>(
            "editObjectiveConditionsButton"
        )->set_sensitive(true);
	}
	else
    {
		// No selection, disable the delete button and clear the objective
		// panel
		delEntityButton->set_sensitive(false);
		objButtonPanel->set_sensitive(false);

        // Disable mission logic button
        gladeWidget<Gtk::Widget>(
            "editSuccessLogicButton"
        )->set_sensitive(false);

		// Disable obj condition button
        gladeWidget<Gtk::Widget>(
            "editObjectiveConditionsButton"
        )->set_sensitive(false);
	}
}
Example #18
0
AboutDialog::AboutDialog(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &builder):
        Gtk::AboutDialog(cobject) {

    Gtk::Button* closeButton = nullptr;
    builder->get_widget("closeButton", closeButton);

    closeButton->signal_clicked().connect(sigc::mem_fun(this, &AboutDialog::closeDialog));
}
Example #19
0
 void HIGMessageDialog::add_button(const Gtk::BuiltinStockID& stock_id, 
                                    Gtk::ResponseType resp, bool is_default)
 {
   Gtk::Button *button = manage(new Gtk::Button (stock_id));
   button->property_can_default().set_value(true);
   
   add_button(button, resp, is_default);
 }
static void gradsel_style_button(GtkWidget *gtkbtn, char const *iconName)
{
    Gtk::Button *btn = Glib::wrap(GTK_BUTTON(gtkbtn));
    GtkWidget *child = sp_icon_new(Inkscape::ICON_SIZE_SMALL_TOOLBAR, iconName);
    gtk_widget_show(child);
    btn->add(*manage(Glib::wrap(child)));
    btn->set_relief(Gtk::RELIEF_NONE);
}
Example #21
0
Gtk::Button* BuilderListToolBoxImpl::createImageStockButton(
    Gtk::StockID StockImage, Glib::ustring TooltipText)
{
  Gtk::Button* Button = Gtk::manage(new Gtk::Button());
  Button->set_image(*Gtk::manage(new Gtk::Image(StockImage,
      Gtk::ICON_SIZE_BUTTON)));
  if (TooltipText != "")
    Button->set_tooltip_text(TooltipText);
  return Button;
}
Example #22
0
void View::connect_button(const char *name, const sigc::slot<void> &slot)
{
  Gtk::Button *button = NULL;
  m_builder->get_widget (name, button);
  if (button)
    button->signal_clicked().connect (slot);
  else {
    std::cerr << "missing button " << name << "\n";
  }
}
 void set_name(const std::string& name)
 {
     if (_be)
     {
         _be->set_name(name);
         Gtk::Button *btn;
         xml()->get_widget("refactor_btn", btn);
         btn->set_sensitive(_be->refactor_possible());
     }
 }
 void refactor_schema()
 {
     if (_be)
     {
         _be->refactor_catalog();
         Gtk::Button *btn;
         xml()->get_widget("refactor_btn", btn);
         btn->set_sensitive(_be->refactor_possible());
     }
 }
// Constructor creates widgets
ObjectivesEditor::ObjectivesEditor() :
	gtkutil::BlockingTransientWindow(
        _(DIALOG_TITLE), GlobalMainFrame().getTopLevelWindow()
    ),
    gtkutil::GladeWidgetHolder("ObjectivesEditor.glade"),
	_objectiveEntityList(Gtk::ListStore::create(_objEntityColumns)),
	_objectiveList(Gtk::ListStore::create(_objectiveColumns))
{
    // Window properties
    set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);
    set_position(Gtk::WIN_POS_CENTER_ON_PARENT);
    
    // Add vbox to dialog
    add(*gladeWidget<Gtk::Widget>("mainVbox"));
    g_assert(get_child() != NULL);

    // Setup signals and tree views
    setupEntitiesPanel();
    setupObjectivesPanel();

    // Buttons not associated with a treeview panel
    Gtk::Button* logicButton = gladeWidget<Gtk::Button>(
        "editSuccessLogicButton"
    );
    logicButton->signal_clicked().connect(
        sigc::mem_fun(*this, &ObjectivesEditor::_onEditLogic)
    );
	Gtk::Button* conditionsButton = gladeWidget<Gtk::Button>(
        "editObjectiveConditionsButton"
    );
    conditionsButton->signal_clicked().connect(
        sigc::mem_fun(*this, &ObjectivesEditor::_onEditObjConditions)
    );

    gladeWidget<Gtk::Button>("cancelButton")->signal_clicked().connect(
        sigc::mem_fun(*this, &ObjectivesEditor::_onCancel)
    );
	gladeWidget<Gtk::Button>("okButton")->signal_clicked().connect(
        sigc::mem_fun(*this, &ObjectivesEditor::_onOK)
    );

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

    _objectiveEClasses.clear();

    xml::NodeList nodes = GlobalRegistry().findXPath(RKEY_OBJECTIVE_ENTS);

    for (xml::NodeList::const_iterator i = nodes.begin(); i != nodes.end(); ++i)
    {
        _objectiveEClasses.push_back(i->getAttributeValue("name"));
    }
}
Example #26
0
// Create button panel
Gtk::Widget& OverlayDialog::createButtons()
{
	Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox(false, 6));

	Gtk::Button* closeButton = Gtk::manage(new Gtk::Button(Gtk::Stock::CLOSE));
	closeButton->signal_clicked().connect(sigc::mem_fun(*this, &OverlayDialog::_onClose));

	hbox->pack_end(*closeButton, false, false, 0);

	return *hbox;
}
Example #27
0
void RSFilechooser::set_loading(FileType type)
{
  chooser->set_select_multiple (true);
  chooser->set_action(Gtk::FILE_CHOOSER_ACTION_OPEN);
  view->show_widget("load_buttons", true);
  view->show_widget("save_buttons", false);
  Gtk::Button *button = NULL;
  builder->get_widget ("load_save_button", button);
  if (button) button->set_label(_("Load"));  
  set_filetype(type);
}
Example #28
0
 void add_nudge_button (double nudge)
 {
   std::stringstream label;
   if (nudge > 0)
     label << "+";
   label << nudge;
   Gtk::Button *button = new Gtk::Button(label.str());
   add(*button);
   button->signal_clicked().connect
     (sigc::bind(sigc::mem_fun (*this, &AxisRow::nudge_clicked), nudge));
 }
Gtk::Widget& MD5AnimationViewer::createButtons()
{
	Gtk::HBox* hbx = Gtk::manage(new Gtk::HBox(true, 6));

	Gtk::Button* closeButton = Gtk::manage(new Gtk::Button(Gtk::Stock::CLOSE));

	closeButton->signal_clicked().connect(sigc::mem_fun(*this, &MD5AnimationViewer::_onOK));

	hbx->pack_end(*closeButton, true, true, 0);

	return *Gtk::manage(new gtkutil::RightAlignment(*hbx));
}
Example #30
0
    GUI(Glib::RefPtr<Gtk::Application> _app, SimulationRunner &_runner) : app(_app), runner(_runner)
    {
        builder = Gtk::Builder::create_from_file("gui.glade");
        builder->get_widget("mainWindow", mainWindow);

        Gtk::Button* closeButton;
        builder->get_widget("closeButton", closeButton);
        closeButton->signal_clicked().connect(
            sigc::mem_fun(this, &GUI::stopSimulationRequested));
        mainWindow->signal_hide().connect(
            sigc::mem_fun(this, &GUI::quitCallback));

        builder->get_widget("inputFile", inputFileChooserButton);
        inputFileChooserButton->signal_selection_changed().connect(
            sigc::mem_fun(this, &GUI::inputFileChanged));
        builder->get_widget("impulseFile", impulseResponseFileChooserButton);
        impulseResponseFileChooserButton->signal_selection_changed().connect(
            sigc::mem_fun(this, &GUI::impulseResponseFileChanged));

        Gtk::Button* outputFileButton;
        builder->get_widget("outputFileButton", outputFileButton);
        builder->get_widget(
            "outputFileChooserDialog", outputFileChooserDialog);
        outputFileButton->signal_clicked().connect(
            sigc::mem_fun(
                outputFileChooserDialog, &Gtk::FileChooserDialog::show));

        Gtk::Button* outputFileChooserDialogCloseButton;
        builder->get_widget(
            "outputFileChooserDialogCloseButton",
            outputFileChooserDialogCloseButton);
        outputFileChooserDialogCloseButton->signal_clicked().connect(
            sigc::mem_fun(
                outputFileChooserDialog, &Gtk::FileChooserDialog::hide));

        Gtk::Button* outputFileChooserDialogOKButton;
        builder->get_widget(
            "outputFileChooserDialogOKButton",
            outputFileChooserDialogOKButton);
        outputFileChooserDialogOKButton->signal_clicked().connect(
            sigc::mem_fun(
                this, &GUI::outputFileChooserDialogOKButtonClicked));
        outputFileChooserDialog->signal_file_activated().connect(
            sigc::mem_fun(
                this, &GUI::outputFileChooserDialogOKButtonClicked));

        Gtk::Button* runButton;
        builder->get_widget("runButton", runButton);
        runButton->signal_clicked().connect(
            sigc::mem_fun(this, &GUI::runButtonClicked));

        app->run(*mainWindow);
    }