Frederick Posted December 24, 2019 Share Posted December 24, 2019 While inside either TUniDBEdit or TUniEdit, pressing the Insert key to toggle between the insert and overwrite state does not seem to have any effect for typing text. The state is always in Insert mode. How do I get UniGUI to toggle the insert/overwrite state when I press the Insert key and how to I check and display the Insert/Overwrite status? -- Frederick (UniGUI Complete - Professional Edition 1.90.0.1514) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 24, 2019 Share Posted December 24, 2019 1 hour ago, Frederick said: While inside either TUniDBEdit or TUniEdit, pressing the Insert key to toggle between the insert and overwrite state does not seem to have any effect for typing text. The state is always in Insert mode. 1 hour ago, Frederick said: overwrite state does not seem to have any effect for typing text This behavior, you yourself must implement in your project I guess. And it’s normal that it doesn’t work by default. Quote Link to comment Share on other sites More sharing options...
Frederick Posted December 24, 2019 Author Share Posted December 24, 2019 Can you show me how the behaviour can be implemented? I never thought that it would not work in UniGUI since it is just normal behaviour in a Delphi WIndows program. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 24, 2019 Share Posted December 24, 2019 16 minutes ago, Frederick said: Can you show me how the behaviour can be implemented? I never thought that it would not work in UniGUI since it is just normal behaviour in a Delphi WIndows program. Does it work on Delphi VCL? Quote Link to comment Share on other sites More sharing options...
Frederick Posted December 24, 2019 Author Share Posted December 24, 2019 25 minutes ago, Sherzod said: Does it work on Delphi VCL? I tried it in Delphi 10.3.2 VCL and interestingly, it does not work.However, I don't use this Delphi version for Windows programs. When I tried it in Delphi 7, it just works natively without having me to implement any code. It could be because of one of my third-party libraries. Anyway, I found the following code to use in Delphi 10 and it works perfectly in the Windows program. procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if (Key = VK_INSERT) and (Shift = []) then InsertOn := not InsertOn; end; procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if ((TEdit(Sender).SelLength = 0) and (not InsertOn)) then TEdit(Sender).SelLength := 1; end; In UniGUI, the OnKeyDown code is compilable. However, Delphi chokes on the OnKeyPress code because it says that SelLength is not a member of TUniDBEdit. What code can I create to simulate the SelLength property? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.