Re: Action and ActionConvertors

[email protected] Sat, 26 Feb 2005 17:53:41 +0100
Newsgroups gmane.comp.embedded.carlsbad-cubes
Message-ID <[email protected]>
[email protected] wrote:
>>Have a careful look at the code, it is (or may be) used again ;) Probably you
> 
> 
> Well I was searching for the variable named 'action' which isn't found again,
> except in the mac_map. Which I confess, I do not understand!

A bit earlier in the code, the action attribute is made the first one, 
so the action variable is assigned first. When the loop encounters other 
attributes (the mac ones) it gets used again.
> Let me explain what I was trying to do. I may be going about it the wrong way,
> in which case someone may have a better idea.
> 
> I had thought to have a 'wizard' like interface, with back and forward buttons.
> The outer panel would have these buttons, arranged at the bottom. The panel
> would have a center panel for cards (cardlayout), and my wizardbase class would
> a) populate the cards panel using a constructor file list (ie call swix to make
> the UI for each card, setup the cardlayout etc.) , and b) provide a default
> implementation of the back and forward buttons, for going to the next and prev
> cards.
> 
> A class which wanted this wizard functionality would derive from wizardbase,
> and if it needed extra func. would simply override the behavior.
> 
> The difficulty is that swix directly accesses the client object field for
> action, and of course that means I have to put Action X in either the base or
> the child. If there had been a getter instead of a direct field access, I could
> have used method overriding to call different getters (in parent for default,
> and in child when new functionality is added).

Sorry if this is clumsy but why don't implement the actions in your 
wizard base (the usual, public action-way)? Just call a function 
(abstract or default implementation) which is the overiden by your 
wizared-enabled classes? You may then have/use your getters just through 
some kind of delegation to these public actions...


Frank