Enumeration etiquette
Re: Enumeration etiquette
Out of curiosity then - what is better in terms of minimum "holes": predefined constants or #PB_Any?
Re: Enumeration etiquette
#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
Superb
Thanks Fred!

Thanks Fred!
-
- Addict
- Posts: 1675
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Enumeration etiquette
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 ? )
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
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.
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.