* Angus Leeming <[EMAIL PROTECTED]> [010329 16:15]:
> On Wednesday 28 March 2001 18:32, Baruch Even wrote:
> > Attached is a patch I prepared to refactor the ButtonControllerBase
> > hierarchy. The idea is to gather the similar in gnomeBC, xformsBC and
> > kdeBC into one thing, currently there is code duplication in them.
> > 
> > However when compiling with egcs 1.1.2 (gcc 2.91.66), The compiler fails
> > with a compiler error 980711, basically this is probably a bug in the
> > compiler, or at least so it says.
> > 
> > I thought maybe someone will find it interesting or has the time to
> > figure how to do it in a way so that the compiler will not die.
> 
> Baruch, I reworked it slightly; moved some public stuff to private and 
> rewrote setCancelCloseButton as setButtonLabel. It works perfectly for me.
> 
> It strikes me that this idea is very similar to Kalle's one about further, 
> closer integration of the GUIs; a first possible implementation in fact!

I've applied it locally and compiling now, I hope to have a response on
compilability soon enough. Though for now it seems good.

The reason I did this is that I created a bug because I needed to
duplicate code and I didn't duplicate it correctly. Or more correctly,
I haven't read the code close enough to figure that the cancel button is
only renamed and not disabled.

The code in all platforms is so similar that refactoring it just jumps
to the eye (at least, once you need to use it :-)

I'm not sure regarding the cancel button, the reason I took my approach
is that I want to use stock buttons and not just to rename the button
(stock buttons also have a special icon for them).

Maybe instead of having the names passed from the outside, we could have
a list of buttons, to currently include only Close & Cancel, and have an
enumartion for them, this way if I need to change a button I can use
either a stock button or the label. Just a thought.

Baruch

-- 
Baruch Even
http://baruch.ev-en.org/

Reply via email to