Commented out wrong code in text.C (Dekel?) some more changes for new

tabular layout!


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@879 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2000-07-12 15:09:01 +00:00
parent d02a3f2679
commit 71924df1d5
4 changed files with 32 additions and 5 deletions

View File

@ -105,7 +105,7 @@ void FormTabular::show()
} else { } else {
fl_show_form(dialog_->form_tabular, fl_show_form(dialog_->form_tabular,
FL_PLACE_MOUSE | FL_FREE_SIZE, FL_PLACE_MOUSE | FL_FREE_SIZE,
FL_FULLBORDER, FL_TRANSIENT,
_("Tabular Layout")); _("Tabular Layout"));
// u_ = d_->updateBufferDependent.connect(slot(this, // u_ = d_->updateBufferDependent.connect(slot(this,
// &FormTabular::update)); // &FormTabular::update));
@ -154,9 +154,12 @@ void FormTabular::update()
} }
} }
void FormTabular::updateInset(InsetTabular *) void FormTabular::updateInset(InsetTabular * ti)
{ {
update(); inset_ = ti;
if (ti && dialog_ && dialog_->form_tabular->visible) {
update();
}
} }
void FormTabular::input() void FormTabular::input()

View File

@ -47,7 +47,7 @@ using std::endl;
#define cellstart(p) ((p % 2) == 0) #define cellstart(p) ((p % 2) == 0)
#define USE_NEW_LAYOUT 1 //#define USE_NEW_LAYOUT 1
InsetTabular::InsetTabular(Buffer * buf, int rows, int columns) InsetTabular::InsetTabular(Buffer * buf, int rows, int columns)
{ {
@ -66,6 +66,7 @@ InsetTabular::InsetTabular(Buffer * buf, int rows, int columns)
actcell = 0; actcell = 0;
cursor.pos(0); cursor.pos(0);
sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0; sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0;
dialogs_ = 0;
need_update = INIT; need_update = INIT;
} }
@ -81,6 +82,7 @@ InsetTabular::InsetTabular(InsetTabular const & tab, Buffer * buf)
actcell = 0; actcell = 0;
cursor.pos(0); cursor.pos(0);
sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0; sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0;
dialogs_ = 0;
need_update = INIT; need_update = INIT;
} }
@ -91,6 +93,8 @@ InsetTabular::~InsetTabular()
#ifdef USE_NEW_LAYOUT #ifdef USE_NEW_LAYOUT
if (buffer->getUser()) if (buffer->getUser())
buffer->getUser()->owner()->getDialogs()->hideTabular(this); buffer->getUser()->owner()->getDialogs()->hideTabular(this);
else if (dialogs_)
dialogs_->hideTabular(this);
#endif #endif
} }
@ -430,7 +434,12 @@ bool InsetTabular::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset,
if ((inset->LyxCode() == TABULAR_CODE) && if ((inset->LyxCode() == TABULAR_CODE) &&
!the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE)) !the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE))
{ {
#ifdef USE_NEW_LAYOUT
dialogs_ = bv->owner()->getDialogs();
dialogs_->updateTabular(const_cast<InsetTabular *>(this));
#else
UpdateLayoutTabular(true, const_cast<InsetTabular *>(this)); UpdateLayoutTabular(true, const_cast<InsetTabular *>(this));
#endif
oldcell = actcell; oldcell = actcell;
} }
return true; return true;
@ -524,7 +533,8 @@ void InsetTabular::InsetButtonRelease(BufferView * bv,
} }
} }
#ifdef USE_NEW_LAYOUT #ifdef USE_NEW_LAYOUT
bv->owner()->getDialogs()->showTabular(this); dialogs_ = bv->owner()->getDialogs();
dialogs_->showTabular(this);
#if 0 #if 0
else if (ocell != actcell) else if (ocell != actcell)
bview->getOwner()->getPopups().updateTabular(); bview->getOwner()->getPopups().updateTabular();
@ -733,8 +743,13 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
break; break;
case LFUN_LAYOUT_TABLE: case LFUN_LAYOUT_TABLE:
{ {
#ifdef USE_NEW_LAYOUT
dialogs_ = bv->owner()->getDialogs();
dialogs_->showTabular(this);
#else
int flag = (arg == "true"); int flag = (arg == "true");
MenuLayoutTabular(flag, this); MenuLayoutTabular(flag, this);
#endif
} }
break; break;
default: default:
@ -937,7 +952,12 @@ void InsetTabular::resetPos(BufferView * bv) const
if ((!the_locking_inset || if ((!the_locking_inset ||
!the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE)) && !the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE)) &&
(actcell != oldcell)) { (actcell != oldcell)) {
#ifdef USE_NEW_LAYOUT
dialogs_ = bv->owner()->getDialogs();
dialogs_->updateTabular(const_cast<InsetTabular *>(this));
#else
UpdateLayoutTabular(true, const_cast<InsetTabular *>(this)); UpdateLayoutTabular(true, const_cast<InsetTabular *>(this));
#endif
oldcell = actcell; oldcell = actcell;
} }
} }

View File

@ -225,5 +225,6 @@ private:
bool no_selection; bool no_selection;
mutable bool locked; mutable bool locked;
mutable UpdateCodes need_update; mutable UpdateCodes need_update;
mutable Dialogs * dialogs_;
}; };
#endif #endif

View File

@ -4769,10 +4769,13 @@ int LyXText::GetColumnNearX(BufferView * bview, Row * row, int & x,
if (row->pos() > last) // Row is empty? if (row->pos() > last) // Row is empty?
c = row->pos(); c = row->pos();
#warning This is wrong, please have a look Dekel (Jug)
#if 0
else if (lastrow && else if (lastrow &&
( (rtl && vc == row->pos()&& x < tmpx - 5) || ( (rtl && vc == row->pos()&& x < tmpx - 5) ||
(!rtl && vc == last + 1 && x > tmpx + 5) )) (!rtl && vc == last + 1 && x > tmpx + 5) ))
c = last + 1; c = last + 1;
#endif
else if (vc == row->pos() || else if (vc == row->pos() ||
(row->par()->table (row->par()->table
&& vc <= last && row->par()->IsNewline(vc-1)) ) { && vc <= last && row->par()->IsNewline(vc-1)) ) {