On Saturday 31 March 2001 13:30, Lars Gullik Bj�nnes wrote:
> InsetFloat already exist so it would have to be a InsetFloatList.
>
> I do not think that InsetFloatList should be an InsetCommand, it could
> be but that would be misuse of the InsetCommand (hacking at the
> InsetParams...) (btw. I also thing that some of the insets that now
> inherig from InsetCommand should not really be doing so)
Agreed (both points). A lot of the insets are looking rather creaky; they
could do with a little more love and attention. However, the effort that's
gone into the GUI stuff should reap rewards here too because it's only now
that it becomes clear exactly what interface the GUIs require of the insets.
Every(? I think so) inset with an associated dialog should:
1. Have a params struct containing the data.
2. The dialog can be launched in two ways.
a) click on the inset to emit a showInset(Inset const &) signal.
b) from the menubar/minibuffer, calling
LyXFunc::Dispatch(kb_action, string const &)
The Dispatch routine should expand the string (from the minibuffer)
into the appropriate Params struct and emit a
showParams(Params const &) signal. This is different to the current
behaviour where the Dispatch emits a createInset(string const &)
signal and the expansion is performed in the controller.
3. On launching the dialog, a local copy of the Params struct is made
available to the View to modify.
3. The controller applies the modified Params in one of two ways.
a) direct to an existing inset.
b) By converting the Params struct to a string and calling
LyXFunc::Dispatch(kb_action, string const &).
The Dispatch routine should expand the string back into the
appropriate Params struct and create an inset for it.
4. This means that the params struct must have methods to convert to/from a
string. It must also have an operator!=() function/method.
This defines entirely what functionality the popups require of the insets. I
can use the controlInset template to force any new Inset to have these
methods. Ie, if the Inset doesn't have them, the controller won't compile. I
can go power crazy and rule the world! He, he, he!
Now that this (functionality requirement not my lust for world domination) is
clear, I too will start to focus on the insets themselves again. But first,
I'll try and finish the controller-view split so that the GUI porters have a
fairly stable API with which to play.
Angus