Thanks for this, Antonis ; I'll give it a try later and let you know how things 
go

Steve

 -----Original Message-----
From:   delphi-en@yahoogroups.com [mailto:[EMAIL PROTECTED]  On Behalf Of 
Antonis Tsourinakis
Sent:   26 July 2006 15:21
To:     delphi-en@yahoogroups.com
Subject:        Re: [delphi-en] Use colours to represent state of data

If I understood what do you want I prefer another approach.
In the button1 click event I would fetch the data and I would fill not the 
cells but the objects of the cells
with the a flag about the color I want, like 

   SG.Objects[col,row]:= TObject(n) 
where n could be an integer that denotes the index in a collor array e.g. 
MyArrayOfColors[1..3] of TColor

Then in the
procedure TOverviewForm.SGDrawCell(Sender: TObject; ACol, ARow:Integer;Rect: 
TRect; State: TGridDrawState);

i would have
      idx := Integer(SG.Objects[Acol, Arow);
     if idx>0 then
     begin
      SG.Canvas.Brush.Color := MyArrayOfColors[Integer(SG.Objects[Acol, Arow)]
      SG.Canvas.FillRect(Rect);
    end;
==========
So there is not need to fetch all the time the data
The code is by mind so just catch the idea
Sorry for my english
Antonis Tsourinakis



***************************************************************************
This e-mail and any files transmitted with it are confidential. If you are not 
the intended recipient, any reading, printing, storage, disclosure, copying or 
any other action taken in respect of this e-mail is prohibited and may be 
unlawful. If you are not the intended recipient, please notify the sender 
immediately by using the reply function and then permanently delete what you 
have received.
Content of emails received by this Trust will be subject to disclosure under 
the Freedom of Information Act 2000, subject to the specified exemptions, 
including the Data Protection Act 1998 and Caldicott Guardian principles.
This footnote also confirms that this email message has been swept by 
MIMESweeper and Sophos Anti-virus for the presence of computer viruses.
***************************************************************************



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to