-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathFantasie_Software_Basic_WebBrowser.pb
More file actions
91 lines (63 loc) · 2.36 KB
/
Fantasie_Software_Basic_WebBrowser.pb
File metadata and controls
91 lines (63 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
;
; ------------------------------------------------------------
;
; PureBasic - MiniBrowser
;
; (c) Fantaisie Software
;
; ------------------------------------------------------------
;
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, 500, 300, "PureBasic MiniBrowser v1.0", #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget)
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, "Stop")
StringGadget(4, 155, 5, 0, 20, "http://www.purebasic.com")
ButtonGadget(5, 0, 0, 25, 25, "Go")
FrameGadget(6, 0, 30, 0, 2, "", 2) ; Nice little separator
If WebGadget(10, 0, 31, 0, 0, "http://www.purebasic.com") = 0
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
MessageRequester("Error", "ATL.dll not found", 0)
CompilerElse ; Linux and OX uses Webkit
MessageRequester("Error", "Webkit library not found", 0)
CompilerEndIf
End ; Quit
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)
Case 3
SetGadgetState(10, #PB_Web_Stop)
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()
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
; IDE Options = PureBasic 5.31 (Windows - x64)
; CursorPosition = 83
; FirstLine = 49
; Folding = -
; EnableUnicode
; EnableXP
; Executable = ..\Fantasie Software Basic Web Browser.exe