BBjImageCtrl::isDisableable
Description
In BBj 15.00 and higher, this method returns a boolean indicating whether the BBjImageCtrl will be grayed out when it's disabled.
Syntax
|
Return Value |
Method |
|
boolean |
isDisableable() |
Parameters
None.
Return Value
Returns a boolean indicating whether the BBjImageCtrl will be grayed out when it's disabled.
Remarks
By default, the BBjImageCtrl is not grayed out when it's disabled; the disabled control is visually indistinguishable from the enabled control. To change the default behavior, see STBL("!COMPAT","IMAGECTRL_DISABLEABLE").
Example
This example will only run with an image named "bbj.ico" in the same directory as the code, or another image called out in place of "bbj.ico" in the code.
|
rem ' BBjImageCtrl::isDisableable image$ = "https://www.basis.cloud/images/basislogo.jpg" print "Image: ",image$ sysgui = unt open (sysgui)"X0" sysgui! = bbjapi().getSysGui() imagemanager! = sysgui!.getImageManager() image! = javax.imageio.ImageIO.read(new java.net.URL(image$)) os! = new java.io.ByteArrayOutputStream() javax.imageio.ImageIO.write(image!,"jpg",os!) bytes! = os!.toByteArray() image! = imagemanager!.loadImageFromBytes(bytes!) width = image!.getWidth() height = image!.getHeight() print "Image width:",width print "Image height:",height title$ = "IMAGECTRL_DISABLEABLE" window! = sysgui!.addWindow(100,100,250,375,title$,$00090003$) window!.setCallback(window!.ON_CLOSE,"eoj") unscaled! = window!.addButton(101,25,25,200,100,"",$$) unscaled!.setImage(image!) unscaled!.setCallback(unscaled!.ON_BUTTON_PUSH,"msgbox") scaled! = window!.addButton(102,25,150,200,50,"Scaled Image",$$) scaled!.setImage(image!) scaled!.setImageSize(width/2,height/2) scaled!.setCallback(unscaled!.ON_BUTTON_PUSH,"msgbox") checkbox! = window!.addCheckBox(103,25,225,200,25,title$,$$) checkbox!.setCallback(checkbox!.ON_CHECK_ON,"setDisableableTrue") checkbox!.setCallback(checkbox!.ON_CHECK_OFF,"setDisableableFalse") disableable$="FALSE" disableable = msgbox(title$+"?",4+32)=6 if disableable then disableable$="TRUE" checkbox!.setSelected(disableable) print stbl("!COMPAT","IMAGECTRL_DISABLEABLE="+disableable$) x = (250 - width) / 2 y = 275 imagectrl! = window!.addImageCtrl(104,x,y,width,height,image!) process_events eoj: release msgbox: window!.setEnabled(0) disableable$ = Boolean.toString(imagectrl!.isDisableable()) i = msgbox(image$,0,"BBjImageCtrl::isDisableable="+disableable$) window!.setEnabled(1) return setDisableableTrue: imagectrl!.setDisableable(1) return setDisableableFalse: imagectrl!.setDisableable(0) return |
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.