-
Content Count
2082 -
Joined
-
Last visited
-
Days Won
29
Everything posted by Attila Kovacs
-
Direct vs. Indirect access of service by a Client?
Attila Kovacs replied to David Schwartz's topic in Network, Cloud and Web
You asked for thoughts, pros, and cons. Then, you became anxious when I provided you with a point of view and introduced your implementation details (traffic) into the equation, which changed the entire question. But hey, we're used to it 😉 Do you still have any concerns? -
Direct vs. Indirect access of service by a Client?
Attila Kovacs replied to David Schwartz's topic in Network, Cloud and Web
Why do you care then? Anyway, "service storing the data" is a kind of middle-tear API too, nobody exposes the DB itself. -
Direct vs. Indirect access of service by a Client?
Attila Kovacs replied to David Schwartz's topic in Network, Cloud and Web
How would you manage to allow 20 million users to authenticate simultaneously? You can't. Google can. Some services are meant for the clients, while others are not. Relying on such services always carries some risk, but not necessarily the ones you are most concerned about. Instead of fearing discontinuation, excessively frequent updates, or lack of support,.. -
I have something similar without regexp and I'm calling it "Open Unit" 😉
-
Could you help me identify from which Delphi version this works correctly? If it does at all..... Anchors are akTop + akRight original: pressing "+", (scale up with 24dpi) the same thing happens if the anchors are akTop + akLeft + akRigt I'm on Berlin U2. A hint or a patch or workaround would also be appreciated if available. Scale-Test.7z
-
It seems I can't postpone an upgrade much longer, perhaps I can bridge it until then with this. Very basic, only tested with the form from above, (also inserting/removing components may break it)... unit AnchorPanel; interface uses Winapi.Windows, Winapi.Messages, System.Classes, Vcl.Controls, Vcl.ExtCtrls; type TControl = class(Vcl.Controls.TControl); TControlData = record Anchors: TAnchors; Bounds: TRect; Align: TAlign; IsScaling: boolean; end; TAnchorPanel = class(TPanel) private FOriginalSize: TRect; FControlData: TArray<TControlData>; FCalcWidth: integer; FCalcHeight: integer; FScale: single; procedure SaveControls; procedure ResizeControls; procedure WMSize(var Message: TWMSize); message WM_SIZE; protected procedure ChangeScale(M, D: integer; isDpiChange: boolean); override; procedure Loaded; override; public published end; procedure Register; implementation procedure Register; begin RegisterComponents('Samples', [TAnchorPanel]); end; { TAnchorPanel } procedure TAnchorPanel.ChangeScale(M, D: integer; isDpiChange: boolean); var i: integer; begin if (csDesigning in ComponentState) then begin inherited ChangeScale(M, D, isDpiChange); end else begin SaveControls; inherited ChangeScale(M, D, True); if csLoading in ComponentState then begin FCalcWidth := Width; FCalcHeight := Height; FScale := 1; end else begin FCalcWidth := MulDiv(Width, M, D); FCalcHeight := MulDiv(Height, M, D); FScale := FScale * M / D; end; if not isDpiChange then begin for i := 0 to ControlCount - 1 do begin FControlData[i].IsScaling := True; TControl(Controls[i]).ChangeScale(M, D, isDpiChange); end; end; end; end; procedure TAnchorPanel.Loaded; begin inherited; if not(csDesigning in ComponentState) then begin FOriginalSize := Self.BoundsRect; FCalcWidth := Self.Width; end; end; procedure TAnchorPanel.ResizeControls; var i: integer; begin if FOriginalSize.Width <> 0 then for i := 0 to High(FControlData) do begin if FControlData[i].Align = alNone then if akRight in FControlData[i].Anchors then begin if akLeft in FControlData[i].Anchors then begin Controls[i].Width := Trunc(FControlData[i].Bounds.Width * FScale) + Trunc(Self.Width - (FOriginalSize.Width * FScale)); end else begin if not FControlData[i].IsScaling then Controls[i].Left := Trunc(FControlData[i].Bounds.Left * FScale) + (Self.Width - FCalcWidth) + Trunc(FCalcWidth - (FOriginalSize.Width * FScale)); end; end; FControlData[i].IsScaling := False; end; end; procedure TAnchorPanel.SaveControls; var i: integer; begin if not(csDesigning in ComponentState) then begin if Length(FControlData) <> Self.ControlCount then begin SetLength(FControlData, Self.ControlCount); for i := 0 to Self.ControlCount - 1 do begin FControlData[i].Anchors := Self.Controls[i].Anchors; FControlData[i].Bounds := Self.Controls[i].BoundsRect; FControlData[i].Align := Self.Controls[i].Align; FControlData[i].IsScaling := False; Self.Controls[i].Anchors := [akLeft, akTop]; end; end; end; end; procedure TAnchorPanel.WMSize(var Message: TWMSize); begin if not(csDesigning in ComponentState) then SaveControls; inherited; if not(csDesigning in ComponentState) then ResizeControls end; end. Scale-Test5.7z
-
didn't work, the bottom pane is now on 3 panels in groups
-
They are on a TPanel. o.O
-
Where is the link to register to the forum?
Attila Kovacs replied to FPiette's topic in Community Management
chatGPT -
since I switched to x64, I've been encountering a problem that I can only describe if it's not.
-
what was your first google hit?
-
here
-
Are local TGUIDS preinitialized?
Attila Kovacs replied to Attila Kovacs's topic in RTL and Delphi Object Pascal
as both paramerters for Equal() are const it could yell before calling it -
Are local TGUIDS preinitialized?
Attila Kovacs replied to Attila Kovacs's topic in RTL and Delphi Object Pascal
@Brandon Staggs The compiler makes educated guesses even with integers. Consider my example. The same could be mimicked for records. I know it won't cover everything, but neither does it for other types. -
Are local TGUIDS preinitialized?
Attila Kovacs replied to Attila Kovacs's topic in RTL and Delphi Object Pascal
var i: integer; begin i.ToSingle; if i > 0 then Exit; I understand but I think those excuses are made up. ToSingle supresses the hint. -
Are local TGUIDS preinitialized?
Attila Kovacs replied to Attila Kovacs's topic in RTL and Delphi Object Pascal
Does this 'more complex' mean that we don't care, or that we sweated hard and got it done? 🙂 -
Are local TGUIDS preinitialized?
Attila Kovacs replied to Attila Kovacs's topic in RTL and Delphi Object Pascal
Ahm, isn't there a compiler hint missing then? -
Are local TGUIDS preinitialized?
Attila Kovacs replied to Attila Kovacs's topic in RTL and Delphi Object Pascal
@Dalija Prasnikar Thanks! So, I was just lucky all the time <o>, checking it against TGUID.Empty and it bit me under x64. Did a code check and found one more occurence in my code... -
Project Options -> Version Info aka. dproj madness
Attila Kovacs replied to Attila Kovacs's topic in Delphi IDE and APIs
I also have a build server where I generate the resource from a template, but I still need it in the IDE. Just saying. 😉 -
Project Options -> Version Info aka. dproj madness
Attila Kovacs replied to Attila Kovacs's topic in Delphi IDE and APIs
I also need it in the IDE because I store essential information in it. Perhaps it's not the best practice, but that's how it currently is. Uwe's solution to remove child entries seems to be the best option, as it usually is when he comes up with something. However, this issue should also be addressed in the IDE itself. At the very least, they should consider hiring that expert and incorporating their solution into the IDE. -
That means those numbers are implicitly converted to anything by every interpreter. If necessary, you may consider using strings instead.
-
Project Options -> Version Info aka. dproj madness
Attila Kovacs replied to Attila Kovacs's topic in Delphi IDE and APIs
oh. now that's interesting 😄 -
64-bit VCL App hangs for an extended period during termination
Attila Kovacs posted a topic in Delphi IDE and APIs
One of my VCL apps is hanging in 64-bit mode at termination for 30+ seconds. Any ideas what could be causing this? I don't have to do much; just starting the app and ending it, or pressing Ctrl+F2. Other apps are terminating instantly. I would prefer to try some tips before resorting to cloning the project and systematically removing components. IDE: Berlin U2 -
Be careful with those numbers, they can bite. https://lwn.net/Articles/730671/
-
Project Options -> Version Info aka. dproj madness
Attila Kovacs replied to Attila Kovacs's topic in Delphi IDE and APIs
Great, but this should be working in the IDE. Before I report this misimplementation, I wanted to know if it's still the same in the current IDE.