stacked canvas a content canvas is a main from canvas while a stacked canvas is a secondary canvas...

46
Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas. In other words, it can be stacked on another canvas. Thus in this slide presentation a content canvas will be made first, followed by a stacked canvas.

Upload: chloe-baker

Post on 05-Jan-2016

233 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Stacked Canvas

A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas. In other words, it can be stacked on another canvas.

Thus in this slide presentation a content canvas will be made first, followed by a stacked canvas.

Page 2: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Open a new Form Module

Page 3: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Create a new data block using the

EMPLOYEE table

Page 4: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Use a new Content canvas

Page 5: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Set these prompts

Page 6: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

The layout style should be Form

Page 7: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Display only on record and title the frame Employee Details

Page 8: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

The Employee Details frame

Page 9: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Open the Property Palette for EMPLOYEE NUMBER

Page 10: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Change the required property to No

Page 11: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Highlight the Module and create a new data block for the EMPLOYEETYPE table

Page 12: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas
Page 13: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Deselect Auto-join. This data block should not be related to EMPLOYEE

Page 14: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Place this data block on a new stacked canvas

Page 15: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Use these prompts

Page 16: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Select the Form layout

Page 17: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Only display one record

Use the Frame Title, Employee Type Details

Page 18: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

The canvas for Employee Type Details

In the Layout Editor, resize this stacked canvas to the Following:

Height 75Width 410

Page 19: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

The canvas has been resized

Page 20: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Notice the size of the canvas

Page 21: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Change the name of the Content Canvas to

EMPLOYEES

Change the name of the Stacked Canvas to

EMPLOYEE_TYPE

Name changes can be done in the Property Palette or on the Object Navigator. In using the Object Navigator, highlight the object to

be changed. Ensure that the highlight is blue, not yellow, and change the name.

Page 22: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

The names have been changed

Page 23: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Highlight the form window, WINDOW1. Open the Property

Palette and set these properties:Name: PRINCIPAL_WINDOWTitle: EMPLOYEE CHANGE FORMPrimary Canvas: EMPLOYEES

Page 24: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Properties changed

Page 25: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

The window is now called

PRINCIPAL_WINDOW

Page 26: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Highlight Windows and create a new window

by clicking Edit, Create

Page 27: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

The new window, WINDOW11 has been created. Open the Property Palette and set these properties:

Name: EMPLOYEE_TYPETitle: ADD NEW TYPEPrimary Canvas: EMPLOYEE_TYPE

Page 28: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Properties changed

Page 29: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

For the EMPLOYEE_TYPE window, set these additional properties:

X Position: 20Y Position: 50Width: 410Height :75

Page 30: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Properties changed

Page 31: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Open the Property Palette for the

EMPLOYEE_TYPE canvas

Change the window to EMPLOYEE_TYPE

Page 32: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Locate the EMPLOYEETYPE item in the EMPLOYEE data

block and create a When-Validate-Item

trigger

Page 33: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Enter this source code for

the triggerFor the explanation of %ROWTYPE see the

next slide

Page 34: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

%ROWTYPE Attribute

The %ROWTYPE attribute provides a record type that represents a row in a database table. The record can store an entire row of data selected from the table or fetched from a cursor or cursor variable. Variables declared using &ROWTYPE are treated like those declared using a datatype name.

%ROWTYPE can include all the columns in a table:

emp_rec employee%ROWTYPE;

Or a subset of the columns, based on a cursor:

CURSOR XYZ IS

SELECT DepartmentNumber, DepartmentName FROM departments;

Dept_rec XYZ%ROWTYPE;

Columns in such rows have the same names and datatypes, but do not inherit constraints such as NOT NULL or default values.

Page 35: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Open the Layout Editor for

EMPLOYEE

Add a button next to Emp. Type

Page 36: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Push Button has been added. Open the property Palette and give it the following properties:Name: ADD_TYPELabel: ADD TYPE

Page 37: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Properties changed

Page 38: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Name changed

Page 39: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Create a When-Button-Pressed trigger for the ADD_TYPE item. With Triggers highlighted, click Edit,

Create

Page 40: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Enter this code

Go_block navigates to the indicated data block. If the

target block is non-enterable, an error occurs. The syntax:

Go-block (‘Block Name’);

Page 41: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Open the Property Palette for the data block EMPLOYEETYPE. Set the following properties:

Update Allowed: NoDelete Allowed: NoQuery Allowed: No

Page 42: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

1. Compile and run the form. Enter Ctrl-F11 to enter data on

the form. You must be connected to the database!

2. Enter an invalid Emp. Type

3. This warning is given

Page 43: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

Change the Emp. Type back to its original value and click the

ADD TYPE button

Page 44: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

The stacked canvas, ‘Employee Type Details’ appears on the top of the content canvas,

‘Employee Details’.

Notice that there are two windows:1. EMPLOYEE CHANGE FORM2. ADD NEW TYPEThe ADD NEW TYPE window is the active window.

Page 45: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

1. Enter a new Emp. Type as shown

2. Click Insert record3. Click Save

4. A new record will have been added to

the database

Page 46: Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas

A new record has been added to

EMPLOYEETYPE