On Tuesday 19 March 2002 3:30 pm, Angus Leeming wrote:
> 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.

Or alternatively and more simply:

        Inset::toggleDialog(BufferView *) {}

        InsetCommand::toggleDialog(BufferView * bv) {
                if (connected())
                        hideDialog();
                else
                        edit(bv, 0, 0, 0);
        }

Angus

Reply via email to