|
rbuttonup
|
|
Full name
|
pfc_u_lvs.rbuttonup
|
Access
|
public
|
Extend of
|
|
Return value
|
|
Prototype
|
event rbuttonup(unsignedlong,integer,integer)
|
Name
|
Datatype
|
lb_frame
|
boolean
|
le_align
|
alignment
|
li_index
|
integer
|
li_rc
|
integer
|
li_selected
|
integer
|
li_width
|
integer
|
lm_view
|
m_lvs
|
ls_label
|
string
|
lw_childparent
|
window
|
lw_frame
|
window
|
lw_parent
|
window
|
lw_sheet
|
window
|
event rbuttonup;//////////////////////////////////////////////////////////////////////////////
//
// Event: rbuttonup
//
// Description: popup menu
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 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 lb_frame
integer li_rc
integer li_index, li_width, li_selected
string ls_label
alignment le_align
window lw_parent
window lw_frame
window lw_sheet
window lw_childparent
m_lvs lm_view
// Determine if RMB popup menu should occur
if not ib_rmbmenu then
return 1
end if
// Determine parent window for PointerX, PointerY offset
this.of_GetParentWindow (lw_parent)
if IsValid (lw_parent) then
// Get the MDI frame window if available
lw_frame = lw_parent
do while IsValid (lw_frame)
if lw_frame.windowtype = mdi! or lw_frame.windowtype = mdihelp! then
lb_frame = true
exit
else
lw_frame = lw_frame.ParentWindow()
end if
loop
if lb_frame then
// If MDI frame window is available, use it as the reference point for the
// popup menu for sheets (windows opened with OpenSheet function) or child windows
if lw_parent.windowtype = child! then
lw_parent = lw_frame
else
lw_sheet = lw_frame.GetFirstSheet()
if IsValid (lw_sheet) then
do
// Use frame reference for popup menu if the parentwindow is a sheet
if lw_sheet = lw_parent then
lw_parent = lw_frame
exit
end if
lw_sheet = lw_frame.GetNextSheet (lw_sheet)
loop until IsNull(lw_sheet) Or not IsValid (lw_sheet)
end if
end if
else
// SDI application. All windows except for child windows will use the parent
// window of the control as the reference point for the popmenu
if lw_parent.windowtype = child! then
lw_childparent = lw_parent.ParentWindow()
if IsValid (lw_childparent) then
lw_parent = lw_childparent
end if
end if
end if
else
return 1
end if
// Create popup menu
if IsNull(lm_view) Or not IsValid (lm_view) then
lm_view = create m_lvs
lm_view.of_SetParent (this)
end if
// Set the values of the Arrange Items submenu
If isvalid(inv_sort) then
li_index = 1
li_rc = GetColumn (li_index, ls_label, le_align, li_width)
do while li_rc = 1
if li_index >=1 and li_index <= 10 then
lm_view.m_viewitem.m_arrangeicons.item[li_index].text = "by " + ls_label
lm_view.m_viewitem.m_arrangeicons.item[li_index].microhelp = "Sorts items by " + ls_label
lm_view.m_viewitem.m_arrangeicons.item[li_index].visible = true
end if
li_index++
li_rc = GetColumn (li_index, ls_label, le_align, li_width)
loop
else
lm_view.m_viewitem.m_arrangeicons.enabled = false
end if
// Determine if the Auto Arrange Icons item should be enabled
if this.view = ListViewLargeIcon! or this.view = ListViewSmallIcon! then
lm_view.m_viewitem.m_arrangeicons.m_autoarrange.enabled = true
lm_view.m_viewitem.m_arrangeicons.m_autoarrange.checked = this.autoarrange
else
lm_view.m_viewitem.m_arrangeicons.m_autoarrange.enabled = false
lm_view.m_viewitem.m_arrangeicons.m_autoarrange.checked = false
end if
li_selected = this.totalselected()
// we have clicked on an item
If li_selected > 0 Then
lm_view.m_viewitem.m_delete.visible = True
lm_view.m_viewitem.m_dash15.visible = True
If li_selected > 1 Then
lm_view.m_viewitem.m_rename.visible = False
Else
If this.editlabels Then
lm_view.m_viewitem.m_rename.visible = True
Else
lm_view.m_viewitem.m_rename.visible = False
End IF
End If
Else
// We are not on an item
lm_view.m_viewitem.m_delete.visible = False
lm_view.m_viewitem.m_rename.visible = False
End IF
this.event pfc_prermbmenu (lm_view)
lm_view.m_viewitem.PopMenu (lw_parent.PointerX() + 5, lw_parent.PointerY() + 10)
If IsValid(lm_view) Then Destroy lm_view
return 1
end event
Name
|
Owner
|
menu.popmenu |
menu
|
window.getfirstsheet |
window
|
window.getnextsheet |
window
|
window.parentwindow |
window
|
window.pointerx |
window
|
window.pointery |
window
|
listview.getcolumn |
listview
|
listview.totalselected |
listview
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.isvalid |
systemfunctions
|
pfc_u_lvs.of_getparentwindow |
pfc_u_lvs
|
pfc_m_lvs.of_setparent |
pfc_m_lvs
|
pfc_u_lvs.pfc_prermbmenu |
pfc_u_lvs
|