March 29, 2024, 01:39:03 AM

News:

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


2. Scope

Started by LarryMc, July 24, 2011, 02:43:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

Scope

If the reader is expecting a doctorate's thesis on all aspects of creating custom controls for the Windows OS then they are looking in the wrong place. 

This is an explanation of custom controls written by an amateur for amateurs.  The plan is to explain, in as simple terms as possible, my concept of how windows and controls work.  I say "my concept" because I admit that I sometimes use the wrong word to describe a function or feature. 

I do not plan on typing every word only after referring to a Microsoft glossary/dictionary.  I hope to use words that mean basically the same to everyone in order to give the reader a "feel" for what is going on as opposed to a precise technical understanding.  Some things I ask the reader to accept on faith; that's what we do with windows all the time anyway.

With the above in mind, the reader should also remember that I am not a prolific writer.  I'm sure my writing will remind the reader of that on a regular basis.  The goal will always be to give the reader the necessary words to gain a comfortable way to understand what is going on and why some of the steps discussed are required.

My intent is also to describe how IWBasic handles windows and controls first and then tie that to how the Windows OS handles windows.

That discussion alone should help the more amateur readers understand why they are required to do some of the things  they have to do when writing a windows/dialog based program.

All of the discussions to this point will be accomplished without any actual custom control code. However, IWBasic code will be used along with some of the Window's API commands.

If the reader decides to create a custom control they will probably want to share their creation.  This will require the creation of a library.  Therefore I intend to have a section that discusses the different types of libraries

There will be a section on "registering classes" and what that really means in the grand scheme of things.

Using all that is learned from the above, the required components of custom controls will be discussed.  This will be closely followed by a "specification" for what we want our custom control to do.  As a pattern ( for learning purposes) we will use my gage control.

That will be followed by a discussion of how to set up a development environment to work on our project and test it as we go.  This will show how an application communicates with the custom control.

At each step of the development process the reader will be provided with code snippets (with explanations) to demonstrate what is being done and why. At appropriate junctures the reader will be provided with compilable code and screen shots of the correct results in order for the user to experiment with and study further.

When the gage control development is completed there will be an explanation of how to modify the contents of the development environment to a distributable form with examples.

As all the above is discussed, notice will be given  when there are multiple techniques that could have been used and why the one used was picked.

At the end, the reader will have all the source code to completely rebuild the gage control library.
 

Note: For the original gage library ( the one currently available on the forum) I used the standard windows graphics functions.  For this exercise, all the graphics functions have been converted over to GDI+.  So, although this tutorial is not devoted to GDI+ it does show enough about how it is implemented and used with some of its simplest commands.  This should be enough for anyone who is interested to use as a basis for further study.



Additional note:  I'm developing this tutorial in the same software that I use for help files. My intention is to offer this tutorial in eBook format at its completion for a small charge. Source code, and especially screenshots, will appear more organized in the eBook.  Images will simply be attachments here.

 
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library