cur.clearSelection();
bv_->update();
cur.resetAnchor();
- cmd.message(N_("Mark off"));
+ cur.message(N_("Mark off"));
break;
case LFUN_MARK_ON:
cur.mark() = true;
bv_->update();
cur.resetAnchor();
- cmd.message(N_("Mark on"));
+ cur.message(N_("Mark on"));
break;
case LFUN_SETMARK:
cur.clearSelection();
if (cur.mark()) {
- cmd.message(N_("Mark removed"));
+ cur.message(N_("Mark removed"));
} else {
cur.mark() = true;
- cmd.message(N_("Mark set"));
+ cur.message(N_("Mark set"));
}
cur.resetAnchor();
bv_->update();
break;
case LFUN_UNKNOWN_ACTION:
- cmd.errorMessage(N_("Unknown function!"));
+ cur.errorMessage(N_("Unknown function!"));
break;
default:
#include "funcrequest.h"
#include "iterators.h"
#include "lfuns.h"
+#include "lyxfunc.h" // only for setMessage()
#include "lyxrc.h"
-#include "lyxtext.h"
#include "lyxrow.h"
+#include "lyxtext.h"
#include "paragraph.h"
#include "insets/updatableinset.h"
#include "mathed/math_support.h"
#include "support/limited_stack.h"
+#include "frontends/LyXView.h"
#include <boost/assert.hpp>
cursor_[i].inset()->infoize(os);
os << " ";
}
-#warning FIXME
- //if (pos() != 0)
- // prevAtom()->infoize2(os);
+ if (pos() != 0)
+ prevInset()->infoize2(os);
// overwite old message
os << " ";
}
return par.isInset(pos() - 1) ? par.getInset(pos() - 1) : 0;
}
+
+void LCursor::message(string const & msg) const
+{
+ bv().owner()->getLyXFunc().setMessage(msg);
+}
+
+
+void LCursor::errorMessage(string const & msg) const
+{
+ bv().owner()->getLyXFunc().setErrorMessage(msg);
+}
void handleFont(std::string const & font);
void releaseMathCursor();
-
+ /// are we in mathed?
bool inMathed() const;
+ /// display a message
+ void message(std::string const & msg) const;
+ /// display an error message
+ void errorMessage(std::string const & msg) const;
+
private:
/// moves cursor index one cell to the left
bool idxLeft();
#include <config.h>
#include "funcrequest.h"
-#include "BufferView.h"
-#include "lyxfunc.h" // only for setMessage()
-#include "frontends/LyXView.h"
-#include "debug.h"
+
#include "support/std_sstream.h"
#include <iostream>
+#include <vector>
-using std::endl;
using std::getline;
using std::istringstream;
}
-void FuncRequest::message(string const & msg) const
-{
-#warning FIXME
- //if (view_)
- // view_->owner()->getLyXFunc().setMessage(msg);
- //else
- lyxerr << "Dropping message '" << msg << "'" << endl;
-}
-
-
-void FuncRequest::errorMessage(string const & msg) const
-{
-#warning FIXME
- //if (view_)
- // view_->owner()->getLyXFunc().setErrorMessage(msg);
- //else
- lyxerr << "Dropping error message '" << msg << "'" << endl;
-}
-
-
void split(vector<string> & args, string str)
{
istringstream is(str);
#include <string>
#include <iosfwd>
+
/**
* This class encapsulates a LyX action and its argument
* in order to pass it around easily.
/// access to button
mouse_button::state button() const;
- /// output a message
- void message(std::string const & msg) const;
- /// output an error message
- void errorMessage(std::string const & msg) const;
-
/// argument parsing, extract argument i as std::string
std::string getArg(unsigned int i) const;
break;
case LFUN_PASTE:
- cmd.message(_("Paste"));
+ cur.message(_("Paste"));
replaceSelection(bv->getLyXText());
#warning FIXME Check if the arg is in the domain of available selections.
if (isStrUnsignedInt(cmd.argument))
case LFUN_CUT:
cutSelection(true, true);
- cmd.message(_("Cut"));
+ cur.message(_("Cut"));
bv->update();
break;
case LFUN_COPY:
copySelection();
- cmd.message(_("Copy"));
+ cur.message(_("Copy"));
break;
case LFUN_BEGINNINGBUFSEL:
break;
case LFUN_GETXY:
- cmd.message(tostr(cursorX(cur.current())) + ' '
+ cur.message(tostr(cursorX(cur.current())) + ' '
+ tostr(cursorY(cur.current())));
break;
case LFUN_GETFONT:
if (current_font.shape() == LyXFont::ITALIC_SHAPE)
- cmd.message("E");
+ cur.message("E");
else if (current_font.shape() == LyXFont::SMALLCAPS_SHAPE)
- cmd.message("N");
+ cur.message("N");
else
- cmd.message("0");
+ cur.message("0");
break;
case LFUN_GETLAYOUT:
- cmd.message(cursorPar()->layout()->name());
+ cur.message(cursorPar()->layout()->name());
break;
case LFUN_LAYOUT: {
// function list/array with information about what
// functions needs arguments and their type.
if (cmd.argument.empty()) {
- cmd.errorMessage(_("LyX function 'layout' needs an argument."));
+ cur.errorMessage(_("LyX function 'layout' needs an argument."));
break;
}
}
if (!hasLayout) {
- cmd.errorMessage(string(N_("Layout ")) + cmd.argument +
+ cur.errorMessage(string(N_("Layout ")) + cmd.argument +
N_(" not known"));
break;
}