On Wed, 4 Apr 2001, Angus Leeming wrote:
> No, your right. But the thing isn't sophisticated enough to deal with it yet.
> Allan has been muttering that he's got some improvements up his sleeve.
I have to get them compiling first, and then I can try to transfer them
to the new scheme and get them working again. The improvements I have
only affects RadioButtionGroups. It effectively allows groups of widgets
(buttons, inputs etc.) to be controlled by radio-buttons but still obey
the read-only disabling of the button controller. More of a problem of
the button controller re-enabling things that should still be disabled.
I got started on this to get Paragraph working properly.
As for the problem at hand whatever_dialog.input() is meant to be the main
interface to directing the button controller. If there are widgets you
don't want disabled when a document is read-only don't register it. It
might however be handy to expose an iterator for the read-only list so the
list can be adjusted without having to do a complete rebuild of it.
I can certainly see that a callback for a dialog specific extension to the
buttoncontroller could be very handy for some fancy dialogs. This
callback should probably only handle stuff that the BC doesn't handle.
That is, it shouldn't touch anything that is already handled by the BC --
like registered read-only widgets and the R-O-A-C buttons. Otherwise you
should have written a dialog specific policy instead (or at least a
general one better suited to what you need).
##
A couple of things I noticed while taking a brief look at the sources:
ButtonController.h:69
template <class Button, class Widget>
void GuiBC<Button, Widget>::refresh()
{
if (okay_) {
- bool const enabled = bp().buttonStatus(ButtonPolicy::OKAY);
- setButtonEnabled(okay_, enabled);
+ setButtonEnabled(okay_,
+ bp().buttonStatus(ButtonPolicy::OKAY);
saves the use of a named variable. Likewise in 3 other places in
this function.
ButtonPolices.h:141
/// the dialog contents are read-only
SMI_READ_ONLY,
/// the dialog contents can be modified
SMI_READ_WRITE,
The policies are all designed so that you can continue modifying the
dialogs content if the _document_ is read-only. However, the ReadOnly
policies disable the Okay and Apply buttons until the document becomes
read-writeable again. Any widgets registered as read-only widgets will be
disabled but there is no requirement that you register any widgets. That
is a matter of interface design, or "feel", not one of necessity.
Maybe the above paragraph should be merged into the existing source
documentation.
I should hurry up and draw those policy state machine diagrams and that
can start the new GUII documentation.
Allan. (ARRae)