October 09, 2024, 04:18:31 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Constants search program - major update - version 4.0

Started by Andy, October 14, 2018, 02:23:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy


****************************************************
   Please go to the end of this thread to download version 4.22
****************************************************


Firstly, I've placed version 4.0 of the constants search program and library file in this category as I think this is the best place for it now.

An absolute must have for all - it makes programming so much easier and it's a great time saver.

So what's new in version 4.0?

1. Control categories increased from 20 to 50 +
2. Constants included increased from around 1,700 to just over 3,000.
3. SETID value is automatically calculated when a constant is selected.
4. Some IWB commands are cross referenced.
5. You can toggle between viewing selected constants and viewing selected SETIDs.
6. You can search both hex and dec values in general or exactly.
7. Double clicking a constant in the list view automatically adds it to the builder i.e. selected constants.
8. When typing a word or number to search, you can just press Enter as well as clicking "Search".
9. Added a drop down box (option 2 search) so you can select "Word", "Value (Hex)", or "Value (Dec)".
10. A pre-built .exe file so it's available to all for free.
11. A great educational tool.

I've included the Uint64 include file as it was needed to correctly calculate larger SETID values.

Please read the updated help file, especially the section about the "Builder".

For those of you who want to build your own exe file:
Copy Constants.lib to your IWBDev\Libs folder (overwrite the old one if you have it).
Copy Unit64.inc to you IWBDev\Include folder (overwrite the old one if you have it).
Compile as single (F8).

On compile, you will get a few unreferenced sub message - this is because uint64.inc has other mathematical functions in it that we are not using here - so just ignore them.

I would suggest that you copy the exe file, the chm (help file) and the manifest file to you IWBDev\Bin folder and take LarryMc's advice and add it to your IWB Tools:

Tools
Tools Menu Editor
Add Tool


Many thanks to all of you for your help especially Bill, Brian, Fasecero, and LarryMc - a great team effort!

LarryMc:
I am slowly adding in more IWB constants but it will take some time - but you could use the program to easily get a list of SETIDs which you could then add into IWB more easily - just an idea.

Brian & Bill:
I've implemented most of what you have suggested - you will need to download this version as the advanced copy I sent had a couple of bugs I found late on.

To all:
Enjoy - I think you will really like this one.

Andy.

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

fasecero

Andy, I made some small color & font changes just for my personal use. Since your program has a license I thought I should let you know. Thank you very much for sharing this project. Very useful tool!


Brian


Andy

Fasecero,

Yes I like it too!

Eagle eyes Brian spotted a couple of things that needed fixing.

When searching, the values were uppercase 0X and not 0x

Some values were missing the zero i.e. x1234 and not 0x1234.

While they don't sound too important they actually are because the Setid values will come out wrong.

So this morning at silly o'clock I fixed the above.

Added in another couple of hundred constants, and really, if no one else spots anything I can release version 4.1 later today or tomorrow.

Also added in a check after a search, for example, you have searched for " something" and have used "All control types", if you change that selection to say "Buttons", the search is narrowed down to just buttons without you having to click "Search" again.

And the same applies to the "Functions" drop down box.

Finally, I have added in a zero suppression check box for all searches.

If you have a value of say 0x0000001234, the value displayed will be 0x1234. Think it is easier to read that way.

You can turn zeros back on if you wish by unticking the new check box.

So sorry about that folks, but that's why I needed to post the program, to see if anyone could spot something that I might have missed.

Fasecero, there is absolutely no problem with ading to / changing the program, and I encourage every one to do so if they wish.

Please tell us the colour / font, it looks so nice I would like to add it in!
And as far as the program is concerned, you are very welcome, it's nice to know many of you can see how useful it is, and will be for a long time.

Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

fasecero

Zero suppression is a nice idea! OX instead or 0x? How I didn't see that? Good catch!  ;D This is the font:

SETFONT win,"Segoe UI",11,400,0,loop

I'll send a private message with the relevant code to Andy so he can judge whether to include the colors or not :)

ckoehn

Excellent program Andy.

How about mouse messages constants.  Couldn't seem to find it with the search on your program.


Value                                        Meaning
MK_CONTROL  0x0008            The CTRL key is down.
MK_LBUTTON  0x0001            The left mouse button is down.
MK_MBUTTON  0x0010            The middle mouse button is down.
MK_RBUTTON  0x0002            The right mouse button is down.
MK_SHIFT  0x0004              The SHIFT key is down.
MK_XBUTTON1  0x0020           The first X button is down.
MK_XBUTTON2  0x0040           The second X button is down.


Later,
Clint

Andy

Clint,

That's a good spot!

Will add them in later today.

Thanks.

Need a volunteer if any one is willing, I have left around 450 constnats I just don't know how to catergorise, anyone interested in helping?

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

ckoehn

There is one other thing I was wondering about.  When searching in the description, I can't seem to find anything.  Search in descriptions for TrackMouseEvent. It won't find anything even though TrackMouseEvent is in WM_MOUSELEAVE.

My method of doing a search uses the INSTR function:

IF INSTR(UCASE$(Description[Loop]), UCASE$(LookFor)) > 0

That finds a match very fast instead of iterating through the string len.

You can also do something like this:
int pos

pos = INSTR(UCASE$(Description[Loop]), UCASE$(LookFor))
IF pos > 0
    'pos is where LookFor is located
    IF INSTR(" .,", MID$(Description[Loop],pos + LEN(LookFor), 1) > 0
        DoSubSelection()
    ENDIF
ENDIF


Hope this helps you.

Later,
Clint


Andy

Clint,

Thanks for the instr code, it works well.

Never knew you could look for multiple like . , etc.

I have added it into the new version, just taking time to check the search results.

Thanks.
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

Hi everyone,

Here is version 4.1 of the constants search program.

What's new?

1. Fixed the search of descriptions (thanks Clint!).
2. Used Fasecero's colour and font scheme - looks much nicer (thanks Fasecero!).
3. Added in a search the Internet button (Fasecero's idea - great one).
4. Automatic search update on selection of control / function drop down boxes.
5. Fixed a SETID value where a constant value = another constant but the other constant is a value + or - something.
6. You can send the contents of the list view to a text file.
7. The program now uses an ini file where you can set your preferences.

Here is the ini file explained:

Internet=msdn - the internet site you would like to search for a selected constant - you can change it to what ever you like or leave it blank.
SearchName=1 - Set the search constant name checkbox to selected
SearchValue=1 - Set the search constant value checkbox to selected
SearchExact=0 - Set the search exact checkbox to un-selected
SearchDescriptions=0 - Set the search descriptions checkbox to un-selected
RemoveZeros=1 - Set remove leading zeros of values to selected
Tooltips=1 - Set tooltips to be on.

Apart from the Internet= option, all other values should be 0 or 1. (0 = off, 1 = on).
These settings are loaded when you start the program, so if you change any of them you need to restart the program.

The "Search the Internet" button is really useful and a time saver, many times I (and I guess you all) find a constant and have to manually type in a search on the Internet for it, this button does it for you.

8. As always, a pre-built .exe file so it's free to all to use.
9. Optimised some searches, so it should be a little quicker.
10. Added another category and another 200 + constants (got the mouse constants in Clint).
11. Added tooltips (which you can turn off).

IWB users:

I would add the following files to your IWBDev\Bin folder so you can add it into IWB Tools (if you haven't already done so)

ConstantsSearch.ini
ConstantsSearch.ico
ConstantsSearchV4.exe
ConstantsSearchV4.exe.manifest

Copy Constants.lib to your IWBDev\Libs folder.
Copy Unit64.inc to your IWBDev\Include folder.

Please let me know what you think!

I've done a lot of hard work on this, but it's a pleasure to share it with you - enjoy!

Andy.
:)


Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

Hi everyone,

This is my final version of the constants search program.

What's new?

Added in a "Create Message" button to copy to the clipboard a SendMessage command using the currently selected constant.
So not only can you click "Search the Internet" for the constant, you can paste it into your program and add in the parameters needs - a big time saver - after all, that's we all do isn't it?

When searching option 2, if you start your search phrase with a letter, Word is automatically selected for you, and likewise a number will have Value (Hex) automatically selected.

On exit of the program, your settings, search results are saved in a text file, so when you start the program again your results will be loaded automatically for you - no need to search for them again.

Also, I've added a "Clear" button to the option 2 search (to the right of where you type in a word or value to search). When you click it, it clears the list view, and removes what you typed.

Added in another category, and increased the constants to 3,561.
Move a lot of "Other" sub functions to "Style", "Messages" etc.

Finally, I have added in a richedit for "Settings", "Change settings" (on the menu bar), when you click it, you can edit your preferences. When done, you can click "Save + restart program".

Many of the constants have been re-catogorised from "Other" to "Styles", "Messages" etc...

The Uint64 include is no longer needed (Thanks Brian)
Some buttons are now coloured.

A free to all exe file included!

Non-IWB users - regarding the exe file.
Create a folder and place the files in there, you can then just run the .exe file.

IWB users:
Build as a project.
Copy Constants.lib to your IWBDev\Libs folder.
All other files should remain in the same folder as your .exe file

If you have added the previous version to your IWB IDE Tools:
Remove the tool.
I would suggest you create a sub folder in your IWBDev\Bin folder, build your .exe file and place all the other files there, i.e.
.ini
.txt
.html etc.

Then add the new .exe to your IWB IDE Tools.

Enjoy - I'm sure I will add to the library file over time - this program is one I am very proud to share with you.

Andy.
:)


Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

Hi everyone,

I posted the new (final) version of the constants search program over the weekend, but I think many of you missed it due to a lot of other posts, so here is a reminder that it's available here, just above this post.

Thanks,
Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

November 04, 2018, 04:54:32 AM #12 Last Edit: November 04, 2018, 06:04:34 AM by Andy
Hi,

Version 4.2 was to be the final offering, but I found a couple of bugs I won't go into at length here so thought I would correct them and add some more to the program. This is not a minor update.

So Version 4.22 has:

Some corrections made to calculation on the constants.
Constants cannot be duplicated in the builder section (if it's already added, it won't be again).
Many more constant descriptions added (Now over 3,700!).
Visually easier to see what search your doing, i.e. option 1 or 2 search.

Option 2 search is set by what you type
    - if you type a word, the option 2 "Word" is selected, as is "Search constant name".
    - if you type a number, the option 2 "Value (Hex)" is selected, as is "Search constant value".

Shortcut keys added (thanks Brian!!)
    - Ctrl + A adds the selected constant to the builder.
    - Ctrl + C clears the builder.
    - Ctrl + S does an option 2 search.
    - Ctrl + R refreshes option 1 search.
    - Ctrl + I searches the Internet for the selected constant
    - Ctrl + M creates a SendMessage command and copies it to the clipboard.
    - Ctrl + F sets the focus on the "Search" edit box where you type in a word or value to search (option 2).

Don't forget, when you type in a word or value to search for, you can also just hit the enter key, or click the "Search" button as well as Ctrl + S.

As always, a built exe file is included.

IWB users:
Copy the Constants.lib to your IWBDev3\Libs folder.
Compile as a project.
Add it to your IDE Tools - it's well worth it!

Thanks,
Andy.
:)

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

Hi,

Well I've added more features and constants to the search program.

I was just wondering if any one has something they would like adding into it before I release version 5.0?

Version 5.0 will be different, from this next update I will be posting the program and the library file separately so this is a last chance to give me a shout on anything you'd like in the program.

All suggestions welcome - except shut up! (lol)

Thanks,
Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

fasecero

Andy, just a small detail. Now when adding a new constant we can see it on the "Selected constants" richedit thanks to the scroll but it is not seen in the second richedit "Selected styles". I don't know if it would be a good idea or not to scroll this second richedit too?

Andy

Thanks Fasecero,

I will have a look at what you have noted, much appreciated!

By the way, my absoluste final version of the program (but not the library version) will be version 5.

And will be released soon.

All suggestions welcome!

Andy
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

Fasecero,

Thanks, seen what you are saying, and it is now fixed! thanks for the suggestion.

By the way, to all, the library file is now nearly up to (and will exceed) 4,000 constants.

Version 5 will be even easier to use, and with the extra constants included - so as soon as I'm ready I will release both.

Thanks every one for all your help!

Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.