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: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138:
| unit noten;
interface
uses SysUtils, Classes, Controls, Graphics;
type TNotes = class(TGraphicControl) private FLines : Integer; procedure SetLines(Value: Integer); protected procedure Paint; override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; published property Lines: Integer read FLines write SetLines; end;
procedure Register;
implementation
constructor TNotes.Create(AOwner: TComponent); begin inherited Create(AOwner);
FLines := 0; end;
destructor TNotes.Destroy; begin inherited Destroy; end;
procedure TNotes.SetLines(Value: Integer); begin if FLines <> Value then begin FLines := Value; Invalidate; end; end;
procedure TNotes.Paint; var LineCount: Integer; count: Integer; hl: Integer; ho, hu: Integer; begin
LineCount := Lines; if csDesigning in ComponentState then begin hl := 10; ho := 10; hu := 130;
for count := 1 to Linecount do begin Canvas.Pen.Width := 3; Canvas.MoveTo(Width - (Width - 10), Height - (Height - ho)); Canvas.LineTo(Width - (Width - 10), Height - (Height - hu));
Canvas.Pen.Width := 1;
Canvas.MoveTo(width - (width-15), Height - (Height - ho)); Canvas.LineTo(width - (width-15), Height - (Height - hu)); Canvas.MoveTo(width - (width-10), Height - (Height - hl)); Canvas.LineTo(width - 10, Height - (Height - hl)); Canvas.MoveTo(width - (width-10), Height - (Height - hl - 10)); Canvas.LineTo(width - 10, Height - (Height - hl - 10)); Canvas.MoveTo(width - (width-10), Height - (Height - hl-20)); Canvas.LineTo(width - 10, Height - (Height - hl-20)); Canvas.MoveTo(width - (width-10), Height - (Height - hl-30)); Canvas.LineTo(width - 10, Height - (Height - hl-30)); Canvas.MoveTo(width - (width-10), Height - (Height - hl-40)); Canvas.LineTo(width - 10, Height - (Height - hl-40)); Canvas.MoveTo(width - (width-10), Height - (Height - hl-80)); Canvas.LineTo(width - 10, Height - (Height - hl-80)); Canvas.MoveTo(width - (width-10), Height - (Height - hl-90)); Canvas.LineTo(width - 10, Height - (Height - hl-90));; Canvas.MoveTo(width - (width-10), Height - (Height - hl-100)); Canvas.LineTo(width - 10, Height - (Height - hl-100)); Canvas.MoveTo(width - (width-10), Height - (Height - hl-110)); Canvas.LineTo(width - 10, Height - (Height - hl-110)); Canvas.MoveTo(width - (width-10), Height - (Height - hl-120)); Canvas.LineTo(width - 10, Height - (Height - hl-120));
Canvas.MoveTo(width - 15, Height - (Height - ho)); Canvas.LineTo(width - 15, Height - (Height - hu));
Canvas.Pen.Width := 3; Canvas.MoveTo(width - 10, Height - (Height - ho)); Canvas.LineTo(width - 10, Height - (Height - hu));
hl := hl + 150; ho := ho + 150; hu := hu + 150; end;
end; end;
procedure Register; begin RegisterComponents('Musik', [TNotes]); end;
end. |