summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien Costantini <fabien@onepost.net>2009-01-03 15:44:06 +0000
committerFabien Costantini <fabien@onepost.net>2009-01-03 15:44:06 +0000
commit8a53f05688f2187c7b88b62cabdcd78847ab9e55 (patch)
treeacbfba0330fcbd8924217e27730e92ad86c8c687
parentd7e4bfe77779e298be0c3a1951848559a9aa46de (diff)
STR50 fix attemp. Added a new check_redraw_corresponding_parent() function to redraw the corresponding tab of a Fl_Tabs or Fl_Wizard group. tested with single, multiple selection. Compared to the proposed patch this version only add one function similar to redraw_overlays() without modifying the Fl_Type class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6621 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--fluid/Fl_Widget_Type.cxx2
-rw-r--r--fluid/Fl_Window_Type.cxx16
2 files changed, 18 insertions, 0 deletions
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx
index 729769d86..8fe4c9edf 100644
--- a/fluid/Fl_Widget_Type.cxx
+++ b/fluid/Fl_Widget_Type.cxx
@@ -1808,6 +1808,7 @@ void Fl_Widget_Type::open() {
Fl_Type *Fl_Type::current;
extern void redraw_overlays();
+extern void check_redraw_corresponding_parent(Fl_Type*);
extern void redraw_browser();
extern void update_sourceview_position();
@@ -1839,6 +1840,7 @@ void selection_changed(Fl_Type *p) {
}
if (!p || !p->selected) p = q;
Fl_Type::current = p;
+ check_redraw_corresponding_parent(p);
redraw_overlays();
// load the panel with the new settings:
load_panel();
diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx
index c4613a9bf..3b766f081 100644
--- a/fluid/Fl_Window_Type.cxx
+++ b/fluid/Fl_Window_Type.cxx
@@ -1065,6 +1065,22 @@ void Fl_Window_Type::fix_overlay() {
((Overlay_Window *)(this->o))->redraw_overlay();
}
+// check if we must redraw any parent of tabs/wizard type
+void check_redraw_corresponding_parent(Fl_Type *s) {
+ Fl_Widget_Type * prev_parent = 0;
+ if( !s || !s->selected || !s->is_widget()) return;
+ for (Fl_Type *i=s; i && i->parent; i=i->parent) {
+ if (i->is_group() && prev_parent &&
+ (!strcmp(i->type_name(), "Fl_Tabs") ||
+ !strcmp(i->type_name(), "Fl_Wizard"))) {
+ ((Fl_Tabs*)((Fl_Widget_Type*)i)->o)->value(prev_parent->o);
+ return;
+ }
+ if (i->is_group() && s->is_widget())
+ prev_parent = (Fl_Widget_Type*)i;
+ }
+}
+
// do that for every window (when selected set changes):
void redraw_overlays() {
for (Fl_Type *o=Fl_Type::first; o; o=o->next)