main logo
Subject: ctoolbarbutton
Author: graeme thomson
Posted: 2002/04/17 04:25:01
 
View Entire Thread
New Search


cToolbarButton has a property lEnabled. Also ENABLED is Protected.

I am unable to find any calls to lEnabled. does anyone know if it is used anywhere.

The reason I ask is that it seems to me that it could be usefully employed by setting it programmatically from the form RefreshToolbar() property or from a toolbarbutton method such as GetEnabled().
I have toolbarbuttons which I need to enable/disable depending on the ActivePage in a pageform.
It can't be done directly because ENABLED is protected.

Something like the following in cToolbarbutton.Setenabled()

tlEnabled = iif(tlEnabled,THIS.lEnabled,tlEnabled)

- if tlEnabled is FALSE then everything is DISABLED anyway -

and then set the enabled values for the toolbarbutton and the menu in the rest of the code as currently.

cNewButton for instance passes a parameter to SetEnabled() and bypasses the toolbar SetEnabled()

Perhaps all calls to button SetEnabled should go via toolbar setenabled and this proposal achieves this.
The code in cNewbutton.Refresh() would be in GetEnabled()

Any thoughts?

I can do this myself of course but as it needs to be in the c-layer it would break the principle of not touching the c-layer.
 
©2002 graeme thomson
<-- Prior Message New Search Next Message -->