Jump to content

Uwe Raabe

Members
  • Content Count

    2555
  • Joined

  • Last visited

  • Days Won

    149

Posts posted by Uwe Raabe


  1. In 10.4+ it is and versions before have no ImageName properties.

    function TVirtualImageList.IsImageNameAvailable: Boolean;
    begin
      Result := FImageNameAvailable;
    end;

    Actually that function is introduced in TCustomImageList. It is just overridden in TVirtualImageList.


  2. 12 minutes ago, Eric Grange said:

    this could be worked out by subclassing the image list, reintroducing the property, and then using the image list subclass everywhere...

    You can as well override the IsImageNameAvailable function for that subclass and just return False.


  3. The ImageName can only be stored when the linked image list supports it. A plain old TImageList does not, so that won't make any problems. 

     

    The new TVirtualImageList introduces ImageName support, but makes it configurable with its ImageNameAvailable property. Setting that to False avoids setting the ImageName property on the linking controls. You might have to clear existing ImageName values manually, though.


  4. 46 minutes ago, Stano said:

    The process cannot access the file because it is being used by another process.

    This usually happens with embedded drivers that require exclusive access to the database. This would even happen when you run your project, open the IDE and try to set Connected to True. Also when you run two instances of your program at once. I doubt there is any automatic solution covering all these cases.

     

    It should not happen with a decent InterBase or FireBird server, which are able to cope with multiple connections at once. Perhaps using one of those during development helps to circumvent the problem.


  5. 8 hours ago, Vincent Parrett said:

    VirtualTrees.pas is now only 2K lines and code is split into units that make sense. 

    Nevertheless are there several cycles as shown by MMX Unit Dependency Analyzer:

     

    image.thumb.png.841cb19647a00bfa0b808f60f587dcc5.png 

     

    Here is a part of the Dependency Graph from Understand for the VirtualTrees -> VirtualTrees.WorkerThread cycle with information where the dependencies come from in the Dependency Browser below:

     

    image.thumb.png.4cea5bde6ee1fcc605a1779a94962a06.png


  6. 1 minute ago, Vincent Parrett said:

    Does it actually support Delphi

    Yes, it does: Supported Languages. They are also providing new releases in a reasonable time frame. When I provide a test case showing some syntax confusing the parser, they usually fix it in the next two releases.

     

    6 minutes ago, Vincent Parrett said:

    Also, if I have to contact a vendor for a price I immediately lose interest

    OK, but that doesn't say anything about the quality and usability of the product.

     

    I may have reacted the same when I had found the website myself, but I already had another product from their German reseller, when they contacted me with a trial of Understand. That was 2014 and I declined with a comment about the poor Delphi support. In 2016 they came up with that again, and I agreed, because the Delphi support was sufficient for me at that time. Meanwhile, with some significant help from myself, it became even better.

     

    As I often have to cope with foreign code and for that it proved very helpful. It turned out that it also gives some valuable insights in my own code, especially the sort of code that evolved over time. I am glad to have this tool at hand. One can argue about their sales channel, but IMHO that doesn't diminish the product itself. BTW, one can always try to negotiate with the reseller.


  7. Just a small anecdote: Working on one of my customers code base, which is heavily convoluted with circular references, I was able to break a cycle with simply using a string literal instead of a global constant declared in one of the units, knowingly sacrificing at least some of the Clean Code principles. The constant was declared like this:

    const
      cLocalHost = 'localhost';

    BTW, a valuable tool for me to understand someone else's code and detect the fibers a cycle is made from is SciTools Understand. Although it may look a bit expensive for some at first, the time saving effects are absolutely worth it.


  8. 1 minute ago, Lajos Juhász said:

    For compiler stability possible it's more important to write the entire unit name eg. Winapi.Windows instead of Windows and having a large list of unit scopes names in the options. 

    Relying on unit scope names also makes the compiling slower. Besides MMX there is also UsesCleaner as its command line companion resolving these issues.

    • Thanks 1

  9. Avoiding circular unit references speeds up compilation significantly. Let me cite @Bill Meyer in his excellent book Delphi Legacy Projects : Strategies and Survival Guide:

    Quote

    When you are working with 1,000 or more units, and the majority of them are participating in dozens (or more) of such cycles, and the length of the cycles is dozens (or more) units, then you have a real snarl.

    And worse, you will find that the days of building in seconds are long gone, and that building the application now takes minutes.

    As slower compile times also affect the IDE, especially Code Insight, we are not just talking about longer build times, but responsiveness of the IDE itself.

     

    Also mentioned in the book and backed by my own experience and involvement, a very helpful tool is the Unit Dependency Analyzer built in MMX Code Explorer (also available as standalone). Bill dedicates a whole chapter in his book on Cleaning Uses Clauses.

    • Thanks 1

  10. The docs say for WS_EX_NOACTIVATE:

    Quote

    A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window.

     


  11. That would still miss the 

    44 minutes ago, CoMPi74 said:

    completely transparent for all mouse and keyboard activities

    To achieve that add a message handler like this:

        procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST;
    
    
    ...
    
    procedure TMyTransparentForm.WMNCHitTest(var Message: TWMNCHitTest);
    begin
      Message.Result := HTTRANSPARENT;
    end;

     


  12. 5 minutes ago, Attila Kovacs said:

    Is there a component that supports both at the same time?

    As already mentioned, TMS FNC Grid, but also TeeGrid from Steema.

     

    Technically these are not strictly the same component, because it must be derived from either a VCL or FMX TControl, but for the developer it comes quite near.


  13. I guess, that is as designed. When you click on a date that date is selected. When you click again on the same date it is unselected and the Date property is set to NullDate:

      NullDate: TDate = -700000;

    You can avoid that when you set SelectionMode to smNone.

    • Like 1

  14. 34 minutes ago, Sherlock said:

    I wonder what Embarcadero would call a procedure with a return type...

    Hybrid, Bastard, Chimera or (my personal favorite) Manticore.

     

    But as we already can call a function like a procedure, it may be straight forward to declare a procedure with a return type - even if there is no way to retrieve that value. 🤔

     

    Looking into details, a function internally is just a procedure with an additional parameter for the return value. It is the declaration that makes the difference.

     

    After all, I agree that BlockRead/BlockWrite should no longer be used.

    • Thanks 1
×