Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying value in graphically form for a Grid

Status
Not open for further replies.

prakashroch

Technical User
May 2, 2002
21
0
0
US
Hello,
I have grid, which displays many records during run time. I have a column in the grid that I want to display graphically say in form of LED's or bulbs. LED’s are circular shaped and are placed outside, adjacent to the row of the grid. There are 5 leads for each row. I can change the color of circular object depending upon the value of that column in a particular record. Say if the value is 2 then 2 LED’s will glow.
How can it be done??
Thanks
 
Prakashroch,

I'm not sure if it's what you are looking for:

1. I created 5 container classes (for your five colors) and on each one I placed a shape (with curvature of 50 to form a circle)and each one of these shapes a different colors.

2. I created a grid (with 3 columns for my sample) and in the third column I use the dynamicCurrentcontrol of the third column to switch between the different containers depending on the conditions.

I relalized you may have wanted the LED outside of the grid, but this way I can control the conditions of the current record more easely.

If you need me to e-mail the sample to you let me know.

 
Hi Mike,

could you perhaps let me see your sample too?
I never saw this interesting use of colors before...

My adress:
KBriesemeister@t-online.de


Best regards from Germany
where it is very sunny - unfortunately there are only clouds between....

Klaus
 
Hi Mike,

Can You send me the sample on pa_gandhi@hotmail.com

Thanks
 
Hi Mike
What i was looking for is if the EMP_ID ="2" then there would be 2 led's
if the EMP_ID ="4" then there would be 4 led's
Doesnt matter if the color of all the leds is same.

Hope this is clear if not please let me know
Thanks

 
It works ……
In the class i added the number of LED's i wanted in each of "myled#" so in case of "myled4" there are 4 leds of same color in it.
Mike if I am not bothering can you explain me how the class works.

Thanks a lot
Prakash
 
The class works like this.
I created a container class and on it I put a shape (round = curvature = 50)(transparent). I then subclassed it 5 times and each of the subclasses I changed the color of the shapes.
I then add all the subclasses to the grid's column 2 as currentcontrols.
And in the init of the grid I check for the proper dynamicCurrentcontrol:
THISFORM.grid1.columns(2).dynamicCurrentControl = "THISFORM.current()"

And in the method "Current" here is the code:
DO CASE
CASE ALLTRIM(EMP_ID) = "1"
RETURN ("myled11") && Yellow
CASE ALLTRIM(EMP_ID) = "2"
RETURN ("myled21") && Orange
CASE ALLTRIM(EMP_ID) = "3"
RETURN ("myled31") && Blue
CASE ALLTRIM(EMP_ID) = "4"
RETURN ("myled41") && Green
CASE ALLTRIM(EMP_ID) = "5"
RETURN ("myled51") && Pink
OTHERWISE
RETURN ("") && No color
ENDCASE

This it.

Hope that help.

Mike


 
I was wondering how RETURN ("myled11") works coz the subclass names are myled1 ,myled2 so on ??
Thanks for your help
 
When you add them to the column's current control, it's like subclassing the subclass, and it automaticaly takes on the extra "1" at the end of it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top