Author Topic: wxSmith: enums for IDs  (Read 1862 times)

cheshirekow

  • Guest
wxSmith: enums for IDs
« on: July 15, 2010, 11:57:39 am »
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_

  • Guest
Re: wxSmith: enums for IDs
« Reply #1 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_

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: wxSmith: enums for IDs
« Reply #2 on: July 17, 2010, 02:52:11 pm »
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_

  • Guest
Re: wxSmith: enums for IDs
« Reply #3 on: July 18, 2010, 12:51:31 am »
Indeed it provides unique IDs upon runtime. Next time, I should do my homework ;)p

For some reason I confused them with #defines.