On Tuesday 19 March 2002 4:09 pm, Jean-Marc Lasgouttes wrote:
> >>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
>
> Angus> JMarc, I have fixed things in my tree here so that this should
> Angus> be pretty easy. All insets with dialogs are now derived from
> Angus> withDialog, so:
>
> What about things like minipage? THey are both collabsable and have a
> dialog, so we have too think about a reasonable interface.

You have created an (LFUN_INSET_TOGGLE, toggle-inset) interface that opens 
and closes collapsable insets. I suggest that we leave this as-is and define 
a new (LFUN_INSET_DIALOG_TOGGLE, toggle-inset-dialog) interface.

This would need new methods in Inset
        virtual bool hasDialog() const { return false; }
        virtual bool dialogConnected() const { return false; }
        virtual void openDialog(BufferView *) {}
        virtual void closeDialog() {}

which could be overridden in (say) InsetCommand
        virtual bool hasDialog() const { return true; }
        virtual bool dialogConnected() const { return connected(); }
        virtual bool openDialog(BufferView * bv) { edit(bv, 0, 0, 0); }
        virtual void closeDialog() { hideDialog(); }

where connected() and hideDialog() are methods of my withDialog class.

Please comment on this and on the names of the LFUNs etc. I'm not very 
creative at such things!

For now I've overridden the isOpen(), open(BufferView *), close(BufferView *) 
methods in InsetCommand and all works well.

> Angus> That is, the all important SigC::Connection has been moved from
> Angus> the controllers to the inset, where it really belongs.
>
> Good.
>
> Angus> Remind me again about the LFUNs and how they are to be used.
>
> The LFUN is TOGGLE_INSET, and the relevant code is text2.C,
> LyXText::toggleInset.

Indeed, I've found it. See above.

Angus

Reply via email to