Jump to content


Photo

nxPageControl DoubleBuffer


  • Please log in to reply
13 replies to this topic

#1 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 06 August 2007 - 10:20 PM

hi

in CellClick event of a grid i have code that changes values in the cds
for example:
cds.Edit;
if cds.FieldByName('val').AsInteger = 0 then
cds.FieldByName('val').AsInteger := 4
else
cds.FieldByName('val').AsInteger := 0;
cds.Post;

the result is an image displayed/not displayed accordingly
this is working perfect
the problem is that i have a nxPageControl (the grid is NOT inside the nxPageControl itself)
that flickers a bit (tabs and captions) when this happens

i added nxPC.DoubleBuffered := TRUE;
it stopped flickering but then the attached happened
when i switched between the pages (manually)
each 2-3 switches, the pagecontrol was painted ok
until again i switched between pages and so on

long time ago i had a similar problem
of the flickering X button of the pagecontrol and u fixed this flickering
without me needing to DoubleBuffer it.
mayb u can do the same here?

thanks

Attached Files

  • Attached File  db.JPG   8.35KB   9 downloads


#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 06 August 2007 - 11:16 PM

Hello Emailaya,

Maybe is better to I fix flickering.

Can you please tell me how you have change this image, do you have set ImageIndex or Glyph property?

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 06 August 2007 - 11:52 PM

imageindex
0 = icon of nothing
4 = icon

so once i change between 0 and 4, the column changes between the icon and nothing (this works gr8)

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 07 August 2007 - 12:06 AM

Hello Emailaya,

In NxPageControl.pas replace next procedure:

CODE
procedure TNxTabSheet.SetImageIndex(const Value: TImageIndex);
begin
  FImageIndex := Value;
  if FPageControl <> nil then FPageControl.RefreshPage(PageIndex);
end;


Please tell me if is now better.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 07 August 2007 - 12:21 AM

i think i was misunderstood
the change of icon is done for a certain column! in the grid
not related in anyway to the pagecontrol
(except for it being flickers when it happens)

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 07 August 2007 - 12:25 AM

Hello Emailaya,

Column doesn't have ImageIndex property (!?).

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#7 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 07 August 2007 - 12:38 AM

TnxDBImageColumn has images property
and according to the value it takes the imageindex from the imagelist

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 07 August 2007 - 12:45 AM

Hello Emailaya,

I don't understand why PageControl then flicker?

There is no reason for this. I think that you have done something wrong.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#9 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 07 August 2007 - 08:38 AM

and why did the close button of the page control flickered
when i move the mouse over the TSpeedButtons with glyphs on them?
and fact is that u solved this problem

#10 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 07 August 2007 - 03:36 PM

Hello Emailaya,

But this 2 components in your example are not connected in any way.

Regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#11 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 07 August 2007 - 04:18 PM

the only relation is
that the pagecontrol is placed right on top of the grid
meaning the bottom border of the pagecontrol is close to the top border of the grid
moreover, the pagecontrol view contains only the tabs
meaning the height of the pagecontrol is enough to show only the tabs
this is done so i wont need to change the parent of the grid each time i change page in the pagecontrol

#12 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 07 August 2007 - 04:34 PM

Hello Emailaya,

I think that there is still no connection. It will be different if one component is parent of other. In previous example, toolbar was located inside PageControl.

If you can send me a small demo, this maybe can help. Thank you.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#13 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 07 August 2007 - 04:40 PM

i can send u the application exe for u to try smile.gif

#14 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 07 August 2007 - 04:45 PM

Hello Emailaya,

It will be better some small demo with only suspicious components on it.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users