コード例 #1
0
ファイル: Splash.cpp プロジェクト: m2osw/turnwatcher
SplashScreen::SplashScreen(Gtk::Window *parent) :
	Gtk::Window(Gtk::WINDOW_POPUP),
	f_parent( parent )
{
    molib::moWCString splash_path( Common::GetFullPathnameForImage( SPLASH_IMAGE ) );

	if( splash_path != "" )
	{
		splash_path = molib::moFile::FullPath(splash_path);
		f_splash.set( splash_path.c_str() );
	}

	set_type_hint(Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
	set_title(gettext("Turn Watcher Splashscreen"));
	set_resizable(false);
	set_decorated(false);
	set_has_frame(false);
	set_position(Gtk::WIN_POS_CENTER);
	set_transient_for(*f_parent);	// avoid having an icon in toolbar
	set_modal(true);		// the first click closes the splash no matter where
	set_keep_above();		// keep splashscreen on top of everything
	set_icon( Gdk::Pixbuf::create_from_xpm_data( Helmet_xpm ) );

	add(f_box);

	f_box.add(f_splash);

	f_box.set_events(Gdk::BUTTON_PRESS_MASK);
	f_box.signal_button_press_event().connect(
			sigc::mem_fun(*this, &SplashScreen::on_button_press_event));

	show_all_children();
}
コード例 #2
0
ファイル: gd_keyGrabber.cpp プロジェクト: fourks/giada
gdKeyGrabber::gdKeyGrabber(int ch, gdConfig *w)
: Fl_Window(300, 100, "Key configuration"), w(w), ch(ch) {
	set_modal();
	text = new gBox(10, 10, 280, 80, "Press a key (esc to quit):");
	gu_setFavicon(this);
	show();
}
コード例 #3
0
ファイル: gd_midiOutputSetup.cpp プロジェクト: rzr/giada
gdMidiOutputSetup::gdMidiOutputSetup(MidiChannel *ch)
	: gWindow(300, 64, "Midi Output Setup"), ch(ch)
{
	begin();
	enableOut      = new gCheck(x()+8, y()+8, 150, 20, "Enable MIDI output");
	chanListOut    = new gChoice(w()-108, y()+8, 100, 20);

	save   = new gButton(w()-88, chanListOut->y()+chanListOut->h()+8, 80, 20, "Save");
	cancel = new gButton(w()-88-save->w()-8, save->y(), 80, 20, "Cancel");
	end();

	fillChanMenu(chanListOut);

	if (ch->midiOut)
		enableOut->value(1);
	else
		chanListOut->deactivate();

	chanListOut->value(ch->midiOutChan);

	enableOut->callback(cb_enableChanList, (void*)this);
	save->callback(cb_save, (void*)this);
	cancel->callback(cb_cancel, (void*)this);

	set_modal();
	gu_setFavicon(this);
	show();
}
コード例 #4
0
// Main constructor
ModalProgressDialog::ModalProgressDialog(const Glib::RefPtr<Gtk::Window>& parent, const std::string& title)
: gtkutil::TransientWindow(title, GlobalMainFrame().getTopLevelWindow()),
  _label(Gtk::manage(new Gtk::Label)),
  _progressBar(Gtk::manage(new Gtk::ProgressBar)),
  _aborted(false)
{
  	// Window properties
	set_modal(true);
	set_position(Gtk::WIN_POS_CENTER_ON_PARENT);
	set_default_size(360, 80);
	set_border_width(12);

	// Create a vbox
	Gtk::VBox* vbx = Gtk::manage(new Gtk::VBox(false, 12));

	// Pack a progress bar into the window
	vbx->pack_start(*_progressBar, false, false, 0);

	// Pack the label into the window
	vbx->pack_start(*_label, true, false, 0);
	add(*vbx);

	// Pack a right-aligned cancel button at the bottom
	Gtk::Button* cancelButton = Gtk::manage(new Gtk::Button(Gtk::Stock::CANCEL));
	cancelButton->signal_clicked().connect(sigc::mem_fun(*this, &ModalProgressDialog::_onCancel));

	vbx->pack_end(*Gtk::manage(new gtkutil::RightAlignment(*cancelButton)), false, false, 0);

	// Connect the realize signal to remove the window decorations
	signal_realize().connect(sigc::mem_fun(*this, &ModalProgressDialog::_onRealize));

	// Show the window
	show_all();
	handleEvents();
}
コード例 #5
0
ファイル: HUDWindow.cpp プロジェクト: m2osw/turnwatcher
/** \brief
 *
 * Constructor. Sets up a modeless window and adds the HUD component to a
 * ScrolledWindow component.
 *
 */
HUDWindow::HUDWindow()
{
	set_type_hint(Gdk::WINDOW_TYPE_HINT_NORMAL);
	set_title(gettext("Player HUD Window"));
	set_resizable(true);
	set_decorated(true);
	set_position(Gtk::WIN_POS_CENTER);
	set_modal(false);
	set_icon( Gdk::Pixbuf::create_from_xpm_data( Helmet_xpm ) );

	PositionWindow();

    f_charView.AddHUDColumns();
    f_charView.set_border_width( 1 );
    //f_charView.update();
	//
    f_scrolledWindow.add( f_charView );
	f_scrolledWindow.set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC );
	f_scrolledWindow.set_shadow_type( Gtk::SHADOW_IN  );
	f_scrolledWindow.set_border_width( 1 );
	//
	f_mainBox.pack_start( f_scrolledWindow, Gtk::PACK_EXPAND_WIDGET );
	f_mainBox.pack_start( f_statusBox, Gtk::PACK_SHRINK );
	//
	add( f_mainBox );

	f_statusBox.Update();
	
	show_all_children();
}
コード例 #6
0
ファイル: AcceptAppUI.cpp プロジェクト: johneddcooper/2404a4
//////////////////////////////////////////////////////////////////////////
// Default constructor
AcceptAppUI::AcceptAppUI(Manager* aManager) 
	: aTable(2, 2, false),
	aLabel("Thank you for filling out an application.\n         Would you like to submit? "),
	submitButton("Submit"),
	cancelButton("Cancel")
{
	manager   = aManager;

	set_default_size(500, 350);
	set_title("cuTAES");
	set_modal(true);
	set_position(Gtk::WIN_POS_CENTER_ALWAYS);
	set_deletable(false);

	add(aTable);

	aTable.attach(aLabel, 0, 2, 0, 1,Gtk::EXPAND,Gtk::FILL,20,100);
	aTable.attach(cancelButton, 0, 1, 1, 2,Gtk::FILL,Gtk::FILL,40,50);
	aTable.attach(submitButton, 1, 2, 1, 2,Gtk::FILL,Gtk::FILL,40,50);

	submitButton.signal_clicked().connect(
			sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &AcceptAppUI::on_submitButton), "Submit") );
	cancelButton.signal_clicked().connect(
			sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &AcceptAppUI::on_cancelButton), "Cancel") );

	show_all_children();

	//cout << "CONSTRUCT AcceptAppUI" << endl;
}
コード例 #7
0
ファイル: gd_beatsInput.cpp プロジェクト: asd55/giada
gdBeatsInput::gdBeatsInput()
	: gWindow(164, 60, "Beats")
{
	if (G_Conf.beatsX)
		resize(G_Conf.beatsX, G_Conf.beatsY, w(), h());

	set_modal();

	beats     = new gInput(8,  8,  35, 20);
	bars      = new gInput(47, 8,  35, 20);
	ok 		    = new gClick(86, 8,  70, 20, "Ok");
	resizeRec = new gCheck(8,  40, 12, 12, "resize recorded actions");
	end();

	char buf_bars[3]; sprintf(buf_bars, "%d", G_Mixer.bars);
	char buf_beats[3]; sprintf(buf_beats, "%d", G_Mixer.beats);
	beats->maximum_size(2);
	beats->value(buf_beats);
	beats->type(FL_INT_INPUT);
	bars->maximum_size(2);
	bars->value(buf_bars);
	bars->type(FL_INT_INPUT);
	ok->shortcut(FL_Enter);
	ok->callback(cb_update_batt, (void*)this);
	resizeRec->value(G_Conf.resizeRecordings);

	gu_setFavicon(this);
	setId(WID_BEATS);
	show();
}
コード例 #8
0
ファイル: prefdialog.cpp プロジェクト: Spin0za/inkscape
void
PrefDialog::preview_toggle (void) {
    if(_param_preview->get_bool(NULL, NULL)) {
        set_modal(true);
        if (_exEnv == NULL) {
            _exEnv = new ExecutionEnv(_effect, SP_ACTIVE_DESKTOP, NULL, false, false);
            _exEnv->run();
        }
    } else {
        set_modal(false);
        if (_exEnv != NULL) {
            _exEnv->cancel();
            _exEnv->undo();
            delete _exEnv;
            _exEnv = NULL;
        }
    }
}
コード例 #9
0
//////////////////////////////////////////////////////////////////////////
// Default constructor
SubmitAppUI::SubmitAppUI(Manager* aManager) 
: subTable(3, 2, true),
  closeButton("Close"),
  createButton("Create New Application"),
  statusLabel1("Application Status: "),
  appNumLabel1("Application Number: ")
{
  manager = aManager;

  set_default_size(675, 475);
  set_title("cuTAES");
  set_modal(true);
  set_position(Gtk::WIN_POS_CENTER_ALWAYS);
  set_deletable(false);
  add(subTable);  

  if (manager->getCurrUGradApp() != 0) 
    completeLabel.set_text("You have succesfully submitted your application for " + aManager->getCurrUGradApp()->getCourse()->getName());
  else
    completeLabel.set_text("You have succesfully submitted your application for " + aManager->getCurrGradApp()->getCourse()->getName());

  // Set status and app #
  stringstream out;
  if (manager->getCurrUGradApp() != 0) 
    out << manager->getCurrUGradApp()->getAppNum();
  else
    out << manager->getCurrGradApp()->getAppNum();
  string s = out.str();
  appNumLabel2.set_label(s);

  if (manager->getCurrUGradApp() != 0)
    statusLabel2.set_text(manager->getCurrUGradApp()->getStatusString(manager->getCurrUGradApp()->getStatus()));
  else
    statusLabel2.set_text(manager->getCurrGradApp()->getStatusString(manager->getCurrGradApp()->getStatus()));

  // Align labels to the left
  appNumLabel2.set_alignment(0, 0.5);
  statusLabel2.set_alignment(0, 0.5);

  // Attach all the labels 
  subTable.attach(completeLabel, 0, 2, 0, 1);
  subTable.attach(appNumLabel1, 0, 1, 1, 2);
  subTable.attach(appNumLabel2, 1, 2, 1, 2);
  subTable.attach(statusLabel1, 0, 1, 2, 3);
  subTable.attach(statusLabel2, 1, 2, 2, 3);
  subTable.attach(closeButton, 0, 1, 3, 4,Gtk::FILL,Gtk::FILL,75,50);
  subTable.attach(createButton, 1, 2, 3, 4,Gtk::FILL,Gtk::FILL,75,50);

  closeButton.signal_clicked().connect(
    sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &SubmitAppUI::on_closeButton), "Close") );
  createButton.signal_clicked().connect(
    sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &SubmitAppUI::on_createButton), "Create New Application") );

  show_all_children();

  //cout << "CONSTRUCT SubmitAppUI" << endl;
}
コード例 #10
0
int ProjectOptionsDlg::DoModal()
{
	doneInput = 0;
	set_modal();
	show();
	while (!doneInput)
		Fl::wait();

	return doneInput == 1 ? 1 : 0;
}
コード例 #11
0
//////////////////////////////////////////////////////////////////////////
// Default constructor
OnePendingUI::OnePendingUI(Manager* aManager, string crs) 
: aTable(3, 3, false),
  aLabel("List of applications sorted by Major GPA and Research Area for " + crs),
  backButton("Back"),
  cancelButton("Cancel"),
  saveButton("Save"),
  summary(8, false, Gtk::SELECTION_NONE)
{
  manager = aManager;
  course = crs;

  set_default_size(1100, 500);
  set_title("cuTAES");
  set_modal(true);
  set_position(Gtk::WIN_POS_CENTER_ALWAYS);
  set_deletable(false);

  // Scrolled window settings
  scrolledWindow.set_border_width(5);
  scrolledWindow.set_policy(Gtk::POLICY_ALWAYS, Gtk::POLICY_ALWAYS); 

  summary.set_column_title(0, "Student #");
  summary.set_column_title(1, "First Name");
  summary.set_column_title(2, "Last Name");
  summary.set_column_title(3, "E-mail");
  summary.set_column_title(4, "Major/Research");
  summary.set_column_title(5, "Year/Program");
  summary.set_column_title(6, "CGPA/Supervisor");
  summary.set_column_title(7, "Major GPA");

  fillSummary();

  scrolledWindow.add(summary);

  aTable.attach(aLabel, 0, 2, 0, 1,Gtk::EXPAND,Gtk::FILL,0,10);
  aTable.attach(scrolledWindow, 0, 3, 1, 2);
  aTable.attach(backButton, 0, 1, 2, 3,Gtk::FILL,Gtk::FILL,40,50);
  aTable.attach(cancelButton, 2, 3, 2, 3,Gtk::FILL,Gtk::FILL,40,50);
  aTable.attach(saveButton, 1, 2, 2, 3,Gtk::FILL,Gtk::FILL,40,50);

  add(aTable);

  backButton.signal_clicked().connect(
    sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &OnePendingUI::on_backButton), "Back") );
  cancelButton.signal_clicked().connect(
    sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &OnePendingUI::on_cancelButton), "Cancel") );
  saveButton.signal_clicked().connect(
    sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &OnePendingUI::on_saveButton), "Save") );

  show_all_children();

  //cout << "CONSTRUCT OnePendingUI" << endl;
}
コード例 #12
0
gdMidiOutputMidiCh::gdMidiOutputMidiCh(MidiChannel *ch)
	: gdMidiOutput(300, 168), ch(ch)
{
	setTitle(ch->index+1);
	begin();

	enableOut   = new gCheck(x()+8, y()+8, 150, 20, "Enable MIDI output");
	chanListOut = new gChoice(w()-108, y()+8, 100, 20);

	enableLightning = new gCheck(x()+8, chanListOut->y()+chanListOut->h()+8, 120, 20, "Enable MIDI lightning output");
	new gLearner(x()+8,  enableLightning->y()+enableLightning->h()+8,  w()-16, "playing", cb_learn, &ch->midiOutLplaying);
	new gLearner(x()+8,  enableLightning->y()+enableLightning->h()+32, w()-16, "mute",    cb_learn, &ch->midiOutLmute);
	new gLearner(x()+8,  enableLightning->y()+enableLightning->h()+56, w()-16, "solo",    cb_learn, &ch->midiOutLsolo);

	close = new gButton(w()-88, enableLightning->y()+enableLightning->h()+84, 80, 20, "Close");

	end();

	chanListOut->add("Channel 1");
	chanListOut->add("Channel 2");
	chanListOut->add("Channel 3");
	chanListOut->add("Channel 4");
	chanListOut->add("Channel 5");
	chanListOut->add("Channel 6");
	chanListOut->add("Channel 7");
	chanListOut->add("Channel 8");
	chanListOut->add("Channel 9");
	chanListOut->add("Channel 10");
	chanListOut->add("Channel 11");
	chanListOut->add("Channel 12");
	chanListOut->add("Channel 13");
	chanListOut->add("Channel 14");
	chanListOut->add("Channel 15");
	chanListOut->add("Channel 16");
	chanListOut->value(0);

	if (ch->midiOut)
		enableOut->value(1);
	else
		chanListOut->deactivate();

	if (ch->midiOutL)
		enableLightning->value(1);

	chanListOut->value(ch->midiOutChan);

	enableOut->callback(cb_enableChanList, (void*)this);
	close->callback(cb_close, (void*)this);

	set_modal();
	gu_setFavicon(this);
	show();
}
コード例 #13
0
ファイル: textInput.cpp プロジェクト: ddorian1/fToxTun
TextInput::TextInput(const char* hint)
:
	Fl_Window(w, h, "fToxTun"),
	hint(5, 5, w-10, 20, hint),
	buttonOk(w/2-20, 55, 40, 30, "OK"),
	text(5, 30, w-10, 20)
{
	buttonOk.callback(onOk, this);

	end();
	set_modal();
	show();
}
コード例 #14
0
ファイル: DummyAssistant.cpp プロジェクト: VaysseB/openfluid
    TheDummyAssistant(openfluid::machine::SimulationBlob* SimBlob) :
      Gtk::Assistant(), mp_SimBlob(SimBlob), mp_TestUnitsColl(0), m_Applied(false)
    {
      set_title("Dummy assistant");
      set_default_size(400, 300);
      set_modal(true);

      Gtk::Label* Label1 = Gtk::manage(new Gtk::Label(
          "I'm a Dummy assistant for tests"));
      append_page(*Label1);
      set_page_title(*Label1, "Page 1/2");
      set_page_type(*Label1, Gtk::ASSISTANT_PAGE_INTRO);
      set_page_complete(*Label1, true);

      Gtk::Label* Label2 = Gtk::manage(new Gtk::Label());

      if (!mp_SimBlob)
      {
        Label2->set_text("Nb of units in TestUnits class: no CoreRepository\n"
          "Nothing to do");

        signal_apply().connect(sigc::mem_fun(*this, &Gtk::Assistant::hide));
      }
      else
      {
        unsigned int Size = 0;

        mp_TestUnitsColl = mp_SimBlob->getCoreRepository().getUnits("TestUnits");

        if (mp_TestUnitsColl)
          Size = mp_TestUnitsColl->getList()->size();

        Label2->set_text(Glib::ustring::compose(
            "Nb of units in TestUnits class: %1\n"
              "Clicking ok will add a Unit of class \"TestUnits\"", Size));

        signal_apply().connect(
            sigc::mem_fun(*this, &TheDummyAssistant::m_apply));
      }

      append_page(*Label2);
      set_page_title(*Label2, "Page 2/2");
      set_page_type(*Label2, Gtk::ASSISTANT_PAGE_CONFIRM);
      set_page_complete(*Label2, true);

      signal_cancel().connect(sigc::mem_fun(*this, &Gtk::Assistant::hide));
      signal_close().connect(sigc::mem_fun(*this, &Gtk::Assistant::hide));

      show_all_children();
    }
コード例 #15
0
gdKeyGrabber::gdKeyGrabber(Channel *ch)
	: gWindow(300, 126, "Key configuration"), ch(ch)
{
	set_modal();
	text   = new gBox(8, 8, 284, 80, "");
	clear  = new gClick(w()-88, text->y()+text->h()+8, 80, 20, "Clear");
	cancel = new gClick(clear->x()-88, clear->y(), 80, 20, "Close");
	end();

	clear->callback(cb_clear, (void*)this);
	cancel->callback(cb_cancel, (void*)this);

	updateText(ch->key);

	gu_setFavicon(this);
	show();
}
コード例 #16
0
ViewLogFileWindow::ViewLogFileWindow(const std::string& PathToLogFile)
{
  set_default_size(500, 350);
  set_position(Gtk::WIN_POS_CENTER_ON_PARENT);

  set_title(_("Install log"));

  m_CloseButton.set_label(_("Close"));

  m_RefLogTextBuffer = Gtk::TextBuffer::create();
  m_RefLogTextBuffer->set_text("");

  m_LogTextView.set_editable(false);
  m_LogTextView.set_buffer(m_RefLogTextBuffer);
  m_LogTextView.set_wrap_mode(Gtk::WRAP_WORD);

  m_LogSWindow.add(m_LogTextView);
  m_LogSWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);


  m_VBox.set_border_width(12);
  m_VBox.pack_start(m_LogSWindow,Gtk::PACK_EXPAND_WIDGET,12);
  m_VBox.pack_start(m_CloseButton,Gtk::PACK_SHRINK,12);

  add(m_VBox);

  m_CloseButton.signal_clicked().connect(
      sigc::mem_fun(*this, &ViewLogFileWindow::onCloseClicked)
    );

  std::ifstream LogFile(PathToLogFile.c_str());
  std::string Line, FullContent;

  while(getline(LogFile,Line))
  {
    FullContent += Line + "\n";
  }
  LogFile.close();

  m_RefLogTextBuffer->set_text(FullContent);

  show_all_children();

  set_modal(true);
}
コード例 #17
0
Flu_Combo_Box::Popup :: Popup( Flu_Combo_Box *b, Fl_Widget *c, int H )
  : Fl_Double_Window( global_x(b)-2, //Fl::x()+b->window()->x()+b->x()-2,
		      global_y(b)+b->h()-2, //Fl::y()+b->window()->y()+b->y()+b->h()-2,
		      b->w()+4, H, 0 )
{
  combo = b;
  dragging = false;
  selected = NULL;

  box( FL_BORDER_FRAME );
  border( 0 );
  add( c );
  end();
  //set_non_modal();
  set_modal();

  c->resize( 1, 1, w()-2, h()-2 );
}
コード例 #18
0
ChooseFileWindow::ChooseFileWindow(MainWindow* mainWindow, Gtk::FileChooserAction file_chooser_action)
    : Gtk::FileChooserDialog("Select a wavefront file", file_chooser_action),
      mainWindow(mainWindow),
      selected_path("")
{

  add_button("_Cancel", Gtk::RESPONSE_CANCEL);
  add_button("Select", Gtk::RESPONSE_OK);

  set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);
  set_modal();
  set_transient_for(*mainWindow);

  auto filter_obj = Gtk::FileFilter::create();
  filter_obj->set_name("Wavefront .obj files");
  filter_obj->add_pattern("*.obj");
  filter_obj->add_pattern("*.OBJ");
  add_filter(filter_obj);
}
コード例 #19
0
ファイル: SelectAppUI.cpp プロジェクト: CanadianBac0nz/2404a5
//////////////////////////////////////////////////////////////////////////
// Default constructor
SelectAppUI::SelectAppUI(Manager* aManager, int type, string aStuNum, bool aBeingViewed)
: aTable(3, 2, false),
  aLabel("Please select an application you would like to edit"),
  backButton("Back"),
  nextButton("Next"),
  list(2, false, Gtk::SELECTION_SINGLE)
{
  manager = aManager;
  stuType = type;
  stuNum  = aStuNum;
  beingViewed = aBeingViewed;
  set_default_size(500, 250);
  set_title("cuTAES");
  set_modal(true);
  set_position(Gtk::WIN_POS_CENTER_ALWAYS);
  set_deletable(false);

  // Scrolled window settings
  scrolledWindow.set_border_width(5);
  scrolledWindow.set_policy(Gtk::POLICY_ALWAYS, Gtk::POLICY_ALWAYS); 

  list.set_column_title(0, "Application #");
  list.set_column_title(1, "Course");

  fillList();

  scrolledWindow.add(list);

  add(aTable);

  aTable.attach(aLabel, 0, 2, 0, 1,Gtk::FILL,Gtk::FILL,0,10);
  aTable.attach(scrolledWindow, 0, 2, 1, 2);
  aTable.attach(backButton, 0, 1, 2, 3,Gtk::FILL,Gtk::FILL,40,10);
  aTable.attach(nextButton, 1, 2, 2, 3,Gtk::FILL,Gtk::FILL,40,10);

  backButton.signal_clicked().connect(
    sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &SelectAppUI::on_backButton), "Back") );
  nextButton.signal_clicked().connect(
    sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &SelectAppUI::on_nextButton), "Next") );
  
  show_all_children();
  //cout << "CONSTRUCT SelectAppUI" << endl;
}
コード例 #20
0
gdMidiOutputSampleCh::gdMidiOutputSampleCh(SampleChannel *ch)
	: gdMidiOutput(300, 140), ch(ch)
{
	setTitle(ch->index+1);

	enableLightning = new gCheck(8, 8, 120, 20, "Enable MIDI lightning output");
	new gLearner(8,  enableLightning->y()+enableLightning->h()+8, w()-16, "playing", cb_learn, &ch->midiOutLplaying);
	new gLearner(8,  enableLightning->y()+enableLightning->h()+32, w()-16, "mute",   cb_learn, &ch->midiOutLmute);
	new gLearner(8,  enableLightning->y()+enableLightning->h()+56, w()-16, "solo",   cb_learn, &ch->midiOutLsolo);

	close = new gButton(w()-88, enableLightning->y()+enableLightning->h()+84, 80, 20, "Close");
	close->callback(cb_close, (void*)this);

	enableLightning->value(ch->midiOutL);
	enableLightning->callback(cb_enableLightning, (void*)this);

	set_modal();
	gu_setFavicon(this);
	show();
}
コード例 #21
0
ファイル: SelectCrsUI.cpp プロジェクト: CanadianBac0nz/2404a5
//////////////////////////////////////////////////////////////////////////
// Default constructor
SelectCrsUI::SelectCrsUI(Manager* aManager, int i) 
: createTable(2, 2, false),
  createLabel("Select a course to apply for:"),
  nextButton("Continue"),
  backButton("Back")
{
  whichWindow = i;
  manager = aManager;

  set_default_size(500, 350);
  set_title("cuTAES");
  set_modal(true);
  set_position(Gtk::WIN_POS_CENTER_ALWAYS);
  set_deletable(false);

  add(createTable);
    
  // Iterate through course queue and put names into comboBox
  CourseQueue<Course>::Node* currNode = manager->getCourseQueue()->front();

  while (currNode != 0){ 
    m_Combo.append(currNode->data->getName());
    currNode = currNode->next;
  }

  m_Combo.set_active(0);

  createTable.attach(createLabel, 0, 1, 0, 1,Gtk::EXPAND,Gtk::EXPAND,0,100);
  createTable.attach(m_Combo, 1, 2, 0, 1,Gtk::EXPAND,Gtk::EXPAND,0,45);
  createTable.attach(backButton, 0, 1, 1, 2,Gtk::FILL,Gtk::FILL,20,50);
  createTable.attach(nextButton, 1, 2, 1, 2,Gtk::FILL,Gtk::FILL,35,50);

  nextButton.signal_clicked().connect(
    sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &SelectCrsUI::on_nextButton), "Next") );
  backButton.signal_clicked().connect(
    sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &SelectCrsUI::on_backButton), "Back") );

  show_all_children();

  //cout << "CONSTRUCT SelectCrsUI" << endl;
}
コード例 #22
0
ファイル: StuOptionUI.cpp プロジェクト: CanadianBac0nz/2404a5
//////////////////////////////////////////////////////////////////////////
// Default constructor
StuOptionUI::StuOptionUI(Manager* aManager) 
: stuTable(4, 2, false),
  stuLabel("Please select an option"),
  createButton("Create application"),
  editButton("Edit application"),
  backButton("Back")
{
  manager = aManager;

  set_default_size(500, 350);
  set_title("cuTAES");
  set_modal(true);
  set_position(Gtk::WIN_POS_CENTER_ALWAYS);
  set_deletable(false);

  add(stuTable);

  m_Combo.append("Graduate");
  m_Combo.append("Undergraduate");

  m_Combo.set_active(0);

  stuTable.attach(stuLabel, 0, 2, 0, 1,Gtk::EXPAND,Gtk::FILL,0,120);
  stuTable.attach(m_Combo, 0, 2 , 1, 2,Gtk::FILL,Gtk::FILL,80,10);
  stuTable.attach(createButton, 0, 1, 2, 3,Gtk::FILL,Gtk::FILL,40,10);
  stuTable.attach(editButton, 1, 2, 2, 3,Gtk::FILL,Gtk::FILL,40,10);
  stuTable.attach(backButton, 0, 2, 3, 4,Gtk::FILL,Gtk::FILL,175,20);

  createButton.signal_clicked().connect(
    sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &StuOptionUI::on_createButton), "Create") );
  editButton.signal_clicked().connect(
    sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &StuOptionUI::on_editButton), "Edit") );
  backButton.signal_clicked().connect(
    sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &StuOptionUI::on_backButton), "Back") );
  
  show_all_children();
  createButton.set_sensitive(true);
  //cout << "CONSTRUCT StuOptionUI" << endl;
}
コード例 #23
0
DifficultyDialog::DifficultyDialog() :
	gtkutil::BlockingTransientWindow(_(WINDOW_TITLE), GlobalMainFrame().getTopLevelWindow())
{
	// Load the settings
	_settingsManager.loadSettings();

	// Set the default border width in accordance to the HIG
	set_border_width(12);
	set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);
	set_modal(true);

	signal_key_press_event().connect(sigc::mem_fun(*this, &DifficultyDialog::onWindowKeyPress), false);

	// Create the widgets
	populateWindow();

	// Connect the window position tracker
	_windowPosition.loadFromPath(RKEY_WINDOW_STATE);

	_windowPosition.connect(this);
	_windowPosition.applyPosition();
}
コード例 #24
0
//////////////////////////////////////////////////////////////////////////
// Default constructor
AllReportsUI::AllReportsUI(Manager* aManager) 
: summary(10, false, Gtk::SELECTION_NONE)
{
  manager = aManager;

  set_default_size(1200, 500);
  set_modal(true);
  set_position(Gtk::WIN_POS_CENTER_ALWAYS);
  set_deletable(false);

  summary.set_column_title(0, "Course");
  summary.set_column_title(1, "UGrad/Grad");
  summary.set_column_title(2, "Student #");
  summary.set_column_title(3, "First Name");
  summary.set_column_title(4, "Last Name");
  summary.set_column_title(5, "E-mail");
  summary.set_column_title(6, "Major/Research");
  summary.set_column_title(7, "Year/Program");
  summary.set_column_title(8, "CGPA/Supervisor");
  summary.set_column_title(9, "Major GPA");

  //cout << "CONSTRUCT AllReportsUI" << endl;
}
コード例 #25
0
PATransitionCreator::PATransitionCreator(PATransitionEditor2* editor, int x, int y, int w, int h) : Fl_Window(x, y, w, h)
{
	set_modal();
	isCreateMode = true;
	transitionEditor = editor;
	xDis = 10;
	yDis = 10;
	this->label("Edit State");
	this->begin();

	int csx = xDis;
	int csy = 4 * yDis;

	inputStateName = new Fl_Input(xDis + csx + 20, yDis, 10 * xDis, 2 * yDis, "Name");
	choiceStateType = new Fl_Choice(xDis + csx + 60, 2 * yDis + csy, 150, 20, "State Type");
	choiceStateType->add("0D");
	choiceStateType->add("1D");
	choiceStateType->add("2D");
	choiceStateType->add("3D");
	choiceStateType->value(0);

	
	animationList = new Fl_Multi_Browser(xDis + csx, 4 * yDis + csy, 350, 250, "All Motions");
	stateAnimationList = new Fl_Multi_Browser(xDis + csx + 420, 4 * yDis + csy, 350, 250, "Motions in State");
	animationAdd = new Fl_Button(xDis + csx + 360, 4 * yDis + csy + 50, 50, 20, ">>>");
	animationAdd->callback(addMotion, this);
	animationRemove = new Fl_Button(xDis + csx + 360, 4 * yDis + csy + 100, 50, 20,  "<<<");
	animationRemove->callback(removeMotion, this);

	buttonCreateState = new Fl_Button(xDis + csx, 4 * yDis + csy + 300, 100, 20, "Create State");
	buttonCreateState->callback(createState, this);
	
	buttonCancelState = new Fl_Button(xDis + csx + 100, 4 * yDis + csy + 300, 60, 20, "Cancel");
	buttonCancelState->callback(cancelState, this);

	this->end();
}
コード例 #26
0
ファイル: Tempo_Point.C プロジェクト: 0mk/non
    Tempo_Point_Editor ( float *tempo ) : Fl_Menu_Window(  75, 58, "Edit Tempo" )
        {
            _sucess = false;
            _tempo = tempo;

            set_modal();

            Fl_Float_Input *fi = _fi = new Fl_Float_Input( 12, 0 + 24, 50, 24, "Tempo:" );
            fi->align( FL_ALIGN_TOP );
            fi->when( FL_WHEN_NOT_CHANGED | FL_WHEN_ENTER_KEY );
            fi->callback( &Tempo_Point_Editor::enter_cb, (void*)this );

            char pat[10];
            snprintf( pat, sizeof( pat ), "%.1f", *tempo );

            fi->value( pat );

            end();

            show();

            while ( shown() )
                Fl::wait();
        }
コード例 #27
0
gdBpmInput::gdBpmInput(const char *label)
: gWindow(144, 36, "Bpm") {

	if (G_Conf.bpmX)
		resize(G_Conf.bpmX, G_Conf.bpmY, w(), h());

	set_modal();

	input_a = new gInput(8,  8, 30, 20);
	input_b = new gInput(42, 8, 20, 20);
	ok 		  = new gClick(66, 8, 70, 20, "Ok");
	end();

	char   a[4];
	snprintf(a, 4, "%d", (int) G_Mixer.bpm);
	char   b[2];
	for (unsigned i=0; i<strlen(label); i++)	// looking for the dot
		if (label[i] == '.') {
			snprintf(b, 2, "%c", label[i+1]);
			break;
		}

	input_a->maximum_size(3);
	input_a->type(FL_INT_INPUT);
	input_a->value(a);
	input_b->maximum_size(1);
	input_b->type(FL_INT_INPUT);
	input_b->value(b);

	ok->shortcut(FL_Enter);
	ok->callback(cb_update_bpm, (void*)this);

	gu_setFavicon(this);
	setId(WID_BPM);
	show();
}
コード例 #28
0
WindowLoading::WindowLoading(Context* context)
        : Fl_Window(350, 140, _("Please Wait"))
{
    this->context = context;
    this->align(Fl_Align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE));

    progress_bar_dir = new Fl_Progress(20, 20, 320, 30, _("Scanning directories..."));
    progress_bar_dir->selection_color(DEFAULT_FOREGROUND_COLOR);

    progress_bar_file = new Fl_Progress(20, 70, 320, 30, _("Loading files..."));
    progress_bar_file->selection_color(DEFAULT_FOREGROUND_COLOR);

    Fl_Button* button_cancel = new Fl_Button(280, 110, 70, 25, _("Cancel"));
    util_adjust_width(button_cancel, 10);

    button_cancel->clear_visible_focus();
    button_cancel->callback([](Fl_Widget *w, void *u) {
        SignalCancelSync.emit();
    });

    SignalCancelSync.connect(sigc::mem_fun(this, &WindowLoading::cancel));

    set_modal();
}
コード例 #29
0
ファイル: tempopopup.cpp プロジェクト: Stazed/seq32
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);
}
コード例 #30
0
TransformObjectWindow::TransformObjectWindow(MainWindow* mainWindow, DrawableObject* object)
    : mainWindow(mainWindow),
      object(object),
      label_translation_x("Translate X:"),
      label_translation_y("Translate Y:"),
      label_translation_z("Translate Z:"),
      label_scale_sx("Scale X:"),
      label_scale_sy("Scale Y:"),
      label_scale_sz("Scale Z:"),
      label_rotate_axis("Rotate around:"),
      label_rotate_x("Point X:"),
      label_rotate_y("Point Y:"),
      label_rotate_z("Point Z:"),
      label_rotate_degree("Angle to rotate:"),
      label_rotate_point("Reference point:"),
      label_rotate_axis_x1("Axis X\u2081"),
      label_rotate_axis_y1("Axis Y\u2081"),
      label_rotate_axis_z1("Axis Z\u2081"),
      label_rotate_axis_x2("Axis X\u2082"),
      label_rotate_axis_y2("Axis Y\u2082"),
      label_rotate_axis_z2("Axis Z\u2082"),
      m_vbox(Gtk::ORIENTATION_VERTICAL),
      button_close("Close"),
      button_add_translation("Translate"),
      button_add_scale("Scale"),
      button_add_rotate("Rotate")
{
  set_title("Transform Object");
  set_border_width(12);
  set_resizable(false);

  add(m_vbox);

  m_vbox.pack_start(m_notebook);
  m_vbox.pack_start(button_close, Gtk::PACK_SHRINK);

  //Add translation grid
  translation_grid.set_column_homogeneous(true);
  translation_grid.set_row_spacing(10);
  translation_grid.set_column_spacing(10);
  translation_grid.attach(label_translation_x, 1, 1, 1, 1);
  translation_grid.attach(label_translation_y, 1, 2, 1, 1);
  translation_grid.attach(label_translation_z, 1, 3, 1, 1);
  translation_grid.attach(translation_x_field, 2, 1, 1, 1);
  translation_grid.attach(translation_y_field, 2, 2, 1, 1);
  translation_grid.attach(translation_z_field, 2, 3, 1, 1);
  translation_grid.attach(button_add_translation, 1, 4, 2, 1);
  translation_grid.set_border_width(10);

  //Add scale grid
  scale_grid.set_column_homogeneous(true);
  scale_grid.set_row_spacing(10);
  scale_grid.set_column_spacing(10);
  scale_grid.attach(label_scale_sx, 1, 1, 1, 1);
  scale_grid.attach(label_scale_sy, 1, 2, 1, 1);
  scale_grid.attach(label_scale_sz, 1, 3, 1, 1);
  scale_grid.attach(scale_sx_field, 2, 1, 1, 1);
  scale_grid.attach(scale_sy_field, 2, 2, 1, 1);
  scale_grid.attach(scale_sz_field, 2, 3, 1, 1);
  scale_grid.attach(button_add_scale, 1, 4, 2, 1);
  scale_grid.set_border_width(10);

  //Add rotate grid
  rotate_axis.append("X Axis");
  rotate_axis.append("Y Axis");
  rotate_axis.append("Z Axis");
  rotate_axis.append("Custom Axis");
  rotate_axis.set_active(0);
  rotate_axis.signal_changed().connect(
    sigc::mem_fun(*this, &TransformObjectWindow::on_rotate_axis_changed));
    rotate_grid.set_column_homogeneous(true);
  rotate_point.append("Object Center");
  rotate_point.append("World Center");
  rotate_point.append("Custom Point");
  rotate_point.set_active(0);
  rotate_point.signal_changed().connect(
    sigc::mem_fun(*this, &TransformObjectWindow::on_rotate_point_changed));
  rotate_grid.set_row_spacing(10);
  rotate_grid.set_column_spacing(10);
  rotate_grid.attach(label_rotate_degree, 1, 1, 2, 1);
  rotate_grid.attach(rotate_degree_field, 3, 1, 2, 1);
  rotate_grid.attach(label_rotate_axis, 1, 2, 2, 1);
  rotate_grid.attach(rotate_axis, 3, 2, 2, 1);
  rotate_grid.attach(label_rotate_point, 1, 6, 2, 1);
  rotate_grid.attach(rotate_point, 3, 6, 2, 1);
  rotate_grid.attach(button_add_rotate, 1, 10, 4, 1);
  rotate_grid.set_border_width(10);

  button_close.signal_clicked().connect(sigc::mem_fun(*this,
    &TransformObjectWindow::on_button_close));

  button_add_translation.signal_clicked().connect(sigc::mem_fun(*this,
    &TransformObjectWindow::on_button_translate));

  button_add_scale.signal_clicked().connect(sigc::mem_fun(*this,
    &TransformObjectWindow::on_button_scale));

  button_add_rotate.signal_clicked().connect(sigc::mem_fun(*this,
    &TransformObjectWindow::on_button_rotate));

  m_notebook.append_page(translation_grid, "Translate");
  m_notebook.append_page(scale_grid, "Scale");
  m_notebook.append_page(rotate_grid, "Rotate");

  set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);
  set_modal();
  set_transient_for(*mainWindow);

  show_all_children();
}