Duration: 1 Day
Instructor: Douglas Clark
Prerequisites: Attendees will need to have VAC++ v 4 installed on their laptops.
This course is an introduction to the VIsual Builder tool included in IBM's VisualAge C++ version 4 compiler. The course will cover building a small application, in the process covering some of the major features of the Visual Builder tool. The course will also cover an introduction to VAC++ version 4.
Some topics that will be covered are:
The Visual Builder is a tool bundled with VisualAge C++ used to construct applications visually. There a many products that do the same thing, although not necessarily for C++: VX-Rexx, DrDialog, Sibyl, Delphi and Visual Basic, to name a few. Where Visual Builder differs from all these other products is in two very important areas.
First is that Visual Builder is designed around a concept of parts. Where other visual application builders have you placing GUI components such as buttons and drop down lists on a composition surface, in Visual Builder you work with parts. While some parts supplied with Visual Builder are indeed GUI components, a part is much more powerful concept than a GUI component. Parts in Visual Builder can be anything - anything that can be encapsulated into a rather simple interface that consists of attributes, actions and events. Parts can be visual or non-visual; in fact you can build an entire application out of parts that has no GUI components in Visual Builder.
Parts are conceptually similar to objects in C++: attributes in a part are very similar to variables in an object, likewise actions in a part are very similar to the methods of an object. The thing that is new in a part that does not exist in an object is the event. An event in a part indicates a change of state, or that something has happened. There is no direct analogy in a C++ object/class. Examples of events are: the click event in a button part, the resize event in a window part, and the receipt of incoming data in a TCP/IP socket part.
Visual Builder comes with a rich set of parts, but if the part you need doesn't exist you can create the part yourself. Once you create a part you can reuse that part in other applications. You can also assemble together parts into sub-assemblies that then become parts that can also be re-used.
The second area where Visual Builder is different from other visual application tools is connections. In other visual application tools you place a GUI component, then set properties for the component, then write code to handle the events generated by that component. In the Visual Builder you connect together attributes, actions and events to make the application work rather than writing code to handle events. Since you can basically connect anything to anything else you generally end up writing less code in a Visual Builder application than you would in one created with another visual application tool. A small example is shown below.
This very small Hello World appliction consists of a window with a close button. The entire application (small as it is) is built without writing a single line of code.
We want the window to close when we click on the Close button. In order to do this we will connect the
buttonClickEvent
with the close
action for the window frame. To do this we right
click on the button, select the buttonClickEvent
from the pop-up menu.
Point to the window frame and right click.
Select the close
action from the pop-up menu.
Notice the connection between the button and the window frame.
The application is built by clicking on the build button (upper left corner) on the composition editor, then clicking on the build button on the IDE, shown below. The application can then be run by clicking on the run button.