Jump to content

pyscripter

Members
  • Content Count

    920
  • Joined

  • Last visited

  • Days Won

    56

Everything posted by pyscripter

  1. pyscripter

    Olevariant and memory leak

    No the performance issue was https://quality.embarcadero.com/browse/RSP-23095 also fixed as suggested. https://quality.embarcadero.com/browse/RSP-23093 was a memory leak issue. Please read the reports. In both issues the suggested solution was implemented.
  2. pyscripter

    Olevariant and memory leak

    Glad to hear that! So it must be https://quality.embarcadero.com/browse/RSP-23093 that was causing the issue.
  3. pyscripter

    Olevariant and memory leak

    function TObjSvr.ObjAddRef: Integer; begin OutputDebugString(PChar(Format('TObjSvr ($%08X) AddRef', [integer(Self)]))); end; function TObjSvr.ObjRelease: Integer; begin OutputDebugString(PChar(Format('TObjSvr ($%08X) Release', [integer(Self)]))); end; Υour are overriding ObjAddRef, ObjRelease, without calling the inherited method. and you expect to see no memory leaks?
  4. The first VCS I used a long-time ago were CVS and FreeVCS (anyone remembers that?). In the days of Google code, I became an SVN fan using TortoiseSVN. When Google Code shut down all projects moved to Github and converted to git. But, I was very reluctant to move to git and carried on using SVN to work with Git repositories. Soon, I realize this change-resisting approach was counter-productive. I then switched to TortoiseGit and never looked back. Having to fork a repository to submit a PR is rather cumbersome (I wish you could do that from a clone), but I do understand the reasons why this is so.
  5. pyscripter

    Using the New Edge browser control

    I have added a workaround for https://quality.embarcadero.com/browse/RSP-31170
  6. pyscripter

    Using the New Edge browser control

    Just reported two QA issues relevant if you are planning to use/deploy TEdgeBrowser: https://quality.embarcadero.com/browse/RSP-31163 https://quality.embarcadero.com/browse/RSP-31170
  7. pyscripter

    Olevariant and memory leak

    This one was fixed in 10.4 https://quality.embarcadero.com/browse/RSP-23093 @NamoRamanaYou should provide a simple test case that reproduces the issue. Otherwise we are all guessing and hand-waving.
  8. pyscripter

    TControl.SetParent

    TControl.SetParent contains the following code: if not (csLoading in ComponentState) and not (csDesigning in ComponentState) and not (csDestroying in ComponentState) and not (csFreeNotification in ComponentState) then begin if not (csDesigning in Parent.ComponentState) then ScaleForPPI(GetParentCurrentDpi); end; Apart from the fact that I would write the if condition as if [csLoading, csDesigning, csDestroying, csFreeNotification] * ComponentState = [] then does anyone have any idea why controls with csFreeNotification are not scaled? This makes writing per Monitor DPI aware applications much harder.
  9. pyscripter

    TControl.SetParent

    The workaround for both issues is to follow a pattern such as this: Form.SetParent(Panel); Form.HandleNeeded; Form.ScaleForPPI(Panel.CurrentPPI);
  10. pyscripter

    TControl.SetParent

    This is another tough one to work around: procedure TCustomForm.ScaleForPPIRect(NewPPI: Integer; NewRect: PRect); var LCurrentPixelsPerInch: Integer; I: Integer; PriorHeight: Integer; begin if not (csDesigning in ComponentState) and ((not HandleAllocated and (Parent <> nil)) or (NewPPI < 30)) then Exit; Parented forms with unallocated handle are not scaled (e.g. page-like controls). It becomes even harder since TCustomForm.SetParent destroys the handle if the form had no parent. This is irrespective of FreeNotifications.
  11. https://community.idera.com/developer-tools/b/blog/posts/august-2019-delphi-android-beta-plans-august-roadmap-update It was planned for mid-2020. But it is late.
  12. pyscripter

    TControl.SetParent

    @Uwe Raabe Thanks! Good to know I am not the only one bitten by this (should have checked QA), but bad to know it has not been fixed for quite some time now. I placed my vote on the first issue. You can work around the bug by manually calling ScaleForPPI(future parent PPI) before setting the parent but it gets difficult to get right with things like docking. Embarcadero will face this issue when they try to make the IDE per monitor DPI-aware as promised.
  13. pyscripter

    UCS4Strings

    Does anybody know why WideStringToUCS4String adds 0 zero as the last character? Surprisingly, Length(WideStringToUCS4String('')) returns 1 and Length(WideStringToUCS4String('abc')) returns 4.
  14. pyscripter

    UCS4StringToWideString broken?

    The issue is the in-memory representation of USC4. Should it have the redundant (obviously, no need to make the same argument multiple times ) #0 or not? And I argued that for inter-operability (passing a pointer to external functions expecting null-terminated UCS4) it is better that it always includes it despite the redundancy. And this is what the RTL assumes and does.
  15. pyscripter

    UCS4StringToWideString broken?

    You don't have to use USC4 for that and using USC4 would not solve this problem. There are mainly two issues: 1) Surrogates pairs (two widechars correspond to one glyph) UCS4 would help with this one. UTF-16 Encoding: 0xD83D 0xDCBC “💼” 2) Combining characters (more than one Widechars shown as one glyph). But UCS4 would not help with this one. Åström ḱṷṓn Precomposed vrs Decomposed ḱṷṓn (U+1E31 U+1E77 U+1E53 U+006E) ḱṷṓn (U+006B U+0301 U+0075 U+032D U+006F U+0304 U+0301 U+006E) Windows provides CharNext/Prev that deals with both issues, but not perfectly. You have to use Uniscribe or DirectWrite for greater accuracy. In SynEdit there is this function: function SynCharNext(P: PWideChar; out Element : String) : WideChar; overload; Var Start : PWideChar; begin Start := P; Result := Windows.CharNext(P); SetString(Element, Start, Result - Start); end; It is very easy to write an enumerator that works with CharNext.
  16. pyscripter

    UCS4StringToWideString broken?

    Why should any Delphi program use UCS4? The main use case is for inter-operability. You would need to pass the result to some external function. Having to manually add the null-terminator, would be inconvenient.
  17. pyscripter

    UCS4StringToWideString broken?

    I suppose this is understandable. The Windows world is on UTF-16 and the rest on UTF-8. UCS4 (UTF-32) is very rarely used. With the benefit of hindsight, UTF-8 would probably have been a better choice for Windows. Now Microsoft is trying to bring UTF-8 back into Windows via the A routines and by offering to make UTF-8 the default character encoding.
  18. pyscripter

    UCS4StringToWideString broken?

    It needs to be when you interoperate with libraries in which the default character encoding is USC4 (eg. python API on Linux https://www.python.org/dev/peps/pep-0513/).
  19. pyscripter

    UCS4StringToWideString broken?

    This was all covered in
  20. pyscripter

    Project Magician gotcha

    Project Magician is wonderful and a must for all Delphi programmers. Thank you @Uwe Raabe. However I recently run into the following problem. As I was debugging, whenever I tried to step into Vcl.Graphics the file would open and get marked as modified. Moreover stepping into the code would not work. Also when I opened Vcl.Graphics and some other files in the IDE, it would automatically marked them as modified. I was puzzled. I thought this was a new bug in the 10..4.1 Delphi IDE. But it turns out this was due to a Project Magician, otherwise very useful option to "Clean Line Feeds" under global settings. Vcl.Graphics has mixed line breaks in Delphi 10.4.1, so whenever it is opened in the IDE it would be automatically marked as modified since the mixed line breaks were detected and marked for fixing. And then debugging is hampered + you get all these annoying messages about the IDE being unable to create a backup. One suggestion to @Uwe Raabe is that Delphi library files are excluded from line-feed cleaning.
  21. pyscripter

    Project Magician gotcha

    @Uwe Raabe One issue I had recently was with the IDE crashing badly when going View Form as Text and then back. I disabled Project Magician and the issue went away. Using Delphi 10.4.1 and the latest version of Project Magician. Delphi Magician options: The crash also occurred with a fresh VCL application and an empty Form.
  22. pyscripter

    Per monitor DPI awareness - how to prevent flickering?

    @dummzeuchAll these limitations of LockWindowUpdate are well known and noted. Yes you should avoid using LockWindowUpdate if you can and prefer WM_SETREDRAW. Fully agree. WM_SETREDRAW was the first thing I tried and did not work. As Raymond Chen says in the above articles One can well argue therefore, that dragging a Window from one monitor to another is a valid case for using LockWindowUpdate. If it is OK to lock the whole desktop when you do OLE drag&drop it should be OK to lock a single window while dragging it between monitors, just for the time it rescales.
  23. pyscripter

    Per monitor DPI awareness - how to prevent flickering?

    InputBox/Query are still broken.
  24. pyscripter

    Per monitor DPI awareness - how to prevent flickering?

    There are a number of ways to reduce scaling time: If you are using VirtualLists with many Icons try RtlVclFixes.pas Use ParentFont := True in child controls to avoid scaling fonts For custom components try to fine-tune/override DefaultScalingFlags
  25. pyscripter

    Per monitor DPI awareness - how to prevent flickering?

    !? Why not 96 to avoid scaling?
×