_WhenHideEval in _dcclass.prg
Posted: Tue Jan 31, 2023 3:06 am
Hi,
It looks to me that there is a problem in the _WhenHideEval function. I solved it for me, so I don't expect any changes in eXPress++.
Just to be sure that I understand it correctly. My question is for the HIDE clause.
Suppose the following in a dialog.
A GET for a variable cName.
A checkbox with a HIDE {|| empty(cName) }
So at creation the checkbox is hidden.
If I'm correct, the HIDEBLOCK of the checkbox will never be evaluated?
Maybe I'm wrong and I don't understand the logical flow of this, but it looks very strange to me.
It looks to me that there is a problem in the _WhenHideEval function. I solved it for me, so I don't expect any changes in eXPress++.
Just to be sure that I understand it correctly. My question is for the HIDE clause.
Suppose the following in a dialog.
A GET for a variable cName.
A checkbox with a HIDE {|| empty(cName) }
So at creation the checkbox is hidden.
If I'm correct, the HIDEBLOCK of the checkbox will never be evaluated?
Code: Select all
STATIC FUNCTION _WhenHideEval( lEnable, lShow, lProtect, oXbp )
IF Valtype(oXbp:whenBlock) = 'B'
lEnable:= Eval(oXbp:whenBlock,oXbp)
IF lEnable
oXbp:enable()
ELSE
oXbp:disable()
ENDIF
ENDIF
IF Valtype(oXbp:hideBlock) = 'B' .AND. oXbp:isVisible() ; -------------------------------------> hidden at creation, so isvisible() will be False and it will never be executed????
.AND. IIF(oXbp:parent:isDerivedFrom('XbpTabPage'),IIF(oXbp:parent:Minimized,.f.,.t. ),.t. )
lShow := !Eval(oXbp:hideBlock,oXbp)
IF lShow
oXbp:show()
ELSE
oXbp:hide()
ENDIF
ENDIF
IF Valtype(lProtect) == 'L' .AND. Valtype(oXbp:protectBlock) = 'B'
lProtect := Eval(oXbp:protectBlock,oXbp)
ENDIF
RETURN oXbp