BBjImageCtrl::setDisableable

Description

In BBj 15.00 and higher, this method sets whether the BBjImageCtrl will be grayed out when it's disabled.

Syntax

Return Value

Method

void

setDisableable(boolean p_disableable)

Parameters

Return Value

Method

p_disableable

Specifies whether the BBjImageCtrl should be grayed out when it's disabled.
0 = The BBjImageCtrl is visually identical when it's enabled and disabled.
1 = The BBjImageCtrl is grayed out when it's disabled.

Return Value

None.

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

rem ' BBjImageCtrl::setDisableable

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(newjava.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,"ScaledImage",$$)
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

BBjAPI

BBjSysGui

STBL("!COMPAT")

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.