• No results found

Using the Library Painter

Detailed Instructions

Task 2: Using the Library Painter

1. Click ToolsÆLibrary Painter on the menu (or click the Library icon on the PowerBar).

2. The default Library Painter looks like Windows Explorer. It has very similar functionality. However, the true use of the Library Painter, is to provide a utility to manage your PowerBuilder libraries (PBLs).

3. The default Library Painter has two views, a tree (left) and a list (right). In the Tree view, right-click in a null area. You will see the context menu:

4. Select Set Root… and when prompted, select Current Workspace and click OK. 5. The Tree view of the Library Painter should now mirror that of the System Tree.

12. Whenever you use a resource, such as a GIF in a Picture control, you should add the location and filename to your PBR file.

13. In the File Editor, place your first reference as follows:

14. Click FileÆSave As…

15. On the Save dialog, navigate to your Student directory, change the Save As Type drop down to Resource Files, and name the file SybHealth. The PBR extension will automatically be appended.

16. Close the File Editor.

Task 2: Using the Library Painter

1. Click ToolsÆLibrary Painter on the menu (or click the Library icon on the PowerBar).

2. The default Library Painter looks like Windows Explorer. It has very similar functionality. However, the true use of the Library Painter, is to provide a utility to manage your PowerBuilder libraries (PBLs).

3. The default Library Painter has two views, a tree (left) and a list (right). In the Tree view, right-click in a null area. You will see the context menu:

4. Select Set Root… and when prompted, select Current Workspace and click OK. 5. The Tree view of the Library Painter should now mirror that of the System Tree.

6. The Library Painter has been part of PowerBuilder for a long time. The System Tree was new in PowerBuilder 8. Because it is typically in the foreground, developers tend to use the System Tree more than the Library Painter; however, there are some good reasons to use the Library Painter.

7. When in the Library Painter, remember is to use the Tree view as a navigator and the List view when performing operations on the contents of PBLs. The Tree view does not support multi-selecting objects. The List view does. The List view also provides additional valuable information.

8. Using the Tree view of the Library Painter, expand the SybHealth_target and then click (single-click), on the visual_controls_base.pbl. The contents of that PBL will display in the List view as seen below:

9. What valuable pieces of information does the List view contain beside the object name?

_____________________________________________________________________ _____________________________________________________________________ _____________________________________________________________________ 10. On the menu, click EntryÆLibraryÆCreate or click the Create Library icon on the

PainterBar.

11. When prompted, create a new PBL named Trash in your Student folder. No comments need to be added. Click Save.

12. Did the System Tree or Library Painter display your new PBL? Are PBLs created in the Library Painter added to the Library List?

_____________________________________________________________________

6. The Library Painter has been part of PowerBuilder for a long time. The System Tree was new in PowerBuilder 8. Because it is typically in the foreground, developers tend to use the System Tree more than the Library Painter; however, there are some good reasons to use the Library Painter.

7. When in the Library Painter, remember is to use the Tree view as a navigator and the List view when performing operations on the contents of PBLs. The Tree view does not support multi-selecting objects. The List view does. The List view also provides additional valuable information.

8. Using the Tree view of the Library Painter, expand the SybHealth_target and then click (single-click), on the visual_controls_base.pbl. The contents of that PBL will display in the List view as seen below:

9. What valuable pieces of information does the List view contain beside the object name?

_____________________________________________________________________ _____________________________________________________________________ _____________________________________________________________________ 10. On the menu, click EntryÆLibraryÆCreate or click the Create Library icon on the

PainterBar.

11. When prompted, create a new PBL named Trash in your Student folder. No comments need to be added. Click Save.

12. Did the System Tree or Library Painter display your new PBL? Are PBLs created in the Library Painter added to the Library List?

13. Use the Tree view of the Library Painter to navigate to the sybhealth_target. Expand and click on the visual_controls_base.pbl, displaying its contents in the List view. 14. In the Library Painter’s List view, hold down the Ctrl key click to select the first 5

objects in that PBL. You could also perform a lasso select with the mouse.

15. With your mouse over one of the selected objects, right-click and select Move… from the context menu. Move these objects to your new trash.pbl in your Student folder. Click Open to complete the move. The point of the exercise is to never outright delete objects. It is safer to move them to a temporary holding place, similar to the Windows Recycle Bin.

16. Now move those objects back into the visual_controls_base.pbl. There are many ways to do this. One includes right-clicking over the Tree view of the Library Painter and selecting Set Root…

17. Select Directory under Set Root to. Browse to and select your Student folder. The Tree view of the Library Painter will now show all PBLs in the directory you specified. Click on the trash.pbl in the Tree view, select all of the objects, right-click and Move back to the visual_controls_base.pbl that is in the \Student\Framework folder.

18. The Library Painter can also be used to compare contents of two PBLs. To do this, you need to add a second List view to the painter. This is done by clicking ViewÆList on the PowerBuilder menu bar.

13. Use the Tree view of the Library Painter to navigate to the sybhealth_target. Expand and click on the visual_controls_base.pbl, displaying its contents in the List view. 14. In the Library Painter’s List view, hold down the Ctrl key click to select the first 5

objects in that PBL. You could also perform a lasso select with the mouse.

15. With your mouse over one of the selected objects, right-click and select Move… from the context menu. Move these objects to your new trash.pbl in your Student folder. Click Open to complete the move. The point of the exercise is to never outright delete objects. It is safer to move them to a temporary holding place, similar to the Windows Recycle Bin.

16. Now move those objects back into the visual_controls_base.pbl. There are many ways to do this. One includes right-clicking over the Tree view of the Library Painter and selecting Set Root…

17. Select Directory under Set Root to. Browse to and select your Student folder. The Tree view of the Library Painter will now show all PBLs in the directory you specified. Click on the trash.pbl in the Tree view, select all of the objects, right-click and Move back to the visual_controls_base.pbl that is in the \Student\Framework folder.

18. The Library Painter can also be used to compare contents of two PBLs. To do this, you need to add a second List view to the painter. This is done by clicking ViewÆList on the PowerBuilder menu bar.

19. The new List view will appear horizontally across the bottom of the Library Painter. By dragging and dropping a view, rearrange the painter so that it looks like the following:

20. Once you have two list views, you can drag a PBL from the Tree view to any List view creating a tool that allows you to compare PBL contents.

19. The new List view will appear horizontally across the bottom of the Library Painter. By dragging and dropping a view, rearrange the painter so that it looks like the following:

20. Once you have two list views, you can drag a PBL from the Tree view to any List view creating a tool that allows you to compare PBL contents.