https://www.purebasic.com/french/docume ... er.pb.html
replace YouTube Video Links with your own
Code: Select all
;-< Top >
;-
;- PureBasic_MiniBrowser_2003_example_modified_2017_v1.pb
;-
;- Original Link : https://www.purebasic.com/french/documentation/Examples/WebBrowser.pb.html
;-
;- Link : http://www.purebasic.fr/english/viewtopic.php?p=93126#p93126
;- Post Subject/Date : PostPosted: Wed Jun 15, 2005 11:59 am modified by Dare2 year 2005
;- Compiler : PB 5.31 ( July 22 2017 )
;-
;-< Start Program >------------------------------------------------------------
;
;
; ------------------------------------------------------------
;
; PureBasic - MiniBrowser
;
; (c) 2003 - Fantaisie Software
;
; ------------------------------------------------------------
;
; This program requiers the Microsoft freely distribuable
; ATL.dll shared library.
;
Define.i Cnt
Procedure ResizeWebWindow()
ResizeGadget(10, #PB_Ignore, #PB_Ignore, WindowWidth(0), WindowHeight(0)-52)
ResizeGadget(4, #PB_Ignore, #PB_Ignore, WindowWidth(0)-185, #PB_Ignore)
ResizeGadget(5, WindowWidth(0)-25, #PB_Ignore, #PB_Ignore, #PB_Ignore)
ResizeGadget(6, #PB_Ignore, #PB_Ignore, WindowWidth(0), #PB_Ignore)
EndProcedure
If OpenWindow(0, 100, 200, 940, 705, "PureBasic MiniBrowser v1.0 Click [Next] Button = view next Video [Back] Button = view previous Video", #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
CreateStatusBar(0, WindowID(0))
AddStatusBarField(#PB_Ignore)
StatusBarText(0, 0, "Welcome to the world's smallest Browser ! :)", 0)
ButtonGadget(1, 0, 0, 50, 25, "Back")
ButtonGadget(2, 50, 0, 50, 25, "Next")
ButtonGadget(3, 100, 0, 50, 25, "Quit")
StringGadget(4, 155, 5, 0, 20, "https://www.purebasic.com/french/documentation/Examples/WebBrowser.pb.html" )
ButtonGadget(5, 0, 0, 25, 25, "Go")
FrameGadget(6, 0, 30, 0, 2, "", 2) ; Nice little separator
;- Note : need to Parse https://www.youtube.com/watch?v=CD1CYMPNSis to only this -> https://www.youtube.com/v/CD1CYMPNSis
If WebGadget(10, 0, 31, 0, 0, "https://www.youtube.com/v/CD1CYMPNSis") = 0 : MessageRequester("Error", "ATL.dll not found", 0) : End : EndIf
AddKeyboardShortcut(0, #PB_Shortcut_Return, 0)
ResizeWebWindow()
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case 1 : SetGadgetState(10, #PB_Web_Back)
Case 2 : SetGadgetState(10, #PB_Web_Forward)
Select Cnt ;------ put your own YouTube Video Links here
Case 0 : Cnt = Cnt + 1 : SetGadgetText(10, "https://www.youtube.com/v/1Qcexr6CZ5Y")
Case 1 : Cnt = Cnt + 1 : SetGadgetText(10, "https://www.youtube.com/v/V1wWKOAdS38")
Case 2 : Cnt = Cnt + 1 : SetGadgetText(10, "https://www.youtube.com/v/wTG-bCMG05E")
Case 3 : Cnt = Cnt + 1 : SetGadgetText(10, "https://www.youtube.com/v/qoX0Olfqziw")
Case 4 : Cnt = Cnt + 1 : SetGadgetText(10, "https://www.youtube.com/v/tZugz8FTqog")
Case 5 : Cnt = Cnt + 1 : SetGadgetText(10, "https://www.youtube.com/v/euMNVyuqmwo")
Case 6 : Cnt = 0 : SetGadgetText(10, "https://www.youtube.com/v/CD1CYMPNSis")
EndSelect
Case 3 : SetGadgetState(10, #PB_Web_Stop) : End
Case 5 : SetGadgetText(10, GetGadgetText(4))
EndSelect
Case #PB_Event_Menu ; We only have one shortcut
SetGadgetText(10, GetGadgetText(4))
Case #PB_Event_SizeWindow : ResizeWebWindow()
Case #PB_Event_CloseWindow:SetGadgetState(10, #PB_Web_Stop) : CloseWindow(0) : End
EndSelect
ForEver
EndIf
;-
;-< End Program >--------------------------------------------------------------