[Gambas-user] SwitchButton with "OFF" when Enabled gets False

Tobias Boege taboege at ...626...
Fri Oct 24 17:00:17 CEST 2014


Hi Benoit,

gb.form's SwitchButton's DrawingArea_Draw() contains this:

 80   If $fValue > 0 Then
 81     If $iBg = Color.Default Then
 82       iCol = Color.SelectedBackground
 83     Else
 84       iCol = $iBg
 85     Endif
 86     If Not Me.Enabled Then iCol = Color.Desaturate(Color.Merge(iCol, Color.ButtonBackground))
 87     iCol = Color.SetAlpha(iCol, 255 * (1 - $fValue))
 88   Else
 89     iCol = Color.Default
 90   Endif

So Enabled = False has no effect (on iCol) when the button is "OFF". This
looks like it's intentional but it makes the control appear differently when
it is disabled, depending on whether it is ON or OFF... Why?

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list