-
Content Count
2750 -
Joined
-
Last visited
-
Days Won
162
Everything posted by Uwe Raabe
-
Indeed - and it is just because you simply cannot place a "SubForm" anywhere at design time. If you don't do it with a frame both are on par again.
-
Can you explain how you come to this conclusion? Adding a TEdit to a frame is no different from adding a TEdit to a form. Basically a "SubForm" is just a TForm descendant, which Parent is set to another control at runtime. During design time the "SubForm" is designed as any other form. So is a frame. I guess, you are referring to adding a TEdit to a frame during design time while it is inlined (placed) into another form. You have to switch to the frame designer to do that and switch back to the form to see the change in the form. You also need to switch to the form designer of a "SubForm" to do that. In contrast to the inlined frame you can see the actual outcome at runtime only.
-
That is almost the same as @Lars Fosdal describes: This approach indeed eliminates the mentioned problems that may come up when placing the frames at design time.
-
Are SubForms problem free? It boils down to what your are trying to achieve. Recently I developed a VCL application for a customer that is almost solely build on frames. You need forms for dialogs and tool windows, but even those are just containing a frame. The IDE itself is built on frames, too. (OK, that may not really count for problem free)
-
As @Dmitry Arefiev already mentioned: Replace the TLabel with TStaticText. The latter is a TWinControl and can be placed on top of other controls.
-
The issue is that BringToFront only works inside a group of TGraphicControls (like TLabel) and TWinControls. This is from the documentation of BringToFront:
-
TFDPhysCommandKind contants missing in FireDAC Delphi 12
Uwe Raabe replied to JGMS's topic in General Help
Not that I am aware of. Besides that, I really question the benefits of this declaration: TBindNavigateBtn = TNavigateButton; -
TFDPhysCommandKind contants missing in FireDAC Delphi 12
Uwe Raabe replied to JGMS's topic in General Help
Can you give a concrete (failing) example for that? -
TFDPhysCommandKind contants missing in FireDAC Delphi 12
Uwe Raabe replied to JGMS's topic in General Help
They have been renamed to TFDCommandKind, while TFDPhysCommandKind is a simple alias now. -
Hard to believe...
-
Interesting. That isn't visible in my browser:
-
What makes you think so?
-
How to make "dynamic initialization" procedure
Uwe Raabe replied to Tommi Prami's topic in RTL and Delphi Object Pascal
Or you try a total different approach described in this article: Dataset Enumerator Reloaded The old repository can be found on GitHub: https://github.com/UweRaabe/DataSetEnumerator, although the current development happens in https://github.com/UweRaabe/CmonLib Taking your code example from above: var LTotal: Double; LField1: TField; LField2: TField; LField3: TField; LField4: TField; begin LField1 := Query.FieldByName('FIELD1'); LField2 := Query.FieldByName('FIELD1'); LField3 := Query.FieldByName('FIELD1'); LField4 := Query.FieldByName('FIELD1'); Query.First; while not Query.Eof do begin LTotal := LTotal + LField1.AsFloat; // More stuff done with local field variables... Query.Next; end; a corresponding solution based on my unit could look like this: uses Cmon.DataSetHelper; type [DBFields(mapAuto)] // make sure record fields are named similar to DB fields! TMyFields = record Field1: Double; Field2: Double; Field3: Double; Field4: Double; end; var LTotal: Double; begin LTotal := 0; for var rec in Query.Records<TMyFields> do begin LTotal := LTotal + rec.Field1; // More stuff done with rec end; -
There is no Delphi 12 Update 1 (yet), only Delphi 12 with Patch 1. During times a common rule had established to wait for the first Update after an initial release before starting to use a Delphi version in production. That doesn't imply not to install and start using it - just not for production. JM2C
-
How to make "dynamic initialization" procedure
Uwe Raabe replied to Tommi Prami's topic in RTL and Delphi Object Pascal
This will only change the TField array item, but not the local variable FieldX as expected. A const or var array of TField is no replacement for a couple of var par: TField parameters. As soon as you construct that array parameter, the addresses of the local variables are gone, while their current content (which may be undefined here) is copied to the array item. Perhaps this may be a better approach (didn't try as I am too lazy to create a fake dataset with these fields): procedure ConnectFields(Query: TDataSet; const Fields: TArray<^TField>; const Names: TArray<string>); begin Assert(Length(Fields) = Length(Names), 'Number of fields and number of names must match'); for var ix := 0 to Length(Fields) - 1 do begin Fields[ix]^ := Query.FindField(Names[ix]); if not Assigned(Fields[ix]^) then raise Exception.Create(Format('Field %s not found.', [Names[ix]])); end; end; procedure Test; var Field1, Field2, Field3, Field4: TField; begin ConnectFields(Query, [ @Field1, @Field2, @Field3, @Field4], ['Field1', 'Field2', 'Field3', 'Field4']); ... end; -
Isn't that what Shared Resources are for?
-
What new features would you like to see in Delphi 13?
Uwe Raabe replied to PeterPanettone's topic in Delphi IDE and APIs
Actually there is a way to achieve that using generics: type TRecB<T> = record FieldA: T; FieldB: Integer; FieldC: string; end; type TRecA = record Secret: string; end; type TRecB = TRecB<TRecA>; -
There is also a very old version on SourceForge: Rad Studio Code Examples Code
-
TNumberBox question regarding mode=nbmFloat in Version 12
Uwe Raabe replied to Gord P's topic in VCL
This is indeed very instable. One would need to extend the current internals significantly to make this work. Nevertheless one can achieve some results by setting AcceptExpressions to True and override these two methods: type TNumberBox = class(Vcl.NumberBox.TNumberBox) protected function GetValidCharSet(AAcceptExpressions: Boolean): TSysCharSet; override; function IsNumericText(const AText: string): Boolean; overload; override; end; function TNumberBox.GetValidCharSet(AAcceptExpressions: Boolean): TSysCharSet; begin Result := inherited GetValidCharSet(AAcceptExpressions); if Mode = nbmFloat then Result := Result + ['e', 'E', '+', '-']; end; function TNumberBox.IsNumericText(const AText: string): Boolean; begin Result := inherited; if AText.LastIndexOfAny(['e', 'E']) = AText.Length - 1 then Result := False; end; -
What new features would you like to see in Delphi 13?
Uwe Raabe replied to PeterPanettone's topic in Delphi IDE and APIs
You have already been told: -
What new features would you like to see in Delphi 13?
Uwe Raabe replied to PeterPanettone's topic in Delphi IDE and APIs
There is a reason why that is not supported: type TRecA = record; TRecB = record FieldA: TRecA; end; TRecA = record FieldB: TRecB; end; -
TNumberBox question regarding mode=nbmFloat in Version 12
Uwe Raabe replied to Gord P's topic in VCL
The current Delphi 12 version doesn't support that out of the box. -
What new features would you like to see in Delphi 13?
Uwe Raabe replied to PeterPanettone's topic in Delphi IDE and APIs
SetThreadDpiAwarenessContext has to be wrapped around the creation of a top level window handle to work correctly. All child windows then inherit the context of the top level one. This rules out any docked forms or frames, which explains why it is not feasible for the Embedded Designer. (Fun fact: an undocked designer window would have worked with that.) A solution for this problem could be SetThreadDpiHostingBehavior and AFAIK that is something Embarcadero is investigating in. -
As of today a rebuilt 11.3 web installer is available on my.embarcadero.com.
-
GetIt Package Manager Delphi 11.3 Timeout
Uwe Raabe replied to VolkerS's topic in Delphi IDE and APIs
As of today there is a rebuild web installer for 11.3 available on my.embarcadero.com.