[futurebasic] state = Button (Id) reports 1 less than actual

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2012 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Fri, 13 Jan 2012 20:42:53 -0500
Active control, but state = Button(ID) reports _grayBtn state. _FBGetCtlRawValue...same thing.

Reporting one less than actual state. Similar to old appearance bug.


_MakeItWorkKludge = _False// change to true, i.e. + 1

Local Fn DoDialog
dim as short evnt, id
dim as short state

evnt = Dialog(0)
id = Dialog(evnt)

select evnt
case _BtnClick
Select id
case 1203

state = Button (1203, _FBGetCtlRawValue) 
 
Select state + _MakeItWorkKludge//state+1 works correctly...reports actual.
case _ActiveBtn // 1
 
Button 1203,_markedBtn
 
case _MarkedBtn // 2

Button 1203,_activeBtn
 
case _grayBtn

beep

End Select

end Select
end select
end fn

local fn addButton
 
Button 1203, _activeBtn, "Bold", (20,124)-(120,144), _checkBox
 
end fn


on dialog Fn DoDialog

Window 1
Fn addButton

do
handleEvents
until (gFBQuit)