Contents

The Map Editor is used to create the user interface elements of DP4 applications. Maps are introduced in the "Introduction to DP4", and you can find out how to use them in programs in the QA Build Developers Manual or the C Reference manual, depending on how you are creating your DP4 programs. This manual is just about how to use the Map Editor to create and modify the maps.

  • Map Editor Basics
  • Working in a Map Edit Window
  • Editing DP4 Menu Pages
  • Editing Menus
  • Configuration


What's New in the 4.600 Map Editor User's Guide

This page will tell you about recent changes to this manual. The most recent changes are mentioned first

New in 4.624

  • 2 May 2013 Documentation of bitmaps,buttons and icon controls improved to include information about how to change the image displayed in the control dynamically.

New in 4.623

  • 7 Nov 2007 Date edit controls now support a "Calendar" button which will show any date in the Gregorian calendar from 1600 onwards in the correct calendar for the month.
  • 29 Aug 2007 Improved facilities for selecting and applying changes to multiple controls. See Selecting Controls and Cutting,Copying and Pasting Controls
  • 21 Sep 2005 Preliminary support is added for Web browser controls

New in 4.622

  • 14 Mar 2005 Preliminary support is added for a new type of control - Enumerations.
  • 26 Jan 2005 The Map Properties dialog has some extra fields for enhanced support for printing to Legacy printers.
  • 25 Jan 2005 There are enhancements to the support for bitmap controls to allow other types of image file to be displayed. See Bitmap Control Properties for details.

New in 4.621

  • 10 Apr 2003 Radio buttons support a default value. See Radio Button Control Properties
  • 10 Apr 2003 Texture bitmaps support. See Bitmap Control Properties

New in 4.620

  • 12 Mar 2003 Script combo box added to Font Dialog
  • 31 Jan 2003 Password mode added to Formatting Characters possibilities.
  • 29 Jan 2003 Information relating to embedded fields updated as mapedit now allows embedded fields in more controls.
  • 22 Jan 2003 This manual has been extensively revised for 4.620. The is not yet quite complete: more information on the co-ordinate system is to be added.
  • 29 Nov 2002 Cursor Movement in Maps Page has additional information


Map Editor Basics

This section introduces you to the Map Editor. It is designed to familiarise you with the main concepts that underpin the Map Editor, to show you the important components of the Map Editor's screen and to teach you the basic skills that you will use on a regular basis. The following topics are covered:

  • An explanation of mapsets, maps, controls and properties
  • Starting the Map Editor
  • The Map Editor's main screen
  • Opening a database
  • Closing a database
  • Opening a mapset
  • Opening a map
  • Creating a new map
  • Copying a map
  • Deleting a map
  • Copying a mapset
  • Deleting a mapset
  • Saving the map
  • Saving all maps
  • Saving the active map in a different location
  • Working with multiple maps
  • Leaving the Map Editor


Mapsets, Maps, Controls and Properties

Before you begin working with the Map Editor, it is worth reading this section to gain an understanding of the terms mapset, map, control and property and the relationships between them.

Maps are used to define how information is displayed and printed by your applications. They are set up using the Map Editor, which you use to define the map, draw its text and edit boxes, and add its other controls (buttons for example). Maps are numbered and stored within a named mapset.

Each map can exist in multiple languages. Maps from different languages should have equivalent controls, but with necessary changes for each language: controls may need to be a different size when one language is more verbose than another, the controls' captions will usually differ, and a different font may be required. The Map Editor allows you to edit maps from any language code, but does not enforce any consistency between languages. To do this it is best to print out the maps from one language using MapMake Translator format, translate the text file produced using a text editor, then post the maps back. Then you need to check the control sizes using Mapedit.

The usual reason that maps are held in a particular mapset is that they are displayed by the same applications. Mapsets are, however, stored on the database independently of their applications. This means that you can change many of the characteristics of the map without recompiling your applications.

Maps can contain any of the following types of control:

Control | Description
 | Attach points or hooks, are for overlaying the map with other maps (any other control can also be used as an attach point, but attach points are useful when you do not want a visible control)
 | Bitmap controls allow you to display pictures in your map. Bitmaps can be built into an application or the DP4 resource DLL or can be displayed directly from BMP or other image files. Some other controls, notably buttons, can also display a bitmap on themselves.
 | Buttons have an associated keystroke that is simulated when they are clicked and usually cause some action to take place.
 | Check boxes enable or disable a particular option or answer a question. The option is enabled when X appears inside the check box; it is disabled when the check box is empty.
 | Edit boxes are fields for displaying and editing data. Enumeration controls look like edit controls, but work more like radio buttons. They allow you to select one of a fixed list of options from a pop-up window on screen. They are useful when you don't want to select the options using a static data table on a database. They may be particularly useful when you want to prepare versions of an application in several different languages, or where radio buttons would take up too much room on screen.
%1 | Embedded fields are not true controls, but pieces of replaceable text that live inside various types of control. They are useful for doing things like adding filenames to title bars or error message text. You can find out more about embedded fields here.
 | Group boxes are the standard way of grouping related controls in a map. A group box surrounds its controls with a line and normally has a title.
 | Headers are used to make a column of controls underneath resizeable. The boundary between two headers can be moved resizing both columns. You can also make headers clickable and add extra functionality like reordering a list according to the column clicked on. You can find background information on header controls here.
 | Icons allow you to display seven predefined icons or your own custom icons. In the latter case icons can be built into an application or the DP4 resource DLL or can be displayed directly from ICO files.
______ | The Line control adds horizontal or vertical lines to the map.
 | Radio buttons present two or more mutually exclusive options. You pick one of the options by clicking the associated button to highlight it.
 | Tabs are used to create multi-page dialogs. A row of tabs is placed above a control to which another map is attached. Clicking on one of the Tabs attaches the appropriate map to display the corresponding page of the dialog. The Add Tabs option is useful for creating a prototype of the maps needed for this type of dialog.
 | Text controls are used for unchanging text which allows you to provide descriptions for the edit controls on the map. They can also be used to create the options in a menu. Internally each map also has a special text control that is the background for the whole map. This control determines the size of the map, its border and title and it is this control you edit when you edit the Map Properties.
 | VCR buttons are used to provide various pre-defined buttons that are often useful for navigation. They are similar to buttons, but start working as soon as they are pressed whereas ordinary buttons only work when they are pressed and released.

Controls are defined by their properties. For example, the main properties of a button control are its caption, its associated key press and its width and height. If you double-click any control on the map, a dialog will appear that defines the properties of the control:

Because a control can have many properties, they are grouped together on separate tabs in the properties dialog:

  • The general properties group determines the main properties of the control, such as size, and field number. General properties vary depending on the control type.

  • The access group, which determines user access

  • The colour group, which determines the colouring scheme used for the control

  • The font group, which determines the font used for text associated with the control.

It is possible for a control to be "shared" between different maps, so that editing it in one place changes its properties in all the other maps that use it. This can be an important time saver for standard controls that are used in many maps (for example OK and Cancel buttons). For more information see Sharing Control Properties.


Starting the Map Editor

If you are developing using QA Build, at those points in the development of an application when you need to create or edit a map, QA Build automatically starts the Map Editor and opens the appropriate map. You can also start it yourself by double clicking its icon in the DP4 program group or in the DP4 main menu, or running MAPEDIT from a command prompt.

When you start MAPEDIT like this you you have to open a database, before any options become available. Then you will usually want to open a mapset, because even if you do not want to edit a map, opening the a mapset is a good way to discover maps you want to delete, copy (or copy over) etc.

If you are used to the way other DP4 utilities work you may find MAPEDIT takes a little getting used to. Another utility, MAPMAKE, is available as a front end into MAPEDIT, and works more like other DP4 utilities. You may find MAPMAKE makes it easier to select the map(s) you want to work on. MAPMAKE also contains facilities to print out maps or to create MAPPOST format files so you can distribute changes to maps, and has some specail facilities that are useful if you need to work on the same map in more than one language.


The Map Editor Screen

The Map Editor screen looks like this; click on its features for further information.


Opening a Database

You must open a database in order to access the maps it contains.

  1. Select Open Database from the File menu, or (from 4.622) press Ctrl+B. The Open Database dialog appears.

  2. In the list box, double-click the database you want to open. You can have several databases open at once.

An error message stating that 600 map structures are not supported means that you are trying to open a database whose mapsets have not been converted for use with the new Map Editor: To upgrade the mapsets, run the FIXDB23 program against the database, as described in the DP4 4.600 Release Notes.


Closing a Database

To close a database with which you no longer wish to work:

  1. Select Close Database from the File menu. The Close Database dialog displays the databases that are open.

  2. In the list box, double-click the database you want to close. Any Map Editing windows for the database are closed. You will be asked whether you want to save any unsaved work.


Opening a Mapset

This is a useful option because it allows you to preview all the maps in a mapset before choosing the one on which one you want to work or performing an action on the whole set of maps.

To open a mapset:

  1. Select Open Mapset from the File menu or (from 4.622) press Ctrl+M. The Open Mapset dialog appears:

  2. Fill in the dialog, specifying the database, mapset, language, and, optionally, the map number, then click OK. (You can specify new or existing values for the mapset and map number). A two part Map Editing window appears, showing the map numbers used in the mapset on the left and one of the maps on the right:

    If you did not specify the map number, the first map in the mapset is displayed.

After opening a mapset your options are:

  • To choose a map to edit, click the list and use the cursor keys for browsing. When the correct map is displayed, you can edit it.
  • To work on another map, click its number in the list. You will be asked whether you want to save any work done on the active map.
  • To create a new map, click the number enclosed in angle brackets (<>) at the bottom of the list. An empty map appears, ready for editing. If you want to use a different map number for a new map, use the "Save Copy As" option to save the map or use the File menu New Map option.
  • If you choose one of the options in the file menu it will default to using the currently active map in the dialog, so this is a good way for selecting a map to be copied or deleted.

You can open the same mapset more than once. If you do this be careful only to edit each map in any one window. The mapset windows are only synchronised when changes are saved.


Opening a Map

If you know exactly what map you want to work on you can open just one map from a mapset:

  1. Select Open Map from the File menu or click the Open icon [image] on the Tool bar. The Open Map dialog appears.

  2. Fill in the dialog, specifying the database, mapset,language and map number. Click OK. A Map Editing window displaying the map appears, unless a window is already open for the selected map, in which case that window is activated.

You can have multiple maps open at the same time.


Creating a New Map

There are several ways to create a new map:

  • To create a new map not based on an existing map:

    1. Select New Map from the File menu or click the New icon [image] on the Tool bar. The New Map dialog appears:

    2. Fill in the dialog, specifying the database, mapset,language and new number for the map, then click OK. A Map Editing window displaying the map appears. You set some of the initial properties for new maps in the customisation section of the MAPEDIT.INI file. See Configuration for more details. You can use the map number comobo box to see what map numbers have already been used. You need to select a different map number from any of these.

    Alternatively open the mapset and edit the new map (in angle brackets)

  • To create a new map based on an existing map either edit the existing map and then use the "Save Copy As" option, or use the "Copy Map" dialog initially.


Copying a Map

Before copying a map, open the source database and, if copying to a different database, the target database. The source map may be open, but must not have unsaved changes (because they will not be copied); if the target map is already being edited it will be overwritten.

To copy a map:

  1. Select Copy Map from the File menu. The Copy Map dialog appears:

  2. Fill in the top part of the dialog, specifying the source database, language, mapset and map number, then the target details in the bottom part. (The target map need not already exist, but if it does you will be asked to confirm whether you want to overwrite it.) Click OK. The map is copied to its new location.


Deleting a Map

Before deleting a map, we recommend that you preview it with Open Mapset from the File menu to ensure that it is the right one.

To delete a map:

  1. Select Delete Map from the File menu. The Delete Map dialog appears, containing details of the current map, if there is one. You can, of course, choose to delete any map.

  2. Fill in the dialog, specifying the database, mapset,language and map number, then click OK to delete the map.

If you have versions of a map set up in more than one language and want to delete it in all language variants you may find it easier to use MAPMAKE and enable the "multi language" option and then select the map and delete it from within MAPMAKE.


Copying a Mapset

The same kind of restrictions apply as for copying maps, that is: the relevant database(s) must be open; maps in the source mapset may be open, but must not have unsaved changes.

To copy a mapset:

  1. Select Copy Mapset from the File menu. The Copy Mapset dialog appears:

  2. Fill in the top part of the dialog, specifying the source mapset, database and language, then the bottom part with the target details. (The target mapset need not already exist, but if it does you will be asked to confirm whether you want to overwrite it.) Click OK. The mapset is copied to its new location.


Deleting a Mapset

As with deleting a map, we recommend you preview the mapset with Open Mapset from the File menu to ensure that it is the right one.

To delete a mapset:

  1. Select Delete Mapset from the File menu. The Delete Mapset dialog appears, containing details of the current mapset, if there is one. You can, of course, choose to delete any mapset:

  2. Fill in the dialog, specifying the database, mapset and language, then click OK to delete the mapset.

If a mapset exists in several language variants and you want to delete them all, you may find it more convenient to use MAPMAKE. MAPMAKE is also convenient if you want to delete all the mapsets for a particular language.


Saving the Map

You can save the work done on the current map by selecting Save from the File menu or clicking the Save icon [image] on the Tool bar, or (from 4.622) by pressing Ctrl+S. When you close a Map Editing window and you have made changes, you are asked whether you want to save the map.


Saving All Maps

You can save the changes made to all the open maps by selecting Save All from the File menu, or (from 4.622) by pressing Ctrl+E.


Saving the Active Map in a Different Location

To save the active map in a different location on the database:

  1. Select Save Copy As from the File menu, or (from 4.622) press Ctrl+A. The Save Map As dialog appears:

  2. Fill in the dialog, specifying the mapset,language and map number, then click OK to save the map. If this operation would overwrite an existing map, you are asked to confirm that that is what you want to do.

Using the "Save Copy As" option does not change the map being edited into the new map, you are still editing the original map, and will still be prompted to save your changes to that map. If you do not want to change your original map then, after using the Save Copy as dialog, close the current map edit window without saving your changes and open the newly saved map if desired.


Working with Multiple Maps

You can work with several maps at once. Using the Window menu commands you can arrange the Map Editor screen so that the maps are easy to see:

  • The Tile command resizes and arranges the Map Editing windows side by side.

  • The Cascade command resizes and layers the Map Editing windows so that each title bar is visible.

  • The Arrange Icons command arranges all minimised Map Editing windows into rows in the bottom left corner of the Map Editor screen.

  • The Next command moves the Map Editing window at the top of the viewing order to the bottom, activating the window that was immediately below it.

  • The Previous command moves the Map Editing window at the bottom of the viewing order to the top and activates that window.

  • The Window menu also allows you to open a map being edited by clicking on its name in the menu.


Changing Language in a MapEdit Session

Changing Language in a Map Editor Session

By default the Map Editor uses the language specified by USERDATA.SYS. However at any point where you open a map you can specify another language.

In 4.620 you can edit maps from more than one language at the same time.


Leaving the Map Editor

There are three ways to exit from the Map Editor:

  • Select Exit from the File menu

  • Press <Alt + F4>

  • Select Close from the System menu

You are asked whether you want to save any unsaved work.


Working in a Map Editing Window

This section describes how to use the Map Editor Window to add, edit, and delete controls in maps. The tasks covered are:

  • Undoing Mistakes
  • Adding Controls
  • Selecting Controls
  • Editing Control Properties
  • Deleting Controls
  • Moving Controls
  • Positioning Controls by Specifying their Co-ordinates
  • Sizing Controls
  • Aligning Controls using the Grid
  • Aligning Controls using the Align Commands
  • Spacing Controls
  • Making Controls the Same Size
  • Cutting, Copying and Pasting Controls


Undoing Mistakes

The Map Editor remembers the last action you performed during the current session. If you make a mistake or change your mind, the Undo command in the Edit menu can usually reverse the action. It can restore a control or other item if your last action was to delete it, move, size, or align it.

Operations that you cannot undo are:

  • File operations (opening, closing and saving)
  • Control selection
  • Window selection
  • Changes made by a dialog after you select OK.
  • There is no undo facility in the Menu Editor.

In 4.620 there is only one level of Undo, and there is no Redo facility. Previous versions of Mapedit had a very limited undo facility - for example there was no undo for move, size, or align operations.

If you find you cannot undo a serious mistake then close the map without saving. It is a good idea to save your work periodically when creating a map. You may be able to use the Copy and Paste facility to recover from certain mistakes that undo cannot reverse.


Adding Controls

You can add a control to the map in either of two ways:

  • Using the Tool box, as described here. Double-clicking a tool adds the corresponding control to the top-left corner of the current map. Single-clicking a tool makes a cross-hair cursor appear when you move the pointer over a map. Position the cross-hair where you want the control, then either click to add the control at its default size or drag the mouse to add the control, sizing it yourself.

    Once you have added a control this way, the Map Editor reselects the pick tool in the Tool box. If you wish to keep the current icon highlighted to add more controls of the same type, press the <Shift> key when selecting the tool.

    Or

  • By selecting the appropriate control command from the Controls menu. The selected control appears in the top left corner of the current map.

You can customise the initial size of controls. Refer to Configuration if you need details.

After adding a control you will usually want to invoke its property dialog to edit its properties. Controls may not behave in the way you intend until you have defined the Map Properties.

If you want to add a number of similar controls to a map you will probably save time by using the Copy and Paste facility.


Selecting Controls

To select a single control:

  1. Select the pointer tool

  2. Place the cursor over the desired control in the toolbar and click the mouse.

Alternatively, select Control List from the Edit menu and the desired control from the list.

To select multiple controls, select the pointer tool and either

  • hold down the <Shift> key and click a control. Grey selection handles appear around it. Keep the <Shift> key pressed down and click another control. Two controls are now selected. Repeat this procedure until you have completed your selection.

    From 4.623 (in builds on or after 29th Aug 2007) you can de-select a previously selected control by shift+Click on an already selected control.

or

  • Move the pointer to a position clear of controls, (usually above and to the left of the controls you want to select is best). Click the mouse to check that the area is empty. Drag the mouse down and to the right, surrounding the controls with the selection rectangle. Release the mouse to select all the controls that are completely within the selection rectangle.

    If you cannot find a location free of controls (for example because you have used a bitmap as a background for the whole map), then you can start a selection rectangle by pressing the Ctrl key at the same time as you press the mouse button. (This only works from release 4.620)

or

  • Press F2 or use the menu to open the "Control List" dialog. You can use standard Windows techniques to select select a range or a more complex set of controls. When you have selected your desired set of controls click on the Close button. (This facility was added in 4.623)


Editing Control Properties

When you have added a control to the map, you can edit its properties. Every control has a dialog for editing its properties. Because most controls have many properties, they are grouped into various property pages. All controls have a General property page, which allows you to specify the most important properties of the control, including its field number, whether it is shared, its size, the appearance of its border and so on. Other property pages include:

  • The Access page, which determines the minimum access levels required for the user to view and modify the contents of the control
  • The Font page, which determines the Windows font used to display annotation for the control
  • The Colour page which determines the colour of various parts of the control
  • The Data page, which determines the formatting and validation for data used by Edit controls

The various dialogs are described below.

Displaying a Control's Dialog

To activate the dialog for setting the properties of a control, do one of the following:

  • Double-click the control

  • With the control selected, press F5 or Enter

  • With the control selected, click the Control icon [image] on the Tool bar

  • With the control selected choose Control Properties from the Edit menu.

  • If it is not easy to select the control with the mouse (for example because it is covered by another control) choose Control List from the Edit menu. The Control List dialog appears:

    This lists the controls and their field numbers. Select the desired control from the list (if it is not already highlighted) and click Edit

    Control Dialogs

    The dialogs for each type of control are described on the following pages:

    • Attach Point Control Properties
    • Bitmap Control Properties
    • Button Control Properties
    • Check Box Control Properties
    • Edit Control Properties
    • Enumeration Control Properties
    • Group Box Control Properties
    • Header Control Properties
    • Icon Control Properties
    • Line Control Properties
    • Radio Button Control Properties
    • Tab Control Properties
    • Text Control Properties
    • VCR Control Properties

    The following pages describe some of the tasks and propery pages common to the various types of control:

    • Adding Help
    • Specifying Access Levels
    • Specifying the Font
    • Specifying Colours
    • Specifying Mnemonics


Attach Point Control Properties

The attach point dialog looks like this:

The Attach field Nr provides the application with a field number to which maps can be attached. That map will be positioned according to the placement of the attach point control. To be more exact, usually the top-left pixel of the map being attached is aligned over the top-left pixel of the attach point, unless the map being attached has the 4.500 position flag set. In this case the interior of the map is attached one character position below and to the right of this.


Bitmap Control Properties

The Bitmap dialog looks like this:

Click on a feature in the illustration above for further information.


Button Control Properties

The button properties dialog looks like this:

Click on a feature in the illustration above for further information.


Check Box Control Properties

The Check box dialog looks like this:

Click on a feature in the illustration above for further information.


Edit Control Properties

The Edit control properties dialog looks like this:

Click on a feature in the illustration above for further information


Edit Controls: Data Properties

The contents of the dialog for the data properties group will vary considerably depending on the type of the field. There are three main areas:

  • The Source area allows you to specify a database field to be associated with the control. If this is done some of the other properties are always taken from the data dictionary and so are removed or disabled in the dialog.

  • The format area allows you to specify various formatting options for the data in the edit control. This format infomation is dependent on the type of the field. For non database fields you need to specify the type of data the field will contain.

  • The validation area (within the format area) allows you to specify low,high and default values for the field (or a subset, depending on the data type). The low and high values are used to validate the data entered into the field. The default value is only used when the field has the clearfirst behaviour set, and the dialog is also invoked with the clearfirst flag set to TRUE.

    The illustration below shows a typical instance of the edit control Data page:

    Click on a feature in the illustration above for further information


Formatting Booleans

The Data dialog Boolean fields contains the following fields:

Use default values

Enable this to accept the default formatting values for the field. These are derived from the user preferences

Switch Yes/No

Enable this to switch the yes and no words for the Boolean field. If you do this, yes returns the no value and no returns the yes value. This might seem strange, but it allows you to rephrase associated questions without reprogramming. For example, you could enable Switch Yes/No to rephrase "Quit without saving?" as "Save file before quitting?"

Use default Yes No Values

The Yes No words can only be set for non database fields.

Leave this checkbox enabled to use the Default Yes No words for the current language. Clear the checkbox to set the Yes and No words.

No Value/Yes Value

For non-database fields, enter up to 8 characters for the word for "Yes" and word for "No", for example, "Positive" and "Negative" or "Oui" and "Non"


Formatting Characters

The Data dialog for database character fields contains the following fields:

Use default values

Enable this to accept the default formatting values for the field. These are derived from the user preferences

Start with capital

Enable this to convert the first letter entered into the field to upper case automatically. This is convenient when typing in names, but you should not rely on this because the user can enter a lower case first letter by deleting the first character later on.

Overtype mode

Normally the existing contents of a field are all selected when it gets focus, which means that the contents of the field are cleared as soon as the user starts to type, unless the user cacncels the selection (for example by pressing Cursor keys). If you enable overtype mode the existing data is not selected.

Password mode

If password mode is enabled then data displayed or edited is echoed as * characters.

Default value

For non-database fields, enter the text to offer as a default for field entry


Formatting Dates

The Data dialog for date fields contains the following fields:

Use default values

Enable this to accept the default formatting values for the field. These are derived from the user preferences

Show Century

Enable this to output the year in full. For example, "1995" instead of "95"

Month name

Enable this to output the month name. For example, "Dec" instead of "12"

Year first

Enable this to output the year first. For example, "95 Dec 08"

Month first

Enable this to output the month first. For example, "Dec 08 95"

Day first

Enable this to output the day first. For example, "08 Dec 95"

Separator

Enable this to display dates with a separator character, then enter the desired character in the adjacent edit box. A hyphen is often used, for example, "25-Dec-95"

No spaces

Enable this to display dates without any separator, for example: "25Dec95" or "251295"

Validation

For non database date fields you can set up explicit validation ranges and a default value for the field (possibly used to initialise the edit feidl if the Clear First property is set). If you don't enable validation DP4 will use the null date as the default, and will allow any valid date.

Low High

For non-database fields, enter the earliest/latest dates permitted. DP4 uses these values to validate field entry

Database fields are always range-validated and defaulted using the data dictionary validation.

Default

For non-database fields, enter the date to offer as a default for field entry


Formatting Numbers

The Format group for the various types of number fields (integer,long,real,unsigned char,signed char) contains some or all of the following fields:

Precision

(For real type fields only) Enter the number of decimal places to display.

Scale factor

(For real type fields only) Display-only for database fields. For non-database fields that are real numbers, you use it to determine how fields are stored and processed, as opposed to how they are displayed. The aim is to store numbers as integers to minimise rounding errors. On storage, numbers are multiplied by the power of 10 corrsposding to their scale factor. On display, they are divided by the corresponding power of 10. For example:

Precision | Scale factor | Displayed as | Stored as
3 | 3 | 51.356 | 51356
3 | 0 | 51.356 | 51.356
2 | 3 | 51.36 | 51356

As a rule of thumb, set the scale factor to the same value as the precision. Occasionally, you may want to set the scale factor higher than the precision, for example in currency translations. Be aware that if you set the scale factor lower than the precision, the number is not stored as an integer, which defeats the purpose of using scale factors.

Use default values

Enable this to accept the default formatting values for the field. These are derived from the user preferences.

Before decimal point

Enable this to insert the separator between thousands before the decimal point. Disable it to display no separator before the decimal point

After decimal point

Enable this to insert the separator between thousands after the decimal point. Disable it to display no separator after the decimal point

Separator

Enter the character to be used for separating thousands (groups of three digits). This is normally a comma (,) in the UK and USA and a period (.) in continental Europe

Units

Select the unit, if any, whose symbol you want to display. (Increase the length of the field to accommodate the symbol)

Cash till input

Enable this to specify that numbers are entered as for cash registers, for example:1.00 is entered as 100, 0.01 is entered as 1

Standard

Enable this to display negative values in the normal way, for example −3.7

Trailing sign

Enable this to display negative values with a trailing minus sign, for example −3.7 displays as 3.7−

In parentheses

Enable this to display negative values enclosed in parentheses, for example −3.7 displays as (3.7)

Blank if zero

Enable this to display nothing for zero values, for example, "0" displays as " "

Blank leading

Enable this to display nothing for leading zeros. This is primarily zeros intended for echoing typed characters during cash till input. For example, 0.37 displays as .37

Decimal point

Enter the decimal point character you want. This is normally a period (.) in the USA and UK and a comma (,) in continental Europe

Pad with asterisks

Enable this to replace spaces with asterisks (*). This is useful in cheque printing, for example: 0.37 appears as ****0.37 in a field of length 8

Validation

For non database fields you can set up explicit validation ranges and a default value for the field (possibly used to initialise the edit feidl if the Clear First property is set). If you don't enable validation DP4 will use 0 as the default value, and create suitable low and high values based on the input field type and length.

Database fields are always range-validated and defaulted using the data dictionary validation.

Low High

For non-database fields, enter the lowest/highest values permitted for the field. DP4 uses these values to validate field entry.

Default

For non-database fields, enter the value to offer as a default for field entry.


Formatting Pause Fields

Pause fields are rarely used, as most GUI programs will use buttons instead. A pause field is usually an edit control without a border contained in a error message type map. The control waits for input from the user, but the input is not echoed into the control. The purpose of a pause field is to force the user to acknowledge the message before continuing. The Data dialog for pause fields contains the following fields:

Use default values

Enable this to accept the behaviour defined in the user preferences for pause fields. If this chexbox is cleared you must select one of the following two options.

Allow 'Press any key'

Enable this allow to allow the user to acknowledge the pause field by pressing any key.

Designated key

Enable this to force the user to press the key specified for pause fields in the user preferences.


Formatting Times

The Data dialog for time fields contains the following fields:

Use default values

Enable this to accept the default formatting values for the field. These are derived from the user preferences. You have to clear this checkbox to set any other format.

There is a second "Use Default Values" checkbox inside the "Time Separators" group box. This must be cleared to override the default time separators.

Seconds

Enable this to show seconds, for example: "15:34:56". Time is normally displayed as just hours and minutes

Hundredths

Enable this to show hundredths of a second, for example: "15:34:56.88"

AM/PM

The AM/PM format is not currently supported.

Enable this to display time in the 12-hour clock format with an AM/PM suffix, for example: "01:56PM" or "11:34AM". Time is normally displayed in the 24-hour clock format.

Separator

Enable this to display time with a separator character, then enter the desired character in the adjacent edit box. A colon is often used, for example: "12:59:03". You can specify a different separator between the seconds and hundredths of seconds.

No spaces

Enable this to display time without any separator, for example: "1500"

Validation

Check this to set custom validation and default values. You can only set validation for non database fields. If not set non database fields will allow any time and use the null time as the default.

Database fields are always range-validated and defaulted using the data dictionary validation.

Low/High

For non-database fields, enter the earliest/latest times permitted. DP4 uses these values to validate field entry. For example you might want to force a delivery time to be within normal office houts.

Default

For non-database fields, enter the time to offer as a default for field entry. This is only used when the field has the clearfirst property.


Enumeration Control Properties

The Enumeration control properties dialog looks like this:

Click on a feature in the illustration above for further information


Group Box Control Properties

The Group box dialog looks like this:

Click on a feature in the illustration above for further information.


Header Control Properties

For information on how and when to use header controls in a map click here.

The Header properties dialog looks like this:

Click on a feature in the illustration above for further information.


Using Header Controls

You can create the headings for the columns in QAB or C multiple choice lists/windows using header controls. These allow the user to size the columns of data dynamically enabling you to include more information. When used you no longer need to worry too much about lining up headings with data.

In the 'choice map' display the heading text using header controls. Number the headers so that they have the same field number as the corresponding field in the item map. The headers should be numbered sequentially from left to right starting from 1, and may not work properly otherwise.

If there is a function key associated with a header it will be displayed as a button, and clicking it in will generate the appropriate function key value. This will allow a QAB or C program to implement sorting by branching to a different window which uses a different index to access the data. If there is no function key associated with the field the control can be sized but not clicked on to change the sort order.

If you use header controls you still need to set up the item map, but you need not take trouble to exactly size and align the item controls so that they line up with the appropriate header. You should however make sure they appear in the correct left to right order and are aligned properly vertically.


Icon Control Properties

The Icon dialog looks like this:

It contains the following tabbed property groups:

  • General: click on a feature in the illustration above for further information

  • Access

  • Colour

Icons are always displayed at their actual size.


Line Control Properties

The Line dialog looks like this:

Click on a feature in the illustration above for further information.


Map Properties

As well as the properties belong to each control, a map has properties that apply to the map as a whole, such as the rules used to navigate around the controls with the cursor keys (explained in Cursor Movement in_Maps).

The Map Properties dialog, used to edit these properties, actually contains two types of information - the information belonging to the special Text Control that defines the map's "Frame", and the actual map property information. The two types of information are not clearly separated in the dialog, but the only time you need to be aware of this is if you specify a shared control in the map properties: you will find that only the Control Properties are shareable.

To activate the dialog in which you can edit the properties of the map do one of the following:

  • Double-click any area in the map free of controls. The title bar is a good choice

  • Click the Map tool Toolbar Image on the Tool bar

  • Select Map Details from the Edit menu

  • Press F3

The Map Properties dialog appears.

Click on a feature in the illustration for further information.

Embedded Fields Colour Font Access Levels Caption Map Type Appearance Border Shared Control Size Field Layout Miscellaneuos Properties


Cursor Movement in Maps

In DP4 dialogs users can navigate between fields using the cursor keys. However the navigation is not based on the physical layout of the map. Cursor movement is interpreted using the numbers assigned to the fields. Each map is considered to be divided into rows and columns, and the field numbers are assumed to imply the row and colunn number. For instance, if your map has 2 rows and 3 columns, then fields 1,2 and 3 are on the first row, and fields 4,5, and 6 on the second. If the cursor is in field 2, and the user presses cursor down, DP4 will attempt to move to field 5.

It is not actually that difficult to number a map in rows and columns properly. You simply divide the map (or a sketch of it - it is probably a good plan to do this before you actually set up the map) roughly into rows and columns so that no more than one field appears in each box (you may need to use a little poetic licence if your fields don't line up neatly). It is OK if a particularly big field occupies several boxes in your grid. Number the fields according to the box in which they appear. In detail:

  1. When dividing the map into a grid you may ignore static controls that are headings for a following edit control. These two controls normally share a field number. You can also ignore all controls that will be given field number 0 (static controls that won't be associated with a field number, VCR controls, lines, and so on)

    You do not have to divide radio buttons that are in a group. These will all have the same field number. In any case, inside radio buttons navigation does not work in the same way as for other fields.

    If your map contains controls that need field numbers but are never used for input, for example hooks or output only edit controls, these should also be ignored when creating the grid. Assign them field numbers that are beyond the value rows*columns, so that the DP4 terminal manager knows they can be ignored when the user is navigating round a dialog. If you assign numbers in the range of the navigable controls your data entry routines will get called for these field numbers. This should be harmless (your code should drop through to the default case and omit the field), but it does impact performance slightly.

  2. In the map properties enter the value for 'Rows' as the number of rows in your grid. Enter the value for 'Cols' as the number of columns in the grid.

    Number the boxes in the grid, starting from 1, according to their position in the grid, from left to right, top to bottom. If there is a field in a box its field number should be the number of the box, If a field is in more than one box assign the lowest (top left) number. It does not matter if there are gaps in the field number sequence. Here is an example:

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    This means the natural sequence or Tab Order of the fields is also left to right,top to bottom. If you want the Tab Order to go through columns then set the "Column major" property and number the fields top to bottom, right to left. The example above would now look like this:

    1

    5

    9

    2

    6

    10

    3

    7

    11

    4

    It is even possible to number fields so that you do something like the top half of the first column, then the top half of the second, then the second half of the first column, and then finally the bottom half of the second. The trick there is to mentally cut your map in half and to move the lower half so that the two half maps form two diagonally opposite quarters of a larger grid. You then number the enlarged grid in the same way as previously described. Many maps on the system database are numbered like this.

    If this all seems more trouble than its worth, you can simply number the fields sequentially, and say they are all in one column and set the number of rows to the last field number (or the other way round - it makes no difference). In this case the user will still be able to use the cursor keys to move round the map, but the left and up arrow keys will work the same, as will the down and right arrow keys.


Radio Button Controls: General Properties

The Radio button dialog looks like this:

Click on a feature in the illustration above for further information


Tab Control Properties

See "Using Tabs" for information on how to use Tab Controls in DP4 programs.

The Tab properties dialog looks like this:

Click on a feature in the illustration above for further information.


Using Tabs

Tabs are used to create Tabbed dialogs like the ones used in the Map Editor itself.

You need to do the following to make good use of Tab controls:

  1. Create a map containing OK and Cancel buttons, a 3D static control in 'Inverted data map' colours and Tab buttons for each of the tabs in the page control. The tabs should be positioned so that they are all on the same horizontal position, all the same depth, all immediately adjacent and are immediately above the 3d static control. The 3d static control should be large enough to enclose the maps used to implement each page. Include a hook just inside the static control for attaching these maps. Make sure this map has an activating function key. F1 will be a good choice.

  2. Associate a different field number with each tab (it will be best to number them consecutively starting from 2). You can also optionally associate function keys, such as F2 and F3, with each tab, although this is not necessary; each tab can be mapped to the Enter key. Code your C application or QAB program to display the appropriate map for the Tab when it receives the option/function key value associated with the Tab.

  3. Create the maps for each page. Each map should have an activating function key that is the same as the option to which it corresponds in the Tabs. For example, the leftmost Tab's dialog will normally have F2.

You can use the Add Tabs dialog to slightly simplify creating a set of maps for a Tabbed dialog.


Add Tabs Dialog

Using the Add Tabs Dialog provides an easy way to create the basis of the set of maps needed to implement a Tabbed Dialog (like the ones used by MAPEDIT itself). This dialog will add a number of Tab Controls and optionally create the additional maps needed for the various pages.

The best way to use this dialog is as follows:

  1. Begin creating a new map as described in "Creating a New Map".

  2. Use the map's sizing handles to size the map appropriately.

  3. Create a static control that fills the area where the pages will be displayed. You need to leave room above the control for the Tab Buttons, and room below for an OK and Cancel button (if these will be required).

  4. Give the control a 3D border and set its colour to 'Inverted Data map'

  5. Save the map. If necessary use Save Copy As and then open the saved copy so that the map number is correct. You should use a map number whether the next few map numbers have not been used yet so that the maps for each Tab can be created.

  6. Make sure the control that will be the Tab Frame is still selected, and then select the Add Tabs option from the Options menu.

  7. Select the required number of Tabs, and adjust the size of the Tabs if required. There is no need to adjust the Tab Frames option, because the Tab Frame is the selected control. Check the Add Maps option.

  8. Click OK to create the Tabs.

Currently you will still need to use the Control and Map Property dialogs to set up colour schemes and Function keys. See "Using Tabs" for more information.


Text Control Properties

The Text Control Properties dialog looks like this:

Click on a feature in the illustration above for further information


Embedded Fields

You can "embed" fields in other controls, usually to display headings dynamically. In some cases an alternative way of doing this would be to use separate edit controls, but the advantage of embedding fields is that the words in the displayed text are correctly spaced and have the correct colour and font automatically. Fields are embedded by specifying %field_number within the Caption text of the General properties dialog (this is not how the embedded fields are actually stored, just how the Map Editor displays them). The Embedded Fields dialog allows you to define the properties of the fields you have chosen to embed. It looks like this:

At the moment, you can only specify the length in characters of the embedded fields, and MAPEDIT only allows embedded fields within controls that have text captions. (In fact the terminal manager allows embedded fields in edit controls, and it is possible to assign embeeded fields format flags using MAPPOST).

It is important that you increase the size of the containing control to cater for the largest possible values of the embedded fields.

You can embed different fields at the same place in the control, thus: (%1 %2 %3) etc.


VCR Control Properties

The VCR dialog looks like this:

Click on a feature in the illustration above for further information.

If creating a combo-style control, enabling the Prompt property in the General page of the edit control properties is the best way of incorporating a down-arrow for the list box.


Adding Buttons to Old Maps

You can convert old-style maps, such as those that ask the user to answer a "Yes/No" question or to press a key to do one action or press <Esc> to do another, into standard Windows dialogs with buttons. The advantage of using the Replacement field and Switch Y/N properties is that you do not need to change the way in which the program processes the fields; you need only recreate the map:

1. Delete the single field, numbered say 1, from the old map:

2. Add two button controls to the map, with field numbers 1 and 2 and give each an associated key press of <Enter>. (Note: that if the map being replaced is a "press a key to do this or press <Esc> to do that"-type of map, give the button numbered 2 the <Esc> key stroke in place of <Enter>)

3. If you want button 1 to correspond to "Yes" and button 2 to "No", enable the Replacement field property

If you want the reverse effect, enable the Replacement field and Switch Yes/No properties for button 1


Adding Help

You can add help messages to any controls in the map. The map editor contains a help editor which treats help messages like other maps. You may place the following controls in help messages:

  • text
  • bitmaps
  • icons
  • group boxes
  • lines

To activate the help editor:

  1. Ensure that the map, including the currently selected control (for which the help message is being created) has been saved (so that it is known to the database)
  2. Ensure that the selected control for which you want to create help has a field number other than 0. If two controls have the same field number, they must share the same help message, but you can also share help messages beween controls with different field numbers or even on different maps where this is appropriate (though this currently requires you to use MAPPOST).
  3. To activate the help editor, select the control you want to create help for, and then choose the Help Editor option in the Edit menu (or just press <F9>). This opens the map for the help message.

Then follow the same procedures as you would when editing other maps to creating the help message. Simple help messages can be created using just the Help Details dialog (this replaces the Map Properties Dialog in the Edit menu), which you can start by pressing <F3>.


Specifying Access Levels

In 4.603, the program will terminate at runtime if the user attempts to display a map or use a control to which they do not have access.

All users have read and write access levels in the range 1 to 99, where 99 is the highest level permitting unrestricted access. The Access group allows you to set the minimum access levels required for the user to view (read) or modify (write) the map and each of its control. The following tables give some examples that show how access levels work:

User Access | Map Access | Runtime Effect on User
Read 50 | Read 50 | Can use the map to browse data
Write 50 | Write 99 | Cannot modify data with the map
User Access | Control Access | Runtime Effect on User
Read 50 | Read 60 | } The control is not displayed on
Write 50 | Write 99 | } the map

To change the default access levels for the map:

1. Activate the Map Properties dialog

2. Click the Access button at the top of the dialog

3. Edit the read and write access levels and click OK

To specify the access to a control:

1. Activate the Control's dialog

2. Click the Access button at the top of the dialog

3. Edit the read and write access levels and click OK


Fonts

The Map Editor allows you to use any available font in maps and their controls. You could, if you really wanted to, use a different font for every control on a map. You are advised, however, to exercise restraint. If too many fonts are used in the same map, it will appear cluttered, inconsistent and unprofessional. Also you need to bear in mind that not all machines will have the same fonts installed.

When you create a new map and give it a title, that title will appear in the map's default font. If you subsequently want to change the font for the map, you can do so within the Font page of the Map Properties.

Controls that you add to the map also have a default font, which may be the same as that for the map or may be different. As with the map, you can change the font for a control in the Font page of the control's properties.

The Font Dialog

The Font dialog for Map Properties is shown below. The dialog for controls is the same except the "Use as Control Default" checkbox does not appear.

The dialog provides the following options:

Option Description
Use Default Font

If this checkbox is cleared then an explicit font must be specified for the map or control.

If this checkbox is checked there is a slightly different meaning in the control properties dialog from the map properties dialog.

  • In Map Properties the appropriate default font will always be used. Usually this will be the DP4 default font, but at run time DP4 may substitute an appropriate font as specified by the Appearance Tab in the Display Properties. For examples menubars and pulldowns will use the menu font.

  • In Control Properties the DP4 default will be used unless an explicit font was set in the map properties and the "Use as Control Default" property is also set, in which case that font is used as the default font. This is not supported by the underlying map architecture - instead the Map Editor sets the fonts for the controls in the map. This means that you may have problems if you try to use shared controls in such a map.

    In either case the Map Editor displays the font that will be used as the default font, greyed out.
Use as Control Default

This checkbox is only present in the Map Properties Dialog.

This affects the default font for controls in the map. Enable it, to use the Map font as the default; disable it, to use the DP4 default font as the default. As mentioned above, the Map Editor adjusts the fonts of all the controls that use the default font when posting the map to achieve this effect.

You can use this checkbox as a quick method of changing the font for all the controls in a map that use the default font.
Font

Select a font from the font list. The Map Editor allows you to use any installed font.
Script

Select one of the available scripts for the font. The Script will usually default to the script corresponding to the current default character set. Unfortunately the sample text will not always display properly. A bug in Windows NT/2000/XP causes the text only to display properly when using the normal character set, or the symbol set. The text will be displayed properly in the control when you asve your changes.
Size

Select a size in points. It is your responsibility to ensure that the point size is appropriate to the size of the map or control
Strikeout

Enable this to place a horizontal line through the text
Underline

Enable this to place a horizontal line underneath the text


Colour Scheme

Colour

The colouring facility within the Map Editor allows maps and controls to be coloured to suit your user interface conventions, whatever they may be. It does this by allowing controls to share Colour Schemes . On the Windows platforms the default colour schemes match the usual Windows User Interface conventions.

The Map Editor's colouring facility has two main components:

  • Colour Scheme Editor Accessed through the Colour Scheme Editor option on the Options menu, this editor allows you to create and modify colour schemes for controls and the map. You might, for example, use it to set up a colour scheme called Rosy Buttons for buttons whose faces you want to colour rose. The Colour Scheme editor is descibed here.

  • Colour Property Page Accessed by clicking the Colour tab in the control's properties, the Colour page allows you to select a colour scheme to be applied to the control from a list of available colour schemes as described below.

At least one colour scheme is provided for each control type. Using the colour scheme editor, you can create any colour schemes you like, either completely from scratch or if just a little customisation of an existing scheme is required, you can use that as the basis for a new scheme.

Selecting a Control's Colour Scheme

Assuming that more than the default colour scheme is available for the control, to select a different colour scheme for it:

  1. In the Control's property dialog, click the Colour tab; the Colour property dialog appears

  2. In the Colour Scheme list, select the desired colour scheme. Click OK to return to the Editing Window

To create or edit new colour schemes for a control select the control and then press F7 or select Colour Scheme Editor from the options menu to open the Colour Scheme Editor .


Colour Scheme Editor

Each database stores a set of colour schemes, that describe how controls of a particular type should appear. Controls are not coloured individually but must use one of the colour schemes. To activate the colour scheme editor:

  • Select Colour Scheme Editor from the Options menu

Or

  • Press F7 when you are editing a map or menu page. The Colour Scheme Editor will open the colour scheme for the currently selected map (or for any selected control on the map) for editing.

In both cases the Colour Scheme Editor dialog appears:

  1. In the Type list, select the type of control for which you want to create or edit a colour scheme, for example Map

  2. In the Scheme list, select New Scheme to create a new scheme or select one of the existing schemes to edit or delete.

  3. To create a colour scheme that is a variation of an existing scheme, in the Base list, select the scheme to use as the basis for the new scheme, for example Default. The implication of this is that any elements to which you do not explicitly assign colours, will inherit their colours from the base scheme. Basing your scheme on another is completely optional; you can select <None> if the scheme does not inherit any colours.

    In the Scheme Colours part of the dialog, the different elements of the control are listed adjacent to coloured boxes. (The control elements are organised into flat (two-dimensional) and, if supported, 3D (three-dimensional) appearance. Where 3D is supported, clicking the 3D button, displays the 3D control elements, and clicking Flat, redisplays the flat control elements)

  4. To change the colour of a control element, click on its coloured box: a red line appears around the box and the right-side of the dialog changes to show a correspondingly coloured box, also outlined in red. The right-side of the dialog is showing the current colour assignment of the control element.

    There are four ways to change the assignment, you can:

    • Assign a pre-defined colour from the DP4 master palette.
    • Assign your own custom colour.
    • If the scheme uses a base scheme assign the default colour used by the base scheme.
    • Make the element transparent (this is normally only used for the background of "static" controls).

    (If you click using the right mouse button, the right-side of the dialog does not change; allowing you to retain the previous context)

  5. Change elements as required until you have modified the scheme to your liking

  6. To save the colour scheme click Save As, type the name of the new scheme and click OK

  7. To delete an existing scheme click Remove.

    No check is made whether controls that use this scheme still exist - if a control uses a missing colour scheme, default colours will be used instead.

  8. To exit the colour scheme editor click Close

For details of assigning the new scheme to controls see Selecting a Control's Colour Scheme

Assigning a Colour from the DP4 Master Palette

Click on the DP4 tab at the top of the right-side of the dialog. Use the << and >> buttons to page through the DP4 master palette, and click on one of the displayed colours to assign it to the currently selected element of the control.

The DP4 master palette colours are either hard-coded colours with titles such as Black, Dark Blue, Dull Green and so on, or colours that correspond to Windows System colours with titles such as Scroll bar, Button face, Disabled text and so on.

Any change to the Windows System colours immediately changes the associated DP4 master palette colours.

The advantage of using colours from the DP4 master palette that map into the Windows palette is that the colour of screen elements in the application will change dynamically to match the user's selected Windows colour scheme. Beware of using a mix of mapped and hard coded colours in the same colour scheme. This can cause unexpected results if the user uses an unusal Windows Colour scheme. It is a good idea to test the effect of changig the Windows colour scheme on your application.

The master palette is stored in the userdata.sys file, and is also read from the system database and written to menudata.sys when a user logs onto the DP4 menu. In principle different users can have different master palettes, but at present the only means of creating master palettes is to use BROWSER. Using different master palettes is worth considering if your application needs to run on screens with very different colour capabilities.

Assigning your own Custom Colour

Click on the Custom tab at the top of the right-side of the dialog. A dialog appears holding a palette of boxes, some of which may be coloured.

To assign a previously created custom colour, click on its box. To create a new custom colour, click on a blank box, then click the Add Custom Colours button.

Use the standard Windows dialog that appears to create your own custom colour. Click OK to return to the DP4 custom palette, where the colour you defined should now be available.

Click its box to assign the custom colour to the currently selected element of the control.

Currently MapEdit does remember custom colours from one session to the next. However, if you have used a custom colour in a saved scheme, then selecting that scheme and clicking on the appropriate element's colour box will add the colour to the custom colours automatically. In addition you can store custom colours to be automatically displayed in the Custom page, each time you run the Map Editor, in the [CustomColours] section of MAPEDIT.INI as shown in the example below:

[CustomColours]
RGB1=128,64,128
RGB2=255,240,240
RGB3=192,224,192
...

Each RGBn=r,g,b defines a colour. The three comma-separated numbers following the equals sign correspond to the red, green and blue components of the colour, using the standard Windows format (a number between 0 and 255). For successive colours, you must increment the number n, appended to RGB, by one; the Map Editor uses the convention that the first missing entry indicates the end of the list.

Assigning the Default Colour used by the Base Scheme

Click the Special tab at the top of the right-side of the dialog, and click the box entitled Default (Use Base System). The currently inherited colour is shown in this box.

Assigning Transparency

Click the Special tab as above, but click the box entitled Transparent. This option is useful for the backgrounds of static controls, which need to display the same colour as the underlying map.


Specifying Mnemonics

For many controls, you can nominate one of the characters in the Caption property as a mnemonic. At runtime, the user can press the mnemonic character, which is indicated by being underlined, to action the option. To define the mnemonic edit the Caption property of the control's General properties, inserting "&" immediately before the character, for instance, "&Option", specifies "O".


Sharing Control Properties

An important feature of the Map Editor is the ability it gives you to share controls. This provides a number of benefits:

  • It allows you to save time creating maps by selecting from a list of predefined, shared controls.

  • It allows you to change the appearance and behaviour of a shared control in one place and have that change automatically reflected in all the maps that use the shared control.

  • It helps you to create maps having a consistent appearance.

When you opt to share a control all the property values in the control being edited are set to the same values as the selected shared control (except for the field number, which is not shared). Having done that, you have two options:

  • You can exit from the dialog with the shared flag enabled. This means that the control becomes a mirror of the shared control, and any changes made to the shared control are immediately reflected in your map and others that use the shared control.

  • You might want to change just a few of the properties. If you start editing the properties with the shared flag enabled you should be aware that you are editing the properties of the shared control globally, which will affect all the maps that use it. If this is not what you want to do, make the control independent by disabling the shared flag before saving the map.

We recommend that you create one or more library maps with all the controls you are going to share and only edit the shared control definitions in those maps.


Specifying a Shared Control

To specify that a control is shareable in its General properties dialog:

  1. Enable the Shared checkbox

  2. Give the control a meaningful name because it will appear in the Add Shared Control dialog and must make sense in that context.

    Note that if you use the drop down box to select an existing shared control that controls properties will override the current properties for the control.


Adding a Shared Control to the Map

To add a shared control to your map:

  1. Select Add Shared Control from the Controls menu. The Add Shared Control dialog appears, listing the controls you can share.

    If you created the shared control in the current session, you must save the map before the control is listed in the Add Shared Control dialog.

  2. Highlight the desired control in the list and click OK to add it to the active map.

  3. The control is added at the top left of the map, and can be moved to the desired position in the usual way. You should also use the Controls Properties dialog to set its field number.

You can also change an existing control in a map to a previously created shared control by opening its property dialog, checking the "Shared" checkbox and then selecting the appropriate shared control from the drop down list in the "Name" Combo box. In fact this is the only way to use a shared control as the "Frame Control" for the map.


Deleting Controls

To delete controls:

  1. Select one or more controls to be deleted (as described in Selecting Controls).

  2. Press the <Del> key or select Delete from the Edit menu.

To undo a deletion, select the Undo command in the Edit menu or press <Ctrl+Z>.


Moving Controls

To move controls:

  1. Select one or more controls to be moved (as described in Selecting Controls).

  2. Place the cursor over one of the selected controls

  3. Drag the controls' outline to the desired location

  4. Release the mouse button to complete the move, or press <Esc> to cancel the move.

To undo a move, select the Undo command in the Edit menu or press <Ctrl+Z>.


Positioning Controls by Specifying their Co-ordinates

You can explicitly position controls by specifying their X and Y co-ordinates, in the current units (DP4 units or pixels). The co-ordinates are measured from the top-left corner of the map and indicate the position of the top-left corner of the control.

  1. Select Control List from the Edit menu. The Control List dialog appears, listing all the controls in the current map, with their field numbers, types, positions and sizes.

  2. In the list, highlight the desired control and click Move. The Change Control Position dialog appears.

  3. Specify the new horizontal (X co-ordinate) and vertical (Y co-ordinate) positions, then click OK to return to the Map editing window.


Sizing Controls

  1. Click the control to be sized. Sizing handles appear (usually 8, at the corners and the middle of each edge of the control). Each handle will let you move the relevant edge or corner.

  2. Drag the handle you want to move: as you size the control the status bar will be updated with the new size. The size will change in jumps if you have Snap to Grid enabled.

  3. Release the mouse button to complete the operation, or press <Esc> to cancel.

You can also size most controls by setting the size in the General Page of the control's properties.

You can size a map in exactly the same way as you size other controls. The sizing handles for a map are displayed permanently. Only the parts of the handles that are inside the map are visible.


Aligning Controls using the Grid

The grid and align features provide methods for quickly and easily aligning controls in your map. You can display the grid while you are creating the map so that controls are positioned exactly where you want them with respect to other controls.

To specify the grid options:

Select Grid from the Options menu. The Grid attributes dialog appears.

Its options are as follows:

Width | specifies the spacing in pixels or DP4 units between the horizontal grid points.
Height | specifies the spacing in pixels or DP4 units between the vertical grid points.
Show grid | displays the grid in the current map. The grid points are drawn over the map background.
Snap to grid | when controls are moved or sized the part being moved or sized is aligned on a grid point.
Make global default | if checked applies your grid settings to any further maps opened in the current session and saves the new settings to MAPEDIT.INI.


Aligning Controls using the Align Commands

The Align command in the Options menu provides options for aligning controls, spacing controls equally from one another and making controls the same size.

The align options work by surrounding all the selected controls with a box and aligning all the controls with respect to that box.To align controls:

  1. Select the controls to be aligned (as described in Selecting Controls).

  2. Select Align from the Options menu or click the appropriate Tool bar icon or accelerator keys.

    If you selected the Align command, a secondary menu appears, giving several options to align controls with one another, each of which is described below.

    The images below show a map prior to being aligned and the effect of each of the align options in turn together with the toolbar icon and accelerator that has the same effect.

    Top | <Ctrl+↑>
    Bottom | <Ctrl+↓>
    Vertical Centre
    Left | <Ctrl+←>
    Right | <Ctrl+→>
    Horizontal Centre

    In previous versions of the Map Editor the Horizonal and Vertical Centre options were interchanged. They have been changed in line with other products.


Spacing Controls

To space controls equally:

  1. Using the <Shift> key method (described in Selecting Controls), select three or more controls

  2. Select Space Evenly from the Options menu

  3. On the secondary menu, select one of the two options:

    • Space Evenly Horizontally reduces or increases the horizontal space between all the selected controls so that it is the same as that between the first and second selected controls:

      after Horz space becomes:

      Instead of using the menu you can simply press <Alt+←> after selecting the controls

    • Space Evenly Vertically reduces or increases the vertical space between all the selected controls so that it is the same as that between the first and second selected controls:

      becomes

      Instead of using the menu you can simply press <Alt+↑> after selecting the controls


Making Controls the Same Size

To make controls the same size:

  1. Using the <Shift> key method (described in Selecting Controls), select two or more controls.

  2. Select Make Same Size from the Options menu.

  3. On the secondary menu, select one of the two options:

    • Make Same Size Width reduces or increases the width of the second and subsequently selected controls so that they are the same width as the first selected control, for example:

      becomes

    • Make Same Size Height reduces or increases the height of the second and subsequently selected controls so that they are the same height as the first selected control, for example:

      becomes

    An alternative to using the menu is to press <Alt+→> to make controls the same width or <Alt+↓> to make them the same height.


Cutting, Copying and Pasting Controls

To cut controls to the clipboard:

  1. Select one or more controls as described in Selecting Controls.

  2. Click the Cut button on the Tool bar or select Cut from the Edit menu, or press <Ctrl+X>. All selected controls are deleted and moved to the clipboard.

To copy controls to the clipboard:

  1. Select one or more controls as described in Selecting Controls.

  2. Click the Copy button on the Tool bar or select Copy from the Edit menu or press <Ctrl+C>. The selected controls remain in the map, but are copied to the clipboard.

To paste controls from the clipboard, click the Paste button on the Tool bar, or choose Paste from the Edit menu, or press <Ctrl+V>. Controls on the clipboard are pasted into the map.

Pasting Properties

You can apply the properties of a copied control to a collection of existing controls by using the "Paste Into Selection" option from the menu, or by pressing Ctrl+Shift+V. To use this option you should have cut or copied exactly one control, and then selected the set of controls which should be similar to to. When you use this option, the original controls are replaced by copies of the copied control, but in the location and with the field number of the control being replaced. Any incompatible controls are ignored. This option will be particularly useful if you want to change a number of very similar controls, such as the rows of a "Window".


Editing DP4 Menu Pages

The Map Editor contains options for editing the maps used the DP4 menu program (DP4 itself). These options also allow you to edit the other information associated with the menu, notably the commands executed by the options in the menu, and, for options that require them, secondary maps used for requesting values for parameters in the command.

Usually you will probably use the DP4 menu page options via the MENUEDIT program which contains a number of other facilities you will need to set up a proper DP4 menu, but this is not actually necessary except when you need the additional facilities.

In order to edit DP4 menu pages directly from the Map Editor you first need to use the Open DP4 Menu Pages option. This opens a dialog similar to the Open Mapset dialog, and allows you to select the database and language for which the menu pages are to be edited, and to choose the page to select initially. After you complete the dialog a window similar to the mapset window containing all the menu pages is opened:

Note that the toolbox is slightly different from normal. It is explained here.

In general editing a DP4 Menu Page is just like editing any other map. The major difference is that the Control Property Dialogs are slightly different:

  • The Access Page is removed.
  • Where relevant an Option Action page is added. The Option Action page is explained here.

There are also options to copy and delete one or all menu pages. These work just like the corresponding options for copying maps and mapsets. The only difference is that the menu option information associated with the maps for the menu pages is also copied or deleted.


DP4 Menu Page Toolbox

The DP4 menu page toolbox is used exactly like the ordinary Map Editor toolbox as described here. It contains the following tools:

Pick Tool for selecting/manipulating Controls | Button Control | Text Control
Option Control | Group Box Control | Bitmap Control
Icon Control | Line Control | Tab Button Control
Header Control | Hidden Option Control |

Text Controls are used for adding background or informational text, not associated with menu options.

Option controls are numbered text controls which can be selected and clicked to invoke a menu option.

Hidden Option controls are numbered options in the menu which do not have a visible control for selecting them. The most common hidden option is option 0, selected when the user escapes from a menu page, but you can set up other numbered hidden options if desired. Hidden options are displayed at the top left of the page at edit time, but are invisible at run time.


Option Action Properties

The Option Action Page looks like this:

Click on a feature in the illustration above for further information.


Using Menu Commands

There are two types of menu action:

  • Built-in menu commands

    You can use built-in Menu option commands to perform specific actions such as changing to another database, prompting the user to log on and changing the user preferences.

  • Executable commands
    You can run any program including:

    • Your own DP4 application programs (implemented in QA Build, Report Writer, or a language such as C/C++).
    • Standard DP4 utilities such as database backup and recovery tools
    • Non-DP4 programs such as Word Processors

    You can add one or more of the built-in special command tails to affect how the programs are run (for example the %BATCH tail is needed to run batch files and shell scripts), and can supply ordinary command tails such as command line options and filenames.


Built-In Menu Commands

The menu command options that you can provide as options in a menu are described in this table:

Command | Description
%DB database name | Changes to the specified database, for example, %DB SALESORD. It is important to use make sure the Return To page and option are valid when you use this option.
%LOCKUP | Locks up the system until the user re-enters the password
%LOGOFF | Terminates and re-starts the DP4 menu system. The log-on screen is displayed
%LOGON | Prompts the user to log on without terminating and re-starting the system. The logon screen is displayed
%NOSTATUS | Turns off the status line
%PAGE | Goes to the page specified in 'Return to page' field of the option. The option specified in the 'Return to option' field is highlighted.
%PASSWORD | Lets the user change the password
%PREFERENCES | Lets the user change the preferences
%STATUS | Turns on the status line at the top of the menu that displays the database and user names, time, date and menu page while DP4 is running. (This is unrelated to the status line that appears near the bottom of the screen in DP4 editors, such as the Menu editor.) To turn on the status display permanently, use the user preferences option
%SYSTEM | Exits DP4 and returns to the operating system (do not confuse this option with the command tail of the same name)


Running a DP4 Utility

Load a DP4 utility by specifying its program name on the command line. For example, this is the command to load the DP4 Data Entry and Enquiry utility:

BROWSER

Use the DP4 utility command tails to restrict access to the database where this is useful in your application. For example, this command loads the Data entry and enquiry utility to update the CUSTOMER table on the Sales Order database:

BROWSER -DB %DB -TABLE customer

Consult the DP4 Quick Reference Guide for a complete list of utilities and their command tails.


Running an Application Program

Load an application program by entering the executable name, or running the DP4 utility such as Report Writer or QA Build that is required to load the program. For example, an executable program to output customer labels to a dot matrix printer might be run as follows:

PRINTLBL -DEVICE DOT_MATRIX

Run a QA Build program using the command tails to specify the database and program name. For example:

PROGRUN -DB %DB -PROG maint


Running a Non-DP4 Program

Run a non-DP4 program by entering the command you would normally enter at the operating system command line. Include any paths that are required to locate the program.

Use the Menu command tails to control how a program is run. For example, you might load a non-DP4 program such as a word processor with these command tails:

WORDPROC %1 %SYSTEM

The command tail %1 indicates that the filename is to be supplied at run-time, and, on MS-DOS, %SYSTEM terminates the database manager and user interface manager to increase the available memory.

Remember to use the %CLOSEDB option when running programs such as a tape backup utility, and the %BATCH option when running batch files or shell scripts


Special Menu Command Tails

The Menu command tails are described in this table:

Command Description

%1, %2 .. %9

Prompts for the values to substitute for these variables at run-time, using the Second map option. On the second map, include the text to prompt the user for the values, and include fields numbered 1 to n that correspond to the variables %1 to %n
%BATCH

This option is not very well named. It instructs the DP4 program to use the shell to run the command if an attempt to run it normally fails. This option is required to run .BAT files on MS-DOS or Windows, or shell scripts on Unix/Linux. It is also needed to run internal commands like dir on MS-DOS/Windows.

Note that the shell is only invoked if the program cannot be run normally. Thus %BATCH would not work as intended if you used iut to do something like running an ordinary executable program with command line input/output redirection.
%CLOSEDB

Closes the database whilst an option is executed. You need to do this if the option requires exclusive access to the database files is a non DP4 program that needs access to the database (for example a tape backup utility).
%DB

Substitutes the current database name at run-time. For DP4 utilities remember to use this format: -DB %DB

%NOCLEAR

(Text based interface only) Suppresses clearing the screen for a command that does not output to the screen

%NOWAIT

(From 4.620) DP4 does not wait for the command to complete before continuing to execute. This option will only work well for programs that run properly as background tasks.

%PAUSE

Pauses and asks the user to press any key once the program has run. This option may not work as intended on Windows
%PREFERENCES

If using a non-DP4 program to change the user preferences, implements the changes in the current session
%SYSTEM

(MS-DOS only) Attempts to remove the database manager and user interface manager from memory to increase the available memory


Editing Menus

In the Map Editor the term "menu" is used to refer to what would be called an action bar menu in QA Build: it is a collection of related maps that together comprise a pull-down menu system. Although a menu is held in several maps, this is not outwardly apparent when using the Menu Editor; it provides an easy-to-use interface, within a single window, for creating and editing a menu bar and each of its pulldowns.

This section describes how to use the Map Editor's built-in menu editing facilities to create and maintain action bar menus residing on DP4 databases.

The following topics are described:

  • What are Menu Numbers?
  • Avoiding Overwrite Problems
  • Opening a Menu
  • Converting Maps to Menus
  • Creating a New Menu
  • Adding Lines to the Pull-down Menu
  • Defining Accelerator Keys
  • Deleting Options from the Pull-down Menu
  • Inserting New Options in the Pull-down Menu
  • Deleting a Menu


What are Menu Numbers?

Within the Map Editor, you refer to a menu by its database, mapset and menu number. The database and mapset have the usual meanings. The menu number represents the menu you want to open, create or delete. Although it refers to the whole menu, this number is the number of the map holding the menu bar, while the immediately following numbers are used for the map numbers of the pulldowns from left to right. For example, a menu numbered 4 with three pull-down menus is stored in four maps, numbered 4, 5, 6 and 7, where map 4 holds the menu bar and maps 5 through 7 hold its pulldowns.

To be more exact the map number of each pulldown formed by adding the option number of the option in the menu bar that opens the pulldown to the the map number of the menu bar itself.

This means that you have to be careful when editing or creating a menubar in an existing mapset, as is explained next.


Avoiding Overwrite Problems

Pulldowns are stored as maps after their menu bar map, so you must take great care to ensure that you have sufficient free map numbers for the pulldowns when you create or modify the menu. If you do not, you may unintentionally overwrite other maps in the mapset. For example, if you create a menu and add three pulldowns then, using the next available map number, create a conventional map in the same mapset, that map will be overwritten if you add another pulldown later on.

At present the Map Editor will not warn you if an existing map will be over-written.


Opening a Menu

To open a menu:

  1. Select Open Menu from the File menu; the Open Menu dialog appears.

  2. Fill in the dialog, specifying the database, mapset, language and menu number.

    Although menus are really just maps, initially the menu combo box will only display maps that have been created as menus. If you check the "All Maps" checkbox the combo box will display all the maps in the mapset. This allows existing maps to be converted to menus.

  3. When you have slected the appropriate menu click OK. A Menu Editing window displaying the menu appears. If the menu is already being edited as an ordinary map the menu editor will not be opened, but the existing Map Editing window will be re-activated. You should close any map editing window for a map if you decide you want to edit that map as a menu instead.

    Edit the menu to the desired state; for details see Creating a New Menu.


Converting Maps to Menus

The Open Menu dialog provides a facility for converting ordinary maps into menus. This is useful where you have upgraded an application database that contains a pull-down menu system, and you want to amend it with the Map Editor.

Before converting a map, make sure there are enough free map numbers for its pulldowns, or if they exist already that the map references them correctly. As an example, the typical set of controls for a menu bar with two pulldowns is given below:

Field Nr | Type | Position | Description
0 | Line | 1,19 | Underlines the menu bar
1 | Text | 1,1 | The first menu bar option
2 | Text | 65,1 | The second menu bar option
101 | Edit | 1,19 | The attach point for the first pulldown
102 | Edit | 65,19 | The attach point for the second pulldown

The field numbers of the attach points are:

100 + <fieldnr_of_associated_menu_bar_option>

which define the location of the top-left corners of the pull-down maps. The convention is that the map numbered one greater than the menu bar is attached as the first pulldown, the map numbered 2 greater is the second pulldown and so on.

To convert a map into a menu:

1. Select Open Menu from the File menu

2. In the Open Menu dialog, specify the database and mapset

3. Enable the All Maps option. This causes the Menu: list to display all the maps in the mapset, rather than all the menus

4. In the Menu: list, locate the number of the map holding the menu bar, and click OK

The Map Editor should find that the map is not marked as a menu and ask you whether you want to convert it

5. Click Yes to convert the map into a menu

Edit the menu to the desired state; for details see Creating a New Menu.


Creating a New Menu

To create a new menu:

  1. Select New Menu from the File menu. The New Menu dialog appears:

  2. Fill in the dialog, specifying the database, mapset and new number for the menu, then click OK. A Menu Editing window for creating the menu appears:

  3. To specify the menu, double-click the blank menu option near the top-left corner of the Edit window or highlight it and press <Enter>. The Menu Item Properties dialog appears:

  4. Click the Caption field and type the name of the first menu bar option. As you type the text appears on the menu behind the dialog. Options should usually have a pull-down menu attached to them so next click the Popup checkbox. If you do, a blank menu option is added below the menu name.

  5. To define the first option of the first menu, click the down-arrow button in the dialog, click the Caption: box, then type the name of the option. Repeat this to add all the options for the first menu.

    You can use the up-arrow button to move back up the menu once you are finished. You need not define the field numbers of the options yourself; the Map Editor will always ensure that they are correct. That is, they increase from the top of the menu to the bottom

  6. To add a new menu, click the up-arrow button until you are at the top of the menu, then click the right-arrow button. Repeat step 4 to create the menu. You can also move to any part of the menu by closing the property dialog and then double clicking on the desired part of the menu.

Having roughly defined all the pull-down menus, you can fine tune your menu system by adding separator lines in the pulldowns, specifying accelerator keys, deleting unwanted options and inserting additional options.


Adding Lines to the Pull-down Menu

Lines are used in Windows menus to group related options. To insert lines in your pull-down menu:

  1. Double-click the menu option above, or below, which you want to insert a line. The Menu Item Properties dialog appears with details of the menu option

  2. To insert a line:

    • Above the option, click Insert ^ and then enable the Separator checkbox

    • Below the option, click Insert v and then enable the Separator checkbox


Defining Accelerator Keys

In the run-time application, accelerator keys give you an alternative way of selecting menu options through function key presses. To specify an accelerator key for a menu option:

  1. Double-click the menu option. The Menu Item Properties dialog appears

  2. In the Accelerator Key list, select the function key that selects the menu option


Deleting Options from a Menu

Deleting Options from the Pull-down Menu

You delete a menu option in one of two ways:

  • With the Menu Item Properties closed, highlight the menu option by clicking it or by using the cursor keys. Press <Del>

  • In the Menu Item Properties, click Delete when the details of the unwanted menu option are shown


Inserting New Options in the Pull-down Menu

To insert a new menu option:

  1. Double-click the menu option above or below the position where you want to insert a new option. The Menu Item Properties dialog appears

  2. In the Menu Item Properties, click Insert ^ to insert the new option above the current one or Insert v to insert it below


Deleting a Menu

To delete a menu:

1. Select Delete Menu from the File menu. The Delete Map dialog appears, containing details of the current menu, if there is one. You can, of course, choose to delete any menu

2. Fill in the dialog, specifying the database, mapset and menu number, then click OK to delete the map

All of the maps associated with the menu are deleted.


Configuration

This section describes the various ways in which the Map Editor can be tailored to suit your particular requirements. The following topics are covered:

  • Configuration Options
  • Configuration Details
  • MAPEDIT Command Tails
  • Map Editor Preferences
  • Map Editor Window


Configuration Options

An configuration file, MAPEDIT.INI, is located in the same directory as the DP4 configuration file (usually the same directory as the directory for DP4 executables in 4.620, and the Windows directory in earlier releases) . The general format of the MAPEDIT.INI file is as follows:

  • Defaults section - specifies the default values for the Map Editor. This section starts with the [Defaults] keyword and can hold a number of configuration options./P>

  • User sections - there may be many of these allowing you to customise the behaviour of the Map Editor for particular users. This section starts with the [username] keyword, for example [fred]. To run the Map Editor assigning the defaults for a user you append the -USER command tail when loading the Map Editor, as in:

    mapedit -user fred

    You may use the same configuration options as in the [Defaults] section. Options in the user section override any setup in the Defaults section

You can change most (useful) MAPEDIT.INI settings from within the Edit Options dialog, accessed from the Options menu.


Configuration Details

The following can be placed in the [Defaults] or a [user_name] section:

AllowBitmap=0|1
AllowButton=0|1
AllowCheckbox=0|1
AllowEdit=0|1
AllowGroupBox=0|1
AllowHeader=0|1
AllowHiddenOption=0|1
AllowHook=0|1
AllowIcon=0|1
AllowLine=0|1
AllowOption=0|1
AllowRadioButton=0|1
AllowTab=0|1
AllowText=0|1
AllowVCR=0|1

Determines whether the user can add controls of the specified types to maps

AllowDeleteControls=0|1

Determines whether the user can delete controls. If AllowDeleteControls is 0, the Delete option in the Edit menu is greyed out, the Delete button in the control list and on the Menu bar is greyed out and the Delete key is ignored

AllowDeleteMap=0|1

Determines whether the user can use delete options in the File menu. If AllowDeleteMap is 0, the:/Delete Mapset/Delete Map/Delete Menu/options are greyed out

AllowEdit=0|1

Determines whether the user can add edit maps. It takes two values:

  • 0
    runs the Map Editor in read-only mode
  • 1
    runs the Map Editor without editing restrictions

In read-only mode, the user cannot do the following:

  • Adjust the map size
  • Grey out controls or select them with the dashed rectangle
  • Save changed property values for controls
  • Delete controls, maps or mapsets
  • Access the toolbox or options on the Controls menu

AllowNewMap=0|1

Determines whether the user can add new maps and menus. If AllowNewMap is 0, the New Map and New Menu options are greyed out in the File menu, and the new map button on the Menu bar is greyed out

AllowNewControls=0|1

Determines whether the user can add new controls. If AllowNewControls is 0, the toolbox is inaccessible, the Controls menu options are greyed out

AskDelete=0|1

A value of 1 forces confirmation when a control is deleted; an OK/Cancel Message is activated

AutoToolBox=0|1

A value of 1 automatically activates the toolbox when the user creates or opens a map. Set up this behaviour if you prefer to use the toolbox rather than creating default controls from the Controls menu

ControlsUseMapFont=0|1

Determines whether controls that us the default font use the map's font or the real default font. You can override this in the Map Editor by setting the Use as Control Default checkbox in the Font page of the Map Properties

ControlSizesAreClient=0|1

Works with SnapToClient. When ControlSizesAreClient is 1, any sizing and co-ordinate information for edit and text controls is with respect to the client area, not the complete control area; borders are ignored. This includes the width and height value in the General page properties for the control and the origin and sizes displayed in the Status bar at the foot of the Map Editor window.

DefaultBitmapSize=widthxheight
DefaultButtonSize=widthxheight
DefaultCheckBoxSize=widthxheight
DefaultEditSize=widthxheight
DefaultGroupBoxSize=widthxheight
DefaultHeaderSize=widthxheight
DefaultHelpSize=widthxheight
DefaultHookSize=widthxheight
DefaultLineSize=widthxheight
DefaultMapSize=widthxheight
DefaultRadioButtonSize=widthxheight
DefaultTabSize=widthxheight
DefaultTextSize=widthxheight
DefaultVCRSize=widthxheight

Determines the default size for a control of the specified type when it is created. DefaultMapSize and DefaultHelpSize determine the default size for a new map or help message.

All these sizes are in DP4 internal units unless you add the IniSizesInPixels=1 setting. Edit and Text sizes refer to the client area size unless IniSizesAreClient=0 is set.

DisableShared=0|1

A value of 1 disables Add Shared Control on the Controls menu

EditLimit=n

Determines the maximum number of Map editing windows which can be opened in a session. Zero, the default, indicates that there is no limit

GridShow=0|1

Determines if the grid used for aligning and sizing controls should be shown (1) or be invisible (0) . The default is 0.

GridSnap=0|1

Determines if controls should snap (align) to the grid when they are moved. The default is 0

Gridx=n

Determines the width between the grid points. The default is 8 internal units (half the average width of a character in the default font)

Gridy=n

Determines the height between the grid points. The default is 8 internal units (one quarter the height of a character in the default font)

IniSizesAreClient=0|1

Determines whether sizes in mapedit.ini refer to the size including the border, or the client area size. The default is 1

IniSizesInPixels=0

Determines whether sizes in mapedit.ini are given in pxiel units ot DP4 Internal units. The default is 0. The Grid settngs are always in internal units.

LimitControlToClient=0|1

A value of 1 prevents the user from moving controls outside the map. This setting can be changed using the Edit Options dialog.

MaxMapCols=n

Constrains the maximum number of columns in maps

MaxMapRows=n

Constrains the maximum number of rows in maps

MinYear=n

Sets the minimum year allowed in dates

MaxYear=n

Sets the maximum year allowed in dates

MaxMapHeight=n
MaxMapWidth=n
MinMapHeight=n
MinMapWidth=n

If set to non-zero values these contrain the maximum and minimum sizes for maps.

All these sizes are in DP4 internal units unless you add the IniSizesInPixels=1 setting. Sizes refer to the client area size (not including the border and title) unless IniSizesAreClient=0 is set.

MaxButtonHeight=n
MaxButtonWidth=n
MinButtonHeight=n
MinButtonWidth=n
MaxCheckBoxHeight=n
MaxCheckBoxWidth=n
MinCheckBoxHeight=n
MinCheckBoxWidth=n
MaxEditHeight=n
MaxEditWidth=n
MinEditHeight=n
MinEditWidth=n
MaxGroupBoxHeight=n
MaxGroupBoxWidth=n
MinGroupBoxHeight=n
MinGroupBoxWidth=n
MaxHeaderHeight=n
MaxHeaderWidth=n
MinHeaderHeight=n
MinHeaderWidth=n
MaxLineHeight=n
MaxLineWidth=n
MinLineHeight=n
MinLineWidth=n
MaxRadioButtonHeight=n
MaxRadioButtonWidth=n
MinRadioButtonHeight=n
MinRadioButtonWidth=n
MaxTabHeight=n
MaxTabWidth=n
MinTabHeight=n
MinTabWidth=n
MaxTextHeight=n
MaxTextWidth=n
MinTextHeight=n
MinTextWidth=n
MaxVCRHeight=n
MaxVCRWidth=n
MinVCRHeight=n
MinVCRWidth=n

If set to non-zero values these constrain the size of controls of the appropriate type. All these sizes are in DP4 internal units unless you add the IniSizesInPixels=1 setting. Edit and Text sizes refer to the client area size unless IniSizesAreClient=0 is set.

SnapToClient=0|1

Affects controls that may have border (non-client) areas, currently edit and text controls. All but the border of these controls is considered to be the client area. When SnapToClient is 1 control sizing handles disregard the border and bound only the client area and with snap-to-grid enabled, controls are aligned as if they had no borders.

Units=Pixels|Dialog

The size and position of maps, controls and the grid can be displayed either in DP4 internal units or pixels. The default is pixels. To work with Dialog units set: Units="Dialog". You can change this setting using the Edit Options option from the Options menu and setting the Display Dialog Coordinates checkbox to your preference.


MAPEDIT Command Tails

The following command tails are supported.

-DB database | Opens the database after loading
-MAPSET mapset | Use with -map to open a map
-MAP map or db\mapset\map or mapset\map | Opens an edit window for the map.
-LANGUAGE n | Edit maps with language n.
-USER name | Reads options from the [name] section in MAPEDIT.INI


Map Editor Preferences

You can override certain MAPEDIT.INI options from within the Map Editor by choosing Edit Options from the Edit menu:

The options are described below:

Option | Meaning
Display edit field numbers | Disable this to suppress the field numbers that appear within the edit controls
Auto display tool box | Enable this to display the tool box whenever you start to edit a map.
Restrict controls to inside of map | Enable this to prevent the user from moving controls outside the map When this option is selected you will not be able to move a control that is already partially outside the map unless you move it so that it is completely within the map.
Display Dialog Coodinates | Enable this to work with DP4 units, rather than pixels
Save options across sessions | Enable this to save the Edit Options preferences to MAPEDIT.INI for your subsequent Map Editor sessions
Supported application names (for loading resources) | See Specifying the Resource Location


Specifying the Resource Location

Pictures used by maps are held in one of three locations:

  1. in the DP4 resource file

  2. as external files

  3. embedded within the application program or, if running a QA Build program, within the interpreter (PROGRUN)

If (3) applies, for the Map Editor to be able to display the picture correctly you must specify the location and name of the application, as follows:

  1. Select Edit Options from the options menu; the Edit Options dialog appears.

  2. In the supported application names box, type the full path name of the application holding the resources. Although you can specify as many applications as you like, each pathname must be specified on a separate line.

    It is a good idea only to specify the application that will be running when the map is displayed. At design type a bitmap or icon will be displayed correctly if any of the applications specified contain the named resource. At runtime the bitmap or icon will only be displayed correctly if the running application contains the resource.


Map Editor Window

As with other DP4 programs for Windows, the position and size of the Map Editor's main window is stored in the DP4 Configuration File. If no width or depth has been set up there, the window is initially displayed maximised. The parameters can be overridden if the Map Editor is loaded with either the SW_SHOWMAXIMIZED or SW_SHOWMINIMIZED flags.


Appearance

Title Bar

Enable this to make the top line of the map appear as a Windows caption title

Justification: Left/Centre/Right*

Select whether the text is left aligned, right aligned or centred in the title bar/top line of the map

The DP4 terminal manager is set up so that titles are, by default, aligned according to the style of the Windows GUI. In Windows 95 and Windows NT titles are left aligned. This will over-ride any setting you make in the Map Editor. To force the terminal manager to follow the settings specified in the Map Editor, insert the following line into the DP4 Configuration File (either in the TRMW section or the program's own section):
stdtitles = <n>
where <n> is 0 if you wish to follow the alignment specified in the Map Editor,
1 if you wish to centre all titles, and
2 if you wish to left-align all titles.
Delete the line if you wish to revert to the Windows default.


Appearance

Left text

Enable this to place the caption to the left rather than to the right of the check box

Switch Yes/No

Enable this to reverse the meaning of the 'selected' and 'cleared' states for the check box. If you do this, the selected state returns the cleared state value and the cleared state returns the selected state value. This might seem strange, but it allows you to rephrase the caption without reprogramming. For example, you could enable this option to rephrase "Quit without saving" as "Save file before quitting".


Appearance

Specify how the border, if any, should appear:

No border | Enable this to draw the edit control without a border
Border | Enable this to draw a single-line border around the edit control.
3D | Enable this to draw a border with a three-dimensional effect, as if the bottom and right sides of the control were illuminated

Disabled

Enable this to set the control to be initially appear disabled.

Shadow

Enable this to draw a shadow along the bottom and right sides of the control. You can combine this option with one of the border styles above.

Prompt

Enable this to display a drop-down arrow to the right of the edit control, simulating a combo control. Clicking on the arrow or pressing <Ctrl+P> returns abort_cod=SPACE_BAR to the application allowing it to provide a suitable behaviour (for example by calling pick_record() using a map attached bwlow the edit control

Spinner

This option only applies to numeric edit fields. Enable this to display up down arrows to the right of the edit control. Clicking on the arrows will increment or decrement the number displayed in the edit control. From 4.620 the edit control will also have a slider drawn under it when it is active. This can be used to adjust the value more rapidly.


Appearance

3D

Enable this to draw a border with a three-dimensional effect, as if the bottom and right sides of the control were illuminated

Shadow

Enable this to draw a shadow along the bottom and right sides of the control. Combine this option with the above to achieve the desired appearance


Appearance

Left text

Enable this to place the caption to the left rather than to the right of the radio button


Appearance

Specify how the border, if any, should appear:

No border | Enable this to draw the control without a border
Border | Enable this to draw a single-line border around the control. (This is the default)
3D | Enable this to draw a border with a three-dimensional effect, as if the bottom and right sides of the control were illuminated

Shadow

Enable this to draw a shadow along the bottom and right sides of the control. Combine this option with the above to achieve the desired appearance


Border

None/Thin/Bevelled/Dialog

Select the style of the map's border.

Shadow

Enable this to display a shadow around the map


Key Type

Buttons can be mapped to two different types of key:

  • Special keys include the cursor, editing and function keys (often coloured grey on PC keyboards).

  • On Screen Keyboard is used for buttons that take the place of ordinary alpha-numeric keys. Usually the Caption and the Associated Key Press will be the same. Typically the field number will be zero for this type of button.

Associated Key Press

Specify the key stroke generated when the button is pressed.

Enable this property to cause the button to be drawn with a thickened border


Button Type

Button/Header/Tab Type

Buttons, Headers and Tabs are one of three types, depending on the information to be displayed on their faces:

Text | Enable this to display just the caption on the control
Icon | Enable this to display an icon on the control
Bitmap | Enable this to display a bitmap on the control


Caption

Specifies the map's title, that is, the wording which appears in the map's title bar. To include embedded data items in the title (for example file names) put %n where n is a unique field number in the field numbering scheme of the map. To include a % character in the title put %%. This will be shown as %% in the map editor, but as a single % character at run time. For full details see Embedded Fields


Caption

Specify the text to display on the button. You can embed fields in the text to display variable data (though you can also show text directly into the button using its field number so this is not usually necessary). To specify an embedded field use this format: %field_number where field_number is a unique field number in the field numbering scheme of the map. To include a % character in the text put %%. This will be shown as %% in the map editor, but as a single % character at run time. For full details see Embedded Fields.

You can specify a mnemonic character by preceding it with "&". See Specifying Mnemonics for more details. You can specify more than one line of text if required.


Caption

Specifies the check box's text. You can embed fields in the text to display variable data (though you can also show text directly into the check box using its field number so this is not usually necessary). To specify an embedded field use this format: %field_number where field_number is a unique field number in the field numbering scheme of the map. To include a % character in the text put %%. This will be shown as %% in the map editor, but as a single % character at run time. For full details see Embedded Fields.

You can specify a mnemonic character by preceding the character with "&", for example, "&Text". For more details see Specifying Mnemonics

Field Nr

The Map Editor automatically supplies the next unused field number. Checkboxes must have a unique field number in the rage of input fields. It is essential to number the fields correctly, because this together with the map properties determines how the cursor behaves in the map. For more details see Editing the Map Properties


Caption

Specifies the group box's title. To include embedded data items in the title put %n where n is a unique field number in the field numbering scheme of the map. To include a % character in the title put %%. This will be shown as %% in the map editor, but as a single % character at run time. For full details see Embedded Fields

Field Nr

Group Boxes usually have field number 0. If you want a mnemionic to move to the begiinning of the group give thr group the same field number as the first input control inside the group box. If the group box has a unique field number you can change the title of the box by displaying data into the corresponding field number.


Caption

Specifies the header's text.. You can embed fields in the text to display variable data. To specify an embedded field use this format: %field_number where field_number is a unique field number in the field numbering scheme of the map. To include a % character in the text put %%. This will be shown as %% in the map editor, but as a single % character at run time. For full details see Embedded Fields.

Associated Field Nr

Headers should be given the same field number as the corresponding control in the map used to fill in the rows displayed under the headers. It is important to get this right so that at run time the column displayed under the header can be sized appropriately.


Caption

Specifies the radio button's text. You can embed fields in the text to display variable data. To specify an embedded field use this format: %field_number where field_number is a unique field number in the field numbering scheme of the map. To include a % character in the text put %%. This will be shown as %% in the map editor, but as a single % character at run time. For full details see Embedded Fields.

You can specify a mnemonic character by preceding the character with "&", for example, "&Radio Text". For more details see Specifying Mnemonics

Field Nr

The Map Editor automatically supplies the next unused field number. Radio buttons present two or more mutually exclusive options. All the buttons in a given set should have the same field number. This must still fit in with the overall field numbering scheme so that the cursor behaves properly in the map. For more details see Editing the Map Properties

Value

Enter the value to be returned on selection of the radio button

Default

Optionally Check this to set a default value for the radio button group. The value of the field entered using the radio button will be set to the default in dialogs for which the "clearfirst" property is set.


Caption

Specify the text to display. You can embed fields in the text to display variable data. To specify an embedded field use this format: %field_number where field_number is a unique field number in the field numbering scheme of the map. To include a % character in the text put %%. This will be shown as %% in the map editor, but as a single % character at run time. For full details see Embedded Fields.

You can specify a mnemonic character by preceding the character with "&", for example, "&Menu Option". See Specifying Mnemonics for more details

Associated Field Nr

Specify the field with which the text is associated (if any). You must do this for text menu options, but it is optional for edit field headings- if you do so you can use mnemonics to select the edit field and moving the mouse over the heading will display the help message for the edit field.


Caption

Specifies the Tab's text. You can embed fields in the text to display variable data (though you can also show text directly into the button using its field number so this is not usually necessary). To specify an embedded field use this format: %field_number where field_number is a unique field number in the field numbering scheme of the map. To include a % character in the text put %%. This will be shown as %% in the map editor, but as a single % character at run time. For full details see Embedded Fields.

Field Nr

The Map Editor automatically supplies the next unused field number. Tabs should normally be numbered consecutively from left to right.


Command

This is used to determine the command line to be executed by the option. It will usually consist of the name of the program to be run, followed by any command line options. There are a number of special commands and command line options that are handled specially by the DP4 program. These all begin with a "%" character.

The special commands are described in "Built-In Menu Commands" and the special options are described in "Special Menu Command Tails". For more information and examples refer to "Using Menu Commands".


Custom

Enable this to select one of your own icons.

Resource/File Name

When custom is enabled, enter the resource name of the icon, for example "ICON", or if "File" source is selected supply a name with either an absolute path or a path relative to the application working directory.

Source

When custom is enabled, specify the source of the icon. There are three possibilities:

DP4Res | Enable this if the icon is located in the DP4 resource file
Application program | Enable this if the icon is embedded in the application program that displays the map. See Specifying
File | Enable this if the icon is in an external file.

See Specifying the Resource Location for information on how to make the Map Editor display the correct image when Application is selected as the source.

The image displayed in an icon can be changed at runtime. In QAB program process the field as a type G field. The image displayed will be updated using the fieldname as a filename or as a resource name, depending on the original selection made for the source. In a C program call the show_resource() or show_object() functions.


Default Push Button

Enable this property to cause the button to be drawn with a thickened border even when it is not active. A Default Push Button should be mapped to the Enter key. It is typically used for the OK button in dialogs.

You should only nominate one button on a map as the default button


Disabled

Disables the VCR button at runtime


DP4

Enable this to select one of the predefined icons


Behaviours

Clear First

Enable this flag to cause the data in the field to be reset to the the default value for the field initially. Your application has to set the range and clearfirst variables appropriately to use this facility (this is done automatically in QA Build). Disable it to retain the previous value for the field.

Disallow Null

Enable this to prohibit entry of the null value. The user will have to enter a valid value for the field if it is null initially.

Auto Enter

Enable this option to remove the need to type the separator character between parts of dates and times and to allow the field to lose focus as soon as it is full. This flag is useful where you want to build up a complex entry field from several smaller fixed lenth fields.


Enumeration Control Properties

Data

The Enumeration Data dialog allows you to select a database or non-database field for the enumeration. Usually you would only need to specify the database field used by an enumeration control in a QA Build program.


Enumeration Maps

Enumerations are currently implemented using secondary maps. The first map contains a menu of all the available options. In addition you need separate maps (numbered as original map number + field number of option in main enumeration map) to contain the text associated with each option in the enumeration. It is hoped that this facility will be enhanced so that it is only necessary to define the first of these maps, and to take the text to be displayed for each option directly from the main enumeration map. Alternately a facility may be provided in MAPEDIT to manage enumerations more conveniently.

For example, if your enumeration contains the three options Red=1,Green=2,Blue=3, and your main enumeration map is map 1 of the "Colours" map set, then the additional amps, would be Map 2 (Red), Map 3 (Green), and Map 4 (Blue). Mapedit uses the information in the main enumeration map to decide how many further maps there are.

If you want to use non consecutive values for your enumeration you should number the fields accordingly. For example you could assign Blue=4, by missing out field 3 in the main enumeration map and creating it as field 4 instead. In this case the map for Blue would have map number 5.

Mapname

Use this combo box to select the mapset to contain the enumeration maps. You are recommended to store enumerations in a separate mapset from other maps. One reason to do this is that currently the "Weed" facilty of QABUTIL is not aware of enumeration maps, and may therefore try to delete them if they are stored in the same mapsets as other maps.

Map Nr

Enter the map number to be used for the enumeration. Obviously this option should allow the map to be selected visually. Unfortunately this is not easy to achieve in the current Mapedit. You may find it easier to open your enumerations as a mapset so that you can find the map you want more easily.


Field Layout

These properties are not shareable - they have to be set up separately in each map.

These settings affect the way the cursor moves in the map. See Cursor Movement in Maps for more details.

Rows/Cols

Specify the number of rows of fields and the number of columns of fields on the map

Column Major

Enable this to number the fields from top to bottom, left to right

Field Tab Wrap

Enable this to allow the cursor to move from the last option to the first. You should only disable this if your program is written in an older style: with key fields at the beginning of a data entry map, not separated from the other input fields. In this case, wrapping results in the record being re-read from the database, which causes the entered data to be discarded


Field Nr

The Map Editor automatically supplies the next unused field number. Specify the field with which the bitmap is associated or specify a unique field number that fits in with the map's field numbering scheme. For more details see Editing the Map Properties


Field Nr

The Map Editor automatically supplies the next unused field number. Numbering the fields correctly is essential, because this together with the map properties determines how the cursor behaves in the map. Enter the field number with which the static text is associated. For more details see Editing the Map Properties


Field Nr

The Map Editor gives icons field number 0 by default. If you want to change the icon at run time you need to specify a unique field number. If the icon represents a menu item then the field number for the icon should be the same as the field number for any text option that selects the same option. For more details see Editing the Map Properties


Force Next Option

If this option is checked the option corresponding to the "Return To..." option is automatically executed after this option is selected. If this option is cleared the user can select an option in the normal way.


Format

Type

Enter the data type of the field such as: Integer, Long, Real, Date, Time, Text, Boolean, Pause field

Length

The Map Editor displays the actual length of the field in the data dictionary if the field is validated from the database. You can use a shorter length for database fields. For non database character fields the length should match the length of the character field that will be processed in the field. For other non field types it does not matter if the lengths are different.

Depth

For multi-occurs fields, specify the number of lines to display. For example, the CUSTOMER.ADDRESS field has three lines. If you specify 2 as the Depth for the CUSTOMER.ADDRESS, only its first two lines are displayed.


Associated Key Press

A header control can optionally be associated with a key press (normally a function key). If you do this then the header will be drawn like a button to indicate that it can be clicked. Clicking the header will cause the ascoiated abort_code value to be returned to the application. The application can use this to perform some appropriate action, for example, sorting the items in the window using the column associated with the header control.


IME

Applicable to Japanese users only. For character data, define the Input Method Editor (IME) mode, as one of the following:

Off (0) | IME is turned off, but can be turned on again. (This is the default)
Windows(1) | IME setting left up to Windows
On (2) | IME is enabled with the previous input mode
Banned (3) | IME is turned off and cannot be turned on by the user
Full Width Hiragana (4) | IME is turned on and characters are converted to DBCS (double-byte character set) Hiragana
Full Width Katakana (5) | IME is turned on and characters are converted to DBCS Katakana
Half Width Katakana (6) | IME is turned on and characters are converted to single-byte Katakana. (Katakana are the only Japanese characters in the single-byte character set)
Full Width Alpha numeric (7) | IME is turned on and characters are converted to DBCS Alphanumeric. DBCS Alpha characters look like ordinary ones, but take up two bytes in memory and are typically twice the width of normal characters


Justification

Default Justification/Right/ Centre

Define whether the text is left aligned, right aligned or centred within the edit control


Justification

Left/Right/Centre

Define whether the text is left aligned, right aligned or centred within the static text control


Legacy Printing

When a 4.6xx map is output to a legacy print device (i.e. one not printing to a DFPRINT device), DP4 converts the map's internal coordinates, which are pixel based, to a row/column approximation. Up to release 4.621 this conversion is hard coded at 32 internal units vertically equals one row.

For maps intended only for printing this works well. However, if the map is also used in dialogs and contains edit controls, then the edit controls will typically be separated by at least 40 internal units. (Maps converted from 4.5xx using -smarten typically use 48 units). Print output from such a map will contain blank lines.

The Ideal Solution

Ideally, each control in a map wuold have both pixel and row/column coordinates. Unfortunately this is not compatible with the existing 4.6xx map architecture, and would require base dictionary changes.

The Stop-gap Solution

From release 4.622 MapEdit allows you to specify two additional properties for the map properties: an X and Y factor for Legacy printing. If set, the values are used for printing to traditional DP4 print devices. For example for map 6 of the DFSETUP mapset, the edit controls are spaced 48 units apart, so this is the appropriate Y factor. This compresses the upper part of the map, where there are no edit controls, but gives better results than the default value of 32. The solution works well provided all controls are well aligned on a fixed size grid.

Please note that the values for X and Y factor must always be expressed in the "internal" coordinate system, even if you have configured mapedit to use pixel based coordinates.


Map Editing Window

Gives you a window in which to create a map. Each time you create a new map or start work on an existing one, a Map Editing window is opened. Its title bar displays the name of the mapset and number of the map. Although several Map Editing windows can be opened, only one can be active. One way of activating a window is to click it.


Map Type

Select the map type. DP4 uses the colour and other preferences for the selected map type

This property is not shareable


Menu bar

Provides access to program menus. Clicking a menu name displays a list of commands for accessing the Map Editor's functions. The menu structure is as follows. Note that the Tool bar and the Tool box also provide access to many of the menu commands.

  • File
    • Open Database
    • Close Database
    • New Map
    • Open Map
    • Open Mapset
    • Delete Map
    • Delete Mapset
    • Open Menu
    • New Menu
    • Delete Menu
    • Open DP4 Menu Pages
    • Copy Page
    • Copy All Pages
    • Delete Page
    • Delete All Pages
    • Save
    • Save Copy As
    • Save All
    • Copy Map
    • Copy Mapset
    • Exit
  • Edit
    • Undo
    • Copy
    • Cut
    • Paste
    • Delete
    • Map Details
    • Help Editor
    • Control Details
    • Control List
  • Controls
    • Button
    • Edit
    • Text
    • Radio Button
    • Check Box
    • Group Box
    • Bitmap
    • Icon
    • Line
    • VCR
    • Attach Point
    • Tab
    • Header
    • Add shared control
  • Options
    • Grid
    • Edit Options
    • Colour Scheme Editor
    • Align
      • Top
      • Bottom
      • Vertical Centre
      • Left
      • Right
      • Horizontal Centre
    • Space Evenly
      • Horz space
      • Vert space
    • Make Same Size
      • Width
      • Height
    • Add Tabs
  • View
    • Tool Bar
    • Status Bar
    • Tool Box
  • Window
    • Cascade
    • Tile
    • Arrange Icons
    • Next
    • Previous
    • 1 mapset [n]
    • 2 mapset [n]
  • Help
    • About Mapedit


Menu

Accelerator

For menus only, enter the function key press that selects this menu option


No Auto Repeat

Select this if the VCR should only fire once when the user presses it. Normally VCR buttons will fire repeatedly if the user keeps them pressed. This may not be desirable for some buttons, for example a button that invokes a "Delete" function.


Access

All users have read and write access levels in the range 0 to 99, where 99 is the highest level permitting unrestricted access. The Access group allows you to set the minimum access levels required by the user to select the option. Users must have both sufficient read and sufficient write access before they can select the option.


Picture/Text Layout

Specify where you want the caption in relation to the picture:

Centre | Overlays the picture with a centred caption
Text at bottom | Centres the caption beneath the picture
Text at left | Places the text at the left of the button, and centres both vertically
Text at right | Places the text at the right of the button, and centres both vertically


On Return

The two edit boxes in this group set the menu page and option to highlight after this option has completed.

Page

Usually this will be the same page as you are currently editing. However, for the Escape Hidden Option it will normally be the page that was used to select the current page. You will also want to specify a different page when you use the %PAGE command.

Option

Selects the option number to highlight next. The default for new options is to highlight the same option. If there is a natural progression through the options on a page you may wish to highlight the "next" option. For example the DP4 system menu highlights the "Compiler" option after selecting the "Editor" option on the QA Build page.


Shared

Enable the Shared option to apply the properties of a previously created shared control. Disable it, if you want to define the properties of the control uniquely. For more information see Sharing Control Properties

Name

With Shared enabled, you can enter the name of a control whose properties you want to apply. If creating a new shared control, specify the name under which it will be known.


Size

Width/Height

Specifies the width and height in pixels or DP4 units of the control. Note that changing the size of the control does not change the size of any text in the control


Size

Raw

The control is sized according to the raw dimensions of the bitmap in Pixels. In this case the Width/Height box should not be used as the control size will be changed appropriately at run time.

Resized keeping aspect ratio

This option allows you to stretch or shrink the bitmap image keeping the pixture in proportion. When doing this you need to adjust both the width and height of the control simultaneously, as otherwise you may find he control snaps back to its previous size.

Resized to fill control

This allows you to stretch and shrink the control freely. The image will distort when you do this, so it is really only useful for bitmaps that are used as a background.

Resized to stored image size

Do not use this option - it will probably be removed and replaced by an option to tile the bitmap in a future release. It was intended as a way of displaying bitmaps that have additional size information embedded in them, but few, if any, bitmaps actually contain such information.

Width/Height

Specifies the width and height in pixels or DP4 units of the control. Note that changing the size of the control will have no effect if you use the Raw option, and will be somewhat unpredictable if you use the Resize keeping aspect ratio option.


Source

When Icon or Bitmap is enabled, you must give the location of the icon (.ICO) or bitmap (.BMP) file. There are three possibilities:

DP4Res | Enable this if the bitmap/icon is located in the DP4 resource file
Application | Enable this if the bitmap/icon is embedded in the application program that displays the map
File | Enable this if the bitmap/icon is in an external file.

See Specifying the Resource Location for information on how to make the Map Editor display the correct image when Application is selected as the source.

Resource/File Name

If Application or DP4Res source is selected enter the resource name of the bitmap/icon, for example "PICTURE", or if "File" source is selected supply a name with either an absolute path or a path relative to the application working directory.

The image displayed in a button or header can be changed at runtime. In QAB program process the field as a type G field. The image displayed will be updated using the fieldname as a filename or as a resource name, depending on the original selection made for the source. In a C program call the show_resource() or show_object() functions.


Source

Specify the source of the bitmap. There are three possibilities:

DP4Res

Enable this if the bitmap is located in the DP4 resource file

Application

Enable this if the bitmap is embedded in the application program that displays the map

File

Enable this if the bitmap is in an external file. Up to release 4.621 the bitmap must be in a .BMP file. As of release 4.622 you can use the following additional file formats: JPEG, GIF, Metafile and Enhanced Metafile,and ICO. However, for a texture only BMP files are supported. Please note the following additional points:

  • The support for image types other than BMP relies on supportin the operating system for OleLoadPicture(). This function is not supported on Windows CE, and may not be supported on Windows 9x/NT machines without Internet Explorer

  • The documentation for the supported image types for OleLoadPicture() is unclear. Neither JPEG or GIF files are mentioned as being supported, but they do work, at least on Windows XP.

  • Although ICO files can now be displayed in a Bitmap control you should continue to use Icon controls unless the control is required to display images of various types

See Specifying the Resource Location for information on how to make the Map Editor display the correct image when Application is selected as the source.

Resource/File Name

If Application or DP4Res source is selected enter the resource name of the bitmap, for example "BITMAP", or if "File" source is selected supply a name with either an absolute path or a path relative to the application working directory.

The image displayed in a bitmap control can be changed at runtime. In QAB program process the field as a type G field. The image displayed will be updated using the fieldname as a filename or as a resource name, depending on the original selection made for the source. In a C program call the show_resource() or show_object() functions.


Source

Edit controls and checkboxes can optionally be associated with database fields. This serves two purposes:

  • The dictionary information for the field is used to set corresponding properties on the control such as the maximum number of characters allowed (the length), the scale factor for real fields, and the low,high and default values for the field.

  • The field name is used by QA Build to work out what data should be displayed or input into the field.

Database

Enable this to specify a field that is on the database.

Field

With Database enabled, enter the name of the database field


Special

These properties are not shareable - they have to be set up separately in each map.

Function Key

"0" is the default value and disables activation of the map through a function key press. If you want to be able to press a function key or click on the map to move the cursor to it when the cursor is in another map, select the function key to be used

Double Click

"0" is the default value and disables double-click processing. If you want to take special action when the map fields are double-clicked, assign the function key press to be generated by the double-click

4.500 Position

You may want to enable this for maps created prior to DP4 4.600 that you want to display with the DP4 4.600 terminal manager. Such maps will be positioned using the same co-ordinate system as pre-4.600 versions of DP4.

Controls to Contain Borders

Normally the size of edit and text controls is stored minus the border (non client area). This ensures that the client area is always the appropriate size even if Windows is configures to use an unusually thick border size.

However, if you want a number of controls to join up exactly it is desirable to store the total size and to subtract the border size afterwards. Enable this to store the control size including the border size.

Map to contain overlapped controls

Enable this to allow a map to contain controls that overlap one another and which need to be dynamically rearranged to bring the current control to the top of the view order. You don't need to enable this if the viewing order of overlapping controls does not need to change. In 4.620 MapEdit always displays maps with controls ordered correctly. Changing the field number of a control will change its position in the view order.


Behaviours and Notifications

Replacement Field Switch Yes/No

These properties allow you to convert certain old dialog maps that have one input field into button dialogs, or to use simple functions like map_pause() or map_yes() to work with a map containing several buttons. For further information see Adding Buttons to Old Maps

Func Key

Enable this checkbox to take special action with function keys. (In QA Build combined/menu entry procedures, this flag is automatically enabled. Setting it elsewhere in QA Build will allow you to use function keys to shortcut to the next menu)

Special Keys

Enable this to allow special action to be taken with the <Page Up>, <Page Down>, <Insert>, and <Delete> keys. Pressing one of these keys when the button has focus will return the appropriate value in abort_code.

Notify

Enable this option to cause the buttons associated keypress to be posted to the application using a Windows WM_CHAR message. You may need to enable this flag if you want to use C/C++ code to subclass the button in some way. For example you might enhance an on screen keyboard by providing a key that behaved like Shift or Caps Lock.


Special

Function Keys

Enable this to take special action with function keys

Special Keys

Enable this to allow special action to be taken with the <Page Up>, <Page Down>, <Insert>, and <Delete> keys. Pressing one of these keys when the control has focus will return the appropriate value in abort_code.

Data Change Key

If you set up a data change key, then whenever the user changes the state of the control the corresponding value will be returned in abort code. Normally DP4 checkboxes and radio buttons do not return any information to a program until the user moves away from the control. Setting a data change key allows a program to provide visual feedback to the user every time the checkbox or radio button changes. For example a program can immediately enable or disable other controls in the map depending on the state of the control.


Notifications

Special Keys

Enable this to allow special action to be taken with the <Page Up>, <Page Down>, <Insert>, and <Delete> keys. Pressing one of these keys when the edit control has focus will return the appropriate value in abort_code (but the Insert and Delete keys will only work if the user has not started editing the field)

Function Key

Enable this to allow special action to be taken with function keys, such as taking a short cut to the next menu. (In QA Build combined/menu entry procedures, this property is automatically enabled)

Data Change

If you enable the data change flag, which is currently only available for numeric fields, then whenever the user changes the value in the edit box the value 0x7ff will be returned in abort code. Normally DP4 edit controls do not return any information to a program until the user moves away from them. Setting the data change flag allows a program to provide visual feedback to the user every time the data changes.


Notifications

These two settings are only relevant to text controls that are menu items (ones that have a unique field number).

Special Keys

Enable this to allow special action to be taken with the <Page Up>, <Page Down>, <Insert>, and <Delete> keys. Pressing one of these keys when the text control has focus will return the appropriate value in abort_code.

Function Key

Enable this to allow special action to be taken with function keys, such as taking a short cut to the next menu. (In QA Build combined/menu entry procedures, this property is automatically enabled)


Special

No Dialog

This flag should be set if the page associated with a Tab is display only and does not contain entry fields. If this flag is not set when the page does not contain entry fields it will not behave properly.


Status Bar

When enabled, the Status Bar appears at the bottom of the Map Editor Window. It gives you an explanation of menu options as the cursor moves over them and the position and size in pixels or DP4 units of the currently selected control or group of them (so it is particularly useful when you are sizing or moving controls). You can hide/show the Status Bar by selecting its option on the View menu; which may be useful when editing large maps.


Associated Key Press

A tab control must be associated with a key press (normally a function key), so that when the user clicks on the Tab the application can be notified. Clicking the tab will cause the ascoiated abort_code value to be returned to the application. The application can use this to perform the appropriate action, usually displaying the appropriate page of a dialog.

The same value should be used as the Function Key in the Map Properties for the map that will be attached to the base map for that Tab.

Usually you should set the function key of the map containing the Tabs to F1, then set the Associated function key of the Tabs and the Function key of the map for the Tabs to F2,F3...


Texture

The Texture property is introduced in release 4.621.

Check the Texture checkbox if the bitmap is a bitmap that you want DP4 to recolour to match the map colour scheme. For information on how to create such a bitmap see the Skinning DP4 in the Guide to DP4 configuration. In release 4.621 Mapedit will not display a texture bitmap in its runtime colours but in its raw colours. From release 4.622 Mapedit displays the bitmap as it will appear at run time.

In release 4.621 you can only use a 256 colour bitmap as a texture. As of release 4.622 you can also use true colour bitmaps. However your should only use true colour bitmaps where this improves performance on a particular graphics card, as recolouring a bitmap is expensive in both time and memory. You cannot use other image formats as a teture, only BMP files.

Unlike the default Texture supported by DP4 a texture bitmap will not automatically show through in the other controls in your map. You need to give the controls a transparent background for this.


Title bar

The Title bar located at the top of the Map Editor window displays the program title and indicates the currently active map.


Tool bar

Provides quick access to commonly used features. All features available on the Tool bar can also be accessed from the Menu bar.

The Tool bar also contains a drop-down list box showing the database for the currently active map:

By clicking the drop-down arrow you can view all the opened databases.

To toggle the display of the Tool bar, select its option on the View menu.


Toolbox

Provides quick access to the most common operation in the Map Editor, which is adding controls.

Pick Tool for selecting/manipulating Controls | Button Control | Edit Control
Enumeration Control | Text Control | Radio Button Control
Group Box Control | Check Box Control | Bitmap Control
Icon Control | Line Control | VCR Control
Attach Point Control | Tab Button Control | Header Control

To display the Tool box, select its option on the View menu; to remove it, do the same. The Tool box is a floating window. To position it, click its title bar and drag it.

Double-clicking an icon adds the corresponding control to the top-left corner of the current map. Single-clicking an icon makes a cross-hair cursor appear when you move the pointer to any map. Position the cross-hair where you want the control, then either click to add the control at its default size or drag the mouse to add the control, sizing it yourself.

Once you have added a control, the Map Editor reselects the pick tool in the Tool box. If you wish to keep the current icon highlighted to add more controls of the same type, press the <Shift> key when selecting the control.

The currently selected tool is coloured maroon and its button is pressed in. In the illustration the Pick Tool is selected.

If the tool box does not contain all these tools when editing an ordinary map it is because some controls have been disabled in the MAPEDIT.INI configuration file. See the various AllowXXX options for details. The toolbox for the help editor only contains a subset of these tools. The toolbox for editing DP4 menu pages is also rather different, and is described here.


Associated Key Press

Specify the key stroke generated when the button is pressed. This will be set automatically when you select the VCR Button image, but you can change the key press to another value if required.


Button Type

Select the VCR button you want by clicking on the appropriate image.


Vertical

Enable this to change the orientation of the line from horizontal to vertical.