EnableExplicit Global PBEx_WebGadget CompilerIf #PB_Compiler_Processor = #PB_Processor_x86 PBEx_WebGadget = OpenLibrary(#PB_Any, "PB.Ex_WebGadget_x86.dll") CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64 PBEx_WebGadget = OpenLibrary(#PB_Any, "PB.Ex_WebGadget_x64.dll") CompilerEndIf If PBEx_WebGadget Prototype WebGadgetEx(ID, X, Y, Width, Height, URL.p-Unicode, ParentWindowID, ErrorOutput) Global WebGadgetEx.WebGadgetEx = GetFunction(PBEx_WebGadget, "WebGadgetEx") Prototype SetWebGadgetExText(ID, URL.p-Unicode, ErrorOutput) Global SetWebGadgetExText.SetWebGadgetExText = GetFunction(PBEx_WebGadget, "SetWebGadgetExText") Prototype GetWebGadgetExText(ID, Output, ErrorOutput) Global GetWebGadgetExText.GetWebGadgetExText = GetFunction(PBEx_WebGadget, "GetWebGadgetExText") Prototype SetWebGadgetExState(ID, State, ErrorOutput) Global SetWebGadgetExState.SetWebGadgetExState = GetFunction(PBEx_WebGadget, "SetWebGadgetExState") Prototype SetWebGadgetExItemText(ID, Entry, Text.p-Unicode, ErrorOutput) Global SetWebGadgetExItemText.SetWebGadgetExItemText = GetFunction(PBEx_WebGadget, "SetWebGadgetExItemText") Prototype GetWebGadgetExItemText(ID, Entry, Output, ErrorOutput) Global GetWebGadgetExItemText.GetWebGadgetExItemText = GetFunction(PBEx_WebGadget, "GetWebGadgetExItemText") Prototype FreeWebGadgetEx(ID, ErrorOutput) Global FreeWebGadgetEx.FreeWebGadgetEx = GetFunction(PBEx_WebGadget, "FreeWebGadgetEx") Prototype IsWebGadgetEx(ID, ErrorOutput) Global IsWebGadgetEx.IsWebGadgetEx = GetFunction(PBEx_WebGadget, "IsWebGadgetEx") Prototype WebGadgetExWidth(ID, ErrorOutput) Global WebGadgetExWidth.WebGadgetExWidth = GetFunction(PBEx_WebGadget, "WebGadgetExWidth") Prototype WebGadgetExHeight(ID, ErrorOutput) Global WebGadgetExHeight.WebGadgetExHeight = GetFunction(PBEx_WebGadget, "WebGadgetExHeight") Prototype WebGadgetExX(ID, ErrorOutput) Global WebGadgetExX.WebGadgetExX = GetFunction(PBEx_WebGadget, "WebGadgetExX") Prototype WebGadgetExY(ID, ErrorOutput) Global WebGadgetExY.WebGadgetExY = GetFunction(PBEx_WebGadget, "WebGadgetExY") Prototype WebGadgetExID(ID, ErrorOutput) Global WebGadgetExID.WebGadgetExID = GetFunction(PBEx_WebGadget, "WebGadgetExID") Prototype HideWebGadgetEx(ID, State, ErrorOutput) Global HideWebGadgetEx.HideWebGadgetEx = GetFunction(PBEx_WebGadget, "HideWebGadgetEx") Prototype ResizeWebGadgetEx(ID, X, Y, Width, Height, ErrorOutput) Global ResizeWebGadgetEx.ResizeWebGadgetEx = GetFunction(PBEx_WebGadget, "ResizeWebGadgetEx") Prototype HideWebGadgetExDevTools(ID, State, ErrorOutput) Global HideWebGadgetExDevTools.HideWebGadgetExDevTools = GetFunction(PBEx_WebGadget, "HideWebGadgetExDevTools") Prototype ExecuteWebGadgetExJavaScript(ID, Code.p-Unicode, Output, ErrorOutput) Global ExecuteWebGadgetExJavaScript.ExecuteWebGadgetExJavaScript = GetFunction(PBEx_WebGadget, "ExecuteWebGadgetExJavaScript") Prototype BindWebGadgetExJavaScript(ID, PBProcedureName.p-Unicode, PBProcedureHandle, PID, ErrorOutput) Global BindWebGadgetExJavaScript.BindWebGadgetExJavaScript = GetFunction(PBEx_WebGadget, "BindWebGadgetExJavaScript") Prototype GetWebGadgetExAttribute(ID, Attribute, ErrorOutput) Global GetWebGadgetExAttribute.GetWebGadgetExAttribute = GetFunction(PBEx_WebGadget, "GetWebGadgetExAttribute") Prototype EnableRemoteDebugger(Port, ErrorOutput) Global EnableRemoteDebugger.EnableRemoteDebugger = GetFunction(PBEx_WebGadget, "EnableRemoteDebugger") EndIf Define Output$ = Space(1000000) Define ErrorOutput$ = "" Define IsDevTools = #True Procedure MyJSCallback(aaa) Debug "This procedure was executed from Javascript: " + PeekS(aaa) EndProcedure If OpenWindow(0, 0, 0, 1100, 768, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) WebGadgetEx(1, 0, 20, 1100, 748, "http://www.rsbasic.de", WindowID(0), @ErrorOutput$) ButtonGadget(2, 0, 0, 50, 20, "Back", 0) ButtonGadget(3, 50, 0, 50, 20, "Forward", 0) ButtonGadget(4, 100, 0, 50, 20, "Reload", 0) ButtonGadget(5, 150, 0, 50, 20, "Stop", 0) ButtonGadget(6, 200, 0, 50, 20, "Google", 0) ButtonGadget(7, 250, 0, 70, 20, "Own HTML", 0) ButtonGadget(8, 320, 0, 70, 20, "Get HTML", 0) ButtonGadget(10, 390, 0, 70, 20, "Get URL", 0) ButtonGadget(11, 460, 0, 100, 20, "Get size && position", 0) ButtonGadget(12, 560, 0, 50, 20, "Get ID", 0) ButtonGadget(13, 610, 0, 50, 20, "Hide", 0) ButtonGadget(14, 660, 0, 50, 20, "Show", 0) ButtonGadget(15, 710, 0, 50, 20, "Size", 0) ButtonGadget(16, 760, 0, 100, 20, "Show/Hide DevT.", 0) ButtonGadget(17, 860, 0, 70, 20, "Execute JS", 0) ButtonGadget(18, 930, 0, 50, 20, "BindProc", 0) ButtonGadget(19, 980, 0, 50, 20, "CallProc", 0) ButtonGadget(20, 1030, 0, 50, 20, "IsBusy?", 0) Repeat Select WaitWindowEvent() Case #PB_Event_Gadget Select EventGadget() Case 2 SetWebGadgetExState(1, #PB_Web_Back, @ErrorOutput$) Case 3 SetWebGadgetExState(1, #PB_Web_Forward, @ErrorOutput$) Case 4 SetWebGadgetExState(1, #PB_Web_Refresh, @ErrorOutput$) Case 5 SetWebGadgetExState(1, #PB_Web_Stop, @ErrorOutput$) Case 6 SetWebGadgetExText(1, "http://www.google.de", @ErrorOutput$) Case 7 SetWebGadgetExItemText(1, #PB_Web_HtmlCode, "