+2002-07-20 John Levon <moz@compsoc.man.ac.uk>
+
+ * paragraph_pimpl.C: constify
+
+ * BufferView_pimpl.C:
+ * LaTeX.C:
+ * lyxfunc.C: fix dispatch in a nicer way
+
2002-07-20 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* version.C.in: update lyx_docversion
if (lfun) {
ostringstream str;
str << _("LaTeX run number") << ' ' << count;
- // check lyxstring string stream and gcc 3.1 before fixing
- lfun->dispatch(LFUN_MESSAGE, string(str.str().c_str()));
+ lfun->dispatch(LFUN_MESSAGE, str.str().c_str(), false);
}
this->operator()();
// no checks for now
lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
if (lfun) {
- lfun->dispatch(LFUN_MESSAGE, string(_("Running MakeIndex.")));
+ lfun->dispatch(LFUN_MESSAGE, _("Running MakeIndex."), false);
}
rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx")));
// no checks for now
lyxerr[Debug::LATEX] << "Running BibTeX." << endl;
if (lfun) {
- lfun->dispatch(LFUN_MESSAGE, string(_("Running BibTeX.")));
+ lfun->dispatch(LFUN_MESSAGE, _("Running BibTeX."), false);
}
updateBibtexDependencies(head, bibtex_info);
ostringstream str;
str << _("LaTeX run number") << ' ' << count;
// check lyxstring string stream and gcc 3.1 before fixing
- lfun->dispatch(LFUN_MESSAGE, string(str.str().c_str()));
+ lfun->dispatch(LFUN_MESSAGE, str.str().c_str(), false);
}
this->operator()();
// no checks for now
lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
if (lfun) {
- lfun->dispatch(LFUN_MESSAGE, string(_("Running MakeIndex.")));
+ lfun->dispatch(LFUN_MESSAGE, _("Running MakeIndex."), false);
}
rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx")));
if (lfun) {
ostringstream str;
str << _("LaTeX run number") << ' ' << count;
- // check lyxstring string stream and gcc 3.1 before fixing
- lfun->dispatch(LFUN_MESSAGE, string(str.str().c_str()));
+ lfun->dispatch(LFUN_MESSAGE, str.str().c_str(), false);
}
this->operator()();
+2002-07-20 John Levon <moz@compsoc.man.ac.uk>
+
+ * ControlRef.C: fix dispatch call nicely
+
2002-07-19 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am:
void ControlRef::gotoRef(string const & ref) const
{
- lv_.getLyXFunc()->dispatch(LFUN_BOOKMARK_SAVE, string("0"));
+ lv_.getLyXFunc()->dispatch(LFUN_BOOKMARK_SAVE, "0", false);
lv_.getLyXFunc()->dispatch(LFUN_REF_GOTO, ref);
}
void ControlRef::gotoBookmark() const
{
- lv_.getLyXFunc()->dispatch(LFUN_BOOKMARK_GOTO, string("0"));
+ lv_.getLyXFunc()->dispatch(LFUN_BOOKMARK_GOTO, "0", false);
}
+2002-07-20 John Levon <moz@compsoc.man.ac.uk>
+
+ * FormMathsDelim.C:
+ * FormMathsMatrix.C: fix dispatch calls nicely
+
2002-07-20 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Menubar_pimpl.C (add_toc): avoid crash when there is no document
ostringstream ost;
ost << delim_values[left] << ' ' << delim_values[right];
- // the unusual formulation here is necessary for lyxstring stringstream
- lv_->getLyXFunc()->dispatch(LFUN_MATH_DELIM, string(ost.str().c_str()));
+ lv_->getLyXFunc()->dispatch(LFUN_MATH_DELIM, ost.str().c_str(), false);
}
bool FormMathsDelim::input(FL_OBJECT *, long)
ostringstream ost;
ost << nx << ' ' << ny << ' ' << c << ' ' << sh;
- // remeber gcc 3.1 and lyxstring stringstream before "fixing"
- lv_->getLyXFunc()->dispatch(LFUN_INSERT_MATRIX, string(ost.str().c_str()));
+ lv_->getLyXFunc()->dispatch(LFUN_INSERT_MATRIX, ost.str().c_str(), false);
}
bool FormMathsMatrix::input(FL_OBJECT * ob, long)
XMiniBuffer::XMiniBuffer(XFormsView * v, ControlCommandBuffer & control,
FL_Coord x, FL_Coord y, FL_Coord h, FL_Coord w)
: controller_(control), view_(v),
- info_suffix_shown_(false)
+ info_shown_(false)
{
input_obj_ = create_input_box(FL_NORMAL_INPUT, x, y, h, w);
- suffix_timer_.reset(new Timeout(1500));
+ info_timer_.reset(new Timeout(1500));
idle_timer_.reset(new Timeout(6000));
- suffix_timer_->timeout.connect(boost::bind(&XMiniBuffer::suffix_timeout, this));
+ info_timer_->timeout.connect(boost::bind(&XMiniBuffer::info_timeout, this));
idle_timer_->timeout.connect(boost::bind(&XMiniBuffer::idle_timeout, this));
idle_timer_->start();
messageMode();
int XMiniBuffer::peek_event(FL_OBJECT * ob, int event,
int key, XEvent * /*xev*/)
{
-#if 0
- if (dropdown_->isVisible()) {
- return dropdown_->peek(xev);
- }
-#endif
-
switch (event) {
case FL_FOCUS:
messageMode(false);
case FL_KEYBOARD:
{
string input;
- if (info_suffix_shown_) {
- suffix_timer_->stop();
- suffix_timeout();
+ if (info_shown_) {
+ info_timer_->stop();
+ info_timeout();
}
char const * tmp = fl_get_input(ob);
{
string const h(controller_.historyDown());
if (h.empty()) {
- show_info_suffix(_("[End of history]"), input);
+ show_info(_("[End of history]"), input, false);
} else {
set_input(h);
}
{
string const h(controller_.historyUp());
if (h.empty()) {
- show_info_suffix(_("[Beginning of history]"), input);
+ show_info(_("[Beginning of history]"), input, false);
} else {
set_input(h);
}
vector<string> comp = controller_.completions(input, new_input);
if (comp.empty() && new_input == input) {
- show_info_suffix(_("[no match]"), input);
+ show_info(_("[no match]"), input);
break;
}
if (comp.empty()) {
set_input(new_input);
- show_info_suffix(("[only completion]"), new_input + " ");
+ show_info(("[only completion]"), new_input + " ");
break;
}
case XK_KP_Enter:
#endif
{
-#if 0
- // This will go in again in a little while
- // we need to be able to declare what types
- // of argumetns LFUN's should have first. (Lgb)
- // First check for match
- vector<string>::const_iterator cit =
- find(completion_.begin(),
- completion_.end(),
- input);
- if (cit == completion_.end()) {
- // no such func/item
- string const tmp = input + _(" [no match]");
- show_info_suffix(tmp, input);
- } else {
-#endif
messageMode();
redraw();
controller_.dispatch(input);
-# if 0
- }
-#endif
return 1;
}
default:
}
-void XMiniBuffer::show_info_suffix(string const & suffix, string const & input)
+void XMiniBuffer::show_info(string const & info, string const & input, bool append)
{
stored_input_ = input;
- info_suffix_shown_ = true;
- set_input(input + " " + suffix);
- suffix_timer_->start();
+ info_shown_ = true;
+ if (append)
+ set_input(input + " " + info);
+ else
+ set_input(info);
+ info_timer_->start();
}
}
-void XMiniBuffer::suffix_timeout()
+void XMiniBuffer::info_timeout()
{
- info_suffix_shown_ = false;
+ info_shown_ = false;
set_input(stored_input_);
}
bool isEditingMode() const;
/// reset buffer to stored input text
- void suffix_timeout();
+ void info_timeout();
/// go back to "at rest" message
void idle_timeout();
void messageMode(bool on = true);
/// show a temporary message whilst in edit mode
- void show_info_suffix(string const & suffix, string const & input);
+ void show_info(string const & info, string const & input, bool append = true);
/// the dropdown menu
boost::scoped_ptr<DropDown> dropdown_;
- /// info suffix timer
- boost::scoped_ptr<Timeout> suffix_timer_;
+ /// info timer
+ boost::scoped_ptr<Timeout> info_timer_;
/// idle timer
boost::scoped_ptr<Timeout> idle_timer_;
/// the lyx view
XFormsView * view_;
- /// stored input when showing suffix info
+ /// stored input when showing info
string stored_input_;
- /// are we showing an informational suffix of the mesage ?
- bool info_suffix_shown_;
+ /// are we showing an informational temporary message ?
+ bool info_shown_;
};
#endif // XMINIBUFFER_H
// passthrough hat and underscore outside mathed:
case LFUN_SUBSCRIPT:
- dispatch(LFUN_SELFINSERT, string("_"));
+ dispatch(LFUN_SELFINSERT, "_", false);
break;
case LFUN_SUPERSCRIPT:
- dispatch(LFUN_SELFINSERT, string("^"));
+ dispatch(LFUN_SELFINSERT, "^", false);
break;
case LFUN_MATH_PANEL:
{ "LaTeX", "\\LaTeX{}", true },
};
-size_t phrases_nr = sizeof(special_phrases)/sizeof(special_phrase);
+size_t const phrases_nr = sizeof(special_phrases)/sizeof(special_phrase);
} // namespace anon