I thought this could be a big time saver for all of us.
The idea is that if you see a constant you want in the list view you can select it in
the list view and click "Add to builder".
When you add a selection to the builder it will create the code of the constant for
you. You can then send it to the clipboard and paste it into any program you are
currently working on.
You can select multiple constants.
Building up constants.
Here is an example:
If I select BS_LEFT in the list view and click "Add to builder" you will see
CONST BS_LEFT = 0x00000100
has been added to the builder box.
You can then send it to clipboard and paste it into your program.
What if a constant uses another one for it's value?
I have added that in too.
Let's take this:
WM_CHOOSEFONT_GETLOGFONT, it's value is (WM_USER+1)
When you select WM_CHOOSEFONT_GETLOGFONT and add it to the builder,
it will automatically add in WM_USER - like this...
CONST WM_USER = 0x400
CONST WM_CHOOSEFONT_GETLOGFONT = (WM_USER+1)
If you then add another constant to the builder that also requires WM_USER it
won't be added again.
CONST WM_USER = 0x400
CONST WM_CHOOSEFONT_GETLOGFONT = (WM_USER+1)
CONST WM_CHOOSEFONT_SETFLAGS = (WM_USER+102)
What about a constant that uses multiple constnats as it's value?
I have also added this in (up to and including three constants).
WS_EX_OVERLAPPEDWINDOW uses two other constants the value is shown
as (WS_EX_WINDOWEDGE|WS_EX_CLIENTEDGE).
When you add WS_EX_OVERLAPPEDWINDOW to the builder you will be asked
if you want to include these two constants.
Answering Yes gives you this:
CONST WS_EX_WINDOWEDGE = 0x100
CONST WS_EX_CLIENTEDGE = 0x200
CONST WS_EX_OVERLAPPEDWINDOW =
(WS_EX_WINDOWEDGE|WS_EX_CLIENTEDGE)
Answering No just gives you this:
CONST WS_EX_OVERLAPPEDWINDOW =
(WS_EX_WINDOWEDGE|WS_EX_CLIENTEDGE)
Now if we add
CONST WS_EX_PALETTEWINDOW =
(WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST)
we get:
CONST WS_EX_WINDOWEDGE = 0x100
CONST WS_EX_CLIENTEDGE = 0x200
CONST WS_EX_OVERLAPPEDWINDOW =
(WS_EX_WINDOWEDGE|WS_EX_CLIENTEDGE)
CONST WS_EX_TOOLWINDOW = 0x80
CONST WS_EX_TOPMOST = 0x8
CONST WS_EX_PALETTEWINDOW =
(WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST)
in the builder.
Building up styles.
As you add constants into the builder the style builder is also at work.
Here is an example of multiple styles based on some button constants:
| BS_LEFT | BS_LEFTTEXT | BS_RIGHTBUTTON | SBS_LEFTALIGN
You can toggle between viewing constants and SETIDs via two radio buttons.
A note on SETIDs:
Unlike a constant, SETID cannot apply mathematical operations, simply put you
cannot assign two or more constants to SETID, it has to be one value.
To help along, if you select a constant like this one:
CONST WS_GT = (WS_GROUP|WS_TABSTOP)
The SETID value will be the value of WS_GROUP (0x20000) + the value of
WS_TABSTOP (0x10000).
Which gives us:
SETID "WS_GT",0x30000
This SETID calculation works with any combination of hex or decimal.
Very useful I think.
I use Include files - won't I get conflicts?
No, you should not get any, the values are the same as in the include files.