Schultz’s PowerBuilder Notes

PFC Sheet Management (n_cst_winsrv_sheetmanager)

The sheet management service provides support for management of multiple sheets.
It includes the following features:

  • Arrange sheets in layer, cascade, horizontal, or vertical format
  • Restore sheets to previous state and position before last arrange operation
  • Obtain the number of open sheets
  • Populate an array with the handles of open sheets
  • Obtain a list of the open sheets of a specific class or title

Example of the Sheet Manager in action

Get a handle on the sheet with the class name of w_sheet_employee_roster.

// Function: wf_findroster()
// Access: private
// Arguments: none
// Returns: long

Boolean lb_found = FALSE
Integer li_return
Long ll_total_sheets, ll_sheet_cnt, ll_rc
String ls_sheet
window lw_opensheets[]
w_sheet_employee_roster lw_roster
n_cst_winsrv_sheetmanager lnv_sheetmanager

ll_rc = 1
ls_sheet = ‘w_sheet_employee_roster’

lnv_sheetmanager = create n_cst_winsrv_sheetmanager
ll_rc = lnv_sheetmanager.of_SetRequestor(gnv_app.of_getframe())
li_return = lnv_sheetmanager.of_GetSheetsByClass(lw_opensheets, ls_sheet)

if ll_rc > 0 then
if li_return > 0 then
ll_total_sheets = UpperBound(lw_opensheets)
Do while ll_sheet_cnt < ll_total_sheets AND lb_found = FALSE ll_sheet_cnt ++ if lw_opensheets[ll_sheet_cnt].ClassName() = ls_sheet then
lb_found = TRUE
end if

if lb_found then
lw_roster = lw_opensheets[ll_sheet_cnt]
iw_roster = lw_roster
if ib_multiplecmtrpt then
// Drive open the multiple worker comments report
ib_multiplecmtrpt = false
end if

if ib_dislist then
//Create Distribution list
if wf_create_dislist() < 0 then ll_rc = -1 messagebox("Error: m_frame_lm", "Error: wf_create_dis_list() < 0.~n" + & "Please contact system administrator.") end if ib_dislist = false end if end if else ll_rc = -1 messagebox("Information", "Employee Roster window not opened.") end if else ll_rc = -1 messagebox("Error: m_frame_lm::wf_findroster()",& "Error: lnv_sheetmanager.of_SetRequestor() < 0. Please contact system administrator.") end if destroy lnv_sheetmanager Return ll_rc [/sourcecode]


June 16, 2008 - Posted by | 3. PFC, Window Services | , , , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: