Jump to content

PeterBelow

Members
  • Content Count

    547
  • Joined

  • Last visited

  • Days Won

    13

PeterBelow last won the day on April 30 2024

PeterBelow had the most liked content!

Community Reputation

250 Excellent

1 Follower

Technical Information

  • Delphi-Version
    Delphi 12 Athens

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. PeterBelow

    Richedit

    Microsoft has released several versions of the richedit control over the decades, TRichedit in the current Delphi version (since 11.0 if memory serves) is based on version 4 (the latest and most feature-rich). The Jedi version may be based on an older version. The divers versions are implemented in separate DLLs with different names and use different window class names, so they can coexist on a given Windows system. Different versions may explain the behaviour you see.
  2. PeterBelow

    How to sign .msix packages

    Won't the MS Store sign the package for you when you upload it? I dimly remember some mention about this (also for Google and Apple app stores) in a webinar i watched recently.
  3. PeterBelow

    Richedit

    Is the BiDiMode property set to true on all controls in question? Also look at the methods in the see also section at the bottom of the page linked to for BiDiMode, may be important if you test on a non-hebrew locale.
  4. PeterBelow

    About the compiler (not) finding the DFM files

    I just add the "library" foms to the project that needs them, this way the required path is in the dpr file uses clause. Btw.: I think this DCC_RessourcePath is for the resource compiler and you can set it under that node in the Options dialog. Never needed that myself, though.
  5. PeterBelow

    tray notification dll delphi11.3/Delphi 2010

    Then why don't you delegate the hint showing to a task running in a secondary thread? The task can wait for a short interval and if it is cancelled before that interval has elepsed the hint will not be shown at all...
  6. The answer is no since the update would have to be triggered somewhere from inside the work code. But you can create and show a window from a secondary thread, it is just a bit cumbersome to do since the visual part of the VCL is not thread-safe. The secondary thread needs a message loop that will process all messages for the window, including timers and paint messages. The simplest way to get that loop is to show the window modally. And the safest way to do such stuff is to not use a Delphi form but do it all the API way (hence the cumbersome part above 8-)). If you want to use a Delphi form the important points to mind are: Do not autocreate the form! Create the form inside the Execute method of the secondary thread, using Nil as owner. Use a try finally block to make sure the form is destroyed. Use a field of the thread class to store the form reference. ShowModal the form. Add a public method to the thread class the main thread can call to get the form to close once the work is done. The method should set the form's ModalResult to mrCancel to allow the modal loop to exit normally.
  7. PeterBelow

    TDBLookupComboBox without the field: DataSource

    Try to set the KeyValue property to the ID you want to look up.
  8. PeterBelow

    TService.Queue reliable?

    A Windows service should to all of its work in a secondary thread started in the OnStart event (and terminated in OnStop, perhaps also paused and resumed if possible in the corresponding events). The main thread should only process commands received from the service manager, which TService handles internally. That aside: from a look at the source TServiceApplication actually starts any services in a secondary thread and, after launching that, goes into a simple loop (actually it calls Vcl.TApplication.Run) which does the normal Idle processing, including the CheckSynchronize call that handles queued or synchronized tasks from background threads. So your construct will probably work, but I would not go this way in a service application. If the queued call blocks for some reason that would prevent the service app from terminating.
  9. PeterBelow

    Is there a way to Clear content of TDateTimePicker?

    The control has a ShowCheckbox property. This gives the user a checkbox to check or uncheck to indicate a NULL or NOT NULL state. The Checked property then tells you the user's descision. A bit cumbersome but the Windows common control behind TDatetimepicker has no concept of an "empty" state.
  10. A TList<T> has a constructor overload that takes a comparer (IComparer<T> instance) to use for sorting and searching the list by default. The Sort method also has such an overload. You use TComparer<T>.Construct() to fabricate a suitable comparer on the fly, providing an anonymous method that does the actual comparison of two items in the way you want the sort to go. This anonymous method has to "know" the record type in question, so you can directly refer to the fields of the two items passed to it. Forget about pointers, you do not need them to work with generics.
  11. PeterBelow

    [Resolved] Window State and position saver

    Set the DefaultMonitor property of the form to dmDesktop, this way the form left and top do not depend on the monitor the form is on and will restore the form to the monitor it was on before (unless the user rearranges his desktop configuration). For the necessary code see the PB.Winset unit in the attached archive. Winset.zip
  12. PeterBelow

    Using external chemistry libraries with Delphi

    Well, well, has been some years since somebody asked about chemistry here 8-)... As it happens I am a (retired) organic chemist and have worked for more than 30 years for a german (later french) pharma company in research. I wrote a lot of software working with chemical information, mostly from chemical databases. While the core of my library depended on MDL (later Accelrys) ISIS (long dead) and their Oracle chemistry package I tried during my last year at the company to get rid of the ISIS dependency by creating a Delphi wrapper for the Indigo library. Unfortunately I did not have enough time to complete and test the wrapper, and it is based on the 2017 32-bit Indigo DLLs, but perhaps you can find something of use in the mess. I also included some other units related to chemistry in the attached archive without ISIS dependencies. Have fun ;). chemistry.zip
  13. PeterBelow

    Recovery Problem

    If memory serves the IDE deletes these files when it closes normally. Check the first two items under "Autosave" as well. The first creates backups of open units in the _history folder.
  14. PeterBelow

    TButton: change font color

    Not if you use the standard Windows style. If you configure the app to use one of the custom styles (like Windows 10) you can set the StyleElements.seFont property element to false and it will then use the font.color you set and not the Windows default.
  15. PeterBelow

    Screenshot a Component

    If you only need to capture TWincontrol decendants you can do this with a few code lines using the TWincontrol.PaintTo or TWincontrol.PaintWindow methods, using a properly sized TBitmap as target.
×