Using the GNAT Programming System: Description of the Main Windows

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# 2. Description of the Main Windows

> 2.1 The Welcome Dialog |  |
> 2.2 The Menu Bar |  |
> 2.3 The Tool Bar |  |
> 2.4 The Work Space |  |
> 2.5 The Project Explorer |  |
> 2.6 The Messages Window |  |
> 2.7 The Shell Window |  |
> 2.8 The Locations Tree |  |
> 2.9 The Execution Window |  |
> 2.10 The Status Line |  |

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.1 The Welcome Dialog

When starting GPS, a welcome dialog is displayed by default, giving the following choices:

Start with default project in directory
  If you select this option and click on the `OK` button, GPS will create a default internal project with the following properties:

  The project supports Ada files only, using the default GNAT naming scheme: `.ads` for spec files, `.adb` for body files.

  A single source directory corresponding to the current directory. The current directory can be set by modifying the text entry on clicking on the `Browse` button. All the Ada files found in this directory will be considered as part of the default project.

  The object directory where the object and executable files will be put, corresponding also to the current directory.

Create new project with wizard
  Selecting this option and clicking on the `OK` button will start a wizard allowing you to specify most of the properties for a new project. Once the project is created, GPS will save it and load it automatically. See 7.5 The Project Wizard for more details on the project wizard.

Open existing project
  You can select an existing project by clicking on the `Browse` button, or by using a previously loaded project listed in the combo box. When a project is selected, clicking on the `OK` button will load this project and open the main window.

Always show this dialog when GPS starts
  If unset, the welcome dialog won't be shown in future sessions. In this case, GPS will behave as follows: it will first look for a `-P` switch on the command line, and load the corresponding project if present. Then, it will look for a project file in the current directory and will load the first project file found.

  If no project file can be found in the current directory, GPS will start with the default project.

  To reset this property, go to the menu `Edit->Preferences`. See section 15.1 The Preferences Dialog.

Quit
  If you click on this button, GPS will terminate immediately.

When you specify a -P switch on the command line, or if there is only one project file in the current directory, GPS will start immediately with the project file specified, instead of displaying the welcome dialog.

In addition, if you specify source files on the command line, GPS will also start immediately, using the default project if no project is specified.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.2 The Menu Bar

This is a standard menu bar that gives access to all the global functionalities of GPS. It is usually easier to access a given functionality using the various contextual menus provided throughout GPS: these menus give direct access to the most relevant actions given the current context (e.g. a project, a directory, a file, an entity, ...). Contextual menus pop up when the right mouse button is clicked.

The menu bar gives access to the following items:

File
  See The File Menu.

Edit
  See The Edit Menu.

Navigate
  See section 6.2 The Navigate Menu.

VCS
  See section 12.2 The VCS Menu.

Project
  See section 7.4 The Project Menu.

Build
  See section 9.1 The Build Menu.

Debug
  See section 11.1 The Debug Menu.

Tools
  See section 13.1 The Tools Menu.

Window
  See section 4. Multiple Document Interface.

Help
  See section 3.1 The Help Menu.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.3 The Tool Bar

The tool bar provides shortcuts via buttons to some typical actions: creating a new file, opening a file, saving the current file; undo/redo last editing; cut to clipboard, copy to clipboard, paste from clipboard; go to previous/next location; start/continue the debugging session, step/next execution, finish current procedure.

The icon on the far right of the tool bar will be animated to indicate that an action (e.g. a build or a search) is going on in background.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.4 The Work Space

The whole work space is based on a multiple document interface, See section 4. Multiple Document Interface.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.5 The Project Explorer

The project explorer is composed of multiple views which can be accessed by default by clicking on the corresponding pages, or if they are not shown by using the `Project` menu items.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 2.5.1 The explorer views

The explorer views are initially displayed on the left side of the GPS window. Their goal is to show a full view of the various components of your projects. These various components are presented below.

The following screen shot displays the two pages side-by-side: on the left, the `Project View`, and on the right the `File View`.

Each view provides an interactive search capability allowing you to quickly search in the information currently displayed. The default key to start an interactive search is `Ctrl-i`. See Interactive Search for more details.

The various components that are displayed in these explorers are the following:

projects
  As mentioned before, all the sources you are working with are put under control of projects. These projects are a way to store the switches to use for the various tools, as well as a number of other properties.

  They can be organized into a project hierarchy, where a root project can import other projects, with their own set of sources.

  Initially, a default project is created, that includes all the sources in the current directory.

  The `Project View` page of the explorer displays this project hierarchy: the top node in this view is the root project of your application (generally, this is where the source file that contains the main subprogram will be located). Then a node is displayed for each imported project, and recursively for their own imported projects.

  A given project might appear multiple times in the `Project View`, if it is imported by several other projects.

  There exists a second display for this project view, which lists all projects with no hierarchy: all projects appear only once in the explorer, at the top level. This display might be useful for deep project hierarchies, to make it easier to find projects in the explorer.

  This display is activated through the contextual menu entry `Show flat view`, which acts as a switch between the two displays.

  A special icon with an exclamation mark is displayed if the project was modified, but not saved yet. You can choose to save it at any time by right-clicking on it. GPS will remind you to save it before any compilation.

directories
  The files inside a project can be organized into several physical directories on the disk. These directories are displayed under each project node in the `Project View`, or directly mimicking their physical organization on the disk (including Windows drives) in the `File View`.

  In the `Project View`, you can chose whether you want to see the absolute path names for the directories or paths relative to the location of the project. This is done through the `Show absolute paths` contextual menu.

  Special nodes are created for object and executables directories. No files are shown for these.

files
  The source files themselves are stored in the directories, and displayed under the corresponding nodes. Note that in the `Project View`, only the source files that actually belong to the project (i.e. are written in a language supported by that project and follow its naming scheme) are actually visible.

  The `File View` will display all the files that actually exist on the disk. Filters can be set through the contextual menu to only show the files and directories that belong to the project hierarchy. See the menu `Show files from project only`.

  A given file might appear multiple times in the `Project View`, if the project it belongs to is imported by several other projects.

entities
  If you open the node for a source file, the file is parsed by one of the fast parsers integrated in GPS so that all entities declared in the project can be shown. These entities are grouped into various categories, which depend on the language. Typical categories include subprograms, packages, types, variables, tasks,...

Double-clicking on an file, or simple clicking on any entity will open a source editor and display respectively the first line in this file or the line on which the entity is defined.

If you open the search dialog through the `Navigate->Find...` menu, you have the possibility to search for anything in the explorer, either a file or an entity. Note that searching for an entity might be a little slow if you have lots of files.

A contextual menu, named `Locate in Explorer`, is also provided when inside a source editor. This will automatically search for the first entry for this file in the explorer. This contextual menu is also available in other modules, e.g. when selecting a file in the `Dependency Browser`.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 2.5.2 The configuration variables

As described in the GNAT User's Guide, the project files can be configured through external variables (typically environment variables). This means that e.g. the exact list of source files, or the exact switches to use to compile the application can be changed when the value of these external variables is changed.

GPS provides a simple access to these variables, through a special area on top of the `Project View`. These variables are called `Configuration Variables`, since they provide various scenarios for the same set of project files.

A combo box is displayed in this area for each environment variable the project depends on. The current value of the variable can be set simply by selecting it from the pop-down window that appears when you click on the arrow on the right of the variable name

New variables can be added through the contextual menu `Add Configuration Variable` in the `Project View`. The list of possible values for a variable can be changed by clicking on the button on the left of the variable's name.

Whenever you change the value of one of the variables, the project is automatically recomputed, and the list of source files or directories is changed dynamically to reflect the new status of the project. Starting a new compilation at that point will use the new switches, and all the aspects of GPS are immediately affected according to the new setup.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.6 The Messages Window

The Messages window is used by GPS to display information and feedback about operations, such as build output, information about processes launched, error messages.

This is a read-only window, which means that only output is available, no input is possible.

For an input/output window, see 2.9 The Execution Window and also 2.7 The Shell Window

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.7 The Shell Window

These windows give access to the various scripting languages supported by GPS, and allow you to type commands such as editing a file or compiling without using the menu items or the mouse.

See 15.6 Scripting GPS for more information on using scripting languages within GPS.

You can use the `up` and `down` keys to navigate through the history of commands.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.8 The Locations Tree

The Location Tree is filled whenever GPS needs to display a list of locations in the source files (typically, when performing a global search, compilation results, and so on).

The Location Tree shows a hierarchy of categories, which contain files, which contain locations. Clicking on a location item will bring up a file editor at the requested place. Right-clicking on file or category items brings up a contextual menu allowing you to remove the corresponding node from the view.

To navigate through the next and previous location (also called `Tag`), you can use the menu items `Navigate->Previous Tag` and `Navigate->Next Tag`, or the corresponding key bindings.

In some cases, a wrench icon will be associated on the left of a compilation message. See 13.3 Code Fixing for more information on how to make advantage of this icon.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.9 The Execution Window

Each time a program is launched using the menu `Build->Run`, a new execution window is created to provide input and output for this program.

In order to allow post mortem analysis and copy/pasting, the execution windows are not destroyed when the application terminates.

To close an execution window, click on the cross icon on the top right corner of the window, or use the menu `File->Close`, or the menu `Window->Close` or the key binding `Ctrl-W`.

If you close the execution window while the application is still running, a dialog window is displayed, asking whether you want to kill the application, or to cancel the close operation.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 2.10 The Status Line

The status line is composed of two areas: on the left a status bar and on the right a progress bar.

The status bar is used to display temporary information about GPS operations. Note that most of the information GPS displays can be found in the `Messages` window.

The progress bar is used to display information about on going operations such as builds.

[ << ] | [ >> ] |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated by Mail Server on June, 15 2003 using texi2html