[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:

> Jean-Marc Lasgouttes wrote:
>> You should definitely not use these xxx_CODE tests. This is wrong in
>> 99% of cases. Test whether inset->editable() == IS_EDITABLE and then
>> call inset->edit(). The code will be much shorter IMO.
>
> Doesn't seem to work. Inset->edit() doesn't open the dialog (not
> surprising if you look at Inset::edit in Inset.cpp).

Sorry indeed. InsetCommand should maybe have something like
InsetGraphics:
void InsetGraphics::edit(Cursor & cur, bool)
{
        InsetGraphicsMailer(*this).showDialog(&cur.bv());
}

(and then should use it when handling MOUSE_RELEASE).

BTW, does the approach I proposed work with InsetGraphics?

>
> At least I detected an error: InsetIndex returns NOT_EDITABLE for editable(), 
> which is clearly wrong.

No, it returns IS_EDITABLE. InsetPrintIndex returns NOT_EDITABLE.

JMarc

Reply via email to