|
open
|
|
Full name
|
pfc_w_toolbars.open
|
Access
|
public
|
Extend of
|
|
Return value
|
|
Prototype
|
event open()
|
Name
|
Datatype
|
b_visible
|
boolean
|
le_alignment
|
toolbaralignment
|
li_arraysize
|
integer
|
li_cnt
|
integer
|
li_framearrayindex
|
integer[]
|
li_rc
|
integer
|
li_sheetarrayindex
|
integer[]
|
li_titlenumber
|
integer
|
li_toolbarcount
|
integer
|
ll_row
|
long
|
lnv_conversion
|
n_cst_conversion
|
lnv_menu
|
n_cst_menu
|
ls_name
|
string
|
lw_frame
|
window
|
lw_sheet
|
window
|
s_title
|
string
|
event open;call super::open;//////////////////////////////////////////////////////////////////////////////////////////
//
// Event: open
//
// Description:
// Initialize window based on passed-in object
//
//////////////////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1999 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////////////////
boolean b_visible
integer li_toolbarcount
integer li_framearrayindex[]
integer li_sheetarrayindex[]
integer li_cnt
integer li_titlenumber
integer li_arraysize
integer li_rc
long ll_row
string s_title
string ls_name
toolbaralignment le_alignment
n_cst_menu lnv_menu
n_cst_conversion lnv_conversion
window lw_frame
window lw_sheet
ib_disableclosequery = true
gb_position.SetPosition (tobottom!)
iapp_object = GetApplication()
inv_toolbarattrib = message.PowerObjectParm
// Get frame window passed in
lw_frame = inv_toolbarattrib.iw_owner
// Get the active sheet of the MDI frame
if IsValid (lw_frame) then lw_sheet = lw_frame.GetActiveSheet()
// Set the Visible and Enabled attributes of the window
cbx_text.enabled = inv_toolbarattrib.ib_largebuttonsenabled
cbx_tips.enabled = inv_toolbarattrib.ib_tooltipsenabled
if cbx_text.enabled = false and cbx_tips.enabled = false then
gb_app.enabled = false
end if
gb_position.enabled = inv_toolbarattrib.ib_positionenabled
rb_top.enabled = inv_toolbarattrib.ib_positionenabled
rb_bottom.enabled = inv_toolbarattrib.ib_positionenabled
rb_left.enabled = inv_toolbarattrib.ib_positionenabled
rb_right.enabled = inv_toolbarattrib.ib_positionenabled
rb_floating.enabled = inv_toolbarattrib.ib_positionenabled
//////////////////////////////////////////////////////////////////////////////////////////
// Determine if frame toolbar(s) exists and add to listbox.
// Note: li_ToolbarCount must match the Position of the new entry on lb_ToolBar.
//////////////////////////////////////////////////////////////////////////////////////////
if IsValid (lw_frame) then
// Get an array containing all unique ToolbarItemBarIndex(s)
If lnv_menu.of_GetAllToolbarIndex (lw_frame.MenuID, li_framearrayindex) > 0 Then
li_arraysize = UpperBound (li_framearrayindex[])
For li_cnt = 1 to li_arraysize
li_rc = lw_frame.GetToolbar (li_framearrayindex[li_cnt], b_visible, le_alignment, s_title)
If li_rc > 0 Then
li_toolbarcount++
inv_toolbar[li_toolbarcount].iw_owner = lw_frame
inv_toolbar[li_toolbarcount].i_barindex = li_framearrayindex[li_cnt]
inv_toolbar[li_toolbarcount].b_visible = b_visible
inv_toolbar[li_toolbarcount].e_alignment = le_alignment
inv_toolbar[li_toolbarcount].s_title = s_title
// Set the Toolbar title
ls_name = inv_toolbar[li_toolbarcount].s_title
if Len (ls_name) = 0 then
li_titlenumber ++
ls_name = "Frame Toolbar"
If li_titlenumber > 1 Then ls_name = ls_name+String (li_titlenumber)
End If
ll_row = dw_toolbars.InsertRow (0)
dw_toolbars.object.toolbarname[ll_row] = ls_name
dw_toolbars.object.toolbarvisible[ll_row] = lnv_conversion.of_String (inv_toolbar[li_toolbarcount].b_visible, "YN")
inv_toolbar[li_toolbarcount].s_displayname = ls_name
End If
Next
end if
end if
//////////////////////////////////////////////////////////////////////////////////////////
// Determine if sheet toolbar(s) exists and add to listbox.
// Note: li_ToolbarCount must match the Position of the new entry on lb_ToolBar.
//////////////////////////////////////////////////////////////////////////////////////////
if IsValid (lw_sheet) then
li_titlenumber = 0
// Get an array containing all unique ToolbarItemBarIndex(s)
If lnv_menu.of_GetAllToolbarIndex (lw_sheet.MenuID, li_sheetarrayindex) > 0 Then
li_arraysize = UpperBound (li_sheetarrayindex[])
For li_cnt = 1 to li_arraysize
li_rc = lw_sheet.GetToolbar (li_sheetarrayindex[li_cnt], b_visible, le_alignment, s_title)
If li_rc > 0 Then
li_toolbarcount++
inv_toolbar[li_toolbarcount].iw_owner = lw_sheet
inv_toolbar[li_toolbarcount].i_barindex = li_sheetarrayindex[li_cnt]
inv_toolbar[li_toolbarcount].b_visible = b_visible
inv_toolbar[li_toolbarcount].e_alignment = le_alignment
inv_toolbar[li_toolbarcount].s_title = s_title
// Set the Toolbar title
ls_name = inv_toolbar[li_toolbarcount].s_title
if Len (ls_name) = 0 then
li_titlenumber ++
ls_name = "Sheet Toolbar"
If li_titlenumber > 1 Then ls_name = ls_name + String (li_titlenumber)
End If
ll_row = dw_toolbars.InsertRow (0)
dw_toolbars.object.toolbarname[ll_row] = ls_name
dw_toolbars.object.toolbarvisible[ll_row] = lnv_conversion.of_String (inv_toolbar[li_toolbarcount].b_visible, "YN")
inv_toolbar[li_toolbarcount].s_displayname = ls_name
End If
Next
end if
end if
// If no toolbars exist, disable controls.
if li_toolbarcount = 0 then
cb_ok.enabled = false
cbx_text.enabled = false
cbx_tips.enabled = false
gb_position.enabled = false
gb_app.enabled = false
rb_top.enabled = false
rb_bottom.enabled = false
rb_right.enabled = false
rb_left.enabled = false
rb_floating.enabled = false
dw_toolbars.enabled = false
return
End If
// Set application text and tips settings
cbx_text.checked = iapp_object.toolbartext
cbx_tips.checked = iapp_object.toolbartips
// Set current toolbar to first
if dw_toolbars.RowCount() > 0 then
dw_toolbars.SetRow (1)
dw_toolbars.event rowfocuschanged (1)
end if
end event