forked from gphilippot/purebasic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AboutWindow.pb
145 lines (119 loc) · 5.38 KB
/
AboutWindow.pb
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
;--------------------------------------------------------------------------------------------
; Copyright (c) Fantaisie Software. All rights reserved.
; Dual licensed under the GPL and Fantaisie Software licenses.
; See LICENSE and LICENSE-FANTAISIE in the project root for license information.
;--------------------------------------------------------------------------------------------
Procedure OpenAboutWindow()
If IsWindow(#WINDOW_About) = 0
AboutWindowDialog = OpenDialog(?Dialog_About, WindowID(#WINDOW_Main), @AboutWindowPosition)
If AboutWindowDialog
EnsureWindowOnDesktop(#WINDOW_About)
; Image
If IsImage(#IMAGE_PureBasiclogo) = 0
CatchPackedImage(#IMAGE_PureBasiclogo, ?General_Images, 1)
ResizeImage(#IMAGE_PureBasiclogo, DesktopScaledX(ImageWidth(#IMAGE_PureBasiclogo)), DesktopScaledY(ImageHeight(#IMAGE_PureBasiclogo)))
EndIf
SetGadgetState(#GADGET_About_Image, ImageID(#IMAGE_PureBasiclogo))
CompilerIf #SpiderBasic
ProductQuote$ = "..- a Basic to master the Web -.."
CompilerElse
FormerDevelopers$ = "Former Team Members :" + #NewLine +
"Richard Andersson" + #NewLine +
"Benny 'Berikco' Sels" + #NewLine +
"Danilo Krahn" + #NewLine + #NewLine
ProductQuote$ = "Feel the ..Pure.. Power"
CompilerEndIf
; Text
Text$ = DefaultCompiler\VersionString$ + #NewLine +
ProductQuote$ + #NewLine +
#NewLine +
"Team Members :" + #NewLine +
"Frederic 'AlphaSND' Laboureur" + #NewLine +
"Andre Beer" + #NewLine +
"Timo 'fr34k' Harter" + #NewLine +
#NewLine +
FormerDevelopers$ +
#ProductName$ + ", all the provided tools and components" + #NewLine +
"are copyright © 1998-2020 Fantaisie Software" + #NewLine +
#NewLine +
#ProductWebSite$ + #NewLine +
#NewLine +
"Special thanks to all " + #ProductName$ + " users and beta-testers !" + #NewLine +
#NewLine +
"Thanks to Gary Willoughby (Kale) for designing the original" + #NewLine +
"Toolbar icons for this IDE." + #NewLine +
#NewLine +
"Thanks to Mark James for the 'silk icon set'." + #NewLine +
"http://www.famfamfam.com/lab/icons/silk/" + #NewLine +
#NewLine +
"Thanks to Neil Hodgson for the scintilla" + #NewLine +
"editing component." + #NewLine +
#NewLine +
"Scintilla © 1998-2020 Neil Hodgson <[email protected]> " + #NewLine +
#NewLine +
"Thanks to Wimer Hazenberg for Monokai color palette." + #NewLine +
"http://www.monokai.nl/"
; For better debugging
;
Text$ + #NewLine + #NewLine
Text$ + "IDE build on " + FormatDate("%mm/%dd/%yyyy [%hh:%ii]", #PB_Compiler_Date) + " by " + #BUILDINFO_User + #NewLine
Text$ + "Branch: " + #BUILDINFO_Branch + " Revision: " + #BUILDINFO_Revision + #NewLine
CompilerIf #CompileWindows
; Let's have a cool centered text box on Windows
; must be before the SetGadgetText!
;
Format.PARAFORMAT\cbSize = SizeOf(PARAFORMAT)
Format\dwMask = #PFM_ALIGNMENT
Format\wAlignment = #PFA_CENTER
SendMessage_(GadgetID(#GADGET_About_Editor), #EM_SETPARAFORMAT, 0, Format)
CompilerEndIf
CompilerIf #CompileMacCocoa
PB_Gadget_CenterEditorGadget(GadgetID(#GADGET_About_Editor))
CompilerEndIf
SetGadgetText(#GADGET_About_Editor, Text$)
CompilerIf #CompileLinuxGtk2
; center for gtk2
gtk_text_view_set_justification_(GadgetID(#GADGET_About_Editor), #GTK_JUSTIFY_CENTER)
gtk_text_view_set_wrap_mode_(GadgetID(#GADGET_About_Editor), #GTK_WRAP_WORD) ; set autowrap, as the version line is a bit long
CompilerEndIf
CompilerIf #CompileMacCocoa
PB_Gadget_CenterEditorGadget(GadgetID(#GADGET_About_Editor))
CompilerEndIf
AboutWindowDialog\GuiUpdate() ; needed because of the image change since creation
HideWindow(#WINDOW_About, #False)
; fix required for the centereing of non-resizable windows in the dialog manager
; (works only if window is visible)
CompilerIf #CompileLinuxGtk2
If AboutWindowPosition\x = -1 And AboutWindowPosition\y = -1
While WindowEvent(): Wend
gtk_window_set_position_(WindowID(#WINDOW_About), #GTK_WIN_POS_CENTER)
EndIf
CompilerEndIf
EndIf
Else
SetWindowforeground(#WINDOW_About)
EndIf
EndProcedure
Procedure AboutWindowEvents(EventID)
If EventID = #PB_Event_Menu ; Little wrapper to map the shortcut events (identified as menu)
EventID = #PB_Event_Gadget ; to normal gadget events...
GadgetID = EventMenu()
Else
GadgetID = EventGadget()
EndIf
Select EventID
Case #PB_Event_CloseWindow
Quit = 1
Case #PB_Event_Gadget
If GadgetID = #GADGET_About_Ok
Quit = 1
EndIf
EndSelect
If Quit
If MemorizeWindow
AboutWindowDialog\Close(@AboutWindowPosition)
Else
AboutWindowDialog\Close()
EndIf
EndIf
EndProcedure