 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ugo Galbiati Guest
|
Posted: Fri Nov 14, 2003 10:05 am Post subject: Writing a db-grid component |
|
|
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
|
Posted: Fri Nov 14, 2003 7:09 pm Post subject: Re: Writing a db-grid component |
|
|
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 |
|
 |
|
|
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
|
|