Einzelnen Beitrag anzeigen

PatrickB

Registriert seit: 13. Dez 2007
61 Beiträge
 
#30

Re: Combobox Komponente Visualisieren!

  Alt 2. Jul 2009, 18:16
Weiß nich, du hast gesagt entweder TCustomControl oder TGraphicControl. Ich weiß sowieso nicht wirklich worin sich beide untershcieden.

Delphi-Quellcode:
unit ProgressBar1;

interface

uses
  Windows, SysUtils, Classes, Controls, Graphics, ComCtrls;

type
  PbProgressBar = class(TCustomControl)
  private
    { Private-Deklarationen }
    FWidth : Integer;
    FThickness : Integer;
    FControllerWidth : Integer;
    FControllerHeight : Integer;
    FLineColor1 : TColor;
    FLineColor2 : TColor;
    FControllerColor : TColor;
    FScrollPos : Integer;
    FCursor : TPoint;
    FRMouseDown : Boolean;
    FMin : Integer;
    FMax : Integer;
    FRelScrollPos : Integer;
    FOnChange : TNotifyEvent;

    procedure SetThickness(uValue: Integer);
    procedure SetLineColor(uValue: TColor);
    procedure SetControllerColor(uValue: TColor);
    procedure SetPosition(uValue: Integer);
    procedure SetRelScrollPos(uValue:Integer);
  protected
    { Protected-Deklarationen }
    procedure Paint; override;
    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
      X, Y: Integer); override;
    procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
    procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
      X, Y: Integer); override;
  public
    { Public-Deklarationen }
    constructor Create(aOwner: TComponent); override;
    destructor Destroy; override;
  published
    { Published-Deklarationen }
    property OnChange: TNotifyEvent read FOnChange write FOnChange;
    property Position: Integer read FRelScrollPos write SetRelScrollPos;
    property Wer: Integer read FWidth write FWidth;
    property Thickness: Integer read FThickness write SetThickness;
    property LineColor1: TColor read FLineColor1 write SetLineColor;
    property ControllerColor: TColor read FControllerColor write SetControllerColor;
    property OnMouseDown;
    property OnMouseMove;
    property OnMouseUp;
    property OnChange;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Samples', [PbProgressBar]);
end;
  Mit Zitat antworten Zitat