Sequencer: Update appearance, begin to use FL/ helpers.

This commit is contained in:
Jonathan Moore Liles 2012-03-04 22:36:46 -08:00
parent ca64e0fef8
commit 5672517caa
5 changed files with 41 additions and 69 deletions

View File

@ -73,7 +73,7 @@ include scripts/colors
SPACE+=" `tput cuf 20`" SPACE+=" `tput cuf 20`"
ifneq ($(CALCULATING),yes) ifneq ($(CALCULATING),yes)
COMPILING="$(BOLD)$(BLACK)$(PACKAGE)$(SPACE)$(SGR0)$(CYAN)`scripts/percent-complete .files "$<"`$(SGR0)$(BOLD)$(BLACK)]$(SGR0) $(BOLD)$(CYAN)$<$(SGR0)" COMPILING="$(BOLD)$(BLACK)[$(SGR0) $(PACKAGE)$(SPACE)$(SGR0)$(CYAN)`scripts/percent-complete .files "$<"` $(SGR0)$(BOLD)$(BLACK)]$(SGR0) $(BOLD)$(CYAN)$<$(SGR0)"
else else
COMPILING="Compiling: $<" COMPILING="Compiling: $<"
endif endif

View File

@ -31,7 +31,7 @@ const double TRANSPORT_POLL_INTERVAL = 0.05;
const char APP_NAME[] = "Non-Sequencer"; const char APP_NAME[] = "Non-Sequencer";
const char APP_TITLE[] = "The Non-Sequencer"; const char APP_TITLE[] = "The Non-Sequencer";
const char COPYRIGHT[] = "Copyright (c) 2007-2008 Jonathan Moore Liles"; const char COPYRIGHT[] = "Copyright (c) 2007-2012 Jonathan Moore Liles";
#define PACKAGE "non-sequencer" #define PACKAGE "non-sequencer"

View File

@ -28,6 +28,9 @@ decl {\#include <FL/Fl_Dial.H>} {public local
decl {\#include <FL/Fl_Help_Dialog.H>} {private local decl {\#include <FL/Fl_Help_Dialog.H>} {private local
} }
decl {\#include "FL/About_Dialog.H"} {private local
}
decl {\#include <FL/Fl_Shared_Image.H>} {private local decl {\#include <FL/Fl_Shared_Image.H>} {private local
} }
@ -134,11 +137,11 @@ class UI {open
} { } {
code {fl_register_images(); code {fl_register_images();
// Make her pretty // // Make her pretty
Fl::background( 32, 32, 32 ); // Fl::background( 32, 32, 32 );
Fl::background2( 36, 36, 36 ); // Fl::background2( 36, 36, 36 );
Fl::foreground( 255, 255, 255 ); // Fl::foreground( 255, 255, 255 );
Fl::scheme( "plastic" ); // Fl::scheme( "plastic" );
canvas_background_color = FL_GREEN; canvas_background_color = FL_GREEN;
@ -419,8 +422,20 @@ config.follow_playhead = val ? true : false;}
} }
MenuItem {} { MenuItem {} {
label {&About} label {&About}
callback {make_about_popup(); callback {
about_popup->show();}
About_Dialog ab( PIXMAP_PATH "/non-sequencer/icon-256x256.png" );
ab.logo_box->label( VERSION );
ab.title->label( "The Non Sequencer" );
ab.copyright->label( "Copyright (C) 2007-2012 Jonathan Moore Liles" );
ab.credits->label( "Non-Sequencer was written from scratch by\\nJonathan Moore Liles for his own use\\n(see the manual).\\n\\nNobody planned. Nobody helped.\\nYou can help now by donating time, money,\\nand/or replacing the rest of Linux Audio\\nwith fast, light, reliable alternatives.\\n" );
ab.website_url->label( "http://non-sequencer.tuxfamily.org" );
ab.run();}
xywh {0 0 40 25} color 37 xywh {0 0 40 25} color 37
code0 {\#include "../non.H"} code0 {\#include "../non.H"}
} }
@ -648,7 +663,7 @@ o->maximum( phrase::phrases() );}
Fl_Input pattern_name_field { Fl_Input pattern_name_field {
label {name:} label {name:}
callback {pattern_c->grid()->name( strdup( o->value() ) );} callback {pattern_c->grid()->name( strdup( o->value() ) );}
xywh {10 703 144 25} color 36 align 20 when 1 textcolor 32 xywh {10 703 144 25} color 0 align 20 when 1 textcolor 32
} }
Fl_Spinner pattern_number_spinner { Fl_Spinner pattern_number_spinner {
callback {pattern *p = ((pattern *)pattern_c->grid())->by_number( o->value() ); callback {pattern *p = ((pattern *)pattern_c->grid())->by_number( o->value() );
@ -1065,11 +1080,11 @@ if ( s != o->label() )
{ {
o->label( s ); o->label( s );
if ( ! strcmp( s, "INVALID" ) ) if ( ! strcmp( s, "INVALID" ) )
o->color( FL_RED ); o->color( fl_darker( FL_RED ) );
else else
o->color( FL_GREEN ); o->color( fl_darker( FL_GREEN ) );
}} }}
xywh {781 776 87 25} box UP_BOX align 64 xywh {781 776 87 25} box THIN_UP_BOX align 64
} }
} }
Fl_Group pan_indicators {open Fl_Group pan_indicators {open
@ -1108,58 +1123,6 @@ detach_button->value( 0 );} open
} {} } {}
} }
} }
Function {make_about_popup()} {open
} {
Fl_Window about_popup {
label About open
xywh {697 224 535 685} type Double non_modal size_range {535 685 535 685} visible
} {
Fl_Box {} {
label VERSION
xywh {10 16 515 307} align 16
code0 {o->label( VERSION );}
code1 {const char *logo_filename = PIXMAP_PATH "/icon-256x256.png";
o->image( Fl_Shared_Image::get( logo_filename ) );}
code2 {o->redraw();}
}
Fl_Group {} {open
xywh {20 361 488 272} box ROUNDED_BOX color 51
} {
Fl_Box {} {
label {Copyright (C) 2007-2008 Jonathan Moore Liles}
xywh {20 361 488 32} 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 {35 400 463 233} labelfont 1 labelsize 12 align 144
}
}
Fl_Button {} {
label {http://non.tuxfamily.org}
callback {\#if ! ( FL_MAJOR_VERSION >= 1 && FL_MINOR_VERSION >= 1 && FL_PATCH_VERSION >= 8 )
// FIXME: got a better idea?
system( "x-www-browser http://non.tuxfamily.org &" );
\#else
fl_open_uri( "http://non.tuxfamily.org" );
\#endif}
xywh {170 643 188 30} color 14 labeltype SHADOW_LABEL labelcolor 6
}
Fl_Return_Button {} {
label rock
callback {about_popup->hide();}
xywh {440 644 78 31}
}
Fl_Box {} {
label label
xywh {185 337 153 22} color 51 labelfont 4 labelcolor 52
code2 {o->label( "" );}
}
}
}
Function {make_randomization_dialog()} {} { Function {make_randomization_dialog()} {} {
Fl_Window randomization_dialog { Fl_Window randomization_dialog {
label {Randomization Settings} open label {Randomization Settings} open

View File

@ -89,10 +89,10 @@ widget_class Visual_Metronome {open selected
class Fl_Group visible class Fl_Group visible
} { } {
Fl_Slider progress { Fl_Slider progress {
private xywh {119 95 1149 23} type Horizontal box ROUNDED_BOX color 32 selection_color 71 private xywh {119 95 1149 23} type Horizontal box THIN_UP_BOX color 32 selection_color 71
code0 {o->resize( x(), (y() + h()) - (h() / 3), w(), h() / 3 );} code0 {o->resize( x(), (y() + h()) - (h() / 3), w(), h() / 3 );}
code1 {o->slider_size( 0.25 );} code1 {o->slider_size( 0.25 );}
code2 {o->slider( FL_ROUNDED_BOX );} code2 {o->slider( FL_THIN_UP_BOX );}
} }
Fl_Pack pack {open Fl_Pack pack {open
private xywh {119 7 1149 78} type HORIZONTAL resizable private xywh {119 7 1149 78} type HORIZONTAL resizable
@ -116,7 +116,7 @@ int bw = w() / _bpb;
for ( int i = 1; i <= b; ++i ) for ( int i = 1; i <= b; ++i )
{ {
Fl_Box *box = new Fl_Box( FL_ROUNDED_BOX, 0, 0, bw, 1, 0 ); Fl_Box *box = new Fl_Box( FL_THIN_UP_BOX, 0, 0, bw, 1, 0 );
char *pat = (char *)malloc( 4 ); char *pat = (char *)malloc( 4 );

View File

@ -38,6 +38,10 @@
#include "../icons/icon-16x16.xpm" #include "../icons/icon-16x16.xpm"
#endif #endif
#include "FL/color_scheme.H"
#include "FL/Crystal_Boxtypes.H"
#include "FL/Gleam_Boxtypes.H"
// extern const char *BUILD_ID; // extern const char *BUILD_ID;
// extern const char *VERSION; // extern const char *VERSION;
@ -261,12 +265,17 @@ main ( int argc, char **argv )
Fl::visual( FL_RGB ); Fl::visual( FL_RGB );
init_crystal_boxtypes();
init_gleam_boxtypes();
color_scheme( "dark" );
Fl::scheme( "plastic" );
ui = new UI; ui = new UI;
#ifdef HAVE_XPM #ifdef HAVE_XPM
ui->main_window->icon((char *)p); ui->main_window->icon((char *)p);
#endif #endif
ui->main_window->show( argc, argv ); ui->main_window->show( 0, 0 );
instance_name = strdup( APP_NAME ); instance_name = strdup( APP_NAME );