Jump to content

uligerhardt

Members
  • Content Count

    83
  • Joined

  • Last visited

Posts posted by uligerhardt


  1. 21 minutes ago, dummzeuch said:

    There is no option (as far as I know, I might have missed it). And I remember seeing a comment in the original formatter sources from Egbert van Nes that he implemented this behaviour because he couldn't get the formatter handle these comments in any useful manner without breaking the source code.

     

    If anybody really wants to use that kind of comments: I am accepting patches.

    OK then, I'll see if I can give it a try.


  2. 23 minutes ago, Lars Fosdal said:

    /off-topic Preferences of code.  I like begin/end for clarity.
    However, I also like unusual breaks before then and strange indentations of single statements.  If only I could convince the formatter to do my bidding.

    
    procedure MyProcedure(a, b: Boolean);
    begin
      if a
      then begin
        if b 
         then Beep
          else Beep
      end  
      else begin
        if b // Kommentar
         then Beep
          else Beep;
      end;
    end;

     

    I'd just use begin/end here too, but that's difficult because of my charcter counting colleague. 😉


  3. I have disabled the "Always break line between else and if" option, and I'm happy with the results.

     

    However my colleague insists on having nested if-elses without begin/end pairs and on top mixes this with comments. A simplified example:

    procedure MyProcedure(a, b: Boolean);
    begin
      if a then
        if b then
          Beep
        else
          Beep
      else
        // Kommentar
        if b then
          Beep
        else
          Beep;
    end;


    This gets formatted to

    procedure MyProcedure(a, b: Boolean);
    begin
      if a then
        if b then
          Beep
        else
          Beep
      else
        {// Kommentar} if b then
          Beep
        else
          Beep;
    end;

    Is there an option to keep the lines separate under these circumstances? Do you deem the current behavior desirable?


  4. 21 hours ago, Remy Lebeau said:

    I don't know if this is covered in the documentation (I can't find it), but in TMetaFile's source code is the following comment:

     

    Thanks, I didn't see that comment. And indeed it mostly works without the cloning. However without passing a reference DC <> 0 resolution/size still get mixed up. But as mentioned in my postscriptum I found a compatible DC, so that's only a cosmetic problem. :-))


  5. I have an existing enhanced TMetafile in memory (technically speaking an array of them - it's a print preview) and want to add some text to it (page numbers). How can I best achieve that?

     

    First I tried creating a TMetafileCanvas for the MF and added my text. But creating the TMetafileCanvas clears the existing MF, so no luck. Could I supress the clearing somehow?

     

    The next idea was to clone the original MF:

        OrigMF := // my metafile in memory
        CloneMF := TMetafile.Create;
        try
          CloneMF.Assign(OrigMF);
          MFCanvas := TMetafileCanvas.Create(CloneMF, 0);
          try
            MFCanvas.Draw(0, 0, OrigMF);
            // Draw my stuff on MFCanvas
          finally
            MFCanvas.Free;
          end;
          OrigMF.Assign(CloneMF);
        finally
          CloneMF.Free;
        end;

    but I didn't manage to preserve the page dimensions, font sizes etc. The reference DC used to create OrigMF is gone and the combinations of properties like Width, MMWidth and Inch that I tried didn't help.

    How could I clone OrigMF retaining these informations (that must be stored inside)? 

     

    PS: While writing this post I managed to dig out a reference DC that worked. But answers would be still interesting.


  6. I had a look in the source code and decided I don't want to mess up GExperts' shortcut management. 😅

    However I discovered that the relevant actions (actListSelectNext/actListSelectPrevious in TfmGrepResults) have SecondaryShortCuts assigned. These don't work for me out of the box but I assigned them in the config dialog:

    1137571084_2022-09-3018_18_38-GExpertsConfiguration.thumb.png.fbd2844160cd9189eaf2bc252d06d38a.png

     

    I'll check how that works out for me.


  7. 3 hours ago, dummzeuch said:

    As for changing the functionality depending on the focus: Once you have used it once, the editor window has the focus, so how could the software know what you want?

    I guess one could track the most recently focused one of the "target" lists.

    3 hours ago, dummzeuch said:

    But anyway: GExperts can either use the shortcuts or not, there is no way that I know of to pass them on to the IDE.

    Maybe it could work to have the shortcuts enabled (i.e. <> 0) only if the Grep result list is focused? I'll see if I can play a bit with that.


  8. 2 hours ago, David Heffernan said:

    As an aside what annoys me about image lists in Delphi is that they lump all images in one big dfm blob. I like to keep my icons in icon files and link them as a resource. Then load them up at runtime. It means that when you need to update one you just change the ico file in one place. But then you don't get to see icons at design time. I'd like to have my icons in resources and see them at design time. Such a system must be possible. 

    DevEx cxImageLists at least store the individual images in separate blob subitems. And they don't change the blobs on every occasion.


  9. I'll try to rephrase: As your package is called JasotComponents, * means JasotComponents, so the 3 $R lines are equivalent to:

    {$R JasotComponents.res JasotComponents.rc}
    {$R JasotComponents.res JasotComponentsResource.rc}
    {$R JasotComponents.res JasotComponents.rc}   
    

    So you're instructing Delphi to include the resource file JasotComponents.res 3 times, and to create it alternatingly from JasotComponents.rc and JasotComponentsResource.rc. That probably won't work. 😉


  10. 11 minutes ago, Angus Robertson said:

    The old download page exists, http://vclzip.bizland.com/v4src.htm but all the source downloads are password protected and you can not buy a new license.  But maybe someone not using theirs would sell it?  I still use VCLZip.   Not sure if Kevin is still around, would have been good if it had been made open source. 

     

    Angus

     

     

    FWIW: I sent an e-mail to his bigfoot address and got an "Undeliverable". 😞


  11. 5 minutes ago, Attila Kovacs said:

    To which Delphi? Since XE2 there is System.Zip.TZipFile which would be the right way to move to.

    XE6 for now. I know about System.Zip.TZipFile, but IIRC it didn't have all features we use from VCLZip. I should look again. :classic_biggrin:


  12. Hello all!

     

    We are using an "prehistoric" version (2.21 AFAICT) of VCLZip by Kevin Boylan together with Delphi 2007.

    After finally making the switch to an Unicode version of Delphi we get some errors with invalid zip files and the like.

    In the internet I found references to an Unicode aware version 4.50 but no way to to licence or download it.

    Does anybody have any hints with this?


  13. 10 hours ago, corneliusdavid said:

    I totally agree. It frustrates me to no end to see and hear about problems in the product but not have any response or idea when they'll get resolved, if a feature is dropped, what the priority is, or ANYTHING. Just someone saying, "sorry it's late, we're working on it but are slammed" or something would be better than silence. So often, I see businesses just trying to pretend everything is OK when customers are clamoring for answers. I always give my customers reasons for being late, even if they've heard them before--they appreciate knowing I'm still alive and are listening to their cries.

    As an Ingress player, I always have to check whether I am in a Niantic or an Embarcadero forum, when I read stuff like this. :classic_blink:

    • Haha 1

  14. 7 hours ago, Anders Melander said:

    If you're exclusively a high level application developer then you probably don't need the SDK, but if you plan to do anything close to the OS then you should install and familiarize yourself with the development tools that comes with the OS. Imagine if your Lamborghini mechanic didn't have the official Lamborghini tools... Would you let him/her mess with your Countach?

    At least I'd be careful with letting an official Ferrari mechanic touch my Enzo 😉 

    Ferrari Enzo zerstört: Mechaniker zerlegt bei Spritztour Millionen-Rarität | STERN.de


  15. 45 minutes ago, vhanla said:

     

    
        var vZipContents := TStringList.Create;
        var zip := TZipFile.Create;
        try
          if TZipFile.IsValid(fZipFilename) then
          begin
            zip.Open(fZipFilename, zmRead);
            for I := Low(zip.FileNames) to High(zip.FileNames) do    
            begin
              vZipContents.Add(zip.FileNames[I]);
            end;
            Memo1.Lines := vZipContents;
          end;
        finally
          zip.Free;
    	  vZipContents.Free;
        end;

     

    Try storing zip.FileNames in a local variable. 

     

    Edit: ... and maybe drop vZipContents and use that local variable instead. 

×