John Spray wrote:

> On Mon, 2004-10-11 at 15:24, Angus Leeming wrote:
>> I've just noticed that you don't appear to use the ButtonController. You
>> should. It's powerful and useful.
> Where specifically do you suggest that it be used, and how does it
> improve matters?  Is it documented?

Yes, it is documented. Either read
        BCView.h  ButtonController.h  ButtonPolicies.h
in frontends/controllers/

or 'make doxydoc' and read the generated html.

Of course, that isn't necessarily useful, so just follow the example of the
XForms frontend:

void GChanges::doBuild()
{
        // disable for read-only documents
        bcview().addReadOnly(acceptbutton_);
        bcview().addReadOnly(rejectbutton_);
        bcview().addReadOnly(nextbutton_);
}

Thereafter all you need is:

void GChanges::promptChange()
{
        bc().readonly(false);
}


void GChanges::promptDismiss()
{
        bc().readonly(true);
}

Ok, I realise that this isn't really a 'readonly' toggle, but if you want
to add a ChangesPolicy, be my guest...

-- 
Angus

Reply via email to