+2000-12-22 Juergen Vigna <jug@sad.it>
+
+ * src/insets/insettabular.C (InsetButtonPress): do nothing if we
+ have a selection and button == 3.
+ (UpdateLocal): if what == INIT clear selection if existent!
+ (InsetButtonPress): don't activate the cell inset on button==3
+ (Edit): ditto
+ (LocalDispatch): move curor up/down if exiting an inset which this
+ keys.
+
+2000-12-20 Juergen Vigna <jug@sad.it>
+
+ * src/mathed/formula.C (LocalDispatch): return UNDISPATCHED when
+ calling for the math-panel (do not unlock the math-inset if locked)!
+
+ * src/text.C (GetVisibleRow): fixed drawing of depth lines inside
+ text-insets (with x-offset).
+
+ * src/tabular.C (TeXCellPreamble): fixed wrong output of special
+ alignment of multicolumn-cells.
+
+2000-12-19 Juergen Vigna <jug@sad.it>
+
+ * src/lyxfunc.C (Dispatch):
+ * src/bufferview_funcs.C (changeDepth): implemented DEPTH functions
+ for insettext.
+
2000-12-19 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/WorkArea.C (work_area_handler): simplify the key/keysym
src/frontends/kde/tocdlg.C
src/frontends/kde/urldlg.C
src/frontends/xforms/FormBase.h
-src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCitation.C
-src/frontends/xforms/form_copyright.C
+src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCopyright.C
-src/frontends/xforms/form_document.C
+src/frontends/xforms/form_copyright.C
src/frontends/xforms/FormDocument.C
-src/frontends/xforms/form_error.C
+src/frontends/xforms/form_document.C
src/frontends/xforms/FormError.C
-src/frontends/xforms/form_graphics.C
+src/frontends/xforms/form_error.C
src/frontends/xforms/FormGraphics.C
-src/frontends/xforms/form_index.C
+src/frontends/xforms/form_graphics.C
src/frontends/xforms/FormIndex.C
+src/frontends/xforms/form_index.C
src/frontends/xforms/FormInset.h
-src/frontends/xforms/form_paragraph.C
src/frontends/xforms/FormParagraph.C
-src/frontends/xforms/form_preferences.C
+src/frontends/xforms/form_paragraph.C
src/frontends/xforms/FormPreferences.C
-src/frontends/xforms/form_print.C
+src/frontends/xforms/form_preferences.C
src/frontends/xforms/FormPrint.C
-src/frontends/xforms/form_ref.C
+src/frontends/xforms/form_print.C
src/frontends/xforms/FormRef.C
-src/frontends/xforms/form_tabular.C
+src/frontends/xforms/form_ref.C
src/frontends/xforms/FormTabular.C
-src/frontends/xforms/form_tabular_create.C
+src/frontends/xforms/form_tabular.C
src/frontends/xforms/FormTabularCreate.C
-src/frontends/xforms/form_toc.C
+src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/FormToc.C
-src/frontends/xforms/form_url.C
+src/frontends/xforms/form_toc.C
src/frontends/xforms/FormUrl.C
+src/frontends/xforms/form_url.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/xform_helpers.C
// Change environment depth.
// if decInc >= 0, increment depth
// if decInc < 0, decrement depth
-void changeDepth(BufferView * bv, int decInc)
+void changeDepth(BufferView * bv, LyXText * text, int decInc)
{
- if (!bv->available()) return;
+ if (!bv->available() || !text)
+ return;
bv->hideCursor();
bv->update(BufferView::SELECT|BufferView::FITCUR);
if (decInc >= 0)
- bv->text->IncDepth(bv);
+ text->IncDepth(bv);
else
- bv->text->DecDepth(bv);
+ text->DecDepth(bv);
+ if (text->inset_owner)
+ bv->updateInset((Inset *)text->inset_owner, true);
bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
bv->owner()->getMiniBuffer()
->Set(_("Changed environment depth"
class BufferView;
class LyXFont;
+class LyXText;
#ifndef NEW_INSETS
///
///
extern void Tex(BufferView *);
///
-extern void changeDepth(BufferView *, int);
+extern void changeDepth(BufferView *, LyXText *, int);
///
extern void Free(BufferView *);
///
sel_pos_start = sel_pos_end = cursor.pos();
sel_cell_start = sel_cell_end = actcell;
bv->text->FinishUndo();
- if (InsetHit(bv, x, y)) {
+ if (InsetHit(bv, x, y) && (button != 3)) {
ActivateCellInset(bv, x, y, button);
}
// UpdateLocal(bv, NONE, false);
{
if (need_update < what) // only set this if it has greater update
need_update = what;
+ if ((what == INIT) && hasSelection())
+ clearSelection();
// Dirty Cast! (Lgb)
if (need_update != NONE) {
bv->updateInset(const_cast<InsetTabular *>(this), mark_dirty);
void InsetTabular::InsetButtonPress(BufferView * bv, int x, int y, int button)
{
- if (hasSelection() && (button != 3)) {
+ if (hasSelection() && (button == 3))
+ return;
+
+ if (hasSelection()) {
clearSelection();
UpdateLocal(bv, SELECTION, false);
}
+
no_selection = false;
int const ocell = actcell;
UpdateLocal(bv, NONE, false);
sel_pos_start = sel_pos_end = cursor.pos();
sel_cell_start = sel_cell_end = actcell;
+ if (button == 3) {
+ if ((ocell != actcell) && the_locking_inset) {
+ the_locking_inset->InsetUnlock(bv);
+ the_locking_inset = 0;
+ }
+ ShowInsetCursor(bv);
+ return;
+ }
bool const inset_hit = InsetHit(bv, x, y);
the_locking_inset->ToggleInsetCursor(bv);
return result;
} else if (result == FINISHED) {
+ result = DISPATCHED;
if ((action == LFUN_RIGHT) || (action == -1)) {
cursor.pos(inset_pos + 1);
resetPos(bv);
+ } else if (action == LFUN_DOWN) {
+ if (moveDown(bv) == FINISHED) {
+ bv->unlockInset(this);
+ result = FINISHED;
+ }
+ } else if (action == LFUN_UP) {
+ if (moveUp(bv) == FINISHED) {
+ bv->unlockInset(this);
+ result = FINISHED;
+ }
}
sel_pos_start = sel_pos_end = cursor.pos();
sel_cell_start = sel_cell_end = actcell;
the_locking_inset=0;
ShowInsetCursor(bv);
- result = DISPATCHED;
return result;
}
}
break;
case LFUN_DEPTH:
- changeDepth(owner->view(), 0);
+ changeDepth(owner->view(), text, 0);
break;
case LFUN_DEPTH_MIN:
- changeDepth(owner->view(), -1);
+ changeDepth(owner->view(), text, -1);
break;
case LFUN_DEPTH_PLUS:
- changeDepth(owner->view(), 1);
+ changeDepth(owner->view(), text, 1);
break;
case LFUN_FREE:
mathcursor->setLastCode(LM_TC_TEX);
}
UpdateLocal(bv);
+ } else if (action == LFUN_MATH_PANEL) {
+ result = UNDISPATCHED;
} else {
// lyxerr << "Closed by action " << action << endl;
result = FINISHED;
if (mathcursor->Selection() || was_selection)
ToggleInsetSelection(bv);
- if ((result == DISPATCHED) || (result == DISPATCHED_NOUPDATE))
+ if ((result == DISPATCHED) || (result == DISPATCHED_NOUPDATE) ||
+ (result == UNDISPATCHED))
ShowInsetCursor(bv);
else
bv->unlockInset(this);
}
if (IsMultiColumn(cell)) {
os << "\\multicolumn{" << cells_in_multicolumn(cell) << "}{";
- if (!cellinfo_of_cell(cell+1)->align_special.empty()) {
- os << cellinfo_of_cell(cell+1)->align_special << "}{";
+ if (!cellinfo_of_cell(cell)->align_special.empty()) {
+ os << cellinfo_of_cell(cell)->align_special << "}{";
} else {
if (LeftLine(cell))
os << '|';
for (int i = 1; i <= depth; ++i) {
int const line_x = (LYX_PAPER_MARGIN / 5) *
- (i + minipage) + box_x;
+ (i + minipage) + box_x + x_offset;
pain.line(line_x, y_offset, line_x,
y_offset + row_ptr->height() - 1 - (i - next_depth - 1) * 3,
LColor::depthbar);