changing how disabled (tbgra)button are visualized lazarus / 39-Graphics ---------------------------------------------------------------------- Blue1987 · 2011-09-30 11:16 using TBGRAbuttons... I would like to make disablede buttons semi- transparent (say alpha 100)... is it possible? thank you, Paolo ---------------------------------------------------------------------- Blue1987 · 2011-10-02 22:55 isn't it possible? ---------------------------------------------------------------------- Blue1987 · 2011-10-04 12:11 Quote from: Blue1987 on October 03, 2011, 12:55:04 amisn't it possible? up... how can I change how "enabled/disabled" components are displayed? ---------------------------------------------------------------------- Shebuka · 2011-10-04 13:22 Try TBGRAImageButton and make the alpha layer transparent as your needs. ---------------------------------------------------------------------- Blue1987 · 2011-10-04 14:19 I am already using TBGRAbuttons... I simply would like to change how DISABLED tgrabuttons are visualized... but the question would be the same for a label, or any other component! where are the "visual settings" for "enabled/disabled" components? how can I change them? ---------------------------------------------------------------------- Blue1987 · 2011-10-06 12:32 Quote from: Blue1987 on October 04, 2011, 04:19:15 pmwhere are the "visual settings" for "enabled/disabled" components? how can I change them? up ---------------------------------------------------------------------- lainz · 2011-10-06 16:23 Most bgracontrols are like examples of the things you can do with BGRABitmap, if you want some new feature or addapt one to fit with your needs you can improve the code because it's LGPL. BTW contact Dibo if you really need that state, he is the author of that component. There is no 'visual settings' for enabled / disabled. Look, for example, the Paint code in BGRAImageButton: if Enabled then... check and draw the current state (that's modified when you move the mouse, clic, etc) else (when it is disabled) draw the disabled state. ---------------------------------------------------------------------- Blue1987 · 2011-10-09 13:34 Quote from: lainz on October 06, 2011, 06:23:21 pmMost bgracontrols are like examples of the things you can do with BGRABitmap, if you want some new feature or addapt one to fit with your needs you can improve the code because it's LGPL. BTW contact Dibo if you really need that state, he is the author of that component. There is no 'visual settings' for enabled / disabled. Look, for example, the Paint code in BGRAImageButton: if Enabled then... check and draw the current state (that's modified when you move the mouse, clic, etc) else (when it is disabled) draw the disabled state. this is the solution I am tring to implement... Code: [Select]type Tbgrabutton = class(BGRAButtons.TBGRAButton) public   procedure Paint; override; end; ... implementation procedure TBGRAButton.Paint; var   bodya, bodyn: TBody;   baserect: TRect; begin   //inherited Paint;   { Mouse stage }   case FMouseStage of     msClicked: bodya := FBodyClicked;     msHover: bodya := FBodyHover;     msNormal: bodya := FBodyNormal;   end;   { Calculating base rect }   baserect := ClientRect;   Inc(baserect.Left, Round(FBorderWidth / 2));   Inc(baserect.Top, Round(FBorderWidth / 2));   Dec(baserect.Right, Round(FBorderWidth / 2) + 1);   Dec(baserect.Bottom, Round(FBorderWidth / 2) + 1);   { Clearing previous paint }   FBGRA.Fill(BGRAPixelTransparent);   { Drawing main button }   if (FActiveButt = bbtButton) and (not FStaticButton) then     bodyn := bodya   else     bodyn := FBodyNormal;   DrawBasicBody(bodyn, Rect(baserect.Left, baserect.Top, baserect.Right -     ifthen(FStyle = bbtDropDown, ARR_SPACE), baserect.Bottom));   { Drop down arrow button }   if FStyle = bbtDropDown then   begin     if (FActiveButt = bbtDropDown) and (not FStaticButton) then       bodyn := bodya     else       bodyn := FBodyNormal;     DrawBasicBody(bodyn, Rect(baserect.Right - ARR_SPACE, baserect.Top,       baserect.Right, baserect.Bottom));     { Drawing arrow }     DrawArrow(bodyn, baserect);   end;   if FTextApplyGlobalOpacity then   begin     { Drawing text }     DrawText(bodyn.FFont.Color, bodyn.FFont.Style, bodyn.FFont.Name);     { Set global opacity }    if Enabled then FBGRA.ApplyGlobalOpacity(FGlobalOpacity) else FBGRA.ApplyGlobalOpacity(100); end   else   begin     { Set global opacity }     if Enabled then FBGRA.ApplyGlobalOpacity(FGlobalOpacity) else FBGRA.ApplyGlobalOpacity(100); { Drawing text }     DrawText(bodyn.FFont.Color, bodyn.FFont.Style, bodyn.FFont.Name);   end;   { Convert to gray if not enabled }   if not Enabled then     ConvertToGrayScale;   { Finally drawing on canvas }   FBGRA.Draw(Self.Canvas, 0, 0, False); end; but when I try to compile I get the following errors: Code: [Select]Unit1.pas(2543,16) Unit1.pas(2581,20) Error: Identifier not found "FMouseStage" Unit1.pas(2582,14) Error: Identifier not found "msClicked" Unit1.pas(2582,14) Error: Constant Expression expected Unit1.pas(2582,37) Error: Identifier not found "FBodyClicked" Unit1.pas(2583,12) Error: Identifier not found "msHover" Unit1.pas(2583,12) Error: Constant Expression expected Unit1.pas(2583,12) Error: duplicate case label Unit1.pas(2583,33) Error: Identifier not found "FBodyHover" Unit1.pas(2584,13) Error: Identifier not found "msNormal" Unit1.pas(2584,13) Error: Constant Expression expected Unit1.pas(2584,13) Error: duplicate case label Unit1.pas(2584,35) Error: Identifier not found "FBodyNormal" Unit1.pas(2589,41) Error: Identifier not found "FBorderWidth" Unit1.pas(2589,3) Error: Incompatible types: got "untyped" expected "LongInt" Unit1.pas(2590,40) Error: Identifier not found "FBorderWidth" Unit1.pas(2590,3) Error: Incompatible types: got "untyped" expected "LongInt" Unit1.pas(2591,42) Error: Identifier not found "FBorderWidth" Unit1.pas(2591,3) Error: Incompatible types: got "untyped" expected "LongInt" Unit1.pas(2592,43) Error: Identifier not found "FBorderWidth" Unit1.pas(2592,3) Error: Incompatible types: got "untyped" expected "LongInt" Unit1.pas(2595,8) Error: Identifier not found "FBGRA" Unit1.pas(2595,34) Error: Identifier not found "BGRAPixelTransparent" Unit1.pas(2598,19) Error: Identifier not found "FActiveButt" Unit1.pas(2598,54) Error: Identifier not found "FStaticButton" Unit1.pas(2601,25) Error: Identifier not found "FBodyNormal" Unit1.pas(2603,16) Error: Identifier not found "DrawBasicBody" Unit1.pas(2604,11) Error: Identifier not found "ifthen" Unit1.pas(2604,19) Error: Identifier not found "FStyle" Unit1.pas(2604,43) Error: Identifier not found "ARR_SPACE" Unit1.pas(2607,13) Error: Identifier not found "FStyle" Unit1.pas(2609,21) Error: Identifier not found "FActiveButt" Unit1.pas(2609,58) Error: Identifier not found "FStaticButton" Unit1.pas(2612,27) Error: Identifier not found "FBodyNormal" Unit1.pas(2614,18) Error: Identifier not found "DrawBasicBody" Unit1.pas(2614,57) Error: Identifier not found "ARR_SPACE" Unit1.pas(2617,14) Error: Identifier not found "DrawArrow" Unit1.pas(2620,30) Error: Identifier not found "FTextApplyGlobalOpacity" Unit1.pas(2623,20) Error: identifier idents no member "FFont" Unit1.pas(2623,39) Error: identifier idents no member "FFont" Unit1.pas(2623,58) Error: identifier idents no member "FFont" Unit1.pas(2625,26) Error: Identifier not found "FBGRA" Unit1.pas(2625,60) Error: Identifier not found "FGlobalOpacity" Unit1.pas(2625,72) Error: Identifier not found "FBGRA" Unit1.pas(2630,26) Error: Identifier not found "FBGRA" Unit1.pas(2630,60) Error: Identifier not found "FGlobalOpacity" Unit1.pas(2630,72) Error: Identifier not found "FBGRA" Unit1.pas(2632,20) Error: identifier idents no member "FFont" Unit1.pas(2632,39) Error: identifier idents no member "FFont" Unit1.pas(2632,58) Error: identifier idents no member "FFont" Unit1.pas(2637,23) Error: Identifier not found "ConvertToGrayScale" Unit1.pas(2637,23) Fatal: There were 50 errors compiling module, stopping ---------------------------------------------------------------------- Blue1987 · 2011-10-14 00:23 Quote from: Blue1987 on October 09, 2011, 03:34:45 pmQuote from: lainz on October 06, 2011, 06:23:21 pmMost bgracontrols are like examples of the things you can do with BGRABitmap, if you want some new feature or addapt one to fit with your needs you can improve the code because it's LGPL. BTW contact Dibo if you really need that state, he is the author of that component. There is no 'visual settings' for enabled / disabled. Look, for example, the Paint code in BGRAImageButton: if Enabled then... check and draw the current state (that's modified when you move the mouse, clic, etc) else (when it is disabled) draw the disabled state. this is the solution I am tring to implement... Code: [Select]type Tbgrabutton = class(BGRAButtons.TBGRAButton) public   procedure Paint; override; end; ... implementation procedure TBGRAButton.Paint; var   bodya, bodyn: TBody;   baserect: TRect; begin   //inherited Paint;   { Mouse stage }   case FMouseStage of     msClicked: bodya := FBodyClicked;     msHover: bodya := FBodyHover;     msNormal: bodya := FBodyNormal;   end;   { Calculating base rect }   baserect := ClientRect;   Inc(baserect.Left, Round(FBorderWidth / 2));   Inc(baserect.Top, Round(FBorderWidth / 2));   Dec(baserect.Right, Round(FBorderWidth / 2) + 1);   Dec(baserect.Bottom, Round(FBorderWidth / 2) + 1);   { Clearing previous paint }   FBGRA.Fill(BGRAPixelTransparent);   { Drawing main button }   if (FActiveButt = bbtButton) and (not FStaticButton) then     bodyn := bodya   else     bodyn := FBodyNormal;   DrawBasicBody(bodyn, Rect(baserect.Left, baserect.Top, baserect.Right -     ifthen(FStyle = bbtDropDown, ARR_SPACE), baserect.Bottom));   { Drop down arrow button }   if FStyle = bbtDropDown then   begin     if (FActiveButt = bbtDropDown) and (not FStaticButton) then       bodyn := bodya     else       bodyn := FBodyNormal;     DrawBasicBody(bodyn, Rect(baserect.Right - ARR_SPACE, baserect.Top,       baserect.Right, baserect.Bottom));     { Drawing arrow }     DrawArrow(bodyn, baserect);   end;   if FTextApplyGlobalOpacity then   begin     { Drawing text }     DrawText(bodyn.FFont.Color, bodyn.FFont.Style, bodyn.FFont.Name);     { Set global opacity }    if Enabled then FBGRA.ApplyGlobalOpacity(FGlobalOpacity) else FBGRA.ApplyGlobalOpacity(100); end   else   begin     { Set global opacity }     if Enabled then FBGRA.ApplyGlobalOpacity(FGlobalOpacity) else FBGRA.ApplyGlobalOpacity(100); { Drawing text }     DrawText(bodyn.FFont.Color, bodyn.FFont.Style, bodyn.FFont.Name);   end;   { Convert to gray if not enabled }   if not Enabled then     ConvertToGrayScale;   { Finally drawing on canvas }   FBGRA.Draw(Self.Canvas, 0, 0, False); end; but when I try to compile I get the following errors: Code: [Select]Unit1.pas(2543,16) Unit1.pas(2581,20) Error: Identifier not found "FMouseStage" Unit1.pas(2582,14) Error: Identifier not found "msClicked" Unit1.pas(2582,14) Error: Constant Expression expected Unit1.pas(2582,37) Error: Identifier not found "FBodyClicked" Unit1.pas(2583,12) Error: Identifier not found "msHover" Unit1.pas(2583,12) Error: Constant Expression expected Unit1.pas(2583,12) Error: duplicate case label Unit1.pas(2583,33) Error: Identifier not found "FBodyHover" Unit1.pas(2584,13) Error: Identifier not found "msNormal" Unit1.pas(2584,13) Error: Constant Expression expected Unit1.pas(2584,13) Error: duplicate case label Unit1.pas(2584,35) Error: Identifier not found "FBodyNormal" Unit1.pas(2589,41) Error: Identifier not found "FBorderWidth" Unit1.pas(2589,3) Error: Incompatible types: got "untyped" expected "LongInt" Unit1.pas(2590,40) Error: Identifier not found "FBorderWidth" Unit1.pas(2590,3) Error: Incompatible types: got "untyped" expected "LongInt" Unit1.pas(2591,42) Error: Identifier not found "FBorderWidth" Unit1.pas(2591,3) Error: Incompatible types: got "untyped" expected "LongInt" Unit1.pas(2592,43) Error: Identifier not found "FBorderWidth" Unit1.pas(2592,3) Error: Incompatible types: got "untyped" expected "LongInt" Unit1.pas(2595,8) Error: Identifier not found "FBGRA" Unit1.pas(2595,34) Error: Identifier not found "BGRAPixelTransparent" Unit1.pas(2598,19) Error: Identifier not found "FActiveButt" Unit1.pas(2598,54) Error: Identifier not found "FStaticButton" Unit1.pas(2601,25) Error: Identifier not found "FBodyNormal" Unit1.pas(2603,16) Error: Identifier not found "DrawBasicBody" Unit1.pas(2604,11) Error: Identifier not found "ifthen" Unit1.pas(2604,19) Error: Identifier not found "FStyle" Unit1.pas(2604,43) Error: Identifier not found "ARR_SPACE" Unit1.pas(2607,13) Error: Identifier not found "FStyle" Unit1.pas(2609,21) Error: Identifier not found "FActiveButt" Unit1.pas(2609,58) Error: Identifier not found "FStaticButton" Unit1.pas(2612,27) Error: Identifier not found "FBodyNormal" Unit1.pas(2614,18) Error: Identifier not found "DrawBasicBody" Unit1.pas(2614,57) Error: Identifier not found "ARR_SPACE" Unit1.pas(2617,14) Error: Identifier not found "DrawArrow" Unit1.pas(2620,30) Error: Identifier not found "FTextApplyGlobalOpacity" Unit1.pas(2623,20) Error: identifier idents no member "FFont" Unit1.pas(2623,39) Error: identifier idents no member "FFont" Unit1.pas(2623,58) Error: identifier idents no member "FFont" Unit1.pas(2625,26) Error: Identifier not found "FBGRA" Unit1.pas(2625,60) Error: Identifier not found "FGlobalOpacity" Unit1.pas(2625,72) Error: Identifier not found "FBGRA" Unit1.pas(2630,26) Error: Identifier not found "FBGRA" Unit1.pas(2630,60) Error: Identifier not found "FGlobalOpacity" Unit1.pas(2630,72) Error: Identifier not found "FBGRA" Unit1.pas(2632,20) Error: identifier idents no member "FFont" Unit1.pas(2632,39) Error: identifier idents no member "FFont" Unit1.pas(2632,58) Error: identifier idents no member "FFont" Unit1.pas(2637,23) Error: Identifier not found "ConvertToGrayScale" Unit1.pas(2637,23) Fatal: There were 50 errors compiling module, stopping up ---------------------------------------------------------------------- lainz · 2011-10-14 01:35 ConvertToGrayScale; << override that procedure and add this line: ABGRA.ApplyGlobalOpacity(100); TCustomBGRAButton = class(TBGRAButton) and change your buttons to TCustomBGRAButton in each lfm ---------------------------------------------------------------------- Blue1987 · 2011-10-16 23:56 Quote from: lainz on October 14, 2011, 03:35:17 amConvertToGrayScale; << override that procedure and add this line: ABGRA.ApplyGlobalOpacity(100); TCustomBGRAButton = class(TBGRAButton) and change your buttons to TCustomBGRAButton in each lfm now when I open the project, it tells me "impossible to find the class of the component TCustomBGRAButton" ... and does not allow me to visualize the form... ehr.. what did I do wrong? ---------------------------------------------------------------------- lainz · 2011-10-17 01:08 You must register the component. To be added to your BGRA Controls component tab. Code: [Select]type   { TCustomBGRAButton }   TCustomBGRAButton = class(TBGRAButton)     private     procedure ConvertToGrayscale(ABGRA: TBGRABitmap); override;   end; implementation procedure Register; begin   RegisterComponents('BGRA Controls', [TCustomBGRAButton]); end; { TCustomBGRAButton } procedure TCustomBGRAButton.ConvertToGrayscale(ABGRA: TBGRABitmap); begin   ABGRA.ApplyGlobalOpacity(100);   inherited ConvertToGrayscale(ABGRA); end; and add 'virtual' to the procedure in TBGRAButton to allow you to be overriden: Code: [Select]procedure ConvertToGrayScale(ABGRA: TBGRABitmap); virtual;  That works, see image attached, custombgrabutton with alpha 100. ---------------------------------------------------------------------- Blue1987 · 2011-10-17 08:13 Quote from: lainz on October 17, 2011, 03:08:07 amYou must register the component. To be added to your BGRA Controls component tab. Code: [Select]type   { TCustomBGRAButton }   TCustomBGRAButton = class(TBGRAButton)     private     procedure ConvertToGrayscale(ABGRA: TBGRABitmap); override;   end; implementation procedure Register; begin   RegisterComponents('BGRA Controls', [TCustomBGRAButton]); end; { TCustomBGRAButton } procedure TCustomBGRAButton.ConvertToGrayscale(ABGRA: TBGRABitmap); begin   ABGRA.ApplyGlobalOpacity(100);   inherited ConvertToGrayscale(ABGRA); end; and add 'virtual' to the procedure in TBGRAButton to allow you to be overriden: Code: [Select]procedure ConvertToGrayScale(ABGRA: TBGRABitmap); virtual;  That works, see image attached, custombgrabutton with alpha 100. my aim was NOT to create a new component, but just overridding a procedure... so that users who wants to edit the code just have to install codetyphon and doubleclick on the project files... and not to install other components... ... I would like to simplify the life of people who want to edit my code! ---------------------------------------------------------------------- lainz · 2011-10-17 13:30 ok do it in your way. ---------------------------------------------------------------------- Blue1987 · 2011-10-17 15:44 Quote from: lainz on October 17, 2011, 03:30:45 pmok do it in your way. I would like to do it but it tells me << Unit1.pas(2581,20) Error: Identifier not found "FMouseStage" >> ---------------------------------------------------------------------- lainz · 2011-10-17 17:20 Quote from: Blue1987 on October 17, 2011, 05:44:44 pmQuote from: lainz on October 17, 2011, 03:30:45 pmok do it in your way. I would like to do it but it tells me << Unit1.pas(2581,20) Error: Identifier not found "FMouseStage" >>   You can't modify TBGRAButton disabled state if you don't modify the ConvertToGrayScale(ABGRA: TBGRABitmap);  procedure. In order to modify the procedure you have two ways: * Create a new component. (For example creating a TCustomBGRAControl). * Modify the existing component. (Editing the bgraimagebutton.pas). If none of those ways are the thing you want you can try to use 'OnAfterPrepareBGRAButton', this allow to modify the bitmap when it needs to be updated (like OnPaint event of a form): Code: [Select]procedure TForm1.BGRAButton1AfterPrepareBGRAButton(Sender: TObject;   const ABGRA: TBGRABitmap; ARect: TRect; AState: TBGRAButtonState); begin   if not BGRAButton1.Enabled then     ABGRA.ApplyGlobalOpacity(100); end; ---------------------------------------------------------------------- lainz · 2011-10-17 17:24 Quote from: Blue1987 on October 09, 2011, 03:34:45 pmQuote from: lainz on October 06, 2011, 06:23:21 pmMost bgracontrols are like examples of the things you can do with BGRABitmap, if you want some new feature or addapt one to fit with your needs you can improve the code because it's LGPL. BTW contact Dibo if you really need that state, he is the author of that component. There is no 'visual settings' for enabled / disabled. Look, for example, the Paint code in BGRAImageButton: if Enabled then... check and draw the current state (that's modified when you move the mouse, clic, etc) else (when it is disabled) draw the disabled state. this is the solution I am tring to implement... Code: [Select]type Tbgrabutton = class(BGRAButtons.TBGRAButton) public   procedure Paint; override; end; ... implementation procedure TBGRAButton.Paint; var   bodya, bodyn: TBody;   baserect: TRect; begin   //inherited Paint;   { Mouse stage }   case FMouseStage of     msClicked: bodya := FBodyClicked;     msHover: bodya := FBodyHover;     msNormal: bodya := FBodyNormal;   end;   { Calculating base rect }   baserect := ClientRect;   Inc(baserect.Left, Round(FBorderWidth / 2));   Inc(baserect.Top, Round(FBorderWidth / 2));   Dec(baserect.Right, Round(FBorderWidth / 2) + 1);   Dec(baserect.Bottom, Round(FBorderWidth / 2) + 1);   { Clearing previous paint }   FBGRA.Fill(BGRAPixelTransparent);   { Drawing main button }   if (FActiveButt = bbtButton) and (not FStaticButton) then     bodyn := bodya   else     bodyn := FBodyNormal;   DrawBasicBody(bodyn, Rect(baserect.Left, baserect.Top, baserect.Right -     ifthen(FStyle = bbtDropDown, ARR_SPACE), baserect.Bottom));   { Drop down arrow button }   if FStyle = bbtDropDown then   begin     if (FActiveButt = bbtDropDown) and (not FStaticButton) then       bodyn := bodya     else       bodyn := FBodyNormal;     DrawBasicBody(bodyn, Rect(baserect.Right - ARR_SPACE, baserect.Top,       baserect.Right, baserect.Bottom));     { Drawing arrow }     DrawArrow(bodyn, baserect);   end;   if FTextApplyGlobalOpacity then   begin     { Drawing text }     DrawText(bodyn.FFont.Color, bodyn.FFont.Style, bodyn.FFont.Name);     { Set global opacity }    if Enabled then FBGRA.ApplyGlobalOpacity(FGlobalOpacity) else FBGRA.ApplyGlobalOpacity(100); end   else   begin     { Set global opacity }     if Enabled then FBGRA.ApplyGlobalOpacity(FGlobalOpacity) else FBGRA.ApplyGlobalOpacity(100); { Drawing text }     DrawText(bodyn.FFont.Color, bodyn.FFont.Style, bodyn.FFont.Name);   end;   { Convert to gray if not enabled }   if not Enabled then     ConvertToGrayScale;   { Finally drawing on canvas }   FBGRA.Draw(Self.Canvas, 0, 0, False); end; but when I try to compile I get the following errors: Code: [Select]Unit1.pas(2543,16) Unit1.pas(2581,20) Error: Identifier not found "FMouseStage" Unit1.pas(2582,14) Error: Identifier not found "msClicked" Unit1.pas(2582,14) Error: Constant Expression expected Unit1.pas(2582,37) Error: Identifier not found "FBodyClicked" Unit1.pas(2583,12) Error: Identifier not found "msHover" Unit1.pas(2583,12) Error: Constant Expression expected Unit1.pas(2583,12) Error: duplicate case label Unit1.pas(2583,33) Error: Identifier not found "FBodyHover" Unit1.pas(2584,13) Error: Identifier not found "msNormal" Unit1.pas(2584,13) Error: Constant Expression expected Unit1.pas(2584,13) Error: duplicate case label Unit1.pas(2584,35) Error: Identifier not found "FBodyNormal" Unit1.pas(2589,41) Error: Identifier not found "FBorderWidth" Unit1.pas(2589,3) Error: Incompatible types: got "untyped" expected "LongInt" Unit1.pas(2590,40) Error: Identifier not found "FBorderWidth" Unit1.pas(2590,3) Error: Incompatible types: got "untyped" expected "LongInt" Unit1.pas(2591,42) Error: Identifier not found "FBorderWidth" Unit1.pas(2591,3) Error: Incompatible types: got "untyped" expected "LongInt" Unit1.pas(2592,43) Error: Identifier not found "FBorderWidth" Unit1.pas(2592,3) Error: Incompatible types: got "untyped" expected "LongInt" Unit1.pas(2595,8) Error: Identifier not found "FBGRA" Unit1.pas(2595,34) Error: Identifier not found "BGRAPixelTransparent" Unit1.pas(2598,19) Error: Identifier not found "FActiveButt" Unit1.pas(2598,54) Error: Identifier not found "FStaticButton" Unit1.pas(2601,25) Error: Identifier not found "FBodyNormal" Unit1.pas(2603,16) Error: Identifier not found "DrawBasicBody" Unit1.pas(2604,11) Error: Identifier not found "ifthen" Unit1.pas(2604,19) Error: Identifier not found "FStyle" Unit1.pas(2604,43) Error: Identifier not found "ARR_SPACE" Unit1.pas(2607,13) Error: Identifier not found "FStyle" Unit1.pas(2609,21) Error: Identifier not found "FActiveButt" Unit1.pas(2609,58) Error: Identifier not found "FStaticButton" Unit1.pas(2612,27) Error: Identifier not found "FBodyNormal" Unit1.pas(2614,18) Error: Identifier not found "DrawBasicBody" Unit1.pas(2614,57) Error: Identifier not found "ARR_SPACE" Unit1.pas(2617,14) Error: Identifier not found "DrawArrow" Unit1.pas(2620,30) Error: Identifier not found "FTextApplyGlobalOpacity" Unit1.pas(2623,20) Error: identifier idents no member "FFont" Unit1.pas(2623,39) Error: identifier idents no member "FFont" Unit1.pas(2623,58) Error: identifier idents no member "FFont" Unit1.pas(2625,26) Error: Identifier not found "FBGRA" Unit1.pas(2625,60) Error: Identifier not found "FGlobalOpacity" Unit1.pas(2625,72) Error: Identifier not found "FBGRA" Unit1.pas(2630,26) Error: Identifier not found "FBGRA" Unit1.pas(2630,60) Error: Identifier not found "FGlobalOpacity" Unit1.pas(2630,72) Error: Identifier not found "FBGRA" Unit1.pas(2632,20) Error: identifier idents no member "FFont" Unit1.pas(2632,39) Error: identifier idents no member "FFont" Unit1.pas(2632,58) Error: identifier idents no member "FFont" Unit1.pas(2637,23) Error: Identifier not found "ConvertToGrayScale" Unit1.pas(2637,23) Fatal: There were 50 errors compiling module, stopping That's because you can't override in this way.. Code: [Select]Tbgrabutton = class(BGRAButtons.TBGRAButton) public   procedure Paint; override; end; You CAN do in this way Code: [Select]Tcustombgrabutton = class(TBGRAButton) public   procedure Paint; override; end; ---------------------------------------------------------------------- Blue1987 · 2011-10-17 19:12 Quote from: lainz on October 17, 2011, 07:24:26 pmThat's because you can't override in this way.. Code: [Select]Tbgrabutton = class(BGRAButtons.TBGRAButton) public   procedure Paint; override; end; since I already do Code: [Select]Tlabel = class(StdCtrls.TLabel) public   FromTop: integer; {distance from top}   FCHeight: integer; {font client height}   procedure Paint; override; end;                  in my code and it works... could you please explain me the difference? ---------------------------------------------------------------------- lainz · 2011-10-17 19:40 Quote from: Blue1987 on October 17, 2011, 09:12:33 pmcould you please explain me the difference? The difference is that the inherited declarations can't be accesed, try this code (it should not work): Code: [Select] Tlabel = class(StdCtrls.TLabel) public   FromTop: integer; {distance from top}   FCHeight: integer; {font client height}   procedure Paint; override; end; implementation procedure Tlabel.Paint; begin // this works   FromTop := 1; // this not   case FAlignment of     taLeftJustify: Caption := 'Left';     taRightJustify: Caption := 'Right';     taCenter: Caption := 'Center';   end;   inherited Paint; end;