]> git.lyx.org Git - features.git/commitdiff
(Rob Lahaye): use double, not singel, click to select the style.
authorAngus Leeming <leeming@lyx.org>
Sat, 22 Feb 2003 18:28:07 +0000 (18:28 +0000)
committerAngus Leeming <leeming@lyx.org>
Sat, 22 Feb 2003 18:28:07 +0000 (18:28 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6232 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/FormBibtex.C
src/frontends/xforms/forms/form_bibtex.fd

index cf38cc6af3b03bd81994f6657882d9e25343e984..3c4c399c4e5c06dad7a7ed091a7b28af3a6ff9c2 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-17  Rob Lahaye  <lahaye@snu.ac.kr>
+
+       * FormBibTeX.C: add double click to choose from list.
+
+       * forms/form_bibtex.fd: modify layout slightly.
+
 2003-02-17  Rob Lahaye  <lahaye@snu.ac.kr>
 
        * FormTexinfo.C: fix full filename lookup when showing
index 461f60a0b697a9d2736c1e729b2aeb4d6e135f13..973d70b0f8b1504d6cbb42a40f0d5c26ddd78ea6 100644 (file)
@@ -64,6 +64,10 @@ void FormBibtex::build()
        fl_set_input_return(dialog_->input_database, FL_RETURN_CHANGED);
        fl_set_input_return(dialog_->input_style, FL_RETURN_CHANGED);
 
+       // callback for double click in browser
+       fl_set_browser_dblclick_callback(dialog_->browser_styles,
+                                        C_FormBaseInputCB, 2);
+
        // set up the tooltips
        string str = _("The database you want to cite from. Insert it "
                       "without the default extension \".bib\". Use comma "
@@ -81,7 +85,7 @@ void FormBibtex::build()
                "of Contents");
        tooltips().init(dialog_->check_bibtotoc, str);
 
-       str = _("Choose a BibTeX style from the list.");
+       str = _("Double click to choose a BibTeX style from the list.");
        tooltips().init(dialog_->browser_styles, str);
        // Work-around xforms' bug; enable tooltips for browser widgets.
        setPrehandler(dialog_->browser_styles);
@@ -93,7 +97,7 @@ void FormBibtex::build()
 }
 
 
-ButtonPolicy::SMInput FormBibtex::input(FL_OBJECT * ob, long)
+ButtonPolicy::SMInput FormBibtex::input(FL_OBJECT * ob, long ob_value)
 {
        if (ob == dialog_->button_database_browse) {
                // When browsing, take the first file only
@@ -119,7 +123,8 @@ ButtonPolicy::SMInput FormBibtex::input(FL_OBJECT * ob, long)
                        fl_set_input(dialog_->input_style, style.c_str());
                }
 
-       } else if (ob == dialog_->browser_styles) {
+       } else if (ob == dialog_->browser_styles && ob_value == 2) {
+               // double clicked in styles browser
                string const style = getString(dialog_->browser_styles);
                if (style.empty()) {
                        return ButtonPolicy::SMI_NOOP;
@@ -127,6 +132,9 @@ ButtonPolicy::SMInput FormBibtex::input(FL_OBJECT * ob, long)
                        fl_set_input(dialog_->input_style,
                                        ChangeExtension(style, "").c_str());
                }
+               // reset the browser so that the following
+               // single-click callback doesn't do anything
+               fl_deselect_browser(dialog_->browser_styles);
 
        } else if (ob == dialog_->button_rescan) {
                fl_clear_browser(dialog_->browser_styles);
index 44383a985553447f369a7876e02fdd29e9ca51f4..2c8636ef2b2002cb6d3a0947e6eca5264035eeac 100644 (file)
@@ -9,14 +9,14 @@ SnapGrid: 5
 
 =============== FORM ===============
 Name: form_bibtex
-Width: 435
+Width: 395
 Height: 235
 Number of Objects: 12
 
 --------------------
 class: FL_BOX
 type: FLAT_BOX
-box: 0 0 435 235
+box: 0 0 395 235
 boxtype: FL_FLAT_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -34,7 +34,7 @@ argument:
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 355 25 75 25
+box: 315 25 75 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -70,7 +70,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: RETURN_BUTTON
-box: 150 205 90 25
+box: 110 205 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -88,7 +88,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 340 205 90 25
+box: 300 205 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -160,7 +160,7 @@ argument: 0
 --------------------
 class: FL_BROWSER
 type: HOLD_BROWSER
-box: 250 50 180 145
+box: 245 50 145 145
 boxtype: FL_DOWN_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_TOP_LEFT
@@ -196,7 +196,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 245 205 90 25
+box: 205 205 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER