TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *AntonyD »

I could not find that, where would that be?
Uhhh, looks like Delhi/Lazarus - is not so suitable for programming like VC++/MFC it was(((
No, this functions directly belongs to MFC/Visual C++ coding style, but I was hoping that the
chosen Object Pascal will have something similar on board... But looks like it's not. Sorry.

Something like that did you try?

Code: Select all

procedure <anObject>.KeyPress(Sender: TObject; var Key: Char);
begin
  if Key = ^A then
    begin
      // Select all mode is ON
      (Sender as TEdit).SelectAll;
      // or PostMessage(<EditObjectName>.Handle, EM_SETSEL, 0, -1);
      Key := #0;
    end;
end;
PS> btw - what kind of "the bad behaviour' did you see?
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *ghisler(Author) »

Yes, I tried this in various places, also tried to catch it via subclassing.
PS> btw - what kind of "the bad behaviour' did you see?
When auto-append is on, start typing a path in the edit box until there are some suggestions.
Now press cursor down to choose one of the suggestions.
When I now press Ctrl+A once, the text gets selected shortly, but then the cursor appears behind the path.
When I press Ctrl+A again, the text gets removed.

My guess is that Microsoft's auto-complete subclasses the control somehow and intercepts all keypresses. It sees Ctrl+A as a normal text input, which it tries to append first, and the second time replace the text. But since there is no character generated by Ctrl+A, it replaces the path by empty text.
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *AntonyD »

I must be crazy again, BUT! with turned off option "AutoAppend suggested names" at the global settings - all editboxes, which we touched in our topic here - are pretty well working with some autosuggestion somehow built-in! When I type like "C:\Prog" inside it - then after that I have immediately open listbox with suggestions! Thus I should say - that I don't understand now - about for which GUI elements inside the TC we should worry about and add for them "AutoAppend names" ability???
And CTRL+A is perfectly working inside those elements in these conditions!
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *AntonyD »

Here I must confess again that I do not understand - for which elements and on which form/dialog this option should work when it was forced to turn it on? In all places where I would like to see auto-path/name substitution - it works everywhere and WITHOUT enabling this option. Maybe it was introduced to target support for some older version of the OS?
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *ghisler(Author) »

There is a difference between auto-suggest (which opens a dropdown list of suggestions) and auto-append, which directly appends the first suggestion so you just need to press Cursor right or Tab to accept the suggestion. It seems that this second option messes with the handling of Ctrl+A, because it somehow interprets it as a character...
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *AntonyD »

ghisler(Author) wrote: 2022-05-05, 16:34 UTC There is a difference between auto-suggest (which opens a dropdown list of suggestions) and auto-append, ....
In both cases I see the drop-down list. The only diff is indeed - it's that the proposal item with enabled option "AutoAppend suggested names" is automatically fit into the edit box after the cursor.
BUT! W/o this option I only have to press the ArrowDown Key as much as I need it in order to get acceptable result from the list of suggestions. And yes - we can get some economy of some seconds, but for which price?
So I personally see NO VALUABLE difference for using this option in comparison with prebuilt-in mechanism of auto-suggestions. Thus I personally absolutely do not understand even in which circumstances the process of applying the support for "AutoAppend suggested names" has been started:(
What could have prompted the development of this option?

But Of course all is IMHO, and all will be as you wish:)
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *AntonyD »

ghisler(Author) wrote: 2022-05-05, 16:34 UTC .....It seems that this second option messes with the handling of Ctrl+A, because it somehow interprets it as a character...
But is not you said that you already tried to use some examples of my code suggestions?
And in one of them I used the Delphi principal that CTRL+A combination can be caught as ONE key|one char pressed:
if Key = ^A then
Thus yes - you must break such interpretation manually;) as example I've used:
Key := #0;
As far as I know any COMPLEX key-pressing is translated to a single character message at the end of internal message processing.
And of course this will work only if we did not forget <form>.KeyPreview to set to True.
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *ghisler(Author) »

The problem is that Ctrl+A isn't handled even when I subclass the window, it seems to be handled somewhere internally by Windows.
I can intercept it via Application.onMessage in Delphi, which seems to intercept the MessageLoop, but there is no such thing in Lazarus.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *ghisler(Author) »

I found a solution now by directly changing the Lazarus win32callback.inc file to handle Ctrl+A there.
Author of Total Commander
https://www.ghisler.com
User avatar
funkymonk
Senior Member
Senior Member
Posts: 410
Joined: 2013-12-04, 09:56 UTC

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *funkymonk »

That sounds great!
User avatar
funkymonk
Senior Member
Senior Member
Posts: 410
Joined: 2013-12-04, 09:56 UTC

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *funkymonk »

Confirmed fixed in 10.50b5 (32bit, dark/white mode)

Ctrl+A selects all text,
Ctrl+Z undoes 1 step,
Ctrl+Left/Right/Backspace still work properly.

Thank you.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *ghisler(Author) »

It's still quite a hack in the 64-bit version: While I can intercept Ctrl+A, just selecting everything doesn't help - I have to set a timer with a 10 millisecond delay which re-adds the string and selects it. Just posting a message to the window is not enough, the auto-append function still manages to clear the edit box...
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *ghisler(Author) »

Moderator message

Moved to fixed bugs
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *Usher »

It's NOT fixed. It's broken in 32-bit TC 10.50 starting from beta5. You cannot type Polish letter ąĄ with AltGr+A, because Ctrl+Alt+A works now as Ctrl+A (select all). Tested in TC 32-bit in Windows XP and Windows 7. TC 64-bit in Windows 7 works OK.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
petermad
Power Member
Power Member
Posts: 14742
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: TC10.00/10.50b1+2: Buggy textbox shortcut behavior in button bar config dialog

Post by *petermad »

You cannot type Polish letter ąĄ with AltGr+A, because Ctrl+Alt+A works now as Ctrl+A (select all). Tested in TC 32-bit in Windows XP and Windows 7. TC 64-bit in Windows 7 works OK.
Confirmed. - Even when Auto append is turned off.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply