BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Writing a db-grid component

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing
View previous topic :: View next topic  
Author Message
Ugo Galbiati
Guest





PostPosted: Fri Nov 14, 2003 10:05 am    Post subject: Writing a db-grid component Reply with quote



Hi,
I'm trying to write a db-grid component (inheriting from TCustomControl) and
I have two questions:

1) Standard TDBGrid scrolls all the dataset but all the other component
using the same datasource don't even feel it. How is it done?

2) When my grid is all the screen wide and is full of rows, it becomes
pretty slow on painting. I can feel it because I have a hint showed on mouse
move, that calls my component paint every move.
My Paint procedure paints all the control but I saw that when is called
after the hint moving it actually paint on the screen only what needed...
but my proc always "says" to paint all. How can I know, in the Paint
procedure, what is the rect that really needs to be painted?

Thanks,
Ugo Galbiati.


Back to top
Solerman Kaplon
Guest





PostPosted: Fri Nov 14, 2003 7:09 pm    Post subject: Re: Writing a db-grid component Reply with quote



Ugo Galbiati wrote:
Quote:
1) Standard TDBGrid scrolls all the dataset but all the other component
using the same datasource don't even feel it. How is it done?

Using the DataSet's DisableControl/EnableControl mechanism
Quote:

2) When my grid is all the screen wide and is full of rows, it becomes
pretty slow on painting. I can feel it because I have a hint showed on mouse
move, that calls my component paint every move.
My Paint procedure paints all the control but I saw that when is called
after the hint moving it actually paint on the screen only what needed...
but my proc always "says" to paint all. How can I know, in the Paint
procedure, what is the rect that really needs to be painted?

You may need to wrap the WM_PAINT message who receives the clipping
rectangle related to the invalidated region made by the hint window when
it was made invisible/moved. The clipping rectangle tell you exactly
what's need to be repainted, I guess the TDBGrid already make use of it,
but I didn't looked it to be sure.

Solerman


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.