Jump to content

dummzeuch

Members
  • Content Count

    3019
  • Joined

  • Last visited

  • Days Won

    108

Posts posted by dummzeuch


  1. GExperts did not have a Code Formatter in the 90ies. There was only DelForEx by Egbert van Nees (and later a code formatter as part of project JEDI which today is part of the Lazarus IDE).

    He donated that code to GExperts in the mid 2000ties and I integrated it into GExperts and over the years improved it (performance on large files more than doubled) and extended it to cover new language constructs that were added.

    • Like 1
    • Thanks 1

  2. I just had a look at my import unit. It also uses stdcall, so that's not the problem. I apparently wrote a test tool, but I don't recall the specifics. As I already wrote on Mastodon: I ended up just using the keyboard emulation. It might have been because I didn't get the API to work. Or maybe the emulation was easier and good enough. I'll try to look into it tomorrow, if I find some time.


  3. At least one of my bug reports got resolved in Delphi 12 :classic_cheerleader: partially :classic_unsure::

    This no longer happens the same way, but moving from Run to Components using the right arrow key now only highlights the Menu item without showing the menu. Pressing the down arrow key then shows the menu, so I guess I can live with that partial fix. Moving from Edit to Search with the right arrow key works as expected.

     

    Unfortunately the two most infuriating bugs since Delphi 11 have still not been fixed:

    • Sad 1

  4. I'm pretty sure installing different versions of CE on the same PC will work. But I have never used CE myself, so this is only an (educated) guess based on what I know about having multiple regular Delphi installations on the same PC.

    It would be a good idea to have an up to date image backup of your PC before trying it though.

    • Thanks 1

  5. I have got a curious effect with Delphi 12.2 (maybe it has already been there in Delphi 12.1 but I didn't notice it):

    When starting the IDE and opening a source code file in the editor, the gutter (the panel left of the source code containing line numbers and breakpoints etc.) has some given width. After a few seconds that width gets larger by approximately 16 pixels, moving everything to the right.

    This happens only the first time after starting the IDE. After that, closing and opening files keeps that new width.

    This is on a HD monitor with 1920x1200 pixel resolution and no scaling.

     

    Has anybody else noticed that effect?

     

    Animation.gif


  6. On 8/26/2024 at 5:23 PM, Remy Lebeau said:

    And even though Native(U)Int existed starting in Delphi 2007, they were buggy up to Delphi 2010.

    In which way were they buggy? I'm only aware of the wrong declaration of NativeInt as Int64 in Delphi 7 to 2007. These compilers were all 32 bit only, so NativeInt should have been Integer. That was fixed in Delphi 2009.


  7. Your event handler must match the signature of the event to which you want to assign it. Many events are of the type TNotifyEvent, so this is the most versatile event signature. 

    But I'm not sure I understand what exactly you want to achieve. Maybe a universal message handler would be a better fit for your purpose? But such a handler can not just be assigned.


  8. 1 hour ago, duzzell said:
    
      NativeInt             = Integer;

    Even though this is the same technique as in the fix I attempted, the whole idea of redeclaring a known type is so bizzare to me that I didn't look to see whether it had already be done elsewhere in the code.

    That code was probably written for a Delphi version that did either not have a NativeInt type (Delphi 5 or earlier) or possibly declared it incorrectly. The latter was the case for Delphi 6 to 2007.


  9. 12 hours ago, PeterPanettone said:

    Are you sure that "scaling" generally works as intended? Maybe we could do without it—all the more so because it interferes with the font settings.

    Yes, it works as intended with most windows by now. And turning it off is not an option anyway.


  10. The problem is not that the settings are not saved. I checked it and they are. The problem is that the settings are loaded after the scaling has been initialized and that initialization saves the font sizes. Then the settings are loaded and the font sizes are set, just to be overwritten again when scaling is applied after that. 

    This is why the problem only occurs in Delphi 11 and 12, but not e.g. in Delphi 10.2, as I stated above.


  11. Argl. Maybe it's me who is suffering from amnesia...

    I know the culprit: It's the bloody scaling again. It overwrites the font sizes read from the registry with the defaults.

    But the layout should not be affected by this, and in my installation it isn't.


  12. Since this is no dockable window, saving the IDE's desktop is not necessary to save its settings. Just setting them in the configuration dialog should be enough. And it does work for me. Just tested it in Delphi 10.2.

    You didn't specify which Delphi version you are having this problem with. Am I to assume it's Delphi 12 since that what's listed in your profile?


  13. 1 hour ago, Remy Lebeau said:

    I tested the code I showed with Delphi 12.1 before I posted it, and it worked fine. And it should also work fine in earlier versions, as handling of WideString has not changed over the years. Which makes me wonder if there is another problem with your larger project and .Next is just a victim of circumstance? This feels like a classic symptom of "undefined behavior" being invoked in earlier code. 

    Hm. my "larger code" is the test program here:

     

    https://svn.code.sf.net/p/dzlib/code/dzlib/trunk/tests/AutoCompleteTest

     

    Which isn't much more than a form with a few TEdits and calls to the various TEdit_AutoAutoCompleteXxx procedures in the constructor:

    constructor Tf_AutoCompleteTest.Create(_Owner: TComponent);
    var
      sl: TStringList;
    begin
      inherited;
      TEdit_ActivateAutoCompleteDirectories(ed_AutoCompleteDirs);
      sl := TStringList.Create;
      try
        sl.Add('one');
        sl.Add('two');
        sl.Add('three');
        sl.Add('four');
        sl.Add('five');
        sl.Add('six');
        sl.Add('seven');
        sl.Add('eight');
        sl.Add('nine');
        sl.Add('ten');
        TEdit_SetAutoCompleteStringList(ed_AutoCompleteStrings, sl);
      finally
        FreeAndNil(sl);
      end;
    
      TEdit_ActivateAutoCompleteFiles(ed_AutoCompleteDfmFiles, '*.dfm');
      TEdit_ActivateAutoCompleteFiles(ed_AutoCompleteFilesCallback, AutocompleteFilter);
      // These masks are passed to Masks.MatchesMask, so they allow something more than just '*' and '?'
      // wildcards, e.g. '[a-z]_*.dpr' would also work, which matches 'a_blablub.dpr'.
      TEdit_ActivateAutoCompleteFiles(ed_AutoCompleteFilesMasks, ['*.dpr', '*.pas']);
      TEdit_ActivateAutoCompletePath(ed_AutoCompletePath);
    end;
    
    procedure Tf_AutoCompleteTest.AutocompleteFilter(_Sender: TObject; const _Filename: string;
      var _Accept: Boolean);
    var
      ext: string;
    begin
      ext := TFileSystem.ExtractFileExtFull(_Filename);
      _Accept := SameText(ext, '.pas') or SameText(ext, '.dfm');
    end;

    Could you please post the code you used to test your .Next implementation(s)?


  14. 12 hours ago, Remy Lebeau said:

    TEnumStringHelper.Next() should look more like this instead:

    Unfortunately both your proposed changes to the code of .Next still raise the same "System exception (code 0xc0000374) at 0x77026e13" with "77026db3 ntdll.RtlIsZeroMemory + 0x93" at the top of the call stack" as my original code did in Delphi 12. My changed code works in all versions of Delphi from 2007 up.

     

    12 hours ago, Remy Lebeau said:

    Also, your TEnumStringHelper.Skip() is just plain wrong.  If celt is <= 1 then you get stuck in an endless loop retrieving strings until the enum is exhausted, and if celt is > 1 then you exit prematurely after 1 string is retrieved.

    You are right with the problem in Skip though. I should have read the description more carefully.

×