Jump to content

luebbe

Members
  • Content Count

    99
  • Joined

  • Last visited

Everything posted by luebbe

  1. luebbe

    Howto prevent a grid from scrolling

    Hi Folks, I'm stuck with the problem that I want to prevent a grid to act on the mouse wheel events. The UI layout is the following: On a TFrame (created at runtime) I have a TCategoryPanelGroup. As the application is receiving data in different formats, for each data package a new TCategoryPanel is created at runtime and placed on the TCategoryPanelGroup. Each TCategoryPanel contains two grids who are adjusted to fit the data. The heights of the grids and the TCategoryPanel are adjusted so that in >90% of the cases the grids won't have a scrollbar. Now when I use the mouse wheel over a grid, the grid catches the wheel and happily acts on it, which is not what I want. If the grid has a scrollbar (rare case), the user shall use the scrollbar to scroll the grid. My goal is to always scroll the TCategroyPanelGroup when the mouse wheel is used over one of the grids or a TCategorypanel so the user can quickly flip through the categories. How can I make the grids and the TCategoryPanel "ignore" or "pass up" the mouse wheel events so that the TCategoryPanelGroup receives them and can act on them? Would a different structure of UI elements be a better approach? I'm actually quite happy with the category panels, because the data inside can be clearly identified via their header and they can be collapsed when I don't want to see all different data sets at the same time. I've attached a stripped example of the UI structure that just catches the mouse wheel events for the controls and outputs them in a memo. MouseScroll.zip
  2. luebbe

    Howto prevent a grid from scrolling

    Sorry no, it doesn't help. The stringgrid still catches all mouse wheel events. And there is a stack overflow in TControl.Defaulthandler when I'm not over a grid.
  3. 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.
  4. 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!
  5. 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.
  6. 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.
  7. luebbe

    C++ Code Insight in 10.4.2

    @Lajos Juhász Did you notice that the link that you posted actually goes through facebook?
  8. 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 😉
  9. 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
  10. 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 🙂
  11. 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.
  12. 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;
  13. Thanks Lars, once again this is proof, that T(ea) makes you happy...
  14. I started my open source life on SF and contributed quite a lot to TortoiseSVN there.
  15. 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.
  16. 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
  17. for I := low to high do; begin ... end; falls into the same category.
  18. Ouch. Are you sure you want to do this? How are you going to ensure that your loop terminates when you keep adding items inside the loop? Consider list.count-1 to be a constant while the loop is executed. This ensures termination. If you really want to change the list content while iterating over the list, use a while loop and ensure termination yourself.
  19. luebbe

    Drawing bug with VCL Styles

    Hi Folks, I have a strange bug when a VCL styled application is maximized in a dual monitor configuration. Steps to reproduce: 1. Set your windows task bar position to "top" 2. Create a minimal application and activate a VCL style (add a main menu if you like) 3. Run the application and: * maximize it on the primary monitor (fine) * maximize it on the secondary monitor (The top part of the application, probably the height of the windows task bar, becomes transparent) left: maximized on primary monitor right: maximized on secondary monitor Additional Info: * My two monitors have different resolutions and they have a vertical offset * This bug doesn't seem to affect many people (no customer has reported it so far ;-)) * This is not a new bug. I've seen for years (three to four) it in several Delphi versions, but I can't put a date on it Today I tried to find out if it is a problem with our main form's settings, but since it also happens with a minimal application, it probably isn't. Has anybody encountered this as well? Does anyone know how to fix it? Do I have to wait for Emba to fix it? Cheers & thanks Lübbe
  20. luebbe

    Drawing bug with VCL Styles

    Lucky you 😉 10.4.2 + all patches (work laptop) 10.4.1 + all patches (work desktop) 10.3.x community edition (home)
  21. luebbe

    Drawing bug with VCL Styles

    Yes, immediately reproducible on my home PC Screen layout: Monitor 1: 1920x1080 (24") Monitor 2: 2560x1440 (27") When both monitors align at the top, everything is fine. This is also sufficient. You have to toggle the app between normal and maximized mode after you change the screen alignment. If you leave the app maximized while changing the screen alignment, everything will stay ok.
  22. luebbe

    Drawing bug with VCL Styles

    Sorry for the late reply. It was a very busy week. Monitor 1: 1920x1080 (??" Laptop screen) Monitor 2: 2560x1440 (27") Both set to 100% font scaling It also happens on my desktop PC at work, which has two 24" monitors with different resolutions Monitor 1: 2560x1440 (24") Monitor 2: 1920x1080 (24") Both set to 100% font scaling They have a slight vertical offset IIRC (working from home, desktop is in the office) May be driver antics, but our IT department keeps everything as up-to-date as possible. I'll compile it with the community edition on my home PC and try what happens there.
  23. luebbe

    Drawing bug with VCL Styles

    I was half fearing @lars' answer :) Thanks to @dwrbudr for confirming it. This is my monitor setup with (1) being the laptop monitor as secondary screen and (2) the desktop monitor as primary screen.
  24. luebbe

    Drawing bug with VCL Styles

    Good morning Lars, Thank you. Here it is. Maximized.zip
  25. luebbe

    Drawing bug with VCL Styles

    I didn't touch anything knowingly in the manifest. Just dropped a menu on the form and activated a VCL style. The minimal app has "per monitor v2" Our standard app has "none" So I guess it doesn't have anything to do with dpi awareness?
×