#include "BufferView.h"
#include "CutAndPaste.h"
#include "FuncStatus.h"
-#include "LColor.h"
+#include "Color.h"
#include "Cursor.h"
#include "debug.h"
#include "FuncRequest.h"
#include "frontends/Clipboard.h"
#include "frontends/Painter.h"
-#include "insets/MailInset.h"
-
#include "support/lstrings.h"
#include <sstream>
using std::istringstream;
using std::vector;
-class GridInsetMailer : public MailInset {
-public:
- GridInsetMailer(InsetMathGrid & inset) : inset_(inset) {}
- ///
- virtual string const & name() const
- {
- static string const theName = "tabular";
- return theName;
- }
- ///
- virtual string const inset2string(Buffer const &) const
- {
- odocstringstream data;
- //data << name() << " active_cell " << inset.getActCell() << '\n';
- data << from_utf8(name()) << " active_cell " << 0 << '\n';
- WriteStream ws(data);
- inset_.write(ws);
- return to_utf8(data.str());
- }
-
-protected:
- InsetBase & inset() const { return inset_; }
- InsetMathGrid & inset_;
-};
-
namespace {
}
-auto_ptr<InsetBase> InsetMathGrid::doClone() const
+auto_ptr<Inset> InsetMathGrid::doClone() const
{
- return auto_ptr<InsetBase>(new InsetMathGrid(*this));
+ return auto_ptr<Inset>(new InsetMathGrid(*this));
}
}
-void InsetMathGrid::vcrskip(LyXLength const & crskip, row_type row)
+void InsetMathGrid::vcrskip(Length const & crskip, row_type row)
{
rowinfo_[row].crskip_ = crskip;
}
-LyXLength InsetMathGrid::vcrskip(row_type row) const
+Length InsetMathGrid::vcrskip(row_type row) const
{
return rowinfo_[row].crskip_;
}
- i * hlinesep() - hlinesep()/2 - rowsep()/2;
pi.pain.line(x + lmargin + 1, yy,
x + dim_.width() - rmargin - 1, yy,
- LColor::foreground);
+ Color::foreground);
}
for (col_type col = 0; col <= ncols(); ++col)
- i * vlinesep() - vlinesep()/2 - colsep()/2;
pi.pain.line(xx, y - dim_.ascent() + 1,
xx, y + dim_.descent() - 1,
- LColor::foreground);
+ Color::foreground);
}
drawMarkers2(pi, x, y);
}
//lyxerr << "*** InsetMathGrid: request: " << cmd << endl;
switch (cmd.action) {
- case LFUN_MOUSE_RELEASE:
- //if (cmd.button() == mouse_button::button3) {
- // GridInsetMailer(*this).showDialog();
- // return DispatchResult(true, true);
- //}
- InsetMathNest::doDispatch(cur, cmd);
- break;
-
- case LFUN_INSET_DIALOG_UPDATE:
- GridInsetMailer(*this).updateDialog(&cur.bv());
- break;
-
// insert file functions
case LFUN_LINE_DELETE:
// FIXME: We use recordUndoInset when a change reflects more
cell(i).append(grid.cell(grid.index(r, c)));
}
cur.clearSelection(); // bug 393
- cur.bv().switchKeyMap();
finishUndo();
break;
}