Code: Alles auswählen
EnableExplicit
Procedure AnkerGadget(windowid, id_name.s, x, y)
! var AnkerGadget = document.createElement('a');
! AnkerGadget.name = v_id_name;
! AnkerGadget.className = "SB_AnkerGadget";
! AnkerGadget.style.cssText = "position: absolute; left: " + v_x + "px; top: " + v_y + "px; width: 0px; height: 0px;";
! v_windowid.content.appendChild(AnkerGadget);
EndProcedure
Procedure OpenWindowEx(window, y, x, innerwidth, innerheight, Title.s, Flags, ParentID)
Protected ReturnValue
ReturnValue = OpenWindow(window, y, x, innerwidth, innerheight, Title, Flags, ParentID)
If Flags & #PB_Window_Background
! spider_WindowID(v_window).contentFrame.style.overflow = "auto";
If innerwidth > 0
! spider_WindowID(v_window).content.style.width = v_innerwidth + "px";
EndIf
If innerheight > 0
! spider_WindowID(v_window).content.style.height = v_innerheight + "px";
EndIf
EndIf
ProcedureReturn ReturnValue
EndProcedure
Macro OpenWindow(Window, y, x, InnerWidth, InnerHeight, Title, Flags = 0, ParentID = 0)
OpenWindowEx(Window, y, x, InnerWidth, InnerHeight, Title, Flags, ParentID)
EndMacro
Procedure RedirectSite(url.s)
! window.location.href = v_url;
EndProcedure
;================================================== Beispielcode ==================================================
Procedure GadgetEvent()
Select EventGadget()
Case 1
RedirectSite("#MyAnker")
EndSelect
EndProcedure
If OpenWindow(0, 0, 0, 0, 3000, "Window", #PB_Window_Background)
HyperLinkGadget(1, 10, 10, 100, 20, "Jump to anker", RGB(0, 0, 255), #PB_HyperLink_Underline)
AnkerGadget(WindowID(0), "MyAnker", 0, 2000)
TextGadget(2, 10, 2000, 200, 20, "Hello, good, you're here now. :-)", 0)
BindEvent(#PB_Event_Gadget, @GadgetEvent())
EndIf