Jump to content

Uwe Raabe

Members
  • Content Count

    2881
  • Joined

  • Last visited

  • Days Won

    169

Everything posted by Uwe Raabe

  1. Uwe Raabe

    TControlList and colors/selection

    You can avoid that by setting MarkDisabledItem to False.
  2. Uwe Raabe

    TControlList and colors/selection

    Add an event handler for OnEnableItem and set AEnabled := False;
  3. Uwe Raabe

    FireDAC encrypted SQLite DB with Delphi 12.3 x64

    If you can reproduce with a small sample database I suggest to file a bug report at https://qp.embarcadero.com/
  4. Uwe Raabe

    FireDAC encrypted SQLite DB with Delphi 12.3 x64

    According to the unit mentioned, the libraries named sqlite3_fde_x64.obj/sqlite3_fde_x86.obj are used. They come with Delphi and are located in subfolders of $(BDSLIB).
  5. Uwe Raabe

    TForm to TForm communication

    First, declare the message type in a common unit: type TIntegerMessage = class(TMessage<Integer>); Second, declare a TMessageListenerMethod in FormA handling that message type: type TFormA = class(TForm) ... private procedure MyMessageHandler(const Sender: TObject; const M: TMessage); ... procedure TFormA.MyMessageHandler(const Sender: TObject; const M: TMessage); begin var msg := M as TIntegerMessage; // do something with the Integer you get from msg.Value end; Third, subscribe/unsubscribe to this message type in TFormA.FormCreate/FormDestroy: procedure TFormA.FormCreate(Sender: TObject); begin TMessageManager.DefaultManager.SubscribeToMessage(TIntegerMessage, MyMessageHandler); end; procedure TFormA.FormDestroy(Sender: TObject); begin TMessageManager.DefaultManager.Unsubscribe(TIntegerMessage, MyMessageHandler); end; Finally, send the message in FormB: begin ... TMessageManager.DefaultManager.SendMessage(Self, TIntegerMessage.Create(42)); ... end; Note: Only the common unit with the type declaration has to be used by both form units. None of them needs to use the other form unit.
  6. Uwe Raabe

    access violation changing font

    It seems to be reproducible reliably in the debugger, while without the debugger I can switch the size with or without errors and I was not able to identify a pattern, yet.
  7. Uwe Raabe

    Custom Time format in TDBGrid

    That would only help if you are using a Delphi version that supports it (i.e. Delphi 11.2 or higher). See https://docwiki.embarcadero.com/RADStudio/Alexandria/en/11_Alexandria_-_Release_2#Updated_FireDAC_Drivers
  8. Uwe Raabe

    Problem with Calculated fields in a TFDQuerry

    The value of calculated fields are only stored for the current record. As soon as you move to another one, the field content is lost. Therefore you need to calculate the field value several times, which can slow down performance when the calculation needs some time. A solution is to cache these values.
  9. Uwe Raabe

    Problem with Calculated fields in a TFDQuerry

    Calculating fields is done on each record at several occasions. Any change to the current record, be it by navigating or switch to and from edit mode. AfterOpen is dataset based and when it is called, at least the first record is already loaded and all fields contain their values, including the calculated ones.
  10. Uwe Raabe

    Problem with Calculated fields in a TFDQuerry

    I would use a caching approach. In OnCalcFields try finding the ID in the dictionary like you already do. If not found, get the file size as you currently do in OnAfterOpen and add it to the dictionary.
  11. It survives the change from Integer to an enumeration type.
  12. Not sure if this helps: Breakpoints are stored in the DSK file. Depending on whether you opened a project group or a standalone project (with that temporary project group created on the fly) this is the DSK file of the project group or the project.
  13. Uwe Raabe

    TButtonedEdit RightButton - OnMouseDown/OnMouseUp

    The TGlyph type being private and Glyph property being protected makes everything a bit cumbersome. Fortunately there is a trick to inject a message handler without subclassing. type TEditButtonHelper = class helper for TEditButton public procedure LinkMessageHandler; end; TGlyphMessageHandler = class(TWinControlMessageHandler) protected function HandleMessage(var Message: TMessage): Boolean; override; end; function TGlyphMessageHandler.HandleMessage(var Message: TMessage): Boolean; begin var edt := TButtonedEdit(Control.Parent); case Message.Msg of WM_LBUTTONDOWN: edt.PasswordChar := #0; WM_LBUTTONUP: edt.PasswordChar := '*'; end; Result := inherited; end; procedure TEditButtonHelper.LinkMessageHandler; begin Glyph.InitMessageHandler(TGlyphMessageHandler); end; procedure TForm1.FormCreate(Sender: TObject); begin ButtonedEdit1.RightButton.LinkMessageHandler; end;
  14. Uwe Raabe

    TButtonedEdit RightButton - OnMouseDown/OnMouseUp

    The buttons of a TButtonedEdit are no controls, so there simply is no handle. Instead they provide an instance FGlyph of a private type TGlyph derived from TCustomControl, which handles the mouse events. This control has the edit control as parent. Perhaps you can achieve your goal by deriving from TButtonControl and override GetEditButtonClass. This gives you access to the protected FGlyph and allows to replace it with a derived class implementing the requested behavior.
  15. Uwe Raabe

    Debugger keeps the execution line centered

    I am not aware of any setting. There is a setting in MMX that acts during navigation, but it doesn't show the behavior you see. So, after making the issue go away, the key question is: Can you reproduce?
  16. Uwe Raabe

    Is TImage empty

    If Image1.Picture.Graphic is not of type TBitmap, referencing Image1.Picture.Bitmap will clear the current content and create an empty TBitmap.
  17. Uwe Raabe

    ToolBar just knoledg

    I doubt that is correct. The datamodule dmSharedImages containing the image lists is part of GExpert and as long as GExpert is loaded in the IDE the datamodule exists and the references are resolved. The problem happens during runtime only. BTW, 3rd party plugin developers should be aware of this and name their forms, frames and datamodules with in mind.
  18. Uwe Raabe

    KSVC 8.0

    Probably, yes.
  19. Wrong thread? What does [ref] attribute actually dows
  20. While the inconsistency is obvious, there might be different opinions about which behavior is correct. One can argue that the local variable case is older and thus takes precedence. That would also take care of existing code staying compatible. Throwing an error on both cases would emphasize the type safety, but may cause some user complaints.
  21. The problem is inconsistency, as it compiles when f is declared as a local variable. Also see the example in the comment of Jost Riedel in the mentioned QP issue. procedure X(i: Integer); begin end; procedure Y1; var f: TFunc<Integer>; begin X(f); // compiles end; procedure Y2; begin var f: TFunc<Integer>; X(f); // fails end;
  22. That is even mentioned in the docs (https://docwiki.embarcadero.com/RADStudio/Athens/en/Variant_Types_(Delphi)#Variants_in_Expressions)
  23. Uwe Raabe

    my.embarcadero.com down?

    Indeed, it does...
  24. Uwe Raabe

    Custom Time format in TDBGrid

    I tried with Delphi 12.3 using SQL Server 2019. The Hour field is definitely time(7) - I used the CREATE TABLE command given by you.
  25. Uwe Raabe

    KSVC 8.0

    GetIt only installs in the current IDE. Not in any other registry node nor in the 64-bit one. Nevertheless, the packages exist and you can simply add them via Components - Install packages.
×