Vous êtes sur la page 1sur 235

Frontend Designer

Training Guide
Product
Information
Version 6.0
2003 Meta4 Spain, S.A. All rights reserved.
WARNING: This manual is protected by copyright law and international treaties. Permitted use of this
document is limited to its use in connection with the product and any unauthorized use will be pursued to
the full extent of the law. Do not copy, modify, reproduce or distribute without the owner's permission.
Meta4 PeopleNet 1999. Meta4 Spain, S.A. All rights reserved.
Meta4KnowNet 1996. Meta4 Spain, S.A. All rights reserved.
Meta

, Meta4Mind

, Meta4 PeopleNet

, Meta4 KnowNet

and Meta4 e-mind

are registered
trademarks belonging to Meta4 Spain, S.A.
Other company names, products, or services are registered trademarks or trademarks of their respective
owners.
Meta4Spain, S.A.
Centro Europa Empresarial
Edificio Roma
C/ Rozabella, 8
Ctra. de La Corua, km. 24,200
28230 Las Rozas, Madrid
SPAIN
http://www.meta4.com
Publishing Date: 2nd January, 2003.
Last Modified Date: 2nd January, 2003.
i
Table of Contents
INTRODUCTION 1
n Course objectives 1
n Prerequisites 2
n How to use the training guide 3
Using the guide during the course 3
Using the guide after the course 4
n Designing presentations in the development cycle 5
n About this course 7
OVERVIEW 9
n Overview objectives 9
n Main Concepts 10
1 INTRODUCING THE FRONTEND DESIGNER: BASIC CONCEPTS 13
n Introduction 13
How to access the functionality for this lesson 14
n Conceptual definitions 16
ii
Contents
Frontend Designer window structure 16
New Presentation 17
Previewing a presentation 18
Central pane: Visual Designer 18
Inserting a new form in a presentation 18
Shifting from Form1 to Form2 19
Changing the grid size 20
Central pane: OBL editor 20
Editing the OBL code of a presentation 20
Closing the OBL editor 21
Control palette 23
Adding controls from the control palette to a form 23
Saving a presentation 25
Adding controls to a form from the "Insert Component" option 25
First approximation to basic properties of visual components 27
Setting properties in design time using the Properties dialog box 27
Control Label 30
Control Image 31
Control Link 32
Control Urlbox 32
Control Combobox 32
Control Checkbox 33
Control Groupbox 33
Control Checkboxgroup 34
Control Textbox 34
Control Button 34
Control Slider 35
Setting properties in design time using the OBL editor 35
The syntax checker 36
Saving code from the FrontEnd Designer and inserting code into the OBL editor 38
Saving OBL code from the FrontEnd Designer 38
Inserting code into the OBL editor 39
Presentation Explorer 40
Adding visual and non visual components with the explorer. Events and Actions. 40
Components as containers 42
Nodes and their hierarchical interpretation 43
Introducing OBL 44
What is behind a running presentation? 45
iii
Contents
The Properties dialog box and the programming scenario 47
Overview 47
Case 1 47
Examples for case 1 49
Case 2 52
Examples for case 2 52
Example 53
General hints 54
Some exceptions 55
Control Split 57
Toolbars 57
Menus 58
n Review questions 60
n Lesson summary 61
Lesson Key Points... 61
You should be able to .... 61
2 BUILDING LOGIC INTO PRESENTATIONS: MORE OBL 63
n Introduction 63
How to access the functionality for this lesson 64
n Conceptual definitions 66
Hierarchy means logic 66
Referring to properties of other objects 66
Absolute referencing 66
Relative referencing 67
Absolute reference facility 68
Changing properties in runtime 72
Action_set 72
Action_call - Methods 73
Namespace 74
Connecting presentations 74
Connecting through an Extends component 74
Connecting through an Action_task 74
Presentation context and context variables 75
Transferring variables - Context vs. Runtime variables 77
iv
Contents
n Review questions 79
n Lesson summary 80
Lesson key points... 80
You should be able to... 80
3 ADVANCED CONTROLS AND FUNCTIONALITY 81
n Introduction 81
How to access the functionality for this lesson 82
n Conceptual definitions 84
Tabstrip, Panel and Scrollpanel 84
Changers and trees. Virtual forms. 85
Changers 85
Exercise 86
Trees 87
Exercise 87
Virtual Areas 87
Multi language text 89
Some important properties 90
Implicit Flow control; Explicit Flow control (Action_goto) 91
Action_dialog 94
Exeblocks 94
n Review questions 96
n Lesson summary 97
Lesson key points... 97
You should be able to... 97
4 CONNECTING TO META4OBJECTS 99
n Introduction 99
How to access the functionality for this lesson 100
n Conceptual definitions 102
v
Linking components to Meta4Objects 102
Data properties 102
Loading options 103
Controls closely related to Meta4Objects 105
Text property. Multi language options. Hard coded text vs. data bound text. 109
Toolbar navigation buttons. First approach. 110
Multinode Meta4Objects. 111
Introducing the Record Insert Wizard 112
Action_value 116
Action_list 117
Patternbox 118
Nodestatus 118
Table 119
Further steps on data related Actions and Toolbarbuttons 121
Toolbar groups 122
Advanced data related Actions - Use of Action_call - Action_dataprops 123
Action_method 125
Action_bp 127
Using Split controls 128
Mimic control 128
5.2.17 Back to changers 130
Action_script, Checkbox and Checkboxgroup 131
Action_script 131
Checkbox control 132
Listgroup 134
Structure of the Listgroup control - The Function control 137
General properties of Listgroup 139
Function properties 140
Passing data Part I - Mainargs and Mainobjs 140
Passing data Part II - Targetitems and Targetobjs 142
Function Zoom 144
Function Clear 144
Function List 145
Label 146
Textbox (non virtual fields) 147
Textbox (virtual fields) 147
List button 148
Advanced properties of the ZLG 148
The Record Insert Wizard and the ZLG 151
Working with tracks 154
Toolbar Navigation Groups 158
Specific patterns 159
Steps in the preload 161
vi
Conditional object construction 163
Multicompany features in presentations 165
Default and customized presentations 165
Customized presentations - params group type element for toolbar 167
Customized presentations - button type element for toolbar 168
n Review questions 169
n Lesson summary 170
Lesson key points... 170
You should be able to... 170
5 EXPLORING WHAT THE FRONTEND DESIGNER WIZARD DOES 171
n Introduction 171
How to access the functionality for this lesson 172
n Conceptual definitions 174
Main structure 174
SplNodeFields_Up 174
SplNode_Up 177
SplNodeFields_Down 178
Logic in Default Presentations 179
The Tree as a main controller 179
Tabs 180
Footer section (SplNodeFields_Down) 180
Multicompany in default presentations 181
n Lesson summary 182
Lesson key points... 182
You should be able to... 182
A APPENDIX: BRIEF SUMMARY OF SOME CONTROLS 183
n About this appendix 183
n Controls for containers 184
vii
B APPENDIX: MOUSE EVENTS 189
n About this appendix 189
n Mouse events 190
C APPENDIX: EVVALIDATE: TRIGGERING MECHANISMS 191
n About this appendix 191
n Evvalidate 192
Triggered when losing focus 192
Triggered when clicking 192
D APPENDIX: DATA-RELATED EVENTS 193
n About this appendix 193
n Data-related events 194
E APPENDIX V: OTHER EVENTS 195
n About this appendix 195
n Other events 196
F APPENDIX VI: SOME PROPERTIES 197
n About this appendix 197
viii
n Properties 198
Properties set #1 198
Properties set #2 199
Properties set #3 199
Properties set #4 200
Properties set #5 201
Action 201
Mousecursor 202
Image 202
G APPENDIX VII: EVENTS CONTAINED IN COMPONENTS 205
n About this appendix 205
n Events 206
H APPENDIX VIII: METHODS 211
n About this appendix 211
n Methods 212
I APPENDIX IX: SOME MORE COMPONENTS 217
n About this appendix 217
n Some more components 218
Action_copy 218
Action_dataprops 218
Action_datatrack 220
Action_execute 220
Action_method 221
1
Frontend Designer
Introduction
The Frontend Designer course will develop your skills and background knowledge required
to effectively develop presentations for the windows client in Meta4 applications such as
Meta4 PeopleNet and Meta4 KnowNet.
The purpose of this course is to introduce you to the benefits, features, and functionality of
the presentations used in the windos interface within applications that use the underlying
Meta4 technology and tools.. You will have opportunities to practice with the software and
identify key benefits and efficiencies gained by using the Frontend Designer.
Upon completion of this course, you will be able to do the following:
n Master the Frontend Designer.
n Create well-designed presentations customized to your companys needs.
n Create effective interfaces for your Meta4Objects
n Describe what the Frontend Designer Wizard does when creating default presentations
for Meta4Objects.
Course objectives
2
To successfully meet the course objectives, you should meet the
prerequisites listed below.
Prerequisites
Other external knowledge
Windows environment
Relational Data modeling
Familiarity with programming
algorithms and programming
languages
Meta4 knowledge Find more information in...
Core Tools Training Guide - Data Modelling
Training Guide - Developing Basic
Functionality
Training Guide - Developing Advanced
Functionality with Meta4Objects
Introduction 3
This training guide is designed to support you in learning about the
Frontend Designer. Each Meta4 course consists of several lessons. Each
lesson is designed to streamline and accelerate the learning process. Our
lessons contain the following standard sections:
n Introductions
Describe what you will learn in the lesson and how it will benefit your
organization.
n Conceptual definitions
Explain Meta4 terms and functionality often using figures and
examples.
n Guided activities
Provide an opportunity for you to practice using the Frontend Designer.
We support you through the use of business scenarios and detailed step-
by-step solutions.
n Additional features
Describe complementary Meta4Mind Set utilities available to aid you
in developing functionality.
n Unguided activities
Provide an opportunity for additional practice using Meta4Mind Set.
These activities are more complex and challenge you to use what you
have learned throughout the lesson.
n Review questions
Check your mastery of the lesson objectives.
n Lesson summaries
Review the knowledge and skills you learned in the lesson.
Using the guide during the course
Throughout this course, use this guide to follow along with your instructor.
It includes pictures or diagrams your instructor may refer to in the class
presentation. Take additional notes throughout this book. During a guided
activity, you can refer to the instructions to the activity. At the end of a
lesson, check to see whether you are ready to complete the next lesson by
answering the review questions and reviewing the summary.
How to use the training guide
4
Using the guide after the course
After attending this course, you can refer to the definitions, examples, and
step-by-step instructions to help you while working with Meta4
applications using the Frontend Designer.
Introduction 5

Whenever you use Meta4 development tools to create functionality, you are
in fact developing business functionality that has already been previously
identified and defined in the Customer Requirements Analysis phase of the
Meta4 Project Implementation Methodology. Once the Customer
Requirements have been identified and the product installed, then in the
Customization phase of a project implementation, you can start building the
required functionality, using the Meta4 development tools. There is a
loosely defined procedure for customization using the tools, this is known
as the development cycle.
The very first step in this development cycle is to build the data model for
describing the specific customer data and its relationships to support
Meta4Objects, the cornerstone of the application business functionality.
Designing presentations in the development cycle
Figure 1. Positioning presentation designing within the development cycle
of the customization phase
CORE TOOLS
VERTICAL TOOLS
Customer
Requirements
Time Relational Data Model
Meta4Objects
ANALYSIS
DESIGN
Events
VT VT
VT
VT VT
VT
CUSTOMIZATION
PHASE
REQUIREMENTS
ANALYSIS PHASE
Frontend Designer
6
Once the data model and Meta4Objects that implement the desired
functionality are created, the next step is to present the information to the
user. This is where presentations come into play. These form the interface
to the application and its functionality particularly in the windows client.
A poorly designed presentation can spoil the entire underlying process, no
matter how good it is. Creating effective, well-designed presentations
dramatically enhance the usability of your application and improve the
efficiency of the department that has to work with the application.
Introduction 7

The course content is organized sequentially according to the way a you
build a presentation in a Meta4 application using the Frontend Designer.
You will be guided through the concepts and steps involved by following a
business case or several activities if appropriate.
About this course
Overview A high level structure of this
module and the key elements
forming the different processes the
module offers.
Lesson 1: Introducing the
Frontend Designer
Wizard
This lesson is an introduction to the
Frontend Designer tool. You will
learn the tool interface and start
creating your first presentation
using some basic controls
Lesson 2: Providing logic to
presentations: mode
OBL
In this lesson you will study the
event-action process underneath
presentations. You will start
providing more powerful logic to
your presentations.
Lesson 3: Advanced controls
and functionality
In this lessons you will study more
advanced controls.
Lesson 4: Connecting to
Meta4Objects
This is a key lesson. Here you will
learn how to link your presentations
to Meta4Objects.
Lesson 5: Exploring what the
Frontend Designer
Wizard does
Lesson 5 explores the structure of
default presentations created with
the Frontend Designer Wizard.
8
9
Frontend Designer
Overview
As you know from previous courses the logical architecture of the application
is divided in three levels: Database level, Application level, Presentation
level. The Presentation level is the user interface to the application. When
new functionality is created using the Data Model Designer and or The
Meta4Object Designer, an interface has to be created for that new
functionality. The Frontend Designer is the tool of Meta4Mind Works
devoted to the development of such interface.
In this section you learn the principal processes, concepts, and features of
Meta4Mind Set Frontend Designer.
Overview objectives
Objectives
Upon completion of this lesson, you will be able to:
n Understand where presentations come into play in the process of
developing new functionality with meta4Mind Set.
n Understand what the Frontend Designer is for, and how can be used
to effectively design presentations.
n Have a birds eye view of what the learning process in the course
will be.
10
In the process of building up a new functionality inside Meta4Mind Set
there comes a point at which the developer wants to use the Meta4Objects
already designed. This use of a Meta4Object is always provided trough a
presentation. In terms of the Logical Architecture we are entering the
Presentation level. This level comprises all software components used to
present information to the end user. Thus we shall define the user final
interface when we building a presentation.
The execution of a Meta4Object involves the load of the related data, but
those data can be shown only if a presentation is used. What this means is
the need of a presentation any time we want to see a Meta4Object.
A Presentation is the main interaction unit between the end user and
Meta4Mind. Any time a Meta4Object is invoked presentations are needed
and this also comprises internet/intranet and work flows.
Meta4Mind helps the developer build up default presentations by means of
a wizard. These default presentations enable the developer to choose the
Main Concepts
Figure 2. Steps of the basic "new functionality" process
Data Model Designer
Data model
Meta4Object Designer
Meta4Objects
Frontend Designer
Presentation
Task Designer
Task definition
Menu Designer
Menu option
Overview 11
final aspect of the Meta4Object depending on the desired functionality. You
can present a Meta4Object as a usual form, or as a list, or as a filter plus list
screen The wizard is what you have been using in Meta4Object basic
and advanced courses.
Most of the time changes and modifications to these default presentations
are required. To make this modifications you shall use the Frontend
Designer Tool. This tool enables editing and modifying presentations, and
also building up presentations disregarding the wizard. As a matter of fact,
the Designer Tool can be understood as an independent programming tool
and we will dedicate some time to learn how to use it.
This two approaches are reflected in the Frontend Designer Tool, for
when you enter the Frontend Designer, you are entering a set of different
tools:
n The Designer Tool, meant to build up programs in a highly portable
language. This also enables the modification of already made
presentations.
n The wizard, for constructing default presentations of different kinds.
The present course will first lead you trough the Designer Tool as an object
oriented programming tool, unrelated to Meta4Object. When the basic
aspects of the Designer Tool have been learned, you will learn how to
connect with Meta4Objects, gaining practice and familiarity through
examples. You will then understand what a default presentation is, and how
to modify it, no matter its final use (i.e., whether it will be used in intranet,
in a windows client, as part of a workflow...).
Figure 3. Roadmap of the course
Lesson 1.
Introducing the Frontend
Designer:Basic concepts
Lesson 4.
Connecting to
Meta4Objects
Lesson 5.
Exploring what the FED
Wizard does
Lesson 3.
Advanced functionality
Lesson 2.
Providing logic to
presentations: more OBL
12
13
Introducing the Frontend
Designer: Basic concepts
.
The Frontend Designer is the Tool of Meta4Mind Works that allows you to
create interfaces for your Meta4Objects, in other words: Presentations.
In this lesson you will be introduced to the Frontend Designer. You will
first learn what each of the sections of the FED (Frontend Designer) is for.
Once you have gained experience with the FED interface, you will start
learning about the basic structure of a presentation, and some of the basic
controls that will allow you to implement some elementary functionality.
.
Introduction
Lesson Objectives
Upon completion of this lesson, you will be able to:
n Identify the main components of the Frontend Designer Tool.
n Understand the structure of a very basic presentation.
n Create simple presentations.
n Identify some of the basic controls and their functionality.
Lesson 1.
Introducing the Frontend
Designer:Basic concepts
Lesson 4.
Connecting to
Meta4Objects
Lesson 5.
Exploring what the FED
Wizard does
Lesson 3.
Advanced functionality
Lesson 2.
Building logic into
presentations: more
OBL
14
How to access the functionality for this lesson
Select the following path:
If you select this path the following window opens:
Click the Frontend Designer option on the right panel, or double click the
same option on the tree and the Frontend Designer window will open.
Meta4Mind Menu Tree
Mind|Developement Tools|Presentations
Figure 4. Accessing the Frontend Designer
Introducing the Frontend Designer: Basic concepts 15
In order to fully open the structure of the Designer Tool you need to bring
the so called Presentation Browser (or Explorer) to the screen. The
Explorer is hidden by default. To open it select the option
View|Presentation Browser on the window toolbar.
Figure 5. The Frontend Designer window
Figure 6. The Frontend Designer with the Presentation Browser
16
Frontend Designer window structure
In the Frontend Designer window we differentiate the following main
sections:
n Window toolbar
n Title bar
n Left pane: Presentation browser
n Middle pane: Visual designer and OBL editor
n Right pane: Control Palette
Throughout the course we will be referring to this sections, so it is
important that you get familiar with them.
Conceptual definitions
Figure 7. Frontend Designer window sections
Introducing the Frontend Designer: Basic concepts 17
New Presentation
When you open the Frontend Designer a new presentation is displayed by
default.
Notice the that the title bar indicates that it is indeed a new presentation by
displaying the message New Presentation. Take a close look at the
contents of the Presentation Browser, youll see a two node tree. The
displayed presentation is at this moment a program. A presentation is a
program with a very special piece of code. If we looked at the code of this
program it would look something like this:
BEGIN The Program
Some code
END
The code in between the BEGIN and END instructions would contain the
definition of the components inside the presentation. In our case, this would
be Form1. You can visually see the form in the Presentation Browser or in
the Visual Designer (Middle Pane).
A form is a very special component. The windows the user sees when
interacting with the application are designed over forms. We will study
Figure 8. New Presentation
18
forms in more detail later in the chapter.
In case a presentation contains a form, its execution will promote the
construction of the form in run time. Lets study how to execute a
presentation and how the run time form is constructed.
Previewing a presentation
To preview your presentation select the Tools|Preview Presentation menu
option or click the Preview Presentation button on the window toolbar.
Closing the form brings you back to the Designer tool. Be aware of the
difference between the form in design time and run time. The form in run
time is displayed without grid lines. These grid lines are intended to help
you in further steps of the design process as it will be explained later on.
You can insert more than one form in a presentation. You will learn this in
the next section
Central pane: Visual Designer
From a design point of view a presentation can be understood as a working
area where different graphical and functional elements are arranged in
order to help (implement) a given functionality
1
. Those elements are
referred to as controls.
The form included in the new presentation is a control contained by the
presentation. Once inserted, the form will act as a visual interface between
the user and the application.
Inserting a new form in a presentation
Lets now insert another form in the presentation. To do so follow the
instructions.
1. Generally speaking any given functionality. In particular, if you are working inside
Meta4Mind Set your functionality has most probably been designed with the DMD and
the Meta4Object Designer. The presentation design can help the end user to fulfill that
functionality
Introducing the Frontend Designer: Basic concepts 19
The form displayed in the visual design pane shows handles around the
form. Those handles enable changes in the forms size.
Shifting from Form1 to Form2
Only one form is visible at a time in the visual designer. To shift back to
Form1 you can:
Notice that if you click the Presentation node in the Presentation
Browser, there is no object displayed in the visual design pane.
a. Right click the Presentation node in
the Presentation Browser and select
the option New Form
b. The "Form2" will appear in the
Presentation Browser and you will see
the new form in the visual designer
pane.
a. Click the Form1 node in the
Presentation Browser or
b. Use the combo box on the window
toolbar and select Form1
20
Changing the grid size
The grid is a design tool that will not appear in run time. Grids will help
you design the visual appearance of your forms. To change the grid size of
a particular form do the following:
Central pane: OBL editor
The middle pane also acts as an editor. We have already mentioned that the
presentation is acting as a program. That program can be represented by the
OBL language. The OBL code of the presentation is editable in the middle
pane.
Editing the OBL code of a presentation
To edit the OBL code of a presentation do the following:
a. Right click the desired form either in
the Presentation Browser or the
Visual Designer. A pop up menu will
appear
b. Select the option Change Grid Size. A
new dialog box will appear.
c. Determine the desired grid size and
click OK.
Introducing the Frontend Designer: Basic concepts 21
The whole presentation can be understood as a sequential execution process
and this interpretation is most evident when the OBL code is studied in
detail. We will go back to this fundamental topic later in this course.
Our presentation contains two controls: Form1 and Form2. You can see that
each control (form) is defined in the OBL code by a "BEGIN Form -
END" structure. The OBL in between those two sentences is the OBL code
corresponding to each control.
Closing the OBL editor
You will now close the OBL editor for the presentation. You have two
possibilities:
a. Right click the Presentation node in
the Presentation Browser. A pop up
menu will appear.
b. Select the OBL Editor option. The
code for the presentation will appear in
the middle pane
22
Lets now open the OBL editor for each of the controls in the presentation.
The OBL editor lets you open the code for a number of components at the
same time. It will not let you edit duplicate code. If you try to open the
OBL code for the presentation at the same time as the OBL code for any of
the controls in the presentation (say Form1 or Form2), a message appears
prompting you to close some OBL editors:
a. Click the Close button in the window
toolbar or
b. Select the View|View Editors menu
option, select the editor you want to
close and click the Close Editor(s)
button
a. Right click the Form1 node in the
Presentation Browser, and select the
OBL Editor option from the pop up
menu. The middle pane will show the
OBL code for the Form1 control only.
b. Repeat the same process right clicking
this time the Form2 node. The middle
pane will show a tabstrip with two tabs:
one tab for the Form1 control, and
another tab for the Form2 control. Each
tab contains the OBL code for the
corresponding control
Introducing the Frontend Designer: Basic concepts 23
The reason why this message doesnt appear when we try to open the OBL
editor for Form2, while the OBL editor for Form1 is open is that Form1 and
Form2 are disjoint. None is partly or fully contained in the other. In order to
open the OBL editor for the presentation you will have to close the OBL
editors for Form1 and Form2.
In later sections of the course you will learn that controls can be added to a
form or a presentation either visually (using the Visual Designer), or
adding their corresponding "BEGIN control_name END" structure
directly in the OBL code of the presentation.
Control palette
We have already spoken about controls and components. The Designer tool
has a great number of components, some of them visible. These are referred
to as controls. The Control Palette in the right pane includes the most
common visual components (controls).
The controls listed in the palette and a brief description of their meaning are
included at the end of the manual.
Up to now the only control we have dealt with is the Form control. Forms
are very special visual components that act as direct containers for other
visual components.
All the controls listed in the palette can be added visually to a form by
clicking and dragging.
Adding controls from the control palette to a form
Follow the steps to add a button control, a label control and a textbox
control to Form1 and a label control and a texbox control to Form2
Figure 9. Closing OBL Editors
24
a. Click the button control on the control
palette, then click the form and drag the
mouse to determine the dimensions of
the control.
b. Use the Label button and the Text Box
button in the control palette to place the
controls on the form
c. Select Form2
d. Insert a label and a text box repeating
the process explained above
Introducing the Frontend Designer: Basic concepts 25
Saving a presentation
In order to save a presentation, click the Save button on the window
toolbar. The Save dialog box will appear. We recommend that you use the
CXX_NAME_OF_YOUR_PRESENTATION syntax, where XX are
replaced with your initials. So if your name is Mike Smith and you want to
name your presentation Example_1, then the name would be as follows:
CMS_EXAMPLE_1. We also recommend that you save your presentations
with the Owner ID 101.
Adding controls to a form from the "Insert Component" option
Another way of inserting a control to a form is by means of the Insert
Component menu option. This is a pop-up menu option that appears when
e. Notice how the explorer reflects your
actions by inserting an icon for each of
the controls you insert in the
presentation.
Figure 10. Saving a presentation
26
right clicking the icon of the form in the presentation browser.
Follow the steps to insert a button in a form.
a. Right click the Form1 icon in the
presentation browser.
b. Select the Insert Component option.
The Component List window will
appear.
c. Select the Button icon and click OK. A
new button will appear on the left-upper
corner of the form.
Introducing the Frontend Designer: Basic concepts 27
First approximation to basic properties of visual components
Components have a number of properties. By giving certain values to these
properties you define the final behavior of the component. Simple and
intuitive properties are the Size, Backcolor or Font, among others.
You can access the properties of a certain component in design time in two
different ways: through the Properties dialog box or through the OBL
Editor.
Setting properties in design time using the Properties
dialog box
Any component in a presentation has several properties which are set to a
certain default value as soon as the component is included in the
presentation.
Any time we insert a new component in the presentation by selecting it
from the Insert Component menu option, the Alias property is
automatically set by the designer tool. This alias is the logical name you
shall use inside the program to invoke the component.
Lets start off with a brand new presentation. Create a new presentation by
clicking the New button on the window toolbar.
d. Drag the button to the desired position
in the form. Use the handles to resize
the control
28
Notice that after inserting the new form in the presentation, the component
is added to the tree in the left pane (presentation browser) with the name
Form2. This name is a property whose value has been set to Form2 by
default. You have not chosen it.
The set of properties of a given component can be seen in design time by
right clicking the component (either on the visual designer pane or in the
node representing the control in the browser) and selecting the Properties
option from the pop-up menu.
The following figure displays the Properties window for the Form control.
a. Click the New button on the window
toolbar to create a new presentation
b. Select the Blank Form option from the
New Presentation dialog box.
c. Insert a new form in the presentation.
Right click the Presentation icon in the
presentation browser and select the
New Form option from the pop-up
menu.
Introducing the Frontend Designer: Basic concepts 29
You can change (or set) a property value just by overwriting the existing
one on the corresponding row of the Property dialog box.
For example lets change the background color of the form.
Figure 11. Properties dialog box for the Form control
30
following are a number of exercises that will help you gain experience in
the management of control properties.
Control Label
a. Save this presentation as CXX_EXERCISE_2_1.
b. Insert a label in the form.
c. Open the Properties dialog box for the label and change the following
properties:
a. In the Properties dialog box for the
form, click the three-dotted button
located in the Backcolor row. A new
dialog box will appear.
b. Select the new color for the background
c. Click the OK button on the Properties
dialog box.
Introducing the Frontend Designer: Basic concepts 31
d. Click the OK button in the Properties dialog box.
e. Save your presentation.
f. Preview your presentation.
Notice that some properties are only seen in run time. That is the case for
the Mouse and Tooltip properties, which can be noticed when moving the
mouse over the label.
g. Finally, change the value of the properties Enabled and Visible from 1
to 0, and test the effects.
h. Save your presentation.
Control Image
a. Insert an Image control in the form.
b. Set the Image property to the value #Four. This value (#Four) refers to
a so called "fixed" image. You can find the rest of fixed images in
Appendix VI.
c. Insert a second image control. Set its Image property to
b_mapusa.bmp. See that the image is not seen in design time. This is a
non fixed image, i.e. a file stored in the disk. Save the presentation and
preview it. Notice how fixed images include the # character in their
name whereas non fixed images do not.
d. Open the Properties dialog box for Image2 and change the property
Stretch to True. Save and preview the presentation.
Property New Value
Text My Label
Font Tahona, 10pt, Underline
Borderstyle 1
Alignment 2
Forecolor any color (except for black)
Mousecursor Hand
Tooltip This is a label
32
Control Link
a. Insert a Link control in the form.
b. Change the following properties of the control:
c. Save and preview your presentation. Test the link.
Control Urlbox
a. Insert a Urlbox in the form.
b. Change the following properties of the control:
Notice that this control shows the page in design time.
c. Save and preview your presentation.
Control Combobox
a. Insert a Combobox control in the form.
b. A combobox usually displays a list with several options from which to
select. To get this functionality in run time, use the Values property of
the combobox.
Notice that there are no spaces between the values separated by commas.
One thing is the list of values that the end user sees in run time in the
Property New Value
Text Linking to Meta4
Tooltip Click to open
Url http://www.meta4.com
Property New value
Align Bottom
Url http://www.meta4.es
Property New Value
Values Monday,Tuesday,Wednesday,Th
ursday,Friday
Introducing the Frontend Designer: Basic concepts 33
combobox, and another is the actual values that the combobox uses
internally when selecting a specific option. For example, suppose that you
want to map Monday with the value 1, Tuesday with the value 2 and so on,
so that whenever you select the option Monday, the combobox stores the
value 1 instead of the string "Monday" (why you may want to do this will
become more clear in further examples). You can do this using the
Listitems property of the combobox.
c. Modify the following properties of the control:
Control Checkbox
a. Insert a Checkbox control in the form.
b. Change the following properties of the control:
Value = 1 means that the checkbox will be checked when running the
presentation.
c. Reset the Value property to 0 and see the effects is run time.
Control Groupbox
a. Insert a Groupbox in the form.
b. Insert a label and two checkboxes in the groupbox.
c. Try to move (in design time) the groupbox around the form. Notice
how the controls inside the groupbox move with it.
d. Preview the presentation.
e. Change the following properties of the groupbox:
Property New Value
Values 1,2,3,4,5
Listitems Monday,Tuesday,Wednesday,Th
ursday,Friday
Property New Value
Text Check this option?
Value 1
34
Notice that disabling the groupbox means disabling all the controls
contained in it.
Control Checkboxgroup
a. Insert a Checkboxgroup in the form.
b. Insert two checkboxes in the checkboxgroup.
c. Preview the presentation.
Notice that the checkboxes are acting as option buttons (radio buttons) in
run time. A set of checkboxes (as the ones seen in the previous section) can
be checked all at the same time. A set of option buttons allows the selection
of only one option per set (those inside the same checkboxgroup).
Control Textbox
a. Insert a Textbox in the form.
b. Change the following properties of the control.
Control Button
a. Insert a Button in the form.
b. Change the following properties for the control:
Property New Value
Text This is a group
Enabled False
Property New Value
Text My text
Font Arial, 12pt, Underline
Tabindex 1
Tooltip First in getting the focus
Introducing the Frontend Designer: Basic concepts 35
Control Slider
a. Insert a Slider in the form.
b. Change the following properties for the control:
Setting properties in design time using the OBL editor
Properties can also be set and changed in the OBL editor. You should be
aware that a number of properties do not appear in the Properties dialog
box, and they can only be changed using the OBL editor.
Property New Value
Text Click
Font Bold
Tabindex 2
Tooltip Second in getting the focus
Image #Currency
Property New Value
Forecolor any color (except for blue)
Maxvalue 30
Tabindex 3
Tooltip Third in getting the focus
Value 10
Tickfrequency 2
Orientation 1
36
Close now the OBL editor for the form by clicking the Close button on the
window toolbar and open the Properties dialog box for the form. You will
see that the Mousecursor property has been changed to "Hand".
Remember that any changes introduced with the OBL editor have to be
applied before they can take place. You apply the changes by clicking the
Apply button on the window toolbar. Notice also that whenever you do
some modifications in the OBL code for a component, an asterisk * appears
on the tab. That asterisk warns you that you have made some modifications
but have not applied the changes yet. Click the Apply button to apply the
changes. The asterisk will disappear.
The syntax checker
When the OBL editor is being used for writing code you can check the
program syntax before applying the changes.
The integrated syntax checker is activated by clicking the Check syntax
button on the window toolbar. This triggers a syntax inspection in the
selected OBL tab.
The syntax checker inspects the proper spelling of the OBL code and the
validity of properties and values, at a rate of about 1000 lines per second. In
case the spelling is correct a message box with the Syntax Successful
message is displayed. If the code contains errors a sub window is created at
the bottom of the OBL Editor pane, listing the errors encountered in the
checking process.
a. Create a new presentation
b. Right click the Form1 and select the
OBL editor menu option. The OBL
code for the form will appear in the
middle pane.
c. Add the following statement to the
code: Mousecursor = "Hand"
d. Click the Apply button on the window
toolbar for the changes to take place.
Introducing the Frontend Designer: Basic concepts 37
Feedback about errors comprises the following information:
n Line number in the OBL code where the error has been encountered
n Error identifier (Error number)
n A description of the specific error
n Total number of errors inside the checked OBL block
In the example shown in the figure above a number of errors where
encountered inside an Action_set block. The original OBL code is
displayed in the top half of the screen. Notice that the " character is missing
at the end of the second line. The third line begins with a misspelled set
property name. Finally, an Evclick was inserted into this block, which
represents an Action like component. This is an illegal insertion, for actions
do not accept events inside. You will learn more about actions and events in
further lessons of the course.
The lower part of the screen displays the error window generated after the
syntax checking process. You can follow up the errors with it. The OBL
editor also shows the position of the cursor (in terms of Line Number and
Column Number) in the Status Bar. This enables a fast localization of the
listed errors.
Double clicking an error line highlights the OBL line where the error was
encountered, thus this is a second method for identifying error lines inside
the program. The figure below displays the situation where the line
containing error n 5 (it appears as a selected line) is double clicked. Notice
how the BEGIN Evclick ev1 line is bold typed in the upper half of the
screen.
Figure 12. Errors in the OBL code
38
Do not forget to apply the changes before exiting the OBL editor pane,
even when a "Syntax Successful" message has been displayed.
Saving code from the FrontEnd Designer and inserting code into
the OBL editor
The fact that presentations can be interpreted in the OBL language opens
the possibility of storing OBL code in a file, and to a certain extent the
rearrangement of OBL code as if it were a text file.
Saving OBL code from the FrontEnd Designer
2
When the OBL editor is being used you can save a selected range of OBL
code by selecting the Edit|Save Selection menu option.
Figure 13. Errors in the OBL code II
2. You will learn that presentations stored as disk files can be invoked by means of the
STFORM.PTCMFTASK.
Introducing the Frontend Designer: Basic concepts 39
This opens a Save As dialog box. The file stored will contain the selected
code as if it were a common text file, i.e. ASCII format. Two file extensions
can be chosen, .obl and .txt. They happen to be identical but the .obl
extension might be helpful to identify the text files that contain OBL code.
Inserting code into the OBL editor
The files saved in the previous section can be inserted in a presentation,
when its OBL code is being edited. To do so just select the Edit|Insert File
menu option. The text in the file will be added to the code contained in the
current OBL editor tab.
Figure 14. Saving OBL code
Figure 15. Save As window
40
Presentation Explorer
The third pane in the Designer Tool is called the Presentation Explorer or
Presentation Browser. It is of great help when designing and also for
understanding basic aspects of presentations.
We suggest that you open the presentation CXX_EXERCISE_1 while
reading this section. Edit the OBL code for the presentation and pay special
attention to the Explorer tree.
In every presentation there is an underlying hierarchy of components acting
as containers for other components. In the first presentation that you
created, forms acted as containers for buttons, text boxes and labels, while
forms were contained by the presentation.
This is extremely meaningful to the understanding of presentations and we
will come back to this point at the end of this lesson.
At this moment just be aware of how the Explorer reproduces this
container/contained behavior at any level, in terms of parent nodes
(controls acting as containers for some other controls) and child nodes
(controls being contained by another control).
Each branch in the Explorer represents a parent component.You can add
components to a parent component.
Adding visual and non visual components with the explorer.
Events and Actions.
Not all the components available in the designer tool are included in the
control palette. In fact, many of them are non visual components, i.e. they
have nothing to do with visual design, but provide the mayor part of the
logic inside the presentation. Those non visual components are, mainly,
Events and Actions.
Events, actions, and in general non visual components, bring your visual
presentations to live. You can access the non visual components that can be
inserted in a specific component by:
1. Selecting in the explorer the node representing the component you are
going to use as a container.
2. Right clicking the selected node.
3. Selecting the Insert Object option from the pop-up menu.
The list of components is displayed in a window.
This is exactly what we did at the beginning of the course in order to
include a form in a presentation.
Introducing the Frontend Designer: Basic concepts 41
Do the following exercise where you are prompted to insert two non visual
components: one of type Event and the other of type Action.
Exercise
a. Insert an Evclick component in the Button1 control. The Evclick is a
non visual component.
b. Save an preview your presentation. Nothing will happen when you
click the button. Why?, you have not programmed what happens when
the user clicks the button. At this point the program recognizes the click
event for the button (you have done that by inserting the Evclick
component), but you have not specified what has to happen when the
event is invoked. You do that in the next step.
c. Insert an Action_message component in the Evclick component you
created in the previous step. Action_message is also a non visual
component.
d. Save and preview your presentation. If you click the button now, a
dialog box will appear.
Notice that not a line of OBL has been typed. Edit the presentations OBL
code and notice the changes.
Notice the structure:
Button1
Evclick1
Action_message1
Action_message is a non visual component that triggers a message box
which is displayed by default with no text and an OK button. Other options
can be implemented with the following properties of Action_message:
n Text = "My Message Text"
This will display a message box with the "My Message Text" message.
n Buttonflags = X
Where X stands for a number from 0 to 5. This will let you choose the
buttons you want to be displayed in the message box. The meaning of the
different options is explained in the table below:
Buttonflag OK Cancel Abort Retry Ignore Yes No
0 X
42
An OBL code as the following:
BEGIN Action_message Action_message2
Text = "OOOO"
Buttonflags=2
END
will display the following message box:
e. Add now another button to Form1.
f. Make this button open a third Form (it will be called Form3).
g. Save and preview your presentation.
In terms of the "Button
Event
Action" structure,
n Which is the role being played by Form3 in this example?
n Compare the behavior of Form2 and Form3.
Components as containers
In the above exercise you have noticed how the container/contained
1 X X
2 X X X
3 X X
4 X X
5 X X
Figure 16. Example of Action_message
Buttonflag OK Cancel Abort Retry Ignore Yes No
Introducing the Frontend Designer: Basic concepts 43
problem is of the greatest importance for OBL programming. In fact, it will
help you understand the keystone of OBL programming.
In order to get functionality in our example we have used three different
kinds of components:
n Visual components: Button1, and Form3.
n Non visual components:
n Evclick: for making the button able of triggering some process.
n Action_message: for telling the program what to do, i.e. show a
message.
In general, presentations must be understood as programs composed of
these three elements:
n VISUAL COMPONENTS
n EVENTS
n ACTIONS
Generally speaking if you want a visual component to react to some event
in order to execute some other process you should follow the structure:
1. Select the visual component.
2. Insert the kind of event that will trigger the process.
3. Translate the process into actions that must be sequentially contained
inside the event.
If you try to add the Action_message action inside Button1 without the
Evclick1 nothing will trigger the action although it is in the program.
Nodes and their hierarchical interpretation
When referring to a given component inside a presentation the Explorer
tree gives you the complete reference name of that component.
As an example, in a presentation like the one in the figure below the text
box would be referred to as: Presentation/Form1/Groupbox1/Tabstrip1/
Tab1/Textbox1
44
This is exactly the path given by the explorer. Notice that if there is some
non visual component in between the presentation node and the component
you want to refer to the only way of getting the complete dependence is by
means of the Explorer. That is the case for a form being called from an
Evclick inside a button.
Introducing OBL
OBL is built up of three levels:
1. LEVEL ONE: EVENTS
2. LEVEL TWO: ACTIONS
3. LEVEL THREE: VISUAL
Understanding this structure helps in getting a global idea of what we are
doing when programming in OBL.
Figure 17. Example of component path
Figure 18. OBL levels
EVENTS
ACTIONS
VISUAL
FORMS
Introducing the Frontend Designer: Basic concepts 45
You will learn that there are a couple of OBL elements which do not lie
exactly inside any of the above mentioned categories, being of the greatest
importance for programming purposes.
When writing an OBL program we have to obey the following structure:
An event marks the beginning of certain actions, which are the elements
we use to execute commands. Events are contained inside visual
components.
Appendix I shows a number of controls and the related objects that can be
inserted inside them.
What is behind a running presentation?
Events and actions are mortal components. Visual elements are immortal
components. What this means is that when executing an OBL program,
any non-visual element dies away. At the end, just the visual components
survive, with their related OBL code.
An OBL program begins with an event, but it has to be a special one in
order to be independent of any visual component, for at the beginning of
the execution no visual component has been created yet. This special event
will be the Presentation object that will act as a global container.
According to this we can understand a presentation (which is nothing else
than a special event) as a sort of flow process that contains a series of
actions.
Events act as triggers for a set of actions to take place. Its like running an
MSDOS bat file, consisting of commands. The event would be the bat file
itself, which is the 'object' that can be run. And the execution of this bat file
triggers the sequential execution of the commands it contains. Those
commands would act as Actions do.
A bat file 'dies away' when it reaches its end. But the effects can endure.
The same happens to a presentation. Enduring elements of a presentation
are, among others, the visual interfaces the end user sees.
Figure 19. OBL program structure
BEGIN Event
END
BEGIN Action
...
END
46
Where is that visual interface? Where do visual components lie? How do
they take part in presentations?
We have already said that events are contained inside visual components,
exception made for the Presentation event. But we still need a link
between our initial event (the presentation) and, for instance, a textbox
appearing on the screen. Some element connecting an event with a visual
component able to contain other visual components an subject of being
contained by the Presentation. This very special component is the Form.
Forms act as elements between visual components and actions. Its visual
side is obvious. Its action side means the appearance of the visual
components it contains, when the presentation has been executed.
As forms are visual components they endure after the presentation is over.
This is why a presentations OBL code will follow an structure like:
BEGIN Presentation PresentationX
BEGIN Action ActionXXX

Figure 20. Presentation structure


BEGIN Presentation
END
BEGIN Event
BEGIN Action

END
END
BEGIN Event
BEGIN Action

END
END
Visual components
events
actions
Form
Introducing the Frontend Designer: Basic concepts 47
END
BEGIN Form FormX

BEGIN VisualComponent CompX


BEGIN Event EventX
BEGIN Action ActionX
.
END
END
END
END
END
The Properties dialog box and the programming
scenario
You have already learned how the Properties dialog box edits most of the
properties of a given component, enabling the assessment of values without
the need of the OBL editor. An 'F4' shortcut to this dialog has been
implemented. This Properties dialog box has a wider scope and
functionality which is very much related to the programming paradigm you
have just gone through.
Overview
The Properties dialog box shows additional tabs, apart from the one you
have used. These tabs enable the insertion of components into the one that
owns the Properties dialog box. Thus for inserting an event inside a button,
and then an action into that event (remember the VISUAL-EVENT-
ACTION scenario) you no longer need to use the explorer twice. The
whole insertion can be carried out from the initial Properties dialog.
Generally speaking the new Properties dialog is structured as follows:
Case 1
If the component can contain events the Properties dialog has three tabs
48
n Properties Tab: it includes the list of all the properties.
n Events Tab: it contains a list of events supported by the initial object.
If one of this events has already been included into the component it
will be shown in bold type.
n Component Tab: Any component that has been inserted in our initial
object is listed in this tab, in zone 1 (see figure below). A new
component can be included from this dialog by just pressing the Add
button (zone 2). This opens the Component List dialog (the same one
that is displayed through the Insert Component option).Components
can also be removed by means of the Remove button. Finally, the
arrow buttons in zone 3 enable changes in the list order. What this
means in terms of run time effects is a change in the order in which
those components will be executed. This is reflected by the value of the
Execorder property. Be aware that the change in the Execorder
property is not refreshed automatically in the Explorer although it will
be applied in run time, and if you inspect the OBL code you will see
that the code blocks change in position according to the specified
Execorder.
Figure 21. Properties dialog box: Properties
Figure 22. Properties dialog box: Events
Properties Tab Component Tab
Events Tab
Introducing the Frontend Designer: Basic concepts 49
Examples for case 1
n Forms
Forms can contain several events, and also a number of non-event like
objects. Thus you have the following tabs in the Properties dialog:
Figure 23. Properties dialog box: Components
Figure 24. Properties of the Form control
1
2
3
50
n Buttons
Buttons also contain events. Furthermore this control can ONLY contain
event like components. So the situation is as follows:
Figure 25. Events available for the Form control
Figure 26. Components available for the Form control
Introducing the Frontend Designer: Basic concepts 51
Figure 27. Properties of the Button control
Figure 28. Events available for the Button control
52
Case 2
If the component can not contain events the Properties dialog box has only
two tabs.
Examples for case 2
n Presentation
Presentations do not contain events, as they are event like components
themselves
3
. Their Properties dialog box is structured as follows:
Figure 29. Components available for the Button control
Figure 30. Properties dialog box without the events tab
3. Presentations can contain presentations, but as we explained earlier in the course this is
just an exception in the whole programming scenario.
Properties Tab
The usual list of
properties and
their values
Component Tab
Contains the list with
the objects that have
been inserted into this
component.
Introducing the Frontend Designer: Basic concepts 53
Example
Here you will implement the following well-known functionality: when
clicking on a button a message appears.
Figure 31. Properties of the Presentation program
a. Add a button to the initial form and
open its Properties dialog box.
b. Click the Events tab. The tab only
contains the Evclick event.
54
General hints
The Properties dialog box contains a list of the components already inserted
in the current component. This list is displayed when accessing the
Components Tab. The arrow buttons in this tab enable changes in the
order of execution in an easy and effective way.
The whole VISUAL-EVENT-ACTION programming scenario is reflected
in this Property dialog box. This helps in the understanding of the
underlying programming paradigm. It also avoids undesirable errors and
fulfills a more ergonomic use.
The whole hierarchy of objects represented by the explorer can be accessed
from the Property dialog, enabling an ordered inspection, modification and
insertion of objects.
c. Click the button on the right of Evclick
to insert a click event. The Evclick
Properties dialog box will open.
d. Click the OK button in order to make
effective the Evclick insertion
e. Insert an Action_message into the
Evclick component. To do so, open
again the Evclick Properties dialog
box, and select the Components tab.
f. Click the Add button.
g. Select the Action_message component
and click OK.
h. Insert a second Action_message.
i. Save the presentation as
CXX_31_EXAMPLE_1.
j. Change the text property for each of the
Action_message to:
n This is the first message
n This is the second message
respectively.
Introducing the Frontend Designer: Basic concepts 55
Some exceptions
All the former visual that contains an event + event that contains an
action picture works well in general terms. There are some exceptions to
this rules. The following tables summarizes the behavior of the most
common components.
Visual
Component
Contains
visual
components
Contains
actions
Contains
events
Button Yes
Textbox Yes
Treenode Yes Yes
Rectreenode Yes Yes
Groupbox Yes Yes
Itemlabel
Nodestatus
Tab Yes Yes
Image
Link
Patternbox
Combobox Yes
Urlbox
Changer Yes Yes
Toolbarbutton Yes Yes
Splittblock Yes Yes
Extern Yes
Slider
Label Yes
56
Action
Component
Contains
visual
components
Contains
actions
Contains
events
_bp
_call
_cmf
_copy
_dataprops
_datatrack
_dialog
_edititem
_execute
_filter
_goto
_help
_insrecord
_list
_listtrack
_method
_message
_notify
_set
_script
_task
_tasklet
_value
Form Yes Yes
Introducing the Frontend Designer: Basic concepts 57
Control Split
There are two controls of this kind; Splitthorizontal and Splittvertical.
Follow the steps to better understand these controls:
a. Add both types of Split controls to Form1. Preview the presentation
and test the new controls.
b. Look at the Explorer. Notice that a couple of Splittblocks have been
inserted into each Split control.
c. Right click on the Splitthorizontal node and see what you can insert in
this control.
d. Right click any of the Splittblock nodes and see what you can insert in
them.
Toolbars
To insert a toolbar in a form you can click the Toolbar button on the
Control Palette.
a. Add a Toolbar to Form1.
Event
Component
Contains
visual
components
Contains
actions
Contains
events
Event Yes (Forms) Yes Yes
(Presentations)
Evclick Yes (Forms) Yes Yes
(Presentations)
Evdbclick Yes (Forms) Yes Yes
(Presentations)
Evfocuslost Yes (Forms) Yes Yes
(Presentations)
Evmouseover Yes (Forms) Yes Yes
(Presentations)
Evvalidate Yes (Forms) Yes Yes
(Presentations)
Presentation Yes (Forms) Yes Yes
(Presentations)
58
b. Open the OBL code of the Toolbar, you will see:
BEGIN Toolbar Toolbar1
...
BEGIN Toolbarbutton Toolbarbutton1
Text = "Toolbarbutton1"
END
END
Notice the structure in the Explorer Tree and in the OBL code. See that a
Toolbarbutton control is included into the Toolbar as happened before with
the Split controls.
To insert buttons in a toolbar you must follow these steps:
Menus
Menus are inserted through the OBL editor. The OBL syntax for such a
a. Open the Properties dialog box of the
Toolbar. In the displayed Tabstrip, click
the Buttons tab.
b. Click the Insert button. You will get to
the following window:
c. Give values to the button properties:
l Name: CXX_SAVE
l Image: XSAVE
d. Click the OK button.
Introducing the Frontend Designer: Basic concepts 59
control is:
BEGIN Menubar MyMenu
BEGIN Menu MyFirstMenuOption
Text = "Option1"
BEGIN Menuitem MyFirstMenuItem
Text = "Item1"
END
END
END
60
Check your understanding of the current lesson by answering the following
review questions:
1. List each of the sections that make up the Frontend Designer
tool
2. What is the difference between fixed and non fixed images?.
How do you differentiate them?
3. What is the meaning of the properties: Values and Listitems of
the combobox?
4. Which are the three main types of components?
Review questions
Introducing the Frontend Designer: Basic concepts 61
Lesson Key Points...
Summary of key points in a bullet format...
n Frontend Designer Interface: Window toolbar, Title bar, Presentation
Browser, Visual Designer, OBL editor, Control Palette.
n Presentations are a very special type of programs.
n Presentations contain visual and non visual components.
n Components can be classified as: Events, Actions and Visual
components. Events and Actions are non visual components.
You should be able to ....
Lesson summary
Create presentations based on forms, and give them the look you
desire.
Implement elementary functionality through your presentations.
Open up other presentations and understand the main structure.
Export presentations to text files, and import them back to the
Frontend Designer.
Display messages on screen as the result of the click of a button,
or other events that you may wish to implement.
62
63
Building logic into
Presentations: more OBL
If you review what you have achieved so far, you may thing that you have
created very basic presentations, however, and even though you are right,
you must have by now a clear understanding of the philosophy underneath
a presentation. From now on you will learn how to do more complex the
presentations. This learning process is a lot easier than the process you have
already gone through.
Introduction
Lesson objectives
Upon completion of this lesson, you will be able to:
n Alter the code supporting a presentation.
n Change properties in runtime.
n Change the program flow of a presentation.
n Refer to a property of a component from outside the OBL code
corresponding to that component.
n Differentiate between the two referencing options: Relative and
Absolute.
n Call other presentations already created from your presentation
n Use context variables as a way to pass values from one
presentation to another
Lesson 1.
Introducing the Frontend
Designer:Basic concepts
Lesson 4.
Connecting to
Meta4Objects
Lesson 5.
Exploring what the FED
Wizard does
Lesson 3.
Advanced functionality
Lesson 2.
Building logic into
presentations: more
OBL
64
How to access the functionality for this lesson
Select the following path:
If you select this path the following window opens:
Click the Frontend Designer option on the right panel, or double click the
same option on the tree and the Frontend Designer window will open.
Meta4Mind Menu Tree
Mind|Developement Tools|Presentations
Figure 32. Accessing the Frontend Designer
Building logic into Presentations: more OBL 65
Remember to show the Presentation Browser on the screen. To open it
select the option View|Presentation Browser on the menu bar.
Figure 33. The Frontend Designer window
66
In order to gain more power in your presentations you will learn now how
to type code inside your OBL. Usually that code will be added to an Action
block, as those represent the fundamental unit of work inside a
presentation.
You will be able to change properties in runtime, change the program flow
and refer to a certain components property from outside the OBL block of
that component. That will teach you how to provide logic to a presentation.
Hierarchy means logic
If you go back to some of the exercises we have done in the previous lesson
you will see how the hierarchical structure brings some logic into the
presentation. A certain flow can be attained just by ordering the
components in a proper way.
Referring to properties of other objects
A common action inside a presentation is changing an object property in
runtime. To do so you have to learn first how to address the object and its
properties.
Absolute referencing
Each object is identified by the path it inherits in the Explorer. We call this
path the objects absolute reference.
Conceptual definitions
Building logic into Presentations: more OBL 67
The absolute reference of some objects in the presentation shown in the
figure above is listed in the table below. The figure also shows the
presentation in runtime.
Properties are addressed using the dot operator. Here is an example:
n Addressing the Backcolor property of Textbox1:
/Presentation/Form1/Tabstrip1/Tab1/Groupbox1/Textbox1.Backcolor
Relative referencing
There is another way for addressing objects inside a presentation. We will
explain it with an example.
Open again your CXX_EXERCISE_1 presentation. If you are to address an
object from another object you have a source and a target object. Suppose
you want to address the Textbox2 control from Evclick2. That means:
n SOURCE OBJECT: Evclick2
n TARGET OBJECT: Textbox2
Figure 34. Absolute referencing
Object Alias Absolute reference
Button1 /Presentation/Form1/Button1
Textbox1 /Presentation/Form1/Tabstrip1/Tab1/
Groupbox1/Textbox1
68
In order to find the proper reference we suggest that you do the following:
a. Localize both objects in the Explorer tree.
b. Localize the first common node for both the target and source object.
n Textbox2 is contained in the Form2 node, which in turn is
contained in the Presentation node.
n Evclick1 is contained in Button1, which is contained by Form1,
which in turn is contained in Presentation.
n Thus the first common node is the Presentation node.
n Build the relative path from the source object, each time you ascend a
level add a "../" symbol, until you reach the first common node. From
that node write the absolute path for the target object.
../../../Form2/Textbox2
Absolute reference facility
When referring to another object inside a presentation two ways have
already been explained: using absolute references and using relative
references.
Here you will be introduced to the FrontEnd Designer reference facility,
which enables the generation of a given components path in an internal
way. You will be able to paste this absolute reference in any part of the
presentation where it is needed.
To illustrate this facility you will use the CXX_EXAMPLE_1 presentation.
In this presentation you must have already inserted two Action_message
Figure 35. Relative referencing
Building logic into Presentations: more OBL 69
components into a Buttons Evclick event. Now you will construct the
following functionality:
a. Add a Textbox with no text, into the
Form. The message shown in
Action_messge1 box will no longer be
fixed. It will display the text typed
inside the textbox in runtime. To do so
you can use the following design.
b. Insert an Action_set with the following
assignment:
*V*MiVar:=[*O*/Presentation/Form1/
Textbox1.Text]
To do so follow the steps:
c. Change the Text property of the
Action_message to [*V*MiVar]
d. Select the component (in the example
the Textbox1 control), either in the
Explorer or in the Design pane.
e. Right click on the selected component.
A pop-up menu will appear. By
selecting the Copy Component Path
option the components absolute
reference, i.e. the string *O*/
Presentation/Form1/Textbox1, is
created and sent to the clipboard.You
have the same functionality in the Edit
menu option.
70
Read the next section (changing properties in runtime) to fully understand
all the steps taken in this example.
You can also drag and drop the components path if the OBL editor is open.
The former example would be carried out in the following way:
a. STEP 1: Open the OBL code of the target block.
b. STEP 2: Drag (from the explorer) and drop (in the OBL code block)
Add the rest of the components and get the functionality described at the
beginning of this example. Save and test your presentation.
Finally lets just point out that this absolute reference facility has an F5
shortcut.
f. Open the Action_set Properties dialog
box and double click in the Set textbox.
Now write the beginning of the Set
sentence, i.e. *V*MiVar:=
g. Press Ctrl+V to recover the path
*V*MiVar:=*O*/Presentation/Form1/
Textbox1
h. Add the.Text property to the above
expression
i. Complete the process by inserting
square brackets.
*V*MiVar:=[*O*/Presentation/Form1/
Textbox1.Text]
Figure 36. Dragging a components path in the OBL editor
Building logic into Presentations: more OBL 71
Further options concerning this absolute reference facility can be displayed
if the drag-and-drop process is triggered with the right mouse button. In
that case the process shown in the above figure would yield the situation
represented in the screenshot below.
Paste the component path here option is equivalent to using the drag-and-
drop with the left mouse button, it copies the components absolute
reference.
The Paste component code here option however replicates the whole
components OBL code. In our example that would result in the code
shown in the following figure.
The Cancel option just cancels the process.
The whole drag-and-drop process can be carried out using one presentation
as a source of OBL code and a second one, with its OBL editor opened, as a
target. This is most of the times meaningless in terms of getting absolute
references, for the Explorer structure can vary significantly in both
presentations. But in terms of duplicating OBL code from a whole block it
is extremely useful.
Figure 37. Pasting a components path in the OBL editor
Figure 38. Pasting a components code in the OBL editor
72
Changing properties in runtime
Suppose you want to change the initial color of a text box with the click of
a button. That means changing the Backcolor property of a textbox control
in runtime. To do so just bear in mind the two fundamental concepts you
just went through:
1. The structure: VISUAL COMPONENT
EVENT
ACTION
2. How to address an object from another object.
Action_set
n Action_set: Syntax.
BEGIN Action_set ActionSet1
Set = "*O*ObjectReference.PropertyToChange := NewValue"
END
n In order to practice, build a new presentation with a button and a text
box. When clicking the button the textbox text must change. Please
follow the steps.
Building logic into Presentations: more OBL 73
Action_call - Methods
n Action_call invokes a method supported by the component. The syntax
is the following:
BEGIN
Sentence = "*O* ObjectReference.PropertyToChange(NewValue)"
END
n In order to practice repeat the previous exercise changing the
Action_set by an Action_call
You can find the methods supported by a great number of components in
Appendix VIII
a. Create a new presentation.
b. Insert a button control, and Evclick
component in the button, and an
Action_set component in the Evclick.
c. Insert a textbox in the form
d. Edit the Action_set Properties dialog
box.
e. Set the Set property to the value:
*O*/Presentation/Form1/
Textbox1.Backcolor:=30000
74
Namespace
Notice that in any of the above actions the chain *O* must be added at the
beginning of the object reference. This chain means that the following
reference points to a presentation object.
This is the first element of the Frontend namespace. The table bellow
contains the elements of this namespace. You will learn how and when to
use them in the following sections and lessons.
Connecting presentations
Calling a presentation from another presentation is more or less a common
task and there is more than one way of doing it.
Connecting through an Extends component
A first way of invoking a presentation from another one uses an special
object called Extends.
n Extends: Syntax.
BEGIN Extends Extends1
Idinstance = "IdentifierOfThePresentationYouWantToRise"
END
Connecting through an Action_task
The second way uses the OLE interface TaskInt.TaskInterface which is
the basic task interface.
The task you will use is called STFORM.PTCMFTASK which is the
primary task for the presentations engine. It enables the triggering of any
presentation no matter whether it is stored in the data base or in the disk.
Variable Object type
*O* Presentation object
*V* Runtime or presentation variable
*C* Context object
*F* Fixed value
*D* Data object
*T* Data object belonging to the connected track
Building logic into Presentations: more OBL 75
You execute this task inside the presentation by means of the object
Action_task.
n Action_task: Syntax
BEGIN Action_task ActionTask1
Class = "NameOfTheTaskYouWantToExecute"
END
n Example:
BEGIN Action_task RisePresentation
Class = "STFORM.PTCMFTASK"
END
If you execute this code, no presentation will be raised. Somehow you have
to tell the STFORM.PTCMFTASK task which presentation you want to
raise. You will learn to do that in the following section.
Presentation context and context variables
If there is any task parameter needed, which is usually the case, it has to be
stored in the presentations context, because tasks use context variables as
parameters.
A context can be understood as the zone where context values can be stored
to be used later on either by the presentation in which they have been
defined or in another presentation.
By default contexts are inherited. What that means is basically that unless
you state the opposite a second presentation that has been started from the
first one will work with the same context.
Figure 39. Presentation context
BEGIN Presentation Pres1
.
.
.
ThisIsAContextVar
.
.
.
END
CONTEXT
ThisIsAContextVar
Here some context
variable is created
Here it is stored
76
You can break the context inheritance by setting the second presentations
Localcontext property to TRUE.
From that moment the presentation with its Localcontex set to true has a
new context not connected to its parent presentations context.
Context variables are named in the following way:
*C*NameOfTheContextVariable
Where the string *C* means that we are referring to a context object.
You can assign a certain value to a given context variables using the
Action_set in the same way as you did with presentation objects. That is:
BEGIN Action_set SetValue
Set = "*C*AnyContextVar := AnyValue"
END
In your case the name of the presentation you want to start is a parameter
needed by the task. Thus first we have to create a context variable whose
value will be the name of the presentation. There is an special context
variable reserved for such purpose: *C*#SYS_IDINSTANCE#. Thus the
Figure 40. Context variables
Figure 41. Context inheritance: local context
BEGIN Presentation Pres1
.
.
.
ThisIsAContextVar
.
.
.
END
CONTEXT
ThisIsAContextVar
BEGIN Presentation Pres2
.
.
.
GetTheContextVar
.
.
.
END
The context is common
Broken link
BEGINPresentationPres1
.
.
.
ThisIsAContextVar
.
.
.
END
CONTEXT
ThisIsAContextVar
BEGINPresentationPres2
Localcontext =True
.
.
.
GetTheContextVar
.
.
.
END
NEW
CONTEXT
Building logic into Presentations: more OBL 77
code must be:
BEGIN Action_set SetPresNameToContext
Set = "*C*#SYS_IDINSTANCE# := "IdOfNextPresentation""
END
Here is a summary of the steps needed to fulfil the whole process:
STEP 1.- Transfer the name of the second presentation to the context:
BEGIN AnyAvaliableEvent MyEvent1
BEGIN Action_set SetPresNameToContext
Set = "*C*#SYS_IDINSTANCE# :=
"IdOfNextPresentation""
END
END
STEP 2.- Order the rise presentation task
BEGIN AnyAvaliableEvent MyEvent1
BEGIN Action_set SetPresNameToContext
Set = "*C*#SYS_IDINSTANCE# :=
"IdOfNextPresentation""
END
BEGIN Action_task RisePresentation
Class = "STFORM.PTCMFTASK"
END
END
Transferring variables - Context vs. Runtime
variables
The other great advantage of contexts is the possibility of transferring
values from one presentation to another, through the context, or to store a
variable and use it later on the presentation where it has been created.
There is another way of implementing the process we built before. It uses
another kind of variable, which is not a context one, but a so called runtime
variable.
78
These runtime variables are named as:
*V*NameOfRunTimeVariable
Values are assigned in the same way as you assigned values to context
variables, that is through Action_set.
Building logic into Presentations: more OBL 79
Check your understanding of the current lesson by answering the following
review questions.
1. What is the difference between absolute referencing and relative
referencing?
2. What is the presentation context and what are context
variables?. How can you break the context inheritance?
3. What are runtime variables? Which symbol identifies them?
4. What is the Action_call used for?
Review questions
80
Lesson key points...
Summary of key points in a bullet format...
n There are two ways of referencing an object is a presentation: relative
and absolute referencing.
n You can change control properties through the use of an Action_set or
Action_call components.
n To access a property of a component follow the reference to the
component.name_of_property structure.
n You can use context spaces to store variables that can be used later on.
n You can also use context spaces and context variables to pass values
from one presentation to another.
You should be able to...
Lesson summary

Change controls properties in runtime.

Call other presentations from your presentation.

Pass values to the n presentation invoked.


81
Advanced controls and
functionality
In this lesson you will study more controls. These controls were not
introduced in lesson 1 because they are a little bit more complex, and you
needed to start off with simple things. If you have successfully completed
the previous lessons, you shouldnt have any trouble completing this one,
because all you are going to do is learn about some controls and properties
that allow you to create more sophisticated presentations.
Introduction
Lesson objectives
Upon completion of this lesson, you will be able to:
n Use advanced controls to create awesome-looking presentations.
n Use the metalanguage capabilities of some controls to display text
in different languages depending on the language the user has
logged in.
n Break the sequential flow of a presentation using the Action_goto
control.
n Use virtual areas to better design forms and scrollpanels.
Lesson 1.
Introducing the Frontend
Designer:Basic concepts
Lesson 4.
Connecting to
Meta4Objects
Lesson 5.
Exploring what the FED
Wizard does
Lesson 3.
Advanced functionality
Lesson 2.
Building logic into
presentations: more
OBL
82
How to access the functionality for this lesson
Select the following path:
If you select this path the following window opens:
Click the Frontend Designer option on the right panel, or double click the
same option on the tree and the Frontend Designer window will open.
Meta4Mind Menu Tree
Mind|Developement Tools|Presentations
Figure 42. Accessing the Frontend Designer
Advanced controls and functionality 83
Remember to show the Presentation Browser on the screen. To open it
select the option View|Presentation Browser on the menu bar.
Figure 43. The Frontend Designer window
84
Tabstrip, Panel and Scrollpanel
Here is another useful control provided by the Designer Tool: Tabstrip.
They are included in the Control Palette.
If you include a Tabstrip in your presentation, you will see that it has to
include at least one Tab.
Each tab can be brought to the front of the design pane by selecting it on the
Explorer. The pop up menu that appears when right clicking the Tabstrip
node also allows for tab selection.
In run time, tabs can be selected by clicking the corresponding tab. In case
you want to control the tab to be shown from another control, Tabstrips
support two methods:
n Selectedtab(NameOfTab)
n Showtab(NameOfTab)
See appendixes for other important properties.
It must be mentioned here that the Frontend creates overlapping objects on
demand, i.e. in run time the unseen objects are destroyed. This results in a
lower need of memory and space, but it also means that you have to be very
careful when trying to access the properties of an object inside a tab, for it
may not be alive at that moment.
The Panel and Scrollpanel controls act as pure containers. Both act in a
very similar way, but the advantage of Scrollpanel is the horizontal and
vertical scrolls bars that appear in run time when needed. What this means
is that in case the space needed for displaying a number of controls is larger
than the size of the Panel, you will not be able to see these controls in run
time. But if a Scrollpanel is being used instead of a Panel, scrollbars will be
generated enabling the end user to scroll in run time to see all the included
controls.
Both the Panel and Scrollpanel controls have the property Contstructif.
This property will be discussed later on the course.
Conceptual definitions
Advanced controls and functionality 85
Changers and trees. Virtual forms.
Changers
Suppose you want to design a presentation with the following functionality:
n It will show a map with the working centers of your company
1
.
n There will be some object that enables the user to get a detailed map of
an area
2
with some additional information (e.g. the address and the
head managers name)
You could use two different forms, invoke a second presentation or change
the image in run time and make some controls visible or non visible
depending on what the image control is showing.
The Changer is a control that simplifies this kind of functionality. It lets
you implement a number of different visual levels all sharing the same area
in the same form. The figure bellow illustrates this concept.
The visual levels we mention can be any of the objects listed in Appendix I
(see Changer object). If you construct a level with a container object (a
panel, scrollpanel, tabstrip) a great amount of logic can be added without
the need of changing your form or your presentation.
The most meaningful aspect of changers is the method Changeto, that
allows changing from one visual level to another.
WARNIG: Be aware! You must invoke this method from the event you
1. Use the image: "b_mapusa.bmp"
2. Use the image: "b_mapgeorg.bmp"
Figure 44. Changer: visual levels
Changer
1
st
visual level
2
nd
visual level
3
rd
visual level
86
want to trigger a change in the changers visual level (i.e. a menu option, a
button)
n Changeto: Syntax.
BEGIN AnyAviliableEvent MyEvent
BEGIN Action_call ActCall
Sentence = "*O*TheChanger'sPath.Changeto(VisualLevel_n)"
END
END
n Example:
Exercise
In order to practice the concepts introduced, do the following small
exercise:
a. Build the presentation described at the beginning of this section. It will
show a map with your company's working centers.
3
b. There will be some object that enables the user to get a detailed map of
an area
4
with some additional information (e.g. the address and the
head manager's name). Use a changer and scroll panels as containers
for the images and the rest of the visual controls. Use two buttons to
change the changer's level.
c. Save and preview your presentation.
Figure 45. Presentation that uses a changer
3. Use the image: "b_mapusa.bmp"
4. Use the image: "b_mapgeorg.bmp"
BEGIN Button Button1
Top = 10
Left = 20
Width = 61
Height = 41
Text = "To level 1"
BEGIN Evclick Evclick1
BEGIN Action_call Action_call1
Sentence="*O*/Presentation/Form1/Changer1.Changeto(Level1)"
END
END
END
Advanced controls and functionality 87
This method allows selecting several levels at the same time. The levels
have to be separated by commas when the method Changeto is invoked.
Trees
In this section the Tree object will be presented. Trees are build in the
following way.
First you establish the area which will act as a container for the tree itself.
This area is the Treeview object. As it is the case with the Menubar or the
Toolbar controls, it acts as a pure container for the future tree nodes the
user includes.
Inside the Treeview object you can only insert a Treenode object which is
now a visual component able to respond to an Evclick event.
It is easy to construct a tree reflecting the different visual levels inserted
inside a changer and use the Treenodes instead of buttons or any other
triggering objects to switch from node to node in the tree.
Exercise
In order to get more familiar with the tree object, do the following small
exercise.
Modify the previous presentation and trigger the changes in the changer
using the treenodes instead of the buttons. Build the tree hierarchy like:
Virtual Areas
To optimize the use of a changers area it is of common use to set the
property Align of the contained objects (levels) to All thus forcing the
object to occupy the whole area assigned to the changer.
Problem arises when the number of levels inside the changer grows. Or
when the complexity of each level design is high. Then this overlapping
turns into a source of confusion. Specially is the changer is no longer
Figure 46. Tree hierarchy
Working centers (USA)
Georgia
...
88
visible because of the Align=All property.
Another common problem encountered when designing is the following:
when a scrollpanel is being used you can not control the distribution of the
controls that lay outside the scrollpanels area. Playing around with each
controls Top and Left properties is a somehow tiresome solution...
Finally, if you use the copy & paste facility for inserting controls into
another container, Top and Left properties are inherited in the pasted
components, and this can result in a problem similar to the one described
before. Again, resetting the Top and Left values can solve the problem. But
a more straightforward way is desirable.
In all this situations you will find extremely useful to get a so called
Virtual Area of each of the components that act as containers.
To do so, just right click the corresponding treenode in the Presentation
Browser (the one corresponding to the container) and select the Virtual
Area option from the pop-up menu. Virtual areas are generated as
appended forms that are only alive and visible in this 'Form-state' in design
time. If they are present in your design, they appear at the lower part of the
Presentation Browser. The following figure shows a screenshot of a
presentation design where virtual areas for Tab1 and Tab2 have been
created.
They also appear in the toolbar combobox as if they were forms in the
presentation.
Figure 47. Virtual areas
Advanced controls and functionality 89
To display a virtual area in the designer pane you can either select it from
the combobox or click its node in the Explorer. Virtual areas are displayed
as white forms in order to distinguish them from non-virtual (usual) forms.
You can introduce changes in the virtual form as if you were working in the
normal form. These changes have to be applied, as in the OBL Editor. You
apply changes by clicking the Apply button on the window toolbar.
To close a virtual form click on the Close button on the window toolbar.
Multi language text
The designer Tool offers the possibility of inserting text associated to a
given component in the different languages supported by Meta4Mind Set.
This is easily done in the Properties dialog box of that given component.
For example, a label inserted in a form can be displayed with a different
text depending on the language the user chooses when logging in the
application.
The different values of the Text property are given in the Translated
Property dialog box that pops up when clicking the button at the right end
of the text line.
Figure 48. Selecting virtual areas from the combo box
90
Multi language text can be tested in design time. Just click the language
icon on the status bar and then select the desired language from the pop up
menu.
Some important properties
Forms can be designed as Modal forms, i.e., no other form will receive the
focus unless the displayed modal form has been closed. By default, this
property is set to 0 (i.e. false or non modal).
In order to avoid reopening a form twice in run time you can give a non null
value to the property Registername of a form. The form will then be
created only in case no other form with such Registername is already
alive. Register here refers to record.
Startupposition is a property that accepts the following values:
Windowstate lets you decide whether you want the screen to be displayed
in a normal way (0), minimized (1) or maximized (2).
When dealing with data base records (next lessons) any change in a value
will promote, when the form is being closed, a message asking about saving
Figure 49. Multilingual text
Value Meaning
0 Centers the form in the screen
1 Windows decides
2 Top and left properties are used
Advanced controls and functionality 91
the unsaved changes. To avoid this messagebox when closing the form,
change the default value of Askbeforeclose property to 0.
Every component has a Grant property based on a bit mask. See
Appendixes for details.
Implicit Flow control; Explicit Flow control
(Action_goto)
You have already worked with Action_message (see previous sections).
There you were presented to the Onok, Oncancel, Onyes... properties. You
were told these could be used to control the flow of the program. Here you
will learn how this control can be achieved, either from the
Action_message component or from some other components provided by
the Frontend Designer.
In our programming scenario Actions are the smallest unit of execution.
They have to be contained by an event like component. Thus we can
understand the sequence of Actions inside an event as an execution block.
If left alone, this execution block will perform sequentially the actions it
contains. This would be the natural flow.
Figure 50. Sequential flow of actions
End of the execution block
0
1
2
3
Event is triggered
Beginning of the execution
block
Action_message1
Action_call1
Action_set1
4
92
This sequence can be broken and changed in run time by taking control of
the programs flow. Jumps in the process shown in the above figure can be
performed using for instance the Onok and Oncancel properties of
Action_message. This is described in the figure bellow.
Figure 51. OBL code
Figure 52. Onok & Oncancel properties break the sequential flow
BEGIN Evclick Evclick
BEGIN Action_message Action_message1
...
END
BEGIN Action_call Action_call1
...
END
BEGIN Action_set Action_set1
...
END
END
Event is triggered
Beginning of the execution
block
Action_call1
Action_set1
End of the execution block
Action_message1
Onok Oncancel
Advanced controls and functionality 93
Notice that just by giving the Alias of the component you want the flow to
jump to in the On* properties this control is achieved.
This On* properties are present in a number of components inside the
Frontend designer (see the list below) and many of them will be introduced
in the present course. This way of changing the flow is referred to as
intrinsic flow control.
n Action_dialog
n Action_edititem
n Action_list
n Action_listtrack
n Action_message
n Action_value
n Action_script
There is an action specifically designed for changing the flow and it is
called Action_goto. The syntax of this component is:
n Action_goto: Syntax.
BEGIN Action_goto MyAction
Nextblock = "AliasOfActionInsideTheExecutionBlock"
END
Nextblock is the property where you specify the Alias you want the flow to
jump to inside the same execution block. This way of handling the flow is
known as explicit flow control.
Figure 53. OBL code
BEGIN Evclick Evclick
BEGIN Action_message Action_message1
Onok = "Action_set1"
Oncancel= "Action_call1"
...
END
BEGIN Action_call Action_call1
...
END
BEGIN Action_set Action_set1
...
END
END
94
Action_dialog
This action is intended to display the Open file and Save file windows and
the Color, Printers and Font dialogs in run time.
Here are some comments on this actions properties.
n Dialog. The kind of dialog that is actually displayed in run time is set
by means of the value of this property. It accepts:
n Openfile
n Savefile
n Color
n Print
n Font
n Onok & Oncancel. They act in the usual way, i.e. as flow controllers.
They accept the alias of the step, in the current execution block
n Filenameobject. It works for Open and Save like dialogs. This is the
name of the presentation object that will receive the name of the file
selected in the dialog.
n Fontboldobject, Fontitalicobject, Fontstriketrhoughobject,
Fontunderlineobject. They all work with the Font dialog. When any
of the related properties of a given font have been chosen in a Font
dialog, a True or a False value is returned to the presentation object
that is written into these properties.
n Fontnameobject, Fontsizeobject. They also work when the Font
dialog is being used. The value returned to the presentation objects
specified here is correspondingly the name of the font selected or the
size of the font.
Exeblocks
This component is intended for storing code that will be reused in different
points in a presentation. In this sense it acts as a functional library.
It can be inserted as if it were a visual component, being accepted by
controls like Form, Panel, Scrollpanel, and so on. It can only contain the
component Presentation.
n Syntax:
BEGIN Exeblocks Exeblocks1
BEGIN Presentation p1
Advanced controls and functionality 95
Idpresentation = 0
.....
Any Action you want to include, Forms,...
....
END
END
When you want to invoke the code stored inside the presentation (p1 in the
example above) you have to use an Action_call with the following syntax:
BEGIN Action_call Action_call1
Idpresentation = 0
Sentence = "*O*...ThePathOfExeblocks1/Exeblocks1.Call(p1)"
END
96
Check your understanding of the current lesson by answering the following
review questions.
1. What is the virtual area? List two components that have this
capability.
2. Which property is used for the multilingual feature? How can you
test it?
3. What is the effect of setting the Modal property of a form to True?
4. What is the difference between the implicit flow control and the
explicit flow control?
Review questions
Advanced controls and functionality 97
Lesson key points...
Summary of key points in a bullet format...
n The controls introduced in this lesson were: Tabstrip, Panel,
Scrollpanel, Changers and Trees.
n Virtual area: a very handy feature to facilitate the design of some
controls.
n Flow control: Action_goto, Onok, Oncancel, Onyes, and so on
You should be able to...
Lesson summary
Use the Changer and Tree controls to create fancy-looking
presentations.
Use the Action_goto component to control the flow of the
program and introduce some logic to the presentation.
Use the Action_dialog component to interact with the Open file,
Save file, Color, Printers and Font dialog boxes.
98
99
Connecting to Meta4Objects
This is undoubtedly the most important chapter of the course together with
chapter one. In this lesson you will learn to link your presentations to
Meta4Objects. Up to now you have been working on forms, events, and
visual controls. However you have not shown a single record stored in
some table of the repository. This is where you will learn to load data into
your presentations and show it to the user. Basically you will construct a
bridge to your Meta4Objects.
Introduction
Lesson objectives
Upon completion of this lesson, you will be able to:
n Provide all the functionality implemented in a Meta4Object (or
several) through a presentation.
n Implement navigation toolbars to navigate through the records of
a given table.
n Execute Meta4Object methods from your presentations
n Create a Zoom List Group
n Use real advanced controls and properties to create highly
functional presentations.
Lesson 1.
Introducing the Frontend
Designer:Basic concepts
Lesson 4.
Connecting to
Meta4Objects
Lesson 5.
Exploring what the FED
Wizard does
Lesson 3.
Advanced functionality
Lesson 2.
Building logic into
presentations: more
OBL
100
How to access the functionality for this lesson
Select the following path:
If you select this path the following window opens:
Click the Frontend Designer option on the right panel, or double click the
same option on the tree and the Frontend Designer window will open.
Meta4Mind Menu Tree
Mind|Developement Tools|Presentations
Figure 54. Accessing the Frontend Designer
Connecting to Meta4Objects 101
Remember to show the Presentation Browser on the screen. To open it
select the option View|Presentation Browser on the menu bar.
Figure 55. The Frontend Designer window
102
Linking components to Meta4Objects
An intrinsic and powerful aspect of the Frontend Designer is the easiness of
connecting with data trough already designed Meta4Objects.
You should be very much aware of the fact that once you have connected
your presentation with a Meta4Object the underlying Meta4Object
structure will be as important as the design of the presentation itself. Thus
be very careful and study the Meta4Object you will link to the presentation.
A great deal of the exceptional potential of Meta4Mind relies on the design
of Meta4Objects, but care must be put on the underlying data model and on
the presentation that finally brings the Meta4Object to the end user. Here
you will learn the key points for building those interfaces, between
Meta4Objects and end users, which are presentations.
Data properties
Every component in the designer tool has a set of Data Properties that link
the component with a certain Meta4Object, a certain node or/and a certain
item. Those properties are listed in the table below.
If none of the above properties is given a value, the component remains
independent of any Meta4Object. Be aware of the fact that they require a
sequential value assignment.
n Assigning a value to Idchannel means linking to a Meta4Object,
independent of which node or item.
n Assigning a value to Idnode particularizes which Meta4Objects node
will be related to the presentation object.
n Finally, Iditem lets you link the object to a particular item of the
Meta4Object.
Conceptual definitions
Property name Meaning
Idchannel Identifier of the Meta4Object
Idnode Identifier of a certain node in the Meta4Object. It
requires a non null value in Idchannel
Iditem Identifier of a certain item in a certain node of the
Meta4Object. It requires non null values in
Idchannel and Idnode
Connecting to Meta4Objects 103
Data properties are inherited through the Explorer Tree. Thus if you assign
a value to the presentations data property it will be inherited in all the
components contained by the presentation.
This inheritance can be broken by different ways that will be mentioned
further on the course.
In order to gain experience on these concepts we suggest that you do the
following exercise.
Exercise
a. Build up a presentation like the one in the figure below. Link the text
boxes to the corresponding items in the STD_MT_COUNTRY
Meta4Object.
b. Save your presentation and then preview it. Do you see any data on the
linked items?
The answer to the above question is no. Why? The following sections
explain why.
Loading options
Linking components is just the beginning of the process. As you might
have guessed data have got to be loaded, and the loading processes have to
be included inside the presentation.
Figure 56. The Frontend Designer with the Presentation Browser
104
Data is loaded using the Action_preload control.
n Action_preload: Syntax:
BEGIN Action_preload MyPreload1
Idchannel = "MyChannel"
Idnode = "MyNode"
1
END
If the Meta4Object we are going to load has any kind of data filtering
before the data is effectively loaded (i.e. any kind of filter defined at the
root node level) or a track Meta4Object has been linked through a list
connector, then a certain process of pre-loading takes place. This processes
are invoked in the Frontend Designer by a property of Action_preload
called Availablesteps.
We will not get into the details here
2
but these are the possible preload
steps:
As it has just been mentioned the property that lets you decide which one of
the above mentioned steps is going to be present when loading data is
Availablesteps. You can control this steps by giving the corresponding
mask number as a value of this property. Combining the bit mask invokes
different steps that will take place in the sequence indicated in the previous
table (e.g. Availablesteps = 12 shows first a filter for the Meta4Object and
then the Ask Parameters dialog box).
n Availablesteps: Syntax
BEGIN Action_preload MyPreload1
Idchannel = "MyChannel"
Idnode = "MyNodeNotMandatory"
Availablesteps = XX
END
1. This is optional
2. For further explanations see the section devoted to tracks
Preload step Mask number Binary code
Choose list dialog 1 00001
Filter list dialog 2 00010
Filter channel dialog 4 00100
Ask parameters dialog 8 01000
Display list dialog 16 10000
Connecting to Meta4Objects 105
In order to practice the concepts introduced in this section we suggest that
you do the following exercise:
Exercise
a. Insert an Action_preload in your presentation.
b. Save and run now your presentation.
c. Change the sequence in the execution order so that Action_preload
takes place before Form1. You can do this either directly changing the
OBL code or through the Properties dialog box changing the
Execorder property of the controls
3
.
d. Save and preview your presentation.
You will learn more about Action_preload taking control of the underlying
Meta4Object structure. Specially if tracks or dynamic filters are present.
Controls closely related to Meta4Objects
Getting into the details of DMD and Meta4Object design is out of the scope
for this course. However you will need to work with a data model and a
Meta4Object in order to understand the behavior and functionality of some
the controls of the Frontend Designer. The data model and Meta4Object
you will be working with are depicted below in the following figures.
3. Be aware!. Changing Execorder will not change the order of the nodes in the Explorer,
but it has the desired effect in run time. Furthermore, after reloading the presentation the
Explorer tree is synchronized to the Execorder property.
Figure 57. Changing the order of execution
106
In the data model above, two single-node Meta4Objects have been
generated for every table, the Track and Maintenance Meta4Objects. In
addition a multi-node Meta4Object was constructed using the Meta4Object
Designer Tool. Its structure is shown in the figure below.
Figure 58. Data model
Figure 59. CMP_M4O_COSTS Meta4Object
Connecting to Meta4Objects 107
Node structures have been inherited from the corresponding MT
Meta4Objects. Nor a track neither any kind of filter has been connected to
this Meta4Object.
Briefly, this Meta4Object is intended for creating courses indicating a
number of characteristics and assigning different costs to courses.
Lets build up a presentation for this Meta4Object. Please follow the steps
in order to successfully complete the exercise.
Exercise
a. Click the New Presentation button on the window toolbar.
b. Create 10 text boxes and 10 labels as shown in the figure below. TIP:
Use the copy & paste option.
c. Set the Text property of the boxes to "" and the Alignment property of
the labels to 1.
d. Add an Action_preload and correct the execution order so it takes
place before Fom1.
e. In the Presentations Property dialog box link the presentation to the
Meta4Object named CMP_M4O_COSTS. Set the following properties:
n Idchannel = CMP_M4O_COSTS
n Idnode = ROOT
f. Now link each textbox with the corresponding Meta4Object item. The
following table will help you.
Figure 60. Presentation design
108
g. Save your presentation an preview it. You should see the following
screen.
Control Iditem
Textbox1 ID_COURSE
Textbox2 DT_START
Textbox3 DT_END
Textbox4 N_COURSE
Textbox5 ID_PAY_TYPE
Textbox6 CMP_DD_BB
Textbox7 CMP_EX_KN
Textbox8 CMP_LANGUAGES
Textbox9 CMP_HH_RR
Textbox10 CMP_PREVIOUS
Figure 61. Presentation preview
Connecting to Meta4Objects 109
Text property. Multi language options. Hard coded text vs. data
bound text.
Obviously a label saying Label1 results meaningless in a final screen. The
text property of each label should be changed.
To which value? You have already changed the text property and used the
possibility of multi language values. Connecting to Meta4Objects enlarges
this multi language facility.
Meta Data accepts being translated into different languages, that is the
translated values are stored in the data base. There is a way to use the value
of a meta data and leave it variable so when connecting in one language or
another the presentation will display the value in the corresponding
language.
The following table reflects the way to refer to the value of a certain meta
data in the presentation.
For instance, setting the Text property of Label1 as:
Text = ##TM[ID_COURSE]
will assign the corresponding Item name value to the label.
Do the following exercise:
Exercise
a. Change the text property of all the labels to the following values:
Meta4Object name ##CHNNL[Meta4Objects ID]
Node name ##ND[Nodes ID]
Item name ##TM[Item ID]
Control Text
Label1 ##TM[ID_COURSE]
Label2 ##TM[DT_START]
Label3 ##TM[DT_END]
Label4 ##TM[N_COURSE]
Label5 ##TM[ID_PAY_TYPE]
Label6 ##TM[CMP_DD_BB]
Label7 ##TM[CMP_EX_KN]
Label8 ##TM[CMP_LANGUAGES]
110
b. Save your presentation. You can see in the design how labels have
taken the corresponding value of the data name.
c. Change the language from English to Spanish in the status bar, as you
did in previous lessons. Notice how the labels change their text from
english to spanish.
The great advantage of this value assignment is obvious, you no longer
need to insert language options in a hard coded way. This sort of soft
coded value assignment will do it for you!.
Notice the big difference between this multi language option and the one
used in Lesson 4. You deal here with data base data. The name of a menu
option is not data base data, and therefore you need the method used in
Lesson 4.
Toolbar navigation buttons. First approach.
Your simple Meta4Object has been loaded and the first record is to be seen
on the screen. The next step is to be able to change the record.
This is commonly done by means of a toolbar button with a suitable action
linked to it. The following table summarizes the images and actions that
typically implement this functionality. Of course the value given to the
Image property is meaningless for this purpose.
Label9 ##TM[CMP_HH_RR]
Label10 ##TM[CMP_PREVIOUS]
Image Action Meaning
First Moves to the first record of the block loaded
in the node
Last Moves to the last record of the block loaded
in the node
Next Moves to the next record of the block loaded
in the node
Previous Moves to the previous record of the block
loaded in the node
Control Text
Connecting to Meta4Objects 111
To practice, we suggest that you do the following exercise:
Exercise
a. Add a toolbar and the four navigation buttons. Assign them the
corresponding actions. Tip: you can use the Duplicate option...
b. Save your presentation as: CXX_EXAMPLE_5_4_PARENT.
c. Preview your presentation.
d. Test the navigation buttons.
Multinode Meta4Objects.
The Meta4Object you are dealing with has a child node whose records are
loaded when the root record is loaded
4
. You will now add the possibility of
viewing the child node records.
You will do it in a different number of ways.
The easiest way is to devote a certain area of the present form to textboxes
and labels linked to the child node. In order to organize your presentation
you will insert parent related controls into a scrollpanel and child related
controls in a second scrollpanel.
Please follow the steps:
Exercise
a. Save the CXX_EXAMPLE_5_4_PARENT presentation as
CXX_EXAMPLE_5_5_CHILD1.
b. Add two scrollpanels to Form1. Place the controls related to the parent
node in the top scrollpanel. Insert the necessary text boxes and labels
for the child node into the second scrollpanel. The following tables will
help you linking these new text boxes and labels to the corresponding
items. BE AWARE of the Idnode property of each scrollpanel!
4. Nodes are connected in R-B mode and LOAD PRG methods are linked with Autoload =
off
Control Iditem
Textbox11 DT_START
Textbox12 ID_COSTS
Textbox13 ID_COURSE
Textbox14 N_COSTS
112
c. Add the required navigation buttons to see child records in
Scrollpanel2. The following figure depicts a preview of the
presentation, if done correctly.
d. Save and preview your presentation.
Introducing the Record Insert Wizard
When building up presentations that connect with Meta4Objects without
making use of the Default Frontend Wizard it turns out that most of the
times what you want for your end user interface is more or less routinely
designed.
Control Text
Label11 ##TM[DT_START]
Label12 ##TM[ID_COSTS]
Label13 ##TM[ID_COURSE]
Label14 ##TM[N_COSTS]
Figure 62. Presentation with scrollpanels
Connecting to Meta4Objects 113
Usually you will need a textbox for displaying a given item value, thus you
will insert a textbox control, and set its text property to "".
Then you will chose the Meta4Objects ID for the textbox Idchannel, a
certain node for Idnode and the items ID for the Iditem property.
Most likely you will add a label, with its text property set to
"##TM[ID_ITEM]", and Alignment = 1 so the text is right aligned.
It can happen that the item you want to include needs additional controls, as
e.g. a date, where you will probably have to enable the date selection by
means of the ways explained along the course.
All these steps are repeated each time a new item is added in a form. Time
and effort are saved by the integration of the Default Frontend in the
Frontend Designer.
Default Frontend integration enables the use of an extremely well
programmed Wizard for inserting controls. You will choose which item
from which Meta4Object you want to include in your design. According to
the underlying data definition of the item this sub-wizard will perform all
the steps to include the items related components you would expect to
appear in a Default Frontend presentation. Here is a guided exercise to
show this powerful utility.
In this exercise you will design a form that will display some fields
included in the Meta4Object you are working with throughout this lesson.
(CMP_M4O_COSTS). In particular you will insert controls for the
following items:
114
Complete now the steps of the following guided exercise:
Figure 63. CMP_M4O_COSTS II
Connecting to Meta4Objects 115
a. Create a new presentation and right
click Form1. A pop-up menu will
appear.
b. Select the Record Insert Wizard
option from the pop-up menu. This
option starts the wizard.
c. Select the Meta4Object that contains
the items for which you want to create
controls in your presentation. This
Meta4Object is CMP_M4O_COSTS
d. Select the DT_START item from
CMP_ROOT_COURSES.
116
Action_value
n Action_value: Syntax
BEGIN Action_value MyActionValue1
Dialog = "PropertyValue"
Inputvalue = "ValueToAppearInTheDialog"
Outputvalue = "ItemToRecieveTheDialogsValue"
END
This control displays a dialog showing a calendar, a calendar with a clock
or a calculator. The specific kind of dialog is set through the Dialog
property, which can have the following values:
e. The wizard finds out what kind of item
is it going to deal with, i.e. whether it is
a method, a column containing a date or
a combo-like column... This
information will lead to different
constructions in terms of presentation
objects (Calendar buttons, enabled or
disabled textboxes, and so on...). When
the wizard has found out what kind of
controls would be used in a default
presentation to show this item, a dialog
listing those presentation objects is
displayed. In your example the wizard
displays the construction: Label +
Textbox + Button.
f. Click the Next button.
Dialog property values Meaning
Dialog = "Date" Displays a calendar
Dialog = "Datetime" Displays a calendar and a clock
Dialog = "Numeric" Displays a calculator
Connecting to Meta4Objects 117
Parameters can be transferred from the presentation to the dialog and from
the dialog to the presentation using the properties Inputvalue and
Outputvalue. The first one transfers the parameter value from the
presentation to the dialog. The second one has to be one item that, after
clicking the dialogs OK button, will receive the value chosen in the dialog.
This component also has the Onok and Oncancel properties.
Do the following exercise:
Exercise
a. Add a calendar button to the presentation
CXX_EXAMPLE_5_5_CHILD1 for the field containing dates. Use
Action_values properties to enable the selection of the date in the
dialog and pass its value to the field.
b. Save and preview your presentation.
Action_list
n Action_list: Syntax.
BEGIN Action_list MyActionList1
BEGIN Listcolumn Listcolumn1
Iditem = "ItemToBeListed1"
Text = "Colum1Title"
END
...............
BEGIN Listcolumn ListcolumnN
Iditem = "ItemToBeListedN"
Text = "ColumNTitle"
END
END
This control opens a List dialog. The columns are set by inserting
Listcolumn controls and linking the Iditem data property to the items you
want to be included in the column.
This component also has Onok and Oncancel properties.
118
Exercise
a. Add a button in CXX_EXAMPLE_5_5_CHILD1 presentation. Make it
work as follows: when clicking on the button a List dialog with
DT_START and ID_COURSE fields must be displayed.
b. Save and preview your presentation.
Patternbox
n Patternbox: Syntax.
BEGIN Patternbox MyPattern
Pattern = "[#Meta4ObjectItem1] Any Character... [#Meta4ObjectItemN]"
END
This control displays in run time the value of the Meta4Object element(s)
that are given in the property Pattern.
Specific patterns will be discussed in later sections. References to pattern
objects usually begin with the string *D*, but this string is not mandatory.
Do the following exercise:
Exercise
a. Add a patternbox in CXX_EXAMPLE_5_5_CHILD1 presentation
showing the Meta4Objects name (#Idchannel).
b. Save and preview your presentation.
Nodestatus
n Nodestatus: Syntax
BEGIN Nodestatus MyNodestatus
Idchannel = "MyChannel"
Idnode = "MyNode"
END
This component appears as an icon in the presentation. In run time it
represents graphically the status of the current record in the node it is linked
to.
Connecting to Meta4Objects 119
The following table shows the meaning of the different icons.
Table
Here you will be presented a control designed to allow a massive view of
the records in a block, the so called Table control.
n Table: Syntax.
BEGIN Table MyTable
Insert the components to be seen inside the table (Column, Textbox,...)
END
Suppose that you want to implement a presentation like the one done before
but instead of navigating in a sequential way, you want the whole child
block to be displayed as a table. Please follow the steps to achieve that
functionality:
Exercise
a. Open the CXX_EXAMPLE_5_4 _PARENT presentation and save it as
CXX_EXAMPLE_5_6_CHILD2.
b. Insert a scrollpanel for the parent-linked objects and a second
scrollpanel for the child objects (this second scrollpanel is empty in this
moment). The following figure shows the Explorer Tree and the form
at this step. Remember to link Scrollpanel2 to the child node.
Icon Meaning
Record loaded in the node
New record in the node
Modified record in the node
Deleted record in the node
120
a. Insert a Table control in Scrollpanel2.
b. Set the Align property of Table1 to All.
c. The child node has four fields. Add a textbox for each field and link it
with the corresponding Meta4Object item.
d. Save and preview your presentation. The following figure shows this
presentation in design time. The Scrollpanel1s are not expanded in the
tree for space reasons.
Figure 64. Presentation with a table control I
Figure 65. Presentation with a table control II
Connecting to Meta4Objects 121
Further steps on data related Actions and Toolbarbuttons
A number of actions have been programmed in order to implement the
possibility of working with records from a presentation. The following
table lists some of them along with the usual image associated.
To practice, do the following exercise:
Exercise
a. Open the CXX_EXAMPLE_5_6 _CHILD2 presentation.
b. Add a toolbarbutton in Scrollpanel1 for inserting new records and
another for saving changes.
c. Save and test your presentation.
d. Insert a new record.
Image Action Meaning
Removefilters Removes the active RAM filter if any
Delete Deletes the present record
Undo Undoes the last action
Copy Copies to the clipboard
New Generates a new record
Paste Pastes from the clipboard
Reload Reloads
Save Saves
Find Open the Find dialog box
Filters Shows active RAM filters
Cut Cuts and copies the contents in the
clipboard
122
Toolbar groups
Instead of adding each button an the related action the Designer Tool offers
several Toolbars that group buttons with actions already programmed. This
simplifies the presentation design at the cost of having less control and
flexibility over the behavior of the mentioned Toolbars. Table 5.X shows
the available Toolbar groups.
To practice, do the following exercise:
Exercise
a. Add a Toolbar and a Datagroup to the
CXX_EXAMPLE_5_6_CHILD2. You must add this Toolbar inside
Scrollpanel2. Thus, make the corresponding changes in the Height
property of Table1.
b. Save and test your presentation.
c. Add new child records to the new parent record created in a previous.
Save changes.
Image Name Meaning
Datagroup New, Delete, Undo, List,
Show/Remove Filter, Find
Editgroup Cut, Copy and Paste
Connecting to Meta4Objects 123
The figure above shows the presentation in runtime.
Advanced data related Actions - Use of Action_call -
Action_dataprops
You can always implement a certain functionality in a Toolbarbutton by
invoking a certain method through an Action_call action. Here is an
example.
n Action_call. Example. Printing a form.
BEGIN Toolbarbutton MyPrintButton
Image = "#Print"
BEGIN Evclick EvClick1
BEGIN Action_call Print
Sentence = "*O*/MyFormReference.Print"
END
END
END
Figure 66. Presentation with a table control: preview
124
There is also an action provided by the Frontend Designer that enables the
execution of a great deal of actions and includes properties that add certain
logic to the process that will take place when the action is executed. This
control is called Action_dataprops.
n Action_dataprops: Syntax.
BEGIN Action_dataprops MyDataprops
. (Specific properties)
END
Useful properties of Action_datprops are listed in the following table.
Example. Adding a Toolbarbutton that reloads the Meta4Object:
BEGIN Toolbarbutton MyToolBarButton
Image = "#Reload"
BEGIN Evclick Evclick1
BEGIN Action_dataprops MyDataprops
Reload = True
END
END
END
Example. Executing a certain method defined in the Meta4Object:
BEGIN Action_dataprops MyDataprops
Property Meaning
Action Name of the specific action to be executed
Actionifinvalidpos Name of the action to be executed in case position is
not valid
Actionifvalidpos Name of the action to be executed in case positions is
valid
Load When set to TRUE it loads the Meta4Object. On
False it does not load the Meta4Object
Reload When set to TRUE it reloads the Meta4Object. On
False it does not reload the Meta4Object
Unload When set to TRUE it unloads the Meta4Object. On
False it does not unload the Meta4Object
Connecting to Meta4Objects 125
Idchannel = "MyChannel"
Idnode = "MyNodel"
Iditem = "MyItemMETHODl"
Action = Execute
END
Action_method
In case you want to execute a method defined in a Meta4Object the
component Action_method enables its execution
5
.
Action_method has a number of properties that enable a bi-directional
dialog between the Presentation and the Meta4Object. Here is an example
that will show you how to send values from a presentation to the method,
and how to collect a value returned by the method (if any) in the
presentation.
In this example we will work over the XMP_METHODS Meta4Object
where a record-scope method has been defined with two varstring-type
arguments. The method is depicted in the following figure:
This method will concatenate the string in XMP_ARG_1_METH_1 with
the string in XMP_ARG_2_METH_1 and return the concatenated string.
What we will do in this example is design a presentation where the value of
XMP_ARG_1_METH_1 and XMP_ARG_2_METH_1 is established by
the end user in run time. Then the execution of the method will be triggered
through an Action_method, and the returned string will be shown in a
textbox.
The design of the presentation is shown in the following figure:
5. Executing a method in a given Meta4Object can also be achieved with
Action_dataprops. The property Action can get the values Execute and
Executewithoutparameters. This triggers the execution of the method specified in the
Iditem property of Action_dataprops.
Figure 67. Rule
126
Notice that Action_method has been inserted into Evclick1. To enable the
execution of the XMP_METH_1_1 method, the data properties of
Action_method have to be set to:
The property Sourceargs is where you must specify the identifier of the
method arguments in the Meta4Object, separated by commas. Thus:
The presentation will assign a value to those arguments, and the property
Sourceobjs is where you establish which presentation object is the one
containing the value you want to assign to each argument. In our example:
Notice that they have to obey the same sequence than Sourceargs, and they
are also separated by commas. In a certain way, these properties enable the
dialog between the presentation and the Meta4Object.
Figure 68. Presentation with Action_method
Idchannel XMP_METHODS
Idnode XMP_ROOT_METH
Iditem XMP_METH_1
Sourceargs XMP_ARG_1_METH_1,XMP_
ARG_2_METH_1
Sourceobjs *O*.../Textbox1.Text,*O*.../
Textbox2.Text
Connecting to Meta4Objects 127
Now where to write the result of the method execution has yet to be
established. This is done through the Returnobj property. In our example:
The complete OBL code for the Action_method component would then
be:
BEGIN Action_method Action_method1
Idchannel = "XMP_METHODS"
Idnode = "XMP_ROOT_METH"
Iditem = "XMP_METH_1_1"
Sourceargs = "XMP_ARG_1_METH_1,XMP_ARG_2_METH_1"
Sourceobjs = "*O*..../ Textbox1.Text,*O..../Textbox2.Text"
Returnobj = "*O*.../Form1/Textbox3.Text"
END
Action_bp
Any task designed with the Task Designer tool can be invoked from a
presentation through the component Action_bp. All you need is the Task
Identifier. This must be the value of the Idbp property of the Action_bp.
This is the complete syntax:
BEGIN Action_bp Action_bp1
Figure 69. Source objects and source arguments
Returnobj *O*.../Textbox3.Text
Presentation
Textbox1.Text
Textbox2.Text
Method
XMP_ARG_1_METH_1
XMP_ARG_2_METH_1
Sourceobjs
Sourceargs
128
Idpb = "IdentifierOfTheTaskYouWantToExecute"
END
Using Split controls
Just to add a certain amount of ergonomy to the presentation you have just
designed, you will now insert the parent-related scrollpanel in the upper
block of a splittvertical control, and the child-related scrollpanel in the
lower block. The following figure illustrates the idea.
Save this presentation as CXX_EXAMPLE_5_7_CHILD3.
Mimic control
In the CXX_EXAMPLE_5_5_CHILD1 presentation you displayed child
records as a form, i.e., in a sequential way. In the
CXX_EXAMPLE_5_6_CHILD2 you used a table control to show
massively the same information.
It is a common requirement to enable the end user to choose between those
to view of displaying information in run time. The designer tool introduces
the Mimic control to enable this kind of functionality.
n Mimic: Syntax
BEGIN Mimic MyMimic1
....
Class = "InitialClassToBeEmulated"
...
END
Figure 70. Split controls
Connecting to Meta4Objects 129
The Mimic control acts as a class emulator. The class it emulates is defined
through the Class property, which can take the values Scrollpanel to
imitate a form, and Table to imitate a table.
It should be mentioned that a Mimic control does not emulate the methods
of the above mentioned classes. In fact, this control supports only the Class
method, which is enables you to change the mimic class in run time. The
access to the Class method is achieved through the use of an Action_call
component.
n Syntax
BEGIN Action_call ChangeMimicClass
Sentence = "*O*MyMimic1Path.Class(TheClassYouWantToChangeTo)"
END
Thus this change from Form to Table in run time requires:
a. To use a mimic control as a container for the node related objects.
b. To use an Action_call invoking the Class method.
You will learn how to use the mimic control through the following exercise.
In this exercise you will enable a class change in the child node. Steps
would be the same in case you wanted to add a mimic control in the parent
block.
Exercise
a. Open the CXX_EXAMPLE_5_5_CHILD1 presentation and save it as
CXX_EXAMPLE_5_7 _CHILD4.
b. Insert a Mimic control in Scrollpanel2 and place all the child objects
(Label11 to Label14, Textbox11 to Textbox14 and the navigation
buttons) in it.
c. Open the mimics OBL code and add the following line:
Class = "Scrollpanel"
d. Save and test your presentation.
e. Add two buttons to Scrollpanel2 with the following functionality:
n When Form1 is displayed in run time the button Form must be
disabled
6
.
6. The property Class of the mimic control has been set to Scrollpanel, thus it results
meaningless to allow the user to change again to the same class.
130
n When clicking the button Table, the mimic class must change to
Table, the button Form must be enabled and the button Table must
be disabled.
n When clicking on the button Form, the mimic class must change to
Scrollpanel, the button Form must be disabled and the button
Table must be enabled.
5.2.17 Back to changers
You have already dealt with changers in lesson 4. The next exercise will
show you how to use a changer when multinode Meta4Objects are at play.
Changers (lesson 4) established different visual levels. The idea is to use
one level of the changer to display the parent nodes data and another level
for the child node.
Exercise
a. Open the CXX_EXAMPLE_5_4_PARENT presentation and save it as
CXX_EXAMPLE_5_8 _CHILD5.
b. Insert a changer in Form1 and insert all the controls shown in the
figure below inside a Tabstrip. Tip: Use the OBL editor and the copy
& paste technique. Adjust the sizes of the controls when necessary.
Figure 71. Presentation with a mimic control
Connecting to Meta4Objects 131
c. Add a second Tabstrip control to the changer, and insert labels and text
boxes to be linked to the child node items.
d. BE AWARE OF THE CORRECT VALUE OF PROPERTY Idnode
FOR YOU WANT TO INSERT CONTROLS LINKED TO THE
CHILDS NODE INTO Tab1 of Tabstrip2.
e. Insert a Splitthorizontal control in Form1 and again insert the changer
inside Splittblock2 (Tip: Use the OBL editor and the copy & paste
technique). Add a Tree to Splittblock1 and implement the
corresponding nodes, events and actions so that changes in the changer
are controlled through the tree.
f. Add the necessary navigation buttons in Tab1 of Tabstrip2 in order to
enable the navigation through the child node.
Action_script, Checkbox and Checkboxgroup
Action_script
You can execute LN4 code typed in the presentation using Action_script.
n Action_script: Syntax.
BEGIN Action_script MyLN4Script
Idchannel = "MyChannel"
Idnode = "MyNode"
Figure 72. Presentation with a changer
132
Sourcenames = "MyLN4Variable1,...MyLN4VariableN"
Sourceojbects =
"[ValueForMyLN4Variable1],...[ValueForMyLN4VariableN]"
Code = "LN4Code(MyLN4Variable1,...MyLN4VariableN)"
END
This action has Onfalse and Ontrue properties that can be used as
conditionals.
The LN4 code is neither checked nor executed inside the presentation. In
fact, to execute LN4 code, a Meta4Object node has to be assigned in the
Action_script data properties thus Idchannel and Idnode become
mandatory
7
.
Exercise
a. Open the CXX_EXAMPLE_5_4_PARENT presentation and save it as
CXX_EXAMPLE_5_4_SCRIPT.
b. Build the following functionality:
n When the value of the field in Textbox7 (linked to CMP_EX_KN)
is validated two cases are distinguished:
n Case 1: the value is "1". Then a message box saying "Value is 1"
appears.
n Case 2: the value is not "1". Then a message box saying "Not 1
value" appears.
HINTS: use the following LN4 code:
Code = "if EK="1" then return(1) else return(0)"
c. Where EK is the name of a LN4 variable.
Checkbox control
n Checkbox control: Syntax.
BEGIN Checkbox MyCheckbox
Truevalue = ""
Falsevalue = ""
Value = ""
END
7. We shall make use of the system method called ExecuteLN4JIT.
Connecting to Meta4Objects 133
Truevalue, Falsevalue and Value properties are not mandatory.
Checkboxes can behave in different ways depending on whether or not this
properties are being used.
Value = 0 means unchecked and Value = 1 means checked.
It can contain the Evvalidate event, triggered when checking and
unchecking the checkbox.
Exercise
a. Open the CXX_EXAMPLE_5_4_SCRIPT presentation and save it as
CXX_EXAMPLE_5_4_CHECK.
b. Add a checkbox with the following functionality:
n When the checkbox is checked a messagebox saying "I am
checked" will appear.
n When unchecked, the message "Not checked now" will be
displayed.
If a checkbox is linked to a Meta4Object item, Truevalue and Falsevalue
properties can be used in order to choose between these two values, which
will be transferred to the Item.
BEGIN Checkbox MyCheckbox
Idchannel = "MyChannel"
Idnode = "MyNode"
Iditem = "MyItem"
Truevalue = "True"
Falsevalue ="False"
END
When a checkbox has been linked to an item and Truevalue and
Falsevalue have been assigned a non null value (True and False in our
example) the following processes take place:
n When reading a record: if the value of MyItem is equal to True,
the checkbox appears checked. If it is equal to False it will be
unchecked.
n When writing in a record (either new or being modified) checking
the checkbox assigns the value True to MyItem. Leaving the
checkbox unchecked assigns the value False to MyItem.
134
Exercise
a. Add a groupbox control and reorganize the labels and textboxes as in
the following figure. Add checkboxes where indicated by the figure.
b. The check boxes in Groupbox1 must reflect whether the related
Extended Knowledge is required or not. The Needed Extended
Knowledge Checkbox must enable/disable Groupbox1.
c. Add also a New button for the insertion of new records.
d. Save and test the presentation.
Listgroup
In a number of cases the data model underlying a Meta4Object that is
loaded in a presentation shows relations between the tables it contains. This
is the case of the data model we have used, where table CMP_PAY_TYPES
is related to table CMP_TB_COURSES through the element
ID_PAY_TYPE.
You have learned in previous courses that in such cases the table
CMP_PAY_TYPES can act as an auxiliary table for the table
Figure 73. Presentation with a groupbox
Connecting to Meta4Objects 135
CMP_TB_COURSES. Generally a single-node Meta4Object is created for
each auxiliary table with the help of the Data Model Designer Wizard
8
.
In such cases it turns out to be extremely useful to reflect such relations into
the presentation enabling a number of operations that exploit the fact that
an auxiliary table has been included in the data model.
It is the aim of this section to show you how to implement a List/Validate
group (ZLG) in your presentation. You do this with the Listgroup control.
The basic functional schema of what you shall implement in the
presentation is shown in the following figure.
Bear in mind that the final goal of an auxiliary table is to:
n confront the values given to a certain table item with the values
already contained in a second table (the auxiliary table), which
includes validating those values and/or listing the records of the
second table.
n enable the insertion of new records in the auxiliary table.
n enable a fast zoom to the record in the auxiliary table.
Notice that a ZLG requires working with three different Meta4Objects:
n The multinode Meta4Object (in our example
CMP_M4O_COSTS).
n The List/Validate Meta4Object created for the table
CMP_PAY_TYPES
9
.
8. Remember the steps followed when generating the single-node Meta4Objects.
Figure 74. Elements of the Zoom List Group
9. Both the Track and Maintenance Meta4Objects were created using the DMD Wizard.
Label TextboxW TextboxL1 TextboxLN
...
Evclick to the maintenance
Meta4Object presentation
Evdbclick to the track
Meta4Object presentation
Evvalidate validating the
TextboxW.Text value
Evdbclick validating the
TextboxLi.Text value
against the table.
Evclick to the track
M4Object presentation
136
n The maintenance Meta4Object created for the table
CMP_PAY_TYPES.
A number of specific methods (List, Validate, Zoom...) that implement the
functionality described are programmed by the DMD Meta4Object Wizard
as methods of the Track and Maintenance Meta4Objects. You will learn
how to invoke those methods in order to build a ZLG. Notice that the
methods List and Validate are included in the Track Meta4Object while
the Zoom method is included in the Maintenance Meta4Object.
A ZLG also implies rising the presentations of the track or maintenance
Meta4Objects depending on the case. And, above all, it implies a certain
information flow. In this last sense you will deal with an origin and a
destination of information.
The Listgroup control will help you in creating this sort of functionality. It
is by far one of the most complicated controls in the designer tool and a
deep understanding is out of our present reach. Here you will be given
some basic hints in order to be able to create a ZLG disregarding the
Frontend Designers wizard.
Please follow the steps:
a. Open the presentation CXX_EXAMPLE_5_8 _CHILD5 and save it as
CMP_EXAMPLE_LVG.
Figure 75. Track and Maintenance Meta4Objects
Connecting to Meta4Objects 137
b. Notice that tables CMP_PAY_TYPES and CMP_TB_COURSES are
connected through the column ID_PAY_TYPE. This column is
represented by the field item ID_PAY_TYPE in the Meta4Object we
are dealing with (CMP_M40_COSTS).
c. Thus the ZLG must be constructed as:
d. Add the necessary changes to get the visual design shown in the figure
above. Use Image = #List for the list button.
e. Add the necessary events in each control. The following table will help
you.
f. Save your presentation.
Structure of the Listgroup control - The Function control
You have just prepared the visual components of the ZLG. Now you will
learn where to give the parameters for enabling the ZLG functionality by
means of the Listgroup control.
This control will act as the bridge between the already mentioned
Meta4Objects. Parameters for this communication are passed through a
number of properties.
n Listgroup: Syntax
BEGIN Listgroup MyListgroup
Idchannel = "Meta4ObjectOrigin"
Figure 76. The Zoom List Group
Presentation object Events to be inserted
Evclick
Evdbclick
Evvalidate
Evdbclick
Evclick
138
Idnode = "NodeOrigin"
Iditem = "ItemOrigin"
Watchobject = "PresentationObjec.BooleanProperty"
BEGIN Function MyFunction1
.
END
BEGIN Function MyFunction2
.
END

END
g. Insert a Listgroup control in Tab1 of Tabstrip1.
The Listgroup control includes a first block of data properties (data header
in the OBL code listed above). This block must identify the item around
which the ZLG is going to be built. In our example ID_PAY_TYPE.
Listgroup properties include one which plays a mayor role, the
Watchobject. Remember we shall create a ZLG around a certain item (in
our example ID_PAY_TYPE). This item's value is to be seen through a
certain presentation control, most typically a textbox like TextboxW in the
figure, i.e. a certain presentation object is receiving the value of the item
acting as the keystone of the whole ZLG.
The whole TextboxW.Visible construction is called the Watchobject.
When the Visible property of the Watchobject is set to True validations are
enabled.
Then a number of blocks are defined, each of them collecting the necessary
data for implementing the Zoom, the List, the Validate and the Clear
functionality. Each one of this blocks is an event-like component called
Function. Thus you will distinguish:
n Function List
n Function Zoom
n Function Validate
n Function Clear
At least one Function component is mandatory inside a Listgroup.
Opening the property dialog of a Listgroup control will display a number of
tabs that will help you systematize all the information required by the
Connecting to Meta4Objects 139
Listgroup control.
h. Open the property dialog of Listgroup1.
General properties of Listgroup
Data properties of the Listgroup control must reflect the fact that we are
dealing with that special Meta4Object item (in our example
ID_PAY_TYPE), thus they must be assigned a non null value that
particularizes up to the item itself.
i. Inside the dialog of Listgroup1, set the data properties to their
corresponding value. The following figure will help you.
j. Write the path reference of the Watchobject in the corresponding
textbox. Remember to give the reference and the property whose
boolean value will enable or disable validations.
*O*../Textbox5.Visible
Figure 77. General Properties of the Listgroup control
140
In this General tab the three Meta4Objects you will deal with have to be
identified. The central one is already included in the General Props frame.
The second frame will collect data about the Meta4Object invoked for the
List and Validate methods.
The third frame copes with the Meta4Object containing the Zoom method.
k. Identify each Meta4Object.
l. Give the required parameters for the List Meta4Object and the Zoom
Meta4Object frames.
Function properties
Up to now you have just begun with the basic aspects of a ZLG
construction. To get on with the following steps giving a thought on what
you are doing with all this Meta4Objects and methods becomes necessary.
The following discussion will be focused on the Validate Function for. At
the end of this section the other Function blocks will be explained.
Refer to the figure above when needed. The Alias is written belowbelow
each control for guidance. The following figure shows the records in the
Track Meta4Object, i.e. the records of table CMP_PAY_TYPES.
Passing data Part I - Mainargs and Mainobjs
n What happens when a new value is written in Textbox5?. It was stated
above that when loosing focus the Evvalidate comes into stage
triggering the following process:
Figure 78. Zoom List Group II
Figure 79. Records in the Track Meta4Object
Label5 Textbox5 Textbox15 Button1
Connecting to Meta4Objects 141
1. What is written inside Textbox5 must be validated against the table
of the Track Meta4Object.
2. In case validation is correct then the Track Meta4Object must send
back the value to be displayed in Textbox15.
3. For simplicity the not validate case will be discussed later on.
n In terms of presentations and Meta4Object:
1. you have to pass the value of *D*ID_PAY_TYPE (what is written
in Textbox5) to the track Meta4Object.
2. the track Meta4Object must receive the *D*ID_PAY_TYPE
value and run its Validate method.
This information flow has to be done using some argument of the track
Meta4Object. Remember this track Meta4Object was generated by the
DMD Wizard. This extremely well programmed tool defines the
parameters needed in the List, Validate and Zoom methods as the column
name preceded by the string ARG_ string. Thus, in your example, an
argument called ARG_ID_PAY_TYPE has been defined by the DMD
Wizard both in the Track and in the Maintenance Meta4Objects.
In a certain way what is needed here is a sort of assignment of the kind:
10
ARG_ID_PAY_TYPE=*D*ID_PAY_TYPE
Remember that, in this example, as we are dealing with TR and MT
Meta4Objects generated by the DMD wizard the name of the argument to
be used by all the methods in TR and MT Meta4Objects we shall invoke is
the same.
Now the question is how to make the
ARG_ID_PAY_TYPE=*D*ID_PAY_TYPE assignment. And here again,
we can use the Listgroup dialog.
Click the Source Data button in the Listgroup General Props property
dialog and write the corresponding data as stated in the following figure. To
enable the insertion you must click the + symbol at the right border of the
Source Data dialog.
10. WARNING: This is NOT to be understood in terms of a proper syntax use. This would
be a completely invalid sentence.
142
Notice that this is a General Property of the Listgroup control, thus this
assignment can be used by this control independent of which Meta4Object
you want to pass *D*ID_PAY_TYPE to.
Passing data Part II - Targetitems and Targetobjs
Now, you have just enabled the passing of values between the origin
Meta4Object (in your example CMP_M4O_COSTS2) and the TR and MT
Meta4Objects. Lets go on with further steps.
m. The Track Meta4Object executes the Validate method. If the
ARG_ID_PAY_TYPE is validated against table CMP_PAY_TYPE, the
method returns the value of all fields in the record with the Position in
list property different from zero. In your example the column
N_PAY_TYPE has Position in List = 2. So this has to travel back from
the Track Meta4Object to the presentation where the Listgroup is
included.
How do these values travel back to your presentation?. Generally speaking,
what you need now is another assignment but this time the value sent by
the track Meta4Object will be received by a presentation object. From now
on, a so called Targetitem (the one coming from the Track) passes its value
to a so called Targetobject (the presentation component where the
Targetitems value is to be written).
This assignment has to be stated inside each Function tab.
You are dealing with the Validate Function in the example, so open the
Validate function tab as shown in the figure below.
The value of N_PAY_TYPE for a given record has to be collected in the
presentation.
Figure 80. Source data properties
Connecting to Meta4Objects 143
Which object in the presentation is the one receiving the value sent by the
Validate method? Look at the figure above, Textbox15 (what is somewhere
called a virtual field) is the object. Its property.Text is the one that can get
the N_PAY_TYPE value. Thus, in terms of this assignment you would
have something like:
11
*O*/Presentation/Form1/Textbox15.Text = N_PAY_TYPE
This is what you state in the Validate tab. Just remember:
This would establish the parameters for the Validate Function block.
Here are some comments on the rest of the Function blocks defined in
Listgroup control.
Figure 81. Validate Tab
11. AGAIN: This is not to be understood in terms of a proper syntax use. This would be a
completely invalid sentence.
Targetobject Targetitem
*O*/Presentation/Form1/
Textbox15.Text
N_PAY_TYPE
144
Function Zoom
This Function invokes the Zoom method in the Maintenance Meta4Object
when clicking on Label1. It must display the Maintenance presentation
built over the MT Meta4Object, but show only the record corresponding to
the *D*ID_PAY_TYPE (passed by the Source Data assignment). No data
returns from the MT Meta4Object thus, the Function Zoom tab would be as
shown in the following figure.
Function Clear
In this case the text property of the virtual fields in the presentation have to
be cleared, thus, in your example, you would have:
Figure 82. Zoom tab
Figure 83. Clear tab
Connecting to Meta4Objects 145
Function List
Function List has to be ready to receive the value of the columns of the
record selected in the List Meta4Objects presentation that have the
property Position in List different from zero, included the one
corresponding to the *D*ID_PAY_TYPE column.
In our example:
Now, the Listgroup control is ready to be invoked from the controls of our
presentation.
Invoking the Functions in the Listgroup Control
Now you will finally implement the whole ZLG functionality.
Figure 84. Function list tab
146
To begin with, every control that will be used to invoke one of the
Listgroup Functions has got to have the following property values:
n Idchannel = "MyChannel"
n Idnode = "MyNode"
n Iditem = Depends on the control
n Dependson = "*D*ThePresentationItem"
In our example:
n Idchannel = "CMP_M4O_COSTS2"
n Idnode = "COURSES"
n Iditem = Depends on the control
n Dependson = "*D*ID_PAY_TYPE"
We list the OBL code inside each control.
Label
You need the Function Zoom when clicking. Thus:
BEGIN Label Label5
Idchannel = "CMP_M40_COSTS2"
Idnode = "COURSES"
Dependson = "ID_PAY_TYPE"
Text = "##TM[ID_PAY_TYPE]"
BEGIN Evclick ToZoom
BEGIN Action_call CallZoom
Sentence = "*O*../../../Listgroup1.Zoom"
END
END
END
Connecting to Meta4Objects 147
Textbox (non virtual fields)
Refer to the figure that shows you the structure of the CMP_M40_COST2
to remind yourself of the functionality you want to build from this object.
Double click must trigger the List Function, and Evvalidate the Function
Zoom.
BEGIN Textbox Textbox5
Idchannel = "CMP_M40_COSTS2"
Idnode = "COURSES"
Iditem = "ID_PAY_TYPE"
Dependson = "ID_PAY_TYPE"
Collabel = "##TM[ID_PAY_TYPE]"
BEGIN Evvalidate ToValidate
BEGIN Action_call ToValidate
Sentence = "*O*../../../Listgroup1.Validate"
END
END
BEGIN Evdblclick ToList
BEGIN Action_call ToList
Sentence = "*O*../../../Listgroup1.List"
END
END
END
Textbox (virtual fields)
When double clicking it call the Validate Function.
BEGIN Textbox Textbox15
Idchannel = "CMP_M40_COSTS2"
Idnode = "COURSES"
Editable = False
Dependson = "ID_PAY_TYPE"
BEGIN Evdblclick ToValidate2
148
BEGIN Action_call ToValidate2
Sentence = "*O*../../../Listgroup1.Validate"
END
END
END
List button
You will invoke the List Function:
BEGIN Button Button1
Idchannel = "CMP_M40_COSTS2"
Idnode = "COURSES"
Iditem = "ID_PAY_TYPE"
Image = "#List"
BEGIN Evclick ToList2
BEGIN Action_call ToList2
Sentence = "*O*../../../Listgroup1.List"
END
END
END
Advanced properties of the ZLG
By default, the presentations raised for the Track and Maintenance
Meta4Objects are:
Track Meta4Object
n Its presentation is generated in run time so you dont need to create
a presentation for this Meta4Object.
n If you need to raise a specific presentation built for this
Meta4Object you can change this default behavior by specifying
the presentations ID in the Function List tab. See the figure below.
Connecting to Meta4Objects 149
Maintenance Meta4Object
n The presentation has to be available for this time it is not generated in
run time. By default, the default maintenance presentation is invoked,
i.e. the one with a name as the single-node Meta4Object plus the
_MT_ string. In our example that would be CMP_MT_PAY_TYPES.
n If you want to invoke another presentation instead of the default one
you can change the Idinstance in the Zoom Function tab.
To understand the flow of these two functions the OBL code for Function
List is listed in the following figure. See that inside the Function block a
Presentation Meta4Object control is inserted.
Figure 85. Idinstance in the Function List tab
Figure 86. Idinstance in the Function Zoom tab
Idinstance = TheListPresentationToBeRaised
Idinstance = TheMaintenacePresentationToBeRaised
150
This in turn contains an Extends, whose Idinstance is #Default_list, i.e.
the presentation will be created in run time. Changing the value of
Idinstance here or in the Function List tab is equivalent.
The Presentation Preload block parameters can also be changed in the
OBL editor or in the Function List tab.
The Inheritdata property has to be set to 1 in order to allow the sharing of
data between the initial Meta4Object and the Track (or Maintenance)
Meta4Object.
Notice that the parameters given in the General Props tab identifying the
related Track Meta4Object are referred here as Idfuncchannel,
Idfuncnode and Idfuncmethod enabling an easy identification of the
information related to the initial Meta4Object or to the rest of the
Meta4Objects.
In case the item is part of a foreign key the parent and son listgroups can
be linked through the properties (General Props Tab) ParentListGroup
and SonListGroup. Several parents can be included separated by commas.
If ParentListGroup has a non null value, after invoking the list method
from the son the Validate method of the parent is invoked.
If SonListGroup has a non null value, deleting the value of the item in the
Figure 87. OBL code for Function List
BEGIN Function List
Idfuncchannel = "CMP_TR_PAY_TYPES2"
Idfuncnode = "CMP_TR_PAY_TYPES2"
Idfuncmethod = "LIST"
Mainobjs = "ID_PAY_TYPE"
Mainargs = "ARG_ID_PAY_TYPE"
Targetobjs = "ID_PAY_TYPE,*O*/Presentation/Form1/Textbox15.Text"
Targetitems ="ID_PAY_TYPE,N_PAY_TYPE"
BEGIN Presentation Preload
BEGIN Action_preload Default1
Onok = "END_OK"
Oncancel = "UnloadForm"
Availablesteps = 12
Loadchannel = False
Actionnew = False
END
END
BEGIN Presentation MetaObject
BEGIN Extends Default2
Idchannel = "CMP_TR_PAY_TYPES2"
Inheritdata = 1
Idinstance = "#Default_list"
END
END
END
Connecting to Meta4Objects 151
parent calls the Clear function of the son.
When foreign keys are around the Mainargs/Mainobjs assignment can be
not enough for our Function. Properties Sourceargs and Sourceobjs
enables further assignments in the block.
Finally we will mention the way in which internal flow takes place when
invoking Listgroup functions.
n List flow:
1. Presentation Preload is executed
2. List Meta4Object is created
3. The List method in track Meta4Object is executed
4. In case no data are to be shown in the List node an error message
appears and the flow dies away.
5. If only one record is loaded in the List node then its value is copied to
the initial Meta4Object.
6. Presentation Meta4Object is executed.
7. If click on Cancel Function Clear is invoked and the flow dies away.
8. Copy values in List node to the initial Meta4Object.
9. End of the flow.
n Validate flow:
1. Validate Meta4Object is created.
2. The validate method is executed.
3. If there is no data on the Validate node List is invoked.
4. If there is more than one record in the Validate node List is invoked.
5. If there is only one valid record values in the Validate Meta4Object are
copied to the initial Meta4Object.
The Record Insert Wizard and the ZLG
When running the Record Insert Wizard over data that contain relations in
the dictionary with other tables there is the possibility of generating the
whole ZLG. This means all the visual components plus the Listgroup
control.
Moreover if the generated ZLG is a candidate for having a parent ZLG the
wizard will prompt an option to construct both ZLGs at the same time. This
will be shown through an example.
152
a. Open a new presentation and activate the Record Insert Wizard.
b. Select the STD_MT_SUB_GEO_DIV Meta4Object and when its items
are listed, select the STD_ID_GEO_DIV item. The figure below shows
the relations that will be encountered by the wizard over the data
contained in the Meta4Object.
c. Notice the relation established though STD_ID_GEO_DIV. This would
mean a ZLG in a Default FrontEnd presentation. This is exactly what
the Record Insert Wizard suggests as you can see in the right side in the
figure below.
d. In case you want to ignore the ZLG generation possibility just click on
the Other Components option button. A label and a textbox will be
used.
e. If the ZLG is to be generated, the wizard will look for further relations
in the dictionary. In the figure above a second relation is present. That
would mean two ZLG in a default presentation. One for
Figure 88. Data Model II
Figure 89. Using the Record Insert Wizard to generate a ZLG
Connecting to Meta4Objects 153
STD_ID_GEO_DIV and another one for STD_ID_COUNTRY. The
wizard brings this option by displaying the dialog shown in the next
figure. Clicking in the STD_ID_COUNTRY option will lead to the
hierarchical generation of both ZLGs.
f. Finally the figure below shows the result of the whole process.
Figure 90. Using the Record Insert Wizard to generate a ZLG II
Figure 91. Final result
154
Working with tracks
For optimization reasons in many cases a track Meta4Object is connected
to the Meta4Object we want to work with
12
. Remember this is done by
means of a List connection between the two Meta4Objects.
To see how a track connection is implemented through the Designer Tool
you will work with a Meta4Object built from the Meta4Object you have
been working with, but linked to a track Meta4Object. The track
Meta4Object is normally created with the Data Model Designer wizard. .
In the example used below, the list connector is of a 1:N type and only one
field of the PK has been used. This has been done for learning reasons.
Exercise
Lets build a presentation for a Meta4Object based on
CMP_EXAMPLE_TRACKS_0.
a. Open presentation CMP_EXAMPLE_TRACKS_0 and save it as
CXX_EXAMPLE_TRACKS_1. The presentation is shown below.
Where Scrollpanel1 contains textboxes linked to the parent node of
CMP_M40_COSTS3 Meta4Object, and Scrollpanel2 the ones linked to
the same Meta4Objects child node.
12. Why a track and how the connection is established is far beyond our present scope. Refer
to the advanced aspects of Meta4Object design.
Figure 92. CXX_EXAMPLE_TRACKS_0 presentation
Connecting to Meta4Objects 155
If you test this presentation a QB form will appear, followed by a List form,
both being related to the QB node and List node of the Track Meta4Object.
Finally after choosing one record from the Track List you will see Form1
with the data corresponding to the first record loaded in the parent node of
CMP_M4O_COSTS3.
No navigation buttons have been included in
CXX_EXAMPLE_TRACKS_1 presentation.
a. Add a Navigationgroup in Scrollpanel1 and another in Scrollpanel2.
Save your presentation.
Figure 93. Source Meta4Object
Figure 94. The corresponmding track and its structure.
156
Figure 95. List connector
Figure 96. Track
Connecting to Meta4Objects 157
Now, in order to understand what is happening in terms of records and
nodes, take a look at the schema in the next figure.
Figure 97. Initial Meta4Object
Figure 98. Maintenance Meta4Object
158
b. Test your presentation following the steps of the figure above. Notice
that when selecting in the List form the second record all records in the
with the same DT_START value are loaded in the Root node.
Toolbar Navigation Groups
When list connectors are defined as 1:N it becomes important to enable the
end user to navigate through the List node. Some specific controls have
been included in the Designer Tool to facilitate navigation. The following
tables display their main features.
Figure 99. The Frontend Designer with the Presentation Browser
List connector
(by DT_START)
ROOT NODE
CMP_M4O_COSTS3
CHILD NODE
TRACK
QB NODE
TR NODE
STEP 1.- QB form
STEP 2.- List form
STEP 3.- list is 1:N by DT_START.
Load in Root & Child
Image Type Meaning Classname
Navigation
Group
Navigates through
the related node
Toolbarnavigationgroup
NavRoot
Group
Navigates through
the parent node
Toolbarrootnavigationgroup
NavTrack
Group
Navigates through
the track node
Toolbartracknavigationgroup
Connecting to Meta4Objects 159
To get some practice, complete the following instructions:
a. Add the corresponding Navigation Groups to your presentation in
order to be able to navigate through the Track. Use Scrollpanel3 for the
Toolbartracknavigation control.
b. Save and test your presentation.
Specific patterns
Pattern objects become very useful when tracks are used, and as is the case
with Navigation Groups, a number of specific pattern objects have been
included to simplify your work. The following table includes some of them.
Image Action Meaning Classname
Firstdoc Moves to the first record
loaded in the track node
Button
Lastdoc Moves to the last record
loaded in the track node
Button
Nextdoc Moves to the next record
loaded in the track node
Button
Previousdoc Moves to the previous
record loaded in the track
node
Button
Document #Docindex Number of present record
#Doccount Number of records in the node
#Docnodestr Shows the nodes items
Track
node
#Trackindex Number of present record in the track node
#Trackcount Number of records in the track node
#Tracknodestr Shows track nodes items
Root node #Rootindex Number of present record in root node
#Rootcount Number of records in theroot node
#Rootnodestr Shows root nodes items
Current
node
#Index Number of present record in current node
#Count Number of records in current node
#Nodestr Shows current nodes items
160
Here are some examples:
n Node counters:
BEGIN Patternbox MyPattern1
Pattern = "([#Index]/[#Count])"
Borderstyle = 0
Idchannel = "MyChannel"
Idnode = "MyNode"
END
n Node structures:
BEGIN Patternbox Mypattern2
Pattern = "[#Nodestr]"
Idchannel = "MyChannel"
Idnode = "MyNode"
END
Pattern objects also accept the scope modifier *T* at the beginning of the
Figure 100. The Frontend Designer with the Presentation Browser
Figure 101. The Frontend Designer with the Presentation Browser
Patternbox in run time
Index number of
current register
Total number
of registers
loaded in the
node
Connecting to Meta4Objects 161
pattern value (e.g. *T*#Count). The meaning of this modifier is to refer the
object to the track node, if any.
In order to practice add counters and node structure controls to your
presentation.
Steps in the preload
Remember that when the table over which you build a single-node
Meta4Object is defined as non cacheable, Track Meta4Objects generated
with the DMD Wizard have a QB Free node plus a List node.
In run time, if a Track has been connected to a certain Meta4Object you
will get the sequence already described, i.e.
1. QB - step
2. LIST - step
3. Connection
4. Load in the Meta4Object
There are two more cases in which a certain step must be taken before the
final Meta4Object is loaded:
a. dynamic filters defined in the Meta4Object
and / or
b. properties defined in the Meta4Object with node scope
(parameters).
I n summary, there are four possible preload steps:
The Action_preload control lets you modify the number of steps that will
take place in the Meta4Object preload process as was mentioned in
previous sections. Remember this was attained through the property
Step Meaning Defined in...
QB Filter the list presented by the list
node of the track
Track Meta4Object
LIST Lists records charged in the List
node of the track
Track Meta4Object
Dynamic Filter Filters the records to be loaded in the
Meta4Object
Source Meta4Object
Parameters Filters according to the value of a
property defined with node scope.
Source Meta4Object
162
Availablesteps.
Now that you have learned how to take control over the display of different
records in a node you will understand the potential of the Avaliablesteps
property.
Please follow the steps:
a. Edit the OBL code of Action_preload1. Add the line:
Availablesteps = 31
b. This will make no change in the preload for 31 means a 11111 mask,
i.e. all available steps.
c. Save and test your presentation.
d. Change now Availablesteps to 3 (i.e. 00011 ). Save and test your
presentation. Notice the following features:
n The list is not displayed.
n The first record in the parent node is loaded.
n When navigating through the track node the transaction to the
parent node is done in blocks according to the condition set in the
List connector (in our example DT_START).
See that the field used by the List connector is not editable in run time (see
figure below).
Preload steps Mask number Binary code
Choose list dialog 1 00001
Filter list dialog 2 00010
Filter channel dialog 4 00100
Ask parameters dialog 8 01000
Display list dialog 16 10000
Figure 3. The Frontend Designer with the Presentation Browser
Connecting to Meta4Objects 163
e. Change now Availablesteps to 2. Save and test your presentation.
Notice the following features:
n Track navigation buttons are disabled.
n The whole block is loaded in the parent node.
n DT_START related textbox is now enabled.
f. Try the rest of the Availablesteps values.
Conditional object construction
Suppose you want to add to your CXX_EXAMPLE_TRACKS_1
presentation a button showing the list of records in the track node. Here is
the OBL code of such insertion:
BEGIN Button Button1
Idchannel = "CMP_M4O_COSTS3"
Idnode = "COURSES"
Image = "#Showlist"
BEGIN Evclick EvclickList
BEGIN Action_preload Action_preload2
Onok = "END_OK"
Oncancel = "UnloadTheForm"
Availablesteps = 31
END
BEGIN Action_call UnloadTheForm
Sentence = "*O*/Presentation/Form1.Unload"
END
END
END
Please do the following exercise:
Exercise
a. Add the Show List button with the OBL code listed above. Save and
test your presentation.
Suppose now that you dont know whether the CMP_M4O_COSTS3
164
Meta4Object has got a track connected to it. The Show List button would
result as meaningless in case no track is linked.
The Designer Tool provides a mask for conditions that have to be checked
before an object is constructed in run time. The mask is applied to the
property Constructif which is available in a number of controls.
n Constructif: Syntax.
Constructif = ValueOfConditionMask
b. Add a suitable Constructif condition to the Show List button. Save
and test the presentation.
c. Open CXX_EXAMPLE_ZLG presentation and reproduce the Show
List button. Test its proper behavior. Remember this presentation was
constructed over the CMP_M4O_COSTS2 Meta4Object which was
not connected to a track.
Value Meaning
1 Object (and contained objects) are constructed only if a track is
connected
2 Object (and contained objects) are constructed only if a track is
NOT connected
4 Object (and contained objects) are constructed only if a track is
connected through a List connector of 1:N type
8 Object (and contained objects) are constructed only if the
Meta4Object has NOT been loaded
16 Object (and contained objects) are constructed only if the
Meta4Object has been loaded
Connecting to Meta4Objects 165
Multicompany features in presentations
Default and customized presentations
If you remember, in the Core Tools course you learnt that you can generate
default presentations that consider multicompany features. If you select a
Meta4Object that is multicompany-enabled, you must decide whether you
want the corresponding presentation to be multicompany or single
company.
If you decide that it is single, that is to say, you do not activate the
multicompany feature, the company field is hidden and you cannot display
it on screen.
Now, If you choose to create a multicompany presentation, in the
presentation toolbar a new button is added to open the company selection
window.
What happens if instead, you want to build from a multicompany
Meta4Object, your own presentation, rather than use the default?
The outcome of your multicompany enabled presentation allows the end-
Figure 4. Enabling multicompany features in default presentations
166
user to select which company to filter for.
Assuming that you are already familiar with the procedures for building
your own presentations from exisiting Meta4Objects, what you need to do
is:
n Add the corresponding toolbar control, a button, for the multicompany
feature to your presentation. Upon clicking this, you need to display a
filter for the different companies.
n Associate a filter that contains the list of values for companies, the
parameter invoked by the button in the presentation.
n Add the corresponding menubar entry. The details of how to do this
have already been covered and will not be discussed here.
Figure 5. The outcome of your multicompany enabled presentation
Connecting to Meta4Objects 167
Customized presentations - params group type element for
toolbar
In this case, the toolbar button type you create for the multicompany feature
is set to the value, toolbarparam group. .
Figure 6. Inserting a multicompany button with the toolbar param group
1. In the Formmain part of your
presentation that you are creating,
double click over the toolbar area.
2. Click the Buttons tab.
3. Click insert to add a new control,
a button.
4. Select Params group for type to
insert the multicompany button.
168
Using the Toolbar Editor, make sure that you select the param group type
when you define the new element for the toolbar, as this specifically adds a
group of parameters for the multicompany feature. This by default includes
a button for dates and another for company usually.
Customized presentations - button type element for toolbar
Alternatively you can also add an ordinary button to perform the same
function. The procedure in this case is different, as shown and dicussed in
the figure below. In this case, the toolbar button type you create for the
multicompany feature is set to the value, button.:
Figure 7. Adding a button type element for multicompay to the toolbar
1. In the Toolbar Editor, for the
Meta4Objec indicated in idchannel,
select Button for Type in General
Properties.
2. Add additional details such as
name, text, image type to use.
3. Indicate whether it is visible,
enabled and does something when
click enabled.
6. Just as standard button events, you need
to add instructions for loading and off-
loading. Here you have Action.preload
where you specifically use 32 ifor
Availablesteps to invoke the corresponding
companies filter.
7.. Select Params group for type to insert
the multicompany button
4. Your end-result after atdding
the button.
5. Select Properties to add
eventclick controls.
Connecting to Meta4Objects 169
Check your understanding of the current lesson by answering the following
review questions.
1. How do you load data into records of a presentation?
2. In a presentation how do you make a method executable?
3. How do you graphically represent the status of the current record
in the node?
4. How do customize a presentation so that you can invoke a task
from it?
Review questions
170
Lesson key points...
n All data and loading functionality of a Meta4Object can be
implemented in one or more presentations.
n To navigate through the records based on data in a Meta4Object, add
toolbar navigation controls, datagroup and edit group controls.
n In a presentation, the Action type controls invoke instructions
embodied in methods or tasks for a given Meta4Object.
n The list/validate group control allows you to add a link to the
presentation of the maintenance Meta4Object for data entry, to add
another two links to the presentation for the track Meta4Objec to
validate the data entered against the data in the track and to filter
records through the track Meta4Object.
n Use pattern objects to display the current record number, total number
of records in current, track or root node, as well as to display node
items.
n Adding multicompany features is automatically done in a default
presentation, if the multicompany feature is enabled. Otherwise, it can
be customized as a toolbar button and a menubar option.
You should be able to...
Lesson summary
Build in all the functionality implemented in a Meta4Object
into a presentation.
Add navigation toolbars to navigate through records in a
presentation.
Run methods from a presentation.
Add multicompany features to a presentation
Use advanced controls and properties to add more functionality
to a presentation.
171
Exploring what the Frontend
Designer Wizard does
The course ends with a review at how the Frontend Designer constructs
default presentations for Meta4Objects. You will identify the structure of a
default presentation, and enumerate the different controls used in such
presentations.
Understanding the structure and functionality of each of the elements that
appear in a default presentations will prove to be very useful, because you
will be able to use the Frontend Designer Wizard to quickly generate
default presentations for your Meta4Objects, and modify them according to
your needs.
Introduction
Lesson objectives
Upon completion of this lesson, you will be able to:
n Understand the structure of a default presentations created with
the Frontend Wizard.
n Identify each of the elements used in a presentation created with
the wizard, and their role in the presentation.
n Alter presentations created with the wizard and customize them
according to your needs.
Lesson 1.
Introducing the Frontend
Designer:Basic concepts
Lesson 4.
Connecting to
Meta4Objects
Lesson 5.
Exploring what the FED
Wizard does
Lesson 3.
Advanced functionality
Lesson 2.
Building logic into
presentations: more
OBL
172
How to access the functionality for this lesson
Select the following path:
If you select this path the following window opens:
Click the Frontend Designer option on the right panel, or double click the
same option on the tree and the Frontend Designer window will open.
Meta4Mind Menu Tree
Mind|Developement Tools|Presentations
Figure 8. Accessing the Frontend Designer
Exploring what the Frontend Designer Wizard does 173
Remember to show the Presentation Browser on the screen. To open it
select the option View|Presentation Browser on the menu bar.
Figure 9. The Frontend Designer window
174
You have already used the Frontend Wizard in your Meta4Objects course
for generating default presentations for your Meta4Objects.
Now that you have been trough the main elements of the designer tool you
will understand what a default presentation is about. This becomes an
important point as a great amount of work can be saved if you use the
wizard, but commonly changes to the default presentation are required.
Those changes are easily achieved if you have a deep understanding both of
the designer tool and of what a default presentation is.
Run the wizard and select the Meta4Object we have been working with
(CMP_M40_COSTS3). Generate its default presentation (WARNING: do
not save THIS default presentation).
Main structure
By default, the main presentations form is structured as follows:
A tree is usually added into splFormLeft reproducing the Meta4Objects
nodes hierarchy.
SplNodeFields_Up
splFormRight/splNodeDown/splNodeFields_Up act as containers for the
controls that will display the data of different nodes. A changer is also used.
Conceptual definitions
Figure 10. Structure of a default presentation
Exploring what the Frontend Designer Wizard does 175
Usually this changer contains two tabstrips:
TABSTRIP_ROOTS is reserved for the Root Node of the involved
Meta4Object. Non root nodes will be represented in the other tabstrip
control. The name of this non root tabstrip is taken from the root node. In
our example COURSES.
Generally speaking, each level in the underlying Meta4Object is assigned a
Tabstrip, whose name is TABSTRIP_ParentNodeId. Each sibling in a
specific level is represented by a tab in the corresponding Tabstrip. The
name of the tab for each sibling is TAB_NameOfTheNode.
The specific structure of each tab is the same. The following figure shows
the displayed Explorer area for the root and non root tabs (left side) and the
design of both tabs (right side).
Toolbars, Patterns and Nodestatus controls play the roles you have
Figure 11. SplNodeFields_Up
Figure 12. chaChangerNodes
Figure 13. Mapping the visual area with the explorer structure
176
already dealt with. The NODE_COURSES and NODE_COSTS controls
are Mimic controls (see Lesson 5) whose class type is initially set to
Scrollpanel. The mimic class is changed by means of the first button in
tlbCOSTS and tlbCOURSES. The following figures show the controls
inside each of the mimics in our example.
Primary key related objects are inserted into a groupbox control. In case the
wizard finds a relation in the dictionary it builds a ZLG, inserting the
elements that were discussed in Lesson 5. You can see a Listgroup control
in NODE_COURSES.
Figure 14. Controls inside the mimic controls I
Figure 15. Controls inside the mimic controls II
Exploring what the Frontend Designer Wizard does 177
SplNode_Up
This block contains the controls shown in the following figure.
Inside scrPath scrollpanel two controls are inserted:
a. panTrackSection, which is a panel, where a connection with the track
Meta4Object is implemented. The figure below shows the design of
this panel.
The panTrackSection control has its Constructif property set to 4, which
means that only in case a 1:N connection has been actually established is
this object constructed (See Lesson 5).
Figure 16. SplNode_Up
Figure 17. panTrackSection
178
b. chaChangerPath, which is a changer control. It contains the
navigation buttons for the root node. We will see later on how this
changer is controlled in run time. Design is displayed in the figure
below..
SplNodeFields_Down
Finally the lower area of the form is dedicated to this block. In run time it is
controlled so as to show a link to child nodes when parent nodes are being
displayed. The figure below shows the Explorer area of this block (left
side) and the block in run time (right side).
Figure 18. chaChangerPath
Figure 19. splNodeFields_Down
Exploring what the Frontend Designer Wizard does 179
Logic in Default Presentations
You can control which node is going to be displayed in run time in a default
presentation from different controls.
The Tree as a main controller
Inside each tree node the wizard inserts an Evclick event. A number of
actions are executed inside this event.
First the changer containing the nodes tabstrips is changed to the level
representing the node (you are dealing with the objects contained in
SplNodeFields_Up. See Lesson 5). This is done by means of Changeto
method.
The following action makes use of Selectedtab method in order to show
the corresponding tab. In our example tabstrips have only one tab, but in
case a number of nodes reside at the same level, each would be represented
in one of the tabs of that levels tabstrip.
These actions depend on the relative order, that is the sequence. A tab
cannot be selected before its changer has constructed the container Tabstrip.
The third action works over the changer in SplNode_Up. It will show the
parent navigation buttons in case the child is visible, or it will be set to
"NOTHING" in case the root node is displayed. This is also achieved with
the Changeto method.
Finally SplNodeFields_Down changer is changed to the level containing
the links to the levels shown in figure 16.
Figure 20. Events and actions in the tree
chaChangerNodes.Changeto(TABSTRIP_ROOTS)
TABSTRIP_ROOTS.Selectedtab(TAB_COURSES)
chaChangerPath.Changeto("NOTHING")
scrChildNodesLink/chaChildNodesLink.Changeto(PIE_COURSES)
chaChangerNodes.Changeto(TABSTRIP_COURSES)
TABSTRIP_COURSES.Selectedtab(TAB_COSTS)
chaChangerPath.Changeto(PAT_COURSES)
scrChildNodesLink/chaChildNodesLink.Changeto(PIE_COSTS)
180
Tabs
In case more than one node is present at the same level tabs include an
Evclick event with:
a. An Action_call for changing the chaChangerPath.
b. An Action_call for changing the child related footer.
Notice that no changes between hierarchical levels take place in the tabs
Evclick. Only changes in the same level are defined here.
Footer section (SplNodeFields_Down)
In case it is displayed a number of links to the child node appear (see figure
16). Each link contains again an Evclick that reproduces the behavior of
child nodes in the tree, i.e.
a. chaChangerNodes.Changeto(TABSTRIP_.......)
b. TABSTRIP_COURSES.Selectedtab(TAB_....)
c. chaChangerPath.Changeto(PAT_COURSES)
d. chaChildNodesLink.Changeto(PIE_.....)
Exploring what the Frontend Designer Wizard does 181
Multicompany in default presentations
By default, selecting the Multicompany checkbox automatically generates
an entry for the menu and creates the corresponding buttons in the toolbar.
Internally the multicompany feature depends on the company ID itself,
which is used to filter by company..
Note that these controls do not have any visible eventclk controls
associated.
Figure 21. Components that correspond to different features of a
presentation that is multicompany enabled.
182
Lesson key points...
n Generating default presentations automatically includes components
that define the panels, tabstrips, tabs, tree structure, nodes, and
navigational keys.
n Additionally you can optionally add multicompany features to a default
presentation.
You should be able to...
Lesson summary
Match the different parts of a presentation to the corresponding
components in the presentation browser.
183
Appendix: Brief summary of
some controls
The purpose of this appendix is to introduce other information which can be
relevant for the understanding of the current course.
About this appendix
184
Controls for containers
n Button
n Evclick
n Groupbox
n Calendar
n Checkgroupbox
n Dataevents
n Event
n Exeblocks
n Frmobject
n Ganttable
n Link button
n Listgroup
n Mimic
n Nodehistory
n Panel
n Scrollfrmobject
n Scrollpanel
n Setpos
n Shortcut
n Slider_dates
n Table
n Template
n Textbox
n Evdbclick
n Evvalidate
n Treeview
n Treenode
n Evclick
n Treenode
n Rectree
n Rectreenode
n Action_set
n Evclick
n Evdbclick
n Evdrag
n Evdrop
n Popupmenu
n Rectreenode
n Itemlabel
n Nodestatus
185
n Tabstrip
n Tab
n Calendar
n Checkboxgroup
n Dataevents
n Evclick
n Event
n Exeblocks
n Frmobject
n Ganttable
n Link Button
n Listgroup
n Mimic
n Nodehistory
n Panel
n Scrollfrmobject
n Scrollpanel
n Setpos
n Shortcut
n Slider_dates
n Table
n Template
n Image
n Changer
n Calendar
n Checkboxgroup
n Dataevents
n Event
n Exeblocks
n Frmobject
n Ganttable
n Link Button
n Listgroup
n Mimic
n Nodehistory
n Panel
n Scrollfrmobject
n Scrollpanel
n Setpos
n Shortcut
n Slider_dates
n Table
n Template
n Link
n Patternbox
n Combobox
n Evclick and Evvalidate
n Urlbox
n Toolbar
n Toolbarbutton
n Evclick
n Evclickpressed
n Popupmenu
n Unpressed
186
n Splittvertical
n Splittblock
n Calendar
n Checkboxgroup
n Dataevents
n Event
n Evhide
n Evshow
n Exeblocks
n Frmobject
n Ganttable
n Link Button
n Listgroup
n Mimic
n Nodehistory
n Panel
n Scrollfrmobject
n Scrollpanel
n Setpos
n Shortcut
n Slider_dates
n Table
n Template
n Extern
n Slider
n Evvalidate
n Label
n Evclick
n Presentation
n Action_bp
n Action_call
n Action_cmf
n Action_copy
n Action_dataprops
n Action_datatrack
n Action_dialog
n Action_edititem
n Action_execute
n Action_filter
n Action_goto
n Action_help
n Action_list
n Action_listtrack
n Action_message
n Action_method
n Action_notify
n Action_options
n Action_preload
n Action_script
n Action_set
n Action_task
n Action_tasklet
n Action_value
n Extends
187
n Forms
n Backgroundimage
n Button
n Calendar
n Changer
n Checkbox
n Checkboxgroup
n Combobox
n Dataevents
n Date
n Evload
n Evshow
n Evunload
n Exeblocks
n Extern
n Ganttable
n Groupbox
n Image
n Itemlabel
n Label
n Link
n Listgroup
n Menubar
n Mimic
n Nodehistory
n Nodestatus
n Panel
n Patternbox
n Rectree
n Scrollpanel
n Shortcut
n Slider
n Slider_dates
n Splitthorizontal
n Splittvertical
n Forms (condt)
n Table
n Tabstrip
n Textarea
n Textbox
n Toolbar
n Treeview
n Urlbox
188
189
Appendix: Mouse events
The purpose of this appendix is to introduce other information which can be
relevant for the understanding of the current course.
About this appendix
190
Mouse events
n Evclick
n Menu
n Menuitem
n Button
n Label
n Itemlabel
n Textbox
n Image
n Extern
n Patternbox
n Mimic
n Shortcut
n Tab
n Toolbarbutton
n Treenode
n Rectreenode
n Evclickchecked & Evclickunchecked
n Menu
n Menuitem
n Extern
n Mimic
n Evclickpressed & Evclickunpressed
n Extern
n Mimic
n Toolbarbutton
n Evdbclick
n Textbox
n Combobox
n Image
n Extern
n Calendar
n Date
n Mimic
n Textarea
n Column
n Rectreenode
n Evdrag & Evdrop
n Rectreenode
n Extern
n Mimic
191
Appendix: Evvalidate:
Triggering mechanisms
The purpose of this appendix is to introduce other information which can be
relevant for the understanding of the current course.
About this appendix
192
n Extern
n Mimic
n Date
n Dataevents
Triggered when losing focus
n Textbox
n Column
n Textarea
n Calendar
n Combobox
Triggered when clicking
n Checkbox
n Optionbutton
n Slider
Evvalidate
193
Appendix: Data-related events
The purpose of this appendix is to introduce other information which can be
relevant for the understanding of the current course.
About this appendix
194
n Evaftermove
n Dataevents
n Extern
n Mimic
n Evafternew
n Dataevents
n Extern
n Mimic
n Evafterdelete
n Dataevents
n Extern
n Mimic
n Evafterpersist
n Dataevents
n Extern
n Mimic
n Evafterchangeitem
n Dataevents
n Extern
n Mimic
Data-related events
195
Appendix V: Other events
The purpose of this appendix is to introduce other information which can be
relevant for the understanding of the current course.
About this appendix
196
Other events
n Evnotify
n Action_task
n Action_tasklet
n Evload
n Form
n Tab
n Changer
n Evunload
n Form
n Evshow
n Form
n Splittblock
n Extern
n Mimic
n Evhide
n Extern
n Mimic
n Evtab
n Extern
n Mimic
n Table
n Evbefnav
n Urlbox
n Rectreenode
n Extern
n Mimic
n Evnavcom
n Urlbox
n Rectreenode
n Extern
n Mimic
n Evoledrop
n Rectreenode
n Extern
n Mimic
n Evoledrag
n Rectreenode
n Extern
n Mimic
197
Appendix VI: Some properties
The purpose of this appendix is to introduce other information which can be
relevant for the understanding of the current course.
About this appendix
198
Properties set #1
Comments on Grants:
n Bit Mask
Properties
Name Meaning Run time Mandatory
Classname Name of the class by
which the component is
represented
N Y
Alias Logical name given to the
component
N Y
Idchannel ID of the Meta4Object
linked to the component
N N
Idnode ID of the node linked to
the component
N N
Iditem ID of the item linked to
the component
N N
Idchannelkey Advanced use. Password
for the Meta4Object
access
N N
Idchannelalias Advanced use. Logical
name given to the
Meta4Object
N N
Idaccessalias Advanced use. Name
given to the Meta4Object
access
N N
Grants Bit map reflecting
permissions
N Y
Grant Mask number Binary code
Read 1 00001
New 2 00010
Update 4 00100
Delete 8 01000
Execute 16 10000
199
n Default value: 31(all)
Properties set #2
Properties set #3
Name Meaning Default Mandatory
Font Type of font MS Sans
Serif
Y
Backcolor Background color (in
some components)
Gray Y
Forecolor Foreground color (in some
components)
Black Y
Borderstyle Border (in some
components)
Single
Fixed
Y
Alignment For text inside the
component (Left/
Centered/Right=0/2/1)
0 Y
Name Meaning Default Mandatory
Top Referred to the container
component. Vertical
distance
Visual D. Y
Left Referred to the container
component. Left distance
Visual D. Y
Width Width of the component Visual D. Y
Height Height of the component Visual D. Y
Align Referred to the container
component. Type of
alignment
Null Y
200
Comments on Align. Possible values:
Properties set #4
Top Stuck to the top of the container. The
component changes its width to the
containers. The component keeps its
height.
Bottom Stuck to the bottom of the container.
The component changes its width to
the containers. The component keeps
its height.
Left Stuck to the left of the container. The
component keeps its width. The
component changes its height to the
containers.
Right Stuck to the right of the container. The
component keeps its width. The
component changes its height to the
containers.
Bottomfixed Stuck to the bottom of the container.
The component changes its width to
the containers. The height of the
component changes according to the
components Top value
Rightfixed Stuck to the right of the container. The
component changes its width
according to its Left value. The
component keeps its height.
All Adjust to the containers size.
Name Meaning Default Mandatory
Enabled The component is enabled.
(Enabled/Disabled = 1/0)
1 Y
Visible The component is visible.
(Visible/Not visible) = 1/0
1 Y
Editable The component contains a
text which is editable (1)
or not editable (0)
1 Y
201
Properties set #5
Some more properties
Action
n Values
n Addfilters
n Copy
n Cut
n Delete
n Execute
n Executewithoutparams
n Filters
n Find
n First
n Firstdoc
n Last
n Lastdoc
n Load
n New
n Next
n Nextdoc
n Paste
n Previousdoc
n Redo
n Reload
n Removefilters
n Save
n Undo
n Unload
Name Meaning Default
Text Text appearing in run time. Admits
multi language values
Same as Alias
202
Mousecursor
n Image of the mouse cursor when passing over the component.
n Values:
n Arrow
n Arrowhourglass
n Arrowquestion
n Crosshair
n Default
n Hand
n Hourglass
n Ibeam
n Iconpointer
n Nodrop
n Sizeall
n Sizenesw
n Sizepointer
n Sizewe
n Uparrow
Image
n An image stored in the disk can be used by a control with the Image
property. In that case values can be given to this control according with
the reference of the Image Folder.
n A number of images are available. Their values are:
n #Calculator
n #Calendar
n #Chnfinal
n #Chnint
n #Chnmedium
n #Closebook
n #Delrecord
n #Erasefilter
n #Execute
n #Forbbiden
203
n #Forbbiden_1
n #Forbbiden_2
n #Four
n #Gofirst
n #Golast
n #Gonext
n #Goprevious
n #Menu
n #Newrecord
n #Openedbluebook
n #Openedredbook
n #Save
n #Search
n #Showfilter
n #Showlist
n #Sort
n #Statusdeleted
n #Statusdeleted1
n #Statusdeleted2
n #Statuseof
n #Statuseof1
n #Statuseof2
n #Statusmodified
n #Statusmodified1
n #Statusmodified2
n #Statusnew
n #Statusnew1
n #Statusnew2
n #Statusnormal1
n #Statusnormal2
n #Undo
204
205
Appendix VII: Events
contained in components
The purpose of this appendix is to introduce other information which can be
relevant for the understanding of the current course.
About this appendix
206
Events
Component Event
Presentation Presentation
Form Evshow
Evload
Evunload
Tab Evclick
Evload
Action_task Evnotify
Action_tasklet Evnotify
Label Evclick
Button Evclick
Textbox Evvalidate
Evdbclick
Evclick
Splittblock Evshow
Evhide
Changer Evload
Checkbox Evvalidate
Combobox Evvalidate
Evdbclick
Extern See figure bellow
Image Evdbclick
Evclick
Patternbox Evclick
207
Toolbarbutton Evclick
Evclickpressed
Evclickunpressed
Urlbox Evbefnav
Evnavcom
Slider Evvalidate
Calendar Evvalidate
Evdbclick
Treenode Evclick
Rectreenode See figure bellow
Date Evvalidate
Evdbclick
Dataevents Evvalidate
Evaftermove
Evafternew
Evafterdelete
Evafterpersist
Evafterchangeitem
Evbeforepersist
Menu Evclick
Evclickchecked
Evclickunchecked
Menuitem Evclick
Evclickchecked
Evclcickunchecked
Mimic See figure bellow
Shortcut Evclick
Slider_dates Evchange
Table Evtab
Component Event
208
Column Evvalidate
Evdbclick
Textarea Evvalidate
Evdbclick
Figure 22. Events for the Extern component
Component Event
209
Figure 23. Events for the Rectreenode component
210
211
Appendix VIII: Methods
The purpose of this appendix is to introduce other information which can be
relevant for the understanding of the current course.
About this appendix
212
Methods
Component Method
Button Enabled
Text
Visible
Calendar Backcolor
Copy
Cut
Enabled
Forecolor
Paste
Text
Visible
Changer Changeto
Checkbox Backcolor
Copy
Cut
Enabled
Forecolor
Paste
Value
Visible
213
Column Backcolor
Copy
Cut
Enabled
Forecolor
Paste
Text
Visible
Combobox Backcolor
Copy
Cut
Enabled
Forecolor
Paste
Text
Visible
Exeblocks Call
Form Print
Unload
Validate
Validateform
Image Image
Itemlabel Backcolor
Enabled
Forecolor
Text
Visible
Component Method
214
Menu Checked
Click
Enabled
Visible
Menuitem Enabled
Visible
Checked
Mimic Class
Popupmenu Show
Rectreenode Condition
Checkcurrentpos
Shortcut Click
Slider Backcolor
Enabled
Forecolor
Value
Visible
Splittblock Floating
Blocked
Textarea Backcolor
Copy
Cut
Enabled
Forecolor
Paste
Text
Visible
Component Method
215
Textbox Backcolor
Copy
Cut
Enabled
Forecolor
Paste
Text
Visible
Toolbarbutton Click
Enabled
Pressed
Text
Visible
Urlbox Goback
Goforward
Gohome
Refresh
Stop
Url
Component Method
216
217
Appendix IX: Some more
components
The purpose of this appendix is to introduce other information which can be
relevant for the understanding of the current course.
About this appendix
218
Action_copy
Action_dataprops
Some more components
Property name Values
Set #1 See Appendix I
Action Cut
Copy
Paste
Undo
Property name Values
Set #1 See Appendix I
Mappersist
Mapload
*
Mapundo
Mapdelete
Autoload

0/1
Load

True/False
Unload
**
True/False
Reload
Statistics
Workdates
Action Addfilter,Copy, Copydata, Cut,
Cutdata, Delete, Execute,
Executewithoutparams, Filters, Find,
First, Firstdoc, Last, Lastdoc, List,
Load, New, Next, Nextdoc, Paste,
Pastedata, Previous,
PreviousdocRedo, Removefilters,
Save, Silentsave, Undo, Unload
219
Actionifinvalidpos Addfilter,Copy, Copydata, Cut,
Cutdata, Delete, Execute,
Executewithoutparams, Filters, Find,
First, Firstdoc, Last, Lastdoc, List,
Load, New, Next, Nextdoc, Paste,
Pastedata, Previous,
PreviousdocRedo, Removefilters,
Save, Silentsave, Undo, Unload
Actionifvalidpos Addfilter,Copy, Copydata, Cut,
Cutdata, Delete, Execute,
Executewithoutparams, Filters, Find,
First, Firstdoc, Last, Lastdoc, List,
Load, New, Next, Nextdoc, Paste,
Pastedata, Previous,
PreviousdocRedo, Removefilters,
Save, Silentsave, Undo, Unload
Mvcaction
*. Maps the Load action with the item execution
. Assigns this property to the Meta4Object
. Loads the Meta4Object
**. Unloads the Meta4Object
Property name Values
220
Action_datatrack
Action_execute
Propert name Values
Set #1 See Appendix I
Idtrackchannel
Idtrackchannelalias
Idtrachchannelkey
Idtrackaccessalias
Idtracknode
Idtrackitem
Trackgrants
Idtrackpresentation
Property name Values
Set #1 See Appendix I
Action
*
*. Name of actions that can be executed
Globalrefresh
Channelrefresh
Accessrefresh
Branchrefresh
Noderefresh
Recordrefresh
Itemrefresh
Validate Boolean
221
Action_method
Action_method enables the execution of a given method defined in a
Meta4Object with the possibility of transferring values in both directions
Property name Values
Set #1 See Appendix I
Sourceargs
Sourceobjs
Targetobjs
Returnobjs
Ontrue
Onfalse
Onerror
222
ccxxiii
Index
A
Absolute reference facility 68
Absolute referencing 66
Action_bp 127
Action_call 73
Action_dataprops 123
Action_dialog 94
Action_goto 91
Action_list 117
Action_method 125
Action_preload 104
Action_script 131
Action_set 72
Action_task 74
Action_value 116
Adding controls from the control palette to a
form 23
Adding controls to a form from the "Insert
Component" option 25
Adding visual and non visual components with
the explorer 40
Advanced properties of the ZLG 148
Askbeforeclose property 91
Availablesteps property 104
C
Changing properties in run time 72
Changing the grid size 20
Closing the OBL editor 21
Conditional object construction 163
Connecting presentations 74
Constructif 164
Control Button 34
Control Changer 85
Control Checkbox 33, 132
Control Checkboxgroup 34
Control Combobox 32
Control Groupbox 33
Control Image 31
Control Label 30
Control Link 32
Control Mimic 128
Control palette 23
Control Panel 84
Control Scrollpanel 84
Control Slider 35
Control Split 57
Control Tabstrip 84
Control Textbox 34
Control Urlbox 32
D
Data properties 102
E
Editing the OBL code of a presentation 20
Exeblocks 94
Extends 74
F
Flow control 91
ccxxiv
Index
Frontend Designer interface 16
Function Clear 144
Function List 145
Function Zoom 144
G
General properties of Listgroup 139
Grant property 91
I
Inserting a new form in a presentation 18
L
Linking presentations to Meta4Objects 102
Listgroup 134
Loading options 103
Logic behind Default Presentations 179
M
Mainargs and Mainobjs 140
Menus 58
Modal property 90
Multi language 109
Multi language text 89
N
New Presentation 17
Nodestatus 118
O
Onok, Oncancel properties 91
P
Patternbox 118
Presentation context and context variables 75
Presentation Explorer 40
Previewing a presentation 18
R
Referring to properties of other objects 66
Registername property 90
Relative referencing 67
RunTime variables 77
S
Saving a presentation 25
Saving code from the FrontEnd Designer and
inserting code into the OBL editor 38
Setting properties in design time using the
OBL editor 35
Setting properties in design time using the
Properties dialog box 27
Specific patterns 159
SplNode_Up 177
SplNodeFields_Down 178
SplNodeFields_Up 174
Startupposition property 90
Steps in the preload 161
Structure of the Listgroup control 137
T
Table 119
Targetitems and Targetobjs 142
The Function control 137
The Properties dialog box 47
The Record Insert Wizard 112
The Record Insert Wizard and the ZLG 151
The syntax checker 36
Toolbar groups 122
Toolbar Navigation Groups 158
Toolbars 57
Trees 85
V
Virtual forms 85
ccxxv
Index
W
Windowstate property 90
Working with tracks 154

Vous aimerez peut-être aussi