Mastering PowerBuilder

HomePrevious Lesson: Course 3:: Session 24 :: Page 270
Next Lesson: Course 3:: Session 24 :: Page 290
Cut, copy, Paste ( Special ), Clear Services

All these services are available as basic services. You may want to turn off the relevent menu options for report DataWindows as shown below:

// Object: DataWindow user object in the window
// Event: pfc_PreRmbMenu
am_dw.m_table.m_cut.enabled = False
am_dw.m_table.m_copy.enabled = False
am_dw.m_table.m_paste.enabled = False
am_dw.m_table.m_selectall.enabled = False

If you paint a different menu for report windows, then it’s fine. Other wise, write the following code.

// Object: Window that you use for the report
// Event: pfc_PostOpen
This.MenuID.Item[2].Item[1].Enabled = FALSE
This.MenuID.Item[2].Item[3].Enabled = FALSE
This.MenuID.Item[2].Item[4].Enabled = FALSE
This.MenuID.Item[2].Item[5].Enabled = FALSE
This.MenuID.Item[2].Item[6].Enabled = FALSE
This.MenuID.Item[2].Item[7].Enabled = FALSE
This.MenuID.Item[2].Item[9].Enabled = FALSE

We advise to paint a separate menu for report windows and hide all the options that aren’t required for the report.

HomePrevious Lesson: Course 3:: Session 24 :: Page 270
Next Lesson: Course 3:: Session 24 :: Page 290