Example #1
0
void TableofcontentsNoteAddin::on_note_opened ()
{
  m_toc_menu = manage(new Gtk::Menu);
  m_toc_menu->signal_hide().connect(
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_menu_hidden));

  register_main_window_action_callback("tableofcontents-heading1",
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_level_1_action));
  register_main_window_action_callback("tableofcontents-heading2",
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_level_2_action));
  register_main_window_action_callback("tableofcontents-help",
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_toc_help_action));
  register_main_window_action_callback("tableofcontents-goto-heading",
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_goto_heading));

  auto win = get_window();
  win->signal_foregrounded.connect(sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_foregrounded));

  auto buffer = get_note()->get_buffer();
  if(buffer) {
    buffer->signal_changed().connect(sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_note_changed));
  }

  // Reacts to key press events
  win->signal_key_press_event().connect(
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_key_pressed));

  // TOC can show up also in the contextual menu
  win->editor()->signal_populate_popup().connect(
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_populate_popup));

  // Heading tags
  m_tag_bold  = get_note()->get_tag_table()->lookup ("bold");
  m_tag_large = get_note()->get_tag_table()->lookup ("size:large");
  m_tag_huge  = get_note()->get_tag_table()->lookup ("size:huge");
}
Example #2
0
void ErrorPopup::show_msg() {
    dialog = new Gtk::MessageDialog(msg, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE);
    dialog->set_keep_above(true);
    //Gtk::VBox *ma = dialog->get_message_area(); // not in Gtkmm 0.20
    //FIXME: no comment :-)
    Gtk::VBox *ma = dynamic_cast<Gtk::VBox*>(
	*(++dynamic_cast<Gtk::HBox*>(
	      *dialog->get_vbox()->get_children().begin())->get_children().begin()));
    // add an alignment parent to the label widget inside the message area
    // should better define our own dialog instead of hacking MessageDialog...
    Gtk::Alignment *align = new Gtk::Alignment();
    align->show();
    dynamic_cast<Gtk::Label*>(*ma->get_children().begin())->reparent(*align);
    ma->pack_start(*manage(align));
    align->set_padding(50,20,0,10);
    Gtk::VBox *vbox = dynamic_cast<Gtk::VBox *>(dialog->get_child());
    vbox->set_redraw_on_allocate(true);
    vbox->signal_expose_event().connect(
	sigc::group(&gx_cairo::error_box_expose,GTK_WIDGET(vbox->gobj()),sigc::_1,(void*)0),false);
    dialog->set_title(_("GUITARIX ERROR"));
    dialog->signal_response().connect(
	sigc::mem_fun(*this, &ErrorPopup::on_response));
    dialog->show();
}
Example #3
0
StudyTab::StudyTab(const Glib::RefPtr<ImagePool::Study>& study, StudyView* view) {

	set_size_request(-1, 35);

	m_study = study;
	m_studyview = view;
	
	std::string labeltext = m_study->patientsname().substr(0,20);

	m_label = manage(new Gtk::Label(labeltext, Gtk::ALIGN_LEFT));
	m_label->set_padding(2,0);
	m_label->show();

	m_progress = manage(new Gtk::ProgressBar);
	m_progress->set_fraction(0);
	m_progress->set_size_request(-1, 14);
	m_progress->show();

	Gtk::Image* image_left = manage(new Gtk::Image(Gtk::Stock::DND_MULTIPLE, Gtk::ICON_SIZE_LARGE_TOOLBAR));
	image_left->set_padding(2,0);
	image_left->show();

	Gtk::Image* image_close = manage(new Gtk::Image(Gtk::Stock::CLOSE, Gtk::ICON_SIZE_MENU));
	image_close->show();

	m_close = manage(new Gtk::ToolButton(*image_close));
	m_close->set_tooltip(m_tooltips, gettext("Close study"));
	m_close->set_size_request(22, 22);
	m_close->signal_clicked().connect(sigc::bind(signal_close, view));
	m_close->set_sensitive(false);
	m_close->hide();

	Gtk::VBox* vbox = manage(new Gtk::VBox);
	vbox->show();

	vbox->pack_start(*m_label);
	vbox->pack_start(*m_progress, Gtk::PACK_SHRINK);

	pack_start(*image_left);
	pack_start(*vbox);
	pack_start(*m_close);
}
PanelMundo::PanelMundo() {
	pathFileMundos = RUTA_CARPETA_MUNDOS;
	pathFileMundos += "mundos.xml";
	set_size_request(ANCHO_WIZARD, ALTO_WIZARD);
	cargarNombreMundos();
	// Widgets con funcionalidad
	botonEditar = new Gtk::Button("Editar mundo seleccionado");
	botonCrear = new Gtk::Button("Crear mundo nuevo");
	selector = new SelectorMundos(nombreMundos);
	creador = new CreadorMundo(nombreMundos);
	// Contenedores
	Gtk::VBox* cajaVertical = manage(new Gtk::VBox(true, 30));
	Gtk::HBox* cajaHorizontalUno = manage(new Gtk::HBox(false, 20));
	Gtk::HBox* cajaHorizontalDos = manage(new Gtk::HBox(false, 20));
	Gtk::Frame* cuadroEditar = manage(new Gtk::Frame("Edite un mundo existente"));
	Gtk::Frame* cuadroCrear = manage(new Gtk::Frame("Cree un mundo nuevo"));
	cajaHorizontalUno->pack_start(*selector);
	Gtk::HButtonBox* cajaAuxiliarUno = manage(new Gtk::HButtonBox());
	cajaAuxiliarUno->set_layout(Gtk::BUTTONBOX_CENTER);
	cajaAuxiliarUno->pack_start(*botonEditar, Gtk::PACK_SHRINK);
	cajaHorizontalUno->pack_start(*cajaAuxiliarUno, Gtk::PACK_SHRINK);
	cajaHorizontalDos->pack_start(*creador);
	Gtk::HButtonBox* cajaAuxiliarDos = manage(new Gtk::HButtonBox());
	cajaAuxiliarDos->set_layout(Gtk::BUTTONBOX_CENTER);
	cajaAuxiliarDos->pack_start(*botonCrear, Gtk::PACK_SHRINK);
	cajaHorizontalDos->pack_start(*cajaAuxiliarDos, Gtk::PACK_SHRINK);
	cuadroEditar->add(*cajaHorizontalUno);
	cuadroCrear->add(*cajaHorizontalDos);
	cajaVertical->pack_start(*cuadroEditar);
	cajaVertical->pack_start(*cuadroCrear);
	add(*cajaVertical);
	// Seniales
	botonEditar->signal_clicked().connect(sigc::mem_fun(*this,
											&PanelMundo::botonEditarClickeado));
	botonCrear->signal_clicked().connect(sigc::mem_fun(*this,
											&PanelMundo::botonCrearClickeado));
}
Example #5
0
mainwnd::mainwnd(perform *a_p)
{


    /* set the performance */
    m_mainperf = a_p;

    /* main window */
    set_window_title_filename( global_filename );

    m_main_wid = manage( new mainwid(  m_mainperf ));
    m_main_time = manage( new maintime( ));

    m_menubar   = manage(new MenuBar());
    m_menu_file = manage(new Menu());
    m_menu_control = manage( new Menu());
    m_menu_help    = manage( new Menu());
    
    /* fill with items */
    m_menu_file->items().push_back(MenuElem("New", mem_fun(*this,&mainwnd::file_new_dialog)));
    m_menu_file->items().push_back(SeparatorElem());
    m_menu_file->items().push_back(MenuElem("Open...",   mem_fun(*this,&mainwnd::file_open_dialog)));
    m_menu_file->items().push_back(MenuElem("Import...", mem_fun(*this,&mainwnd::file_import_dialog)));
    m_menu_file->items().push_back(SeparatorElem());
    m_menu_file->items().push_back(MenuElem("Save", mem_fun(*this,&mainwnd::file_save_dialog)));
    m_menu_file->items().push_back(MenuElem("Save As...", mem_fun(*this,&mainwnd::file_saveas_dialog)));
    m_menu_file->items().push_back(SeparatorElem());
    m_menu_file->items().push_back(MenuElem("Options...", mem_fun(*this,&mainwnd::options_dialog)));
    m_menu_file->items().push_back(SeparatorElem());
    m_menu_file->items().push_back(MenuElem("Exit", mem_fun(*this,&mainwnd::file_exit_dialog)));

    m_menu_help->items().push_back(MenuElem("About", mem_fun(*this,&mainwnd::about_dialog)));
 
    m_menubar->items().push_front(MenuElem("File", *m_menu_file));
    m_menubar->items().push_back(MenuElem("Help", *m_menu_help));

    HBox *hbox = manage( new HBox( false, 2 ) );

    m_button_stop = manage( new Button( ));
    m_button_stop->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( stop_xpm ))));
    m_button_stop->signal_clicked().connect( mem_fun(*this,&mainwnd::stop_playing));
    hbox->pack_start(*m_button_stop, false, false);

    m_button_play = manage( new Button() );
    m_button_play->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( play2_xpm  ))));
    m_button_play->signal_clicked().connect(  mem_fun( *this, &mainwnd::start_playing));
    hbox->pack_start(*m_button_play, false, false);

    //m_button_test = manage( new Button("test") );
    //m_button_test->signal_clicked().connect(  mem_fun( *this, &mainwnd::test));
    //hbox->pack_start(*m_button_test, false, false);

    m_button_perfedit = manage( new Button(  ));
    m_button_perfedit->add( *manage( new Image(Gdk::Pixbuf::create_from_xpm_data( perfedit_xpm  ))));
    m_button_perfedit->signal_clicked().connect( mem_fun( *this, &mainwnd::open_performance_edit ));
    hbox->pack_end(*m_button_perfedit, false, false, 4);

    m_adjust_bpm = manage( new Adjustment(  m_mainperf->get_bpm(), 20, 500, 1 ));
    m_spinbutton_bpm = manage( new SpinButton( *m_adjust_bpm ));
    m_spinbutton_bpm->set_editable( false );
    hbox->pack_start(*(manage( new Label( "  bpm " ))), false, false, 4);
    hbox->pack_start(*m_spinbutton_bpm, false, false );
  
    m_adjust_ss = manage( new Adjustment( 0, 0, c_max_sets - 1, 1 ));
    m_spinbutton_ss = manage( new SpinButton( *m_adjust_ss ));
    m_spinbutton_ss->set_editable( false );
    m_spinbutton_ss->set_wrap( true );
    hbox->pack_end(*m_spinbutton_ss, false, false );
    hbox->pack_end(*(manage( new Label( "  set " ))), false, false, 4);

    m_adjust_bpm->signal_value_changed().connect( mem_fun(*this,&mainwnd::adj_callback_bpm ));
    m_adjust_ss->signal_value_changed().connect( mem_fun(*this,&mainwnd::adj_callback_ss ));
 
    m_entry_notes = manage( new Entry());
    m_entry_notes->signal_changed().connect( mem_fun(*this,&mainwnd::edit_callback_notepad ));

    hbox->pack_start( *m_entry_notes, true, true );

    /* 2nd hbox */
    HBox *hbox2 = manage( new HBox( false, 0 ) );
    hbox2->pack_start( *manage(  new Image(Gdk::Pixbuf::create_from_xpm_data( seq24_xpm ))), false, false );
    hbox2->pack_end( *m_main_time, false, false );

    /* set up a vbox, put the menu in it, and add it */
    VBox *vbox = new VBox();
    vbox->set_border_width( 10 );
    vbox->pack_start(*hbox2, false, false );
    vbox->pack_start(*m_main_wid, true, true, 10 );
    vbox->pack_start(*hbox, false, false ); 
 

    VBox *ovbox = new VBox();
 
    ovbox->pack_start(*m_menubar, false, false );
    ovbox->pack_start( *vbox );

    /* add box */
    this->add (*ovbox);
  
    /* show everything */
    show_all();

    add_events( Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK );

    m_entry_notes->set_text( * m_mainperf->get_screen_set_notepad(  m_mainperf->get_screenset() )); 

    m_timeout_connect = Glib::signal_timeout().connect(mem_fun(*this,&mainwnd::timer_callback), 25);
    
    m_quit = false;

    m_perf_edit = new perfedit( m_mainperf );
    m_options = NULL;
  
}
MEStreetSegmentItemInfoWidget::MEStreetSegmentItemInfoWidget()
    : MEAbstractItemInfoWidget("SSI")
{
    // Table with 3 rows and 2 columns
    Gtk::Table* table = manage(new Gtk::Table(3, 2));

    Gtk::Label* label = NULL;
    Gtk::Box* box = NULL;
    Gtk::Adjustment* adj = NULL;

    // Road class + road condition
    box = manage(new Gtk::HBox());
    label = manage(new Gtk::Label("Road class"));
    label->set_alignment(XALIGN, YALIGN);
    box->pack_start(*label, true, true);
    m_roadClassVal = manage(new Gtk::Entry());
    m_roadClassVal->set_size_request(100, 18);
    box->pack_start(*m_roadClassVal, true, true);
    label = manage(new Gtk::Label("Road cond"));
    label->set_alignment(XALIGN, YALIGN);
    box->pack_start(*label, true, true);
    m_roadConditionVal = manage(new Gtk::Entry());
    m_roadConditionVal->set_size_request(100, 18);
    box->pack_start(*m_roadConditionVal, true, true);
    table->attach(*box, 0, 2, 0, 1,
                  Gtk::FILL | Gtk::EXPAND, Gtk::FILL);

    // House numbers
    label = manage(new Gtk::Label("Nbr L/R: type"));
    label->set_alignment(XALIGN, YALIGN);
    // Not sure if parameters correspond to old AttachOptions.
    //table->attach(*label, 0, 1, 1, 2, FIXED_OPT, FIXED_OPT);
    table->attach(*label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL);
    box = manage(new Gtk::HBox());

    adj = manage(new Gtk::Adjustment(0, 0, MAX_UINT16));
    m_houseNumberValLS = manage(new Gtk::SpinButton(*adj));
    m_houseNumberValLS->set_numeric(true);
    m_houseNumberValLS->set_size_request(60, 18);
    box->pack_start(*m_houseNumberValLS, true, true);

    label = manage(new Gtk::Label("-"));
    box->pack_start(*label, false, false);

    adj = manage(new Gtk::Adjustment(0, 0, MAX_UINT16));
    m_houseNumberValLE = manage(new Gtk::SpinButton(*adj));
    m_houseNumberValLE->set_numeric(true);
    m_houseNumberValLE->set_size_request(60, 18);
    box->pack_start(*m_houseNumberValLE);

    label = manage(new Gtk::Label(" / "));
    box->pack_start(*label, false, false);

    adj = manage(new Gtk::Adjustment(0, 0, MAX_UINT16));
    m_houseNumberValRS = manage(new Gtk::SpinButton(*adj));
    m_houseNumberValRS->set_numeric(true);
    m_houseNumberValRS->set_size_request(60, 18);
    box->pack_start(*m_houseNumberValRS);

    label = manage(new Gtk::Label("-"));
    box->pack_start(*label, false, false);

    adj = manage(new Gtk::Adjustment(0, 0, MAX_UINT16));
    m_houseNumberValRE = manage(new Gtk::SpinButton(*adj));
    m_houseNumberValRE->set_numeric(true);
    m_houseNumberValRE->set_size_request(60, 18);
    box->pack_start(*m_houseNumberValRE);

    label = manage(new Gtk::Label(":"));
    box->pack_start(*label, true, true);
    // Housenumber-type
    Gtk::Combo* tmpCombo = manage(new Gtk::Combo());
    m_houseNumberTypeVal = tmpCombo->get_entry();
    list<string> houseNbrTypeList;
    for (unsigned int i=0; i<5; i++) {  // Please change to < "invalidStreetNumberType"
        char tmpStr[8];
        sprintf(tmpStr, "%u", i);
        houseNbrTypeList.push_back(tmpStr);
    }
    tmpCombo->set_popdown_strings(houseNbrTypeList);
    tmpCombo->set_size_request(40,18);
    box->pack_start(*tmpCombo);

    table->attach(*box, 1, 2, 1, 2, Gtk::EXPAND, Gtk::FILL);

    // Street segment item attributes
    box = manage(new Gtk::HBox());
    // Ramp?
    m_rampVal = manage(new Gtk::CheckButton("ramp"));
    label = dynamic_cast<Gtk::Label*>(m_rampVal->get_child());
    if(label != NULL)
        label->set_alignment(XALIGN, 0.5);
    box->pack_start(*m_rampVal);
    // Roundabout
    m_roundaboutVal = manage(new Gtk::CheckButton("roundabout"));
    label = dynamic_cast<Gtk::Label*>(m_roundaboutVal->get_child());
    if(label != NULL)
        label->set_alignment(XALIGN, 0.5);
    box->pack_start(*m_roundaboutVal);
    // Roundaboutish
    m_roundaboutishVal = manage(new Gtk::CheckButton("rb_ish"));
    label = dynamic_cast<Gtk::Label*>(m_roundaboutishVal->get_child());
    if(label != NULL)
        label->set_alignment(XALIGN, 0.5);
    box->pack_start(*m_roundaboutishVal);
    // Multi dig
    m_multidigVal = manage(new Gtk::CheckButton("multi dig"));
    label = dynamic_cast<Gtk::Label*>(m_multidigVal->get_child());
    if(label != NULL)
        label->set_alignment(XALIGN, 0.5);
    box->pack_start(*m_multidigVal);
    // Controlled access
    m_controlledAccessVal = manage(new Gtk::CheckButton("ctrl acc"));
    label = dynamic_cast<Gtk::Label*>(m_controlledAccessVal->get_child());
    if(label != NULL)
        label->set_alignment(XALIGN, 0.5);
    box->pack_start(*m_controlledAccessVal);
    table->attach(*box, 0, 2, 2, 3,
                  Gtk::FILL | Gtk::EXPAND, Gtk::FILL);

    // Set editable
    m_roadClassVal->set_state(Gtk::STATE_INSENSITIVE);
    m_roadConditionVal->set_state(Gtk::STATE_INSENSITIVE);
#ifdef MAP_EDITABLE
    m_houseNumberValLS->set_state(Gtk::STATE_NORMAL);
    m_houseNumberValLE->set_state(Gtk::STATE_NORMAL);
    m_houseNumberValRS->set_state(Gtk::STATE_NORMAL);
    m_houseNumberValRE->set_state(Gtk::STATE_NORMAL);
    m_houseNumberTypeVal->set_state(Gtk::STATE_NORMAL);
    m_rampVal->set_state(Gtk::STATE_NORMAL);
    m_roundaboutVal->set_state(Gtk::STATE_NORMAL);
    m_roundaboutishVal->set_state(Gtk::STATE_NORMAL);
    m_multidigVal->set_state(Gtk::STATE_NORMAL);
#else
    m_houseNumberValLS->set_state(Gtk::STATE_INSENSITIVE);
    m_houseNumberValLE->set_state(Gtk::STATE_INSENSITIVE);
    m_houseNumberValRS->set_state(Gtk::STATE_INSENSITIVE);
    m_houseNumberValRE->set_state(Gtk::STATE_INSENSITIVE);
    m_houseNumberTypeVal->set_state(Gtk::STATE_INSENSITIVE);
    m_rampVal->set_state(Gtk::STATE_INSENSITIVE);
    m_roundaboutVal->set_state(Gtk::STATE_INSENSITIVE);
    m_roundaboutishVal->set_state(Gtk::STATE_INSENSITIVE);
    m_multidigVal->set_state(Gtk::STATE_INSENSITIVE);
    m_controlledAccessVal->set_state(Gtk::STATE_INSENSITIVE);
#endif

    // Add the table to this frame
    add(*table);
}
Example #7
0
NoteRenameDialog::NoteRenameDialog(const NoteBase::List & notes,
                                   const std::string & old_title,
                                   const NoteBase::Ptr & renamed_note)
  : Gtk::Dialog(_("Rename Note Links?"),
                *dynamic_cast<Gtk::Window*>(static_pointer_cast<Note>(renamed_note)->get_window()->host()),
                false)
  , m_notes_model(Gtk::ListStore::create(m_model_column_record))
  , m_dont_rename_button(_("_Don't Rename Links"), true)
  , m_rename_button(_("_Rename Links"), true)
  , m_select_all_button(_("Select All"))
  , m_select_none_button(_("Select None"))
  , m_always_show_dlg_radio(_("Always show this _window"), true)
  , m_always_rename_radio(_("Alwa_ys rename links"),
                          true)
  , m_never_rename_radio(_("Never rename _links"),
                         true)
{
  set_default_response(Gtk::RESPONSE_CANCEL);
  set_border_width(10);

  Gtk::Box * const vbox = get_vbox();

  add_action_widget(m_rename_button, Gtk::RESPONSE_YES);
  add_action_widget(m_dont_rename_button, Gtk::RESPONSE_NO);

  std::for_each(notes.begin(), notes.end(),
                ModelFiller(m_notes_model));

  Gtk::Label * const label = Gtk::manage(new Gtk::Label());
  label->set_use_markup(true);
  label->set_markup(
    Glib::ustring::compose(
      _("Rename links in other notes from "
        "\"<span underline=\"single\">%1</span>\" to "
        "\"<span underline=\"single\">%2</span>\"?\n\n"
        "If you do not rename the links, they will no longer link to "
        "anything."),
      old_title,
      renamed_note->get_title()));
  label->set_line_wrap(true);
  vbox->pack_start(*label, false, true, 5);

  Gtk::TreeView * const notes_view = Gtk::manage(
                                       new Gtk::TreeView(
                                             m_notes_model));
  notes_view->set_size_request(-1, 200);
  notes_view->signal_row_activated().connect(
    sigc::bind(
      sigc::mem_fun(*this,
                    &NoteRenameDialog::on_notes_view_row_activated),
      old_title));

  ModelColumnRecord model_column_record;

  Gtk::CellRendererToggle * const toggle_cell
                                    = Gtk::manage(
                                        new Gtk::CellRendererToggle);
  toggle_cell->set_activatable(true);
  toggle_cell->signal_toggled().connect(
    sigc::mem_fun(*this,
                  &NoteRenameDialog::on_toggle_cell_toggled));

  {
    Gtk::TreeViewColumn * const column = Gtk::manage(
                                           new Gtk::TreeViewColumn(
                                                 _("Rename Links"),
                                                 *toggle_cell));
    column->add_attribute(*toggle_cell,
                          "active",
                          model_column_record.get_column_selected());
    column->set_sort_column(
              model_column_record.get_column_selected());
    column->set_resizable(true);
    notes_view->append_column(*column);
  }

  {
    Gtk::TreeViewColumn * const column
      = Gtk::manage(
          new Gtk::TreeViewColumn(
                _("Note Title"),
                model_column_record.get_column_title()));
    column->set_sort_column(model_column_record.get_column_title());
    column->set_resizable(true);
    notes_view->append_column(*column);
  }

  m_select_all_button.signal_clicked().connect(
    sigc::bind(
      sigc::mem_fun(*this,
                    &NoteRenameDialog::on_select_all_button_clicked),
      true));

  m_select_none_button.signal_clicked().connect(
    sigc::bind(
      sigc::mem_fun(*this,
                    &NoteRenameDialog::on_select_all_button_clicked),
      false));

  Gtk::Grid * const notes_button_box = manage(new Gtk::Grid);
  notes_button_box->set_column_spacing(5);
  notes_button_box->attach(m_select_none_button, 0, 0, 1, 1);
  notes_button_box->attach(m_select_all_button, 1, 0, 1, 1);
  notes_button_box->set_hexpand(true);

  Gtk::ScrolledWindow * const notes_scroll
                                = Gtk::manage(
                                         new Gtk::ScrolledWindow());
  notes_scroll->add(*notes_view);
  notes_scroll->set_hexpand(true);
  notes_scroll->set_vexpand(true);

  m_notes_box.attach(*notes_scroll, 0, 0, 1, 1);
  m_notes_box.attach(*notes_button_box, 0, 1, 1, 1);

  Gtk::Expander * const advanced_expander
                          = Gtk::manage(new Gtk::Expander(
                                              _("Ad_vanced"), true));
  Gtk::Grid * const expand_box = Gtk::manage(new Gtk::Grid);
  expand_box->attach(m_notes_box, 0, 0, 1, 1);

  m_always_show_dlg_radio.signal_clicked().connect(
    sigc::mem_fun(*this,
                  &NoteRenameDialog::on_always_show_dlg_clicked));

  Gtk::RadioButton::Group group = m_always_show_dlg_radio.get_group();

  m_never_rename_radio.set_group(group);
  m_never_rename_radio.signal_clicked().connect(
    sigc::mem_fun(*this,
                  &NoteRenameDialog::on_never_rename_clicked));

  m_always_rename_radio.set_group(group);
  m_always_rename_radio.signal_clicked().connect(
    sigc::mem_fun(*this,
                  &NoteRenameDialog::on_always_rename_clicked));

  expand_box->attach(m_always_show_dlg_radio, 0, 1, 1, 1);
  expand_box->attach(m_never_rename_radio, 0, 2, 1, 1);
  expand_box->attach(m_always_rename_radio, 0, 3, 1, 1);
  advanced_expander->add(*expand_box);
  vbox->pack_start(*advanced_expander, true, true, 5);

  advanced_expander->property_expanded().signal_changed().connect(
    sigc::bind(
      sigc::mem_fun(*this,
                    &NoteRenameDialog::on_advanced_expander_changed),
      advanced_expander->property_expanded().get_value()));

  set_focus(m_dont_rename_button);
  vbox->show_all();
}
Example #8
0
  SSAOWrapper::SSAOWrapper()
  { 
    _radius = 0.5;
    _totStrength = 1;
    _dropoff = 0.4;

    _filter.build(); 

    glGenTextures( 1, &_randomTexture);
    glBindTexture(GL_TEXTURE_2D, _randomTexture);

    std::vector<GLubyte> texture;
    texture.resize(3 * _randomTextureSize * _randomTextureSize);

    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    
    srand(120121);
    for (size_t i(0); i < 3 * _randomTextureSize * _randomTextureSize; ++i)
      texture[i] = (rand() * 255.0) / RAND_MAX;
    
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, _randomTextureSize, _randomTextureSize, 
		 0, GL_RGB, GL_UNSIGNED_BYTE, &texture[0]);
    glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
    glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
    glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
    glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );

    //Build the controls
    {
      Gtk::VBox* labelVbox = manage(new Gtk::VBox);
      Gtk::Label* Label1 = manage(new Gtk::Label("Radius"));
      Gtk::Label* Label2 = manage(new Gtk::Label("Magnitude"));
      Gtk::Label* Label3 = manage(new Gtk::Label("Drop off"));
      labelVbox->add(*Label1); Label1->show();
      labelVbox->add(*Label2); Label2->show();
      labelVbox->add(*Label3); Label3->show();
      _optlist.add(*labelVbox);
      labelVbox->show();
    }

    {
      Gtk::VBox* sliderVbox = manage(new Gtk::VBox);
      sliderVbox->add(_radiusSlider);
      sliderVbox->add(_totStrengthSlider);
      sliderVbox->add(_dropoffSlider);

      _optlist.add(*sliderVbox);
      sliderVbox->show();
    }
    _optlist.show();

    _radiusSlider.set_text(boost::lexical_cast<std::string>(_radius));
    _radiusSlider.signal_changed().connect(sigc::mem_fun(this, &SSAOWrapper::settingsCallback));
    _radiusSlider.show();

    _totStrengthSlider.set_text(boost::lexical_cast<std::string>(_totStrength));
    _totStrengthSlider.signal_changed().connect(sigc::mem_fun(this, &SSAOWrapper::settingsCallback));
    _totStrengthSlider.show();
    
    _dropoffSlider.set_text(boost::lexical_cast<std::string>(_dropoff));
    _dropoffSlider.signal_changed().connect(sigc::mem_fun(this, &SSAOWrapper::settingsCallback));
    _dropoffSlider.show();
  }
Example #9
0
/*Keybinding setup (editor for .seq24rc keybindings).*/
void
options::add_keyboard_page()
{
    VBox *mainbox = manage(new VBox());
    mainbox->set_spacing(6);
    m_notebook->append_page(*mainbox, "_Keyboard", true);

    Label* label;
    KeyBindEntry* entry;

    HBox *hbox = manage (new HBox());
    CheckButton *check = manage(new CheckButton(
                                    "_Show key labels on sequences", true));
    check->signal_toggled().connect(bind(mem_fun(*this,
                                         &options::input_callback), (int)e_keylabelsonsequence,
                                         check));
    check->set_active(m_perf->m_show_ui_sequence_key);
    mainbox->pack_start(*check, false, false);

    /*Frame for sequence toggle keys*/
    Frame* controlframe = manage(new Frame("Control keys"));
    controlframe->set_border_width(4);
    mainbox->pack_start(*controlframe, Gtk::PACK_SHRINK);

    Table* controltable = manage(new Table(4, 8, false));
    controltable->set_border_width(4);
    controltable->set_spacings(4);
    controlframe->add(*controltable);

    label = manage(new Label("Start", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_start));
    controltable->attach(*label, 0, 1, 0, 1);
    controltable->attach(*entry, 1, 2, 0, 1);

    label = manage(new Label("Stop", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_stop));
    controltable->attach(*label, 0, 1, 1, 2);
    controltable->attach(*entry, 1, 2, 1, 2);

    label = manage(new Label("Song", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_song));
    controltable->attach(*label, 0, 1, 2, 3);
    controltable->attach(*entry, 1, 2, 2, 3);
#ifdef JACK_SUPPORT
    label = manage(new Label("Jack", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_jack));
    controltable->attach(*label, 0, 1, 3, 4);
    controltable->attach(*entry, 1, 2, 3, 4);
#endif // JACK_SUPPORT

    label = manage(new Label("Snapshot 1", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_snapshot_1));
    controltable->attach(*label, 2, 3, 0, 1);
    controltable->attach(*entry, 3, 4, 0, 1);

    label = manage(new Label("Snapshot 2", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_snapshot_2));
    controltable->attach(*label, 2, 3, 1, 2);
    controltable->attach(*entry, 3, 4, 1, 2);

    label = manage(new Label("bpm down", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_bpm_dn));
    controltable->attach(*label, 2, 3, 3, 4);
    controltable->attach(*entry, 3, 4, 3, 4);

    label = manage(new Label("bpm up", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_bpm_up));
    controltable->attach(*label, 2, 3, 2, 3);
    controltable->attach(*entry, 3, 4, 2, 3);

    label = manage(new Label("Replace", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_replace));
    controltable->attach(*label, 4, 5, 0, 1);
    controltable->attach(*entry, 5, 6, 0, 1);

    label = manage(new Label("Queue", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_queue));
    controltable->attach(*label, 4, 5, 1, 2);
    controltable->attach(*entry, 5, 6, 1, 2);

    label = manage(new Label("Keep queue", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_keep_queue));
    controltable->attach(*label, 4, 5, 2, 3);
    controltable->attach(*entry, 5, 6, 2, 3);

    label = manage(new Label("Menu mode", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_menu));
    controltable->attach(*label, 4, 5, 3, 4);
    controltable->attach(*entry, 5, 6, 3, 4);

    label = manage(new Label("Screenset up", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_screenset_up));
    controltable->attach(*label, 6, 7, 0, 1);
    controltable->attach(*entry, 7, 8, 0, 1);

    label = manage(new Label("Screenset down", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_screenset_dn));
    controltable->attach(*label, 6, 7, 1, 2);
    controltable->attach(*entry, 7, 8, 1, 2);

    label = manage(new Label("Set playing screenset", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_set_playing_screenset));
    controltable->attach(*label, 6, 7, 2, 3);
    controltable->attach(*entry, 7, 8, 2, 3);

    label = manage(new Label("Follow transport", Gtk::ALIGN_RIGHT));
    entry = manage(new KeyBindEntry(KeyBindEntry::location,
                                    &m_perf->m_key_follow_trans));
    controltable->attach(*label, 6, 7, 3, 4);
    controltable->attach(*entry, 7, 8, 3, 4);

    /*Frame for sequence toggle keys*/
    Frame* toggleframe = manage(new Frame("Sequence toggle keys"));
    toggleframe->set_border_width(4);
    mainbox->pack_start(*toggleframe, Gtk::PACK_SHRINK);

    Table* toggletable = manage(new Table(4, 16, false));
    toggletable->set_border_width(4);
    toggletable->set_spacings(4);
    toggleframe->add(*toggletable);

    int x = 0;
    int y = 0;
    Label* numlabel;

    for (int i = 0; i < 32; i++)
    {
        x = i % 8 * 2;
        y = i / 8;
        int slot = x * 2 + y; // count this way: 0, 4, 8, 16...
        char buf[16];
        snprintf(buf, sizeof(buf), "%d", slot);
        numlabel = manage(new Label(buf, Gtk::ALIGN_RIGHT));
        entry = manage(new KeyBindEntry(KeyBindEntry::events, NULL,
                                        m_perf, slot));
        toggletable->attach(*numlabel, x, x + 1, y, y + 1);
        toggletable->attach(*entry, x + 1, x + 2, y, y + 1);
    }

    /*Frame for mute group slots*/
    Frame* mutegroupframe = manage(new Frame("Mute-group slots"));
    mutegroupframe->set_border_width(4);
    mainbox->pack_start(*mutegroupframe, Gtk::PACK_SHRINK);

    Table* mutegrouptable = manage(new Table(4, 16, false));
    mutegrouptable->set_border_width(4);
    mutegrouptable->set_spacings(4);
    mutegroupframe->add(*mutegrouptable);

    for (int i = 0; i <32; i++)
    {
        x = i%8*2;
        y = i/8;
        char buf[16];
        snprintf(buf, sizeof(buf), "%d", i);
        numlabel = manage(new Label(buf, Gtk::ALIGN_RIGHT));
        entry = manage(new KeyBindEntry(KeyBindEntry::groups, NULL,
                                        m_perf, i));
        mutegrouptable->attach(*numlabel, x, x + 1, y, y + 1);
        mutegrouptable->attach(*entry, x + 1, x + 2, y, y + 1);
    }

#define AddKey(text, integer) \
    label = manage(new Label(text)); \
    hbox->pack_start(*label, false, false, 4); \
    entry = manage(new KeyBindEntry(KeyBindEntry::location, &integer)); \
    hbox->pack_start(*entry, false, false, 4);

    hbox = manage(new HBox());
    AddKey("Learn (while pressing a mute-group key):",
           m_perf->m_key_group_learn);
    AddKey("Disable:", m_perf->m_key_group_off);
    AddKey("Enable:", m_perf->m_key_group_on);
    mainbox->pack_start (*hbox, false, false);

#undef AddKey
}
Example #10
0
int comp(int N[5][15],int C[5][5])
{
int c=0,o=0,sf=0,at=0,A[25],B[25],NN[5][15],CC[5][5],NNN[5][15],CCC[5][5],AA[25],BB[25],BBB[25],AAA[25],a=0,cc=0,oo=0,ooo=0,ccc=0,i=0,j=0;
int oooo=0,D[25]={0},S[25],b,k=0,l=0;
	for(i=1;i<=25;i++)
	S[i-1]=i;

	d=25;

	for(i=0;i<5;i++)
	for(j=0;j<5;j++){ 
	if(C[i][j]<=0)
	A[c++]=(5*i)+j+1;
	
	else if(C[i][j]>0){
	B[o++]=(5*i)+j+1;
	del(S,D,((5*i)+j+1));}
		}

	for(i=0;i<5;i++)
	for(j=0;j<5;j++) 
	if(C[i][j]<0)
	b++;

	ooo=0;

	for(k=0;k<5;k++)
	for(j=0;j<15;j++)
	if(N[k][j]>0)
	++ooo;

	ccc=0;
	for(k=0;k<5;k++)
	for(j=0;j<15;j++)
	if(N[k][j]<0)
	++ccc;

//defence
	if(oo>10)
	{
	sf=0;
	for(i=0;i<o;i++)     {
	
	for(k=0;k<5;k++)
	for(j=0;j<15;j++){
	 NN[k][j]=N[k][j];
	 CC[k][j/3]=C[k][j/3];
		}

	manage(NN,0,B[i],CC);
	set(NN,CC);
//printf("\n Printing\n");
//build(NN,0,1);

	oo=0;

	for(k=0;k<5;k++)
	for(j=0;j<15;j++)
	if(NN[k][j]>0){
	++oo;
//printf("\nNN k=%d j=%d\n",k,j);
				}

//	printf("\noo=%d\n",oo);
	for(k=0;k<5;k++)
	for(j=0;j<5;j++)
	if(CC[k][j]>0){
	++oo;
//printf("\nCC k=%d j=%d\n",k,j);
				}
	BB[i]=oo-o-ooo-1;

	//printf("\n BB[i]=%d  oo=%d  o=%d ooo=%d \n",BB[i],oo,o,ooo);
//safe attack check
	if(BB[i]>0) {

	at=0;


	for(l=0;l<c;l++)     {
	
	for(k=0;k<5;k++)
	for(j=0;j<15;j++){
	 NN[k][j]=N[k][j];
	 CC[k][j/3]=C[k][j/3];
		}

	manage(NN,1,A[l],CC);
	set(NN,CC);

	cc=0;

	for(k=0;k<5;k++)
	for(j=0;j<15;j++)
	if(NN[k][j]<0)
	++cc;

	for(k=0;k<5;k++)
	for(j=0;j<5;j++)
	if(CC[k][j]<0)
	++cc;

	AA[l]=cc-b-ccc-1;
//printf("\n AA[l]=%d  cc=%d  b=%d ccc=%d \n",AA[l],cc,b,ccc);
//safety check again

	for(k=0;k<5;k++)
	for(j=0;j<15;j++){
	 NNN[k][j]=NN[k][j];
	 CCC[k][j/3]=CC[k][j/3];
		}

	manage(NNN,0,B[i],CCC);
	set(NNN,CCC);

	oooo=0;

	for(k=0;k<5;k++)
	for(j=0;j<15;j++)
	if(NNN[k][j]>0)
	++oooo;

	for(k=0;k<5;k++)
	for(j=0;j<5;j++)
	if(CCC[k][j]>0)
	++oooo;
			
	sf=oooo-oo-1;

//	printf("\n sf=%d  oo=%d  oooo=%d at=%d  (AA[l]-sf)=%d A[l]=%d\n",sf,oo,oooo,at,(AA[l]-sf),A[l]);
	
	D[l]=AA[l];	

	if(sf>=0)
	del(S,D,A[l]);
	

				}

		    }	

		}

}

//attack

	for(i=0;i<c;i++)     {
	
	for(k=0;k<5;k++)
	for(j=0;j<15;j++){
	 NN[k][j]=N[k][j];
	 CC[k][j/3]=C[k][j/3];
		}

	manage(NN,1,A[i],CC);
	set(NN,CC);

	cc=0;

	for(k=0;k<5;k++)
	for(j=0;j<15;j++)
	if(NN[k][j]<0)
	++cc;

	for(k=0;k<5;k++)
	for(j=0;j<5;j++)
	if(CC[k][j]<0)
	++cc;

	AA[i]=cc-b-ccc-1;

	set(NN,CC);

	o=0;

	for(k=0;k<5;k++)
	for(j=0;j<5;j++)
	if(CC[k][j]>0)
	B[o++]=(5*k)+j+1;

	ooo=0;
	for(k=0;k<5;k++)
	for(j=0;j<15;j++)
	if(NN[k][j]>0)
	++ooo;

	sf=0;

	for(l=0;l<o;l++)     {
	
	for(k=0;k<5;k++)
	for(j=0;j<15;j++){
	 NNN[k][j]=NN[k][j];
	 CCC[k][j/3]=CC[k][j/3];
		}

	manage(NNN,0,B[l],CCC);
	set(NNN,CCC);
//printf("\n Printing\n");
//build(NN,0,1);

	oo=0;

	for(k=0;k<5;k++)
	for(j=0;j<15;j++)
	if(NNN[k][j]>0){
	++oo;
//printf("\nNN k=%d j=%d\n",k,j);
				}

//	printf("\noo=%d\n",oo);
	
	for(k=0;k<5;k++)
	for(j=0;j<5;j++)
	if(CCC[k][j]>0){
	++oo;
//printf("\nCC k=%d j=%d\n",k,j);
				}
	BB[l]=oo-o-ooo-1;
//	printf("\nBB[%d]=%d\n",BB[l],l);

	if(BB[l]>sf)
	sf=BB[l];

						}

	AAA[i]=sf;
/*	k=0;
 	for(j=1;j<o;j++)
	if(BB[j]>BB[k])
	 k=j;
	AAA[i]=BB[k];
	printf("\n AAA[i]=%d  BB[k]=%d",AAA[i],BB[k]);
							}*/
				}

/*	printf("\n attack \n");
	for(i=0;i<c;i++)
	printf(" %d ",A[i]);
	printf("\n");
	for(i=0;i<c;i++)
	printf(" %d ",AA[i]);
	printf("\n");
	for(i=0;i<c;i++)
	printf(" %d ",AAA[i]);*/

//	printf("\ndefence\n");
	k=0;
 	for(i=1;i<c;i++){
	if(AA[i]>AA[k])
	 k=i;
	else if(AA[i]==AA[k]){
	if(AAA[k]>AAA[i])
	k=i;
	}
	}

/*	if(t<4){

	if(C[0][0]==0)
		return 1;
	else if(C[0][4]==0)
		return 5;
	else if(C[4][0]==0)
		return 21;
	else if(C[4][4]==0)
		return 25;

			}

	else{*/

	if(d>0) {
	l=0;
 	for(i=1;i<d;i++)
	if(D[i]>=D[l])
	 l=i;

/*	for(i=0;i<d;i++)
	printf(" %d ",S[i]);
	printf("\n");
	for(i=0;i<d;i++)
	printf(" %d ",D[i]);
	printf("\nAA[k]=%d  D[l]=%d A[k]=%d  S[l]=%d \n",AA[k],D[l],A[k],S[l]);*/

	if(AA[k]>D[l]){
//	printf("\nAttacking\n");
	return A[k];}

	else{
//	printf("\n defencing\n");
	return S[l]; }
			}

	else{
//	printf("\n Attacking \n");
	return A[k];
			}
								
		}
Example #11
0
BugzillaPreferences::BugzillaPreferences()
    : Gtk::VBox(false, 12)
{
    _init_static();
    last_opened_dir = Glib::get_home_dir();

    Gtk::Label *l = manage(new Gtk::Label (_("You can use any bugzilla just by dragging links "
                                           "into notes.  If you want a special icon for "
                                           "certain hosts, add them here.")));
    l->property_wrap() = true;
    l->property_xalign() = 0;

    pack_start(*l, false, false, 0);

    icon_store = Gtk::ListStore::create(m_columns);
    icon_store->set_sort_column(m_columns.host, Gtk::SORT_ASCENDING);

    icon_tree = manage(new Gtk::TreeView (icon_store));
    icon_tree->set_headers_visible(true);
    icon_tree->get_selection()->set_mode(Gtk::SELECTION_SINGLE);
    icon_tree->get_selection()->signal_changed().connect(
        sigc::mem_fun(*this, &BugzillaPreferences::selection_changed));

    Gtk::TreeViewColumn *host_col = manage(new Gtk::TreeViewColumn(_("Host Name"), m_columns.host));
    host_col->set_sizing(Gtk::TREE_VIEW_COLUMN_AUTOSIZE);
    host_col->set_resizable(true);
    host_col->set_expand(true);
    host_col->set_min_width(200);

    host_col->set_sort_column(m_columns.host);
    host_col->set_sort_indicator(false);
    host_col->set_reorderable(false);
    host_col->set_sort_order(Gtk::SORT_ASCENDING);

    icon_tree->append_column (*host_col);

    Gtk::TreeViewColumn *icon_col = manage(new Gtk::TreeViewColumn(_("Icon"), m_columns.icon));
    icon_col->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED);
    icon_col->set_max_width(50);
    icon_col->set_min_width(50);
    icon_col->set_resizable(false);

    icon_tree->append_column (*icon_col);

    Gtk::ScrolledWindow *sw = manage(new Gtk::ScrolledWindow ());
    sw->set_shadow_type(Gtk::SHADOW_IN);
    sw->property_height_request() = 200;
    sw->property_width_request() = 300;
    sw->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
    sw->add (*icon_tree);

    pack_start(*sw, true, true, 0);

    add_button = manage(new Gtk::Button (Gtk::Stock::ADD));
    add_button->signal_clicked().connect(
        sigc::mem_fun(*this, &BugzillaPreferences::add_clicked));

    remove_button = manage(new Gtk::Button (Gtk::Stock::REMOVE));
    remove_button->set_sensitive(false);
    remove_button->signal_clicked().connect(
        sigc::mem_fun(*this,  &BugzillaPreferences::remove_clicked));

    Gtk::HButtonBox *hbutton_box = manage(new Gtk::HButtonBox ());
    hbutton_box->set_layout(Gtk::BUTTONBOX_START);
    hbutton_box->set_spacing(6);

    hbutton_box->pack_start(*add_button);
    hbutton_box->pack_start(*remove_button);
    pack_start(*hbutton_box, false, false, 0);

    show_all ();
}
Example #12
0
void BugzillaPreferences::add_clicked()
{
    Gtk::FileChooserDialog dialog(_("Select an icon..."),
                                  Gtk::FILE_CHOOSER_ACTION_OPEN);
    dialog.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
    dialog.add_button (Gtk::Stock::OPEN, Gtk::RESPONSE_OK);

    dialog.set_default_response(Gtk::RESPONSE_OK);
    dialog.set_local_only(true);
    dialog.set_current_folder (last_opened_dir);

    Glib::RefPtr<Gtk::FileFilter> filter = Gtk::FileFilter::create();
    filter->add_pixbuf_formats ();

    dialog.add_filter(filter);

    // Extra Widget
    Gtk::Label *l = manage(new Gtk::Label (_("_Host name:"), true));
    Gtk::Entry *host_entry = manage(new Gtk::Entry ());
    l->set_mnemonic_widget(*host_entry);
    Gtk::HBox *hbox = manage(new Gtk::HBox (false, 6));
    hbox->pack_start (*l, false, false, 0);
    hbox->pack_start (*host_entry, true, true, 0);
    hbox->show_all ();

    dialog.set_extra_widget(*hbox);

    int response;
    std::string icon_file;
    std::string host;

    while(1) {
        response = dialog.run ();
        icon_file = dialog.get_filename();
        host = sharp::string_trim(host_entry->get_text());


        if (response == (int) Gtk::RESPONSE_OK) {

            bool valid = sanitize_hostname(host);

            if(valid && !host.empty()) {
                break;
            }
            // Let the user know that they
            // have to specify a host name.
            gnote::utils::HIGMessageDialog warn(
                NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
                Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK,
                _("Host name invalid"),
                _("You must specify a valid Bugzilla "
                  "host name to use with this icon."));
            warn.run ();

            host_entry->grab_focus ();
        }
        else if (response != (int) Gtk::RESPONSE_OK) {
            return;
        }
    }

    // Keep track of the last directory the user had open
    last_opened_dir = dialog.get_current_folder();

    // Copy the file to the BugzillaIcons directory
    std::string err_msg;
    if (!copy_to_bugzilla_icons_dir (icon_file, host, err_msg)) {
        gnote::utils::HIGMessageDialog err(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
                                           Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK,
                                           _("Error saving icon"),
                                           std::string(_("Could not save the icon file.")) +
                                           "  " + err_msg);
        err.run();
    }

    update_icon_store();
}
Example #13
0
MainWindow::MainWindow () :
	Gtk::Window(),
	m_events(m_window.GetWindow()),
	m_mainimage(PREFIX_SHARE "/meteor.png"),
	m_padConfigDialog(*this, m_config),
	m_running(false)
{
	this->set_title("Meteor");
	this->set_resizable(false);

	Gtk::Menu* menu_file = manage(new Gtk::Menu);
	menu_file->items().push_back(Gtk::Menu_Helpers::StockMenuElem(
				Gtk::Stock::OPEN, sigc::mem_fun(*this,
					&MainWindow::on_open)));
	Gtk::Image* img = manage(new Gtk::Image(Gtk::Stock::OPEN,
				Gtk::ICON_SIZE_MENU));
	menu_file->items().push_back(Gtk::Menu_Helpers::ImageMenuElem(
				"Open _BIOS", *img, sigc::mem_fun(*this, &MainWindow::on_open_bios)));
	menu_file->items().push_back(Gtk::Menu_Helpers::StockMenuElem(
				Gtk::Stock::CLOSE, sigc::mem_fun(*this,
					&MainWindow::on_close)));
	img = manage(new Gtk::Image(Gtk::Stock::CLOSE,
				Gtk::ICON_SIZE_MENU));
	menu_file->items().push_back(Gtk::Menu_Helpers::ImageMenuElem(
				"Close B_IOS", *img, sigc::mem_fun(*this,
					&MainWindow::on_close_bios)));
	menu_file->items().push_back(Gtk::Menu_Helpers::SeparatorElem());
	menu_file->items().push_back(Gtk::Menu_Helpers::StockMenuElem(
				Gtk::Stock::QUIT, sigc::mem_fun(*this,
					&MainWindow::on_quit)));

	Gtk::Menu* menu_emulator = manage(new Gtk::Menu);
	img = manage(new Gtk::Image(Gtk::Stock::MEDIA_PLAY,
				Gtk::ICON_SIZE_MENU));
	menu_emulator->items().push_back(Gtk::Menu_Helpers::ImageMenuElem(
				"R_un", Gtk::AccelKey('u', Gdk::CONTROL_MASK), *img,
				sigc::mem_fun(*this, &MainWindow::on_run)));
	img = manage(new Gtk::Image(Gtk::Stock::MEDIA_STOP,
				Gtk::ICON_SIZE_MENU));
	menu_emulator->items().push_back(Gtk::Menu_Helpers::ImageMenuElem(
				"_Stop", Gtk::AccelKey('s', Gdk::CONTROL_MASK), *img,
				sigc::mem_fun(*this, &MainWindow::on_stop)));
	img = manage(new Gtk::Image(Gtk::Stock::MEDIA_REWIND,
				Gtk::ICON_SIZE_MENU));
	menu_emulator->items().push_back(Gtk::Menu_Helpers::ImageMenuElem(
				"_Reset", Gtk::AccelKey('r', Gdk::CONTROL_MASK), *img,
				sigc::mem_fun(*this, &MainWindow::on_reset)));
	menu_emulator->items().push_back(Gtk::Menu_Helpers::SeparatorElem());
	img = manage(new Gtk::Image(Gtk::Stock::PREFERENCES,
				Gtk::ICON_SIZE_MENU));
	menu_emulator->items().push_back(Gtk::Menu_Helpers::ImageMenuElem(
				"_Configure pad", *img,
				sigc::mem_fun(*this, &MainWindow::on_config_pad)));

	Gtk::Menu* menu_sstate = manage(new Gtk::Menu);
	Gtk::Menu* menu_lstate = manage(new Gtk::Menu);
	{
		char tmp[2];
		tmp[0] = '1';
		tmp[1] = '\0';
		for (char c = 0; c < 9; ++c, ++tmp[0])
			menu_sstate->items().push_back(Gtk::Menu_Helpers::MenuElem(
						tmp, Gtk::AccelKey(GDK_F1 + c, Gdk::CONTROL_MASK),
						sigc::bind<uint8_t>(sigc::mem_fun(
								*this, &MainWindow::on_save_state), c)));

		tmp[0] = '1';
		for (char c = 0; c < 9; ++c, ++tmp[0])
			menu_lstate->items().push_back(Gtk::Menu_Helpers::MenuElem(
						tmp, Gtk::AccelKey(GDK_F1 + c, (Gdk::ModifierType)0),
						sigc::bind<uint8_t>(sigc::mem_fun(
								*this, &MainWindow::on_load_state), c)));
	}

	Gtk::Menu* menu_state = manage(new Gtk::Menu);
	img = manage(new Gtk::Image(Gtk::Stock::SAVE,
				Gtk::ICON_SIZE_MENU));
	menu_state->items().push_back(Gtk::Menu_Helpers::ImageMenuElem(
				"Save", *img, *menu_sstate));
	img = manage(new Gtk::Image(Gtk::Stock::OPEN,
				Gtk::ICON_SIZE_MENU));
	menu_state->items().push_back(Gtk::Menu_Helpers::ImageMenuElem(
				"Load", *img, *menu_lstate));

	Gtk::Menu* menu_debug = manage(new Gtk::Menu);
	Gtk::Menu_Helpers::CheckMenuElem disassemblercheck(
				"Disassembler", sigc::mem_fun(*this,
					&MainWindow::on_menu_disassembler_toggle));
	m_refDisassemblerCheck =
		Glib::RefPtr<Gtk::CheckMenuItem>::cast_static(
				disassemblercheck.get_child());
	menu_debug->items().push_back(disassemblercheck);
	Gtk::Menu_Helpers::CheckMenuElem palettecheck(
				"Palette", sigc::mem_fun(*this,
					&MainWindow::on_menu_palette_toggle));
	m_refPaletteCheck =
		Glib::RefPtr<Gtk::CheckMenuItem>::cast_static(
				palettecheck.get_child());
	menu_debug->items().push_back(palettecheck);
	Gtk::Menu_Helpers::CheckMenuElem vramcheck(
				"Vram viewer", sigc::mem_fun(*this,
					&MainWindow::on_menu_vram_toggle));
	m_refVramCheck =
		Glib::RefPtr<Gtk::CheckMenuItem>::cast_static(
				vramcheck.get_child());
	menu_debug->items().push_back(vramcheck);

	Gtk::Menu* menu_help = manage(new Gtk::Menu);
	menu_help->items().push_back(Gtk::Menu_Helpers::StockMenuElem(
				Gtk::Stock::ABOUT, sigc::mem_fun(*this,
					&MainWindow::on_menu_about)));

	Gtk::MenuBar* menubar = manage(new Gtk::MenuBar);
	menubar->items().push_back(Gtk::Menu_Helpers::MenuElem("_File", *menu_file));
	menubar->items().push_back(
			Gtk::Menu_Helpers::MenuElem("_Emulator", *menu_emulator));
	menubar->items().push_back(
			Gtk::Menu_Helpers::MenuElem("_State", *menu_state));
	menubar->items().push_back(
			Gtk::Menu_Helpers::MenuElem("_Debug", *menu_debug));
	menubar->items().push_back(
			Gtk::Menu_Helpers::StockMenuElem(Gtk::Stock::HELP, *menu_help));

	m_viewport.set_double_buffered(false);
	m_viewport.set_size_request(4*240, 4*160);

	m_statusbar.set_has_resize_grip(false);

	m_mainvbox.pack_start(*menubar);
	m_mainvbox.pack_start(m_mainimage);
	m_mainvbox.pack_start(m_viewport);
	m_mainvbox.pack_start(m_statusbar);

	this->add(m_mainvbox);

	menubar->show_all();
	m_mainimage.show_all();
	m_statusbar.show_all();
	m_mainvbox.show();
	this->show();

	m_disassemblerWindow.signal_hide().connect(sigc::mem_fun(*this,
				&MainWindow::on_disassembler_hide));
	m_paletteWindow.signal_hide().connect(sigc::mem_fun(*this,
				&MainWindow::on_palette_hide));
	m_vramWindow.signal_hide().connect(sigc::mem_fun(*this,
				&MainWindow::on_vram_hide));

	m_config.Load();
	m_config.Init();
	m_batteryPath = m_config.GetBatteryPath();
	m_sstatePath = m_config.GetSStatePath();
	m_romPath = m_config.GetRomPath();

	m_window.InitAMeteor();
	m_audio.InitAMeteor();

	//m_refDisassemblerCheck->set_active(true);
	//m_refPaletteCheck->set_active(true);
	m_aboutDialog.set_logo(m_mainimage.get_pixbuf());
}
Example #14
0
QRTestWidget::QRTestWidget(bool show_header)
{
	// TestTree

	m_TestTreeModel = Gtk::ListStore::create (m_TestTreeModelColumns);
	m_TestTreeView.set_model (m_TestTreeModel);
	m_TestTreeView.set_headers_visible(show_header);
	m_TestTreeView.set_headers_clickable(false);

	Glib::RefPtr<Gtk::TreeSelection> selection = m_TestTreeView.get_selection ();
//	selection->set_select_function (sigc::mem_fun (*this, &QRTestWidget::selection_callback));

	// Level Combo initialization

	m_TestTreeLevelComboModel = Gtk::ListStore::create (m_TestTreeModelLevelCombo);
	(*m_TestTreeLevelComboModel->append())[m_TestTreeModelLevelCombo.m_level_choices] = "Level L";
	(*m_TestTreeLevelComboModel->append())[m_TestTreeModelLevelCombo.m_level_choices] = "Level M";
	(*m_TestTreeLevelComboModel->append())[m_TestTreeModelLevelCombo.m_level_choices] = "Level Q";
	(*m_TestTreeLevelComboModel->append())[m_TestTreeModelLevelCombo.m_level_choices] = "Level H";


	// Test id

//	m_TestTreeView.append_column ("Test ID", m_TestTreeModelColumns.m_test_id);


	// data size

	Gtk::TreeView::Column* pDataColumn = Gtk::manage (new Gtk::TreeView::Column ("Data Size"));

	Gtk::CellRendererSpin* data_size_spin_renderer = Gtk::manage (new Gtk::CellRendererSpin() );
	Gtk::Adjustment* data_adj = manage (new Gtk::Adjustment (0.0, 0.0, .0, 1.0, 10.0, 100.0));

	data_size_spin_renderer->set_property ("digits", 0);
	data_size_spin_renderer->set_property ("adjustment", data_adj);
	data_size_spin_renderer->set_property ("editable", true);

	data_size_spin_renderer->property_alignment() = Pango::ALIGN_RIGHT;
	data_size_spin_renderer->property_editable () = true;
	data_size_spin_renderer->property_width() = 40;
	data_size_spin_renderer->property_height() = 40;

	data_size_spin_renderer->signal_edited().connect (sigc::mem_fun (*this, &QRTestWidget::on_data_size_edited));

	pDataColumn->pack_start (m_TestTreeModelColumns.m_data_label, false);
	pDataColumn->pack_start (*data_size_spin_renderer, true);
	pDataColumn->add_attribute (data_size_spin_renderer->property_text (), m_TestTreeModelColumns.m_data_size);
	m_TestTreeView.append_column (*pDataColumn);


	// version

	Gtk::TreeView::Column* pVersionColumn = Gtk::manage (new Gtk::TreeView::Column ("Version"));

	Pango::AttrList attr;

	Gtk::CellRendererText* version_text_renderer  = Gtk::manage (new Gtk::CellRendererText() );
	version_text_renderer->property_alignment() = Pango::ALIGN_RIGHT;

	Gtk::CellRendererSpin* version_spin_renderer = Gtk::manage (new Gtk::CellRendererSpin() );
	Gtk::Adjustment* ver_adj = manage (new Gtk::Adjustment (0.0, 0.0, 100.0, 1.0, 10.0, 100.0));

	version_spin_renderer->set_property ("digits", 0);
	version_spin_renderer->set_property ("adjustment", ver_adj);
	version_spin_renderer->set_property ("editable", true);
	version_spin_renderer->set_property ("width", 40);

	version_spin_renderer->signal_edited().connect (sigc::mem_fun (*this, &QRTestWidget::on_version_edited));

//	pVersionColumn->pack_start (m_TestTreeModelColumns.m_version_label, false);
	pVersionColumn->pack_start (*version_text_renderer, false);
	pVersionColumn->add_attribute(version_text_renderer->property_text (), m_TestTreeModelColumns.m_version_label);

	pVersionColumn->pack_start (*version_spin_renderer, true);
	pVersionColumn->add_attribute(version_spin_renderer->property_text (), m_TestTreeModelColumns.m_version);
	m_TestTreeView.append_column (*pVersionColumn);

//	m_TestTreeView.get_column (m_TestTreeView.append_column ("Data Size", *version_spin_renderer) - 1)
//			->add_attribute(version_spin_renderer->property_text (), m_TestTreeModelColumns.m_version);


	// correction level

	Gtk::TreeView::Column* pCorrectionColumn = Gtk::manage (new Gtk::TreeView::Column ("Correction Level"));

	m_ComboRenderer.property_model () = m_TestTreeLevelComboModel;
	m_ComboRenderer.property_has_entry () = false;
	m_ComboRenderer.property_text_column () = 0;
	m_ComboRenderer.property_editable () = true;
	m_ComboRenderer.property_width () = 80;

	m_ComboRenderer.signal_edited().connect (sigc::mem_fun (*this, &QRTestWidget::on_correction_edited));

	pCorrectionColumn->pack_start (m_TestTreeModelColumns.m_level_label, false);
	pCorrectionColumn->pack_start (m_ComboRenderer, true);
	pCorrectionColumn->add_attribute(m_ComboRenderer.property_text (), m_TestTreeModelColumns.m_correction_level);
	m_TestTreeView.append_column (*pCorrectionColumn);


	// Use Image

	Gtk::TreeView::Column* pImageColumn = Gtk::manage (new Gtk::TreeView::Column ("Image Based"));

	Gtk::CellRendererToggle* image_toggle_renderer = Gtk::manage (new Gtk::CellRendererToggle() );
	image_toggle_renderer->property_activatable() = true;
	image_toggle_renderer->property_sensitive() = true;
	image_toggle_renderer->property_width() = 70;

	image_toggle_renderer->signal_toggled().connect (sigc::mem_fun (*this, &QRTestWidget::on_use_image_edited));

	pImageColumn->pack_start(*image_toggle_renderer, true);
	pImageColumn->add_attribute(image_toggle_renderer->property_active() , m_TestTreeModelColumns.m_image_based);
	pImageColumn->add_attribute(image_toggle_renderer->property_visible() , m_TestTreeModelColumns.m_image_option_visible);
	m_TestTreeView.append_column (*pImageColumn);


	// pixel size

	Gtk::TreeView::Column* pPixelColumn = Gtk::manage (new Gtk::TreeView::Column ("Pixel Size"));

	Gtk::CellRendererSpin* pixel_size_spin_renderer = Gtk::manage (new Gtk::CellRendererSpin() );
	Gtk::Adjustment* pix_adj = manage (new Gtk::Adjustment (0.0, 0.0, 100.0, 1.0, 10.0, 100.0));

	pixel_size_spin_renderer->set_property ("digits", 0);
	pixel_size_spin_renderer->set_property ("adjustment", pix_adj);
	pixel_size_spin_renderer->set_property ("editable", true);
	pixel_size_spin_renderer->property_alignment() = Pango::ALIGN_RIGHT;
	pixel_size_spin_renderer->property_width () = 40;

	pixel_size_spin_renderer->signal_edited().connect (sigc::mem_fun (*this, &QRTestWidget::on_pixel_size_edited));

	pPixelColumn->pack_start (m_TestTreeModelColumns.m_pixel_label, false);
	pPixelColumn->pack_start (*pixel_size_spin_renderer, true);
	pPixelColumn->add_attribute(pixel_size_spin_renderer->property_text (), m_TestTreeModelColumns.m_pixel_size);
	pPixelColumn->add_attribute(pixel_size_spin_renderer->property_editable (), m_TestTreeModelColumns.m_image_based);
	pPixelColumn->add_attribute(pixel_size_spin_renderer->property_sensitive (), m_TestTreeModelColumns.m_image_based);
	m_TestTreeView.append_column (*pPixelColumn);


	// Use Background

	Gtk::TreeView::Column* pBgColumn = Gtk::manage (new Gtk::TreeView::Column ("Use Background"));

	Gtk::CellRendererToggle* bg_toggle_renderer = Gtk::manage (new Gtk::CellRendererToggle() );

	bg_toggle_renderer->property_width() = 90;
	bg_toggle_renderer->signal_toggled().connect (sigc::mem_fun (*this, &QRTestWidget::on_use_bkg_edited));

	pBgColumn->pack_start(*bg_toggle_renderer, true);
	pBgColumn->add_attribute(bg_toggle_renderer->property_active() , m_TestTreeModelColumns.m_use_background);
	pBgColumn->add_attribute(bg_toggle_renderer->property_visible() , m_TestTreeModelColumns.m_use_background_visible);
	pBgColumn->add_attribute(bg_toggle_renderer->property_activatable() , m_TestTreeModelColumns.m_image_based);
	pBgColumn->add_attribute(bg_toggle_renderer->property_sensitive() , m_TestTreeModelColumns.m_image_based);
	m_TestTreeView.append_column (*pBgColumn);


	// margin

	Gtk::TreeView::Column* pMarginColumn = Gtk::manage (new Gtk::TreeView::Column ("Margin Size"));

	Gtk::CellRendererSpin* margin_spin_renderer = Gtk::manage (new Gtk::CellRendererSpin() );
	Gtk::Adjustment* mar_adj = manage (new Gtk::Adjustment (0.0, 0.0, 100.0, 1.0, 10.0, 100.0));

	margin_spin_renderer->set_property ("digits", 0);
	margin_spin_renderer->set_property ("adjustment", mar_adj);
	margin_spin_renderer->set_property ("editable", true);
	margin_spin_renderer->set_property ("height", 40);
	margin_spin_renderer->set_property ("width", 40);

	margin_spin_renderer->signal_edited().connect (sigc::mem_fun (*this, &QRTestWidget::on_margin_edited));

	pMarginColumn->pack_start (m_TestTreeModelColumns.m_margin_label, false);
	pMarginColumn->pack_start (*margin_spin_renderer, true);
	pMarginColumn->add_attribute(margin_spin_renderer->property_text (), m_TestTreeModelColumns.m_margin);
	pMarginColumn->add_attribute(margin_spin_renderer->property_editable (), m_TestTreeModelColumns.m_use_background);
	pMarginColumn->add_attribute(margin_spin_renderer->property_sensitive (), m_TestTreeModelColumns.m_use_background);
	m_TestTreeView.append_column (*pMarginColumn);

	// Add Rows

	AddRows ();

	this->add (m_TestTreeView);
	this->show_all_children ();
}
Example #15
0
void
mainwnd::file_import_dialog( void )
{
    Gtk::FileChooserDialog dialog("Import MIDI file",
            Gtk::FILE_CHOOSER_ACTION_OPEN);
    dialog.set_transient_for(*this);

    Gtk::FileFilter filter_midi;
    filter_midi.set_name("MIDI files");
    filter_midi.add_pattern("*.midi");
    filter_midi.add_pattern("*.mid");
    dialog.add_filter(filter_midi);

    Gtk::FileFilter filter_any;
    filter_any.set_name("Any files");
    filter_any.add_pattern("*");
    dialog.add_filter(filter_any);

    dialog.set_current_folder(last_used_dir);

    ButtonBox *btnbox = dialog.get_action_area();
    HBox hbox( false, 2 );

    m_adjust_load_offset = manage( new Adjustment( 0, -(c_max_sets - 1),
                c_max_sets - 1, 1 ));
    m_spinbutton_load_offset = manage( new SpinButton( *m_adjust_load_offset ));
    m_spinbutton_load_offset->set_editable( false );
    m_spinbutton_load_offset->set_wrap( true );
    hbox.pack_end(*m_spinbutton_load_offset, false, false );
    hbox.pack_end(*(manage( new Label("Screen Set Offset"))), false, false, 4);

    btnbox->pack_start(hbox, false, false );

    dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
    dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK);

    dialog.show_all_children();

    int result = dialog.run();

    //Handle the response:
    switch(result)
    {
       case(Gtk::RESPONSE_OK):
       {
           try{
               midifile f( dialog.get_filename() );
               f.parse( m_mainperf, (int) m_adjust_load_offset->get_value() );
           }
           catch(...){
               Gtk::MessageDialog errdialog(*this,
                       "Error reading file.", false,
                       Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
                errdialog.run();
           }

           global_filename = std::string(dialog.get_filename());
           update_window_title();
           m_modified = true;

           m_main_wid->reset();
           m_entry_notes->set_text(*m_mainperf->get_screen_set_notepad(
                       m_mainperf->get_screenset() ));
           m_adjust_bpm->set_value( m_mainperf->get_bpm() );

           break;
       }

       case(Gtk::RESPONSE_CANCEL):
           break;

       default:
           break;

   }
}
Example #16
0
Cal3dStoreOptions::Cal3dStoreOptions(Cal3dStore & s) :
                                     OptionBox("Cal3d Options"),
                                     m_cal3dStore(s)
{
    Gtk::VBox * vbox = this;

    m_columns = new Gtk::TreeModelColumnRecord();
    m_nameColumn = new Gtk::TreeModelColumn<Glib::ustring>();
    m_selectColumn = new Gtk::TreeModelColumn<bool>();
    m_idColumn = new Gtk::TreeModelColumn<int>();
    m_componentColumn = new Gtk::TreeModelColumn<ComponentType>();
    m_columns->add(*m_nameColumn);
    m_columns->add(*m_selectColumn);
    m_columns->add(*m_idColumn);
    m_columns->add(*m_componentColumn);

    m_treeModel = Gtk::TreeStore::create(*m_columns);

    m_treeView = manage( new Gtk::TreeView() );

    m_treeView->set_model( m_treeModel );

    m_treeView->append_column("Component", *m_nameColumn);

    Gtk::CellRendererToggle * crt = manage( new Gtk::CellRendererToggle() );
    crt->signal_toggled().connect( sigc::mem_fun(*this, &Cal3dStoreOptions::enableToggled) );
    int column_no = m_treeView->append_column("View", *crt);
    Gtk::TreeViewColumn * column = m_treeView->get_column(column_no - 1);
    column->add_attribute(crt->property_active(), *m_selectColumn);
    column->set_clickable();

    m_refTreeSelection = m_treeView->get_selection();
    m_refTreeSelection->set_mode(Gtk::SELECTION_SINGLE);
    // m_refTreeSelection->signal_changed().connect( sigc::mem_fun(*this, &Cal3dStoreOptions::selectionChanged) );

    Gtk::ScrolledWindow *scrolled_window = manage(new Gtk::ScrolledWindow());
    scrolled_window->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS);
    scrolled_window->set_size_request(250,150);
    scrolled_window->add(*m_treeView);

    vbox->pack_start(*scrolled_window);

    Gtk::HBox * bothbox = manage( new Gtk::HBox );

    Gtk::Button * b = manage( new Gtk::Button("Wuh...") );
    // b->signal_clicked().connect(sigc::mem_fun(*this, &Cal3dStoreOptions::typesPressed));
    bothbox->pack_start(*b, Gtk::PACK_EXPAND_PADDING, 6);

    vbox->pack_start(*bothbox, Gtk::PACK_SHRINK, 6);

    animationRow = *(m_treeModel->append());
    animationRow[*m_nameColumn] = Glib::ustring("Animations");

    actionRow = *(m_treeModel->append());
    actionRow[*m_nameColumn] = Glib::ustring("Actions");

    meshRow = *(m_treeModel->append());
    meshRow[*m_nameColumn] = Glib::ustring("Meshes");

    materialRow = *(m_treeModel->append());
    materialRow[*m_nameColumn] = Glib::ustring("Materials");

    Cal3dModel & m = s.getModel();

    m.skeletonLoaded.connect(sigc::mem_fun(*this, &Cal3dStoreOptions::skeletonLoaded));
    m.animationLoaded.connect(sigc::mem_fun(*this, &Cal3dStoreOptions::animationLoaded));
    m.actionLoaded.connect(sigc::mem_fun(*this, &Cal3dStoreOptions::actionLoaded));
    m.meshLoaded.connect(sigc::mem_fun(*this, &Cal3dStoreOptions::meshLoaded));
    m.materialLoaded.connect(sigc::mem_fun(*this, &Cal3dStoreOptions::materialLoaded));
}
Example #17
0
perfedit::perfedit
(
    perform & p,
    bool second_perfedit,
    int ppqn
) :
    gui_window_gtk2     (p, 750, 500),
    m_peer_perfedit     (nullptr),
    m_table             (manage(new Gtk::Table(6, 3, false))),
    m_vadjust           (manage(new Gtk::Adjustment(0, 0, 1, 1, 1, 1))),
    m_hadjust           (manage(new Gtk::Adjustment(0, 0, 1, 1, 1, 1))),
    m_vscroll           (manage(new Gtk::VScrollbar(*m_vadjust))),
    m_hscroll           (manage(new Gtk::HScrollbar(*m_hadjust))),
    m_perfnames         (manage(new perfnames(perf(), *this, *m_vadjust))),
    m_perfroll
    (
        manage(new perfroll(perf(), *this, *m_hadjust, *m_vadjust, ppqn))
    ),
    m_perftime          (manage(new perftime(perf(), *this, *m_hadjust))),
    m_menu_snap         (manage(new Gtk::Menu())),
#ifdef SEQ64_STAZED_TRANSPOSE
    m_menu_xpose        (manage(new Gtk::Menu())),
    m_button_xpose      (manage(new Gtk::Button())),
    m_entry_xpose       (manage(new Gtk::Entry())),
#endif
    m_image_play        (manage(new PIXBUF_IMAGE(play2_xpm))),
    m_button_snap       (manage(new Gtk::Button())),
    m_entry_snap        (manage(new Gtk::Entry())),
    m_button_stop       (manage(new Gtk::Button())),
    m_button_play       (manage(new Gtk::Button())),
    m_button_loop       (manage(new Gtk::ToggleButton())),
    m_button_expand     (manage(new Gtk::Button())),
    m_button_collapse   (manage(new Gtk::Button())),
    m_button_copy       (manage(new Gtk::Button())),
    m_button_grow       (manage(new Gtk::Button())),
    m_button_undo       (manage(new Gtk::Button())),
    m_button_redo       (manage(new Gtk::Button())),    // stazed
#ifdef SEQ64_STAZED_JACK_SUPPORT
    m_button_jack       (manage(new Gtk::ToggleButton())),
    m_button_follow     (manage(new Gtk::ToggleButton())),
#endif
    m_button_bpm        (manage(new Gtk::Button())),
    m_entry_bpm         (manage(new Gtk::Entry())),
    m_button_bw         (manage(new Gtk::Button())),
    m_entry_bw          (manage(new Gtk::Entry())),
    m_hbox              (manage(new Gtk::HBox(false, 2))),
    m_hlbox             (manage(new Gtk::HBox(false, 2))),
    m_tooltips          (manage(new Gtk::Tooltips())),  // valgrind complains!
    m_menu_bpm          (manage(new Gtk::Menu())),
    m_menu_bw           (manage(new Gtk::Menu())),
    m_snap              (0),
    m_bpm               (0),
    m_bw                (0),
    m_ppqn              (0),
#ifdef SEQ64_PAUSE_SUPPORT
    m_is_running        (false),
#endif
    m_standard_bpm      (SEQ64_DEFAULT_LINES_PER_MEASURE)   /* 4            */
{
    std::string title = "Sequencer64 - Song Editor";
    if (second_perfedit)
        title += " 2";

    m_ppqn = choose_ppqn(ppqn);
    set_icon(Gdk::Pixbuf::create_from_xpm_data(perfedit_xpm));
    set_title(title);                                       /* caption bar  */
    m_table->set_border_width(2);
    m_hlbox->set_border_width(2);
    m_button_grow->add
    (
        *manage(new Gtk::Arrow(Gtk::ARROW_RIGHT, Gtk::SHADOW_OUT))
    );
    m_button_grow->signal_clicked().connect(mem_fun(*this, &perfedit::grow));
    add_tooltip(m_button_grow, "Increase size of grid.");

    /*
     * Fill the table
     */

    m_table->attach(*m_hlbox, 0, 3, 0, 1,  Gtk::FILL, Gtk::SHRINK, 2, 0);
    m_table->attach(*m_perfnames, 0, 1, 2, 3, Gtk::SHRINK, Gtk::FILL);
    m_table->attach(*m_perftime, 1, 2, 1, 2, Gtk::FILL, Gtk::SHRINK);
    m_table->attach
    (
        *m_perfroll, 1, 2, 2, 3, Gtk::FILL | Gtk::SHRINK, Gtk::FILL | Gtk::SHRINK
    );
    m_table->attach(*m_vscroll, 2, 3, 2, 3, Gtk::SHRINK, Gtk::FILL | Gtk::EXPAND);
    m_table->attach(*m_hbox,  0, 1, 3, 4,  Gtk::FILL, Gtk::SHRINK, 0, 2);
    m_table->attach(*m_hscroll, 1, 2, 3, 4, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK);
    m_table->attach(*m_button_grow, 2, 3, 3, 4, Gtk::SHRINK, Gtk::SHRINK);

    /*
     * To reduce the amount of written code, we now use a static array to
     * initialize some of the menu entries.  We use the same list for the snap
     * menu and for the beat-width menu.  This adds a beat-width of 32 to the
     * beat-width menu.  A new feature!  :-D
     */

#define SET_SNAP    mem_fun(*this, &perfedit::set_snap)
#define SET_BW      mem_fun(*this, &perfedit::set_beat_width)

    static const int s_width_items [] =
    {
        1, 2, 4, 8, 16, 32,
        0,
        3, 6, 12, 24,
#ifdef USE_STAZED_EXTRA_SNAPS
        0,
        5, 10, 20, 40,
        0,
        7, 9, 11, 13, 14, 15
#endif
    };
    static const int s_width_count = sizeof(s_width_items) / sizeof(int);
    for (int si = 0; si < s_width_count; ++si)
    {
        int item = s_width_items[si];
        char fmt[8];
        bool use_separator = false;
        if (item > 1)
            snprintf(fmt, sizeof fmt, "1/%d", item);
        else if (item == 0)
            use_separator = true;
        else
            snprintf(fmt, sizeof fmt, "%d", item);

        if (use_separator)
        {
            m_menu_snap->items().push_back(SeparatorElem());
        }
        else
        {
            m_menu_snap->items().push_back
            (
                MenuElem(fmt, sigc::bind(SET_SNAP, item))
            );
            snprintf(fmt, sizeof fmt, "%d", item);
            m_menu_bw->items().push_back(MenuElem(fmt, sigc::bind(SET_BW, item)));
        }
    }

#define SET_POPUP   mem_fun(*this, &perfedit::popup_menu)

    m_button_snap->add(*manage(new PIXBUF_IMAGE(snap_xpm)));
    m_button_snap->signal_clicked().connect
    (
        sigc::bind<Gtk::Menu *>(SET_POPUP, m_menu_snap)
    );
    add_tooltip(m_button_snap, "Grid snap (fraction of measure length).");
    m_entry_snap->set_size_request(40, -1);
    m_entry_snap->set_editable(false);

#ifdef SEQ64_STAZED_TRANSPOSE

    char num[12];
    for (int i = -SEQ64_OCTAVE_SIZE; i <= SEQ64_OCTAVE_SIZE; ++i)
    {
        if (i != 0)
            snprintf(num, sizeof num, "%+d [%s]", i, c_interval_text[abs(i)]);
        else
            snprintf(num, sizeof num, "0 [normal]");

        m_menu_xpose->items().push_front
        (
            MenuElem
            (
                num,
                sigc::bind
                (
                    mem_fun(*this, &perfedit::transpose_button_callback), i
                )
            )
        );
    }
    m_button_xpose->add
    (
        *manage(new Gtk::Image(Gdk::Pixbuf::create_from_xpm_data(transpose_xpm)))
    );
    m_button_xpose->signal_clicked().connect
    (
        sigc::bind<Gtk::Menu *>
        (
            mem_fun(*this, &perfedit::popup_menu), m_menu_xpose
        )
    );
    add_tooltip(m_button_xpose, "Song-transpose all transposable sequences.");
    m_entry_xpose->set_size_request(30, -1);
    m_entry_xpose->set_editable(false);

#endif  // SEQ64_STAZED_TRANSPOSE

#define SET_BPB     mem_fun(*this, &perfedit::set_beats_per_bar)

    char b[4];
    for (int i = 0; i < 16; ++i)
    {
        snprintf(b, sizeof b, "%d", i + 1);
        m_menu_bpm->items().push_back(MenuElem(b, sigc::bind(SET_BPB, i + 1)));
    }
    m_button_bpm->add(*manage(new PIXBUF_IMAGE(down_xpm)));
    m_button_bpm->signal_clicked().connect
    (
        sigc::bind<Gtk::Menu *>(SET_POPUP, m_menu_bpm)
    );
    add_tooltip
    (
        m_button_bpm, "Time signature: beats per measure or bar."
    );
    m_entry_bpm->set_width_chars(2);
    m_entry_bpm->set_editable(false);

    m_button_bw->add(*manage(new PIXBUF_IMAGE(down_xpm)));  /* beat width */
    m_button_bw->signal_clicked().connect
    (
        sigc::bind<Gtk::Menu *>(SET_POPUP, m_menu_bw)
    );
    add_tooltip(m_button_bw, "Time signature: length of measure or bar.");
    m_entry_bw->set_width_chars(2);
    m_entry_bw->set_editable(false);

    m_button_undo->add(*manage(new PIXBUF_IMAGE(undo_xpm)));
    m_button_undo->signal_clicked().connect(mem_fun(*this, &perfedit::undo));
    add_tooltip(m_button_undo, "Undo the last action (Ctrl-Z).");

    m_button_redo->add(*manage(new PIXBUF_IMAGE(redo_xpm)));
    m_button_redo->signal_clicked().connect(mem_fun(*this, &perfedit::redo));
    add_tooltip(m_button_redo, "Redo the last undone action (Ctrl-R).");

    m_button_expand->add(*manage(new PIXBUF_IMAGE(expand_xpm)));
    m_button_expand->signal_clicked().connect(mem_fun(*this, &perfedit::expand));
    add_tooltip(m_button_expand, "Expand space between L and R markers.");

    m_button_collapse->add(*manage(new PIXBUF_IMAGE(collapse_xpm)));
    m_button_collapse->signal_clicked().connect
    (
        mem_fun(*this, &perfedit::collapse)
    );
    add_tooltip(m_button_collapse, "Collapse pattern between L and R markers.");

    m_button_copy->add(*manage(new PIXBUF_IMAGE(copy_xpm))); /* expand+copy */
    m_button_copy->signal_clicked().connect(mem_fun(*this, &perfedit::copy));
    add_tooltip(m_button_copy, "Expand and copy between the L and R markers.");

    m_button_loop->add(*manage(new PIXBUF_IMAGE(loop_xpm)));
    m_button_loop->signal_toggled().connect
    (
        mem_fun(*this, &perfedit::set_looped)
    );
    add_tooltip(m_button_loop, "Playback looped between the L and R markers.");

    m_button_stop->set_focus_on_click(false);
    m_button_stop->add(*manage(new PIXBUF_IMAGE(stop_xpm)));
    m_button_stop->signal_clicked().connect
    (
        mem_fun(*this, &perfedit::stop_playing)
    );
    add_tooltip(m_button_stop, "Stop playback.");
    m_button_stop->set_sensitive(true);

    m_button_play->set_focus_on_click(false);
    m_button_play->set_image(*m_image_play);
    m_button_play->signal_clicked().connect
    (
        mem_fun(*this, &perfedit::start_playing)
    );
    add_tooltip(m_button_play, "Begin playback at the L marker.");
    m_button_play->set_sensitive(true);

#ifdef SEQ64_STAZED_JACK_SUPPORT
    m_button_jack->add(*manage(new PIXBUF_IMAGE(jack_black_xpm)));
    m_button_jack->signal_clicked().connect
    (
        mem_fun(*this, &perfedit::set_jack_mode)
    );
    add_tooltip(m_button_jack, "Toggle JACK sync connection.");
    if (rc().with_jack_transport())
        m_button_jack->set_active(true);

    m_button_follow->add(*manage(new PIXBUF_IMAGE(transport_follow_xpm)));
    m_button_follow->signal_clicked().connect
    (
        mem_fun(*this, &perfedit::set_follow_transport)
    );
    add_tooltip(m_button_follow, "Toggle the following of JACK transport.");
    m_button_follow->set_active(true);
#endif

    m_hlbox->pack_end(*m_button_copy , false, false);
    m_hlbox->pack_end(*m_button_expand , false, false);
    m_hlbox->pack_end(*m_button_collapse , false, false);
    m_hlbox->pack_end(*m_button_undo , false, false);
    m_hlbox->pack_end(*m_button_redo , false, false);       // stazed
    m_hlbox->pack_start(*m_button_stop , false, false);
    m_hlbox->pack_start(*m_button_play , false, false);
    m_hlbox->pack_start(*m_button_loop , false, false);
    m_hlbox->pack_start(*m_button_bpm , false, false);
    m_hlbox->pack_start(*m_entry_bpm , false, false);
    m_hlbox->pack_start(*(manage(new Gtk::Label("/"))), false, false, 4);
    m_hlbox->pack_start(*m_button_bw , false, false);
    m_hlbox->pack_start(*m_entry_bw , false, false);
    m_hlbox->pack_start(*(manage(new Gtk::Label("x"))), false, false, 4);
    m_hlbox->pack_start(*m_button_snap , false, false);
    m_hlbox->pack_start(*m_entry_snap , false, false);

#ifdef SEQ64_STAZED_TRANSPOSE
    m_hlbox->pack_start(*m_button_xpose , false, false);
    m_hlbox->pack_start(*m_entry_xpose , false, false);
#endif

#ifdef SEQ64_STAZED_JACK_SUPPORT
    m_hlbox->pack_start(*m_button_jack, false, false);
    m_hlbox->pack_start(*m_button_follow, false, false);
#endif

    add(*m_table);

    /*
     * Here, the set_snap call depends on the others being done first.  These
     * calls also depend upon the values being set to bogus (0) values in the
     * initializer list, otherwise no change will occur, and the items won't
     * be displayed.
     */

    set_beats_per_bar(SEQ64_DEFAULT_BEATS_PER_MEASURE); /* time-sig numerator   */
    set_beat_width(SEQ64_DEFAULT_BEAT_WIDTH);           /* time-sig denominator */
    set_snap(SEQ64_DEFAULT_PERFEDIT_SNAP);

#ifdef SEQ64_STAZED_TRANSPOSE
    set_transpose(0);
#endif

    /*
     * Log the pointer to the appropriate perfedit object, if not already
     * done.
     */

    if (second_perfedit)
    {
        if (is_nullptr(gs_perfedit_pointer_1))
            gs_perfedit_pointer_1 = this;
    }
    else
    {
        if (is_nullptr(gs_perfedit_pointer_0))
            gs_perfedit_pointer_0 = this;
    }
}
Example #18
0
 void create() {
   void* tmp = manage(new T()); // { dg-error "incomplete" }
 }
Example #19
0
    Window::Window (App& parent) : 
      Gtk::Window (Gtk::WINDOW_TOPLEVEL), 
      app (parent),
      close_button (Gtk::Stock::CLOSE),
      stop_button (Gtk::Stock::STOP),
      start_button (Gtk::Stock::EXECUTE),
      message_level_label ("Message level"),
      options_label ("Add option"),
      description_frame ("Description"),
      arguments_frame ("Arguments"),
      options_frame ("Options"),
      text_frame ("Program output")
    {
      window = this;
      realize();

      description_label.set_line_wrap (true);
      description_label.set_single_line_mode (false);
      description_label.set_justify (Gtk::JUSTIFY_FILL);
      description_label.set_selectable (true);

      if (app.command_description[0]) {
        description_label.set_text (app.command_description[0]);
        if (app.command_description[1]) {
          String desc (app.command_description[1]);
          for (const gchar** p = app.command_description+2; *p; p++) { desc += "\n\n"; desc += *p; }
          description_label.set_tooltip_text (desc);
        }
      }
      else description_label.set_text ("no description available");

      inner_description_box.set_border_width (GUI_SPACING);
      inner_description_box.add (description_label);
      description_frame.add (inner_description_box);

 
      for (const MR::Argument* arg = app.command_arguments; arg->is_valid(); arg++) {
        Argument* argument = manage (new Argument (*arg));
        arguments_box.pack_start (*argument, Gtk::PACK_SHRINK);
      }
      arguments_frame.add (arguments_box);

      message_level.append_text (message_level_options[0]);
      message_level.append_text (message_level_options[1]);
      message_level.append_text (message_level_options[2]);
      message_level.set_active (0);

      message_level_box.set_spacing (GUI_SPACING);
      message_level_box.pack_start (message_level_label, Gtk::PACK_SHRINK);
      message_level_box.pack_start (message_level);

      top_box.set_border_width (GUI_SPACING);
      top_box.set_spacing (GUI_SPACING);
      top_box.pack_start (description_frame);
      top_box.pack_start (arguments_frame);
      
      if (app.command_options[0].is_valid()) {
        options_box.pack_start (option_menu_box, Gtk::PACK_SHRINK);
        options_box.set_spacing (GUI_SPACING);
        options_box.set_border_width (GUI_SPACING);
        option_menu_box.pack_start (options_label, Gtk::PACK_SHRINK);
        option_menu_box.pack_start (option_combobox);
        option_menu_box.set_spacing (GUI_SPACING);
        for (guint n = 0; App::command_options[n].is_valid(); n++) {
          if (App::command_options[n].mandatory) {
            Option* opt = manage (new Option (*this, App::command_options[n], n));
            options_box.pack_start (*opt, Gtk::PACK_SHRINK);
          }
        }
        set_option_list();
        options_frame.add (options_box);
        top_box.pack_start (options_frame);
        option_combobox.signal_changed().connect (sigc::mem_fun (*this, &Window::on_add_option));
      }

      top_box.pack_start (message_level_box, Gtk::PACK_SHRINK);

      top.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
      top.set_shadow_type (Gtk::SHADOW_NONE);
      top.add (top_box);

      Glib::RefPtr<Gtk::TextBuffer::TagTable> tags = text.get_buffer()->get_tag_table();
      red  = Gtk::TextBuffer::Tag::create(); red->property_foreground()  = "red";  tags->add (red);
      blue = Gtk::TextBuffer::Tag::create(); blue->property_foreground() = "blue"; tags->add (blue);
      grey = Gtk::TextBuffer::Tag::create(); grey->property_foreground() = "grey"; tags->add (grey);

      text.set_editable (false);
      text.set_cursor_visible (false);
      inner_text_frame.set_shadow_type (Gtk::SHADOW_IN);
      inner_text_frame.set_border_width (GUI_SPACING);
      inner_text_frame.add (text);
      text_frame.add (inner_text_frame);

      close_button.signal_clicked().connect (sigc::mem_fun(*this, &Window::on_close_button));
      stop_button.set_sensitive (false);
      stop_button.signal_clicked().connect (sigc::mem_fun(*this, &Window::on_stop_button));
      start_button.signal_clicked().connect (sigc::mem_fun(*this, &Window::on_start_button));

      button_box.set_spacing (GUI_SPACING);
      button_box.set_homogeneous();
      button_box.pack_start (close_button);
      button_box.pack_start (stop_button);
      button_box.pack_start (start_button);



      bottom_box.set_border_width (GUI_SPACING);
      bottom_box.set_spacing (GUI_SPACING);
      bottom_box.pack_start (progressbar, Gtk::PACK_SHRINK);
      bottom_box.pack_start (text_frame);
      bottom_box.pack_start (button_box, Gtk::PACK_SHRINK);


      splitter.pack1 (top, true, false);
      splitter.pack2 (bottom_box, true, false);
      add (splitter);
      set_icon (App::gui_icon);


      ProgressBar::init_func = ProgressBar::init_func_gui;
      ProgressBar::display_func = ProgressBar::display_func_gui;
      ProgressBar::done_func = ProgressBar::done_func_gui;

      print = gui_print;
      error = gui_error;
      info = gui_info;
      debug = gui_debug;



      set_default_size (400, 800);
      show_all_children();
    }
MESignPostInfoDialog::MESignPostInfoDialog(
      OldConnection* conn, uint32 toNodeID, MEMapArea* mapArea)
{

   m_connection = conn;
   m_toNodeID = toNodeID;
   m_mapArea = mapArea;
   m_editSpDialog = NULL;

   char tmpStr[256];
   sprintf( tmpStr, "%s, 0x%x",
            "Sign post info", m_mapArea->getMap()->getMapID() );
   set_title(tmpStr);
   
   // list with all sign posts for this connection
   Gtk::Frame* frame = manage(new Gtk::Frame("Signposts:"));

   // Create ListStore and add to TreeView
   m_listStore = Gtk::ListStore::create(m_columns);
   m_treeView.set_model(m_listStore);

   // Add visible columns to TreeView
   m_treeView.append_column("REMOVE ME", m_columns.m_info);
   m_treeView.set_headers_visible(false);

   // Create selection object to handle selections
   m_selection = m_treeView.get_selection();
   if(!m_selection)
   { 
      // If this doesn't work we're in trouble.
      mc2log << error << "No selection object created for corresponding "
             << "TreeView" << endl;
      MC2_ASSERT(false);
   }


   Gtk::ScrolledWindow* scrolledWin = manage(new Gtk::ScrolledWindow());
   scrolledWin->set_size_request(200, 150);
   scrolledWin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
   scrolledWin->add(m_treeView);
   frame->add(*scrolledWin);
   get_vbox()->pack_start(*frame, true, true, 5);

   // buttons for Edit and Close in the action area
   Gtk::HBox* actionBox = manage(new Gtk::HBox());
   if (m_mapArea != NULL) {
      Gtk::Button* editButton = manage(new Gtk::Button("Edit"));
      editButton->set_size_request(75, 25);
      editButton->signal_clicked().connect(
            sigc::mem_fun(*this, &MESignPostInfoDialog::editSpPressed));
      actionBox->pack_start(*editButton);
   } else {
      // empty label..
      Gtk::Label* editLabel = manage(new Gtk::Label(""));
      editLabel->set_size_request(75, 25);
      actionBox->pack_start(*editLabel);
   }
   Gtk::Button* closeButton = manage(new Gtk::Button("Close"));
   closeButton->signal_clicked().connect(
                  sigc::mem_fun(*this, &MESignPostInfoDialog::closePressed));
   closeButton->set_size_request(75, 25);
   actionBox->pack_start(*closeButton);
   get_action_area()->pack_start(*actionBox);

   // Don't show the dialog now, wait for show()-command.
}
Example #21
0
/*MIDI Clock page*/
void
options::add_midi_clock_page()
{
    // Clock  Buses
    int buses = m_perf->get_master_midi_bus ()->get_num_out_buses ();

    VBox *vbox = manage(new VBox());
    vbox->set_border_width(6);
    m_notebook->append_page(*vbox, "MIDI _Clock", true);

    manage (new Tooltips ());

    for (int i = 0; i < buses; i++)
    {
        HBox *hbox2 = manage (new HBox ());
        Label *label = manage( new Label(m_perf->get_master_midi_bus ()->
                                         get_midi_out_bus_name (i), 0));

        hbox2->pack_start (*label, false, false);

        Gtk::RadioButton * rb_off = manage (new RadioButton ("Off"));
        add_tooltip( rb_off, "Midi Clock will be disabled.");

        Gtk::RadioButton * rb_on = manage (new RadioButton ("On (Pos)"));
        add_tooltip( rb_on,
                     "Midi Clock will be sent. Midi Song Position and Midi Continue will be sent if starting greater than tick 0 in song mode, otherwise Midi Start is sent.");

        Gtk::RadioButton * rb_mod = manage (new RadioButton ("On (Mod)"));
        add_tooltip( rb_mod, "Midi Clock will be sent.  Midi Start will be sent and clocking will begin once the song position has reached the modulo of the specified Size. (Used for gear that doesn't respond to Song Position)");

        Gtk::RadioButton::Group group = rb_off->get_group ();
        rb_on->set_group (group);
        rb_mod->set_group (group);

        rb_off->signal_toggled().connect (sigc::bind(mem_fun (*this,
                                          &options::clock_callback_off), i, rb_off ));
        rb_on->signal_toggled ().connect (sigc::bind(mem_fun (*this,
                                          &options::clock_callback_on),  i, rb_on  ));
        rb_mod->signal_toggled().connect (sigc::bind(mem_fun (*this,
                                          &options::clock_callback_mod), i, rb_mod ));

        hbox2->pack_end (*rb_mod, false, false );
        hbox2->pack_end (*rb_on, false, false);
        hbox2->pack_end (*rb_off, false, false);

        vbox->pack_start( *hbox2, false, false );

        switch ( m_perf->get_master_midi_bus ()->get_clock (i))
        {
        case e_clock_off:
            rb_off->set_active(1);
            break;
        case e_clock_pos:
            rb_on->set_active(1);
            break;
        case e_clock_mod:
            rb_mod->set_active(1);
            break;
        }
    }

    Adjustment *clock_mod_adj = new Adjustment(midibus::get_clock_mod(),
            1, 16 << 10, 1 );
    SpinButton *clock_mod_spin = new SpinButton( *clock_mod_adj );

    HBox *hbox2 = manage (new HBox ());

    //m_spinbutton_bpm->set_editable( false );
    hbox2->pack_start(*(manage(new Label(
                                   "Clock Start Modulo (1/16 Notes)"))), false, false, 4);
    hbox2->pack_start(*clock_mod_spin, false, false );

    vbox->pack_start( *hbox2, false, false );

    clock_mod_adj->signal_value_changed().connect(sigc::bind(mem_fun(*this,
            &options::clock_mod_callback), clock_mod_adj));
}
Example #22
0
LayerWindow::LayerWindow(MainWindow & mw) : OptionBox("Layers"),
                                            m_currentModel(0)
{
    // destroy.connect(slot(this, &LayerWindow::destroy_handler));
    // Gtk::VBox * vbox = manage( new Gtk::VBox(false, 2) );
    Gtk::VBox * vbox = this;

    Gtk::HBox * tophbox = manage( new Gtk::HBox() );

    tophbox->pack_start(*(manage( new Gtk::Label("Model:") )), Gtk::PACK_SHRINK, 2);
    m_modelMenu = manage( new Gtk::OptionMenu() );

    tophbox->pack_start(*m_modelMenu, Gtk::PACK_EXPAND_WIDGET, 2);
    tophbox->pack_start(*(manage( new Gtk::Label("WOOT") ) ), Gtk::PACK_SHRINK, 2);
   
    vbox->pack_start(*tophbox, Gtk::PACK_SHRINK, 2);
    
    m_columns = new Gtk::TreeModelColumnRecord();
    m_visColumn = new Gtk::TreeModelColumn<bool>();
    m_typeColumn = new Gtk::TreeModelColumn<Glib::ustring>();
    m_nameColumn = new Gtk::TreeModelColumn<Glib::ustring>();
    m_ptrColumn = new Gtk::TreeModelColumn<Layer*>();
    m_columns->add(*m_visColumn);
    m_columns->add(*m_typeColumn);
    m_columns->add(*m_nameColumn);
    m_columns->add(*m_ptrColumn);

    m_treeModel = Gtk::ListStore::create(*m_columns);

    m_treeView = manage( new Gtk::TreeView() );

    m_treeView->set_model( m_treeModel );

    Gtk::CellRendererToggle * crt = manage( new Gtk::CellRendererToggle() );
    crt->signal_toggled().connect( sigc::mem_fun(*this, &LayerWindow::visibleToggled) );
    int column_no = m_treeView->append_column("Visible", *crt);
    Gtk::TreeViewColumn * column = m_treeView->get_column(column_no - 1);
    column->add_attribute(crt->property_active(), *m_visColumn);
    column->set_clickable();

    m_treeView->append_column("Type", *m_typeColumn);
    m_treeView->append_column("Name", *m_nameColumn);

    m_refTreeSelection = m_treeView->get_selection();
    m_refTreeSelection->set_mode(Gtk::SELECTION_SINGLE);
    m_refTreeSelection->signal_changed().connect( sigc::mem_fun(*this, &LayerWindow::selectionChanged) );

    vbox->pack_start(*manage(new Gtk::HSeparator()), Gtk::PACK_SHRINK);

    Gtk::ScrolledWindow *scrolled_window = manage(new Gtk::ScrolledWindow());
    scrolled_window->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS);
    scrolled_window->set_size_request(250,150);
    scrolled_window->add(*m_treeView);

    vbox->pack_start(*scrolled_window);

    Gtk::HBox * bothbox = manage( new Gtk::HBox() );
    Gtk::Button * b = manage( new Gtk::Button() );


    Glib::RefPtr<Gdk::Bitmap> pixmask;
    Glib::RefPtr<Gdk::Pixmap> p = Gdk::Pixmap::create_from_xpm(get_colormap(), pixmask, newlayer_xpm);
    b->add_pixmap(p, pixmask);

    b->signal_clicked().connect(sigc::mem_fun(*this, &LayerWindow::newLayerRequested));
    bothbox->pack_start(*b, Gtk::PACK_EXPAND_PADDING, 6);

    b = manage( new Gtk::Button() );
    p = Gdk::Pixmap::create_from_xpm(get_colormap(), pixmask, raise_xpm);
    b->add_pixmap(p, pixmask);
    b->signal_clicked().connect(sigc::mem_fun(*this, &LayerWindow::raiseLayer));
    bothbox->pack_start(*b, Gtk::PACK_EXPAND_PADDING, 6);

    b = manage( new Gtk::Button() );
    p = Gdk::Pixmap::create_from_xpm(get_colormap(), pixmask, lower_xpm);
    b->add_pixmap(p, pixmask);
    b->signal_clicked().connect(sigc::mem_fun(*this, &LayerWindow::lowerLayer));
    bothbox->pack_start(*b, Gtk::PACK_EXPAND_PADDING, 6);

    b = manage( new Gtk::Button() );
    p = Gdk::Pixmap::create_from_xpm(get_colormap(), pixmask, duplicate_xpm);
    b->add_pixmap(p, pixmask);
    bothbox->pack_start(*b, Gtk::PACK_EXPAND_PADDING, 6);

    b = manage( new Gtk::Button() );
    p = Gdk::Pixmap::create_from_xpm(get_colormap(), pixmask, delete_xpm);
    b->add_pixmap(p, pixmask);
    bothbox->pack_start(*b, Gtk::PACK_EXPAND_PADDING, 6);

    vbox->pack_start(*bothbox, Gtk::PACK_SHRINK, 6);

    // add(*vbox);
    // set_title("Layers");
    set_sensitive(false);

    // FIXME Organise the xpms
    //m_eye = gdk_pixmap_create_from_xpm_d(m_clist->gtkobj()->clist_window,
            //&m_eyemask, &GTK_WIDGET(m_clist->gtkobj())->style->white, eye_xpm);

    //m_null = gdk_pixmap_create_from_xpm_d(m_clist->gtkobj()->clist_window,
           //&m_nullmask, &GTK_WIDGET(m_clist->gtkobj())->style->white, null_xpm);

    m_newLayerWindow = new NewLayerWindow();
    // show_all();

    mw.modelAdded.connect(sigc::mem_fun(*this, &LayerWindow::modelAdded));
    mw.currentModelChanged.connect(sigc::mem_fun(*this, &LayerWindow::currentModelChanged));

    signal_delete_event().connect(sigc::mem_fun(*this, &LayerWindow::deleteEvent));
}
Example #23
0
tempopopup::tempopopup(tempo *a_tempo) :
    m_tempo(a_tempo),
    m_escape(false),
    m_return(false),
    m_is_typing(false),
    m_current_beats(0),
    m_base_time_ms(0),
    m_last_time_ms(0)
{
 //   std::string title = "BPM";
 //   set_title(title);
    set_size_request(150, 50);
    
#if GTK_MINOR_VERSION < 12
    m_tooltips = manage( new Tooltips() );
#endif
    
    /* bpm spin button */
    m_adjust_bpm = manage(new Adjustment(m_tempo->m_mainperf->get_bpm(), c_bpm_minimum -1, c_bpm_maximum, 1));
    m_spinbutton_bpm = manage( new SpinButton( *m_adjust_bpm ));
    m_spinbutton_bpm->set_editable( true );
    m_spinbutton_bpm->set_digits(2);                             // 2 = two decimal precision
    m_adjust_bpm->signal_value_changed().connect(
        mem_fun(*this, &tempopopup::adj_callback_bpm ));
 
    m_spinbutton_bpm->set_numeric();
    
    add_tooltip
    ( 
        m_spinbutton_bpm,
        "Adjust beats per minute (BPM) value.\n"
        "Values range from 0 to 600.00.\n"
        "Escape to leave without setting\n"
        "Entry of 0 indicates a STOP marker.\n"
    );
    
    m_spinbutton_bpm->set_update_policy(Gtk::UPDATE_IF_VALID);  // ignore bad entries
    
    Label* bpmlabel = manage(new Label("BPM"));
    
    /* bpm tap tempo button - sequencer64 */
    m_button_tap = manage(new Button("0"));
    m_button_tap->signal_clicked().connect(sigc::mem_fun(*this, &tempopopup::tap));
    add_tooltip
    (
        m_button_tap,
        "Tap in time to set the beats per minute (BPM) value. "
        "After 5 seconds of no taps, the tap-counter will reset to 0. "
        "Also see the File / Options / Keyboard / Tap BPM key assignment."
    );
    m_button_tap->set_can_focus(false);  // to force all keys to the spin button
    
    HBox *hbox = manage(new HBox());
    hbox->set_border_width(6);
    
    hbox->pack_start(*bpmlabel, Gtk::PACK_SHRINK);
    hbox->pack_start(*m_spinbutton_bpm, Gtk::PACK_SHRINK );
    hbox->pack_start(*m_button_tap, Gtk::PACK_SHRINK, 5 );
    
    add(*hbox);
    set_modal();                            // keep focus until done
    set_transient_for(*m_tempo->m_perfedit); // always on top
    set_decorated(false);                   // don't show title bar
    
    add_events( Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK );
    
    m_timeout_connect = Glib::signal_timeout().connect(
                        mem_fun(*this, &tempopopup::timer_callback), 25);
}
Example #24
0
PageBox::PageBox(): marg_adj(0, 0, 99999),
    x_adj(1,1,99999),
    y_adj(1,1,99999),
    dpi_adj(300, 1, 9999, 50) {

    /*** 1st hbox ***/
    Gtk::HBox * hb1 = manage(new Gtk::HBox);

    Gtk::Label *l1 = manage(
                         new Gtk::Label("Size:",  Gtk::ALIGN_RIGHT));
    l1->set_padding(3,0);
    Gtk::Label *l2 = manage(
                         new Gtk::Label("x",  Gtk::ALIGN_CENTER));
    l2->set_padding(3,0);
    Gtk::Label *l3 = manage(
                         new Gtk::Label("DPI:",  Gtk::ALIGN_RIGHT));
    l3->set_padding(3,0);

    x   = manage(new Gtk::SpinButton(x_adj));
    y   = manage(new Gtk::SpinButton(y_adj));
    dpi = manage(new Gtk::SpinButton(dpi_adj,0,1));
    units = manage(new CBUnit());

    //                  expand, fill, padding
    hb1->pack_start(*l1, false, false, 3);
    hb1->pack_start(*x, false, false, 0);
    hb1->pack_start(*l2, false, false, 0);
    hb1->pack_start(*y, false, false, 0);
    hb1->pack_start(*units, false, false, 5);
    hb1->pack_start(*l3, false, false, 5);
    hb1->pack_start(*dpi, false, false, 3);

    /*** 2nd hbox ***/
    Gtk::HBox * hb2 = manage(new Gtk::HBox);

    Gtk::Label *l4 = manage(
                         new Gtk::Label("Page:",  Gtk::ALIGN_RIGHT));
    l4->set_padding(3,0);
    Gtk::Label *l5 = manage(
                         new Gtk::Label("Margins:",  Gtk::ALIGN_RIGHT));
    l5->set_padding(3,0);

    landsc = manage(new Gtk::CheckButton("Landscape"));
    marg = manage(new Gtk::SpinButton(marg_adj));
    page = manage(new CBPage());
    m_units = manage(new CBUnit());

    hb2->pack_start(*l4, false, false, 3);
    hb2->pack_start(*page, false, false, 3);
    hb2->pack_start(*l5, false, false, 3);
    hb2->pack_start(*marg, false, false, 3);
    hb2->pack_start(*m_units, false, false, 3);
    hb2->pack_start(*landsc, false, false, 3);

    /*** main vbox ***/
    Gtk::VBox * vb = manage(new Gtk::VBox);
    vb->pack_start(*hb1, false, false, 3);
    vb->pack_start(*hb2, false, false, 3);
    add(*vb);

    /*** default units ***/
    units->set_active_id(0);
    m_units->set_active_id(1);
    old_u = units->get_active_id();
    old_mu = m_units->get_active_id();
    set_spinpars(x, old_u);
    set_spinpars(y, old_u);
    set_spinpars(marg, old_mu);
    marg->set_value(0.65);
    dpi->set_value(300.0);

    /*** signals ***/
    no_ch=false;
    x->signal_changed().connect(
        sigc::mem_fun(this, &PageBox::ch_value));
    y->signal_changed().connect(
        sigc::mem_fun(this, &PageBox::ch_value));

    units->signal_changed().connect(
        sigc::mem_fun(this, &PageBox::ch_units));
    m_units->signal_changed().connect(
        sigc::mem_fun(this, &PageBox::ch_units));

    page->signal_changed().connect(
        sigc::mem_fun(this, &PageBox::ch_page));
    marg->signal_changed().connect(
        sigc::mem_fun(this, &PageBox::ch_page));
    dpi->signal_changed().connect(
        sigc::mem_fun(this, &PageBox::ch_page));
    landsc->signal_toggled().connect(
        sigc::mem_fun(this, &PageBox::ch_page));

    page->set_active(2); // set A4

}
MEGroupItemInfoWidget::MEGroupItemInfoWidget()
   : MEAbstractItemInfoWidget("Group")
{
   Gtk::Box* mainBox = manage(new Gtk::VBox());
   
   // Create the groups ListStore and add to groups TreeView  
   m_listStore = Gtk::ListStore::create(m_columns);
   m_treeView.set_model(m_listStore);
   m_treeView.append_column("Pos", m_columns.m_pos);
   m_treeView.append_column("Tpe", m_columns.m_tpe);
   m_treeView.append_column("ID", m_columns.m_ID);
   m_treeView.append_column("Name", m_columns.m_name);

   // Set column size- and resize properties.
   Gtk::TreeViewColumn* tmpCol;
   tmpCol = m_treeView.get_column(0);
   tmpCol->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED);
   tmpCol->set_fixed_width(40);
   tmpCol->set_resizable(true);

   tmpCol = m_treeView.get_column(1);
   tmpCol->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED);
   tmpCol->set_fixed_width(40);
   tmpCol->set_resizable(true);

   tmpCol = m_treeView.get_column(2);
   tmpCol->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED);
   tmpCol->set_fixed_width(70);
   tmpCol->set_resizable(true);

   // Create selection object to handle chosen rows
   m_selection = m_treeView.get_selection();
   if (!m_selection) {
      mc2log << error << "No selection object created for corresponding "
             << "TreeView" << endl;
      MC2_ASSERT(false);
   }

   // Create a scrolled window to pack the TreeView widget into */
   Gtk::ScrolledWindow *scrolledWindow = manage(new Gtk::ScrolledWindow());
   scrolledWindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS);
   scrolledWindow->add(m_treeView);
   mainBox->pack_start(*scrolledWindow);

   // Add highlight + select buttons
   Gtk::Box* buttonBox = manage(new Gtk::HBox());
   Gtk::Button* button = manage(new Gtk::Button("Highlight items in group"));
   button->signal_clicked().connect(
      sigc::mem_fun(*this, &MEGroupItemInfoWidget::highlightPressed));
   buttonBox->pack_start(*button);
   
   button = manage(new Gtk::Button("Recursive"));
   button->signal_clicked().connect(
      sigc::mem_fun(*this, &MEGroupItemInfoWidget::highlightRecursivePressed));
   buttonBox->pack_start(*button);

   button = manage(new Gtk::Button("Select"));
   button->signal_clicked().connect(
            sigc::mem_fun(*this, &MEGroupItemInfoWidget::selectItemInGroup));
   buttonBox->pack_start(*button);
   
   mainBox->pack_start(*buttonBox, false, false);
   
   // Add to this frame
   add(*mainBox);
}
Example #26
0
EnvGUI::EnvGUI(const std::string& URI)
{
	EventBox *p_background = manage (new EventBox());
	Gdk::Color* color = new  Gdk::Color();
	color->set_rgb(7710, 8738, 9252);
	p_background->modify_bg(Gtk::STATE_NORMAL, *color);

	VBox *p_mainWidget = manage (new VBox(false, 5));

	m_envScope = new EnvGUIScope();
	p_mainWidget->pack_start(*m_envScope);



	Frame *p_adsrFrame = manage (new Frame("ADSR"));
	p_adsrFrame->set_shadow_type(Gtk::SHADOW_NONE);
	HBox *p_adsrWidget = manage (new HBox(false));

	slot<void> p_slotAttack = compose(bind<0>(mem_fun(*this, &EnvGUI::write_control), p_attack), mem_fun(*this, &EnvGUI::get_attack));
	m_scaleAttack = new LabeledDial("Attack", p_slotAttack, p_attack, 0, 1, NORMAL, 0.01, 2);
	p_adsrWidget->pack_start(*m_scaleAttack);

	slot<void> p_slotDecay = compose(bind<0> (mem_fun(*this, &EnvGUI::write_control), p_decay), mem_fun(*this, &EnvGUI::get_decay));
	m_scaleDecay = new LabeledDial("Decay", p_slotDecay, p_decay, 0, 1, NORMAL, 0.01, 2);
	p_adsrWidget->pack_start(*m_scaleDecay);

	slot<void> p_slotSustain = compose(bind<0> (mem_fun(*this, &EnvGUI::write_control), p_sustain), mem_fun(*this, &EnvGUI::get_sustain));
	m_scaleSustain = new LabeledDial("Sustain", p_slotSustain, p_delay, 0, 1, NORMAL, 0.01, 2);
	p_adsrWidget->pack_start(*m_scaleSustain);

	slot<void> p_slotRelease = compose(bind<0> (mem_fun(*this, &EnvGUI::write_control), p_release), mem_fun(*this, &EnvGUI::get_release));
	m_scaleRelease = new LabeledDial("Release", p_slotRelease, p_release, 0, 1, NORMAL, 0.01, 2);
	p_adsrWidget->pack_start(*m_scaleRelease);

	p_adsrFrame->add(*p_adsrWidget);
	p_mainWidget->pack_start(*p_adsrFrame);



	p_mainWidget->pack_start(*(new HSeparator()));



	Frame *p_dhtFrame = manage (new Frame("Delay / Hold / Time Scale"));
	p_dhtFrame->set_shadow_type(Gtk::SHADOW_NONE);
	HBox *p_dhtWidget = manage (new HBox(false));

	slot<void> p_slotDelay = compose(bind<0>(mem_fun(*this, &EnvGUI::write_control), p_delay), mem_fun(*this, &EnvGUI::get_delay));
	m_scaleDelay = new LabeledDial("Delay", p_slotDelay, p_delay, 0, 1, NORMAL, 0.01, 2);
	p_dhtWidget->pack_start(*m_scaleDelay);

	slot<void> p_slotHold = compose(bind<0> (mem_fun(*this, &EnvGUI::write_control), p_hold), mem_fun(*this, &EnvGUI::get_hold));
	m_scaleHold = new LabeledDial("Hold", p_slotHold, p_hold, 0, 1, NORMAL, 0.01, 2);
	p_dhtWidget->pack_start(*m_scaleHold);

	slot<void> p_slotTimescale = compose(bind<0> (mem_fun(*this, &EnvGUI::write_control), p_timeScale), mem_fun(*this, &EnvGUI::get_timescale));
	m_scaleTimeScale = new LabeledDial("Time Scale", p_slotTimescale, p_timeScale, 0, 10, NORMAL, 0.01, 2);
	p_dhtWidget->pack_start(*m_scaleTimeScale);

	p_dhtFrame->add(*p_dhtWidget);
	p_mainWidget->pack_start(*p_dhtFrame);



	m_envScope->m_attackValue = m_scaleAttack->get_value();
	m_envScope->m_decayValue = m_scaleDecay->get_value();
	m_envScope->m_sustainValue = m_scaleSustain->get_value();
	m_envScope->m_releaseValue = m_scaleRelease->get_value();
	m_envScope->m_delayValue = m_scaleDelay->get_value();
	m_envScope->m_holdValue = m_scaleHold->get_value();

	m_envScope->Redraw();



	p_mainWidget->set_size_request(200, 320);

	p_background->add(*p_mainWidget);
	add(*p_background);

	Gtk::manage(p_mainWidget);
}
GranulatorMonoGUI::GranulatorMonoGUI(const std::string& URI)
{
	EventBox *p_background = manage (new EventBox());
	Gdk::Color* color = new  Gdk::Color();
	color->set_rgb(7710, 8738, 9252);
	p_background->modify_bg(Gtk::STATE_NORMAL, *color);



	VBox *p_mainWidget = manage(new VBox(false, 5));



	Frame *p_gainFrame = manage(new Frame("Gain"));
	//p_gainFrame->set_shadow_type(Gtk::SHADOW_NONE);
	HBox *p_gainBox = manage(new HBox(true));

	slot<void> p_slotInputGain = compose(bind<0>(mem_fun(*this, &GranulatorMonoGUI::write_control), p_inputGain), mem_fun(*this,  &GranulatorMonoGUI::get_inputGain));
	m_dialInputGain = new LabeledDial("Input Gain", p_slotInputGain, p_inputGain, -10, 10, NORMAL, 0.01, 2);
	p_gainBox->pack_start(*m_dialInputGain);

	slot<void> p_slotOutputGain = compose(bind<0>(mem_fun(*this, &GranulatorMonoGUI::write_control), p_outputGain), mem_fun(*this,  &GranulatorMonoGUI::get_outputGain));
	m_dialOutputGain = new LabeledDial("Output Gain", p_slotOutputGain, p_outputGain, -10, 10, NORMAL, 0.01, 2);
	p_gainBox->pack_start(*m_dialOutputGain);

	p_gainFrame->add(*p_gainBox);
	p_mainWidget->pack_start(*p_gainFrame);



	Frame *p_grainFrame = manage(new Frame("Grain"));
	//p_gainFrame->set_shadow_type(Gtk::SHADOW_NONE);
	HBox *p_grainBox = manage(new HBox(true));

	slot<void> p_slotGrainSize = compose(bind<0>(mem_fun(*this, &GranulatorMonoGUI::write_control), p_grainSize), mem_fun(*this,  &GranulatorMonoGUI::get_grainSize));
	m_dialGrainSize = new LabeledDial("Grain Size (ms)", p_slotGrainSize, p_grainSize, 6, 10000, LOG, 1, 0);
	p_grainBox->pack_start(*m_dialGrainSize);

	slot<void> p_slotAttack = compose(bind<0>(mem_fun(*this, &GranulatorMonoGUI::write_control), p_attack), mem_fun(*this,  &GranulatorMonoGUI::get_attack));
	m_dialAttack = new LabeledDial("Attack (ms)", p_slotAttack, p_attack, 3, 100, NORMAL, 1, 0);
	p_grainBox->pack_start(*m_dialAttack);

	slot<void> p_slotRelease = compose(bind<0>(mem_fun(*this, &GranulatorMonoGUI::write_control), p_release), mem_fun(*this,  &GranulatorMonoGUI::get_release));
	m_dialRelease = new LabeledDial("Release (ms)", p_slotRelease, p_release, 3, 100, NORMAL, 1, 0);
	p_grainBox->pack_start(*m_dialRelease);

	p_grainFrame->add(*p_grainBox);
	p_mainWidget->pack_start(*p_grainFrame);



	Frame *p_textureFrame = manage(new Frame("Texture"));
	//p_gainFrame->set_shadow_type(Gtk::SHADOW_NONE);
	HBox *p_textureBox = manage(new HBox(true));

	slot<void> p_slotGrainDensity = compose(bind<0>(mem_fun(*this, &GranulatorMonoGUI::write_control), p_grainDensity), mem_fun(*this,  &GranulatorMonoGUI::get_grainDensity));
	m_dialGrainDensity = new LabeledDial("Grain Spacing (ms)", p_slotGrainDensity, p_grainDensity, 1, 10000, LOG, 1, 0);
	p_textureBox->pack_start(*m_dialGrainDensity);

	slot<void> p_slotGrainSpread = compose(bind<0>(mem_fun(*this, &GranulatorMonoGUI::write_control), p_grainSpread), mem_fun(*this,  &GranulatorMonoGUI::get_grainSpread));
	m_dialGrainSpread = new LabeledDial("Grain Spread", p_slotGrainSpread, p_grainSpread, 2, 10000, LOG, 1, 0);
	p_textureBox->pack_start(*m_dialGrainSpread);

	p_textureFrame->add(*p_textureBox);
	p_mainWidget->pack_start(*p_textureFrame);



	p_background->add(*p_mainWidget);

	p_background->set_size_request(200, 320);

	add(*p_background);

	Gtk::manage(p_background);
}
Example #28
0
	void label::change(const string & text)
	{
		_text = text;
		manage();
	}
Example #29
0
void 
mainwnd::file_import_dialog( void )
{

   FileSelection dialog( "Import..." );


   HBox *abox = dialog.get_action_area(); 
   HBox hbox( false, 2 );
   
   m_adjust_load_offset = manage( new Adjustment( 0, -(c_max_sets - 1) , c_max_sets - 1, 1 ));
   m_spinbutton_load_offset = manage( new SpinButton( *m_adjust_load_offset ));
   m_spinbutton_load_offset->set_editable( false );
   m_spinbutton_load_offset->set_wrap( true );
   hbox.pack_end(*m_spinbutton_load_offset, false, false );
   hbox.pack_end(*(manage( new Label( "Screen Set Offset" ))), false, false, 4);
   
   abox->pack_end(hbox, false, false );  
   
   dialog.show_all_children();
   
   int result = dialog.run();
   
   //Handle the response:
   switch(result)
   {
       case(Gtk::RESPONSE_OK):
       {

           try{
               midifile f( dialog.get_filename() );
               f.parse( m_mainperf, (int) m_adjust_load_offset->get_value() );

           }
           catch(...){
               
               Gtk::MessageDialog errdialog(*this, 
                                            "Error reading file.", false,
                                            Gtk::MESSAGE_ERROR,
                                            (Gtk::ButtonsType)(Gtk::BUTTONS_OK),
                                            true);
                errdialog.run();
               
           }

           global_filename = std::string(dialog.get_filename());
           set_window_title_filename( global_filename );
           
           m_main_wid->reset();
           m_entry_notes->set_text( * m_mainperf->get_screen_set_notepad( m_mainperf->get_screenset() )); 
           m_adjust_bpm->set_value( m_mainperf->get_bpm() );

           break;
       }
       case(Gtk::RESPONSE_CANCEL):
       {
           break;
       }
       default:
       {
           break;
       }
   }

}
Example #30
0
	void label::move(const vec3 & position)
	{
		_position = position;
		manage();
	}