-
Content Count
186 -
Joined
-
Last visited
-
Days Won
2
Everything posted by David Hoyle
-
Continuation of the topic “RAD Studio 10.4 Installation problems”
David Hoyle replied to oliwe's topic in General Help
Which installer did you use: On-Line or Off-Line? Since both are based on Get It its BDS.exe that runs the installation process. Could you have an overzealous AV programme that's removing the bds.exe as its definitions are not up to date for the latest release? -
No. What is the context under which you are trying to do what you are attempting. To do what I've described you need to write an Open Tools API BPL or DLL and add it to the IDE. This will then give you access to the designer once you have an IOTAModule reference to your form.
-
I'm not sure I understand correctly what you are trying to do here but the Open Tools API can provide you access to the IDesigner from INTAFormEditor.GetFormDesigner. You can get the INTAFormEditor by querying the IOTAModule interface for the form.
-
I'm trying to create a rending engine that can use different canvas's where the coordinate system could Integer or Single. This is so that the differences between the output systems can be abstracted at the canvas level. I've tried to used generics (see code below) but it will not compile. I don't know whether I'm trying to be too ambitious or whether I'm missing something. The below code is a test project that shows the issue. Any help would be appreciated. Note: The below code is not intended to run as it's missing some implementations, I'm just looking for it to compile. Program IndirectGenerics; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; Type IPen<T> = Interface Function GetWidth : T; Procedure SetWidth(Const AValue : T); Property Width : T Read GetWidth Write SetWidth; End; ICanvas<T> = Interface Function GetPen : IPen<T>; Property Pen : IPen<T> Read GetPen; End; TConcreteCanvas<T> = Class(TInterfacedObject, ICanvas<T>) Strict Private FPen : IPen<T>; Strict Protected Function GetPen : IPen<T>; Public Constructor Create; End; TConcreteDrawingEngine<T> = Class Strict Private FCanvas : ICanvas<T>; Strict Protected Public Constructor Create(Const Canvas : ICanvas<T>); Procedure DoSomething; End; { TConcreteCanvas<T> } Constructor TConcreteCanvas<T>.Create; Begin // FPen := End; Function TConcreteCanvas<T>.GetPen: IPen<T>; Begin Result := FPen; End; { TConcreteGantt<T> } Constructor TConcreteDrawingEngine<T>.Create(Const Canvas: ICanvas<T>); Begin FCanvas := Canvas; End; Procedure TConcreteDrawingEngine<T>.DoSomething; Begin FCanvas.Pen.Width := 1; // <= Does not compile as it thinks T is not Integer End; Var IntegerCanvas : ICanvas<Integer>; IntegerDrawingEngine : TConcreteDrawingEngine<Integer>; SingleCanvas : ICanvas<Single>; SingleDrawingEngine : TConcreteDrawingEngine<Single>; Begin Try IntegerCanvas := TConcreteCanvas<Integer>.Create; IntegerDrawingEngine := TConcreteDrawingEngine<Integer>.Create(IntegerCanvas); //... SingleCanvas := TConcreteCanvas<Single>.Create; SingleDrawingEngine := TConcreteDrawingEngine<Single>.Create(SingleCanvas); //... Except On E: Exception Do Writeln(E.ClassName, ': ', E.Message); End; End.
-
Thank you @David Heffernan and @Eugine Savin. Clearly, I was too ambitious. I tried a few other things with generics and then abandoned them when they didn't work either. I decided to change the underlying coordinate system to Single from Integer and I'm using TPointF and TRectF and the real-time rendering in my application, even with VCL styles, does not seem to have diminished. Still need to test on an old machine with a crappy graphics card but I think this will allow me to do what I want going forwards.
-
Delphi IDE 10.4.1 doesn't find vclwinx270 and vcledge270 components when running a project.exe
David Hoyle replied to Darick's topic in Tips / Blogs / Tutorials / Videos
Check your IDEs Environment Variables (in the Options dialogue) and see if it is redefining the PATH variable to something that stops the IDE being able to search for the BPLs. -
Tools API - Changing Key Assignment
David Hoyle replied to Carlos Tré's topic in Delphi IDE and APIs
Ctrl+D has never worked for me but then again I'm still using WordStar/Classic IDE key bindings which might grab Ctrl+D for moving the cursor. -
Tools API - Changing Key Assignment
David Hoyle replied to Carlos Tré's topic in Delphi IDE and APIs
I already do this with GExperts so I know it can be done unfortunately I'm on my work machine so cannot show you. The menu item is now hidden underneath View | Editor I think but it is there somewhere. I use Ctrl+Alt+D so I need to disable this shortcut first (disassembly view I think) and then I can assign it for Format Source. -
Tools API - Changing Key Assignment
David Hoyle replied to Carlos Tré's topic in Delphi IDE and APIs
Use GExperts to define an alternate keybinding for this rather go through the rigmarole of creating an expert to do this. -
How secure is your WordPress installation?
David Hoyle replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Install WordFence (the are free and paid version) and keep the number of plug-ins to a minimum. -
cannot install Konopka VCL Controls from GetIt
David Hoyle replied to Randall Carpenter's topic in General Help
Did you install from the ISO? If so you need to reconfigure GetIT for on-line use: `GetItCmd.exe -c=useonline ` (http://docwiki.embarcadero.com/RADStudio/Sydney/en/Release_Notes). -
My mistake @dummzeuch I thought it was dependant upon JCL/JVCL. I must be thinking of something else.
-
@dummzeuch I think the only thing that stops me compiling it myself is setting up all the JCL/JVCL dependencies unless that has changed.
-
The \\?\UNC is for unicode path up to 32K in length so you can work around the MAX_PATH limit. I wouldn't expect ExtractFileDrive to work with these as you would add the \\?\UNC prefix before calling CopyFileW() etc. There is similar syntax for drive letter. Have a look at the Microsoft Documentation (Looks like they've change something in Windows 10 recently as well - https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-copyfile
-
Create component ERROR in expert in D10.2.3
David Hoyle replied to limelect's topic in RTL and Delphi Object Pascal
@limelect Yes, BPLs can see to be easier to work with but bear in mind that if you code something wrong you can make the IDE you are working in unstable. I always use a secondary IDE using a -rNewRegKey command line and then I can kill of that session if I do something wrong. -
Create component ERROR in expert in D10.2.3
David Hoyle replied to limelect's topic in RTL and Delphi Object Pascal
Her e's my code from last night. Add Comp To Form.zip -
Create component ERROR in expert in D10.2.3
David Hoyle replied to limelect's topic in RTL and Delphi Object Pascal
I don't have any experience with FMX but I suspect we need to understand whether the currently selected control can take other child controls. Unfortunately I don't have the time today to have a look at this but I will look into this. -
Create component ERROR in expert in D10.2.3
David Hoyle replied to limelect's topic in RTL and Delphi Object Pascal
@Remy Lebeau you were right, I just didn't call it properly. The below code works for me in 10.4.1... // Set the control framework ActivateClassGroup(Vcl.Controls.TControl); // <= THIS FIXES IT!!!!!!!!! // Get the generic form editor for the current module Module := TACTFUtilities.CurrentModule; FormEditor := TACTFUtilities.FormEditor(Module); // Get the simple class name from a dropdown, i.e. TLabel, TButton, TEdit, etc strClassName := edtComponentClassName.Text; Delete(strClassName, Pos('=', strClassName), strClassName.Length); // Insert the component with the selected component parent If Assigned(FormEditor) Then Begin Component := FormEditor.GetCreateParent; Component := FormEditor.CreateComponent( Component, strClassName, 10, 10, 50, 28 ); FormEditor.MarkModified; End; -
Create component ERROR in expert in D10.2.3
David Hoyle replied to limelect's topic in RTL and Delphi Object Pascal
Alas @Remy Lebeau's suggestion has not worked in the 2 scenarios I have. I will pick this up again later today or tomorrow as I'm sure I had some part of it working with qualified names last week. -
Create component ERROR in expert in D10.2.3
David Hoyle replied to limelect's topic in RTL and Delphi Object Pascal
Thanks @Remy Lebeau, I will check this out today. -
Create component ERROR in expert in D10.2.3
David Hoyle replied to limelect's topic in RTL and Delphi Object Pascal
@limelect I mean Unit.Component or perhaps event Package.Unit.Component. At some point in the work I did last Saturday when trying to find a solution for you, I'm positive one of the solutions accepted this format as a string. I'll try again tomorrow. -
Create component ERROR in expert in D10.2.3
David Hoyle replied to limelect's topic in RTL and Delphi Object Pascal
I need to go back over this at the weekend (no time at the moment due to the day job) but I seem to remember one of the techniques I tried required a fully qualified name which I think we can build from enumerating the packages and their components in the IDE. -
What happens to the behaviour if you set the current location of your application (SetCurrentDir).
-
Create component ERROR in expert in D10.2.3
David Hoyle replied to limelect's topic in RTL and Delphi Object Pascal
Well I think GetClass() is finding FMX controls not VCL ones which is why this is not working (despite the designer type and framework type being VCL). Had enough for now. Might look later in the week if time permits. -
Create component ERROR in expert in D10.2.3
David Hoyle replied to limelect's topic in RTL and Delphi Object Pascal
Okay, I'm leaning towards the issue being FMX verse VCL. I iterated all the packages below and picked out all the components and found duplicates between the frameworks. So I think GetClass() is looking up in FMX instead of VCL. Since it's now failing, selecting a VCL only component does nothing as GetClass() cannot find the component (which does not exist in FMX). Getting a bit late now but I know that on occasions the IDE prompts you to select which framework you are using (FMX or VCL) and I need to find out how we influence this determination (starting a new VCL app didn't work but then again I didn't save it).