WebGadget No TAB works

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

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...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

I will take a look


Fred - AlphaSND
Aeroschmelz
User
User
Posts: 25
Joined: Mon Apr 12, 2004 9:14 am

Post by Aeroschmelz »

The problem still exists, right ? Is there a solution for tab+enter+etc to use like in Internet Explorer
PolyVector
Enthusiast
Enthusiast
Posts: 499
Joined: Wed Sep 17, 2003 9:17 pm
Location: Southern California
Contact:

Post by PolyVector »

I've tried just about everything I can think of... can't get it to work either :(
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Jose
User
User
Posts: 34
Joined: Sat Apr 26, 2003 9:20 pm

Post by Jose »

@Sparkie
Thanks for the pointer, do know how to do what the doc says in PB?

Would be cool to solve this problem and post it in tricks :lol:
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Sorry Jose, but converting the doc to PB code is over my head. I did make some progress, but not enough to post any results. Surely one of our resident PB experts can figure this one out ;)

Until then, I will keep trying :)
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Sometimes it's better to be lucky than good. :wink:

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
Hopefully, someone who's more versed in this area can clean this up for us.
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
PolyVector
Enthusiast
Enthusiast
Posts: 499
Joined: Wed Sep 17, 2003 9:17 pm
Location: Southern California
Contact:

Post by PolyVector »

NICE :)
been tryin' to solve this for a long time :)
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

If the wc is created via ATL.. a simple extra forwardmessages (sendmessage()) is required in the messagepump.
PolyVector
Enthusiast
Enthusiast
Posts: 499
Joined: Wed Sep 17, 2003 9:17 pm
Location: Southern California
Contact:

Post by PolyVector »

@Edwin
I've tried passing the messages along in the messagepump with no success... do you have a working example of this?
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

Unf. this is part of my visual designer:
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..

User avatar
thyphoon
Enthusiast
Enthusiast
Posts: 345
Joined: Sat Dec 25, 2004 2:37 pm

Post by thyphoon »

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

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
Post Reply