Part 1. Creating a Project for a Visual Part

You will create the initial versions of your user interface without writing a single line of code. The SmartGuides help you through creating an initial version of your project. You will go through three SmartGuides, each consisting of a set of screens. The SmartGuides are for your Project, Target, and Parts.

The SmartGuides give you an easy way to define your project, its target executable, and the parts it will use. The Parts SmartGuide even creates an initial version of each part you specify, so that you can simply launch the part, once you have built a first version of your project, in order to edit the part.

Before you begin, you will need to start the IDE.

The Project SmartGuide opens. Follow these steps to create your project:

  1. Click Next to move to the Project Configuration screen, if this is not the first displayed screen.
  2. In the Project Configuration screen, enter the project's name as gui.icc.
  3. Specify a directory in which to store project files. For example, you might enter f:\vatutor. Click Next.
  4. In the Target Type screen, the default selection is Executable (EXE) file. Click Add Target to accept this selection.
  5. The Target SmartGuide opens. In this SmartGuide you will add a target to your configuration. Click Next to get past the opening screen.
  6. In the Target Name screen enter gui.exe as the target name, and select WIN IOC application or OS/2 IOC application as the program type. Click Next.
  7. You need to add two new parts to your target: a nonvisual part that will create the main function, and a visual part that will implement the user interface. Start with the main function by selecting Nonvisual/Class Interface Part from the pull-down list and clicking Create part.
  8. The Parts SmartGuide opens. If a welcome screen appears, click Next until you reach the Nonvisual/Class Interface Part Name screen.
  9. In the Nonvisual/Class Interface Part Name screen, name your part MyMain. Click Next to get to the Base Class screen.
  10. From the Nonvisual Base Class pull-down list, select IVBMain as the base class. Then click OK to add the part and close the Parts SmartGuide. The nonvisual part is now added to your target.You will see it listed in the Current parts list on the Part Type screen.

    This class is used to generate a main function for your program, and later, to connect other parts to the main part so that they are loaded when main is called.

  11. Next you need to create the visual part of your program. Select Visual Part from the New Part pull-down in the Part Type window, then click Create another part. If a Welcome screen appears in the Parts SmartGuide, click Next to reach the Visual Part Name screen. This time call the part MyGui.

    You will notice that some of the screens of the Parts SmartGuide are different for a visual part than for a non-visual part.

  12. Click Next to move to the Base Class screen.
  13. In the Base Class screen leave the default, IFrameWindow, as the base class for your visual part. This class is used for defining simple windowed applications. Click Next to move on to the Client Area screen.
  14. In the Client Area screen, select ICanvas as the client area. Although an IMultiCellCanvas client area allows for better control over the position of objects in the canvas, ICanvas is easier to use for a simple first part. Click Next to move to the Frame Extensions screen.
  15. From the Frame Extensions screen you can add a menu bar, tool bar, or an info area at the bottom of your screen. Add the Info Area now. You will use it later to add hover help to your program.
  16. Click Next until you get to the Help Support screen. You do not need to add help support to your program, so click OK to finish creating the visual part.
  17. Back in the Target SmartGuide, you will notice that the two parts you just added are listed under Current parts on the Part Type page.
  18. Click OK to finish creating the Target portion of your configuration. (The Next button will take you to the Source Files screen, however, you do not need to add any source files. The source files you will be using will be added to your configuration automatically.)
  19. Back in the Project SmartGuide, click Finish to finish creating the configuration for the new project.
  20. Open the project in the IDE.
  21. Begin a build.

When the build completes, you have a project that includes a part for the main function of your code, and a part for the frame window to display. However, the main function is not connected to the frame window. If you run the program now, you will see that nothing happens. Your next task is to connect the two, so that the frame window is displayed when you run your program.

Proceed to: