March 28, 2024, 04:44:06 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


9. Development Environment

Started by LarryMc, August 16, 2011, 12:25:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

It's obvious that we going to develop our custom control in IWBasic's IDE.  So, this short discussion is more about the details of how we are going to go about that.

We previously stated that we've going to share our custom control as a static library.  And we know that the user will have to have a '$USE "OurLib.lib" statement somewhere in there source code in order to be able to use our custom control.  It would seem to follow that we would need the same sort of arrangement while we are testing our custom control as we develop it.

The setup process would flow along these lines:
- We create an IWBasic project, with the Project Type as 'Static Library'.
- We create an IWBasic source file to contain our actual custom control code. Note: We must acknowledge that there is absolutely no reason why we can't use more than one source file for our control.
- We add our source files to the project.
- We create a separate source file as a 'Windows' type exe that we will use for testing our library.
- We create an include file that has the available functions we can call from our library, along with any supporting constants..
- We add the include file to our testing file.
- In either the include file or the testing file we add our '$USE' directive.

With the above setup, a normal editing session would go something like this:
- Open our control project.
- Make some changes.
- Compile the project to create the .lib file.
- Close the project.
- Open our testing program.
- Make any changes in order to do the appropriate testing.
- Compile and run our testing program.
- Reopen our project to make the next set of changes to the control and repeat this process.

As can be seen from this sequence, for each set of changes during development, we have to open and close the library project and compile both the library project and our testing file.  Not very efficient.

This is the setup process I chose to use:
- Create an IWBasic project, with the Project Type as 'Windows EXE'.
- Create an IWBasic source file to contain our actual custom control code.
- Create an IWBasic source file that contains our testing code with the $MAIN directive at the top.
- Add both files to our project.

With this arrangement we don't have to keep opening and closing a project between edits and we only have to perform one compile per set of edits.
After we have completed the development then we can separate the testing file from the custom control file. The control portion can then be added to a new project in order to create the lib file. The testing file can possibly be modified to become an example file (with the addition of the proper include file and directives).

Before this tutorial is finished the reader will have examples of all phases of this total process.

__________________________

Coming Next - Control Required Components
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library