#include <config.h>
#include <fstream>
-#ifdef __GNUG__
-#pragma implementation
-#endif
#include "xformsBC.h"
#include "FormTexinfo.h"
#include FORMS_H_LOCATION
+using std::vector;
typedef FormCB<ControlTexinfo, FormDB<FD_texinfo> > base_class;
FormTexinfo::FormTexinfo()
str = _("Double click to view contents of file.");
tooltips().init(dialog_->browser, str);
+ // Work-around xforms' bug; enable tooltips for browser widgets.
+ setPrehandler(dialog_->browser);
str = _("Runs the script \"texhash\" which builds a new LaTeX tree. "
"Needed if you install a new TeX class or style. You need write "
} else if (ob == dialog_->browser && ob_value == 2) {
// double click in browser: view selected file
- string selection = string();
- if (fl_get_button(dialog_->check_fullpath)) {
- // contents in browser has full path
- selection = getString(dialog_->browser);
- } else {
+ string selection = getString(dialog_->browser);
+ if (!fl_get_button(dialog_->check_fullpath)) {
// contents in browser has filenames without path
// reconstruct path from controller getContents
string const files = controller().getContents(activeStyle, true);
// find line in files vector
vector<string>::const_iterator it = vec.begin();
- int const line = fl_get_browser(dialog_->browser);
- for (int i = line; it != vec.end() && i > 0; ++it, --i) {
- if (i == 1) selection = *it;
+ for (; it != vec.end(); ++it) {
+ if ((*it).find(selection) != string::npos) {
+ selection = *it;
+ break;
+ }
}
}
-
if (!selection.empty()) {
controller().viewFile(selection);
}
// reset the browser so that the following single-click callback doesn't do anything
fl_deselect_browser(dialog_->browser);
-
+
} else if (ob == dialog_->button_rescan) {
// build new *Files.lst
controller().rescanStyles();