+2002-10-04 Angus Leeming <leeming@lyx.org>
+
+ * form_graphics.fd: un-cripple dialog by reverting yesterday's change.
+
+ * FeedbackController.C (PrehandlerCB): reduce the necessary calcs to the
+ bare minimum.
+
+ * combox.[Ch]: the optional tabfolder args passed to the c-tor are
+ no longer necessary and are scrapped.
+ (show): use the same, minimal fix as in PrehandlerCB to ensure that
+ the form's x,y coords are up to date. In truth, this fix should be
+ redundant, but not all "enter" events are caught by the prehandler.
+
+ * FormDocument.C (build):
+ * FormPreferences.C (xyz::build): no longer pass the tabfolder to the
+ combox c-tor.
+
2002-10-03 Angus Leeming <leeming@lyx.org>
* FeedbackController.C (PrehandlerCB): re-compute the folder->x,
// It updates the form->x, form->y coords of the active
// tabfolder when the mouse enters.
FL_FORM * const form = fl_get_active_folder(ob);
- Window win = fl_prepare_form_window(form, 0, 0, "Folder");
- if (win) {
+ if (form->window) {
FL_Coord w, h;
- fl_get_wingeometry(win, &(form->x), &(form->y), &w, &h);
+ fl_get_wingeometry(form->window,
+ &(form->x), &(form->y), &w, &h);
}
} else if (message_widget_ &&
fl_deactivate_object(obj);
fl_addto_form(class_->form);
combo_doc_class.reset(new Combox(FL_COMBOX_DROPLIST));
- combo_doc_class->add(obj->x, obj->y, obj->w, obj->h, 400,
- dialog_->tabfolder);
+ combo_doc_class->add(obj->x, obj->y, obj->w, obj->h, 400);
combo_doc_class->shortcut("#C",1);
combo_doc_class->setcallback(ComboInputCB, this);
fl_end_form();
fl_deactivate_object(obj);
fl_addto_form(language_->form);
combo_language.reset(new Combox(FL_COMBOX_DROPLIST));
- combo_language->add(obj->x, obj->y, obj->w, obj->h, 400,
- dialog_->tabfolder);
+ combo_language->add(obj->x, obj->y, obj->w, obj->h, 400);
combo_language->shortcut("#L",1);
combo_language->setcallback(ComboInputCB, this);
fl_end_form();
FL_OBJECT * obj = dialog_->choice_default_lang;
fl_deactivate_object(dialog_->choice_default_lang);
combo_default_lang.reset(new Combox(FL_COMBOX_DROPLIST));
- combo_default_lang->add(obj->x, obj->y, obj->w, obj->h, 400,
- parent_.lang_opts_tab_->tabfolder_inner,
- parent_.dialog_->tabfolder_prefs);
+ combo_default_lang->add(obj->x, obj->y, obj->w, obj->h, 400);
combo_default_lang->shortcut("#L",1);
combo_default_lang->setcallback(ComboCB, &parent_);
Combox::Combox(combox_type t)
- : type(t), tabfolder1(0), tabfolder2(0)
+ : type(t)
{
browser = button = 0;
callback = 0;
}
-void Combox::add(int x, int y, int w, int hmin, int hmax,
- FL_OBJECT * tabfolder1_, FL_OBJECT * tabfolder2_)
+void Combox::add(int x, int y, int w, int hmin, int hmax)
{
- // Store these for later use in working round an xforms bug in show()
- tabfolder1 = tabfolder1_;
- tabfolder2 = tabfolder2_;
-
FL_OBJECT * obj;
switch (type) {
fl_redraw_object(button);
}
- int x = label->x;
- int y = label->y + label->h;
- if (tabfolder1) {
- // This is a bug work around suggested by Steve Lamont on the
- // xforms mailing list. It correctly positions the browser form
- // after the main window has been moved.
- // The bug only occurs in tabbed folders.
- int folder_x, folder_y, folder_w, folder_h;
- fl_get_folder_area( tabfolder1,
- &folder_x, &folder_y,
- &folder_w, &folder_h);
- x += folder_x;
- y += folder_y;
-
- if (tabfolder2) {
- fl_get_folder_area( tabfolder2,
- &folder_x, &folder_y,
- &folder_w, &folder_h);
- x += tabfolder2->form->x + folder_x;
- y += tabfolder2->form->y + folder_y;
- } else {
- x += tabfolder1->form->x;
- y += tabfolder1->form->y;
- }
-
- } else {
- x += label->form->x;
- y += label->form->y;
+ // This fix ensures that, even if label lies on a tabfolder,
+ // the x,y coords of the underlying form are up to date.
+ // It should be rendered redundant by a similar fix in the
+ // tabfolder prehandler, but apparently "enter" events are not always
+ // caught...
+ // Angus 4 Oct, 2002.
+ if (label->form->window) {
+ FL_FORM * lf = label->form;
+ FL_Coord w, h;
+ fl_get_wingeometry(lf->window, &(lf->x), &(lf->y), &w, &h);
}
+
+ int const x = label->form->x + label->x;
+ int const y = label->form->y + label->y + label->h;
fl_set_form_position(form, x, y);
fl_show_form(form, FL_PLACE_POSITION, FL_NOBORDER, "");
~Combox();
/** To add this object to a form. Note that there are two heights
- for normal (button) and expanded (browser) mode each.
- The optional tabfolder arguments are needed to overcome an
- xforms bug when repositioning a combox in a tab folder.
- tabfolder1_ is the folder holding the combox.
- If using nested tabfolders, tabfolder2_ is the "base" folder
- holding tabfolder1_.
- */
- void add(int x, int y, int w, int hmin, int hmax,
- FL_OBJECT * tabfolder1_ = 0, FL_OBJECT * tabfolder2_ = 0);
+ * for normal (button) and expanded (browser) mode each.
+ */
+ void add(int x, int y, int w, int hmin, int hmax);
/// Add lines. Same as for fl_browser object
void addline(string const &);
FL_OBJECT * label;
///
FL_FORM* form;
- ///
- FL_OBJECT * tabfolder1;
- ///
- FL_OBJECT * tabfolder2;
};
--------------------
class: FL_TABFOLDER
type: TOP_TABFOLDER
-box: 0 10 400 255
+box: 0 5 400 255
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_TOP_LEFT