void
ToggleDucksDial::insert_to_toolbar(Gtk::Toolbar &toolbar, int index)
{
	if (index < 0) index = toolbar.get_n_items();

	// reverse order
	toolbar.insert(ducks_angle,    index);
	toolbar.insert(ducks_width,    index);
	toolbar.insert(ducks_radius,   index);
	toolbar.insert(ducks_tangent,  index);
	toolbar.insert(ducks_vertex,   index);
	toolbar.insert(ducks_position, index);
}
void SelectionSetManager::onRadiantStartup()
{
	// Get the horizontal toolbar and add a custom widget
	Gtk::Toolbar* toolbar = GlobalMainFrame().getToolbar(IMainFrame::TOOLBAR_HORIZONTAL);

	// Insert a separator at the end of the toolbar
	Gtk::ToolItem* item = Gtk::manage(new Gtk::SeparatorToolItem);
	toolbar->insert(*item, -1);

	item->show();

	// Construct a new tool menu object
	SelectionSetToolmenu* toolmenu = Gtk::manage(new SelectionSetToolmenu);

	toolbar->insert(*toolmenu, -1);
}
Esempio n. 3
0
ParticlePreview::ParticlePreview()
{
    // Add one additional toolbar for particle-related stuff
    Gtk::Toolbar* toolbar = Gtk::manage(new Gtk::Toolbar);
    toolbar->set_toolbar_style(Gtk::TOOLBAR_ICONS);

    _showAxesButton = Gtk::manage(new Gtk::ToggleToolButton);
    _showAxesButton->signal_toggled().connect(
        sigc::mem_fun(this, &ParticlePreview::queue_draw)
    );
    _showAxesButton->set_icon_widget(*Gtk::manage(new Gtk::Image(
        GlobalUIManager().getLocalPixbufWithMask("axes.png"))));
    _showAxesButton->set_tooltip_text(_("Show coordinate axes"));

    Gtk::ToolButton* reloadButton = Gtk::manage(new Gtk::ToolButton);
    reloadButton->set_icon_widget(*Gtk::manage(new Gtk::Image(Gtk::Stock::REFRESH, Gtk::ICON_SIZE_MENU)));
    reloadButton->set_tooltip_text(_("Reload Particle Defs"));
    IEventPtr ev = GlobalEventManager().findEvent("ReloadParticles");
    ev->connectWidget(reloadButton);

    _showWireFrameButton = Gtk::manage(new Gtk::ToggleToolButton);
    _showWireFrameButton->set_icon_widget(*Gtk::manage(new Gtk::Image(
        GlobalUIManager().getLocalPixbufWithMask("wireframe.png"))));
    _showWireFrameButton->set_tooltip_text(_("Show wireframe"));
    _showWireFrameButton->signal_toggled().connect(
        sigc::mem_fun(this, &ParticlePreview::queue_draw)
    );

    _automaticLoopButton = Gtk::manage(new Gtk::ToggleToolButton(_("Auto Loop")));
    _automaticLoopButton->set_tooltip_text(_("Auto Loop"));

    toolbar->insert(*_showAxesButton, 0);
    toolbar->insert(*_showWireFrameButton, 0);
    toolbar->insert(*_automaticLoopButton, 0);
    toolbar->insert(*reloadButton, 0);

    addToolbar(*toolbar);
}
Esempio n. 4
0
Gtk::Widget * Ganash::ApplicationWindow::setupUi()
{
  GtkWidget *vbox;
  GtkWidget *menubar;
  GtkWidget *toolbar;
  GtkWidget *dockbar;
  GtkWidget *statusbar;

  vbox      = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
  menubar   = setupMenu()->gobj();//gtk_menu_bar_new();
  toolbar   = setupTool()->gobj();//gtk_toolbar_new();
  dockbar   = setupDock()->gobj();
  statusbar = gtk_statusbar_new();

  gtk_widget_set_vexpand(vbox, TRUE);
  gtk_widget_set_vexpand(dockbar, TRUE);
  //gtk_widget_set_vexpand(toolbar, FALSE);

  // ----------------

  Gtk::Toolbar *tools = new Gtk::Toolbar();
  //tools->set_property("orientation", Gtk::ORIENTATION_VERTICAL);
  //tools->set_property("toolbar-style", Gtk::TOOLBAR_ICONS);
  //tools->set_property("icon-size", Gtk::ICON_SIZE_SMALL_TOOLBAR);
  //tools->set_property("icon-size", Gtk::ICON_SIZE_LARGE_TOOLBAR);

  Gtk::ToolButton *cursor5_tool = new Gtk::ToolButton(Gtk::StockID(Ganash::Ui::Stock::SELECT));
  Gtk::ToolButton *cursor6_tool = new Gtk::ToolButton(Gtk::StockID(Ganash::Ui::Stock::TRANSFORM));
  tools->insert(*cursor5_tool, 0);
  tools->insert(*cursor6_tool, 1);
  // ----


  gtk_container_add(GTK_CONTAINER(vbox), menubar);
  gtk_container_add(GTK_CONTAINER(vbox), toolbar);
  gtk_container_add(GTK_CONTAINER(vbox), GTK_WIDGET(tools->gobj()));
  gtk_container_add(GTK_CONTAINER(vbox), dockbar);
  //gtk_container_add(GTK_CONTAINER(vbox), statusbar);

  _menubar   = Glib::wrap(menubar);
  _toolbar   = Glib::wrap(toolbar);
  _dockbar   = Glib::wrap(dockbar);
  _statusbar = Glib::wrap(statusbar);
  return Glib::wrap(vbox);
}