It's not working fine, when the live_widget is a window the live_widget
covers the scrollbars when resized to a small size.
Some things I don't understand:
-Why the live mode window doesn't have the close/maximize buttons.
-Why we need a button to close live view.
The modified live_mode_cb bellow remove the "Close live vie" button and
it appears to works fine closing the window by pressing ESC key, could
be fine if the close standard window button be there to close with the
mouse too.
But still it's not the final solution.
----
void live_mode_cb(Fl_Button*o,void *) {
/// \todo live mode should end gracefully when the application quits
/// or when the user closes the live widget
static Fl_Type *live_type = 0L;
static Fl_Widget *live_widget = 0L;
static Fl_Window *live_window = 0L;
// if 'o' is 0, we must quit live mode
if (!o) {
o = wLiveMode;
o->value(0);
}
if (o->value()) {
if (numselected == 1) {
live_widget = current_widget->enter_live_mode(1);
if (live_widget) {
live_type = current_widget;
Fl_Group::current(0);
int w = live_widget->w();
int h = live_widget->h();
//live_window = new Fl_Double_Window(w+20, h+55, "Fluid Live
Mode Widget");
live_window = new Fl_Double_Window(w+20, h+20, "Fluid Live Mode
Widget");
//live_window->box(FL_FLAT_BOX);
//live_window->color(FL_GREEN);
Fl_Scroll *dsa = new Fl_Scroll(
live_window->x(), live_window->y(),
live_window->w(), live_window->h());
dsa->box(FL_FLAT_BOX);
dsa->color(FL_GREEN);
/*
Fl_Group *rsz = new Fl_Group(0, h+20, 130, 35);
rsz->box(FL_NO_BOX);
Fl_Box *rsz_dummy = new Fl_Box(110, h+20, 1, 25);
rsz_dummy->box(FL_NO_BOX);
rsz->resizable(rsz_dummy);
Fl_Button *btn = new Fl_Button(10, h+20, 100, 25, "Exit Live
Mode");
btn->labelsize(12);
btn->callback(leave_live_mode_cb);
*/
live_widget->position(10, 10);
live_window->resizable(dsa);
dsa->add(live_widget);
//live_window->add(live_widget);
//live_window->resizable(live_widget);
live_window->set_modal(); // block all other UI
live_window->callback(leave_live_mode_cb);
/*
if (current_widget->is_window()) {
Fl_Window_Type *w = (Fl_Window_Type*)current_widget;
int mw = w->sr_min_w; if (mw>0) mw += 20;
int mh = w->sr_min_h; if (mh>0) mh += 55;
int MW = w->sr_max_w; if (MW>0) MW += 20;
int MH = w->sr_max_h; if (MH>2) MH += 55;
if (mw || mh || MW || MH)
live_window->size_range(mw, mh, MW, MH);
}
*/
dsa->end();
live_window->show();
} else o->value(0);
} else o->value(0);
} else {
if (live_type)
live_type->leave_live_mode();
if (live_window) {
live_window->hide();
Fl::delete_widget(live_window);
}
live_type = 0L;
live_widget = 0L;
live_window = 0L;
}
}
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev