-Updated Options window to be constructed in the Gui(), and show()-n in callback
parent
2256193459
commit
ce41e5999d
62
src/gui.cxx
62
src/gui.cxx
|
@ -65,13 +65,14 @@ static void gui_static_read_rb(void* inst)
|
||||||
Fl::repeat_timeout( 1 / 30.f, &gui_static_read_rb, inst);
|
Fl::repeat_timeout( 1 / 30.f, &gui_static_read_rb, inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void option_controller_cb(Fl_Widget*,void* data)
|
||||||
void back_cb(Fl_Widget*,void* data) { ((Fl_Wizard*)data)->prev(); }
|
{
|
||||||
void next_cb(Fl_Widget*,void* data) { ((Fl_Wizard*)data)->next(); }
|
LUPPP_NOTE("%s","Controller cb");
|
||||||
void done_cb(Fl_Widget*,void* data) { ((Fl_Wizard*)data)->hide(); }
|
}
|
||||||
|
|
||||||
static void gui_header_callback(Fl_Widget *w, void *data)
|
static void gui_header_callback(Fl_Widget *w, void *data)
|
||||||
{
|
{
|
||||||
|
Gui* g = (Gui*)data;
|
||||||
if ( Fl::event_x() > 130 )
|
if ( Fl::event_x() > 130 )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -133,51 +134,19 @@ static void gui_header_callback(Fl_Widget *w, void *data)
|
||||||
}
|
}
|
||||||
else if ( strcmp(m->label(), "Options") == 0 )
|
else if ( strcmp(m->label(), "Options") == 0 )
|
||||||
{
|
{
|
||||||
Fl_Window* G_win = new Fl_Window(400,300,"Example Wizard");
|
g->showOptions();
|
||||||
Fl_Wizard* G_wiz = new Fl_Wizard(0,0,400,300);
|
|
||||||
|
|
||||||
// Wizard: page 1
|
|
||||||
{
|
|
||||||
Fl_Group *g = new Fl_Group(0,0,400,300);
|
|
||||||
Fl_Button *next = new Fl_Button(290,265,100,25,"Next"); next->callback(next_cb,(void*)G_wiz);
|
|
||||||
Fl_Multiline_Output *out = new Fl_Multiline_Output(10,30,400-20,300-80,"Welcome");
|
|
||||||
out->labelsize(20);
|
|
||||||
out->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
|
|
||||||
out->value("This is First page");
|
|
||||||
g->end();
|
|
||||||
}
|
|
||||||
// Wizard: page 2
|
|
||||||
{
|
|
||||||
Fl_Group *g = new Fl_Group(0,0,400,300);
|
|
||||||
Fl_Button *next = new Fl_Button(290,265,100,25,"Next"); next->callback(next_cb,(void*)G_wiz);
|
|
||||||
Fl_Button *back = new Fl_Button(180,265,100,25,"Back"); back->callback(back_cb,(void*)G_wiz);
|
|
||||||
Fl_Multiline_Output *out = new Fl_Multiline_Output(10,30,400-20,300-80,"Terms And Conditions");
|
|
||||||
out->labelsize(20);
|
|
||||||
out->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
|
|
||||||
out->value("This is the Second page");
|
|
||||||
g->end();
|
|
||||||
}
|
|
||||||
// Wizard: page 3
|
|
||||||
{
|
|
||||||
Fl_Group *g = new Fl_Group(0,0,400,300);
|
|
||||||
Fl_Button *done = new Fl_Button(290,265,100,25,"Finish");
|
|
||||||
Fl_Button *back = new Fl_Button(180,265,100,25,"Back"); back->callback(back_cb,(void*)G_wiz);
|
|
||||||
Fl_Multiline_Output *out = new Fl_Multiline_Output(10,30,400-20,300-80,"Finish");
|
|
||||||
out->labelsize(20);
|
|
||||||
out->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
|
|
||||||
out->value("This is the Last page");
|
|
||||||
g->end();
|
|
||||||
}
|
|
||||||
G_wiz->end();
|
|
||||||
G_win->end();
|
|
||||||
G_win->show();
|
|
||||||
}
|
}
|
||||||
else if ( strcmp(m->label(), "Quit") == 0 )
|
else if ( strcmp(m->label(), "Quit") == 0 )
|
||||||
{
|
{
|
||||||
gui->askQuit();
|
g->askQuit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Gui::showOptions()
|
||||||
|
{
|
||||||
|
optionWindow->show();
|
||||||
|
}
|
||||||
|
|
||||||
void Gui::selectLoadSample( int track, int scene )
|
void Gui::selectLoadSample( int track, int scene )
|
||||||
{
|
{
|
||||||
// FIXME: refactor
|
// FIXME: refactor
|
||||||
|
@ -244,6 +213,13 @@ Gui::Gui() :
|
||||||
master = new GMasterTrack(8 + i * 118, 40, 150, 600, "Master");
|
master = new GMasterTrack(8 + i * 118, 40, 150, 600, "Master");
|
||||||
|
|
||||||
window.end();
|
window.end();
|
||||||
|
|
||||||
|
|
||||||
|
// setup Options dialog
|
||||||
|
optionWindow = new Fl_Window(400,300,"Options");
|
||||||
|
Fl_Box* optionLabel = new Fl_Box(130, 25, 500, 20, "Options");
|
||||||
|
optionWindow->end();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GTrack* Gui::getTrack(int id)
|
GTrack* Gui::getTrack(int id)
|
||||||
|
|
|
@ -28,6 +28,8 @@ class Gui
|
||||||
int quit();
|
int quit();
|
||||||
void askQuit();
|
void askQuit();
|
||||||
|
|
||||||
|
void showOptions();
|
||||||
|
|
||||||
GTrack* getTrack(int id);
|
GTrack* getTrack(int id);
|
||||||
GMasterTrack* getMasterTrack(){return master;}
|
GMasterTrack* getMasterTrack(){return master;}
|
||||||
|
|
||||||
|
@ -42,6 +44,8 @@ class Gui
|
||||||
Fl_Double_Window window;
|
Fl_Double_Window window;
|
||||||
Fl_Box* box;
|
Fl_Box* box;
|
||||||
|
|
||||||
|
Fl_Window* optionWindow;
|
||||||
|
|
||||||
DiskReader* diskReader;
|
DiskReader* diskReader;
|
||||||
DiskWriter* diskWriter;
|
DiskWriter* diskWriter;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue