On Thu, Oct 02, 2003 at 04:46:31PM +0000, Angus Leeming spake thusly:
 
> Martin Vermeer wrote:
> 
> >> Ain't this "Boxed"? (That's why using the enum is safer...)
> >> 
> >> src/frontends/controllers/ControlBox.C
> >> +bool ControlBox::initialiseParams(string const & data)
> >> +{
> >> +       InsetBoxParams params("box");
> > 
> > I'm not sure if it's actually used. But look at xforms/Dialogs.C:
> > there the name "box" is used for all box types together.
> > 
> > I cannot say I quite grasp the logic of all this.
> 
> Admit it. It's a fudge that just happens to work.

Well, I don't even know if it's a fudge. But work it does.
 
> InsetBoxParams params is your struct, the constructor of which receives a 
> string <label> identifying the type of the box.
> 
> xforms/Dialogs.C is my code that happens to use a different string label to 
> ascertain which dialog to open. 

Yes, but where is it actually set? And (I believe unrelatedly) where
does my above "box" go to? To the big heap in the sky where all unused
strings go if they've been good?

> Here FormBox. I too could have used an 
> enum but wanted to avoid 500 files depending on frontends/Dialogs.h. Every 
> time we added a new dialgo we used to end up recompiling the whole tree.
>
> That particular argument doesn't hold water in your case, especially since 
> you use an enum internally anyway!!!!
> 
> Anyway, I understand your pain threshold was probably reached days ago. I 
> think you should just shove the code into the tree.

It's a learning process. I am in this to figure out not just how to
write correct C++, but good code. But yes, I think this is as good as
it gets when I write it today.
 
> -- 
> Angus

- Martin 

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to