I was playing with the example CanvasFieldEvents
what i have is 3 radio controls. (r3, r4, r5)
they should correspond to some fields f3, f4, f5. (if it maters on the CanvasFieldEvents it has 8 fields i left it that way.)
so what i want to have happen is when field 3 is clicked it will set radio 3 as selected.
like wise when f4 or f5 will update associated r4 or r5.
but also vise-versa i want when f3, or f4 or f5 is clicked on it will set correspond radio selected.
now when i click on the radio it will adjust color & leave selected the radio.
however when i click on the field it will remove selection from last radio but it doesn't set corresponding radio selected.
so none of the radios have selection.
after playing with this it seems to setting radio to selected state but it like doesn't update the screen.
because after closing the app & reopening the app it shows what should have been the last radio selected as still selected.
example is if click radio 3 it shows dot selected if then click r4 it shows selected & the field box correspond gets focus.
however i click on field5 all radios show as not selected.
however if close & reopen it shows r5 as selected.
because it seems to show what should be last selected correctly, I really can't find anything wrong with the code & it looks like it is tracking everything properly.
it seems like some sort of video refresh issue.
i was playing with the example CanvasFieldEvents pretty sure i left it as was with the exception of the radios.
oh and the starting color, set all fields to white so only active field turns yellow.
here is my code adjustments.
Local fid,evnum,mess,fset
Put fnum into fid
Put FieldEventFN(fid) into evnum
Put fid into mess
Put evnum after mess
Put mess into field 7
@@@@ should track events for == 1 - Mouse Down: The mouse button was pressed within the field.
If evnum=1 Then
@@@@@@ not working & don't know why
Put 'Field ' into mess
Append fid onto mess
Append ' was click' onto mess
SayNow mess
GotoLabel 1
@@@@@@ not working & don't know why
EndIf
@@@@ should track events for == 2 - Mouse Up: The mouse button was released within the field.
If evnum=2 Then
@@@@@@ not working & don't know why
Put 'Field ' into mess
Append fid onto mess
Append ' was click' onto mess
SayNow mess
GotoLabel 1
@@@@@@ not working & don't know why
EndIf
If evnum=5 Then
for fset=1 to 6
@ sets to white
FieldPaperColor fset,255,255,255
endfor
Put 'Field ' into mess
Append fid onto mess
SayNow mess
@ set to yellow
FieldPaperColor fid,255,255,0
@set last card clicked
@@@put
@ put radio active
if fid=3 then
RadioSetState 3,1
endif
if fid=4 then
RadioSetState 4,1
endif
if fid=5 then
RadioSetState 5,1
endif
@@@@@ mental note this fails
@@@@ RadioSetState fid,1
@@Gives the focus to the specified field.
FieldGiveFocus fid
GotoLabel 1
EndIf
If evnum=7 Then
Put FieldKeyDownFN into field 8
EndIf
label 1
i have it separated in app but here is what i have on each filed (listed it all together but seperated by "@@@@")
@@@ for fields 3 to 5 only
RadioSetState 3,1
Call FieldAction(3)
@@@@@@@@@@@
RadioSetState 4,1
Call FieldAction(4)
@@@@@@@@@@@
RadioSetState 5,1
Call FieldAction(5)
@@@@@@@@@@@
likewise here is what i have on my radio buttons
@@@ for radio3
local fset
for fset=1 to 6
@ sets to white
FieldPaperColor fset,255,255,255
endfor
@ yellow = 255,255,0
FieldPaperColor 3,255,255,0
FieldGiveFocus 3
@@@@@@@@@@@
@@@ for radio4
local fset
for fset=1 to 6
@ sets to white
FieldPaperColor fset,255,255,255
endfor
@ yellow = 255,255,0
FieldPaperColor 4,255,255,0
FieldGiveFocus 4
@@@@@@@@@@@
@@@ for radio5
local fset
for fset=1 to 6
@ sets to white
FieldPaperColor fset,255,255,255
endfor
@ yellow = 255,255,0
FieldPaperColor 5,255,255,0
FieldGiveFocus 5
@@@@@@@@@@@
the most important thing right now is the lost selection on radio buttons i think
however
if you will notice in the field control i have it working off event 5 which is mouse movement.
this was jsut how i was able to get it to work as you can see i noted event 1 & event2 not working. (you probably know but that is for the mouse click down or release. to me i don't care which works for what iam doing it doesn't matter i know some times you can care but not for what i am doing.)
I was able to get it to work how i want but i would rather it work off a click as i have a lot of buttons at the top & so if they move mouse to those but go over any of other fields, it could mess with which field should be updated if they go over a field instead of around the field. my goal is to have text inserted in to the last/currently yellow field.
i suppose if i had to choose; i would pick the mouse up (event2) so i know they are done & have selected field they want. example i guess would be if they highlight some existing text in field to select it. (but not sure to me it seems like it is the same or i regard the whole process of clicking down & lifting up as one process. even if draging & dropping stuff.)