Adding New Elements

In this step, you will add new elements to the application by adding a new dialog box to the application's design. Restart the IRE, and select the Open menu item from the File menu. The Open dialog box is displayed. Select the EXAMPLE.IRF file from the files list box to read in the design file for the application. The dialog box you will create is the Another Example dialog box.

First, select the Edit menu, then the New item. The New Dialog/Window dialog box is displayed. Again, select the dialog box type in the dialog box from the first item of the second row.

In the Dialog/Window Styles dialog box, make sure that Dialog is selected in the Type combination box. Delete the default text in the multi-line entry (or title) field, because the dialog box will not have a title bar. Click on the ID entry field and type DLG_ANOTHER; then click on the Value entry field and type 110.

Click on the Style options group check boxes so that only the Visible and the Dialog frame check boxes are selected. For the description, type Another Example Dialog Box. Finally, click on the Enter push button to create the dialog box frame in the lower-left corner of the IRE above the status window.

You can now move and size the dialog box frame. The suggested size to use is 145 dialog box units wide (cx) by 80 dialog box units high (cy). To do this, place the mouse pointer on the top-right corner of the dialog box sizing frame, and when the pointer shape changes to the 45° double-headed arrow, left-click the mouse and drag the sizing frame to the top-right of the IRE window until you achieve the desired size.

Now, select the Control menu and then the System icon menu item. Notice that the pointer shape changes to a positioning pointer. Move the pointer to relative position (58,50) and left click. This will indicate to the IRE that you want to place the icon in this location.

A system icon, the actual pointer arrow, will first be displayed and then the System Icon Styles dialog box will be displayed. In this dialog box, click on the information icon (the letter "i" in a blue circle), and the SPTR_ICONINFORMATION ID symbol and value will show up in the ID entry field. Now click on the Enter push button to exit the dialog box.

In the Tools window, select the Text button. Like the System icon previously created, the pointer shape will change to the positioning pointer shape. This time, move the pointer to relative position (10,30), and left click. A dialog box will be displayed to allow you to set the text styles: the Static Styles dialog if you are working in Expert Mode, the Text Styles dialog if you are not.

In the Static Styles dialog box, replace the default text with Another Example dialog. No ID symbol is required, and you can change the default ID value to -1 if you wish. In the Text Styles group select the Horz. Centered style; then click on the Enter push button.

Notice that the text you entered is not completely visible. To correct this, move the pointer to the right side of the sizing frame of the text until the pointer shape changes to the double-headed horizontal arrow. Left-click when it is this shape and drag the mouse towards the right of the dialog box while watching the (cx,cy) value in the status window. Continue dragging the frame edge to the right until the (cx,cy) value is (125,8); then release the mouse button. You will notice that the text is now centered in the dialog box.

Finally, for this dialog box, you will need to create a push button to allow the dialog box to be exited. Select the Push button icon in the Tools window and place the push button starting at location (45,5). When the Button Styles dialog box or the Push Button Styles dialog box is displayed, change the default text to OK. Now you only need to add the ID symbol and value.

Select the ID drop-down button to select the DID_OK symbol from the drop-down list. Click on the Default check box and then the Enter push button. With this done, the dialog box is complete. Now, you need to create a new menu item in the File action-bar menu so you can display the dialog box from in the application.

In the Window/Dialog combination box in the Toolbar, select the "WIN_WINDOWTITLE" item to have the IRE display the Example window.

Now select the Menu button in the Tools window so you can add the new menu item. In the Menu Styles dialog box displayed, you will see the File entry with an asterisk (*) displayed to the left of the text This denotes that the item is an action-bar menu item. Type ~Another example dialog for the menu-item text, and type IDM_ANOTHER for the ID symbol and 12 for the value. Also, select the Text style in the Menu styles area.

Because you previously created a dialog box, (Another Example dialog box), you can associate the menu item you are creating with that dialog box. To do this, select the dialog box ID from the Dialogs drop down list.

Before clicking on the Add push button, click on the File entry in the list box to associate the submenu item you are entering to the action-bar menu. This will allow the IRE to correctly place the submenu into the correct action-bar menu. When more than one action-bar menu item has been defined, this simplifies the process and makes it unnecessary to arrange menu later. Now click on the Add push button to add it to the submenu list.

Notice that the new menu item was added below the Exit menu item. Because the Exit menu item is to be the last item in the menu, you need to rearrange the items to reflect this.

Clicking the pointer on the Arrange push button displays the Arrange Menus dialog box. This provides a convenient way of accessing the dialog box in the Menu Styles dialog box. Alternately, when you are not in the Menu Styles dialog box, you can access the Arrange Menus dialog box by selecting Arrange menus in the Options action-bar menu.

Select the Another example dialog box in the list box, and then move the pointer to just above the Separator item. When the pointer changes its shape from an arrow to a bar over the entry, left-click to move the selected menu item to this location. When you have rearranged the order of the menus, click on the Accept push button to arrange the menus in the window you are designing. You can double-check that the menu is correct by simply clicking the pointer on the File menu of the Example window.

The second phase of the process is now complete and you can save the file. Because you want to rebuild the application, you can double-click on the IRE system menu. You will be asked if you want to save the EXAMPLE.IRF file, and you should click on the Yes push button. You will also be prompted to save the include header file, and again you should click on the Yes push button.



Designing and Building Applications
Designing the Application
Creating Application Windows
Positioning Relative to the Mouse