Jump to content

luebbe

Members
  • Content Count

    97
  • Joined

  • Last visited

Community Reputation

22 Excellent

Technical Information

  • Delphi-Version
    Delphi 10.4 Sydney

Recent Profile Visitors

903 profile views
  1. luebbe

    Google Charts in uniGUI

    Looks nice. I'm missing information on where to find unigui. A search on GitHub resulted in a lot of hits.
  2. luebbe

    The state of GExperts Support for Delphi 11

    Probably a rounding problem? @pyscripter has created a dpi aware base form which IIRC uses muldiv to adjust to dpi changes. Enjoy your vacation!
  3. not 4K, but two monitors with different resolutions HD and WQHD. Setting one of them to a scaling >100% screws up a lot of things in and around the IDE.
  4. luebbe

    C++ Code Insight in 10.4.2

    @Lajos Juhász Did you notice that the link that you posted actually goes through facebook?
  5. Thanks Stefan, in the debugger I saw in ItemCallback(..) that the addresses of FItem and AItem were similar but not equal, so I suspected that there was something wrong with the interface being passed around instead of the object. I put a breakpoint on the first line of procedure TestIntfItem.ItemCallback(AItem: IMyIntfItem); begin Assert.IsNotNull(AItem); FCallbackResult := AItem.Caption; end; with TOnMyIntfItemSelected<T: IMyIntfItem> = procedure(AItem: T) of object; I see: Name Wert Self (TMyIntfItemA<List.Intf.IMyIntfItem>($3AA2840) as IMyIntfItem, '') AItem Pointer($3AA2828) as IMyIntfItem This told me that something was wrong, but I couldn't understand what. with TOnMyIntfItemSelected<T: IMyIntfItem> = procedure(AItem: IMyIntfItem) of object; I see: Name Wert Self (TMyIntfItemA<List.Intf.IMyIntfItem>($3AC38D8) as IMyIntfItem, '') AItem TMyIntfItemA<List.Intf.IMyIntfItem>($3AC38D8) as IMyIntfItem That's an evil trap. Thanks for shedding light on it. So if something is wrong I have to watch out for $18 byte address offsets 😉
  6. Back from vacation... Thanks for further feedback, I probably oversimplified the interface in order to produce a minimal example. In fact I do have stuff in the interface. The attached project contains two different implementations, one interface based and one skeleton based, with a few unit tests. You need TestInsight installed and the path to DUnitX in the $(DUNITX) variable to run it. I needed a callback for a list item (selection) and for the list itself (changed). The skeleton based implementation works as expected, but the interface based callback for the list item fails with an A/V and I don't understand why. I'm probably still doing something wrong with the generic definition. Could someone please enlighten me what my mistake is? Project4.zip
  7. Meanwhile I prefer interfaces over abstract classes. It was the other way round 20 years ago. Still struggling with the data passed in the callback, but I'll look into it again ten days from now. Finally a bit of vacation 🙂
  8. Arggh, same thing again. Thanks again. Hopefully this time it sticks in my brain. It's not that I'm not working with generics a lot. It's just that I rarely build generics from scratch.
  9. I think the skeleton is what I'm heading towards. Next question. How can I implement a callback with the list itself? I tried different variations, but this is as far as I can get. type IMyIntf = interface; TMyList<T: IMyIntf> = class; TOnListItemSelected = procedure(AItem: IMyIntf) of object; TOnListUpdated = procedure(AList: TMyList<IMyIntf>) of object; IMyIntf = interface ['{FCAFF2E8-5F8E-4473-8795-89BD41C89D57}'] end; TMyList<T: IMyIntf> = class FItems: TList<T>; FOnListUpdated: TOnListUpdated; procedure ListUpdated; end; { TMyList<T> }procedure TMyList<T>.ListUpdated; begin if Assigned(FOnListUpdated) then FOnListUpdated(Self); // E2010 Inkompatible Typen: 'Project4.TMyList<Project4.IMyIntf>' und 'Project4.TMyList<Project4.TMyList<T>.T>' end;
  10. Thanks Lars, once again this is proof, that T(ea) makes you happy...
  11. Hi Folks, I'm banging my head against the wall trying to understand, why the compiler throws "E2008 Incompatible Types" errors at the marked lines. I must be missing something completely... program Project4; {$APPTYPE CONSOLE} {$R *.res} uses System.Generics.Collections, System.SysUtils; type IMyIntf = interface ['{FCAFF2E8-5F8E-4473-8795-89BD41C89D57}'] end; TMyList<IMyIntf> = class FItems: TList<IMyIntf>; procedure AddItem(AItem: IMyIntf); function GetItem: IMyIntf; end; TMyType = class end; TMyTypeList<TMyType> = class FItems: TList<TMyType>; procedure AddItem(AItem: TMyType); function GetItem: TMyType; end; { TMyList<IMyIntf> } procedure TMyList<IMyIntf>.AddItem(AItem: IMyIntf); var Value: IMyIntf; begin FItems.Add(AItem); // E2008 Incompatible Types FItems.Add(Value); // Compiler is happy end; function TMyList<IMyIntf>.GetItem: IMyIntf; begin Result := FItems[0]; // E2008 Incompatible Types end; { TMyTypeList<TMyType> } procedure TMyTypeList<TMyType>.AddItem(AItem: TMyType); var Value: TMyType; begin FItems.Add(AItem); // E2008 Incompatible Types FItems.Add(Value); // Compiler is happy end; function TMyTypeList<TMyType>.GetItem: TMyType; begin Result := FItems[0]; // E2008 Incompatible Types end; begin try { TODO -oUser -cConsole Main : Code hier einfügen } except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end.
  12. I started my open source life on SF and contributed quite a lot to TortoiseSVN there.
  13. He's one of the guys who tries to prevent Sourceforge from dying ;) Admittedly I forgot my SF password, since I haven't logged in for years.
  14. Additional Info: SVGIconImageList has a wrapper for Image32, so Image32 can be used as one of four rendering engines for SVG icons. Since it proved to be the best of the four, @Carlo Barazzetta has made it the default. See: https://github.com/EtheaDev/SVGIconImageList
  15. for I := low to high do; begin ... end; falls into the same category.
×