mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Finally fixed the problems with clicking on insets
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@625 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c5609edc64
commit
e5d7d21ed7
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
||||
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
|
||||
|
@ -662,7 +662,7 @@ void BufferView::workAreaButtonPress(int xpos, int ypos, unsigned int button)
|
||||
|
||||
/* Check whether the inset was hit. If not reset mode,
|
||||
otherwise give the event to the inset */
|
||||
if (inset_hit) {
|
||||
if (inset_hit == the_locking_inset) {
|
||||
the_locking_inset->
|
||||
InsetButtonPress(this,
|
||||
xpos, ypos,
|
||||
@ -673,7 +673,8 @@ void BufferView::workAreaButtonPress(int xpos, int ypos, unsigned int button)
|
||||
}
|
||||
}
|
||||
|
||||
selection_possible = true;
|
||||
if (!inset_hit)
|
||||
selection_possible = true;
|
||||
screen->HideCursor();
|
||||
|
||||
// Right button mouse click on a table
|
||||
@ -730,12 +731,15 @@ void BufferView::workAreaButtonPress(int xpos, int ypos, unsigned int button)
|
||||
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
|
||||
UpdatableInset *inset = (UpdatableInset *)inset_hit;
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -869,7 +873,13 @@ void BufferView::workAreaButtonRelease(int x, int y, unsigned int button)
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -964,7 +974,10 @@ Inset * BufferView::checkInsetHit(int & x, int & y)
|
||||
|
||||
int y_tmp = y + screen->first;
|
||||
|
||||
LyXCursor & old_cursor = text->cursor;
|
||||
text->SetCursorFromCoordinates(x,y);
|
||||
LyXCursor & cursor = text->cursor;
|
||||
|
||||
bool is_rtl = text->real_current_font.isVisibleRightToLeft();
|
||||
|
||||
if (cursor.pos < cursor.par->Last()
|
||||
@ -1018,9 +1031,9 @@ Inset * BufferView::checkInsetHit(int & x, int & y)
|
||||
return tmpinset;
|
||||
} else {
|
||||
text->CursorRight();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
text->SetCursor(old_cursor.par, old_cursor.pos);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -136,11 +136,8 @@ void InsetCollapsable::Edit(BufferView *bv, int x, int y, unsigned int 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);
|
||||
}
|
||||
|
@ -62,3 +62,11 @@ void InsetERT::SetFont(BufferView *, LyXFont const &, bool)
|
||||
_("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;
|
||||
}
|
||||
|
@ -44,6 +44,8 @@ public:
|
||||
///
|
||||
void SetFont(BufferView *, LyXFont const &, bool toggleall = false);
|
||||
///
|
||||
void Edit(BufferView *, int, int, unsigned int);
|
||||
///
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -628,15 +628,17 @@ void InsetFormula::UpdateLocal(BufferView * bv)
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -645,8 +647,8 @@ void InsetFormula::InsetButtonPress(BufferView * bv,
|
||||
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);
|
||||
}
|
||||
|
@ -833,8 +833,8 @@ void LyXText::RedoParagraphs(LyXCursor const & cur,
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user