Welcome, Guest
Username: Password: Remember me
CodeTyphon MS Windows (Win7, Win8.x, Win10 and Win11) OS Development, discussions and problems
  • Page:
  • 1

TOPIC:

AutoComplete and Taskbar issues 2 weeks 4 hours ago #18792

  • Premysl Beran
  • Premysl Beran's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 55
  • Thank you received: 0
Hello,
Lately, I have wanted to add autocomplete functionality to my application editor form, and I figured out some strange behaviour of the forms and the taskbar buttons. I prepared a simple testing project that replicated it.

Here is the description. I have a main form that is open when the application is launched. When clicked on the button, a new form with the editor opens.

If I set the property ShowInTaskBar := stDefault on both forms. In this situation, when you activate the autocomplete function on the editor (Ctrl+Space) all works fine as expected. However, I would like to have the editor in the taskbar as a separate button. So, my default setting is the following.

Property ShowInTaskBar := stDefault for the main form, and for the editor form, I set it to stAlways (in the test project, you can just click the checkbox and open a new editor form). In this case, when I activate the autocomplete function, the editor form loses focus, and the main form is in the foreground with the autocomplete selection on it. The editor form is not visible if the main form is maximised. When the autocompletion is selected, the editor form gets focused again and is moved to the foreground. This is very annoying.

I tried to set  ShowInTaskBar := stAlways to both forms (also the main form). In this case, the editor form doesn't lose focus when the autocomplete function gets activated, but when the application is launched (only the main form is visible), there are two buttons in the taskbar. One with the name of the form and one with the name of the project. 

Please, can you check if you have the same behaviours or if I am doing something wrong? Thanks in advance.

Note: When compiled on Linux and macOS, all works fine. The editor doesn't lose focus when the autocomplete function is activated. 

System: Windows 10
CT: version 8.50

 

Please Log in or Create an account to join the conversation.

AutoComplete and Taskbar issues 1 week 6 days ago #18794

  • Matis A.
  • Matis A.'s Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 1160
  • Thank you received: 177
My suggestion is to set EditorForm.FormStyle to fsStayOnTop
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Matis A..

AutoComplete and Taskbar issues 1 week 6 days ago #18795

  • Premysl Beran
  • Premysl Beran's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 55
  • Thank you received: 0
Hi Matis,

Thanks for the suggestion. I tried this programmatically. I set StayOnTop before the autocomplete execution, and when it ended, I put it back to fsNormal. When putting it back to fsNormal the form blinked (it lost focus and got it right back). Very annoying. 

But I don't want the editor StayOnTop all the time. The medium working solution to set ShowInTaskbar := stAlways also for the main form. But there is this strange additional button in the taskbar (see picture below).


 
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by Premysl Beran. Reason: Wrongly added picture

AutoComplete and Taskbar issues 6 days 7 minutes ago #18801

  • Premysl Beran
  • Premysl Beran's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 55
  • Thank you received: 0
I figured out an acceptable solution. 

In the project file (*.ppr) before
Application.Run
I placed
Application.TaskBarBehavior := tbMultiButton;
 

With this, the editor form doesn't lose focus during the autocomplete. I can have the editor form visible in the taskbar (editor form ShowInTaskbar := stAlways). The application has only one button in the taskbar when launched (main form ShowInTaskbar := stDefault). A small side effect is that when the autocomplete is initiated, there is an additional button in the taskbar with the name "Complete". But only during the apparition of the autocomplete list.

Please Log in or Create an account to join the conversation.

Last edit: by Premysl Beran.

AutoComplete and Taskbar issues 5 days 22 hours ago #18802

  • Matis A.
  • Matis A.'s Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 1160
  • Thank you received: 177
Thanks Sir
I never think this solution.
Your programing ocean it's very deep  
 
Have fun... 
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

  • Page:
  • 1