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 "
"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);
}
-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
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;
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);
=============== 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
--------------------
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
--------------------
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
--------------------
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
--------------------
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
--------------------
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