Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

9 Neutral

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

260 profile views
  1. 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
  2. chkaufmann

    Overloaded generic methods

    Thanks Remy, perfect solution. Christian
  3. 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
  4. 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
  5. chkaufmann

    Memory Management with many objects

    Thanks for all hints. I already use FastMM full version, so I know, there are no memory leaks. I run a huge import from one database to another. I have to pass the data through my business classes. Since I use interfaced objects a lot, destruction is sometimes late. Combined with caching of some complex structures it's not always obvious, where there are still references. I will try to add logging with the code of Stefan. Christian
  6. I have to solve some "out of memory" problems during an import in my application. My application is still 32bit and when I check the memory in the process explorer, it's not 100% clear for me, which values are critical. Here are my questions: - What is an easy way to see the number of objects of each class during debugging? Do I have to build something on my own? Can I get this info for records as well? - Is it worth to switch the application to 64bit? - For 32bit, which values in the Process Explorer are critical and what are the maximum values during runtime that will be save? Thanks for any hints and tips here. Christian
  7. chkaufmann

    Label Style and Color in DFM

    The goal is, to avoid values for unchanged properties (Name, CharSet, Height) spread over all my controls in the DFM files. If I want my application using the Screen.MessageFont, automatic update does not work for all controls with different color and/or style. Christian
  8. chkaufmann

    Label Style and Color in DFM

    Hi, when I change the color and/or style (italic, underline) of the Font of any control (most of the time it's TLabel), then I get this in the DFM: Font.Charset = DEFAULT_CHARSET Font.Color = clHighlight Font.Height = -12 Font.Name = 'Segoe UI' Font.Style = [fsBold] ParentFont = False But the added information is only this: Font.Color = clHighlight Font.Style = [fsBold] Now the only solution I see, is to write my own descendant for the control and add my own properties for Style and Color. But even then I would have to suppress usage of these properties during design time in order to leave Font/ParentFont unchanged. Or did I miss something? Christian
  9. chkaufmann

    Default for published property

    Thanks for the solution. Christian
  10. chkaufmann

    Default for published property

    I except the default not to be written to the DFM at all. It works for High(Integer) but it looks like it doesn't for Low(Integer). Christian
  11. I have a custom control and defined the following published properties: property MaxValue: Integer read FMaxValue write SetMaxValue default High(Integer); property MinValue: Integer read FMinValue write SetMinValue default Low(Integer); It works fine for MaxValue, but for MinValue I always get this in my dfm files: MinValue = -2147483648 Are there limitations for default values and if yes, where can I find these? Christian
  12. chkaufmann

    New TForm - Defaults

    Thanks for your answer. You are right regarding "properly" designed forms. Unfortunately I deal with old applications, that are not perfect and I thought, if I see it with the most common font/size used today, I could just fix the major problems. Mainly fix "Top" and "Height" problem are an issue because all labels and controls are higher. Christian
  13. chkaufmann

    New TForm - Defaults

    I looked at the problem again and this seems the most reasonable solution for me. The only question that remains, how can I set the IDE font used during designing to "Segoe UI, 9pt" because right now, when I choose "ParentFont = True" then I still get "Tahoma 8pt". Christian
  14. chkaufmann

    New TForm - Defaults

    When I create a new form (File - New - VCL Form) font and size is always like this: Font.Height = -11 Font.Name = 'Tahoma' but I would like to have it like this: Font.Height = -12 Font.Name = 'Segoe UI' Is there a simple way to achieve this? I remember, that I saw a sample with an IDE expert for this, but is there no way to set this default in the IDE or "per project"? Christian
  15. chkaufmann

    TIdHTTPServer.OnCommandGet - Timeout

    Follow up question: I create my own request object in my OnCommandGet event. Is there a way to have a reference to this in the current TIdContext or do I have to build my own list/container for this? Christian