This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [SetupXP] The two styles for handling activation refusal


On Sat, 2003-07-19 at 23:40, Max Bowsher wrote:
> Gary's current SetupXP patchset calls 2 member functions on page activation:
> OnActivate (returns void), and OnAcceptActivation (returns bool). I think
> this is unnecessarily messy. AFAICS, OnAcceptActivation only exists to
> prevent the need to change the return type of the existing OnActivate
> function.
> 
> I would very much prefer changing OnActivate to return bool, combining the
> purpose of both functions. Yes, this does require changes in all derived
> classes, but the changes are trivial, and the end result is a cleaner, more
> logical API.

If its what I think you are talking about, I disagree.

OnAcceptActivation was, IIRC, prompted to allow pages to accept or
refuse activation. Refusing == don't display. Accept = display.

OnActivation, is called on each activation, which only occurs
post-accept checking.

OnAcceptActivation can have default behaviour for the common case,
reducing duplicate code over a conflated function that both activates
and indicates whether it's willing to be activated.

Naming wise though, I'd call OnAcceptActivation canBeActivated or some
other query-indicating function.

Again, all the above is based on recollection..

Rob
-- 
GPG key available at: <http://members.aardvark.net.au/lifeless/keys.txt>.

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]