WebGadget No TAB works
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Jose.
Hi, When using the WebGadget to display a web page that has input fields the TAB and SHIFT TAB keys do not apply inside the web page, any one know how I can fix this problem.
Here is some sample code;
nW.l=470 : nH.l=232
nX.l=(GetSystemMetrics_(#SM_CXSCREEN)-nW)/2
nY.l=(GetSystemMetrics_(#SM_CYSCREEN)-nH)/2
If OpenWindow(0,nX,nY,nW,nH,#PB_Window_MinimizeGadget, "test")
If CreateGadgetList(WindowID())
WebGadget(0, 1, 1, nW-1, nH-1, "C:\test.html")
EndIf
EndIf
bQuit.l = #FALSE
Repeat
If WaitWindowEvent() = #PB_EventCloseWindow
bQuit = #TRUE
EndIf
Until bQuit
here is the test HTML page
Name
Address
To see the problem, run this code, click in one field then press TAB key and see what happens, in W2K nothing happens.
Thanks
Jose
Registered PureBasic User
Hi, When using the WebGadget to display a web page that has input fields the TAB and SHIFT TAB keys do not apply inside the web page, any one know how I can fix this problem.
Here is some sample code;
nW.l=470 : nH.l=232
nX.l=(GetSystemMetrics_(#SM_CXSCREEN)-nW)/2
nY.l=(GetSystemMetrics_(#SM_CYSCREEN)-nH)/2
If OpenWindow(0,nX,nY,nW,nH,#PB_Window_MinimizeGadget, "test")
If CreateGadgetList(WindowID())
WebGadget(0, 1, 1, nW-1, nH-1, "C:\test.html")
EndIf
EndIf
bQuit.l = #FALSE
Repeat
If WaitWindowEvent() = #PB_EventCloseWindow
bQuit = #TRUE
EndIf
Until bQuit
here is the test HTML page
Name
Address
To see the problem, run this code, click in one field then press TAB key and see what happens, in W2K nothing happens.
Thanks
Jose
Registered PureBasic User
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by ricardo.
Hi,
Yes, you are right.
I run your html code, first in IE and the tabs where working ok, then run the webgadget and dosent receive tabs.
I dont know why Fred decide to ignore a lot of webgadget stuff. The object that he is using has a lot more functionality that is absolutely neccesary if somebody is planning to develop a serious application using the webgadget, i hope that i next versin this will change.
Best Regards
Ricardo
Dont cry for me Argentina...
Hi,
Yes, you are right.
I run your html code, first in IE and the tabs where working ok, then run the webgadget and dosent receive tabs.
I dont know why Fred decide to ignore a lot of webgadget stuff. The object that he is using has a lot more functionality that is absolutely neccesary if somebody is planning to develop a serious application using the webgadget, i hope that i next versin this will change.
Best Regards
Ricardo
Dont cry for me Argentina...
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by pusztry.
@Ricardo
I agree Fred REALY needs to add to the web gadget. I can't realy do anything with it exception view basic pages. I realy wanted to develope with the web gadget but is just isn't functional enough.
That is just my $.02
- Ryan
RJP Computing
WinXP, PIII 800 MHz, 512MB RAM, SB Live 5.1, NVidia TNT 2 Ultra
@Ricardo
I agree Fred REALY needs to add to the web gadget. I can't realy do anything with it exception view basic pages. I realy wanted to develope with the web gadget but is just isn't functional enough.
That is just my $.02
- Ryan
RJP Computing
WinXP, PIII 800 MHz, 512MB RAM, SB Live 5.1, NVidia TNT 2 Ultra
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- User
- Posts: 25
- Joined: Mon Apr 12, 2004 9:14 am
-
- Enthusiast
- Posts: 499
- Joined: Wed Sep 17, 2003 9:17 pm
- Location: Southern California
- Contact:
Sometimes it's better to be lucky than good.
After many hours of unsuccessful attempts to trap the TAB (and DELETE) keys in a WebGadget, I think I stumbled upon success. 8O
**** Edited to fix bug and to update to PB 4.xx
Hopefully, someone who's more versed in this area can clean this up for us.

After many hours of unsuccessful attempts to trap the TAB (and DELETE) keys in a WebGadget, I think I stumbled upon success. 8O
**** Edited to fix bug and to update to PB 4.xx
Code: Select all
If OpenWindow(0, 0, 0, 700, 500, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_TitleBar) And CreateGadgetList(WindowID(0))
hWeb = WebGadget(1, 10, 10, 680, 480, "http://www.google.com/")
WebObject.IWebBrowser2 = GetWindowLong_(GadgetID(1), #GWL_USERDATA)
CoInitialize_(0)
CoCreateInstance_(?CLSID_IOleInPlaceActiveObject, 0, 1, ?IID_IOleInPlaceActiveObject,@OleObject.IOleInPlaceActiveObject)
Repeat
event = WaitWindowEvent()
If EventGadget() = 1 And event = #WM_KEYDOWN
If EventwParam() = #VK_TAB Or EventwParam() = #VK_DELETE
WebObject\QueryInterface(?IID_IOleInPlaceActiveObject, @OleObject)
web.MSG\message = event
;... I know EventwParam() and EventwLaram()are no longer
;... supported in Purebasic, but for now it works
web\wParam = EventwParam()
web\lParam = EventlParam()
OleObject\TranslateAccelerator(@web)
OleObject\Release()
EndIf
EndIf
Until event = #PB_Event_CloseWindow
CoUninitialize_()
EndIf
End
DataSection
;{00000117-0000-0000-C000-000000000046}
IID_IOleInPlaceActiveObject:
Data.l $00000117
Data.w $0000, $0000
Data.b $C0, $00, $00, $00, $00, $00, $00, $46
;{00000320-0000-0000-C000-000000000046}
CLSID_IOleInPlaceActiveObject:
Data.l $00000320
Data.w $0000, $0000
Data.b $C0, $00, $00, $00, $00, $00, $00, $46
EndDataSection
Last edited by Sparkie on Wed Nov 28, 2007 1:55 pm, edited 1 time in total.
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
-
- Enthusiast
- Posts: 499
- Joined: Wed Sep 17, 2003 9:17 pm
- Location: Southern California
- Contact:
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
-
- Enthusiast
- Posts: 499
- Joined: Wed Sep 17, 2003 9:17 pm
- Location: Southern California
- Contact:
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
Unf. this is part of my visual designer:
You'll get the idea though, FOR ATL ONLY!
You'll get the idea though, FOR ATL ONLY!
Code: Select all
While GetMessage( Msg, 0, 0, 0 )
hWndFocus = 0
nNot = 0
#If %Def( %MOD_VD_ATL )
Select Case Msg.message
Case %WM_KEYFIRST, %WM_KEYLAST, %WM_MOUSEFIRST, %WM_MOUSELAST
hWndFocus = GetFocus()
Do While hWndFocus
If LCase$( VD_GetClassName( hWndFocus, 0 ) ) <> "atlaxwin" Then
hWndFocus = GetParent( hWndFocus )
Iterate
End If
'%WM_FORWARDMSG
nNot = SendMessage( hWndFocus, &H37F, 0, ByVal VarPtr( Msg ) )
Exit Do
Loop
End Select
#EndIf
If nNot Then Iterate
''''''''''''''''''' etc..
I have a little problem with Sparkie's code.The TAB works fine but when i use the delete key in a form 2 characters are deleted not juste one !
What can i do to resolve this problem ?
Thanks, and excuse me for my bad english !
Code PB4.10
What can i do to resolve this problem ?
Thanks, and excuse me for my bad english !
Code PB4.10
Code: Select all
myurl$ = "http://www.google.com/advanced_group_search?hl=en"
If OpenWindow(0, 0, 0, 700, 500,"Web Accelerator Keys", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_TitleBar)
If CreateGadgetList(WindowID(0))
hWeb = WebGadget(0, 10, 10, 680, 480, myurl$)
WebObject.IWebBrowser2 = GetWindowLong_(GadgetID(0), #GWL_USERDATA)
EndIf
EndIf
CoInitialize_(0)
If CoCreateInstance_(?CLSID_IOleInPlaceActiveObject,0,1,?IID_IOleInPlaceActiveObject,@OleObject.IOleInPlaceActiveObject) = 0
EndIf
CoUninitialize_()
web.MSG
Repeat
Event = WaitWindowEvent()
If Event = #WM_KEYDOWN
WebObject\QueryInterface(?IID_IOleInPlaceActiveObject, @OleObject)
web\message = Event
web\wParam = EventwParam()
web\lParam = EventlParam()
OleObject\TranslateAccelerator(@web)
OleObject\Release()
EndIf
Until Event = #PB_Event_CloseWindow
End
DataSection
;{00000117-0000-0000-C000-000000000046}
IID_IOleInPlaceActiveObject:
Data.l $00000117
Data.w $0000, $0000
Data.b $C0, $00, $00, $00, $00, $00, $00, $46
;{00000320-0000-0000-C000-000000000046}
CLSID_IOleInPlaceActiveObject:
Data.l $00000320
Data.w $0000, $0000
Data.b $C0, $00, $00, $00, $00, $00, $00, $46
EndDataSection