On Mon, 15 Jan 2001, Angus Leeming wrote:

> Hello, Allan.

Hi Angus!

> Let me start with a justification of all this: I'd like to ease the pain of
> porting the dialogs to other GUIs by ensuring that they have only a minimum
> of things to do. We have occasional complaints from John and Marco about
> breaking their ports. Matthias Ettrich was rather more vocal. They are
> expressing a valid point. It's hard to keep up when the rules keep changing.
>
> Each dialog exists to change some variables. Nothing more. It should,
> therefore, be passed only those variables (preferably as a Param struct). It
> should also have access to functions linked to the four Apply, Ok, Cancel,
> Reset buttons. Nothing more.
>
> Everything else about the dialog, the signals it connects and disconnects to
> etc, should be controlled by a common Controller class. The GUIs need not
> worry about this. I've implemented this successfully.
>
> In the same way, we can define a subset of the ButtonController class that is
> GUI-I. The GUI View need know about only the BC::valid() method called when
> an input is made and in the xforms case, about methods passed an FL_OBJECT *.
> You've written the Controller beautifully (serious here) so that the
> BC::apply(), ok() etc buttons know nothing about the xforms implementation.

Okay, sounds reasonable.

> I have it all working here. A ButtonController base class and a
> FormButtonController derived class containing xforms-specific stuff. I have a

Please change the name from FormButtonController.  Only dialogs (or forms
in XForms speak) should be called FormXxxx.

> ControlledButtonDialog abstract class that has a ButtonController * and 4
> methods, ApplyButton(), OkButton, CancelButton() and RestoreButton() that
> does exactly as the static ApplyBC() etc used to do. All dialog-specific
> controllers can be derived from this.
>
> It looks and feels clean and elegant and MINIMAL. That means, it should be
> readily understandable to John, Marco, whoever wants to implement another GUI.
>
> If you want a look, just ask. Otherwise, I'll post when it's clean. I send
> enough junk to this list as-is!

I won't be able to look at it for two weeks at least so take your time and
get it really pretty.  Right now I gotta stop reading my email and get
this LDN finished so I can get some sleep tonight.

Allan. (ARRae)

Reply via email to