Logo Search packages:      
Sourcecode: passepartout version File versions  Download package

StreamDialog::StreamDialog (  )  [private]

Todo:
Get a more motivated size, not a hardcoded number of pixels.

Definition at line 71 of file streamdialog.cc.

References _update(), FileEntry::entry, and SubPanel::pack_start().

  : UtilityWindow("Text Streams"),
    file_entry("Stream File"), 
    xfrm_entry("Stylesheet File", config.StylesheetPath.values.front()),
    document(0), 
    current_selection("")
{
  Gtk::HBox *mainbox = manage(new Gtk::HBox(false, double_space));
  mainbox->set_border_width(border_width);
  {
    Gtk::VBox *vbox = manage(new Gtk::VBox(false, single_space));
    // listan should go here
    main_model = Gtk::ListStore::create(main_columns);
    stream_list.set_model(main_model);
    stream_list.set_headers_visible(false);
    stream_list.append_column("Stream", main_columns.name);
    /// \todo  Get a more motivated size, not a hardcoded number of pixels.
    stream_list.property_width_request() = 100;
    stream_list.property_height_request() = 100;
    
    Glib::RefPtr<Gtk::TreeSelection> selection = stream_list.get_selection();
    selection->signal_changed().connect
      (slot(*this, &StreamDialog::on_selection_changed));
    
    Gtk::ScrolledWindow *scroll = manage(new Gtk::ScrolledWindow());
    scroll->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
    scroll->set_shadow_type(Gtk::SHADOW_IN);
    scroll->add(stream_list);
    
    Gtk::Label *list_label = 
      manage(new Gtk::Label("S_treams", 0.0, 0.5, true));
    list_label->set_mnemonic_widget(stream_list);
    vbox->pack_start(*list_label, Gtk::PACK_SHRINK);
    vbox->pack_start(*scroll);

    vbox->pack_start(*fix_button(new Gtk::Button(Gtk::Stock::ADD),
                         Response::ADD),
                 Gtk::PACK_SHRINK);
    
    vbox->pack_start(*fix_button(new Gtk::Button(Gtk::Stock::DELETE),
                         Response::DELETE),
                 Gtk::PACK_SHRINK);
    
    mainbox->pack_start(*vbox);
  }
  {
    Gtk::VBox *propsbox = manage(new Gtk::VBox(false, double_space));
    mainbox->pack_start(*propsbox);
    this->propsbox = propsbox;
    {
      SubPanel *box = manage(new SubPanel("Stream Source"));
      Gtk::Box *line;
      Glib::RefPtr<Gtk::SizeGroup>  sizegroup = 
      Gtk::SizeGroup::create(Gtk::SIZE_GROUP_HORIZONTAL);
      
      line = manage(new Gtk::HBox(false, double_space));
      Gtk::Label *label = manage(new Gtk::Label("_Name:", 0.0, 0.5, true));
      sizegroup->add_widget(*label);
      label->set_mnemonic_widget(name_entry);
      line->pack_start(*label, Gtk::PACK_SHRINK);
      line->pack_start(name_entry, Gtk::PACK_EXPAND_WIDGET);
      box->pack_start(*line, Gtk::PACK_SHRINK);
      
      line = manage(new Gtk::HBox(false, double_space));
      label = manage(new Gtk::Label("_File:", 0.0, 0.5, true));
      sizegroup->add_widget(*label);
      label->set_mnemonic_widget(file_entry);
      line->pack_start(*label, Gtk::PACK_SHRINK);
      line->pack_start(file_entry, Gtk::PACK_EXPAND_WIDGET);
      box->pack_start(*line, Gtk::PACK_SHRINK);
      
      line = manage(new Gtk::HBox(false, double_space));
      label = manage(new Gtk::Label("_Stylesheet:", 1.0, 0.5, true));
      sizegroup->add_widget(*label);
      label->set_mnemonic_widget(*xfrm_entry.entry.get_entry());
      line->pack_start(*label, Gtk::PACK_SHRINK);
      line->pack_start(xfrm_entry, Gtk::PACK_EXPAND_WIDGET);
      box->pack_start(*line, Gtk::PACK_SHRINK);
      
      propsbox->pack_start(*box, Gtk::PACK_SHRINK);
    }
    {
      SubPanel* box = manage(new SubPanel("Parameters"));
      param_box = box; // we need this for set_sensitive later

      param_model = Gtk::ListStore::create(param_columns);
      param_list.set_model(param_model);
      param_list.append_column("Name", param_columns.name);
      param_list.append_column_editable("Value", param_columns.value);
      param_list.property_height_request() = 90;
      param_model->signal_row_changed().connect
      (slot(*this, &StreamDialog::on_param_row_changed));
      Gtk::ScrolledWindow *scroll = manage(new Gtk::ScrolledWindow());
      scroll->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
      scroll->set_shadow_type(Gtk::SHADOW_IN);
      scroll->add(param_list);
      box->pack_start(*scroll);
      propsbox->pack_start(*box);
    }
    propsbox->set_sensitive(false); // nothing is selected to start with
  }
  add(*mainbox);

  show_all_children();

  Document::streams_changed_signal.connect
    (slot(*this, &StreamDialog::_update));
   
  name_entry.signal_activate().connect
    (bind(slot(*this, &StreamDialog::on_response), Response::SETNAME));
  name_entry.signal_focus_out_event().connect
    (adapt_focus_out(slot(*this, &StreamDialog::on_response),
                     Response::SETNAME));
  
  file_entry.entry.get_entry()->signal_activate().connect
    (bind(slot(*this, &StreamDialog::on_response), Response::SETFILE));
  file_entry.entry.get_entry()->signal_focus_out_event().connect
    (adapt_focus_out(slot(*this, &StreamDialog::on_response),
                     Response::SETFILE));
  
  xfrm_entry.entry.get_entry()->signal_activate().connect
    (bind(slot(*this, &StreamDialog::on_response), Response::SETXFRM));
  xfrm_entry.entry.get_entry()->signal_focus_out_event().connect
    (adapt_focus_out(slot(*this, &StreamDialog::on_response),
                     Response::SETXFRM));
}


Generated by  Doxygen 1.6.0   Back to index