Пример #1
0
ScriptWindow::ScriptWindow() :
	Gtk::VBox(false, 6),
	_outView(Gtk::manage(new gtkutil::ConsoleView)),
	_view(Gtk::manage(new gtkutil::SourceView(SCRIPT_LANGUAGE_ID, false))) // allow editing
{
	_view->unset_focus_chain();

	Gtk::Button* runButton = Gtk::manage(new Gtk::Button(_("Run Script")));
	runButton->signal_clicked().connect(sigc::mem_fun(*this, &ScriptWindow::onRunScript));

	Gtk::HBox* buttonBar = Gtk::manage(new Gtk::HBox(false, 6));
	buttonBar->pack_start(*runButton, false, false, 0);

	Gtk::VBox* inputVBox = Gtk::manage(new Gtk::VBox(false, 3));
	inputVBox->pack_start(*Gtk::manage(new gtkutil::LeftAlignedLabel(_("Python Script Input"))), false, false, 0);
	inputVBox->pack_start(*_view, true, true, 0);
	inputVBox->pack_start(*buttonBar, false, false, 0);

	// Pack the scrolled textview and the entry box to the vbox
	Gtk::VPaned* paned = Gtk::manage(new Gtk::VPaned);
	paned->add1(*inputVBox);
	paned->add2(*_outView);

	pack_start(*paned, true, true, 0);
	show_all();
}
Пример #2
0
static void SetGarmonicHeightForTrk(Gtk::VPaned& vpaned)
{
    // выставляем высоту монтажного окна
//     int wdh, hgt;
//     win.get_default_size(wdh, hgt);
    int hgt = vpaned.get_height();
    int layout_hgt = 175; // вручную высчитал
    int vpos = hgt - layout_hgt;
    if( vpos < layout_hgt )
        vpos = hgt/2;
    vpaned.set_position(vpos);
}
Пример #3
0
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 BuilderProjectWithExplorer::compose()
{
  mp_MainPaned = Gtk::manage(new Gtk::HPaned());
  mp_MainPaned->set_visible(true);

  //  Gtk::Label* NothingLabel = Gtk::manage(new Gtk::Label(
  //      _("Nothing to display at this time")));
  //  NothingLabel->set_visible(true);

  Gtk::VPaned* LeftBox = Gtk::manage(new Gtk::VPaned());
  LeftBox->pack1(*mp_ProjectExplorerMVP->asWidget());
  LeftBox->pack2(*mp_ProjectDashboard->asWidget(), true, true);
  LeftBox->set_visible(true);

  mp_MainPaned->add1(*LeftBox);
  mp_MainPaned->add2(*mp_Workspace->asWidget());
  //  mp_MainPaned->add2(*NothingLabel);
}
Пример #5
0
VRGuiBits::VRGuiBits() {
    setComboboxCallback("combobox4", VRGuiBits_on_camera_changed);
    setComboboxCallback("combobox9", VRGuiBits_on_navigation_changed);

    setToolButtonCallback("toolbutton4", VRGuiBits_on_save_clicked);
    setToolButtonCallback("toolbutton3", VRGuiBits_on_quit_clicked);
    setToolButtonCallback("toolbutton17", VRGuiBits_on_about_clicked);
    setToolButtonCallback("toolbutton18", VRGuiBits_on_internal_clicked);

    setButtonCallback("button14", VRGuiBits_on_new_cancel_clicked);
    setButtonCallback("button21", VRGuiBits_on_internal_close_clicked);

    setLabel("label24", "Project: None");

    // About Dialog

    Gtk::AboutDialog* diag;
    VRGuiBuilder()->get_widget("aboutdialog1", diag);
    diag->signal_response().connect( sigc::mem_fun(*this, &VRGuiBits::hideAbout) );
    ifstream f("ressources/gui/authors");
    vector<string> authors;
    for (string line; getline(f, line); ) authors.push_back(line);
    f.close();
    diag->set_authors(authors);

    // window fullscreen
    Gtk::Window* win;
    VRGuiBuilder()->get_widget("window1", win);
    win->signal_key_press_event().connect( sigc::mem_fun(*this, &VRGuiBits::toggleFullscreen) );

    // VTE

    GtkWidget* vte = vte_terminal_new();
    terminal = VTE_TERMINAL (vte);

    vte_terminal_set_background_transparent(terminal, FALSE);
    vte_terminal_set_scrollback_lines(terminal, -1);
    vte_terminal_set_size(terminal, 80, 20);

    char** argv=NULL;
    g_shell_parse_argv("/bin/bash", NULL, &argv, NULL);
    vte_terminal_fork_command_full(terminal, VTE_PTY_DEFAULT, NULL, argv, NULL, GSpawnFlags(0), NULL, NULL, NULL, NULL);

    vte_terminal_set_scroll_on_keystroke(terminal, TRUE);
    gtk_widget_set_size_request(vte, -1, 100);

    GtkWidget* scrollbar = gtk_vscrollbar_new(vte_terminal_get_adjustment(terminal));
    term_box = gtk_hbox_new(FALSE, 0);
    gtk_box_pack_start(GTK_BOX(term_box), vte, FALSE, TRUE, 0);
    gtk_box_pack_start(GTK_BOX(term_box), scrollbar, FALSE, FALSE, 0);

    Gtk::VPaned* paned;
    VRGuiBuilder()->get_widget("vpaned1", paned);
    gtk_paned_pack2(GTK_PANED (paned->gobj()), term_box, FALSE, FALSE);

    vte_terminal_get_emulation(VTE_TERMINAL (vte));

    gtk_widget_show (term_box);
    gtk_widget_show (vte);

    //int pos = paned->property_max_position () - 100;
    //paned->set_position(pos);

    VRFunction<int>* fkt = new VRFunction<int>( "IntMonitor_guiUpdate", VRGuiBits_on_internal_update );
    VRSceneManager::get()->addUpdateFkt(fkt);

    // view options
    setComboboxCallback("combobox20", VRGuiBits_on_viewoption_changed);
    Glib::RefPtr<Gtk::ListStore> opt_list = Glib::RefPtr<Gtk::ListStore>::cast_static(VRGuiBuilder()->get_object("view_options"));
    opt_list->clear();
    Gtk::ListStore::Row row;
    row = *opt_list->append();
    gtk_list_store_set (opt_list->gobj(), row.gobj(), 0, "referentials", -1);
    gtk_list_store_set (opt_list->gobj(), row.gobj(), 1, 0, -1);
    row = *opt_list->append();
    gtk_list_store_set (opt_list->gobj(), row.gobj(), 0, "setup", -1);
    gtk_list_store_set (opt_list->gobj(), row.gobj(), 1, 0, -1);
    row = *opt_list->append();
    gtk_list_store_set (opt_list->gobj(), row.gobj(), 0, "lights and cameras", -1);
    gtk_list_store_set (opt_list->gobj(), row.gobj(), 1, 0, -1);
}
Пример #6
0
void setVPanedSensitivity(string vp, bool b) {
    Gtk::VPaned* tab;
    VRGuiBuilder()->get_widget(vp, tab);
    tab->set_sensitive(b);
}