It is currently Sat Jan 23, 2021 1:50 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Bug RemoveKeyboardShortcut(0, #PB_Shortcut_Tab)
PostPosted: Tue Jan 28, 2020 12:38 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2817
Location: Germany
Remove shortcut 'TAB' destroy Z-Order tab key from Window.

OS: Windows and Linux
Code:
AddKeyboardShortcut(0, #PB_Shortcut_Tab, #MenuItem_TabKey)
RemoveKeyboardShortcut(0, #PB_Shortcut_Tab)


Solution for Windows
Code:
;-TOP

#MenuItem_TabKey = 1001

Global TabOn = #True

Procedure DoEventTabKey()
  Protected hWnd, gadget
  If TabOn
    gadget = GetActiveGadget()
    If gadget >= 0
      hWnd = GetNextDlgTabItem_(WindowID(GetActiveWindow()), GadgetID(gadget), 0)
      If hWnd
        SetFocus_(hWnd)
      EndIf
    EndIf
  EndIf
EndProcedure

If OpenWindow(0, 0, 0, 110, 80, "ABC", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
  CreateMenu(0, WindowID(0))
  ButtonGadget(0, 5, 5, 100, 20, "Tab-Shortcut")
  StringGadget(1, 5, 30, 100, 20, "AA")
  StringGadget(2, 5, 55, 100, 20, "BB")
 
  BindMenuEvent(0, #MenuItem_TabKey, @DoEventTabKey())
  AddKeyboardShortcut(0, #PB_Shortcut_Tab, #MenuItem_TabKey)
 
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_CloseWindow
        Break
      Case #PB_Event_Gadget
        Select EventGadget()
          Case 0
            If TabOn
              TabOn = #False
              Debug "Tab Off"
            Else
              TabOn = #True
              Debug "Tab On"
            EndIf
        EndSelect
    EndSelect
  ForEver
EndIf

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 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