Recent

Author Topic: What does TLazComponentQueue do?  (Read 4955 times)

Avishai

  • Hero Member
  • *****
  • Posts: 1021
What does TLazComponentQueue do?
« on: September 16, 2011, 06:34:50 pm »
What does TLazComponentQueue do? I have searched wiki and done Google search and can not find a description.
Lazarus Trunk / fpc 2.6.2 / Win32

patyi

  • Full Member
  • ***
  • Posts: 168
Re: What does TLazComponentQueue do?
« Reply #1 on: November 27, 2017, 10:31:22 am »
Yes, that is the question !
I nead somehow to define the default OnPaint properity (gradient paint) for every TPanel component across the aplication forms !
Now I do it Panel by Panel on every form, but I like to do it centralized on one place ... is possible ?  8-)

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: What does TLazComponentQueue do?
« Reply #2 on: November 27, 2017, 10:50:51 am »
Well ..... Read the sourcecode......
If you are good enough you KNOW what it does.
Specialize a type, not a var.

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: What does TLazComponentQueue do?
« Reply #3 on: November 27, 2017, 11:01:59 am »
Quote
I nead somehow to define the default OnPaint properity (gradient paint) for every TPanel component across the aplication forms !
This is what inheritance is all about...

Add this unit to your project and call it as LAST unit in the "uses" clause; in particular, it must be AFTER ExtCtrls. This will replace every panel in every form what has this unit in its "uses" after ExtCtrls. Tested on Windows and Linux gtk2/qt.

Code: Pascal  [Select][+][-]
  1. unit Unit3;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Graphics, ExtCtrls;
  9.  
  10. type
  11.   TPanel = class(ExtCtrls.TPanel)
  12.   public
  13.     procedure Paint; override;
  14.   end;
  15.  
  16.  
  17. implementation
  18.  
  19. procedure TPanel.Paint;
  20. begin
  21.   Canvas.GradientFill(Rect(0, 0, Width, Height), clWhite, clSilver, gdVertical);
  22. end;
  23.  
  24. end.
« Last Edit: November 27, 2017, 11:14:36 am by wp »

Noodly

  • Jr. Member
  • **
  • Posts: 70
Re: What does TLazComponentQueue do?
« Reply #4 on: November 27, 2017, 11:05:53 am »
Windows 10 Home, Lazarus 2.02 (svn 60954), FPC 3.04

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: What does TLazComponentQueue do?
« Reply #5 on: November 27, 2017, 11:36:24 am »
well its good to get an answer. even with 6 years delay. I would imagine that avishai already analysed the code by now though.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Noodly

  • Jr. Member
  • **
  • Posts: 70
Re: What does TLazComponentQueue do?
« Reply #6 on: November 27, 2017, 12:56:42 pm »
well its good to get an answer. even with 6 years delay. I would imagine that avishai already analysed the code by now though.

Reminds oneself to check the post's date next time  ;)
Windows 10 Home, Lazarus 2.02 (svn 60954), FPC 3.04

 

TinyPortal © 2005-2018