netmaestro wrote:Well read it and then move on!
I thought I'd go the extra mile and try one more time. If that proves fruitless, which seems likely, that's what I'll do.
Hmmmm. Given the extra mile as you have, and without so much as a thanks, can't say I would blame you the least little bit. Sad oversight I on my part I openly admit. Frustrating to me too because so much of this is a monumental challenge to me. I am not a programmer. Can't figure out what a mesh is to save my life. Got to have a real programmer's brain to figure out more than half the stuff here in PureBasic alone, not to mention the API stuff. I get lost really easy in all that esoteric jargon. Clear
simple logic on the other hand is, to me, clear and uncontestable. Maybe we don't use the same dictionary regarding the term ''workaround''. I'll have to open a thread in 'other topics' to hash that out if you care and dare to be annoyed
For now I think I should do justice to the title of this thread and close out with a working sample and acknowledgement to those that helped to refine the final solution.
(final post from Rashad:
http://www.purebasic.fr/english/viewtop ... 00#p373544 )
Code: Select all
Global EventTyp.l, liveWin, lastLiveWin
#KB_Return = #PB_Shortcut_Return + 49152
Procedure KeyboardGyration()
Select EventType()
Case #PB_EventType_Focus
Debug "focus on window " + Str(liveWin)
If IsWindow(liveWin)
AddKeyboardShortcut(liveWin, #PB_Shortcut_Return, #KB_Return)
EndIf
lastLiveWin = liveWin
Case #PB_EventType_LostFocus
Debug "lost focus on window " + Str(lastLiveWin)
If IsWindow(lastLiveWin)
RemoveKeyboardShortcut(lastLiveWin, #PB_Shortcut_Return)
EndIf
EndSelect
EndProcedure
OpenWindow(0,0,0,640,480,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
TextGadget(#PB_Any, 10,20,100,16,"Enter Something:")
StringGadget(0, 110,20,300,20,"")
EditorGadget(1,10,50,400,400)
SetActiveGadget(0)
OpenWindow(2,0,0,640,480,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
TextGadget(#PB_Any, 10,20,100,16,"Enter Something:")
StringGadget(2, 110,20,300,20,"")
EditorGadget(3,10,50,400,400)
ButtonGadget(4,500,50,120,24,"Hide Window")
SetActiveGadget(2)
Repeat
EventID = WaitWindowEvent()
liveWin = GetActiveWindow()
Select EventID
Case #PB_Event_Gadget ;only one gadget list for all windows
EventTyp.l = EventType()
Select EventGadget()
Case 0, 2
KeyboardGyration()
Case 4
SetActiveGadget(2)
HideWindow(2,1)
EndSelect
Case #PB_Event_Menu
Select EventMenu()
Case #KB_Return
Select liveWin ;menu events can take place on different windows
Case 0
SetActiveGadget(1)
HideWindow(2,0)
Case 1
SetActiveGadget(3)
EndSelect
EndSelect
EndSelect
Until EventID = #PB_Event_CloseWindow
- - - and for their time, expertise, patients and generosity,
my thanks go out to:
netmaestro, Rashad, MachineCode, remi_meier, idle
- - - and others, for contributing their ideas and thoughts:
Tenaja, luis, IdeasVacuum, Foz
My humble thanks!
Er, uh, well... humble as its going to get
