** METHOD: Toolbars.SetObjectStates LPARAMETERS lEnabled ** Loop once for each array element FOR nToolbar = 1 TO ALEN(This.aToolbars) ** Attempt to extract a toolbar reference from the array oToolbar = This.aToolbars[nToolbar] ** If the element contains a toolbar... IF TYPE("oToolbar") = "O" AND NOT ISNULL(oToolbar) ** Call the method on the toolbar to enable/disable buttons oToolbar.SetObjectStates(lEnabled) ENDIF ENDFORNext, in the toolbar's SetObjectStates method:
** METHOD: ToolbarBase.SetObjectStates LPARAMETERS lEnabled ** Loop once for each control on the toolbar FOR nControl = 1 TO This.ControlCount ** Create a reference to the control oControl = This.Controls[nControl] ** If the control contains a SkipFor method... IF PEMSTATUS(oControl, "SkipFor", 5) ** Run the SkipFor condition lEnabled = oObject.SkipFor() ** Set the control's enabled state accordingly oObject.Enabled = lEnabled ENDIF ENDFORThen, in the subclass for the tooblar button, add a SkipFor method. After placing
oToolbars.SetObjectStates(.F.)