From 1c39a1dc2a65dca32c629c37fd40157fa7f304b3 Mon Sep 17 00:00:00 2001 From: EvanR Date: Thu, 15 Jan 2009 09:32:24 -0600 Subject: [PATCH] Floppy button resets after choosing menu option. --- src/ui.cpp | 7 +++++++ src/ui.fl | 16 +++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/ui.cpp b/src/ui.cpp index 25f83a6..af6ed24 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -492,6 +492,7 @@ void UI::cb_action_window(fltk::Window* o, void* v) { inline void UI::cb_new1_i(fltk::Button*, void*) { reset_song(); + ui->file_button->state(0); } void UI::cb_new1(fltk::Button* o, void* v) { ((UI*)(o->parent()->user_data()))->cb_new1_i(o,v); @@ -499,6 +500,7 @@ void UI::cb_new1(fltk::Button* o, void* v) { inline void UI::cb_save_i(fltk::Button*, void*) { action_window->hide(); + ui->file_button->state(0); save(); } void UI::cb_save(fltk::Button* o, void* v) { @@ -507,6 +509,7 @@ void UI::cb_save(fltk::Button* o, void* v) { inline void UI::cb_save1_i(fltk::Button*, void*) { action_window->hide(); + ui->file_button->state(0); save(fltk::file_chooser("save file",NULL,get_last_dir())); } void UI::cb_save1(fltk::Button* o, void* v) { @@ -515,6 +518,7 @@ void UI::cb_save1(fltk::Button* o, void* v) { inline void UI::cb_load_i(fltk::Button*, void*) { action_window->hide(); + ui->file_button->state(0); if(load(fltk::file_chooser("open file",NULL,get_last_dir()))<0){ reset_song(); } @@ -525,6 +529,7 @@ void UI::cb_load(fltk::Button* o, void* v) { inline void UI::cb_import_i(fltk::Button*, void*) { action_window->hide(); + ui->file_button->state(0); if(loadsmf(fltk::file_chooser("import file",NULL,get_last_dir()))<0){ reset_song(); } @@ -535,6 +540,7 @@ void UI::cb_import(fltk::Button* o, void* v) { inline void UI::cb_export_i(fltk::Button*, void*) { action_window->hide(); + ui->file_button->state(0); savesmf(fltk::file_chooser("export file",NULL,get_last_dir())); } void UI::cb_export(fltk::Button* o, void* v) { @@ -1201,6 +1207,7 @@ track."); o->callback((fltk::Callback*)cb_export); } o->end(); + o->resizable(o); } {fltk::Window* o = scope_window = new fltk::Window(425, 280, "scope"); w = o; diff --git a/src/ui.fl b/src/ui.fl index 39eb087..d325739 100644 --- a/src/ui.fl +++ b/src/ui.fl @@ -273,7 +273,7 @@ ui->event_edit->redraw();} } } } - {fltk::Group} {} {selected + {fltk::Group} {} {open xywh {0 445 640 35} box UP_BOX } { {fltk::Button} play_button { @@ -885,29 +885,33 @@ o->hide();} {fltk::Window} action_window { label menu callback {ui->file_button->state(0); -o->hide();} - xywh {286 302 100 130} horizontal hide +o->hide();} open + xywh {286 302 100 130} horizontal resizable visible } { {fltk::Button} {} { label new - callback {reset_song();} + callback {reset_song(); +ui->file_button->state(0);} xywh {5 5 90 20} } {fltk::Button} {} { label save callback {action_window->hide(); +ui->file_button->state(0); save();} xywh {5 25 90 20} } {fltk::Button} {} { label {save as} callback {action_window->hide(); +ui->file_button->state(0); save(fltk::file_chooser("save file",NULL,get_last_dir()));} xywh {5 45 90 20} } {fltk::Button} {} { label load callback {action_window->hide(); +ui->file_button->state(0); if(load(fltk::file_chooser("open file",NULL,get_last_dir()))<0){ reset_song(); }} @@ -916,6 +920,7 @@ if(load(fltk::file_chooser("open file",NULL,get_last_dir()))<0){ {fltk::Button} {} { label import callback {action_window->hide(); +ui->file_button->state(0); if(loadsmf(fltk::file_chooser("import file",NULL,get_last_dir()))<0){ reset_song(); }} @@ -924,7 +929,8 @@ if(loadsmf(fltk::file_chooser("import file",NULL,get_last_dir()))<0){ {fltk::Button} {} { label export callback {action_window->hide(); -savesmf(fltk::file_chooser("export file",NULL,get_last_dir()));} +ui->file_button->state(0); +savesmf(fltk::file_chooser("export file",NULL,get_last_dir()));} selected xywh {5 105 90 20} } } -- 2.11.4.GIT