#include "lyxfunc.h"
#include "debug.h"
#include "LaTeXFeatures.h"
-#include "Painter.h"
-#include "font.h"
+#include "frontends/Painter.h"
+#include "frontends/font_metrics.h"
#include "lyxtext.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "insets/insettext.h"
#include "debug.h"
#include "gettext.h"
on_off ? Painter::line_onoffdash : Painter::line_solid);
}
on_off = !tabular->BottomLine(cell);
- pain.line(x,baseline + tabular->GetDescentOfRow(row),
- x2, baseline + tabular->GetDescentOfRow(row),
+ pain.line(x, baseline + tabular->GetDescentOfRow(row),
+ x2, baseline + tabular->GetDescentOfRow(row),
on_off ? LColor::tabularonoffline : LColor::tabularline,
on_off ? Painter::line_onoffdash : Painter::line_solid);
if (!tabular->LeftAlreadyDrawed(cell)) {
if ((column >= cs) && (column <= ce) && (row >= rs) && (row <= re)) {
int w = tabular->GetWidthOfColumn(cell);
- int h = tabular->GetAscentOfRow(row) + tabular->GetDescentOfRow(row);
- pain.fillRectangle(x, baseline - tabular->GetAscentOfRow(row),
+ int h = tabular->GetAscentOfRow(row) + tabular->GetDescentOfRow(row)-1;
+ pain.fillRectangle(x, baseline - tabular->GetAscentOfRow(row) + 1,
w, h, LColor::selection);
}
}
}
-void InsetTabular::edit(BufferView * bv, int x, int y, unsigned int button)
+void InsetTabular::edit(BufferView * bv, int x, int y, mouse_button::state button)
{
UpdatableInset::edit(bv, x, y, button);
setPos(bv, x, y);
clearSelection();
finishUndo();
- if (insetHit(bv, x, y) && (button != 3)) {
+ if (insetHit(bv, x, y) && (button != mouse_button::button3)) {
activateCellInsetAbs(bv, x, y, button);
}
}
}
-void InsetTabular::insetButtonPress(BufferView * bv, int x, int y, int button)
+void InsetTabular::insetButtonPress(BufferView * bv, int x, int y, mouse_button::state button)
{
- if (hasSelection() && (button == 3))
+ if (hasSelection() && (button == mouse_button::button3))
return;
if (hasSelection()) {
updateLocal(bv, CELL, false);
the_locking_inset = 0;
}
- if (button == 2) {
+ if (button == mouse_button::button2) {
localDispatch(bv, LFUN_PASTESELECTION, "paragraph");
return;
}
bool InsetTabular::insetButtonRelease(BufferView * bv,
- int x, int y, int button)
+ int x, int y, mouse_button::state button)
{
bool ret = false;
if (the_locking_inset)
ret = the_locking_inset->insetButtonRelease(bv, x - inset_x,
y - inset_y, button);
- if (button == 3 && !ret) {
+ if (button == mouse_button::button3 && !ret) {
bv->owner()->getDialogs()->showTabular(this);
return true;
}
}
-void InsetTabular::insetMotionNotify(BufferView * bv, int x, int y, int button)
+void InsetTabular::insetMotionNotify(BufferView * bv, int x, int y, mouse_button::state button)
{
if (the_locking_inset) {
the_locking_inset->insetMotionNotify(bv,
}
-void InsetTabular::insetKeyPress(XKeyEvent * xke)
-{
- if (the_locking_inset) {
- the_locking_inset->insetKeyPress(xke);
- return;
- }
-}
-
-
UpdatableInset::RESULT
InsetTabular::localDispatch(BufferView * bv, kb_action action,
string const & arg)
}
LyXFont font; // = the_locking_inset->GetFont(par, cursor.pos);
-
- int const asc = lyxfont::maxAscent(font);
- int const desc = lyxfont::maxDescent(font);
-
+
+ int const asc = font_metrics::maxAscent(font);
+ int const desc = font_metrics::maxDescent(font);
+
if (isCursorVisible())
bv->hideLockedInsetCursor();
else
return;
if (!isCursorVisible()) {
LyXFont font; // = GetFont(par, cursor.pos);
-
- int const asc = lyxfont::maxAscent(font);
- int const desc = lyxfont::maxDescent(font);
+
+ int const asc = font_metrics::maxAscent(font);
+ int const desc = font_metrics::maxDescent(font);
bv->fitLockedInsetCursor(cursor_.x(), cursor_.y(), asc, desc);
if (show)
bv->showLockedInsetCursor(cursor_.x(), cursor_.y(), asc, desc);
return;
}
LyXFont font;
+
+ int const asc = font_metrics::maxAscent(font);
+ int const desc = font_metrics::maxDescent(font);
+ resetPos(bv);
- int const asc = lyxfont::maxAscent(font);
- int const desc = lyxfont::maxDescent(font);
if (bv->fitLockedInsetCursor(cursor_.x(), cursor_.y(), asc, desc))
need_update = FULL;
}
if (!moved)
return FINISHED;
if (lock) { // behind the inset
- if (activateCellInset(bv, 0, 0, 0, true))
+ if (activateCellInset(bv, 0, 0, mouse_button::none, true))
return DISPATCHED;
}
resetPos(bv);
if (lock) {
bool rtl = tabular->GetCellInset(actcell)->paragraph()->
isRightToLeftPar(bv->buffer()->params);
- activateCellInset(bv, 0, 0, 0, !rtl);
+ activateCellInset(bv, 0, 0, mouse_button::none, !rtl);
}
resetPos(bv);
return true;
if (lock) {
bool rtl = tabular->GetCellInset(actcell)->paragraph()->
isRightToLeftPar(bv->buffer()->params);
- activateCellInset(bv, 0, 0, 0, !rtl);
+ activateCellInset(bv, 0, 0, mouse_button::none, !rtl);
}
resetPos(bv);
return true;
}
-bool InsetTabular::activateCellInset(BufferView * bv, int x, int y, int button,
+bool InsetTabular::activateCellInset(BufferView * bv, int x, int y, mouse_button::state button,
bool behind)
{
UpdatableInset * inset =
bool InsetTabular::activateCellInsetAbs(BufferView * bv, int x, int y,
- int button)
+ mouse_button::state button)
{
inset_x = cursor_.x()
- top_x + tabular->GetBeginningOfTextInCell(actcell);
// otherwise we have to lock the next inset and ask for it's selecttion
UpdatableInset * inset =
static_cast<UpdatableInset*>(tabular->GetCellInset(actcell));
- inset->edit(bv, 0, 0, 0);
+ inset->edit(bv, 0, 0, mouse_button::none);
string const str(selectNextWordInt(bv, value));
nodraw(false);
if (!str.empty())
{
if (buf.length() <= 0)
return true;
-
+
int cols = 1;
int rows = 1;
int maxCols = 1;