Schultz’s PowerBuilder Notes

PFC Datawindow RMB Pop-up Menu


How do I disable the RMB menu

this.ib_rmbmenu = False

How do I disable select menu items

In the datawindow pfc_prermbmenu event

long ll_rc

ll_rc = wf_MenuDefaults(this, am_dw)

if ll_rc < 0 then
   MessageBox("Menu Error", "Failed to set-up the menu in wf_menudefaults")
end if&#91;/sourcecode&#93;
<p class="MsoNormal" style="padding-left:30px;"></p>
<p class="MsoNormal">The function wf_MenuDefaults(this, am_dw)</p>
<p class="MsoNormal"></p>

//////////////////////////////////////////////////////////////////////////
//
// wf_menudefaults(datawindow, m_dw)
//
//////////////////////////////////////////////////////////////////////////////

long ll_row_cnt, ll_rc

ll_rc = SUCCESS
ll_row_cnt = adw_datawindow.RowCount()

gnv_app.inv_security.of_SetSecurity(am_dw)

// Toggle the delete menu item
if ll_row_cnt > 0 then
  am_dw.m_table.m_delete.Enabled = TRUE
  am_dw.m_table.m_copy.Enabled   = TRUE
else
  am_dw.m_table.m_delete.Enabled = FALSE
  am_dw.m_table.m_copy.Enabled   = FALSE
end if 

// Disable all other right mouse button functions
am_dw.m_table.m_insert.Visible            = FALSE
am_dw.m_table.m_cut.visible               = FALSE
am_dw.m_table.m_dash11.visible            = FALSE
am_dw.m_table.m_applyall.visible          = FALSE
am_dw.m_table.m_selectall.visible         = FALSE
am_dw.m_table.m_paste.visible             = FALSE
am_dw.m_table.m_restorerow.visible        = FALSE
am_dw.m_table.m_addgenericworkers.visible = FALSE
am_dw.m_table.m_addgenerictemps.visible   = FALSE

// Disable on Hours past save
If ib_is2dayspassed Then
  am_dw.m_table.m_addrow.Enabled = FALSE
  am_dw.m_table.m_delete.Enabled = FALSE
  am_dw.m_table.m_copy.Enabled   = FALSE
End If

Return ll_rc
Advertisements

July 10, 2008 - Posted by | 3. PFC, Datawindow Services | , , ,

1 Comment »

  1. .of_setrmbmenu(false)

    Comment by Tom Granados | April 12, 2011 | Reply


Leave a Reply

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

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

%d bloggers like this: