Main Window Code Generator

With much experience gained in implementing the bindings, what could be better than to test and refine it by writing a non-trival program for it. This utility program allows a skeletal main window program to be generated after defining the usual operations such as menus, statusbars etc.  For the lack of a better name, the utility is called ACG - Ada Code Generator. 

A project folder must be chosen before all other work can be done. One can be created by using the File -> New option or opened by using File -> Open.  The program will always start with the last used project.  Choose The Main Program option.  The Dialog Boxes option is for building dialog boxes and is not available at this time.

A template window is then created and is ready for use.  The following operations are available.

Main Window Title
By right clicking on the main window title space, an edit box is superimposed on the space allowing changes to be made.

Main Menu
A main menu is always associated with the main window.  When the menu is first created, two default menu items are also created as well.  The File menu item contains submenu items such as New, Open and Close.  These predefined operations allow the user to create, open or close the current project (basically a folder).  Recent Files option allows selection of the 10 most recently accessed folders.  The Exit option quits the main window.  If there are no uses for these default items, they can be deleted.  Main level menu items are created by right clicking on the empty parts of the menu bar.  Left clicking on the menu item will bring up pop up menus for further operations such as creating submenu items.  Accelerators may be associated with a menu item.  However the same accelerator will be used throughout all other menu items with the same name, including those defined in a context menu.

Context Menu
Similarly the main window context menu may be defined by right clicking on the client area.  A pop up menu will guide the user.

Statusbar
There is always a statusbar associated with the main window with a single part occuping the entire space.  This is because error messages are displayed there.  The number of parts can be created or deleted by right clicking on the statusbar.  A pop up menu is then presented for the choice of operation.  Resizing a part is done by left clicking and dragging the mouse to the desired point.

Toolbar
Not implemented yet.

To run
ACG.exe: unzip it to a folder of your choice and run it.        Note: The executable contains all the debugger information.

To compile and link the
source:  After unzipping to a folder, include all files in the src folder to the Aonix project environment.  Include the search path of the precompiled Win2000 library.  You also need to implement/tailor the core library routines.  Most of these routines are self explanatory.  For example, LowercaseWideString takes a wide string and converts it to lower case.  ListManager is a package for list item manipulation.

Email me if you have problems

Back To H
ome