Gtk::VPaned *SendMsgDlgTab::setup_im_pane() { Gtk::VPaned *paned; paned = Gtk::manage(new Gtk::VPaned); Gtk::VBox *vbox; vbox = Gtk::manage(new Gtk::VBox(false, 5)); paned->pack1(*vbox, true, true); Gtk::ScrolledWindow *sw; sw = Gtk::manage(new Gtk::ScrolledWindow()); sw->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS); sw->set_shadow_type(Gtk::SHADOW_IN); vbox->pack_start(*sw, true, true, 0); sw->set_size_request(230, 150); imhtml = gtk_imhtml_new(NULL, NULL); gtk_container_add(GTK_CONTAINER(sw->gobj()), imhtml); gtk_imhtml_show_comments(GTK_IMHTML(imhtml), true); Gtk::VBox *vbox2; vbox2 = Gtk::manage(new Gtk::VBox(false, 5)); paned->pack2(*vbox2, false, false); Gtk::VBox *tool_vbox; tool_vbox = build_conv_toolbutton_vbox(); vbox2->pack_start(*tool_vbox, false, false, 0); Gtk::Frame *frame; frame = Gtk::manage(new Gtk::Frame()); frame->set_shadow_type(Gtk::SHADOW_IN); vbox2->pack_start(*frame, true, true, 0); m_input_textview.set_wrap_mode(Gtk::WRAP_WORD); m_input_textview.set_size_request(-1, 45); frame->add(m_input_textview); //m_input_textview.grab_focus(); m_input_textview.signal_event().connect(SigC::slot(*this, &SendMsgDlgTab::on_input_textview_event)); Gtk::HBox *hbox; hbox = Gtk::manage(new Gtk::HBox(false, 5)); vbox2->pack_start(*hbox, false, false, 0); setup_im_buttons(hbox); return paned; }
void on_thread_back_clicked() { ///To be run when the back button is clicked while viewing a thread boardView(); Gtk::TreeView *threadlist = 0; pWebKitView = WEBKIT_WEB_VIEW (webkit_web_view_new ()); Gtk::ScrolledWindow *imgview = 0; builder->get_widget("scrolledwindow3", imgview); imgview->set_visible(true); imgview->show(); gtk_container_add (GTK_CONTAINER (imgview->gobj()), GTK_WIDGET (pWebKitView)); webkit_web_view_load_uri(pWebKitView, "about:blank"); webkit_web_view_set_zoom_level(pWebKitView, true); gtk_widget_set_can_focus(GTK_WIDGET(pWebKitView), true); gtk_widget_show(GTK_WIDGET(pWebKitView)); builder->get_widget("treeview2", threadlist); Glib::RefPtr<Gtk::TreeSelection> thread_selection = threadlist->get_selection(); thread_selection->signal_changed().connect(sigc::bind<Glib::RefPtr<Gtk::TreeSelection>, WebKitWebView*>(sigc::ptr_fun(&on_selection_changed), thread_selection, pWebKitView)); POST_CLICK_CONNECT.disconnect(); POST_REFRESH_CONNECT.disconnect(); }
void on_button_clicked(Gtk::TreeModel::Path path, Gtk::TreeViewColumn* column, Glib::RefPtr<Gtk::TreeModel> model) { Gtk::TreeModel::iterator iter = model->get_iter(path); Gtk::TreeModel::Row row = *iter; string shortname = row[m_columns.name]; string longname = row[m_columns.longname]; BOARD = shortname; LONGBOARD = longname; boardView(); Gtk::TreeView *threadlist = 0; builder->get_widget("treeview2", threadlist); pWebKitView = WEBKIT_WEB_VIEW (webkit_web_view_new ()); Gtk::ScrolledWindow *imgview = 0; builder->get_widget("scrolledwindow3", imgview); imgview->set_visible(true); imgview->show(); gtk_container_add (GTK_CONTAINER (imgview->gobj()), GTK_WIDGET (pWebKitView)); webkit_web_view_load_uri(pWebKitView, "about:blank"); webkit_web_view_set_zoom_level(pWebKitView, true); gtk_widget_set_can_focus(GTK_WIDGET(pWebKitView), true); gtk_widget_show(GTK_WIDGET(pWebKitView)); Glib::RefPtr<Gtk::ListStore> m_threads_tree_model; m_threads_tree_model = Gtk::ListStore::create(m_thread_list); m_threads_tree_model->clear(); threadlist->set_model(m_threads_tree_model); threadlist->set_search_column(1); threadlist->get_column(1)->set_visible(false); threadlist->get_column(2)->set_visible(false); threadlist->get_column(3)->set_visible(false); threadlist->get_column(4)->set_visible(false); threadlist->signal_key_press_event().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_key_press_or_release_event), m_threads_tree_model)); threadlist->signal_key_release_event().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_key_press_or_release_event), m_threads_tree_model)); threadlist->add_events(Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK); Gtk::CellRendererText* cellRender = dynamic_cast<Gtk::CellRendererText*>(threadlist->get_column_cell_renderer(0)); cellRender->property_wrap_mode() = Pango::WRAP_WORD; cellRender->property_wrap_width() = 400; cellRender->set_alignment(0, 0); Glib::RefPtr<Gtk::TreeSelection> thread_selection = threadlist->get_selection(); thread_selection->signal_changed().connect(sigc::bind<Glib::RefPtr<Gtk::TreeSelection>, WebKitWebView*>(sigc::ptr_fun(&on_selection_changed), thread_selection, pWebKitView)); getThreadData(m_threads_tree_model); threadlist->grab_focus(); Gtk::ToolButton* refresh; builder->get_widget("toolbutton5", refresh); refresh->set_visible(true); refresh->show(); if(!THREAD_REFRESH_CONNECTED) { THREAD_REFRESH_CONNECT = refresh->signal_clicked().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_refresh_threads_clicked), m_threads_tree_model)); } THREAD_CLICK_CONNECT = threadlist->signal_row_activated().connect(sigc::bind<Glib::RefPtr<Gtk::TreeModel>, Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_thread_activated), threadlist->get_model(), m_threads_tree_model)); }
void on_thread_activated(Gtk::TreeModel::Path path, Gtk::TreeViewColumn* column, Glib::RefPtr<Gtk::TreeModel> model, Glib::RefPtr<Gtk::ListStore> store) { ///To be run when a thread is double clicked Gtk::TreeModel::iterator iter = model->get_iter(path); Gtk::TreeModel::Row row = *iter; string no = row[m_thread_list.no]; THREAD = no; cout << THREAD << endl; cout << BOARD << endl; threadView(); Gtk::TreeView *postlist = 0; builder->get_widget("treeview4", postlist); postlist->set_visible(true); postlist->show(); Gtk::ScrolledWindow *imgview = 0; builder->get_widget("scrolledwindow3", imgview); gtk_container_add (GTK_CONTAINER (imgview->gobj()), GTK_WIDGET (pWebKitView)); webkit_web_view_load_uri(pWebKitView, "about:blank"); webkit_web_view_set_zoom_level(pWebKitView, true); gtk_widget_set_can_focus(GTK_WIDGET(pWebKitView), true); gtk_widget_show(GTK_WIDGET(pWebKitView)); Glib::RefPtr<Gtk::ListStore> m_posts_tree_model; m_posts_tree_model = Gtk::ListStore::create(m_post_list); m_posts_tree_model->clear(); postlist->set_model(m_posts_tree_model); postlist->set_search_column(1); postlist->get_column(1)->set_visible(false); postlist->get_column(2)->set_visible(false); postlist->get_column(3)->set_visible(false); postlist->get_column(4)->set_visible(false); postlist->get_column(5)->set_visible(false); postlist->signal_key_press_event().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_key_press_thread), m_posts_tree_model)); postlist->signal_key_release_event().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_key_press_thread), m_posts_tree_model)); postlist->add_events(Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK); Gtk::CellRendererText* cellRender = dynamic_cast<Gtk::CellRendererText*>(postlist->get_column_cell_renderer(0)); cellRender->property_wrap_mode() = Pango::WRAP_WORD; cellRender->property_wrap_width() = 400; cellRender->set_alignment(0, 0); Glib::RefPtr<Gtk::TreeSelection> thread_selection = postlist->get_selection(); thread_selection->signal_changed().connect(sigc::bind<Glib::RefPtr<Gtk::TreeSelection>, WebKitWebView*>(sigc::ptr_fun(&on_selection_changed_post), thread_selection, pWebKitView)); getPostData(m_posts_tree_model); postlist->grab_focus(); Gtk::ToolButton* refresh; builder->get_widget("toolbutton6", refresh); refresh->set_visible(true); refresh->show(); POST_REFRESH_CONNECT = refresh->signal_clicked().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_refresh_posts_clicked), m_posts_tree_model)); Gtk::ScrolledWindow *postwin = 0; builder->get_widget("scrolledwindow4", postwin); postwin->set_visible(true); postwin->show(); POST_CLICK_CONNECT = postlist->signal_row_activated().connect(sigc::bind<Glib::RefPtr<Gtk::TreeModel>, Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_post_activated1), postlist->get_model(), m_posts_tree_model)); }