User forums > Using Code::Blocks
wxSmith: enums for IDs
(1/1)
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_
--- End quote ---
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.
Navigation
[0] Message Index
Go to full version