PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → WM 19 Android - update changes to background colour of edit control in Looper
WM 19 Android - update changes to background colour of edit control in Looper
Iniciado por guest, 03,ene. 2015 19:14 - 2 respuestas
Publicado el 03,enero 2015 - 19:14
Hi All,

I have a looper control with several read-only numeric edit controls, with numbers 1-5 available. Each edit control has a linked attribute.

I want to change the background colour depending on the value, using this code:

PROCEDURE CHK_Other() noth is int = WIN_Assessments.LOOP_QRY_Assessments.ATT_other SWITCH noth CASE 0: WIN_Assessments.LOOP_QRY_Assessments.InjuriesOrDisease..BrushColor= RGB(195, 195, 195) CASE 1: WIN_Assessments.LOOP_QRY_Assessments.InjuriesOrDisease..BrushColor= RGB(34, 177, 76) CASE 2: WIN_Assessments.LOOP_QRY_Assessments.InjuriesOrDisease..BrushColor= RGB(181, 230, 29) CASE 3: WIN_Assessments.LOOP_QRY_Assessments.InjuriesOrDisease..BrushColor= RGB(255, 201, 14) CASE 4: WIN_Assessments.LOOP_QRY_Assessments.InjuriesOrDisease..BrushColor= RGB(255, 127, 39) CASE 5: WIN_Assessments.LOOP_QRY_Assessments.InjuriesOrDisease..BrushColor= RGB(237, 28, 36) END
I put the reference to the procedure in the 'Display a row of LOOP_QRY_Assessments.InjuriesOrDisease. The colours change according to the values in the first record, but do not refresh for subsequent records - they are all the same as for the first record (although the values update). The Looper gets data from a Query.

Any comments or pointers welcome. I haven't used Loopers or developed for Android for long and don't understand some of the finer points.

Thanks

Pete
Publicado el 03,enero 2015 - 19:45
Hi Peter

an attribute is linked to ONE property of a field...
so you need to create an attribute, link it to the brushcolor property of the field, then just do .......att_color=value

Just remember that EVERYTHING in loopers is an attribute, which means that direct access to anything else like a (..property), is forbidden

Best regards
Publicado el 03,enero 2015 - 20:05
Thanks very much for your help Fabrice, that has solved my problem!

And I understand Loopers a bit better now as well.

Best wishes

Pete