in Delphi language, I need a Helper so I can add to every TComponent descendant a…
- User
in Delphi language, I need a Helper so I can add to every TComponent descendant a property of type TQryRecInfo named ORMRec and a property string named ORMRecField. Adjust the changes to the unit interposer_class: Please review carefully before make the needed changes.
unit interposer_class;
interface
uses Vcl.Forms, Vcl.Controls, CommCtrl, Messages, sPanel, sEdit, sPageControl, System.Classes, AdvCGrid, Uni, pixel_classes, ORM_utils;
{$TYPEINFO ON}
type TForm = class(Vcl.Forms.TForm) protected procedure CreateParams(var Params: TCreateParams); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; end;
TsPanel = class(sPanel.TsPanel) protected procedure CreateParams(var Params: TCreateParams); override; end;
TsEdit = class(sEdit.TsEdit) protected procedure CreateParams(var Params: TCreateParams); override; end;
TsPageControl = class(sPageControl.TsPageControl) protected procedure CreateParams(var Params: TCreateParams); override; private procedure TCMAdjustRect(var Msg: TMessage); message TCM_ADJUSTRECT; end;
TAdvColumnGrid = class(AdvCGrid.TAdvColumnGrid) private FByPassAF: TArray; function GetCellz(ACol, ARow: Integer): TZString; procedure SetCellz(ACol, ARow: Integer; const Value: TZString); function GetBypassAF(ACol: Integer): Boolean; procedure SetBypassAF(ACol: Integer; const Value: Boolean); protected procedure CreateParams(var Params: TCreateParams); override; public property Cellz[ACol, ARow: Integer]: TZString read GetCellz write SetCellz; property BypassAutoFit[ACol: Integer]: Boolean read GetBypassAF write SetBypassAF; published function CriaLinhaObjeto(MyObject: TObject): Integer; function CriaLinha: Integer; function GetColumnIndexByName(const nome: string): Integer; procedure SetBasicColumnConfig; end;
implementation
uses pixel_utils, System.Math, System.Types, Windows, System.SysUtils, TypInfo, Generics.Collections, Data.DB, Vcl.Graphics, ComCtrls, Vcl.Grids;
procedure TForm.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); StrPCopy(Params.WinClassName, 'ZPro'); end;
constructor TForm.Create(AOwner: TComponent); begin inherited; end;
destructor TForm.Destroy; begin inherited; end;
procedure TsPanel.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); StrPCopy(Params.WinClassName, 'Painel'); end;
procedure TsEdit.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); StrPCopy(Params.WinClassName, 'Editor'); end;
procedure TsPageControl.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); StrPCopy(Params.WinClassName, 'PagCtrl'); end;
procedure TsPageControl.TCMAdjustRect(var Msg: TMessage); begin inherited; case TabPosition of tpTop: begin PRect(Msg.LParam)^.Left:= 0; PRect(Msg.LParam)^.Right:= ClientWidth; PRect(Msg.LParam)^.Bottom:= ClientHeight;
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.