changeset 1875:d7dc24f8cdfb

prevent new Fl_Widgets from automatically being added to a Fl_Group
author corvid <corvid@lavabit.com>
date Sun, 23 Jan 2011 23:28:22 +0000
parents 4fe10b101393
children 73336563b6e7
files dw/fltkcomplexbutton.cc dw/fltkviewbase.cc src/findbar.cc src/uicmd.cc
diffstat 4 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/dw/fltkcomplexbutton.cc	Sun Jan 23 18:55:28 2011 +0000
+++ b/dw/fltkcomplexbutton.cc	Sun Jan 23 23:28:22 2011 +0000
@@ -168,6 +168,7 @@
  */
 ComplexButton::ComplexButton(int X, int Y, int W, int H, const char *L)
 : Fl_Group(X,Y,W,H,L) {
+  Fl_Group::current(0);
   box(FL_UP_BOX);
   down_box(FL_NO_BOX);
   value_ = oldval = 0;
--- a/dw/fltkviewbase.cc	Sun Jan 23 18:55:28 2011 +0000
+++ b/dw/fltkviewbase.cc	Sun Jan 23 23:28:22 2011 +0000
@@ -41,6 +41,7 @@
 FltkViewBase::FltkViewBase (int x, int y, int w, int h, const char *label):
    Fl_Group (x, y, w, h, label)
 {
+   Fl_Group::current(0);
    canvasWidth = 1;
    canvasHeight = 1;
    bgColor = FL_WHITE;
--- a/src/findbar.cc	Sun Jan 23 18:55:28 2011 +0000
+++ b/src/findbar.cc	Sun Jan 23 23:28:22 2011 +0000
@@ -113,18 +113,21 @@
    int border = 2;
    int input_width = width - (2 * border + 4 * (button_width + gap));
    int x = border;
+
+   Fl_Group::current(0);
+
    height -= 2 * border;
 
    box(FL_PLASTIC_UP_BOX);
    Fl_Group::hide();
 
-   begin();
     hide_btn = new Fl_Button(x, border, 16, height, 0);
     hideImg = new Fl_Pixmap(new_s_xpm);
     hide_btn->image(hideImg);
     x += 16 + gap;
     hide_btn->callback(hide_cb, this);
     hide_btn->clear_visible_focus();
+   add(hide_btn);
 
     i = new MyInput(x, border, input_width, height);
     x += input_width + gap;
@@ -132,25 +135,27 @@
     i->color(206);
     i->when(FL_WHEN_ENTER_KEY_ALWAYS);
     i->callback(search_cb2, this);
+   add(i);
 
     next_btn = new Fl_Button(x, border, button_width, height, "Next");
     x += button_width + gap;
     next_btn->shortcut(FL_Enter);
     next_btn->callback(search_cb, this);
     next_btn->clear_visible_focus();
+   add(next_btn);
 
     prev_btn= new Fl_Button(x, border, button_width, height, "Previous");
+    x += button_width + gap;
     prev_btn->shortcut(FL_SHIFT+FL_Enter);
     prev_btn->callback(searchBackwards_cb, this);
     prev_btn->clear_visible_focus();
-    x += button_width + gap;
+   add(prev_btn);
 
     check_btn = new Fl_Check_Button(x, border, 2*button_width, height,
                               "Case-sensitive");
-    check_btn->clear_visible_focus();
     x += 2 * button_width + gap;
-
-   end();
+    check_btn->clear_visible_focus();
+   add(check_btn);
 
    if (prefs.show_tooltip) {
       hide_btn->tooltip("Hide");
--- a/src/uicmd.cc	Sun Jan 23 18:55:28 2011 +0000
+++ b/src/uicmd.cc	Sun Jan 23 23:28:22 2011 +0000
@@ -232,6 +232,7 @@
 public:
    CustTabGroup (int x, int y, int ww, int wh, const char *lbl=0) :
       Fl_Tabs(x,y,ww,wh,lbl) {
+         Fl_Group::current(0);
          // The parameter pager is cloned, so free it.
 //       CustShrinkTabPager *cp = new CustShrinkTabPager();
 //       this->pager(cp);
@@ -427,6 +428,7 @@
    else
       win = new Fl_Double_Window(ww, wh);
 
+   Fl_Group::current(0);
 //may need a handler for this
 // win->shortcut(0); // Ignore Escape
    CustTabGroup *DilloTabs = new CustTabGroup(0, 0, ww, wh);