Jump to content

chkaufmann

Members
  • Content Count

    70
  • Joined

  • Last visited

Community Reputation

10 Good

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

375 profile views
  1. chkaufmann

    VirtualTreeview for FMX

    In my Windows applications I use VirtualTreeview for grids with inplace editors. Sometimes I load up to several 10'000 rows (nodes). For this I use rather light node classes. When I look at TTreeviewItem in FMX, then each node is a control and I don't think, this will work the same way. So are there alternatives. I need - tree check functionality (simple, tristate) - multiple columns - inplace editors - lazy load for child nodes Christian
  2. chkaufmann

    Database for Cloud and Offline

    Hi, I have an application that still uses an MS Access as database. With the library I have I can run it on other databases as well since all requests are pure SQL (no TTable or things like that). Now I'm looking for a replacement and I wonder, if there is a solution that could be used for cloud and offline. The databases are not that big (about 25 tables, maximum 25'000 records each). But each customer may have up to 50-100 databases. Ideal would be a solution where the database could be in the cloud, but there is an offline copy in case the internet connection is broken, so I can continue to work. When I'm back online, all changes would be synchronized to the server. Now I know there is probably no easy solutions, but I'm open for ideas on how to find a good solution. Christian
  3. chkaufmann

    Missing compiler warning

    So just that I get it right: Because my return value is an interface type, the compiler adds something like this as first statement of the method: Result := nil; Chrisitan
  4. chkaufmann

    Missing compiler warning

    Hi, I just fixed an error in the following function. I had to add the last line where I assign tmp to Result. Now I wonder, why I didn't get a compiler warning like "return value of function might be undefined.". I get such errors in the same project with other methods, so the options are set correctly. Christian class function TLnxResult.GenForEvent(AData: TLnxObject; AEventId, AAgegroupId: Integer): IBSEnumerable<IBSSwLenexResult>; var data : TLnxAbstractObject; clubs : TLnxCollection; tmp : IBSList<IBSSwLenexResult>; begin tmp := TBSGenerics.GenList<IBSSwLenexResult>; data := AData; while Assigned(data) and (data.Tag <> lxCOMPETITION) do data := data.Parent; clubs := TLnxCollection(TLnxObject(data).ChildObject[lxCLUBS]); if Assigned(clubs) then for var ixC := 0 to clubs.ChildCount - 1 do begin for var e in TLnxEntryResult.GenForClub(lxRESULTS, TLnxCollection(clubs.Objects[ixC].ChildObject[lxPERSONS]), AEventId, AAgegroupId) do tmp.Add(e as IBSSwLenexResult); for var e in TLnxEntryResult.GenForClub(lxRESULTS, TLnxCollection(clubs.Objects[ixC].ChildObject[lxRELAYS]), AEventId, AAgegroupId) do tmp.Add(e as IBSSwLenexResult); end; tmp.Sort(function(const AResult1, AResult2: IBSSwLenexResult): Integer begin Result := AResult1.Place(nil) - AResult2.Place(nil); if Result.IsZero and (AResult1.Place(nil) = BSSW_MAX_PLACE) then Result := AResult1.Status.AsInteger - AResult2.Status.AsInteger; end); Result := tmp; // <<<< this line was missing. end;
  5. chkaufmann

    Class Constructor in Delphi 10.4

    The problem is to create a reproducable case. The order of initialization sections and class constructor is at least partial random. So things work fine but if you add a unit or change one of the uses in a project, the order is different. So I don't use class constructor anymore.
  6. In 10.3 (Rio), class constructors are implemented the same way as initialization sections of units. This means, I have no control about the order. So if I create an object of my class in an initialization section, I cannot be sure, that the class constructor for this class was already called. Just wondering: is this problem fixed in 10.4? Or is it still done the same way? Christian
  7. chkaufmann

    Modern TColorDialog

    Hi, The color select dialog in Delphi (TColorDialog, TColorBox) looks quite old and keeping multiple custom colors available doesn't really work. Does somebody have a recommendation to replace it? Christian
  8. chkaufmann

    WM_MOUSEMOVE message

    In my application I have a TApplicationEvents object and there I use the OnMessage event. I was wondering why this event is called all the time even then when I don't touch the mouse and/or the keyboard. Now I noticed that WM_MOUSEMOVE are sent all the time. Is this normal - probably not - but how can I find out, where these messages come from. As soon as I move the mouse cursor outside of my applications window the messages stop. Christian
  9. No. In my approach is I have only two tables in the SQL database: ENTITY and ENTITYVALUE. Basically each object has one record in ENTITY with general values (id, guid, ownerid, created, modified) and then it has one record for each value in ENTITYVALUE. Like this, the database is very generic and the meta information is in the code only. Christian
  10. We built our own framework where we can define different entity types. Each Entity Type has 1-n values. Then we allow different relation between entity types: - Parent / Child - Reference - Link (m:n relation) At first glance a parent/child relation is the same as a mandatory reference. But somehow it feels, it's not and I try to find the rules when to choose parent/child and when to choose reference. Can someone point me to appropriate reading? Thanks Christian
  11. chkaufmann

    AV in GExperts with Themes

    Hi, from time to time I run into an endless AV when running grep from GExperts. Here is the stack trace. I'm not sure if this is a GExperts or a DevExpress problem: [5005FD90]{rtl260.bpl } System.TObject.InheritsFrom (Line 18239, "System.pas" + 6) + $0 [5005FBE2]{rtl260.bpl } System.@IsClass (Line 17942, "System.pas" + 1) + $8 [0B4ED18C]{themeloader260.bpl} System. + $0 [0B4ED959]{themeloader260.bpl} Idetheme.Vclstyledialogshooks.TTabControlIDEDialogStyleHook.Paint + $2D [50E05577]{vcl260.bpl } Vcl.Themes.TCustomStyleServices.DrawParentBackground (Line 2592, "Vcl.Themes.pas" + 1) + $F [50E05591]{vcl260.bpl } Vcl.Themes.TCustomStyleServices.DrawParentBackground (Line 2598, "Vcl.Themes.pas" + 1) + $D [0B4E61F2]{themeloader260.bpl} Idetheme.Vclstylehooks.TTabControlIDEStyleHook.PaintBackground + $82 [0B4D8D17]{themeloader260.bpl} Idetheme.Vclstylehooks.TIDEStyleHook.WMPaint + $EF [0B4D8E82]{themeloader260.bpl} Idetheme.Vclstylehooks.TIDEStyleHook.WndProc + $7A [0B4D97B0]{themeloader260.bpl} Idetheme.Vclstylehooks.TMouseTrackControlIDEStyleHook.WndProc + $0 [0B4E6AB2]{themeloader260.bpl} Idetheme.Vclstylehooks.TTabControlIDEStyleHook.WndProc + $A [0B4D8924]{themeloader260.bpl} Idetheme.Vclstylehooks.TIDEStyleHook.HandleMessage + $A0 [0B511493]{themeloader260.bpl} Idetheme.Stylemanager.TIDEThemeStyleEngine.HandleMessage + $97 [0B511C96]{themeloader260.bpl} Idetheme.Stylemanager.TIDEThemeStyleEngine.UnRegisterSysStyleHook + $DA [50D197BC]{vcl260.bpl } Vcl.Controls.TWinControl.WndProc (Line 10122, "Vcl.Controls.pas" + 10) + $48 [50CF65D7]{vcl260.bpl } Vcl.Graphics.FreeMemoryContexts (Line 7138, "Vcl.Graphics.pas" + 12) + $8 [50D19314]{vcl260.bpl } Vcl.Controls.TWinControl.MainWndProc (Line 9977, "Vcl.Controls.pas" + 3) + $6 [501796A4]{rtl260.bpl } System.Classes.StdWndProc (Line 17932, "System.Classes.pas" + 11) + $2 [1D14BADA]{DevEx_Main.bpl} Cxcontainer.TcxCustomInnerListBox.DoGetGestureOptions + $AFE [1D08A9E1]{DevEx_Main.bpl} Dxhooks. + $0 [50E6EC33]{vcl260.bpl } Vcl.Forms.TApplication.ProcessMessage (Line 10747, "Vcl.Forms.pas" + 23) + $1 [50E6EC5E]{vcl260.bpl } Vcl.Forms.TApplication.ProcessMessages (Line 10769, "Vcl.Forms.pas" + 1) + $4 I'm using Delphi 10.3.2 and GExperts 1.3.13.77. Christian
  12. chkaufmann

    TEdit - Center text vertical

    I have a TEdit that is a bit higher than normal in order to align it with other controls. Then I wanted to center the text vertically but there is no such property and the only solution I found is to overwrite the Paint method in a subclass. Is this really the case? Or did I miss something? Christian
  13. chkaufmann

    Overloaded generic methods

    Thanks Remy, perfect solution. Christian
  14. chkaufmann

    Overloaded generic methods

    But if I don't declare T:class I cannot use it in the InheritsFrom() method. Same for an IInterface with the Support method: function TComponentHelper.FindComponents<I:IInterface>: IBSEnumerable<I>; var ix : Integer; lst : IBSList<I>; tmp : I; begin lst := TBSGenerics.GenList<I>; for ix := 0 to ComponentCount - 1 do if Supports(Components[ix], I, tmp) then lst.Add(tmp); Result := tmp; end; function TComponentHelper.FindComponents<T:class>: IBSEnumerable<T>; var ix : Integer; lst : IBSList<T>; tmp : T; begin Assert(T.InheritsFrom(TComponent), 'Nur für Subklassen von TComponent'); lst := TBSGenerics.GenList<T>; for ix := 0 to ComponentCount - 1 do if Components[ix].InheritsFrom(T) then begin TComponent(tmp) := Components[ix]; lst.Add(tmp); end; Result := lst; end; Christian
  15. Hi, I try to create this helper: TComponentHelper = class helper for TComponent public function FindComponents<I:IInterface>: IBSEnumerable<I>; overload; function FindComponents<T:class>: IBSEnumerable<T>; overload; end; but I get an error "methods with identical parameters". In my generic code I filter components either by using "InheritsFrom" or "Supports()". Therefore I need IInterface and class in the declaration or is there another way to do that? Christian
×