1 / 46

Stacked Canvas

Learn how to create and customize stacked and content canvases in a slide presentation. Create a new form module and data block for EMPLOYEE and EMPLOYEETYPE tables. Set up canvases and windows for displaying employee information and adding new employee types.

brownmaria
Download Presentation

Stacked Canvas

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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. 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.

  2. Open a new Form Module

  3. Create a new data block using the EMPLOYEE table

  4. Use a new Content canvas

  5. Set these prompts

  6. The layout style should be Form

  7. Display only on record and title the frame Employee Details

  8. The Employee Details frame

  9. Open the Property Palette for EMPLOYEE NUMBER

  10. Change the required property to No

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

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

  13. Place this data block on a new stacked canvas

  14. Use these prompts

  15. Select the Form layout

  16. Use the Frame Title, Employee Type Details Only display one record

  17. The canvas for Employee Type Details In the Layout Editor, resize this stacked canvas to the Following: Height 75 Width 410

  18. The canvas has been resized

  19. Notice the size of the canvas

  20. 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.

  21. The names have been changed

  22. Highlight the form window, WINDOW1. Open the Property Palette and set these properties: Name: PRINCIPAL_WINDOW Title: EMPLOYEE CHANGE FORM Primary Canvas: EMPLOYEES

  23. Properties changed

  24. The window is now called PRINCIPAL_WINDOW

  25. Highlight Windows and create a new window by clicking Edit, Create

  26. The new window, WINDOW11 has been created. Open the Property Palette and set these properties: Name: EMPLOYEE_TYPE Title: ADD NEW TYPE Primary Canvas: EMPLOYEE_TYPE

  27. Properties changed

  28. For the EMPLOYEE_TYPE window, set these additional properties: X Position: 20 Y Position: 50 Width: 410 Height :75

  29. Properties changed

  30. Open the Property Palette for the EMPLOYEE_TYPE canvas Change the window to EMPLOYEE_TYPE

  31. Locate the EMPLOYEETYPE item in the EMPLOYEE data block and create a When-Validate-Item trigger

  32. Enter this source code for the trigger For the explanation of %ROWTYPE see the next slide

  33. %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.

  34. Open the Layout Editor for EMPLOYEE Add a button next to Emp. Type

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

  36. Properties changed

  37. Name changed

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

  39. 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’);

  40. Open the Property Palette for the data block EMPLOYEETYPE. Set the following properties: Update Allowed: No Delete Allowed: No Query Allowed: No

  41. 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

  42. Change the Emp. Type back to its original value and click the ADD TYPE button

  43. The stacked canvas, ‘Employee Type Details’ appears on the top of the content canvas, ‘Employee Details’. • Notice that there are two windows: • EMPLOYEE CHANGE FORM • ADD NEW TYPE • The ADD NEW TYPE window is the active window.

  44. 3. Click Save 2. Click Insert record 4. A new record will have been added to the database 1. Enter a new Emp. Type as shown

  45. A new record has been added to EMPLOYEETYPE

More Related