⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 abdbctrls.pas

📁 著名的虚拟仪表控件,包含全部源码, 可以在,delphi2007 下安装运行
💻 PAS
📖 第 1 页 / 共 4 页
字号:
begin
  result := FDataLink.FieldName;
end;

function TAbDBVMeter.GetDataSource: TDataSource;
begin
  result := FDataLink.DataSource;
end;

procedure TAbDBVMeter.SetDataField(const Value: string);
begin
  FDataLink.FieldName := Value;
end;

procedure TAbDBVMeter.SetDataSource(const Value: TDataSource);
begin
  if not (FDataLink.DataSourceFixed and (csLoading in Componentstate)) then
    FDataLink.DataSource := Value;
  if Value <> nil then Value.FreeNotification(self);
end;

procedure TAbDBVMeter.ValueChange;
begin
  inherited;
  if Assigned(FDataLink) then FDataLink.DbWriteSingle(Value);
end;

procedure TAbDBVMeter.Notification(AComponent: TComponent;
  Operation: TOperation);
begin
  inherited Notification(AComponent, Operation);
  if (Operation = opRemove) and (FDataLink <> nil) and
    (AComponent = DataSource) then DataSource := nil;
end;
//========================== TAbDBVMeter ======================================

//========================== TAbDB120Meter =====================================

constructor TAbDB120Meter.Create(AOwner: TComponent);
begin
  inherited;
  FDataLink := TAbFieldDataLink.Create;
  FDataLink.Control := self;
  FDataLink.OnDataRead := DataRead;
  FDataLink.ValueSingle := Value;
  DataReadOnly := true;
end;

destructor TAbDB120Meter.Destroy;
begin
  FDataLink.Free;
  FDataLink := nil;
  inherited;
end;

function TAbDB120Meter.GetDataReadOnly: Boolean;
begin
  result := FDataLink.ReadOnly;
end;

procedure TAbDB120Meter.SetDataReadOnly(Value: Boolean);
begin
  FDataLink.ReadOnly := Value;
end;

procedure TAbDB120Meter.CMGetDataLink(var Message: TMessage);
begin
  Message.result := Integer(FDataLink);
end;

procedure TAbDB120Meter.DataRead(Sender: TObject);
begin
  Value := FDataLink.ValueSingle;
end;

function TAbDB120Meter.GetDataField: string;
begin
  result := FDataLink.FieldName;
end;

function TAbDB120Meter.GetDataSource: TDataSource;
begin
  result := FDataLink.DataSource;
end;

procedure TAbDB120Meter.SetDataField(const Value: string);
begin
  FDataLink.FieldName := Value;
end;

procedure TAbDB120Meter.SetDataSource(const Value: TDataSource);
begin
  if not (FDataLink.DataSourceFixed and (csLoading in Componentstate)) then
    FDataLink.DataSource := Value;
  if Value <> nil then Value.FreeNotification(self);
end;

procedure TAbDB120Meter.ValueChange;
begin
  inherited;
  if Assigned(FDataLink) then FDataLink.DbWriteSingle(Value);
end;

procedure TAbDB120Meter.Notification(AComponent: TComponent;
  Operation: TOperation);
begin
  inherited Notification(AComponent, Operation);
  if (Operation = opRemove) and (FDataLink <> nil) and
    (AComponent = DataSource) then DataSource := nil;
end;
//========================== TAbDB120Meter =====================================

//========================== TAbDB180Meter =====================================

constructor TAbDB180Meter.Create(AOwner: TComponent);
begin
  inherited;
  FDataLink := TAbFieldDataLink.Create;
  FDataLink.Control := self;
  FDataLink.OnDataRead := DataRead;
  FDataLink.ValueSingle := Value;
  DataReadOnly := true;
end;

destructor TAbDB180Meter.Destroy;
begin
  FDataLink.Free;
  FDataLink := nil;
  inherited;
end;

function TAbDB180Meter.GetDataReadOnly: Boolean;
begin
  result := FDataLink.ReadOnly;
end;

procedure TAbDB180Meter.SetDataReadOnly(Value: Boolean);
begin
  FDataLink.ReadOnly := Value;
end;

procedure TAbDB180Meter.CMGetDataLink(var Message: TMessage);
begin
  Message.result := Integer(FDataLink);
end;

procedure TAbDB180Meter.DataRead(Sender: TObject);
begin
  Value := FDataLink.ValueSingle;
end;

function TAbDB180Meter.GetDataField: string;
begin
  result := FDataLink.FieldName;
end;

function TAbDB180Meter.GetDataSource: TDataSource;
begin
  result := FDataLink.DataSource;
end;

procedure TAbDB180Meter.SetDataField(const Value: string);
begin
  FDataLink.FieldName := Value;
end;

procedure TAbDB180Meter.SetDataSource(const Value: TDataSource);
begin
  if not (FDataLink.DataSourceFixed and (csLoading in Componentstate)) then
    FDataLink.DataSource := Value;
  if Value <> nil then Value.FreeNotification(self);
end;

procedure TAbDB180Meter.ValueChange;
begin
  inherited;
  if Assigned(FDataLink) then FDataLink.DbWriteSingle(Value);
end;

procedure TAbDB180Meter.Notification(AComponent: TComponent;
  Operation: TOperation);
begin
  inherited Notification(AComponent, Operation);
  if (Operation = opRemove) and (FDataLink <> nil) and
    (AComponent = DataSource) then DataSource := nil;
end;
//========================== TAbDB180Meter =====================================

//========================== TAbDB270Meter =====================================

constructor TAbDB270Meter.Create(AOwner: TComponent);
begin
  inherited;
  FDataLink := TAbFieldDataLink.Create;
  FDataLink.Control := self;
  FDataLink.OnDataRead := DataRead;
  FDataLink.ValueSingle := Value;
  DataReadOnly := true;
end;

destructor TAbDB270Meter.Destroy;
begin
  FDataLink.Free;
  FDataLink := nil;
  inherited;
end;

function TAbDB270Meter.GetDataReadOnly: Boolean;
begin
  result := FDataLink.ReadOnly;
end;

procedure TAbDB270Meter.SetDataReadOnly(Value: Boolean);
begin
  FDataLink.ReadOnly := Value;
end;

procedure TAbDB270Meter.CMGetDataLink(var Message: TMessage);
begin
  Message.result := Integer(FDataLink);
end;

procedure TAbDB270Meter.DataRead(Sender: TObject);
begin
  Value := FDataLink.ValueSingle;
end;

function TAbDB270Meter.GetDataField: string;
begin
  result := FDataLink.FieldName;
end;

function TAbDB270Meter.GetDataSource: TDataSource;
begin
  result := FDataLink.DataSource;
end;

procedure TAbDB270Meter.SetDataField(const Value: string);
begin
  FDataLink.FieldName := Value;
end;

procedure TAbDB270Meter.SetDataSource(const Value: TDataSource);
begin
  if not (FDataLink.DataSourceFixed and (csLoading in Componentstate)) then
    FDataLink.DataSource := Value;
  if Value <> nil then Value.FreeNotification(self);
end;

procedure TAbDB270Meter.ValueChange;
begin
  inherited;
  if Assigned(FDataLink) then FDataLink.DbWriteSingle(Value);
end;

procedure TAbDB270Meter.Notification(AComponent: TComponent;
  Operation: TOperation);
begin
  inherited Notification(AComponent, Operation);
  if (Operation = opRemove) and (FDataLink <> nil) and
    (AComponent = DataSource) then DataSource := nil;
end;
//========================== TAbDB270Meter ======================================

//========================== TAbDBBar =====================================

constructor TAbDBBar.Create(AOwner: TComponent);
begin
  inherited;
  FDataLink := TAbFieldDataLink.Create;
  FDataLink.Control := self;
  FDataLink.OnDataRead := DataRead;
  FDataLink.ValueSingle := Value;
  DataReadOnly := true;
end;

destructor TAbDBBar.Destroy;
begin
  FDataLink.Free;
  FDataLink := nil;
  inherited;
end;

function TAbDBBar.GetDataReadOnly: Boolean;
begin
  result := FDataLink.ReadOnly;
end;

procedure TAbDBBar.SetDataReadOnly(Value: Boolean);
begin
  FDataLink.ReadOnly := Value;
end;

procedure TAbDBBar.CMGetDataLink(var Message: TMessage);
begin
  Message.result := Integer(FDataLink);
end;

procedure TAbDBBar.DataRead(Sender: TObject);
begin
  Value := FDataLink.ValueSingle;
end;

function TAbDBBar.GetDataField: string;
begin
  result := FDataLink.FieldName;
end;

function TAbDBBar.GetDataSource: TDataSource;
begin
  result := FDataLink.DataSource;
end;

procedure TAbDBBar.SetDataField(const Value: string);
begin
  FDataLink.FieldName := Value;
end;

procedure TAbDBBar.SetDataSource(const Value: TDataSource);
begin
  if not (FDataLink.DataSourceFixed and (csLoading in Componentstate)) then
    FDataLink.DataSource := Value;
  if Value <> nil then Value.FreeNotification(self);
end;

procedure TAbDBBar.ValueChange;
begin
  inherited;
  if Assigned(FDataLink) then FDataLink.DbWriteSingle(Value);
end;

procedure TAbDBBar.Notification(AComponent: TComponent;
  Operation: TOperation);
begin
  inherited Notification(AComponent, Operation);
  if (Operation = opRemove) and (FDataLink <> nil) and
    (AComponent = DataSource) then DataSource := nil;
end;
//========================== TAbDBBar ==========================================

//========================== TAbDBHBar =========================================

constructor TAbDBHBar.Create(AOwner: TComponent);
begin
  inherited;
  FDataLink := TAbFieldDataLink.Create;
  FDataLink.Control := self;
  FDataLink.OnDataRead := DataRead;
  FDataLink.ValueSingle := Value;
  DataReadOnly := true;
end;

destructor TAbDBHBar.Destroy;
begin
  FDataLink.Free;
  FDataLink := nil;
  inherited;
end;

function TAbDBHBar.GetDataReadOnly: Boolean;
begin
  result := FDataLink.ReadOnly;
end;

procedure TAbDBHBar.SetDataReadOnly(Value: Boolean);
begin
  FDataLink.ReadOnly := Value;
end;

procedure TAbDBHBar.CMGetDataLink(var Message: TMessage);
begin
  Message.result := Integer(FDataLink);
end;

procedure TAbDBHBar.DataRead(Sender: TObject);
begin
  Value := FDataLink.ValueSingle;
end;

function TAbDBHBar.GetDataField: string;
begin
  result := FDataLink.FieldName;
end;

function TAbDBHBar.GetDataSource: TDataSource;
begin
  result := FDataLink.DataSource;
end;

procedure TAbDBHBar.SetDataField(const Value: string);
begin
  FDataLink.FieldName := Value;
end;

procedure TAbDBHBar.SetDataSource(const Value: TDataSource);
begin
  if not (FDataLink.DataSourceFixed and (csLoading in Componentstate)) then
    FDataLink.DataSource := Value;
  if Value <> nil then Value.FreeNotification(self);
end;

procedure TAbDBHBar.ValueChange;
begin
  inherited;
  if Assigned(FDataLink) then FDataLink.DbWriteSingle(Value);
end;

procedure TAbDBHBar.Notification(AComponent: TComponent;
  Operation: TOperation);
begin
  inherited Notification(AComponent, Operation);
  if (Operation = opRemove) and (FDataLink <> nil) and
    (AComponent = DataSource) then DataSource := nil;
end;
//========================== TAbDBHBar =========================================

//========================== TAbDBVBar =========================================

constructor TAbDBVBar.Create(AOwner: TComponent);
begin
  inherited;
  FDataLink := TAbFieldDataLink.Create;
  FDataLink.Control := self;
  FDataLink.OnDataRead := DataRead;
  FDataLink.ValueSingle := Value;
  DataReadOnly := true;
end;

destructor TAbDBVBar.Destroy;
begin
  FDataLink.Free;
  FDataLink := nil;
  inherited;
end;

function TAbDBVBar.GetDataReadOnly: Boolean;
begin
  result := FDataLink.ReadOnly;
end;

procedure TAbDBVBar.SetDataReadOnly(Value: Boolean);
begin
  FDataLink.ReadOnly := Value;
end;

procedure TAbDBVBar.CMGetDataLink(var Message: TMessage);
begin
  Message.result := Integer(FDataLink);
end;

procedure TAbDBVBar.DataRead(Sender: TObject);
begin
  Value := FDataLink.ValueSingle;
end;

function TAbDBVBar.GetDataField: string;
begin
  result := FDataLink.FieldName;
end;

function TAbDBVBar.GetDataSource: TDataSource;
begin
  result := FDataLink.DataSource;
end;

procedure TAbDBVBar.SetDataField(const Value: string);
begin
  FDataLink.FieldName := Value;
end;

procedure TAbDBVBar.SetDataSource(const Value: TDataSource);
begin
  if not (FDataLink.DataSourceFixed and (csLoading in Componentstate)) then
    FDataLink.DataSource := Value;
  if Value <> nil then Value.FreeNotification(self);
end;

procedure TAbDBVBar.ValueChange;
begin
  inherited;
  if Assigned(FDataLink) then FDataLink.DbWriteSingle(Value);
end;

procedure TAbDBVBar.Notification(AComponent: TComponent;
  Operation: TOperation);
begin
  inherited Notification(AComponent, Operation);
  if (Operation = opRemove) and (FDataLink <> nil) and
    (AComponent = DataSource) then DataSource := nil;
end;
//========================== TAbDBVBar =========================================

//========================== TAbDBThermometer ==================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -