-/* This file is part of
- * ======================================================
+/**
+ * \file insettabular.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * LyX, The Document Processor
+ * \author Jürgen Vigna
*
- * Copyright 2001 The LyX Team.
- *
- * ======================================================
+ * Full author contact details are available in file CREDITS
*/
#include <config.h>
{ LyXTabular::ALIGN_LEFT, "align-left" },
{ LyXTabular::ALIGN_RIGHT, "align-right" },
{ LyXTabular::ALIGN_CENTER, "align-center" },
+ { LyXTabular::ALIGN_BLOCK, "align-block" },
{ LyXTabular::VALIGN_TOP, "valign-top" },
{ LyXTabular::VALIGN_BOTTOM, "valign-bottom" },
{ LyXTabular::VALIGN_CENTER, "valign-center" },
bool const inset_hit = insetHit(bv, cmd.x, cmd.y);
- FuncRequest cmd1 = cmd;
- cmd1.x -= inset_x;
- cmd1.y -= inset_y;
-
if ((ocell == actcell) && the_locking_inset && inset_hit) {
resetPos(bv);
+ FuncRequest cmd1 = cmd;
+ cmd1.x -= inset_x;
+ cmd1.y -= inset_y;
the_locking_inset->localDispatch(cmd1);
return;
}
lyxerr[Debug::INSETS] << "Cannot lock inset" << endl;
return;
}
+ FuncRequest cmd1 = cmd;
+ cmd1.x -= inset_x;
+ cmd1.y -= inset_y;
the_locking_inset->localDispatch(cmd1);
return;
}
return DISPATCHED;
case LFUN_MOUSE_RELEASE:
- lfunMouseRelease(cmd);
return lfunMouseRelease(cmd) ? DISPATCHED : UNDISPATCHED;
case LFUN_SHIFT_TAB:
case LFUN_WORDLEFTSEL:
case LFUN_WORDRIGHT:
case LFUN_WORDRIGHTSEL:
+ case LFUN_WORDSEL:
case LFUN_DOWN_PARAGRAPH:
case LFUN_DOWN_PARAGRAPHSEL:
case LFUN_UP_PARAGRAPH:
#warning This should be fixed in the right manner (20011128 Jug)
#endif
// fast hack to fix infinite repaintings!
- if (in_reset_pos > 10)
+ if (in_reset_pos > 0)
return;
int cell = 0;
case LyXTabular::ALIGN_CENTER:
setAlign = LYX_ALIGN_CENTER;
break;
+ case LyXTabular::ALIGN_BLOCK:
+ setAlign = LYX_ALIGN_BLOCK;
+ break;
case LyXTabular::M_VALIGN_TOP:
case LyXTabular::VALIGN_TOP:
setVAlign = LyXTabular::LYX_VALIGN_TOP;
}
updateLocal(bv, INIT, true);
}
+
+ if (vallen.zero()
+ && tabular->GetAlignment(actcell, true) == LYX_ALIGN_BLOCK)
+ tabularFeatures(bv, LyXTabular::ALIGN_CENTER, string());
+ else if (!vallen.zero()
+ && tabular->GetAlignment(actcell, true) != LYX_ALIGN_BLOCK)
+ tabularFeatures(bv, LyXTabular::ALIGN_BLOCK, string());
}
break;
case LyXTabular::SET_MPWIDTH:
case LyXTabular::ALIGN_LEFT:
case LyXTabular::ALIGN_RIGHT:
case LyXTabular::ALIGN_CENTER:
+ case LyXTabular::ALIGN_BLOCK:
for (int i = sel_row_start; i <= sel_row_end; ++i)
for (int j = sel_col_start; j <= sel_col_end; ++j)
tabular->SetAlignment(
if (len.zero())
return -1;
- return len.inPixels(latexTextWidth(bv), bv->text->defaultHeight());
+ return len.inPixels(latexTextWidth(bv));
}
case LyXTabular::ALIGN_CENTER:
status.setOnOff(tabular->GetAlignment(actcell, flag) == LYX_ALIGN_CENTER);
break;
+ case LyXTabular::ALIGN_BLOCK:
+ status.disabled(tabular->GetPWidth(actcell).zero());
+ status.setOnOff(tabular->GetAlignment(actcell, flag) == LYX_ALIGN_BLOCK);
+ break;
case LyXTabular::M_VALIGN_TOP:
flag = false;
case LyXTabular::VALIGN_TOP:
ostringstream sstr;
paste_tabular->ascii(bv->buffer(), sstr,
(int)parOwner()->params().depth(), true, '\t');
- bv->stuffClipboard(sstr.str().c_str());
+ bv->stuffClipboard(STRCONV(sstr.str()));
return true;
}