From 488f27d1ebe7a309f38643e6b71236d494201153 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 1 May 2007 20:20:21 +0000 Subject: STR #1652: allowing shortcuts in tabs git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5791 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Tabs.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx index 235826d2c..7260de4df 100644 --- a/src/Fl_Tabs.cxx +++ b/src/Fl_Tabs.cxx @@ -50,6 +50,9 @@ int Fl_Tabs::tab_positions(int* p, int* wp) { int selected = 0; Fl_Widget*const* a = array(); int i; + char prev_draw_shortcut = fl_draw_shortcut; + fl_draw_shortcut = 1; + p[0] = Fl::box_dx(box()); for (i=0; itest_shortcut(c->label())) { + char sc = !c->visible(); + value(c); + if (sc) set_changed(); + do_callback(); + return 1; + } + } + return Fl_Group::handle(event); case FL_SHOW: value(); // update visibilities and fall through default: @@ -309,6 +327,9 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) { int sel = (what == SELECTED); int dh = Fl::box_dh(box()); int dy = Fl::box_dy(box()); + char prev_draw_shortcut = fl_draw_shortcut; + fl_draw_shortcut = 1; + Fl_Boxtype bt = (o==push_ &&!sel) ? fl_down(box()) : box(); // compute offsets to make selected tab look bigger @@ -367,6 +388,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) { fl_pop_clip(); } + fl_draw_shortcut = prev_draw_shortcut; } Fl_Tabs::Fl_Tabs(int X,int Y,int W, int H, const char *l) : -- cgit v1.2.3