📄 tutorial.gml
字号:
.*
.* Screenshot Images
.*
.* The EPS files for screenshots are autogenerated from .bmp screenshots.
.* Default scaling factor that often works well is .50, but it may be
.* necessary to use smaller or larger scaling factor values for a good fit.
.* To calculate height in inches, use the following formula:
.*
.* [height in pixels] / 72 / [scaling factor]
.*
.* For an image 439 pixels high and scaling factor of .50, the result
.* would be 3.05 inches of height.
.*
.chap *refid=cptutor Hands-on Introduction to &product
.*
.np
Let's get started and introduce some of the tools that are in
&product.. The purpose of this chapter is to briefly test out the
new graphical tools in &product using an existing application.
.np
In this tutorial, we will take an existing set of
.if '&lang' eq 'C/C++' .do begin
C++
.do end
.if '&lang' eq 'FORTRAN 77' .do begin
FORTRAN 77
.do end
source files, create a project in our integrated development
environment, and perform the following tasks:
.begbull $compact
.bull
Add multiple targets
.bull
Make a target
.bull
Make all targets
.bull
Execute the program
.bull
Debug the program
.if '&lang' eq 'C/C++' .do begin
.bull
Use the &br
.do end
.bull
Correct errors
.bull
Sample and profile the executable
.bull
Save the project
.bull
Terminate the session
.endbull
.*
.section Outline
.*
.np
&company's &ide (&vip) manages the files and tools that a programmer
uses when developing a project. This includes all the source files,
include files, libraries, compiler(s), linkers, preprocessors, etc.
that one uses.
.np
The &vip has a graphical interface that makes it easy to visualize the
make-up of a project. A single &vip session shows a project. If the
project consists of a number of components, such as two executables
and one library, these are each shown as target windows in the
project window. Each target window shows the files that are needed to
construct the target and is associated via its filename extension with
a rule that describes the construction mechanism. For example, a
filename with the extension ".EXE" may be associated with the rule for
constructing 32-bit Windows executables, or a filename with the
extension ".LIB" may be associated with the rule for constructing static
libraries. Different projects can refer to the same target. If they
do, the target is shared and can be manipulated via either project,
with changes made through one affecting the other.
.np
The &vip itself is a collection of programs that manages the various
files and tools used to create the target libraries and executables.
It creates makefile(s) from the information in the target descriptions
and invokes &makname to construct the targets themselves. A configuration
file contains built-in knowledge of the &company compilers, editors,
Profiler, and &br, as well as all their switches.
:CMT. The open architecture of the configuration file makes it easy to add
:CMT. new tools and file types.
.*
.section The &product Tutorial
.*
.np
This tutorial walks you through the creation and execution of a
.if '&lang' eq 'C/C++' .do begin
C/C++
.do end
.if '&lang' eq 'FORTRAN 77' .do begin
FORTRAN 77
.do end
program under Windows. This will give you an understanding of the
basic concepts of the &vip and its components, and it will detail
the steps involved in project development. The result of this tutorial
is a three dimensional drawing of a kitchen which you can manipulate
using either the menus or the icons on the toolbar. You can rotate and
resize the drawing, as well as adjust the lighting and contrast.
.np
To begin, start the &vip..
This is done by double-clicking on the "&vip" icon in the &product
window.
.np
A status field at the bottom of the &vip window indicates the function
of the icon on the toolbar over which your mouse cursor is currently
positioned.
If the status area does not show you the function of the icons as you
move the mouse cursor over them, check that no item in the menu bar is
highlighted (if one is highlighted, press the Alt key).
.figure *depth='2.53' *scale=50 *file='ide1c' The initial &vip screen
.*
.beglevel
.*
.section Defining a Project
.*
.if '&lang' eq 'C/C++' .do begin
.sr smpdir='\SAMPLES\IDE'
.do end
.if '&lang' eq 'FORTRAN 77' .do begin
.sr smpdir='\SAMPLES\IDE\FORTRAN'
.do end
.*
.np
In this tutorial, you will be creating a new project called
.fi KITCHEN.
Here are the steps required to accomplish this task.
.autonote
.note
Define a new project by pulling down the
.us File
menu and selecting the
.us New Project...
item.
You can also define a new project by clicking on the "Create a new project"
icon on the toolbar.
.note
A choice of different sample project directories is available.
Assuming that you installed the &product software in the
.fi &pathnamup
directory, you will find the sample project directories in the
following directory:
.millust begin
&pathnamup.&smpdir.
.millust end
.pc
For purposes of this tutorial, we recommend that you select one
of the following project directories:
.begnote
.note WIN
for an example of 16-bit Windows 3.x application development
when using Windows 3.x under DOS as a host development system,
.note WIN386
for an example of 32-bit Windows 3.x application development
when using Windows 3.x under DOS as a host development system,
.note WIN32
for an example of 32-bit Win32 application development
when using Windows NT/2000/XP or Windows 95/98/Me as a host development system, and
.note OS2
for an example of 32-bit OS/2 application development
when using 32-bit OS/2 as a host development system.
.endnote
.np
Thus the
.mono target
that we refer to below should be one of
.mono WIN,
.mono WIN386,
.mono WIN32,
or
.mono OS2
depending on your selection.
The tutorial uses the
.mono WIN32
example for illustrative purposes.
You will find some minor variations from your selected target
environment.
.np
When asked for a project name, you can do one of two things:
.autonote
.note
enter the following pathname:
.millust begin
d:[path]&smpdir.\target\KITCHEN
.millust end
.pc
where
.mono d:[path]
is the drive and path where you installed the &company software, or
.note
use the file browser to select the following directory:
.millust begin
d:[path]&smpdir.\target
.millust end
.pc
and specify the filename
.fi kitchen.
.endnote
.np
.if '&lang' eq 'C/C++' .do begin
.figure *depth='2.10' *scale=50 *file='ide2c' Creating a new project
.do end
.if '&lang' eq 'FORTRAN 77' .do begin
.figure *depth='2.10' *scale=50 *file='ide2f' Creating a new project
.do end
.np
Press the Enter key or click on OK (OPEN).
.np
The project description will be stored in this file and the &vip will
set the current working directory to the specified path during your
session.
.note
You will be prompted for a target name. Since we will be attaching
pre-defined targets, just click the
.us Browse
button when prompted for the target name.
Select the "draw" target file (it will be one of
.fi draw16.tgt,
.fi draw.tgt,
.fi draw32.tgt,
.fi drawos2.tgt
depending on your selection of target).
.if '&lang' eq 'C/C++' .do begin
.figure *depth='2.10' *scale=50 *file='ide3c' Attaching existing targets
.do end
.if '&lang' eq 'FORTRAN 77' .do begin
.figure *depth='2.10' *scale=50 *file='ide3f' Attaching existing targets
.do end
.np
Press the Enter key or click on OK (OPEN).
.note
.ix 'Target Environment'
.ix 'Image Type'
You can ignore the settings displayed for
.us Target Environment
and
.us Image Type
since the target definition already exists (we created it for you).
The settings are important when you a defining a new target (i.e., one
that was not predefined).
.figure *depth='3.05' *scale=50 *file='ide4c' Selecting a target type
.np
Press the Enter key or click on OK.
.endnote
.np
A target window is created in the project window for the "draw"
target.
This window contains all of the files associated with the target.
You can click on any of the "Folder" icons to hide or un-hide all
files with a particular extension. For example, you may wish to un-hide
all the files with a
.fi .bmp
extension by clicking on the folder icon associated with bitmap files.
.*
.section Adding Multiple Targets
.*
.np
&company's &vip allows you to have multiple targets in any particular
project. Note that targets can be used by multiple projects. To add a
new target to the project, do the following.
.autonote
.note
Pull down the
.us Targets
menu and select the
.us New Target...
item.
.note
Enter
.fi button.tgt
as the target name for the new target to be added to the project.
Do not forget to include the
.fi .tgt
extension.
It is required when selecting a pre-existing target.
.note
.ix 'Target Environment'
.ix 'Image Type'
You can ignore the settings displayed for
.us Target Environment
and
.us Image Type
since the target definition already exists (we created it for you).
The settings are important when you a defining a new target (i.e., one
that was not predefined).
.note
Press the Enter key or click on OK.
.endnote
.np
A target window is created in the project window for the
.id button
target.
.*
.section Making a Target
.*
.np
&company's &vip will automatically generate the sequence of steps
required to build or "make" each of the targets in a project.
Note that the targets in a project can be made individually or
collectively.
To make the
.id button.lib
target, do the following.
.autonote
.note
Click on the window of the target you wish to make. In this case,
click on the
.id button.lib
target window.
.note
Pull down the
.us Targets
menu and select the
.us Make
item (you can also do this by clicking on the "Make the current
target" icon on the toolbar, or by right-clicking on the target and
selecting the
.us Make
item from the pop-up menu).
.endnote
.np
The &vip will now construct a makefile based on its knowledge of the
target and construction rules, and then invoke the make utility to
create the target, in this case
.id button.lib.
The output of this procedure is displayed in the Log window.
.*
.section Making All Targets
.*
.np
Click the "Make all targets in the project" icon on the toolbar to
make all of the targets in the current project. If one target depends
on another target, the latter target will be made first. In this
tutorial
.fi button.lib
will be made first (there will be nothing to do since it was made
previously) and then
.fi draw???.exe,
since
.fi button.lib
is in the list of files associated with
.fi draw???.exe.
In each case, the &vip constructs makefiles based on its knowledge of
the target and construction rules. The output of this procedure is
displayed in the Log window.
.if '&lang' eq 'C/C++' .do begin
.figure *depth='4.26' *scale=44 *file='ide5c' Making one or more targets
.do end
.if '&lang' eq 'FORTRAN 77' .do begin
.figure *depth='4.26' *scale=44 *file='ide5f' Making one or more targets
.do end
.*
.section Executing the Program
.*
.np
The project should have built without errors, so now you are ready to
execute the program you have developed.
.np
Click on the
.fi draw???.exe
target window and simply click on the "Run the current target" icon on
the toolbar. You can also do this by selecting
.us Run
from the
.us Targets
menu, or right-clicking anywhere on the target window outside of the
inner frame and selecting
.us Run
from the pop-up menu (right-clicking is context sensitive and the
pop-up menu that results will vary depending on the area of the window
in which you right-click).
.figure *depth='3.98' *scale=40 *file='ide6c' The kitchen demo
.np
The demo you have created is a simple three dimensional drawing of a
kitchen. By using either the icons on the toolbar or the menus you can
rotate the picture left, right, up, and down, make the picture
brighter or dimmer, move the picture closer or farther away, and
increase or decrease the amount of contrast (this latter feature is
found in the "Lighting" menu). Choose
.us Exit
from the
.us File
menu to exit the demo program when you are finished.
.*
.section Smart Editing
.*
.np
The &vip recognizes the type of file you wish to edit, and invokes the
appropriate editor for the task. To edit a file, you either
double-click on it or select it and click the "Edit" icon on the
toolbar. Files with a
.fi .c,
.fi .cpp,
.fi .h,
.fi .hpp,
.fi .for,
.fi .asm
or
.fi .rc
extension are edited with a text editor; files with a
.fi .bmp,
.fi .ico,
or
.fi .cur
extension are edited with the Image Editor; files with a
.fi .dlg
or
.fi .res
extension are edited with the Resource Editor.
:cmt. You can customize the edit actions for any particular extension to use
:cmt. your favorite editor (including third-party editors).
.if '&lang' eq 'C/C++' .do begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -