Using the Editors


Chapter E . Editor Basics

The chapter describes basic editor tasks needed to build your application components:


Starting the Editor

How to Start the Editor

Do either of the following:

The editor workspace is displayed. It is in this space that you begin creating the interface to your application.

Figure 5-1 The editor workspace consists of a menu, toolbars, a new screen and an associated Properties window, and can display optional secondary windows.

For a description of each workspace component, refer to Chapter 2, "Editor Workspace."

Editor Startup options

prodev supports the following startup options:

The name of the screens, reports and/or components to be opened initially can also be specified.


Opening and Creating Application Components

Your Panther application components are created in the editor and then stored in a library or a repository.

Creating a New Application Component

A new, untitled screen is open by default when you start up the editor. Now you can begin populating the screen with widgets, or create other types of application components.

How to Create a New Application Component, Library or Repository

  1. From FileNew, choose
  2. For a new screen or report, choose whether you want to use the wizard. If you use the wizard, Panther guides you through the creation process using imported database tables in a repository (a repository must be open).

Opening Application Components

To open an application component, the library that it lives in must be open. If you want to ensure that a library opens when you start up an editing session, specify the library's path in the SMFLIBS variable. However, if the library is not specified in SMFLIBS, you can open the library via the File menu.

Once the library is open, there are two ways to access and open application components:

Viewing the Library Table of Contents

While you are working in the editor, you can:

How to Open the Library Table of Contents
  1. Choose ViewLibrary TOC. A Library Table of Contents window opens.

    Figure 5-2 You can access the library table of contents to open all types of application components.

  2. From the Type option menu, select the type of application component:
  3. You can do any of the following from the Library TOC window:
  4. To open an application component, select the desired name and choose Open or double-click on it.

    The object opens in the workspace. The name is displayed in the title bar in the format: appComponent@libraryName.

  5. Continue to open application components, as needed, by repeating step 2.
  6. To close the Library TOC window, choose Close from its system menu or choose ViewLibrary TOC to toggle the display off.
How to Remove an Application Component

From the Library TOC, select the object and choose Delete. The following prompt is displayed:

Remove [appComponent] from library?


Opening and Creating a Library

If you are responsible for creating libraries for the team, you must also ensure that the libraries open by default when you start up Panther. To open libraries, specify the library's path in the SMFLIBS variable. However, if you are a member of the team and you want to create and open a local library, then you can do so from the File menu option in the menu bar.

How to Open a Library

You can have more than one library open at a time.

  1. Choose FileOpenLibrary. The Open Library dialog box opens.
  2. Select the library (the default filter extension is .lib) that you want to open and choose OK.

    Note: You can also open a library from the library table of contents window.

How to Open a Remote Library

(JetNet/Oracle Tuxedo only) You must have opened a middleware session and have a file access server (devserv) running which enables access to libraries located on remote machines. For further information on the server types, refer to "Server Executables" in JetNet/Oracle Tuxedo Guide.

  1. Choose FileOpenRemote Library. The Open Remote Library dialog box opens.
  2. Select a server from the list of servers. The libraries with their respective paths are displayed for the selected server.
  3. Select the library that you want to open and choose OK.

    Note: You can also open a remote library from the library table of contents window.

Creating a Library

If you are responsible for creating libraries for the team, then it is recommended that you create:

These libraries are provided by copying the distributed libraries, namely client.lib, server.lib, and common.lib, from SMBASE/config to your application development directory. The distributed libraries have copies of files you can modify which are needed for development.

How to Create a Library

  1. Choose FileNewLibrary. The New Library dialog box opens.
  2. Specify the name of a library (with a *.lib extension) and choose OK.

How to Create a New Remote Library

(JetNet/Oracle Tuxedo only) You must be connected to the middleware and have a file access server (devserv) running which provides access to remote machines. For further information on the server types, refer to "Server Executables" in JetNet/Oracle Tuxedo Guide.

  1. Choose FileNewRemote Library. The New Remote Library dialog box opens.
  2. Specify the name of a server in the Server field.
  3. Specify the name of a library in the Library field (with a *.lib extension) and choose OK.

Opening a Middleware Session

In JetNet/Oracle Tuxedo applications, you open a middleware session to connect to a middleware and access the libraries and repositories on the application server. The middleware controls processes and communication between the application's clients and servers. To test an application screen that uses services, you must have a valid middleware connection.

How to Open a Middleware Session

  1. Choose FileOpenMiddleware Session. The Connect dialog box appears.

    Figure 5-3 Connect to the middleware for a client on a server machine, also called a local or native client.

    For a client on a server machine, the Connect dialog box has the following fields and specifications:

  2. Enter the information required in the appropriate fields depending on whether you are a client on a server machine or a PC client.

    If the application requires level-two authentication, then you must enter the application password in the Password field.

    Note: The level of authentication is decided at design time. Thus, a user should be aware of the decided authentication level.


Opening a Database Connection

While you are building your application components, you need a direct connection to the database server if you are:

How to Connect to the Database within the Editor

  1. Choose FileOpenDatabase or in test mode, choose DatabaseConnection. The Choose Engine dialog opens.
  2. Select the desired engine and enter a connection name, if the default name is not appropriate.
  3. For some engines, a Connect to Database dialog opens where you can enter connection options. The options vary according to the selected engine. For JDB, an engine-specific Open File dialog is displayed from which you can select the desired JDB database file.

For information on connecting programmatically, refer to "Programmatically Connecting to the Database" in Application Development Guide.

How to Close a Database Connection within the Editor

Choose FileCloseDatabase or in test mode, choose DatabaseDisconnect. Both options close direct connections on a specified engine. They do not close connections that have been established via the application server.


Creating Widgets

When you create widgets on a client screen, users see and use most of the widgets to enter data and display output. You can control how client screens and widgets respond to input and output by setting their properties.

How to Create a Widget

  1. Select the widget type from either of the following:
  2. Move the mouse pointer to the position on your screen where you want the widget to be placed.
  3. Do either of the following:
  4. (Recommended) Assign a name to the widget (in the Properties window, under the Identity heading in the Name property).
  5. If you make a mistake, you can undo or redo the last several (10 by default) actions by choosing EditUndo or Redo (or the Undo/Redo button on the toolbar).

In addition, you can populate application components with objects by simply dragging them from one to another, described in Chapter 9, "Manipulating Widgets."

For information on the Panther keyboard interface (using Panther without a mouse), refer to Appendix A, "Keyboard Interface."


Setting Properties

The Properties window lists the property settings for selected objects; an object can be a screen, a widget, or several widgets. By default, an application component is selected when no widgets on the screen are selected. Do either of the following to deselect widgets:

You must select a widget or widgets to set properties at the widget-level. A selected widget is displayed with a changed border—on GUI platforms small, black boxes, or grab handles are displayed; in character mode, the widget is surrounded by square brackets ([ ]). A selected grid widget member is displayed in reverse video from unselected members.

Only certain properties can be set for a given widget type. As a result, the information that is displayed in the Properties window is dependent on what object or objects you have selected. If you use the screen wizard to create your client screens, reports, and service components, the wizard automatically sets certain properties for each.

Using the Properties Window

The Properties window is open by default. To toggle the display of the window, select or deselect Properties Window from the View menu, or, whenever the Properties window is not visible, simply press Enter.

How to Set Properties

  1. Display the Properties window by pressing Enter or by choosing ViewProperties Window.
  2. Select the application object:
  3. Display the properties in the Properties window. Expand a single heading by clicking on it, or expand the entire list by choosing the ++ button.
  4. Select the desired property from the Properties listing. Depending on the selected property, you can do one of the following:
  5. If you want to restore a setting, choose Cancel.
  6. To commit the property setting, do any of the following:
  7. If you mistakenly changed a property, you can choose EditUndo to restore the value. You can reverse the last several actions (up to the number specified).

Saving Your Work

Screens, reports and service components in a Panther application must be saved to their appropriate libraries. For example, store client screens in the client library and service components in the server library. However, during development you might also store some application components in a repository to provide consistency and control throughout the entire application.

Saving an Application Component

The appropriate libraries or repository must be open in order to save a client screen, service component, report or repository entry. If the development team is sharing libraries, it is the team leader's responsibility to create libraries for the team and to ensure that all the libraries open when you start up an editing session. However, if you are an independent developer working on a screen that you want to save in a local library, you must create the local library and open it via the file menu before saving the screen.

How to Save an Application Component

  1. Choose FileSave. If it is a member of a library or a repository, it is saved to its source. If the application component is untitled, the Save dialog box opens.
  2. If more than one library is open, select the one in which the object should be saved.

    If you do not have the appropriate library open, choose the Open button or the Remote button. From the Open Library dialog box (or the Open Remote Library dialog box in JetNet and Oracle Tuxedo executables), select the library that you want to open and choose OK.

  3. Specify a name in the Member field.

    Note: In three-tier applications, it is recommended that you adopt a naming convention that identifies client screens with their corresponding service components or vice versa. Table 5-1 lists suggested file extensions.

  4. Choose OK.

    The name, in the form appComponent@libraryName, displays in the title bar.

How to Check for Overlapping Widgets

HTML does not support overlapping widgets. As a result, Web browsers can render widgets in positions that differ from the appearance in the editor workspace. To ensure that widgets adhere to your original design and do not overlap:

  1. Set Check Overlap on Screen Save on the Options menu.

    When this option is active, any save operation (Save, Save As, Save All) forces the editor to check for overlapping widgets before actually saving the screen or screens affected by the save request.

  2. Screens with overlapping widgets are brought to the top of the stack, the overlapping widgets are selected, and the following message is displayed:
    Screen screenName contains overlapping widgets. Save anyway?

To check for overlapping widgets before saving a screen:

Naming Conventions

Although the editor does not enforce naming conventions, the following standards are recommended for naming screens, libraries, and repositories:

In addition, your operating system and those you support may impose their own restrictions for filenames.

"hd:Desktop Folder:myfile"

Panther does have default extensions for each file type which are used primarily as filter specifiers on Save and Save As dialog boxes as well as Open dialog boxes under some GUI platforms.

Table 5-1 contains general recommendations that you can apply which can help you distinguish one file type from another. You can also adopt your own naming conventions.

Table 5-1 Recommended filename extensions

File type Default filter extension Recommendation

Client screen

*.scr

Use a convention that identifies client screens with their corresponding service components.

Service component

*.scr

Use a convention that identifies service components with their corresponding client screens.

Library

*.lib

Use a convention that distinguishes libraries from repositories and other file types.

JPL

*.jpl

Libraries can contain any type of file, therefore, use a convention that distinguishes one file type from another.

Menu

*.mnu

Libraries can contain any type of file, therefore, use a convention that distinguishes one file type from another.

Styles

*.sty

Libraries can contain any type of file, therefore, use a convention that distinguishes one file type from another.

Repository

*.dic

Use a convention that distinguishes repositories from libraries.


Creating and Opening a Repository

A repository has one or more entries, which originally could have been screens, reports, or service components. You can have multiple repositories; however, since you can have only one repository open at a time, it is recommended that you create one repository per application. If application development is a team effort, then a member of the team is responsible for creating and maintaining a repository to provide consistency across the application. If you are an independent developer working on an application, then you need to create your own repository.

Copying objects from a repository to your application components allows for an inheritance relationship between the copied objects. The wizards also store and use information in the open repository to build new screens and reports.

Creating a Repository

You must first create a repository in order to import or store screens as repository entries.

How to Create a Repository

  1. Choose FileNewRepository. The New Repository dialog box opens.
  2. Specify the name of a repository in the Selection (or File Name) field.

    Note: Refer to Table 5-1 for recommendations on file names.

  3. Choose OK.

How to Create a New Remote Repository

(JetNet/Oracle Tuxedo only) You must be connected to the middleware, and you must have a file access server (devserv) running which provides access to create repositories on remote machines. For further information on the server types, refer to "Server Executables" in JetNet/Oracle Tuxedo Guide.

  1. Choose FileNewRemote Repository. The New Remote Repository dialog box opens.
  2. Specify the name of a server in the Server field.
  3. Specify the name of a repository in the Repository field (with a *.dic extension) and choose OK.

Creating a new repository automatically closes any repository that is currently open. You can now save a screen as a repository entry in this newly created repository by choosing Save AsRepository Entry.

Opening Repository Entries

While you are working in the editor, you can open a repository to gain access to its contents, so that you can copy repository objects to your application screens. Opening a repository automatically closes any repository that is already open.

Note: The repository named data.dic (or the repository identified in the setup variable SMDICNAME) is automatically opened on starting your editor session.

How to Open a Repository and Its Repository Entries

  1. If the desired repository is already open, skip to step 2. Otherwise do either of the following:
  2. Select the repository (the default filter extension is *.dic) that contains the entry you want. Only one repository can be open at a time.

    The default repository name is data.dic and it opens by default for an editing session.

  3. Choose FileOpenRepository Entry. The Open Repository Entry dialog box opens.
  4. Select the desired repository entry and choose OK.

    The repository entry opens. The name followed by the [Repository] indicator is displayed in the title bar. The format is repositoryEntry@[Repository]. Database tables that have been imported to a repository are named without a file extension, by default.

    If the entry is being edited by someone else, Panther posts a warning message. If you choose Yes to steal the reservation, the entry is opened in your name and has read and write privileges. Since two people now have the entry open with write privileges, one of you could lose your changes. If you choose No, the entry opens with read-only privileges. If the repository and the entry are under source code management, you are presented with different options (refer to "Maintaining Libraries Under Source Control" in Application Development Guide for more information).

    Note: If you choose to open a repository entry as a Template, a copy of the entry is created in the repository, but it does not by default inherit from the source repository entry.

To create a repository entry, refer to "How to Save a Repository Entry."

Viewing the Repository Table of Contents

There are two ways to access and open repository entries:

How to Open the Repository Table of Contents
  1. Choose ViewRepository TOC. A Repository window opens and lists all the entries that are stored in the open repository.

    Figure 5-5 The Repository TOC lists all the repository entries and indicates whether the entry is currently in use.

  2. (Optional) If you want to edit the repository entry, deselect the Read-only check box on the Repository TOC window.
  3. Select a repository entry and choose Open.

    The entry opens in the workspace. The name of the repository entry is displayed in the title bar in the format entry_name@[Repository].

  4. Continue to open repository entries, as needed, by repeating step 3.
  5. To close the Repository TOC window, choose Close from its system menu or choose ViewRepository TOC to toggle the display off.
How to Remove a Repository Entry

From the Repository TOC, select the repository entry and choose Delete. The following prompt is displayed:

Remove [repository_entry] from repository?


Saving Application Components to a Repository

A repository can store one or more entries. You can:

Regardless of how you create a repository entry, you use the entry and its objects to create your application components—dragging objects from the repository to the application component. This process creates an inheritance link between the parent, or original object, and its child, or copy. So, if you make changes to an object in the repository, those changes are propagated to all your application components derived from it.

Note: Widgets stored in repository entries must be named to enable inheritance to child widgets. Specify a name in the Name property under Identity in the Properties window.

How to Save a Repository Entry

  1. To open a repository if one is not already open, do one of the following:

    Note: A repository, data.dic or the one named in the SMDICNAME setup variable, is opened by default on starting your editor session.

  2. Choose FileNewRepository Entry. The New Repository Entry dialog box opens.
  3. Enter a name for the repository entry.

    Note: Use a naming convention that distinguishes entries you create from those created as a result of importing database tables (which by default have no extension).

    A new entry opens with the given name in its title bar, in the format entry_name@[Repository].

  4. Add widgets to the entry, assign property settings, etc.
  5. Assign a name to each widget in a repository entry—under Identity, in the Name property in the Properties window.
  6. Choose FileSave to save the entry in the open repository.

Populating a Repository with Database Objects

You need to create or open either a repository or a remote repository before importing database objects to it. However, you must have a direct connection to the database to successfully import database objects to a repository. You can browse the contents of your database with Panther's database browser and then import tables and their column definitions to Panther. Through this process, screens are automatically created and stored in the open repository.

By default, when Panther displays the Import Database Objects window, only the database tables are displayed. However, the Options buttons displays a dialog box where you can select to display database views or synonyms.

You can import up to 1000 tables. The maximum number of columns per table is 255.

How to Import Database Tables from Your Database

  1. If the desired repository is not open, create or open it now:
  2. Choose FileOpenDatabase. The Choose Engine dialog box opens.
  3. Select an engine from the Engine option menu of initialized database engines on your system.
  4. Accept or enter a connection name and choose OK. A database Open dialog box appears.
  5. Specify the name of the database in the Selection (or File Name) field, enter any other options needed by your database engines, and choose OK.
  6. Choose ToolsImport Database Objects (or the Import Objects button on the toolbar). The Import Database Objects dialog box opens.

    All tables in the current database are listed, up to a maximum of 1000. (If there are more than 1000 tables in the database, use the Filter field to control the display of table names.)

  7. (Optional) If your database supports views or synonyms, the Options button will be active. You can select it to:
  8. Select the desired database table or tables. As you select individual tables, the column names, column data types, and lengths defined in each are displayed under Column Descriptions.

    To select a table, click on the item in the Tables list. To select more than one table, do one of the following:

  9. Choose Import. The status line informs you of each table being processed.

    A repository screen is created for each table and is designated to inherit from the database as do all the widgets that make up the screen (the Inherit From property for the repository screen is set to @DATABASE).

    If a repository screen already exists for a database table, the screen is updated (refer to "Re-importing Database Tables" for details on re-importing).

  10. Choose Close to return to the editor.

    To display the contents of the repository, choose ViewRepository TOC.

What You Get When You Import Tables

The import process:

Updating Database Views

Panther sets the Updatable property to Yes for all database objects—tables, views, and synonyms. However, be aware that a database view or synonym might not contain the primary key columns that are needed for database updates. If the primary key columns are not members of one of Panther's table views, the transaction manager gives an error.

Re-importing Database Tables

Re-import database tables:

How to Re-import Database Tables

Follow the same directions as described for importing tables the first time. If you have more than one database opened, Panther prompts you to choose which database to import from.

When you re-import, the process proceeds as follows:

  1. A repository screen is created if one does not exist for a database table.
  2. If a repository screen exists for a database table, but it does not have an Inherit From property setting of @DATABASE, Panther prompts you to choose whether to overwrite the repository entry or leave it unchanged.
  3. Existing repository screens are updated if their Inherit From property is set to @DATABASE.
  4. Database columns are compared to the widgets in the repository screen by checking the following property settings for each widget:
  5. The inherited properties are updated for the existing widgets.
  6. Primary and Foreign keys are verified. Any changes in the primary key columns for the database are reflected in the Primary Keys property for the table view. Any new foreign keys result in a new link widget on the repository screen.
  7. A new widget is added for every table column that has no corresponding widget in the repository screen.

Controlling Inheritance

When you copy a repository object to an application screen, all property values are automatically copied and most possess an inheritance relationship between the parent and child objects. You can control which properties will continue to maintain an inheritance relationship. You can:

How to Turn On Inheritance for a Property

To selectively turn inheritance on or restore it for a specific property:

  1. Select the widget or the application screen.
  2. Select the property (unhighlighted) in the Properties window.
  3. Choose the Inh (Inherit) push button on the Properties window.

    The value for the selected property is now highlighted and set—provided that OptionsInherit is on—to match the property for the parent object specified in the Inherit From property for the selected object.

How to Turn Off Inheritance for a Property

To change a property for a widget that inherits its property value:

  1. Select the child widget in your screen.
  2. Select the property that requires a custom setting.
  3. Enter the new value. The following message is displayed:
    The value is inherited! Remove inheritance?

    Note: You can turn these inheritance reminders off by choosing OptionsFileSet Inherit Warnings.

  4. Choose Yes to remove inheritance for the selected property. The new value is confirmed. If you choose No to retain inheritance, the original setting is restored.

Preventing Propagation of Changes

To control the propagation of changes from parent objects to their children, use any of the following methods:

How to Restore Inheritance of All Property Values

  1. Select the widget or your application screen (to inherit screen properties).
  2. Under Identity, enter the source of inheritance in the Inherit From property.
  3. Choose OK. The following message is displayed:
    Do you want to set all the properties inherited?
  4. Indicate whether all properties should be inherited:

Finding the Source of Inheritance

You can find a parent widget or screen (the one that inherits from) as well as find child widgets or screens (the ones that inherit). To find the parent, or source, of inheritance:

How to Find Parent Widgets or Screens

  1. Select the widget in your application screen or the screen itself.
  2. Choose EditFindParent.

    Note: If you have selected an object that does not have an Inherit From property value, the Parent menu option is disabled.

    The parent repository screen, or the one containing the parent widget, is opened (if it currently is not). The parent widget, the source of inheritance, is selected.

How to Find Child Widgets or Screens

To find the children of a parent object:

  1. Select the widget in a repository screen or the repository screen.
  2. Choose EditFindChildren. The Find Children dialog box opens.

    Note: If you have selected an object that is not in a repository, the Children menu option is disabled.

  3. Select one or more of the search criteria:
  4. Specify which file extensions should be included in the search filter.
  5. Choose OK.

    If matches are found, the Child List window opens.

  6. Select the screen you wish to view/edit and choose Open. You can continue to select and open screens from the Child List window.
  7. To close the Child List window, choose Close from its system menu.