]> git.lyx.org Git - features.git/commitdiff
Work around xforms "tooltips and tabfolders" bug.
authorAngus Leeming <leeming@lyx.org>
Thu, 3 Oct 2002 17:20:28 +0000 (17:20 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 3 Oct 2002 17:20:28 +0000 (17:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5357 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/FeedbackController.C
src/frontends/xforms/FormAboutlyx.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/forms/form_graphics.fd

index a2bbbba8803d78c7a81ede47054627ec41f44609..8de3fd68da4909e691a481979797a7171ef62d2d 100644 (file)
@@ -1,3 +1,20 @@
+2002-10-03  Angus Leeming  <leeming@lyx.org>
+
+       * FeedbackController.C (PrehandlerCB): re-compute the folder->x,
+       folder->y coords of a tabfolder when the mouse enters the folder.
+       This works around an xforms bug that manifests itslf as tooltips
+       appearing in their original position after the dialog has been
+       moved aside.
+
+       * FormAboutlyx.C (build):
+       * FormDocument.C (build):
+       * FormGraphics.C (build):
+       * FormPreferences.C (build):
+       * FormTabular.C (build): set the prehandler for tabfolders.
+
+       * form_graphics.fd: move the edge of the tabfolder in by 5 pixels
+       to ensure that the tabfolder prehandler is called.
+
 2002-10-03  Angus Leeming  <leeming@lyx.org>
 
        * lyx_gui.C (start): ev.xany.type is of type 'int' so print it as a
index fbb0f32eabc4f4fdd39894150dc3157a3494a4ad..16b6ebf9bd7ccf6e3fbd7e6b5af9cd939435384e 100644 (file)
@@ -73,10 +73,26 @@ void FeedbackController::MessageCB(FL_OBJECT * ob, int event)
 
 void FeedbackController::PrehandlerCB(FL_OBJECT * ob, int event, int key)
 {
-       if (event == FL_PUSH && key == 2 && ob->objclass == FL_INPUT) {
+       lyx::Assert(ob);
+
+       if (ob->objclass == FL_INPUT && event == FL_PUSH && key == 2) {
                // Trigger an input event when pasting in an xforms input object
                // using the middle mouse button.
                InputCB(ob, 0);
+               
+       // This is very odd:
+       // event == FL_LEAVE when the mouse enters the folder and
+       // event == FL_ENTER are it leaves!
+       } else if (ob->objclass == FL_TABFOLDER && event == FL_LEAVE) {
+               // This prehandler is used to work-around an xforms bug.
+               // 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) {
+                       FL_Coord w, h;
+                       fl_get_wingeometry(win, &(form->x), &(form->y), &w, &h);
+               }
 
        } else if (message_widget_ &&
                   (event == FL_ENTER || event == FL_LEAVE)) {
index 86c64c1589feee39849298ff2cb7087f6789af81..cfb7d625f9910700e776e9d4ed82ad644a33615a 100644 (file)
@@ -68,6 +68,9 @@ void FormAboutlyx::build()
        fl_addto_tabfolder(dialog_->tabfolder,_("Credits"),
                           credits_->form);
 
+       // work-around xforms bug re update of folder->x, folder->y coords.
+       setPrehandler(dialog_->tabfolder);
+
        // Manage the cancel/close button
        bc().setCancel(dialog_->button_close);
 }
index 4cc2c9af2ebcf96a77a13e3393060b5496c94ba3..6180f829528df5823e819092ec8b734e1f2e8e45 100644 (file)
@@ -331,6 +331,10 @@ void FormDocument::build()
                           options_->form);
        fbullet = fl_addto_tabfolder(dialog_->tabfolder,_("Bullets"),
                                     bullets_->form);
+
+       // work-around xforms bug re update of folder->x, folder->y coords.
+       setPrehandler(dialog_->tabfolder);
+
        if ((XpmVersion < 4) || (XpmVersion == 4 && XpmRevision < 7)) {
                lyxerr << _("Your version of libXpm is older than 4.7.\n"
                            "The `bullet' tab of the document dialog "
index 8a29930378b23f20bd9f5d221c27dd86a861fe68..00cd9bcfdf7799525f79b8425f07c0643f5455f1 100644 (file)
@@ -233,6 +233,9 @@ void FormGraphics::build()
        fl_addto_tabfolder(dialog_->tabfolder, _("Bounding Box"), bbox_->form);
        fl_addto_tabfolder(dialog_->tabfolder, _("Extra"), extra_->form);
 
+       // work-around xforms bug re update of folder->x, folder->y coords.
+       setPrehandler(dialog_->tabfolder);
+
        // set the right default unit
        switch (lyxrc.default_papersize) {
        case BufferParams::PAPER_DEFAULT: break;
index b40d8ebbb95bac253f8b2de9f2e26d0ff1031446..9025c83aa0e43e454f9ed1bef6f6117d3ec23d4d 100644 (file)
@@ -249,6 +249,13 @@ void FormPreferences::build()
        fl_addto_tabfolder(lang_opts_tab_->tabfolder_inner,
                           _("Language"),
                           language_.dialog()->form);
+
+       // work-around xforms bug re update of folder->x, folder->y coords.
+       setPrehandler(look_n_feel_tab_->tabfolder_inner);
+       setPrehandler(converters_tab_->tabfolder_inner);
+       setPrehandler(inputs_tab_->tabfolder_inner);
+       setPrehandler(outputs_tab_->tabfolder_inner);
+       setPrehandler(lang_opts_tab_->tabfolder_inner);
 }
 
 
index 2056abebacafcd45f70212740b70d2aa6cfc2fd9..f1dbd5ee6b4ef4533d4b674692920a9fefcdd547 100644 (file)
@@ -145,6 +145,9 @@ void FormTabular::build()
        fl_addto_tabfolder(dialog_->tabfolder, _("LongTable"),
                           longtable_options_->form);
 
+       // work-around xforms bug re update of folder->x, folder->y coords.
+       setPrehandler(dialog_->tabfolder);
+
        // Create the contents of the unit choices
        // Don't include the "%" terms...
        vector<string> units_vec = getLatexUnits();
index 0348618715fb5b0624d7e48c99ba412140245e83..f3fa6aef7d966ccc86bca64baa31bbf134079421 100644 (file)
@@ -34,7 +34,7 @@ argument:
 --------------------
 class: FL_TABFOLDER
 type: TOP_TABFOLDER
-box: 0 5 400 260
+box: 0 10 400 255
 boxtype: FL_FRAME_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_TOP_LEFT