: InsetText(bp), label("Label"), status_(status), openinlined_(false)
{
setAutoBreakRows(true);
- setDrawFrame(InsetText::ALWAYS);
+ setDrawFrame(true);
setFrameColor(LColor::collapsableframe);
setInsetName("Collapsable");
setButtonLabel();
}
-InsetBase * InsetCollapsable::editXY(LCursor & cur, int x, int y)
+InsetBase * InsetCollapsable::editXY(LCursor & cur, int x, int y) const
{
- cur.push(*this);
+ cur.push(const_cast<InsetCollapsable&>(*this));
//lyxerr << "InsetCollapsable: edit xy" << endl;
if (status_ == Collapsed) {
- return this;
+ return const_cast<InsetCollapsable*>(this);
}
return InsetText::editXY(cur, x, y);
}
void InsetCollapsable::priv_dispatch(LCursor & cur, FuncRequest & cmd)
{
// lyxerr << "InsetCollapsable::priv_dispatch (begin): cmd: " << cmd
-// << " button y: " << button_dim.y2
+// << " button y: " << button_dim.y2
// << " coll/inline/open: " << status_ << endl;
+
+ lyxerr << "InsetCollapsable::priv_dispatch (begin): cmd: " << cmd
+ << " cur: " << cur << " bvcur: " << cur.bv().cursor() << endl;
+
switch (cmd.action) {
case LFUN_MOUSE_PRESS:
if (status_ == Inlined)
InsetText::priv_dispatch(cur, cmd);
else if (status_ == Open && !hitButton(cmd))
InsetText::priv_dispatch(cur, cmd);
- else
- cur.noUpdate();
+ else
+ cur.noUpdate();
break;
case LFUN_MOUSE_MOTION: