Page 2 of 2

Re: Enumeration etiquette

Posted: Wed Aug 31, 2011 12:35 pm
by Foz
Out of curiosity then - what is better in terms of minimum "holes": predefined constants or #PB_Any?

Re: Enumeration etiquette

Posted: Wed Aug 31, 2011 12:38 pm
by Fred
#PB_Any is a linkedlist internally, so you have a small overhead against static number (which are stored in a contigous array), but you can't have any hole.

Re: Enumeration etiquette

Posted: Wed Aug 31, 2011 1:06 pm
by Foz
Superb :mrgreen:

Thanks Fred!

Re: Enumeration etiquette

Posted: Fri Sep 02, 2011 11:01 pm
by Zach
Curious if there is a list anywhere, or some rules to go by, that would help me determine how to group objects into separate enumerations?
I still have cases where I'd like to use Enums versus a bunch of typing, or declaring on the fly w/PB_Any

So I'd like to teach myself how to recognize Objects that have their own unique List of numbers, and which objects belong in which group..


Would I essentially need to write a new Enum for each unique object I use?

i.e Menus & Submenus might share the same number list, but a ListView and a TreeView Gadget each have different lists?

A TextGadget (for labeling UI fields) has its own list, but I could Enumerate 20, 30, however many under that same Enumeration..


Is that basically how it works? For each Unique object, it gets its own LinkedList for Enumerations, although they will store "related" objects together (i.e Menu/Submenu, Panel/Tabs ? )

Re: Enumeration etiquette

Posted: Fri Sep 02, 2011 11:15 pm
by Foz
I believe it's nice and simple - open up Help and look at the General Libraries section in the Reference Manual.

For each Library, each will have it's own counter, so:
Window
Gadget
Menu
Toolbar
etc.

I could be wrong, but that's how I understand it.