コード例 #1
0
ファイル: toolbar.cpp プロジェクト: KonishchevDmitry/flush
void set_style(Gtk::Toolbar& toolbar, Style style)
{
	if(style == DEFAULT)
		toolbar.unset_toolbar_style();
	else
		toolbar.set_toolbar_style(toolbar::convert(style));
}
コード例 #2
0
void
ToggleDucksDial::remove_from_toolbar(Gtk::Toolbar &toolbar)
{
	toolbar.remove(ducks_position);
	toolbar.remove(ducks_vertex);
	toolbar.remove(ducks_tangent);
	toolbar.remove(ducks_radius);
	toolbar.remove(ducks_width);
	toolbar.remove(ducks_angle);
}
コード例 #3
0
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);
}
コード例 #4
0
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);
}
コード例 #5
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);
}
コード例 #6
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);
}
コード例 #7
0
ファイル: MainWindow.cpp プロジェクト: Tiger66639/yarp
YarpScope::MainWindow::MainWindow() :
    mPriv(new Private(this))
{
    set_border_width(3);
    set_default_size(640, 480);
    set_icon_name("yarpscope"); // FIXME

    add(mPriv->windowBox);

    // Setup actions
    mPriv->refActionGroup = Gtk::ActionGroup::create();

    mPriv->refActionGroup->add(Gtk::Action::create("MenuFile", _("_File")));
    mPriv->refActionGroup->add(Gtk::Action::create("Quit", Gtk::Stock::QUIT),
                               sigc::mem_fun(*mPriv, &MainWindow::Private::on_action_file_quit));
    mPriv->refActionGroup->add(Gtk::Action::create("MenuActions", _("_Actions")));
    mPriv->refActionGroup->add(Gtk::ToggleAction::create_with_icon_name("StopStart", "media-playback-pause", _("Stop"), _("Stop plotting")),
                               sigc::mem_fun(*mPriv, &MainWindow::Private::on_action_actions_stop_start));
    mPriv->refActionGroup->add(Gtk::Action::create_with_icon_name("Clear", "edit-clear", _("Clear"), _("Clear plots")),
                               sigc::mem_fun(*mPriv, &MainWindow::Private::on_action_actions_clear));
    mPriv->refActionGroup->add(Gtk::Action::create_with_icon_name("AutoRescale", "transform-scale", _("Auto Rescale"), _("Automatically rescale plots")),
                               sigc::mem_fun(*mPriv, &MainWindow::Private::on_action_actions_autorescale));
    mPriv->refActionGroup->add(Gtk::Action::create("MenuHelp", _("Help")));
    mPriv->refActionGroup->add(Gtk::Action::create("About", Gtk::Stock::ABOUT),
                               sigc::mem_fun(*mPriv, &MainWindow::Private::on_action_help_about));

    mPriv->refUIManager->insert_action_group(mPriv->refActionGroup);
    add_accel_group(mPriv->refUIManager->get_accel_group());

    Glib::ustring ui_info =
        "<ui>"
        "  <menubar name='MenuBar'>"
        "    <menu action='MenuFile'>"
        "      <separator />"
        "      <menuitem action='Quit'/>"
        "    </menu>"
        "    <menu action='MenuActions'>"
        "      <menuitem action='StopStart'/>"
        "      <menuitem action='Clear'/>"
        "      <menuitem action='AutoRescale'/>"
        "    </menu>"
        "    <menu action='MenuHelp'>"
        "      <menuitem action='About'/>"
        "    </menu>"
        "  </menubar>"
        "  <toolbar  name='ToolBar'>"
        "    <toolitem action='StopStart'/>"
        "    <toolitem action='Clear'/>"
        "    <toolitem action='AutoRescale'/>"
        "  </toolbar>"
        "</ui>";

    try {
        mPriv->refUIManager->add_ui_from_string(ui_info);
    }
    catch(const Glib::Error& ex) {
        fatal() << "building menus failed: " <<  ex.what();
    }

    // Setup menu bar
    Gtk::MenuBar* menubar = dynamic_cast<Gtk::MenuBar*>(mPriv->refUIManager->get_widget("/MenuBar"));
    if(menubar) {
        mPriv->windowBox.pack_start(*menubar, Gtk::PACK_SHRINK);
    } else {
        fatal() << "building menus failed: \"/MenuBar\" is missing";
    }

    // Setup toolbar
    Gtk::Toolbar* toolbar = dynamic_cast<Gtk::Toolbar*>(mPriv->refUIManager->get_widget("/ToolBar"));
    if(toolbar) {
        mPriv->windowBox.pack_start(*toolbar, Gtk::PACK_SHRINK);
        toolbar->set_toolbar_style(Gtk::TOOLBAR_BOTH);
    } else {
        fatal() << "building menus failed: \"/ToolBar\" is missing";
    }

    mPriv->intervalSpinButton.set_value(PortReader::instance().interval());
    mPriv->intervalSpinButton.signal_value_changed().connect(sigc::mem_fun(*mPriv, &YarpScope::MainWindow::Private::on_action_interval_value_changed));
    mPriv->intervalVBox.pack_start(mPriv->intervalSpinButton);
    mPriv->intervalVBox.pack_start(mPriv->intervalLabel);
    mPriv->intervalToolItem.add(mPriv->intervalVBox);
    toolbar->prepend(mPriv->intervalToolItem);

    mPriv->windowBox.pack_start(*PlotManager::instance().getPlotWidget());

    show_all_children();
}