I made a simply listbox to show bitmaps
ON DBLCLICK action I insert an IF
each record fron second is 1 Character
sample : "S" or "N" or "C"
REDEFINE LISTBOX oLbx FIELDS HEADER "","1","2","3","4","5","6","7","8","9","10" ;
ID 300 OF oDlg UPDATE ;
SIZES 60, 35, 35, 35,35,35,35,35,35,35,35 ;
ON DBLCLICK ( (IF( aData[oLbx:nAt, oLbx:nColAct] = 'S', ;
aData[oLbx:nAt, oLbx:nColAct] := 'N', ;
aData[oLbx:nAt, oLbx:nColAct] := 'S'), ;
IF ( aData[oLbx:nAt, oLbx:nColAct] = 'N' ,;
aData[oLbx:nAt, oLbx:nColAct] := 'C' ,;
aData[oLbx:nAt, oLbx:nColAct] := 'N')),;
oLbx:Drawselect() )
If I use only IF( aData[oLbx:nAt, oLbx:nColAct] = 'S', ;
aData[oLbx:nAt, oLbx:nColAct] := 'N', ;
aData[oLbx:nAt, oLbx:nColAct] := 'S')
the test run ok ( with two bitmap) when I insert also the third parameter I have problems
the problem is I need 3 state "S" "N" and "C" on each state there is a different bitmap
oLbx:bLine:={|| { aData[oLbx:nAt,1],;
IF( aData[oLbx:nAt,2] = 'S', oBmpYes, IF (aData[oLbx:nAt,2] = 'C',oBmpCon,oBmpNo) ),;
IF( aData[oLbx:nAt,3] = 'S', oBmpYes, IF (aData[oLbx:nAt,2] = 'C',oBmpCon,oBmpNo) ),;
IF( aData[oLbx:nAt,4] = 'S', oBmpYes, IF (aData[oLbx:nAt,2] = 'C',oBmpCon,oBmpNo) ),;
IF( aData[oLbx:nAt,5] = 'S', oBmpYes, IF (aData[oLbx:nAt,2] = 'C',oBmpCon,oBmpNo) ),;
IF( aData[oLbx:nAt,6] = 'S', oBmpYes, IF (aData[oLbx:nAt,2] = 'C',oBmpCon,oBmpNo) ),;
IF( aData[oLbx:nAt,7] = 'S', oBmpYes, IF (aData[oLbx:nAt,2] = 'C',oBmpCon,oBmpNo) ),;
IF( aData[oLbx:nAt,8] = 'S', oBmpYes, IF (aData[oLbx:nAt,2] = 'C',oBmpCon,oBmpNo) ),;
IF( aData[oLbx:nAt,9] = 'S', oBmpYes, IF (aData[oLbx:nAt,2] = 'C',oBmpCon,oBmpNo) ),;
IF( aData[oLbx:nAt,10] = 'S', oBmpYes, IF (aData[oLbx:nAt,2] = 'C',oBmpCon,oBmpNo) ),;
IF( aData[oLbx:nAt,11] = 'S', oBmpYes, IF (aData[oLbx:nAt,2] = 'C',oBmpCon,oBmpNo) );
} }
I see only two bitmap
HOw I can make it ?
IF on 3 state on doubleclick action
IF on 3 state on doubleclick action
Best Regards, Saludos
Falconi Silvio
Falconi Silvio
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: IF on 3 state on doubleclick action
Silvio,
How about putting the bitmaps in an array and doing:
aBMP[at("CSN")]
Regards,
James
How about putting the bitmaps in an array and doing:
aBMP[at("CSN")]
Regards,
James
Re: IF on 3 state on doubleclick action
James can you send me a sample because i try to create itr but I not Know How make it
I try to create it for two state "S" and "N" and it run ok how you can see in this picture
NOw I want add a new bitmap and I not Know howe add it
I try to create it for two state "S" and "N" and it run ok how you can see in this picture
NOw I want add a new bitmap and I not Know howe add it
Best Regards, Saludos
Falconi Silvio
Falconi Silvio
Re: IF on 3 state on doubleclick action
PERHAPS FOUND THE SOLUTION
REDEFINE LISTBOX oLbx FIELDS HEADER "","1","2","3","4","5","6","7","8","9","10" ;
ID 300 OF oDlg UPDATE ;
SIZES 60, 35, 35, 35,35,35,35,35,35,35,35 ;
ON DBLCLICK IIF( aData[oLbx:nAt,2] = 'S', aData[oLbx:nAt, oLbx:nColAct] := 'N',;
(IF ( aData[oLbx:nAt, oLbx:nColAct] = 'N',;
aData[oLbx:nAt, oLbx:nColAct] := 'C',;
aData[oLbx:nAt, oLbx:nColAct] := 'S')) );
oLbx:Drawselect()
BUT NOT RUN OK
REDEFINE LISTBOX oLbx FIELDS HEADER "","1","2","3","4","5","6","7","8","9","10" ;
ID 300 OF oDlg UPDATE ;
SIZES 60, 35, 35, 35,35,35,35,35,35,35,35 ;
ON DBLCLICK IIF( aData[oLbx:nAt,2] = 'S', aData[oLbx:nAt, oLbx:nColAct] := 'N',;
(IF ( aData[oLbx:nAt, oLbx:nColAct] = 'N',;
aData[oLbx:nAt, oLbx:nColAct] := 'C',;
aData[oLbx:nAt, oLbx:nColAct] := 'S')) );
oLbx:Drawselect()
BUT NOT RUN OK
Best Regards, Saludos
Falconi Silvio
Falconi Silvio
Re: IF on 3 state on doubleclick action
any one can help me please?
Best Regards, Saludos
Falconi Silvio
Falconi Silvio
Re: IF on 3 state on doubleclick action
Silvio, if the order of the threestate is SNC I think you can reduce your code with
Code: Select all
aData[oLbx:nAt, oLbx:nColAct] := SubStr("SNCS",At(aData[oLbx:nAt, oLbx:nColAct],"SNCS")+1,1); oLbx:Drawselect()