+2000-03-24 Juergen Vigna <jug@sad.it>
+
+ * src/insets/insetcollapsable.C (Edit):
+ * src/mathed/formula.C (InsetButtonRelease):
+ (InsetButtonPress): fixed for new handling of ButtonPress/Release
+ handling.
+
+ * src/BufferView.C (workAreaButtonPress):
+ (workAreaButtonRelease):
+ (checkInsetHit): Finally fixed the clicking on insets be handled
+ correctly!
+
+ * src/insets/insetert.C (Edit): inserted this call so that ERT
+ insets work always with LaTeX-font
+
2000-03-21 Kayvan A. Sylvan <kayvan@camel.internal.sylvan.com>
* src/lyx_main.C (easyParse): Removed misplaced gui=false which
2000-03-21 Kayvan A. Sylvan <kayvan@camel.internal.sylvan.com>
* src/lyx_main.C (easyParse): Removed misplaced gui=false which
/* Check whether the inset was hit. If not reset mode,
otherwise give the event to the inset */
/* Check whether the inset was hit. If not reset mode,
otherwise give the event to the inset */
+ if (inset_hit == the_locking_inset) {
the_locking_inset->
InsetButtonPress(this,
xpos, ypos,
the_locking_inset->
InsetButtonPress(this,
xpos, ypos,
- selection_possible = true;
+ if (!inset_hit)
+ selection_possible = true;
screen->HideCursor();
// Right button mouse click on a table
screen->HideCursor();
// Right button mouse click on a table
updateScrollbar();
// Single left click in math inset?
updateScrollbar();
// Single left click in math inset?
- if (inset_hit != 0 && inset_hit->Editable()==Inset::HIGHLY_EDITABLE) {
+ if ((inset_hit != 0) &&
+ (inset_hit->Editable()==Inset::HIGHLY_EDITABLE)) {
// Highly editable inset, like math
// Highly editable inset, like math
+ UpdatableInset *inset = (UpdatableInset *)inset_hit;
selection_possible = false;
owner_->updateLayoutChoice();
selection_possible = false;
owner_->updateLayoutChoice();
- owner_->getMiniBuffer()->Set(inset_hit->EditMessage());
- inset_hit->Edit(this, xpos, ypos, button);
+ owner_->getMiniBuffer()->Set(inset->EditMessage());
+ inset->InsetButtonPress(this, xpos, ypos, button);
+ inset->Edit(this, xpos, ypos, button);
}
owner_->getMiniBuffer()->Set(inset_hit->EditMessage());
}
owner_->getMiniBuffer()->Set(inset_hit->EditMessage());
- inset_hit->Edit(this, x, y, button);
+ if (inset_hit->Editable()==Inset::HIGHLY_EDITABLE) {
+ // Highly editable inset, like math
+ UpdatableInset *inset = (UpdatableInset *)inset_hit;
+ inset->InsetButtonRelease(this, x, y, button);
+ } else {
+ inset_hit->Edit(this, x, y, button);
+ }
int y_tmp = y + screen->first;
int y_tmp = y + screen->first;
+ LyXCursor & old_cursor = text->cursor;
+ text->SetCursorFromCoordinates(x,y);
LyXCursor & cursor = text->cursor;
LyXCursor & cursor = text->cursor;
bool is_rtl = text->real_current_font.isVisibleRightToLeft();
if (cursor.pos < cursor.par->Last()
bool is_rtl = text->real_current_font.isVisibleRightToLeft();
if (cursor.pos < cursor.par->Last()
return tmpinset;
} else {
text->CursorRight();
return tmpinset;
} else {
text->CursorRight();
+ text->SetCursor(old_cursor.par, old_cursor.pos);
collapsed = false;
UpdateLocal(bv, true);
InsetText::Edit(bv, 0, 0, button);
collapsed = false;
UpdateLocal(bv, true);
InsetText::Edit(bv, 0, 0, button);
- } else if (button && (x < button_x) &&
- (y < (labelfont.maxDescent()+labelfont.maxAscent()))) {
- collapsed = true;
- UpdateLocal(bv, false);
- bv->unlockInset(this);
+ } else if (button && (x < button_x)) {
+ return;
} else {
InsetText::Edit(bv, x-top_x, y, button);
}
} else {
InsetText::Edit(bv, x-top_x, y, button);
}
_("Not permitted to change font-types inside ERT-insets!"),
_("Sorry."));
}
_("Not permitted to change font-types inside ERT-insets!"),
_("Sorry."));
}
+
+void InsetERT::Edit(BufferView * bv, int x, int y, unsigned int button)
+{
+ InsetCollapsable::Edit(bv, x, y, button);
+ LyXFont font(LyXFont::ALL_SANE);
+ font.setLatex (LyXFont::ON);
+ current_font = real_current_font = font;
+}
///
void SetFont(BufferView *, LyXFont const &, bool toggleall = false);
///
///
void SetFont(BufferView *, LyXFont const &, bool toggleall = false);
///
+ void Edit(BufferView *, int, int, unsigned int);
+ ///
void InsetFormula::InsetButtonRelease(BufferView * bv,
int x, int y, int /*button*/)
{
void InsetFormula::InsetButtonRelease(BufferView * bv,
int x, int y, int /*button*/)
{
- HideInsetCursor(bv);
- x += par->xo;
- y += par->yo;
- mathcursor->SetPos(x, y);
- ShowInsetCursor(bv);
- if (sel_flag) {
- sel_flag = false;
- sel_x = sel_y = 0;
- bv->updateInset(this, false);
+ if (mathcursor) {
+ HideInsetCursor(bv);
+ x += par->xo;
+ y += par->yo;
+ mathcursor->SetPos(x, y);
+ ShowInsetCursor(bv);
+ if (sel_flag) {
+ sel_flag = false;
+ sel_x = sel_y = 0;
+ bv->updateInset(this, false);
+ }
int x, int y, int /*button*/)
{
sel_flag = false;
int x, int y, int /*button*/)
{
sel_flag = false;
- sel_x = x; sel_y = y;
- if (mathcursor->Selection()) {
+ sel_x = x; sel_y = y;
+ if (mathcursor && mathcursor->Selection()) {
mathcursor->SelClear();
bv->updateInset(this, false);
}
mathcursor->SelClear();
bv->updateInset(this, false);
}
first_phys_par = tmprow->par->FirstPhysicalPar();
// find the first row of the paragraph
if (first_phys_par != tmprow->par)
first_phys_par = tmprow->par->FirstPhysicalPar();
// find the first row of the paragraph
if (first_phys_par != tmprow->par)
- while (tmprow->previous
- && tmprow->previous->par != first_phys_par) {
+ while (tmprow->previous &&
+ (tmprow->previous->par != first_phys_par)) {
tmprow = tmprow->previous;
y -= tmprow->height;
}
tmprow = tmprow->previous;
y -= tmprow->height;
}