From bcb8e5205cb3a3477a5fdaa379c79f9dc73656eb Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Fri, 29 Feb 2008 18:06:05 -0600 Subject: [PATCH] Get rid of fluid file for Track_Header widget, as fluid doesn't allow us multiple inheritance on widget classes. --- Region.C | 2 +- Timeline.C | 1 + Track_Header.C | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ Track_Header.H | 69 ++++++++++++++++++++++++++++++++++ Track_Header.fl | 55 --------------------------- 5 files changed, 170 insertions(+), 56 deletions(-) create mode 100644 Track_Header.C create mode 100644 Track_Header.H delete mode 100644 Track_Header.fl diff --git a/Region.C b/Region.C index 6b5e06e..6b090ea 100644 --- a/Region.C +++ b/Region.C @@ -36,7 +36,7 @@ using namespace std; extern Timeline *timeline; -Fl_Boxtype Region::_box = FL_PLASTIC_UP_BOX; +Fl_Boxtype Region::_box = FL_UP_BOX; Fl_Color Region::_selection_color = FL_MAGENTA; diff --git a/Timeline.C b/Timeline.C index cb418d7..2ab9c1a 100644 --- a/Timeline.C +++ b/Timeline.C @@ -161,6 +161,7 @@ Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Group( X, // o->end(); t->track( o ); + t->color( FL_GREEN ); } tracks = o; diff --git a/Track_Header.C b/Track_Header.C new file mode 100644 index 0000000..92b0a86 --- /dev/null +++ b/Track_Header.C @@ -0,0 +1,99 @@ + +/*******************************************************************************/ +/* Copyright (C) 2008 Jonathan Moore Liles */ +/* */ +/* 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; see the file COPYING. If not,write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/*******************************************************************************/ + +#include "Track_Header.H" + +Track_Header::Track_Header ( int X, int Y, int W, int H, const char *L ) : + Fl_Group ( X, Y, W, H, L ) +{ + Track_Header *o = this; + o->box( FL_THIN_UP_BOX ); + { + Fl_Group *o = new Fl_Group( 2, 2, 149, 113 ); + o->color( ( Fl_Color ) 53 ); + { + Fl_Group *o = new Fl_Group( 4, 4, 144, 66 ); + { + Fl_Input *o = name_field = new Fl_Input( 4, 9, 144, 25 ); + o->color( ( Fl_Color ) 33 ); + o->labeltype( FL_NO_LABEL ); + o->labelcolor( FL_GRAY0 ); + o->textcolor( 32 ); + } + { + Fl_Button *o = record_button = + new Fl_Button( 6, 38, 26, 27, "@circle" ); + o->type( 1 ); + o->box( FL_ROUNDED_BOX ); + o->color( FL_LIGHT1 ); + o->labelsize( 8 ); + } + { + Fl_Button *o = mute_button = + new Fl_Button( 35, 38, 26, 27, "m" ); + o->type( 1 ); + o->box( FL_ROUNDED_BOX ); + o->color( FL_LIGHT1 ); + o->labelsize( 11 ); + } + { + Fl_Button *o = solo_button = + new Fl_Button( 66, 38, 26, 27, "s" ); + o->type( 1 ); + o->box( FL_ROUNDED_BOX ); + o->color( FL_LIGHT1 ); + o->labelsize( 11 ); + } + { + Fl_Menu_Button *o = take_menu = + new Fl_Menu_Button( 97, 38, 47, 27, "T" ); + o->box( FL_ROUNDED_BOX ); + o->color( FL_LIGHT1 ); + o->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE ); + } + o->end(); + } + o->size( Track_Header::width(), o->h() ); + o->end(); + } + { + Fl_Pack *o = takes = new Fl_Pack( 150, 0, 1006, 115 ); + o->labeltype( FL_NO_LABEL ); + o->align( FL_ALIGN_CLIP ); + o->resize( x() + width(), y(), w() - width(), h() ); + o->end(); + Fl_Group::current()->resizable( o ); + } + end(); +} + +int +Track_Header::width() +{ + return 150; +} + +void +Track_Header::track( Track * t ) +{ + _track = t; + + t->size( 1, takes->h() ); + takes->add( t ); +} diff --git a/Track_Header.H b/Track_Header.H new file mode 100644 index 0000000..0e4163b --- /dev/null +++ b/Track_Header.H @@ -0,0 +1,69 @@ + +/*******************************************************************************/ +/* Copyright (C) 2008 Jonathan Moore Liles */ +/* */ +/* 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; see the file COPYING. If not,write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/*******************************************************************************/ + +#ifndef Track_Header_H +#define Track_Header_H +#include +#include "Track.H" +#include +#include +#include +#include +#include + +#include "Loggable.H" + +class Track_Header : public Fl_Group, public Loggable +{ + +public: + + Track_Header( int X, int Y, int W, int H, const char *L = 0 ); + +private: + Track * _track; + +public: + + Fl_Input * name_field; + Fl_Button *record_button; + Fl_Button *mute_button; + Fl_Button *solo_button; + Fl_Menu_Button *take_menu; + + Fl_Pack *takes; + + const char *class_name ( void ) { return "Track_Header"; } + + void set ( char **sa ) + { + return; + } + + char ** get ( void ) + { + return NULL; + } + + static int width(); + + void track( Track * t ); + +}; +#endif diff --git a/Track_Header.fl b/Track_Header.fl deleted file mode 100644 index c2f75f8..0000000 --- a/Track_Header.fl +++ /dev/null @@ -1,55 +0,0 @@ -# data file for the Fltk User Interface Designer (fluid) -version 1.0107 -header_name {.H} -code_name {.C} -decl {\#include "Track.H"} {public -} - -widget_class Track_Header {open - xywh {383 446 1156 116} type Double box THIN_UP_BOX resizable visible -} { - Function {width()} {open return_type {static int} - } { - code {return 150;} {} - } - decl {Track *_track;} {} - Fl_Group {} {open - xywh {2 2 149 113} color 53 - code0 {o->size( Track_Header::width(), o->h() );} - } { - Fl_Group {} {open - xywh {4 4 144 66} - } { - Fl_Input name_field { - xywh {4 9 144 25} color 33 labeltype NO_LABEL labelcolor 32 textcolor 32 - } - Fl_Button record_button { - label {@circle} - xywh {6 38 26 27} type Toggle box ROUNDED_BOX color 50 labelsize 8 - } - Fl_Button mute_button { - label m - xywh {35 38 26 27} type Toggle box ROUNDED_BOX color 50 labelsize 11 - } - Fl_Button solo_button { - label s - xywh {66 38 26 27} type Toggle box ROUNDED_BOX color 50 labelsize 11 - } - Fl_Menu_Button take_menu { - label T open - xywh {97 38 47 27} box ROUNDED_BOX color 50 align 20 - } {} - } - } - Fl_Pack takes {open selected - xywh {150 0 1006 115} labeltype NO_LABEL align 64 resizable - code0 {o->resize( x() + width(), y(), w() - width(), h() );} - } {} - Function {track( Track *t )} {open return_type void - } { - code {_track = t; - -t->size( 1, takes->h() ); -takes->add( t );} {} - } -}