unit myDataBar;
interface
uses
SysUtils, Classes, Controls, AdvToolBar, StdCtrls, Dialogs;
type
TmyDataBar =
class(TAdvDockPanel)
private
{ Private-Deklarationen }
protected
{ Protected-Deklarationen }
public
{ Public-Deklarationen }
FToolbar : TAdvToolbar;
FDataCombo : TCombobox;
Fbtn_next : TAdvToolBarButton;
Fbtn_previous : TAdvToolBarButton;
Ftb_sep : TAdvToolBarSeparator;
constructor Create(AOwner: TComponent);
override;
destructor Destroy;
override;
procedure GoNext(Sender: TObject);
published
{ Published-Deklarationen }
end;
procedure Register;
implementation
{$R mydatabar.dcr}
procedure Register;
begin
RegisterComponents('
THRU-Soft', [TmyDataBar]);
end;
constructor TmyDataBar.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Parent := TwinControl(Owner);
Self.Height := 43;
Self.Align := daTop;
FToolbar := TAdvToolBar.Create(AOwner);
FToolbar.
Name := '
DataToolbar';
FToolbar.Parent := Self;
FToolbar.FullSize := True;
FDataCombo := TComboBox.Create(FToolbar);
FDataCombo.
Name := '
FDataCombo';
FDataCombo.Text := '
Dummy';
FDataCombo.Parent := TWinControl(FToolbar);
FDataCombo.Width := 200;
Ftb_sep := TAdvToolBarSeparator.Create(FToolbar);
Ftb_sep.Parent := TWinControl(FToolbar);
Ftb_sep.Width := 20;
Fbtn_next := TAdvToolBarButton.Create(FToolbar);
Fbtn_next.
Name := '
btn_Next';
Fbtn_next.Parent := TWinControl(FToolbar);
Fbtn_next.Caption := '
Next';
Fbtn_next.ShowCaption := True;
Fbtn_previous := TAdvToolBarButton.Create(FToolbar);
Fbtn_previous.
Name := '
btn_prev';
Fbtn_previous.Parent := TWinControl(FToolbar);
Fbtn_previous.Caption := '
Previous';
Fbtn_previous.ShowCaption := True;
Fbtn_previous.OnClick := GoNext;
end;
procedure TmyDataBar.GoNext(Sender: TObject);
begin
ShowMessage('
Next');
end;
destructor TmyDataBar.Destroy;
begin
inherited;
end;
end.