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(); }
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; }
void listView() { ///Hide/show items for viewing the board list Gtk::ScrolledWindow *boardlist = 0; builder->get_widget("scrolledwindow1", boardlist); boardlist->set_visible(true); boardlist->show(); gtk_widget_destroy(GTK_WIDGET(pWebKitView)); Gtk::Paned *threadview = 0; builder->get_widget("paned1", threadview); threadview->set_visible(false); threadview->hide(); Gtk::ToolItem *boardback = 0; builder->get_widget("toolbutton3", boardback); boardback->set_visible(false); boardback->hide(); Gtk::Label *title = 0; builder->get_widget("label2", title); title->set_text("Boards"); Gtk::ToolItem *refresh1 = 0; builder->get_widget("toolbutton5", refresh1); refresh1->set_visible(false); refresh1->hide(); Gtk::ToolItem *refresh2 = 0; builder->get_widget("toolbutton6", refresh2); refresh2->set_visible(false); refresh2->hide(); Gtk::MenuItem *item3 = 0; builder->get_widget("menuitem3", item3); item3->set_sensitive(false); Gtk::Grid *post_grid; builder->get_widget("grid1", post_grid); post_grid->set_visible(false); post_grid->hide(); Gtk::ToggleToolButton *post_but; builder->get_widget("toolbutton8", post_but); post_but->set_visible(false); post_but->hide(); post_but->set_active(false); }
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); }
void threadView() { ///Hide or show widgets for viewing a thread Gtk::ScrolledWindow *boardlist = 0; builder->get_widget("scrolledwindow1", boardlist); boardlist->set_visible(false); boardlist->hide(); Gtk::Paned *threadview = 0; builder->get_widget("paned1", threadview); threadview->set_visible(true); threadview->show(); Gtk::ToolItem *boardback = 0; builder->get_widget("toolbutton4", boardback); boardback->set_visible(true); boardback->show(); Gtk::ToolItem *listback = 0; builder->get_widget("toolbutton3", listback); listback->set_visible(false); listback->hide(); Gtk::Button* button; builder->get_widget("button2", button); button->signal_clicked().connect(sigc::ptr_fun(&on_thread_back_clicked)); button->set_visible(true); button->show(); Gtk::ScrolledWindow *threadlist = 0; builder->get_widget("scrolledwindow2", threadlist); threadlist->set_visible(false); threadlist->hide(); Gtk::ScrolledWindow *postlist = 0; builder->get_widget("scrolledwindow4", postlist); postlist->set_visible(true); postlist->show(); postlist->get_vadjustment()->set_value(0); Gtk::Label *title = 0; builder->get_widget("label2", title); title->set_text("#"+THREAD+" - "+BOARD+" - "+LONGBOARD); Gtk::ToolItem *refresh1 = 0; builder->get_widget("toolbutton5", refresh1); refresh1->set_visible(false); refresh1->hide(); Gtk::ToolItem *refresh2 = 0; builder->get_widget("toolbutton6", refresh2); refresh2->set_visible(true); refresh2->show(); Gtk::MenuItem *item3 = 0; builder->get_widget("menuitem3", item3); item3->set_sensitive(true); Gtk::ToolButton *post_but; builder->get_widget("toolbutton8", post_but); post_but->set_visible(true); post_but->show(); }
void boardView(bool destroy=true) { ///Show/hide widgets for viewing all of the threads on a board Gtk::ScrolledWindow *boardlist = 0; builder->get_widget("scrolledwindow1", boardlist); boardlist->set_visible(false); boardlist->hide(); Gtk::Paned *threadview = 0; builder->get_widget("paned1", threadview); threadview->set_visible(true); threadview->show(); if(INIT) { //To be run only the first time a board is viewed Gtk::Window *window = 0; builder->get_widget("window1", window); int w = 0; int h = 0; window->get_size(w, h); threadview->set_position((1-2/(1+sqrt(5)))*w); Gtk::TextView *view = 0; builder->get_widget("textview1", view); GtkSpellChecker* spell = gtk_spell_checker_new (); gtk_spell_checker_set_language (spell, setlocale(LC_ALL,NULL), NULL); gtk_spell_checker_attach (spell, GTK_TEXT_VIEW (view->gobj())); INIT = false; } Gtk::ToolItem *boardback = 0; builder->get_widget("toolbutton3", boardback); boardback->set_visible(true); boardback->show(); Gtk::ToolItem *threadback = 0; builder->get_widget("toolbutton4", threadback); threadback->set_visible(false); threadback->hide(); Gtk::Button* button; builder->get_widget("button1", button); button->signal_clicked().connect(sigc::ptr_fun(&on_board_back_clicked)); button->set_visible(true); button->show(); Gtk::ScrolledWindow *threadlist = 0; builder->get_widget("scrolledwindow2", threadlist); threadlist->set_visible(true); threadlist->show(); Gtk::ScrolledWindow *postlist = 0; builder->get_widget("scrolledwindow4", postlist); postlist->set_visible(false); postlist->hide(); Gtk::ScrolledWindow *webview = 0; builder->get_widget("scrolledwindow3", webview); webview->set_visible(true); webview->show(); Gtk::ToolButton* refresh; builder->get_widget("toolbutton5", refresh); refresh->set_visible(true); refresh->show(); gtk_widget_show(GTK_WIDGET(pWebKitView)); Gtk::Label *title = 0; builder->get_widget("label2", title); title->set_text(BOARD+" - "+LONGBOARD); Gtk::ToolButton *refresh1 = 0; builder->get_widget("toolbutton5", refresh1); refresh1->set_visible(true); refresh1->show(); Gtk::ToolItem *refresh2 = 0; builder->get_widget("toolbutton6", refresh2); refresh2->set_visible(false); refresh2->hide(); Gtk::MenuItem *item3 = 0; builder->get_widget("menuitem3", item3); item3->set_sensitive(false); Gtk::ToolButton *post_but; builder->get_widget("toolbutton8", post_but); post_but->set_visible(true); post_but->show(); }