#include "vspace.h"
#include "support/tostr.h"
-#include "support/lstrings.h" // contains_functor, getStringFromVector
+#include "support/lstrings.h" // contains, getStringFromVector
#include "support/filetools.h" // LibFileSearch
#include "lyx_xpm.h"
+#include <boost/bind.hpp>
+
#include <iomanip>
using lyx::support::bformat;
-using lyx::support::contains_functor;
+using lyx::support::contains;
using lyx::support::getStringFromVector;
using lyx::support::getVectorFromString;
using lyx::support::LibFileSearch;
-using std::bind2nd;
+using boost::bind;
+
using std::endl;
using std::string;
using std::vector;
vector<string>::iterator ret =
std::remove_if(units_vec.begin(),
units_vec.end(),
- bind2nd(contains_functor(), "%"));
+ bind(contains<char>, _1, '%'));
units_vec.erase(ret, units_vec.end());
string const units = getStringFromVector(units_vec, "|");
bcview().addReadOnly(language_->combox_language);
bcview().addReadOnly(language_->choice_inputenc);
bcview().addReadOnly(language_->choice_quotes_language);
- bcview().addReadOnly(language_->radio_single);
- bcview().addReadOnly(language_->radio_double);
fl_addto_choice(language_->choice_inputenc,
"default|auto|latin1|latin2|latin3|latin4|latin5|latin9"
bcview().addReadOnly(options_->counter_tocdepth);
bcview().addReadOnly(options_->choice_ams_math);
bcview().addReadOnly(options_->check_use_natbib);
+ bcview().addReadOnly(options_->check_use_jurabib);
bcview().addReadOnly(options_->choice_citation_format);
bcview().addReadOnly(options_->input_float_placement);
bcview().addReadOnly(options_->choice_postscript_driver);
+
+ // set up the tooltips for optionss form
+ string str = _("Use the natbib styles for natural sciences and arts");
+ tooltips().init(options_->check_use_natbib, str);
+ str = _("Use the jurabib styles for law and humanities");
+ tooltips().init(options_->check_use_jurabib, str);
// trigger an input event for cut&paste with middle mouse button.
setPrehandler(options_->input_float_placement);
bcview().addReadOnly(branch_->browser_all_branches);
// set up the tooltips for branches form
- string str = _("Enter the name of a new branch.");
+ str = _("Enter the name of a new branch.");
tooltips().init(branch_->input_all_branches, str);
str = _("Add a new branch to the document.");
tooltips().init(branch_->button_add_branch, str);
} else if (ob == options_->check_use_natbib) {
setEnabled(options_->choice_citation_format,
fl_get_button(options_->check_use_natbib));
+ if (fl_get_button(options_->check_use_natbib))
+ fl_set_button(options_->check_use_jurabib, 0);
+
+ } else if (ob == options_->check_use_jurabib) {
+ if (fl_get_button(options_->check_use_jurabib))
+ fl_set_button(options_->check_use_natbib, 0);
+ setEnabled(options_->choice_citation_format,
+ fl_get_button(options_->check_use_natbib));
} else if (ob == branch_->browser_all_branches ||
ob == branch_->browser_selection ||
ob == branch_->button_remove_branch ||
ob == branch_->button_modify ||
ob == branch_->button_select ||
- ob == branch_->button_deselect ||
ob == branch_->button_deselect) {
branch_input(ob);
} else if (ob == dialog_->button_save_defaults) {
} else if (ob == branch_->button_select ||
ob == branch_->button_deselect) {
- bool const selected = ob == branch_->button_select;
-
- int const i = fl_get_browser(branch_->browser_all_branches);
- string const current_branch =
- fl_get_browser_line(branch_->browser_all_branches, i);
-
- Branch * branch = branchlist_.find(current_branch);
+ bool const selecting = ob == branch_->button_select;
+ string current_branch;
- if (branch && branch->setSelected(selected))
+ // When selecting, take highlighted item from left browser,
+ // when deselecting, from right browser:
+ if (selecting) {
+ int const i = fl_get_browser(branch_->browser_all_branches);
+ current_branch =
+ fl_get_browser_line(branch_->browser_all_branches, i);
+ } else {
+ int const i = fl_get_browser(branch_->browser_selection);
+ current_branch =
+ fl_get_browser_line(branch_->browser_selection, i);
+ }
+ Branch * branch = branchlist_.find(current_branch);
+
+ if (branch && branch->setSelected(selecting))
rebuild_selected_branches_browser();
} else if (ob == branch_->button_modify) {
break;
}
params.quotes_language = lga;
- if (fl_get_button(language_->radio_single))
- params.quotes_times = InsetQuotes::SingleQ;
- else
- params.quotes_times = InsetQuotes::DoubleQ;
int const pos = fl_get_combox(language_->combox_language);
Language const * new_language = languages.getLanguage(lang_[pos-1]);
params.use_natbib = fl_get_button(options_->check_use_natbib);
params.use_numerical_citations =
fl_get_choice(options_->choice_citation_format) - 1;
+ params.use_jurabib = fl_get_button(options_->check_use_jurabib);
int tmpchar = int(fl_get_counter_value(options_->counter_secnumdepth));
if (params.secnumdepth != tmpchar)
fl_set_choice_text(language_->choice_inputenc, params.inputenc.c_str());
fl_set_choice(language_->choice_quotes_language, params.quotes_language + 1);
- fl_set_button(language_->radio_single, 0);
- fl_set_button(language_->radio_double, 0);
- if (params.quotes_times == InsetQuotes::SingleQ)
- fl_set_button(language_->radio_single, 1);
- else
- fl_set_button(language_->radio_double, 1);
}
fl_set_choice(options_->choice_citation_format,
int(params.use_numerical_citations)+1);
setEnabled(options_->choice_citation_format, params.use_natbib);
+ fl_set_button(options_->check_use_jurabib, params.use_jurabib);
fl_set_counter_value(options_->counter_secnumdepth, params.secnumdepth);
fl_set_counter_value(options_->counter_tocdepth, params.tocdepth);
if (!params.float_placement.empty())