From 98ee848915c30e68966a17cbfc048d8d31df7b35 Mon Sep 17 00:00:00 2001 From: EvanR Date: Sun, 4 Jan 2009 23:52:22 -0600 Subject: [PATCH] Replaced horizontal scroll bars with thumbwheels. The reasoning is that there is no limit to how far you can scroll to the right in the song view or pattern editor. --- src/ui.cpp | 9 ++++++--- src/ui.fl | 16 ++++++++-------- src/ui.h | 6 ++++-- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/ui.cpp b/src/ui.cpp index d9e02a9..0f0d471 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -497,7 +497,10 @@ UI::UI() { {fltk::Scrollbar* o = song_vscroll = new fltk::Scrollbar(370, 0, 15, 415); o->set_vertical(); } - song_hscroll = new fltk::Scrollbar(0, 415, 370, 15); + {fltk::ThumbWheel* o = song_hscroll = new fltk::ThumbWheel(0, 415, 370, 15); + o->maximum(10000); + o->step(10); + } o->end(); fltk::Group::current()->resizable(o); } @@ -523,10 +526,10 @@ UI::UI() { o->box(fltk::FLAT_BOX); fltk::Group::current()->resizable(o); } - new fltk::Scrollbar(0, 340, 580, 15); - {fltk::Scrollbar* o = new fltk::Scrollbar(580, 0, 15, 340); + {fltk::Scrollbar* o = pattern_vscroll = new fltk::Scrollbar(580, 0, 15, 340); o->set_vertical(); } + pattern_hscroll = new fltk::ThumbWheel(0, 340, 580, 15); o->end(); fltk::Group::current()->resizable(o); } diff --git a/src/ui.fl b/src/ui.fl index 21b9f83..31c23d7 100644 --- a/src/ui.fl +++ b/src/ui.fl @@ -98,7 +98,7 @@ o->label_scale=4;} class Timeline } } - {fltk::Group} song_scrollgroup {open + {fltk::Group} song_scrollgroup { xywh {255 15 385 430} resizable } { {fltk::Widget} arranger { @@ -111,8 +111,8 @@ o->label_scale=4;} {fltk::Scrollbar} song_vscroll { xywh {370 0 15 415} } - {fltk::Scrollbar} song_hscroll { - xywh {0 415 370 15} + {fltk::ThumbWheel} song_hscroll { + xywh {0 415 370 15} maximum 10000 step 10 } } } @@ -137,17 +137,17 @@ o->edit_flag = 1;} xywh {0 15 595 355} resizable } { {fltk::Widget} piano_roll { - label pianoroll selected + label pianoroll xywh {0 0 580 340} resizable box FLAT_BOX extra_code {\#include "pianoroll.h"} class PianoRoll } - {fltk::Scrollbar} {} { - xywh {0 340 580 15} - } - {fltk::Scrollbar} {} { + {fltk::Scrollbar} pattern_vscroll { xywh {580 0 15 340} } + {fltk::ThumbWheel} pattern_hscroll {selected + xywh {0 340 580 15} + } } {fltk::Group} {} { xywh {0 370 595 75} diff --git a/src/ui.h b/src/ui.h index 70b4f93..27d31f3 100644 --- a/src/ui.h +++ b/src/ui.h @@ -12,6 +12,7 @@ #include #include "arranger.h" #include +#include #include "timeline.h" #include "pianoroll.h" #include "eventedit.h" @@ -24,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -51,11 +51,13 @@ public: fltk::Group *song_scrollgroup; Arranger *arranger; fltk::Scrollbar *song_vscroll; - fltk::Scrollbar *song_hscroll; + fltk::ThumbWheel *song_hscroll; fltk::Group *pattern_edit; Timeline *pattern_timeline; fltk::Group *pattern_scrollgroup; PianoRoll *piano_roll; + fltk::Scrollbar *pattern_vscroll; + fltk::ThumbWheel *pattern_hscroll; EventEdit *event_edit; EventMenu *event_menu; fltk::Button *event_menu_button; -- 2.11.4.GIT