Welcome! Log In Create A New Profile

Advanced

WD12 - Question about a Looper control (..continuing)

Posted by Gianni Spano 
Gianni Spano
WD12 - Question about a Looper control (..continuing)
August 28, 2008 05:56PM
Here is a picture of the looper where i'm trying to play..



As you can see, i have 15 buttons (for each line in the looper) and if you see, the same button, despite it is on different row, is colorized as it was pressed..

this is my code when the button is pressed:

PROCEDURE SetColor (ID)

//ID is set to button number clicked

I is int
nMin is int
nMax is int




x is int = MouseXPos()
y is int = MouseYPos()
gnRow is int = LooperInfoXY(LOOP_Looper1, liLineNumber, x, y)



SWITCH ID
CASE 1 TO 5
nMin=1
nMax=5
CASE 6 TO 10
nMin=6
nMax=10
CASE 11 TO 15
nMin=11
nMax=15
OTHER CASE

END

FOR I=nMin TO nMax
{"LOOP_LOOPER1.SHA_Shape"+I,indControl}..BrushColor=iWhite
END
{"LOOP_LOOPER1.SHA_Shape"+ID,indControl}..BrushColor=iLightRed

Is it correct? Why the "red" color is assigned to other buttons that have the same vertical position?

Thanks in advance.

Gianni

Piet van Zanten
Re: WD12 - Question about a Looper control (..continuing)
August 28, 2008 06:55PM
Hi Gianni,

Perhaps use the looper index:
FOR I=nMin TO nMax 
{"LOOP_LOOPER1.SHA_Shape"+ID,indControl}[gnRow]..BrushColor=iWhite 
END 
{"LOOP_LOOPER1.SHA_Shape"+ID,indControl}[gnRow]..BrushColor=iLightRed
BTW: the first reference of ID has been changed to I in your example.

Or you could try to create an attribute for each button's brushcolor, then you can use something like:
FOR I=nMin TO nMax 
{"att_btncolor"+ID,indControl}[gnRow]=iWhite 
END 
{"att_btncolor"+ID,indControl}[gnRow]=iLightRed

HTH
Best regards,
Piet
Gianni Spano
Re: WD12 - Question about a Looper control (..continuing)
August 29, 2008 09:25AM
Hi Piet

Thanks for your suggestions, but the trick doesn't run..
Here is the error the program shows when the process below, as you suggested, is executed:

FOR I=nMin TO nMax
{"LOOP_LOOPER1.SHA_Shape"+ID,indControl}[gnRow]..BrushColor=iWhite
END
{"LOOP_LOOPER1.SHA_Shape"+ID,indControl}[gnRow]..BrushColor=iLightRed

-----
Error at line 43 of Local Procedure ImpostaColore process.
[ ] operator not supported by SHA_Shape1 control.

Technical Information

Project : ASL_PUA

Dump error of module <WD120OBJ.DLL> <12.00Pxe>.

- WL Call:
Processing <ASL_SkValutazMultidim.PROCEDURE.ImpostaColore>, line <43>, thread <0>

- Level: fatal error (EL_FATAL)

- Error Code: 10016

- WD55 Error Code: 0

- No system error code

- No system error message

- What happened?
[ ] operator not supported by SHA_Shape1 control.

- No debug information

- Attached Information:
EIT_PILEWL :
Local Procedure ImpostaColore (ASL_SkValutazMultidim.PROCEDURE.ImpostaColore), ligne 43
Left Button Down (WM_LBUTTONDOWN) of SHA_Shape1 ( LOOP_Looper1 ) (ASL_SkValutazMultidim.TAB_Tab1.LOOP_Looper1.SHA_Shape1), ligne 1
EIT_COMPOSANT :

EIT_DATEHEURE : 29/08/2008 09:19:26

- Identifier in .err: 10016

*********************************************************************************

Any idea?

Thanks
Gianni
Gianni Spano
Re: WD12 - Question about a Looper control (..continuing)
August 29, 2008 09:36AM
...continuing from previous message

What i'm trying to do is to obtain different sections (rows) and each control in each line of the looper must be independent from the others...

Probably i'm doing some mistake somewhere, but i don't understand why when i push a one of the 15 fives in each row, the same button is colorized in the others rows (up or down).

Any help is greatly appreciated.

Gianni
Piet van Zanten
Re: WD12 - Question about a Looper control (..continuing)
August 30, 2008 12:42PM
Hi Gianni,

Did you try the attribute? I had an issue with a looper too and contacted PCsoft. Part of their answer applies to this issue too I think,
Quote
PCsoft Techsupport:
"It's difficult to explain why. Basically a looper use only one occurrence of each control. For example, there is only one real control edt_Test_1, and therefore only one value. Only attributes are duplicated. For each row, a new attribute is used.
My note that "I" should be "ID" in your code was a mistake.

Best regards,
Piet
Gianni Spano
Re: WD12 - Question about a Looper control (..continuing)
August 30, 2008 04:24PM
Hi Piet

I have resolved the problem substituting the rows of 5 buttons with radio buttons, with the same value (1, 2, 3, etc etc).
It works fine because the radio button can be selected without cloning the selection in the others rows of the looper, as previous attempt did.
I would like to use shapes as buttons, but as we know, it is not accepted for the same evidence exposed by PcSoft: once a shape is selected (applying the background color changes from white to red), this behaviour is repeated on all rows in the looper and it is not acceptable.
I suggest PcSoft to improve the looper control to accept all possible controls designed in the rows, external activex included. It could act as a container improving the appearance of a form for input data, like exactly a table does.

Thanks again for your support
Gianni
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: