It is currently Tue Mar 02, 2021 2:57 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: [Done] 5.73b3 TAB key in editor gadget with new msftedit.dll
PostPosted: Fri Nov 06, 2020 10:49 am 
Offline
Enthusiast
Enthusiast

Joined: Wed May 28, 2003 6:57 am
Posts: 196
Location: Munich
The TAB key can no longer be used to jump to the next TAB stop in the editor gadget.
With Ctrl+TAB this works. (To test see snippet viewtopic.php?f=4&t=76204 )

Are there any hidden settings?
Can it be fixed, or has this changed for good (then I'll have to take care of it)

_________________
Horst.


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.73b3 TAB key in editor gadget with new msftedit.dll
PostPosted: Sun Nov 08, 2020 10:01 am 
Offline
Addict
Addict

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3972
Location: Berlin, Germany
I've created another small code snippet for testing. It contains two button gadgets in addition to the editor gadget:
Code:
#WinWidth  = 400
#WinHeight = 300
#BtnY = #WinHeight-50

Define.i edit, ok, cancel, event

If OpenWindow(0, 100, 100, #WinWidth, #WinHeight, "Editor Gadget Test") = 0
   MessageRequester("Fatal error",
                    ~"Can't open main window.\nProgram terminated.")
   End
EndIf

edit   = EditorGadget(#PB_Any, 10, 10, #WinWidth-20, #WinHeight-80)
ok     = ButtonGadget(#PB_Any, 220, #BtnY, 60, 30, "OK")
cancel = ButtonGadget(#PB_Any, 310, #BtnY, 80, 30, "Cancel")
SetActiveGadget(ok)

Repeat
   event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow

I did all tests on Windows 10.
Initially, the keyboard focus is on the OK button (although not visible here). After pressing the TAB key twice, the focus is in the editor gadget.
When I then press the TAB key again, different things happen, depending on the used PB version:
  • With PB 5.72 LTS, tab characters are inserted in the editor gadget. It's not possible to set the focus to another gadget by pressing the TAB key.
    You can find code here on the forum, that works around this issue, e.g. by using PB's AddKeyboardShortcut() or a Windows callback.
  • With PB 5.73 beta 3, the focus changes to the OK button. In other words, we now can always use the TAB key for setting the focus to another gadget, regardless on which gadget the focus currently is. (This is at least true for this small example -- I didn't test all PureBasic gadgets.) As you wrote, tab characters can still be inserted in the editor gadget by pressing [Ctrl]+[Tab].

Personally, I prefer the new behaviour, and I can imagine that the change might have been done deliberately (for the reason I mentioned).

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.73b3 TAB key in editor gadget with new msftedit.dll
PostPosted: Sun Nov 08, 2020 2:21 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed May 28, 2003 6:57 am
Posts: 196
Location: Munich
Little John wrote:
Personally, I prefer the new behaviour, and I can imagine that the change might have been done deliberately (for the reason I mentioned).

I agree (though I'll have to modify my programs).

@Fred:
If there are no objections from your side, this thread can be stamped [done]

_________________
Horst.


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.73b3 TAB key in editor gadget with new msftedit.dll
PostPosted: Sun Nov 08, 2020 7:57 pm 
Offline
Addict
Addict

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3972
Location: Berlin, Germany
horst wrote:
(though I'll have to modify my programs)

For this reason, IMHO this change should be documented clearly in the help.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.73b3 TAB key in editor gadget with new msftedit.dll
PostPosted: Mon Nov 09, 2020 11:08 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14181
Location: France
I don't know which is better. Having tab working in an EditorGadget() looks correct to me. I will take a look to how re-enable this.


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.73b3 TAB key in editor gadget with new msftedit.dll
PostPosted: Mon Nov 09, 2020 11:31 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14181
Location: France
Fixed.


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.73b3 TAB key in editor gadget with new msftedit.dll
PostPosted: Tue Nov 10, 2020 2:32 am 
Offline
Addict
Addict

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3972
Location: Berlin, Germany
Fred wrote:
Having tab working in an EditorGadget() looks correct to me. I will take a look to how re-enable this.

If the keyboard focus is in the EditorGadget, how can the user than change the focus to another gadget with the keybord?

Users should be able to move between controls using the TAB key and SHIFT+TAB.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] 5.73b3 TAB key in editor gadget with new msftedit
PostPosted: Tue Nov 10, 2020 5:06 am 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1875
Is this something that could be made optional by a gadget flag? #PB_Editor_TabFocus or something

_________________
On GitHub: PB Includes - IDE Tools - Color Themes - IDE Branches - TabBarGadget Mods


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] 5.73b3 TAB key in editor gadget with new msftedit
PostPosted: Tue Nov 10, 2020 9:14 am 
Offline
Enthusiast
Enthusiast

Joined: Wed May 28, 2003 6:57 am
Posts: 196
Location: Munich
With PB 5.73b3 I can catch the TAB key (including the editor gadget) by AddKeyboardShortcut(),
which was not possible on previous versions, where I had to use a #GWL_WNDPROC construct.

A mode toggle as suggested by kenmo would be all right, but in any case I would appreciate the support for AddKeyboardShortcut().

_________________
Horst.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye