From 2bb7d737b92a251497e7d4de4b2b5883c68dc8c0 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 24 Jan 2010 15:54:32 -0600 Subject: [PATCH] Split About Dialog off into FL/ --- FL/About_Dialog.fl | 110 +++++++++++++++++++++++++++++++++++++++++++++ Mixer/Mixer.C | 10 +++++ Timeline/TLE.fl | 105 ++----------------------------------------- 3 files changed, 123 insertions(+), 102 deletions(-) create mode 100644 FL/About_Dialog.fl diff --git a/FL/About_Dialog.fl b/FL/About_Dialog.fl new file mode 100644 index 0000000..93d1c1a --- /dev/null +++ b/FL/About_Dialog.fl @@ -0,0 +1,110 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0110 +header_name {.H} +code_name {.C} +decl {\#include } {} + +decl {\#include } {} + +decl {\#include } {} + +Function {open_url( const char *url )} {open return_type void +} { + code {\#if ! ( FL_MAJOR_VERSION >= 1 && FL_MINOR_VERSION >= 1 && FL_PATCH_VERSION >= 8 ) + + // FIXME: got a better idea? + char cmd[256]; + snprintf( cmd, sizeof( cmd ), "x-www-browser '%s' &", url ); + system( cmd ); +\#else + fl_open_uri( url ); +\#endif} {} +} + +class About_Dialog {open +} { + Function {About_Dialog()} {} { + code {make_window();} {} + } + Function {run()} {return_type void + } { + code {window->show(); + +while ( window->shown() ) + Fl::wait(); + +delete window;} {} + } + Function {make_window()} {open private + } { + Fl_Window window { + label About + callback {o->hide(); + +if ( logo_box->image() ) +{ + ((Fl_Shared_Image*)logo_box->image())->release(); + logo_box->image( 0 ); +}} open selected + private xywh {1355 125 495 655} type Double xclass {Non-DAW} visible + } { + Fl_Tabs {} {open + xywh {0 264 497 392} + } { + Fl_Group {} { + label Credits open + xywh {2 293 492 362} + } { + Fl_Box {} { + label {Non-DAW was written from scratch by + Jonathan Moore Liles for his own use + (see the manual). + +Nobody planned. Nobody helped. + You can help now by donating time, money, +and/or replacing the rest of Linux Audio +with fast, light, reliable alternatives.} + xywh {39 322 418 262} box ROUNDED_BOX color 46 labelsize 18 + } + } + Fl_Group {} { + label License open + xywh {2 288 492 311} hide + } { + Fl_Box {} { + label {Copyright (C) 2008-2010 Jonathan Moore Liles} + xywh {43 302 410 37} labeltype SHADOW_LABEL labelfont 1 labelsize 18 + } + Fl_Box {} { + label {This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.} + xywh {10 351 475 233} box ROUNDED_BOX color 46 labelfont 1 labelsize 12 labelcolor 53 align 144 + } + } + } + Fl_Box logo_box { + label VERSION + private xywh {25 20 445 180} box ROUNDED_BOX color 48 labelfont 1 labelsize 18 align 16 + code0 {o->image( Fl_Shared_Image::get( INSTALL_PREFIX "/share/pixmaps/non-daw/logo.png" ) );} + code1 {o->label( VERSION );} + } + Fl_Return_Button {} { + label Rock + callback {o->window()->do_callback();} + xywh {400 614 76 30} + } + Fl_Button {} { + label {http://non-daw.tuxfamily.org} + callback {open_url( o->label() );} + xywh {125 614 245 30} color 14 labeltype SHADOW_LABEL labelcolor 6 + } + Fl_Box {} { + label {The Non DAW (Digital Audio Workstation)} + xywh {32 221 430 29} labeltype SHADOW_LABEL labelfont 3 labelsize 17 + } + } + } +} diff --git a/Mixer/Mixer.C b/Mixer/Mixer.C index 746cb83..5c7eae4 100644 --- a/Mixer/Mixer.C +++ b/Mixer/Mixer.C @@ -18,6 +18,7 @@ /*******************************************************************************/ /* This is the main mixer group. It contains and manages Mixer_Strips. */ +#include "const.h" #include "Mixer.H" #include "Mixer_Strip.H" @@ -33,6 +34,10 @@ #include "FL/Fl_Flowpack.H" #include "Project.H" #include "FL/Fl_Menu_Settings.H" +#include "About_Dialog.H" + +#include "util/file.h" + #include #include "debug.h" @@ -179,7 +184,12 @@ void Mixer::cb_menu(Fl_Widget* o) { Fl::scheme( Fl::scheme() ); } + else if ( ! strcmp( picked, "&Help/&About" ) ) + { + About_Dialog ab; + ab.run(); + } } void Mixer::cb_menu(Fl_Widget* o, void* v) { diff --git a/Timeline/TLE.fl b/Timeline/TLE.fl index 7391808..b20c3e1 100644 --- a/Timeline/TLE.fl +++ b/Timeline/TLE.fl @@ -51,7 +51,8 @@ decl {\#include } {} decl {\#include } {} -decl {\#include } {} +decl {\#include } {selected +} decl {\#include } {} @@ -59,7 +60,7 @@ decl {\#include "Engine/Engine.H"} {} decl {\#include "Engine/Audio_File.H" // for supported formats} {} -decl {class About_Dialog;} {} +decl {\#include "FL/About_Dialog.H"} {} decl {extern char project_display_name[256];} {global } @@ -1001,103 +1002,3 @@ window->do_callback();} } } } - -class About_Dialog {} { - Function {About_Dialog()} {} { - code {make_window();} {} - } - Function {run()} {return_type void - } { - code {window->show(); - -while ( window->shown() ) - Fl::wait(); - -delete window;} {} - } - Function {make_window()} {open private - } { - Fl_Window window { - label About - callback {o->hide(); - -if ( logo_box->image() ) -{ - ((Fl_Shared_Image*)logo_box->image())->release(); - logo_box->image( NULL ); -}} open - private xywh {1346 98 495 655} type Double xclass {Non-DAW} visible - } { - Fl_Tabs {} {open - xywh {0 264 497 392} - } { - Fl_Group {} { - label Credits open - xywh {2 293 492 362} - } { - Fl_Box {} { - label {Non-DAW was written from scratch by - Jonathan Moore Liles for his own use - (see the manual). - -Nobody planned. Nobody helped. - You can help now by donating time, money, -and/or replacing the rest of Linux Audio -with fast, light, reliable alternatives.} - xywh {39 322 418 262} box ROUNDED_BOX color 46 labelsize 18 - } - } - Fl_Group {} { - label License open - xywh {2 288 492 311} hide - } { - Fl_Box {} { - label {Copyright (C) 2008-2010 Jonathan Moore Liles} - xywh {43 302 410 37} labeltype SHADOW_LABEL labelfont 1 labelsize 18 - } - Fl_Box {} { - label {This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.} - xywh {10 351 475 233} box ROUNDED_BOX color 46 labelfont 1 labelsize 12 labelcolor 53 align 144 - } - } - } - Fl_Box logo_box { - label VERSION - private xywh {25 20 445 180} box ROUNDED_BOX color 48 labelfont 1 labelsize 18 align 16 - code0 {o->image( Fl_Shared_Image::get( INSTALL_PREFIX "/share/pixmaps/non-daw/logo.png" ) );} - code1 {o->label( VERSION );} - } - Fl_Return_Button {} { - label Rock - callback {o->window()->do_callback();} - xywh {400 614 76 30} - } - Fl_Button {} { - label {http://non-daw.tuxfamily.org} - callback {open_url( o->label() );} - xywh {125 614 245 30} color 14 labeltype SHADOW_LABEL labelcolor 6 - } - Fl_Box {} { - label {The Non DAW (Digital Audio Workstation)} - xywh {32 221 430 29} labeltype SHADOW_LABEL labelfont 3 labelsize 17 - } - } - } -} - -Function {open_url( const char *url )} {open return_type void -} { - code {\#if ! ( FL_MAJOR_VERSION >= 1 && FL_MINOR_VERSION >= 1 && FL_PATCH_VERSION >= 8 ) - - // FIXME: got a better idea? - char cmd[256]; - snprintf( cmd, sizeof( cmd ), "x-www-browser '%s' &", url ); - system( cmd ); -\#else - fl_open_uri( url ); -\#endif} {} -}