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

📄 jvdyncontrolenginevcldb.pas

📁 East make Tray Icon in delphi
💻 PAS
📖 第 1 页 / 共 4 页
字号:
end;

function TJvDynControlVCLDBListBox.ControlGetItems: TStrings;
begin
  Result := Items;
end;

procedure TJvDynControlVCLDBListBox.ControlSetOnDblClick(Value: TNotifyEvent);
begin
  OnDblClick := Value;
end;

procedure TJvDynControlVCLDBListBox.ControlSetDataSource(Value: TDataSource);
begin
  DataSource := Value;
end;

function TJvDynControlVCLDBListBox.ControlGetDataSource: TDataSource;
begin
  Result := DataSource;
end;

procedure TJvDynControlVCLDBListBox.ControlSetDataField(const Value: string);
begin
  DataField := Value;
end;

function TJvDynControlVCLDBListBox.ControlGetDataField: string;
begin
  Result := DataField;
end;

//=== { TJvDynControlVCLDBComboBox } =========================================

procedure TJvDynControlVCLDBComboBox.ControlSetDefaultProperties;
begin
end;

procedure TJvDynControlVCLDBComboBox.ControlSetCaption(const Value: string);
begin
end;

procedure TJvDynControlVCLDBComboBox.ControlSetTabOrder(Value: Integer);
begin
  TabOrder := Value;
end;

procedure TJvDynControlVCLDBComboBox.ControlSetHint(const Value: string);
begin
  Hint := Value;
end;

procedure TJvDynControlVCLDBComboBox.ControlSetOnEnter(Value: TNotifyEvent);
begin
  OnEnter := Value;
end;

procedure TJvDynControlVCLDBComboBox.ControlSetOnExit(Value: TNotifyEvent);
begin
  OnExit := Value;
end;

procedure TJvDynControlVCLDBComboBox.ControlSetOnChange(Value: TNotifyEvent);
begin
//  OnChange := Value;
end;

procedure TJvDynControlVCLDBComboBox.ControlSetOnClick(Value: TNotifyEvent);
begin
  OnClick := Value;
end;

procedure TJvDynControlVCLDBComboBox.ControlSetValue(Value: Variant);
begin
  if Style = csDropDownList then
    ItemIndex := Items.IndexOf(Value)
  else
    Text := Value;
end;

function TJvDynControlVCLDBComboBox.ControlGetValue: Variant;
begin
  Result := Text;
end;

procedure TJvDynControlVCLDBComboBox.ControlSetSorted(Value: Boolean);
begin
  Sorted := Value;
end;

procedure TJvDynControlVCLDBComboBox.ControlSetItems(Value: TStrings);
begin
  Items.Assign(Value);
end;

function TJvDynControlVCLDBComboBox.ControlGetItems: TStrings;
begin
  Result := Items;
end;

procedure TJvDynControlVCLDBComboBox.ControlSetNewEntriesAllowed(Value: Boolean);
const
  Styles: array [Boolean] of TComboBoxStyle =
    (csDropDownList, csDropDown);
begin
  Style := Styles[Value];
end;

procedure TJvDynControlVCLDBComboBox.ControlSetDataSource(Value: TDataSource);
begin
  DataSource := Value;
end;

function TJvDynControlVCLDBComboBox.ControlGetDataSource: TDataSource;
begin
  Result := DataSource;
end;

procedure TJvDynControlVCLDBComboBox.ControlSetDataField(const Value: string);
begin
  DataField := Value;
end;

function TJvDynControlVCLDBComboBox.ControlGetDataField: string;
begin
  Result := DataField;
end;

//=== { TJvDynControlVCLDBImage } ============================================

procedure TJvDynControlVCLDBImage.ControlSetDefaultProperties;
begin
end;

procedure TJvDynControlVCLDBImage.ControlSetCaption(const Value: string);
begin
  Caption := Value;
end;

procedure TJvDynControlVCLDBImage.ControlSetTabOrder(Value: Integer);
begin
//  TabOrder := Value;
end;

procedure TJvDynControlVCLDBImage.ControlSetHint(const Value: string);
begin
  Hint := Value;
end;

procedure TJvDynControlVCLDBImage.ControlSetOnEnter(Value: TNotifyEvent);
begin
//  OnEnter := Value;
end;

procedure TJvDynControlVCLDBImage.ControlSetOnExit(Value: TNotifyEvent);
begin
//  OnExit := Value;
end;

procedure TJvDynControlVCLDBImage.ControlSetOnClick(Value: TNotifyEvent);
begin
  OnClick := Value;
end;

procedure TJvDynControlVCLDBImage.ControlSetAutoSize(Value: Boolean);
begin
  AutoSize := Value;
end;

procedure TJvDynControlVCLDBImage.ControlSetIncrementalDisplay(Value: Boolean);
begin
//  IncrementalDisplay := Value;
end;

procedure TJvDynControlVCLDBImage.ControlSetCenter(Value: Boolean);
begin
  Center := Value;
end;

{$IFDEF VCL}
procedure TJvDynControlVCLDBImage.ControlSetProportional(Value: Boolean);
begin
  {$IFDEF COMPILER6_UP}
//  Proportional := Value;
  {$ENDIF COMPILER6_UP}
end;
{$ENDIF VCL}

procedure TJvDynControlVCLDBImage.ControlSetStretch(Value: Boolean);
begin
  Stretch := Value;
end;

procedure TJvDynControlVCLDBImage.ControlSetTransparent(Value: Boolean);
begin
//  Transparent := Value;
end;

procedure TJvDynControlVCLDBImage.ControlSetPicture(Value: TPicture);
begin
  Picture.Assign(Value);
end;

procedure TJvDynControlVCLDBImage.ControlSetGraphic(Value: TGraphic);
begin
  Picture.Assign(Value);
end;

function TJvDynControlVCLDBImage.ControlGetPicture: TPicture;
begin
  Result := Picture;
end;

procedure TJvDynControlVCLDBImage.ControlSetDataSource(Value: TDataSource);
begin
  DataSource := Value;
end;

function TJvDynControlVCLDBImage.ControlGetDataSource: TDataSource;
begin
  Result := DataSource;
end;

procedure TJvDynControlVCLDBImage.ControlSetDataField(const Value: string);
begin
  DataField := Value;
end;

function TJvDynControlVCLDBImage.ControlGetDataField: string;
begin
  Result := DataField;
end;

//=== { TJvDynControlVCLDBText } =============================================

procedure TJvDynControlVCLDBText.ControlSetDefaultProperties;
begin
end;

procedure TJvDynControlVCLDBText.ControlSetCaption(const Value: string);
begin
end;

procedure TJvDynControlVCLDBText.ControlSetTabOrder(Value: Integer);
begin
end;

procedure TJvDynControlVCLDBText.ControlSetHint(const Value: string);
begin
  Hint := Value;
end;

procedure TJvDynControlVCLDBText.ControlSetOnEnter(Value: TNotifyEvent);
begin
end;

procedure TJvDynControlVCLDBText.ControlSetOnExit(Value: TNotifyEvent);
begin
end;

procedure TJvDynControlVCLDBText.ControlSetOnClick(Value: TNotifyEvent);
begin
end;
    
procedure TJvDynControlVCLDBText.ControlSetDataSource(Value: TDataSource);
begin
  DataSource := Value;
end;

function TJvDynControlVCLDBText.ControlGetDataSource: TDataSource;
begin
  Result := DataSource;
end;

procedure TJvDynControlVCLDBText.ControlSetDataField(const Value: string);
begin
  DataField := Value;
end;

function TJvDynControlVCLDBText.ControlGetDataField: string;
begin
  Result := DataField;
end;

//=== { TJvDynControlVCLDBGrid } =============================================

procedure TJvDynControlVCLDBGrid.ControlSetDefaultProperties;
begin
end;

procedure TJvDynControlVCLDBGrid.ControlSetCaption(const Value: string);
begin
end;

procedure TJvDynControlVCLDBGrid.ControlSetTabOrder(Value: Integer);
begin
  TabOrder := Value;
end;

procedure TJvDynControlVCLDBGrid.ControlSetHint(const Value: string);
begin
  Hint := Value;
end;

procedure TJvDynControlVCLDBGrid.ControlSetOnEnter(Value: TNotifyEvent);
begin
  OnEnter := Value;
end;

procedure TJvDynControlVCLDBGrid.ControlSetOnExit(Value: TNotifyEvent);
begin
  OnExit := Value;
end;

procedure TJvDynControlVCLDBGrid.ControlSetOnClick(Value: TNotifyEvent);
begin
end;                                                                    

procedure TJvDynControlVCLDBGrid.ControlSetDataSource(Value: TDataSource);
begin
  DataSource := Value;
end;

function TJvDynControlVCLDBGrid.ControlGetDataSource: TDataSource;
begin
  Result := DataSource;
end;

procedure TJvDynControlVCLDBGrid.ControlSetDataField(const Value: string);
begin
end;

function TJvDynControlVCLDBGrid.ControlGetDataField: string;
begin
  Result := '';
end;

//=== { TJvDynControlVCLDBNavigator } ========================================

procedure TJvDynControlVCLDBNavigator.ControlSetDefaultProperties;
begin
end;

procedure TJvDynControlVCLDBNavigator.ControlSetCaption(const Value: string);
begin
end;

procedure TJvDynControlVCLDBNavigator.ControlSetTabOrder(Value: Integer);
begin
  TabOrder := Value;
end;

procedure TJvDynControlVCLDBNavigator.ControlSetHint(const Value: string);
begin
  Hint := Value;
end;

procedure TJvDynControlVCLDBNavigator.ControlSetOnEnter(Value: TNotifyEvent);
begin
  OnEnter := Value;
end;

procedure TJvDynControlVCLDBNavigator.ControlSetOnExit(Value: TNotifyEvent);
begin
  OnExit := Value;
end;

procedure TJvDynControlVCLDBNavigator.ControlSetOnClick(Value: TNotifyEvent);
begin
end;

procedure TJvDynControlVCLDBNavigator.ControlSetDataSource(Value: TDataSource);
begin
  DataSource := Value;
end;

function TJvDynControlVCLDBNavigator.ControlGetDataSource: TDataSource;
begin
  Result := DataSource;
end;

procedure TJvDynControlVCLDBNavigator.ControlSetDataField(const Value: string);
begin
end;

function TJvDynControlVCLDBNavigator.ControlGetDataField: string;
begin
  Result := '';
end;

//=== { TJvDynControlEngineVCLDB } ===========================================

function DynControlEngineVCLDB: TJvDynControlEngineDB;
begin
  Result := IntDynControlEngineVCLDB;
end;

procedure TJvDynControlEngineVCLDB.RegisterControls;
begin
  RegisterControlType(jctDBText, TJvDynControlVCLDBText);
  RegisterControlType(jctDBEdit, TJvDynControlVCLDBEdit);
  RegisterControlType(jctDBImage, TJvDynControlVCLDBImage);
  RegisterControlType(jctDBCheckBox, TJvDynControlVCLDBCheckBox);
  RegisterControlType(jctDBComboBox, TJvDynControlVCLDBComboBox);
  RegisterControlType(jctDBListBox, TJvDynControlVCLDBListBox);
  RegisterControlType(jctDBRadioGroup, TJvDynControlVCLDBRadioGroup);
  RegisterControlType(jctDBDateTimeEdit, TJvDynControlVCLDBEdit);
  RegisterControlType(jctDBTimeEdit, TJvDynControlVCLDBEdit);
  RegisterControlType(jctDBDateEdit, TJvDynControlVCLDBEdit);
////  RegisterControlType(jctDBCalculateEdit, TJvDynControlVCLDBEdit);
////  RegisterControlType(jctDBSpinEdit, TJvDynControlVCLDBEdit);
  RegisterControlType(jctDBDirectoryEdit, TJvDynControlVCLDBDirectoryEdit);
  RegisterControlType(jctDBFileNameEdit, TJvDynControlVCLDBFileNameEdit);
  RegisterControlType(jctDBMemo, TJvDynControlVCLDBMemo);
  RegisterControlType(jctDBButtonEdit, TJvDynControlVCLDBButtonEdit);
  RegisterControlType(jctDBGrid, TJvDynControlVCLDBGrid);
  RegisterControlType(jctDBNavigator, TJvDynControlVCLDBNavigator);
end;
type TAccessDBLookupControl = class(TDBLookupControl);

function TJvDynControlEngineVCLDB.GetDataSourceFromDataComponent(ADataComponent: TComponent): TDataSource;
begin
  if not Assigned(ADataComponent) then
    Result := nil
  else
  if ADataComponent is TCustomDBGrid then
    Result := TCustomDBGrid(ADataComponent).DataSource
  else
  if ADataComponent is TDBEdit then
    Result := TDBEdit(ADataComponent).DataSource
  else
  if ADataComponent is TDBNavigator then
    Result := TDBNavigator(ADataComponent).DataSource
  else
  if ADataComponent is TDBListBox then
    Result := TDBListbox(ADataComponent).DataSource
  else
  if ADataComponent is TDBLookupControl then
    Result := TAccessDBLookupControl(ADataComponent).DataSource
  else
  if ADataComponent is TDBImage then
    Result := TDBImage(ADataComponent).DataSource
  else
  if ADataComponent is TDBMemo then
    Result := TDBMemo(ADataComponent).DataSource
  else
  if ADataComponent is TDBRadioGroup then
    Result := TDBRadioGroup(ADataComponent).DataSource
  else
  if ADataComponent is TDBRichEdit then
    Result := TDBRichEdit(ADataComponent).DataSource
  else
  if ADataComponent is TDBText then
    Result := TDBText(ADataComponent).DataSource
  else
  if ADataComponent is TDBCheckBox then
    Result := TDBCheckBox(ADataComponent).DataSource
  else
    Result := inherited GetDataSourceFromDataComponent(ADataComponent);
end;

initialization
  {$IFDEF UNITVERSIONING}
  RegisterUnitVersion(HInstance, UnitVersioning);
  {$ENDIF UNITVERSIONING}
  IntDynControlEngineVCLDB := TJvDynControlEngineVCLDB.Create;
  SetDefaultDynControlEngineDB(IntDynControlEngineVCLDB);

finalization
  FreeAndNil(IntDynControlEngineVCLDB);
  {$IFDEF UNITVERSIONING}
  UnregisterUnitVersion(HInstance);
  {$ENDIF UNITVERSIONING}

end.

⌨️ 快捷键说明

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