delphi-10.4-sydney

How to detect Form Resize END, maybe by using the TApplicationEvents component?

夙愿已清 提交于 2021-02-16 21:30:49
问题 In a Delphi 10.4 VCL Application, I need to detect when the FORM RESIZING ENDS . (E.g. after the user resized the Form by dragging its size-grip). So I have placed a TApplicationEvents component on the form and created its OnMessage event-handler, trying to catch the WM_EXITSIZEMOVE message: procedure TformMain.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); begin if (Msg.Message = WM_EXITSIZEMOVE) then begin CodeSite.Send('TformMain.ApplicationEvents1Message: WM

Why are some properties repeated when TRttiContext.GetType is called on a VCL Control?

ぃ、小莉子 提交于 2021-02-08 14:15:44
问题 Why are some properties repeated (such as Action and Align ) where others are not ( AlignWithMargins ) when TRttiContext.GetType is called on a VCL Control? uses System.RTTI, System.Generics.Collections, System.Generics.Defaults; //.... procedure TForm11.btnShowPropertiesClick(Sender: TObject); var R: TRttiContext; Props: TArray<TRttiProperty>; Prop : TRttiProperty; begin memo1.Clear; R := TRttiContext.Create; Props := R.GetType(Sender.ClassType).GetProperties; //Sort properties by name

Why are some properties repeated when TRttiContext.GetType is called on a VCL Control?

穿精又带淫゛_ 提交于 2021-02-08 14:15:15
问题 Why are some properties repeated (such as Action and Align ) where others are not ( AlignWithMargins ) when TRttiContext.GetType is called on a VCL Control? uses System.RTTI, System.Generics.Collections, System.Generics.Defaults; //.... procedure TForm11.btnShowPropertiesClick(Sender: TObject); var R: TRttiContext; Props: TArray<TRttiProperty>; Prop : TRttiProperty; begin memo1.Clear; R := TRttiContext.Create; Props := R.GetType(Sender.ClassType).GetProperties; //Sort properties by name

Why are some properties repeated when TRttiContext.GetType is called on a VCL Control?

﹥>﹥吖頭↗ 提交于 2021-02-08 14:14:28
问题 Why are some properties repeated (such as Action and Align ) where others are not ( AlignWithMargins ) when TRttiContext.GetType is called on a VCL Control? uses System.RTTI, System.Generics.Collections, System.Generics.Defaults; //.... procedure TForm11.btnShowPropertiesClick(Sender: TObject); var R: TRttiContext; Props: TArray<TRttiProperty>; Prop : TRttiProperty; begin memo1.Clear; R := TRttiContext.Create; Props := R.GetType(Sender.ClassType).GetProperties; //Sort properties by name

Revisited: TClientDataset “Missing data provider or data packet”

痴心易碎 提交于 2020-12-15 05:41:07
问题 With a dynamically created TFDQuery , TClientDataSet , and TDataSetProvider I bump into the "Missing data provider or data packet" with this code: procedure ResetSavedPasswords(ADataModuleDataBaseAdmin : TDataModuleDataBaseAdmin); var lQuery : TFDQuery; lCDS : TClientDataSet; lProvider : TDataSetProvider; begin lFrmBezig := TFormBezig.Create(nil); lQuery := TFDQuery.Create(nil); lProvider := TDataSetProvider.Create(Application); lCDS := TClientDataSet.Create(nil); try lQuery.Connection :=

Load base64-encoded data from INI file back to TPicture?

半世苍凉 提交于 2020-08-09 06:54:30
问题 In Delphi 10.4, I have sucessfully saved a valid TPicture base64-encoded to an INI file, using this code: procedure TForm1.SavePictureToIniFile(const APicture: TPicture); // https://stackoverflow.com/questions/63216011/tinifile-writebinarystream-creates-exception var LInput: TMemoryStream; MyIni: TMemIniFile; Base64Enc: TBase64Encoding; ThisFile: string; begin if FileSaveDialog1.Execute then ThisFile := FileSaveDialog1.FileName else EXIT; //CodeSite.Send('TForm1.btnSaveToIniClick: VOR

WriteBinaryStream compressed to INI file?

ε祈祈猫儿з 提交于 2020-08-08 06:29:33
问题 In Delphi 10.4, I try to save a valid TPicture compressed to an INI file, trying to replicate the ZLibCompressDecompress example from the documentation: procedure TForm1.SavePictureToIniFile(const APicture: TPicture); // https://stackoverflow.com/questions/63216011/tinifile-writebinarystream-creates-exception var LInput: TMemoryStream; LOutput: TMemoryStream; MyIni: System.IniFiles.TMemIniFile; ThisFile: string; LZip: TZCompressionStream; begin if FileSaveDialog1.Execute then ThisFile :=

WriteBinaryStream compressed to INI file?

≯℡__Kan透↙ 提交于 2020-08-08 06:29:16
问题 In Delphi 10.4, I try to save a valid TPicture compressed to an INI file, trying to replicate the ZLibCompressDecompress example from the documentation: procedure TForm1.SavePictureToIniFile(const APicture: TPicture); // https://stackoverflow.com/questions/63216011/tinifile-writebinarystream-creates-exception var LInput: TMemoryStream; LOutput: TMemoryStream; MyIni: System.IniFiles.TMemIniFile; ThisFile: string; LZip: TZCompressionStream; begin if FileSaveDialog1.Execute then ThisFile :=