コード例 #1
0
ファイル: Controls.cpp プロジェクト: fdanesse/JAMediaSuite
Controls::Controls(){

    pixbufplay = Gdk::Pixbuf::create_from_file("./Iconos/pausa.svg");
    pixbufplay = pixbufplay->scale_simple(24, 24, Gdk::INTERP_BILINEAR);
    pixbufpause = Gdk::Pixbuf::create_from_file("./Iconos/play.svg");
    pixbufpause = pixbufpause->scale_simple(24, 24, Gdk::INTERP_BILINEAR);

    {
        Gtk::SeparatorToolItem *sep = new Gtk::SeparatorToolItem();
        sep->set_draw(false);
        sep->set_expand(true);
        insert(*sep, -1);
    }

    ant = new Gtk::ToolButton(
        *Controls::get_imagen("./Iconos/siguiente.svg", true), "");
    ant->set_tooltip_text("Pista Anterior");
    ant->signal_clicked().connect(sigc::bind<Glib::ustring> (
        sigc::mem_fun(*this, &Controls::clicked), "Anterior"));
    insert(*ant, -1);

    pla = new Gtk::ToolButton(
        *Controls::get_imagen("./Iconos/play.svg", false), "");
    pla->set_tooltip_text("Reproducir");
    pla->signal_clicked().connect(sigc::bind<Glib::ustring> (
        sigc::mem_fun(*this, &Controls::clicked), "Play"));
    insert(*pla, -1);

    sig = new Gtk::ToolButton(
        *Controls::get_imagen("./Iconos/siguiente.svg", false), "");
    sig->set_tooltip_text("Pista Siguiente");
    sig->signal_clicked().connect(sigc::bind<Glib::ustring> (
        sigc::mem_fun(*this, &Controls::clicked), "Siguiente"));
    insert(*sig, -1);

    sto = new Gtk::ToolButton(
        *Controls::get_imagen("./Iconos/stop.svg", false), "");
    sto->set_tooltip_text("Detener Reproducción");
    sto->signal_clicked().connect(sigc::bind<Glib::ustring> (
        sigc::mem_fun(*this, &Controls::clicked), "Stop"));
    insert(*sto, -1);

    vol = new Gtk::VolumeButton();
    vol->set_image(*Controls::get_imagen(
        "./Iconos/Media-Controls-Volume-Up-icon.png", false));
    vol->signal_value_changed().connect(
        sigc::mem_fun(*this, &Controls::vol_changed));

    {
        Gtk::ToolItem *item = new Gtk::ToolItem(); item->add(*vol);
        insert(*item, -1);
        Gtk::SeparatorToolItem *sep = new Gtk::SeparatorToolItem();
        sep->set_draw(false);
        sep->set_expand(true);
        insert(*sep, -1);}
        show_all();
    }
コード例 #2
0
ファイル: Shape.cpp プロジェクト: Nidhoegger/UniNotate
ManagedToolbar * CShape::GetAddonToolbar() {
    if (m_addonToolbar == NULL) {
        m_addonToolbar = new ManagedToolbar();

        m_addonToolbar->AddToolItem("Line", "Line", "line.png", "Line", TYPERADIO, 0);
        m_addonToolbar->AddToolItem("Rectangle", "Rectangle", "rectangle.png", "Rectangle", TYPERADIO, 0);
        m_addonToolbar->AddToolItem("Circle", "Circle", "circle.png", "Circle", TYPERADIO, 0);
        m_addonToolbar->AddToolItem("", "", "", "", TYPESEPARATOR, 0);

        Gtk::ToolItem * item;
        item = Gtk::manage(new Gtk::ToolItem());
        item->set_size_request(100, -1);
        scaleAdj = Gtk::Adjustment::create(m_lineWidth, 1.0, 10.0, 1, 2, 0);
        scale = Gtk::manage(new Gtk::Scale(scaleAdj, Gtk::ORIENTATION_HORIZONTAL));
        scale->set_value_pos(Gtk::POS_RIGHT);
        scale->set_digits(0);
        scale->set_increments(1.0, 2.0);
        scale->signal_value_changed().connect(sigc::mem_fun(*this, &CShape::ScaleChanged));
        item->add(*scale);
        m_addonToolbar->append(*item);

        m_addonToolbar->AddToolItem("", "", "", "", TYPESEPARATOR, 0);
        m_addonToolbar->AddToolItem("Black", "Color Black", "black.png", "Black", TYPERADIO, 2);
        m_addonToolbar->AddToolItem("Red", "Color Red", "red.png", "Red", TYPERADIO, 2);
        m_addonToolbar->AddToolItem("Green", "Color Green", "green.png", "Green", TYPERADIO, 2);
        m_addonToolbar->AddToolItem("Blue", "Color Blue", "blue.png", "Blue", TYPERADIO, 2);
        m_addonToolbar->AddToolItem("ChosenColor", "Chosen Color", "black.png", "ChosenColor", TYPERADIO, 2);
        m_addonToolbar->AddToolItem("", "", "", "", TYPESEPARATOR, 0);
        m_addonToolbar->AddToolItem("ColorChooser", "ColorChooser", "rgb.png", "ColorChooser", TYPEBUTTON, 0);
        m_addonToolbar->AddToolItem("", "", "", "", TYPESEPARATOR, 0);
        m_addonToolbar->AddToolItem("Normal Line", "Normal Line", "line_normal.png", "LineNormal", TYPERADIO, 3);
        m_addonToolbar->AddToolItem("Dashed Line", "Dashed Line", "line_dashed.png", "LineDashed", TYPERADIO, 3);
        m_addonToolbar->AddToolItem("Dotted Line", "Dotted Line", "line_dotted.png", "LineDotted", TYPERADIO, 3);
        m_addonToolbar->AddToolItem("", "", "", "", TYPESEPARATOR, 0);
        m_addonToolbar->AddToolItem("Add Sparrow", "Add Sparrow to Lines", "sparrow.png", "AddSparrow", TYPETOGGLE, 0);


        m_addonToolbar->callbackSignal.connect(sigc::mem_fun(*this, &CShape::AddonToolCallback));
        m_addonToolbar->ClickButton(m_sSettingColor);
        m_addonToolbar->ClickButton(m_sSettingWidth);
        m_addonToolbar->ClickButton(m_sSettingShape);
        m_addonToolbar->ClickButton(m_sSettingLine);
        if (m_bSettingSparrow) {
            m_addonToolbar->ClickButton("AddSparrow");
        }

    }
    return m_addonToolbar;
}