Ich will eine Kompo erstellen die von TGauge abgeleitet ist
hier der erste teil des codes:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47:
| unit clGauge;
interface
uses SysUtils, Classes, Controls, Gauges,Graphics,Windows;
type TGradientOrientation = (goVertical, goHorizontal);
TPixelRec = packed record case Boolean of true: (Color: TColor); false: (r, g, b, Reserved: Byte); end; TclGauge = class(TGauge) private FForeColor: TColor; FBackColor: TColor; FForeColor2: TColor; FBackColor2: TColor; procedure PaintAsBar(AnImage: TBitmap; PaintRect: TRect); override; procedure SetForeColor(Value: TColor); override; procedure SetBackColor(Value: TColor); override; procedure SetForeColor2(Value: TColor); procedure SetBackColor2(Value: TColor); protected public published property ForeColor: TColor read FForeColor write SetForeColor default clBlack; property ForeColor2: TColor read FForeColor write SetForeColor2 default clBlack; property BackColor: TColor read FBackColor write SetBackColor default clWhite; property BackColor2: TColor read FBackColor write SetBackColor2 default clWhite; end;
procedure Register;
implementation
procedure Register; begin RegisterComponents('Beispiele', [TclGauge]); end; |
aber ich kriege einen fehler, dass die Methode PaintasBar nicht in der Basisklasse gefunden wurde
wenn ich das override entferne kann ich in meinen prozeduren nicht auf die eigenschaften der tgauge zugreifen
ist meine erste Kompo bin also noch unerfahren
hab ich was falsch verstanden oder wo ist mein fehler?