News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

wxSmith: enums for IDs

Started by cheshirekow, July 15, 2010, 11:57:39 AM

Previous topic - Next topic

cheshirekow

Is there a way to configure wxSmith to use enums for IDs instead of "static const long". I understand the reasons for wanting to use static const long, but there are cases where I actually want an enum... for instance so I can use a switch(){} statement to case through all the possible IDs.

stefanos_

why you think a switch() won't work with static const long? Have you try it? If not, give a shot and provide your results for further analysis by various volunteers.

Cheers.

stefanos_

Jenna

Quote from: stefanos_ on July 17, 2010, 11:37:37 AM
why you think a switch() won't work with static const long? Have you try it? If not, give a shot and provide your results for further analysis by various volunteers.

Cheers.

stefanos_
It does not work, because the value is calculated at runtime with wxNewId() and that is not allowed in switch-statements.

stefanos_

Indeed it provides unique IDs upon runtime. Next time, I should do my homework ;)p

For some reason I confused them with #defines.