1 | /*:VRX Main
|
---|
2 | */
|
---|
3 | /* Main
|
---|
4 | */
|
---|
5 | Main:
|
---|
6 | /* Process the arguments.
|
---|
7 | Get the parent window.
|
---|
8 | */
|
---|
9 | parse source . calledAs .
|
---|
10 | parent = ""
|
---|
11 | argCount = arg()
|
---|
12 | argOff = 0
|
---|
13 | if( calledAs \= "COMMAND" )then do
|
---|
14 | if argCount >= 1 then do
|
---|
15 | parent = arg(1)
|
---|
16 | argCount = argCount - 1
|
---|
17 | argOff = 1
|
---|
18 | end
|
---|
19 | end; else do
|
---|
20 | call VROptions 'ImplicitNames'
|
---|
21 | call VROptions 'NoEchoQuit'
|
---|
22 | end
|
---|
23 | InitArgs.0 = argCount
|
---|
24 | if( argCount > 0 )then do i = 1 to argCount
|
---|
25 | InitArgs.i = arg( i + argOff )
|
---|
26 | end
|
---|
27 | drop calledAs argCount argOff
|
---|
28 |
|
---|
29 | /* Load the windows
|
---|
30 | */
|
---|
31 | call VRInit
|
---|
32 | parse source . . spec
|
---|
33 | _VREPrimaryWindowPath = ,
|
---|
34 | VRParseFileName( spec, "dpn" ) || ".VRW"
|
---|
35 | _VREPrimaryWindow = ,
|
---|
36 | VRLoad( parent, _VREPrimaryWindowPath )
|
---|
37 | drop parent spec
|
---|
38 | if( _VREPrimaryWindow == "" )then do
|
---|
39 | call VRMessage "", "Cannot load window:" VRError(), ,
|
---|
40 | "Error!"
|
---|
41 | _VREReturnValue = 32000
|
---|
42 | signal _VRELeaveMain
|
---|
43 | end
|
---|
44 |
|
---|
45 | /* Process events
|
---|
46 | */
|
---|
47 | call Init
|
---|
48 | signal on halt
|
---|
49 | do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
|
---|
50 | _VREEvent = VREvent()
|
---|
51 | interpret _VREEvent
|
---|
52 | end
|
---|
53 | _VREHalt:
|
---|
54 | _VREReturnValue = Fini()
|
---|
55 | call VRDestroy _VREPrimaryWindow
|
---|
56 | _VRELeaveMain:
|
---|
57 | call VRFini
|
---|
58 | exit _VREReturnValue
|
---|
59 |
|
---|
60 | VRLoadSecondary:
|
---|
61 | __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 )
|
---|
62 | if __vrlsWait then do
|
---|
63 | call VRFlush
|
---|
64 | end
|
---|
65 | __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) )
|
---|
66 | if __vrlsHWnd = '' then signal __vrlsDone
|
---|
67 | if __vrlsWait \= 1 then signal __vrlsDone
|
---|
68 | call VRSet __vrlsHWnd, 'WindowMode', 'Modal'
|
---|
69 | __vrlsTmp = __vrlsWindows.0
|
---|
70 | if( DataType(__vrlsTmp) \= 'NUM' ) then do
|
---|
71 | __vrlsTmp = 1
|
---|
72 | end
|
---|
73 | else do
|
---|
74 | __vrlsTmp = __vrlsTmp + 1
|
---|
75 | end
|
---|
76 | __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd )
|
---|
77 | __vrlsWindows.0 = __vrlsTmp
|
---|
78 | do while( VRIsValidObject( VRWindow() ) = 1 )
|
---|
79 | __vrlsEvent = VREvent()
|
---|
80 | interpret __vrlsEvent
|
---|
81 | end
|
---|
82 | __vrlsTmp = __vrlsWindows.0
|
---|
83 | __vrlsWindows.0 = __vrlsTmp - 1
|
---|
84 | call VRWindow __vrlsWindows.__vrlsTmp
|
---|
85 | __vrlsHWnd = ''
|
---|
86 | __vrlsDone:
|
---|
87 | return __vrlsHWnd
|
---|
88 |
|
---|
89 | /*:VRX __VXREXX____APPENDS__
|
---|
90 | */
|
---|
91 | __VXREXX____APPENDS__:
|
---|
92 | /*
|
---|
93 | */
|
---|
94 | return
|
---|
95 | /*:VRX _ContainerInit
|
---|
96 | */
|
---|
97 | _ContainerInit:
|
---|
98 | say 'Start _ContainerInit()'
|
---|
99 |
|
---|
100 | StatusFH = VRMethod( "CN_Apps", "AddField", "Icon", "Status" )
|
---|
101 | AppFH = VRMethod( "CN_Apps", "AddField", "String", "Application" )
|
---|
102 |
|
---|
103 | ok = VRSet("CN_Apps", "Detailsort", AppFH)
|
---|
104 |
|
---|
105 | ok = VRMethod("CN_Apps","SetFocus")
|
---|
106 |
|
---|
107 | OriginalFH = VRMethod( "CN_Fontmap", "AddField", "String", "Font" )
|
---|
108 | MappedToFH = VRMethod( "CN_Fontmap", "AddField", "String", "Mapped to" )
|
---|
109 | /* ok = VRSet("CN_Fontmap","LastSplitfield", MappedToFH) */
|
---|
110 | IgnoreFH = VRMethod( "CN_Fontmap", "AddField", "Icon", "Ignore" )
|
---|
111 | ok = VRMethod("CN_Fontmap","SetFieldAttr",IgnoreFH,"width", 500)
|
---|
112 | ok = VRSet("CN_Fontmap", "Detailsort", AppFH)
|
---|
113 |
|
---|
114 | say 'Done _ContainerInit()'
|
---|
115 |
|
---|
116 | return
|
---|
117 |
|
---|
118 | /*:VRX _DisableFontengineOptions
|
---|
119 | */
|
---|
120 | _DisableFontengineOptions:
|
---|
121 | ok = VRSet("CB_ITFE_Enabled", "Enabled", 0)
|
---|
122 | ok = VRSet("CB_ITFE_Logging", "Enabled", 0)
|
---|
123 | ok = VRSet("CB_ITFE_Antialiasing", "Enabled", 0)
|
---|
124 | ok = VRSet("CB_ITFE_HintingMode", "Enabled", 0)
|
---|
125 | ok = VRSet("SPIN_SubpixelMode", "Enabled", 0)
|
---|
126 | ok = VRSet("DT_SubpixelMode", "Enabled", 0)
|
---|
127 | ok = VRSet("SPIN_FaceSizeThreshold", "Enabled", 0)
|
---|
128 | ok = VRSet("DT_FaceSizeThreshold", "Enabled", 0)
|
---|
129 | FontengineChanged = 0
|
---|
130 | return
|
---|
131 |
|
---|
132 | /*:VRX _DisableFreetypeOptions
|
---|
133 | */
|
---|
134 | _DisableFreetypeOptions:
|
---|
135 | ok = VRset("RB_IBM_TrueType","set",1)
|
---|
136 | ok = VRset("DT_OpenFaces","Enabled",0)
|
---|
137 | ok = VRSet("EF_OpenFaces","Enabled",0)
|
---|
138 | ok = VRSet("CB_Use_Fake_Bold","Enabled", 0)
|
---|
139 | ok = VRSet("CB_Use_Netscape_Fix","Enabled", 0)
|
---|
140 | ok = VRSet("CB_Add_Uni_Encode","Enabled", 0)
|
---|
141 | ok = VRSet("CB_Use_Facename_Alias","Enabled", 0)
|
---|
142 | ok = VRSet("PB_Save","Enabled", 0)
|
---|
143 | ok = VRSet("EF_OpenFaces","BackColor","PaleGray")
|
---|
144 | TrueTypeChanged = 0
|
---|
145 | return
|
---|
146 |
|
---|
147 | /*:VRX _EnableFontengineOptions
|
---|
148 | */
|
---|
149 | _EnableFontengineOptions:
|
---|
150 | ok = VRSet("CB_ITFE_Enabled", "Enabled", 1)
|
---|
151 | ok = VRSet("CB_ITFE_Logging", "Enabled", 1)
|
---|
152 | ok = VRSet("CB_ITFE_Antialiasing", "Enabled", 1)
|
---|
153 | ok = VRSet("CB_ITFE_HintingMode", "Enabled", 1)
|
---|
154 | ok = VRSet("SPIN_SubpixelMode", "Enabled", 1)
|
---|
155 | ok = VRSet("DT_SubpixelMode", "Enabled", 1)
|
---|
156 | ok = VRSet("SPIN_FaceSizeThreshold", "Enabled", 1)
|
---|
157 | ok = VRSet("DT_FaceSizeThreshold", "Enabled", 1)
|
---|
158 | FontengineChanged = 0
|
---|
159 | return
|
---|
160 |
|
---|
161 | /*:VRX _EnableFreeTypeOptions
|
---|
162 | */
|
---|
163 | _EnableFreeTypeOptions:
|
---|
164 | ok = VRset("RB_FreeType","set",1)
|
---|
165 | ok = VRset("DT_OpenFaces","Enabled",1)
|
---|
166 | ok = VRset("EF_OpenFaces","Enabled",1)
|
---|
167 | ok = VRSet("EF_OpenFaces","BackColor","White")
|
---|
168 | ok = VRSet("CB_Use_Fake_Bold","Enabled", 1)
|
---|
169 | ok = VRSet("CB_Use_Netscape_Fix","Enabled", 1)
|
---|
170 | ok = VRSet("CB_Add_Uni_Encode","Enabled", 1)
|
---|
171 | ok = VRSet("CB_Use_Facename_Alias","Enabled", 1)
|
---|
172 | return
|
---|
173 |
|
---|
174 | /*:VRX _GUIInit
|
---|
175 | */
|
---|
176 | _GUIInit:
|
---|
177 | say 'Start _GUIInit()'
|
---|
178 |
|
---|
179 | if datatype(Top) = 'NUM' then do
|
---|
180 | ok = VRset("Main","Top",Top)
|
---|
181 | ok = VRset("Main","Left",Left)
|
---|
182 | ok = VRset("Main","Width",Width)
|
---|
183 | ok = VRset("Main","Height",Height)
|
---|
184 | end
|
---|
185 | ok = VRSet("Main","Font", Font_Main)
|
---|
186 | ok = VRSet("Main","Statusfont", Font_Status)
|
---|
187 | ok = VRSet("Page_1","Font", Font_Page_1)
|
---|
188 | ok = VRSet("Page_2","Font", Font_Page_2)
|
---|
189 | ok = VRSet("Page_3","Font", Font_Page_3)
|
---|
190 | ok = VRSet("Page_4","Font", Font_Page_4)
|
---|
191 | ok = VRSet("Page_5","Font", Font_Page_5)
|
---|
192 | Buttonwidth = VRMethod( "Screen", "PixelsToTwips", 32 )
|
---|
193 | ok = VRSet("IPB_Add", "width",Buttonwidth)
|
---|
194 | ok = VRSet("IPB_Add", "Height",Buttonwidth)
|
---|
195 | ok = VRSet("IPB_Remove", "width",Buttonwidth)
|
---|
196 | ok = VRSet("IPB_Remove", "Height",Buttonwidth)
|
---|
197 | ok = VRSet("IPB_new", "width",Buttonwidth)
|
---|
198 | ok = VRSet("IPB_new", "Height",Buttonwidth)
|
---|
199 | ok = VRSet("IPB_Test", "width",Buttonwidth)
|
---|
200 | ok = VRSet("IPB_Test", "Height",Buttonwidth)
|
---|
201 |
|
---|
202 | ok = VRSet("IPB_AddMapping", "width",Buttonwidth)
|
---|
203 | ok = VRSet("IPB_AddMapping", "Height",Buttonwidth)
|
---|
204 | ok = VRSet("IPB_newMapping", "width",Buttonwidth)
|
---|
205 | ok = VRSet("IPB_newMapping", "Height",Buttonwidth)
|
---|
206 | ok = VRSet("IPB_RemoveMapping", "width",Buttonwidth)
|
---|
207 | ok = VRSet("IPB_RemoveMapping", "Height",Buttonwidth)
|
---|
208 |
|
---|
209 |
|
---|
210 | ok = VRSet("CB_ITFE_Installed", "Set", FontengineDetected)
|
---|
211 | ok = VRSet("TAB_3","Enabled", FontengineDetected)
|
---|
212 | ok = VRSet("TAB_4","Enabled", FontengineDetected)
|
---|
213 |
|
---|
214 | if FreeTypeDetected then do
|
---|
215 | ok = VRMethod("RB_FreeType","setfocus")
|
---|
216 | call _EnableFreeTypeOptions
|
---|
217 | call _QueryFreeTypeOptions
|
---|
218 | end
|
---|
219 | else do
|
---|
220 | ok = VRSet("RB_IBM_TrueType","Caption", "IBM TrueType Version "TrueTypeVer)
|
---|
221 | ok = VRMethod("RB_IBM_TrueType","setfocus")
|
---|
222 | call _DisableFreeTypeOptions
|
---|
223 | end
|
---|
224 |
|
---|
225 | if FontengineDetected then do
|
---|
226 | ok = VRset("CB_ITFE_Installed","Caption","InnoTek Font Engine Version "FT2Ver" installed")
|
---|
227 | call _EnableFontengineOptions
|
---|
228 | call _QueryInnotekFontengineOptions
|
---|
229 | end
|
---|
230 | else do
|
---|
231 | call _DisableFontengineOptions
|
---|
232 | end
|
---|
233 |
|
---|
234 | ok = VRset("PB_DefaultFont","Caption", CurDefaultFont)
|
---|
235 | ok = VRset("PB_DefaultFont","Font", CurDefaultFont)
|
---|
236 |
|
---|
237 | ok = VRseT("PB_Undo","Enabled",0)
|
---|
238 | ok = VRseT("PB_Save","Enabled",0)
|
---|
239 | TrueTypeChanged = 0
|
---|
240 | FontengineChanged = 0
|
---|
241 | ok = VRSet("Main", "Visible", 1)
|
---|
242 | say 'Done _GUIInit()'
|
---|
243 | return
|
---|
244 |
|
---|
245 | /*:VRX _INIread
|
---|
246 | */
|
---|
247 | _INIread:
|
---|
248 | say 'Start _INIRead()'
|
---|
249 | OurINI = strip(VRParseFileName(VRget("Application","Program"),'DP')'\FT2GUI2.INI',,'\')
|
---|
250 | ok = SysFileTree(OurINI, INIFound.,'FO')
|
---|
251 | if INIFound.0 = 1 then OurINI = VRParseFileName(INIFound.1,'DPNE')
|
---|
252 | say 'OurINI='OurINI
|
---|
253 | HelpFIle = VRParseFileName(OurINI,'DPN')'.HLP'
|
---|
254 | say 'HelpFile='HelpFile
|
---|
255 |
|
---|
256 | Top = VRGetIni( "Pos", "Top", OurINI , 'NoClose')
|
---|
257 | Left = VRGetIni( "Pos", "Left", OurINI , 'NoClose')
|
---|
258 | Width = VRGetIni( "Pos", "Width", OurINI , 'NoClose')
|
---|
259 | Height= VRGetIni( "Pos", "Height", OurINI , 'NoClose')
|
---|
260 |
|
---|
261 | Font_Page_1 = VRGetIni( "Fonts", "Page_1", OurINI , 'NoClose' )
|
---|
262 | Font_Page_2 = VRGetIni( "Fonts", "Page_2", OurINI , 'NoClose' )
|
---|
263 | Font_Page_3 = VRGetIni( "Fonts", "Page_3", OurINI , 'NoClose' )
|
---|
264 | Font_Page_4 = VRGetIni( "Fonts", "Page_5", OurINI , 'NoClose' )
|
---|
265 | Font_Page_5 = VRGetIni( "Fonts", "Page_4", OurINI , 'NoClose' )
|
---|
266 | Font_Main = VRGetIni( "Fonts", "Main", OurINI , 'NoClose' )
|
---|
267 | Font_Status = VRGetIni( "Fonts", "Statusfont", OurINI , 'NoClose' )
|
---|
268 |
|
---|
269 | /* Font_CN = VRGetIni( "Fonts", "CN_WPIFiles", OurINI , 'NoClose' )
|
---|
270 | Font_MLE = VRGetIni( "Fonts", "MLE_Script", OurINI , 'NoClose' )
|
---|
271 | say 'Font_MLE='Font_MLE
|
---|
272 | if Font_MLE = '' |Font_MLE = '<default>' then Font_MLE = '6. System VIO' */
|
---|
273 |
|
---|
274 | TrueTypeChanged = 0
|
---|
275 | FontengineChanged = 0
|
---|
276 | MiscOptionsFontChanged = 0
|
---|
277 | ReBootRequired = 0
|
---|
278 | InitDone = 0
|
---|
279 | say 'Done _INIRead()'
|
---|
280 | return
|
---|
281 |
|
---|
282 | /*:VRX _INIWrite
|
---|
283 | */
|
---|
284 | _INIWrite:
|
---|
285 | ok = VRSetIni( "Pos", "Top", VRGet("Main","Top"), OurINI, 'NoClose' )
|
---|
286 | ok = VRSetIni( "Pos", "Left", VRGet("Main","Left"), OurINI, 'NoClose' )
|
---|
287 | ok = VRSetIni( "Pos", "Width", VRGet("Main","Width"), OurINI, 'NoClose' )
|
---|
288 | ok = VRSetIni( "Pos", "Height", VRGet("Main","Height"), OurINI, 'NoClose' )
|
---|
289 | ok = VRSetIni( "Fonts", "Page_1", VRGet("Page_1","Font"), OurINI, 'NoClose' )
|
---|
290 | ok = VRSetIni( "Fonts", "Page_2", VRGet("Page_2","Font"), OurINI, 'NoClose' )
|
---|
291 | if VRget("CN_Apps", "Font") <> "<default>" then ok = VRset("Page_3", "Font", VRget("CN_Apps", "Font"))
|
---|
292 | ok = VRSetIni( "Fonts", "Page_3", VRGet("Page_3","Font"), OurINI, 'NoClose' )
|
---|
293 | ok = VRSetIni( "Fonts", "Page_5", VRGet("Page_5","Font"), OurINI, 'NoClose' )
|
---|
294 | ok = VRSetIni( "Fonts", "Page_4", VRGet("Page_4","Font"), OurINI, 'NoClose' )
|
---|
295 | ok = VRSetIni( "Fonts", "Statusfont", VRGet("Main","Statusfont"), OurINI, 'NoClose' )
|
---|
296 | ok = VRSetIni( "Fonts", "Main", VRGet("Main","Font"), OurINI )
|
---|
297 | return
|
---|
298 |
|
---|
299 | /*:VRX _LoadOtherFuncs
|
---|
300 | */
|
---|
301 | _LoadOtherFuncs:
|
---|
302 | /* pblo = '2'
|
---|
303 | ftx = '1'
|
---|
304 | itf = '0' */
|
---|
305 | ok = VRRedirectStdIO('OFF')
|
---|
306 |
|
---|
307 | call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
|
---|
308 | call SysLoadFuncs
|
---|
309 |
|
---|
310 | CALL RXFUNCADD 'spLoadFuncs','spUtils','spLoadFuncs'
|
---|
311 | CALL spLoadFuncs
|
---|
312 | /*
|
---|
313 | sprut = pblo||ftx||itf
|
---|
314 |
|
---|
315 | if date('days') > Sprut then do
|
---|
316 | Buttons.1 = "OK"
|
---|
317 | Buttons.0 = 1
|
---|
318 | id = VRMessage( VRWindow(), "Sorry, this version is timebombed! KABOOM! Bye, bye!", "Font rendering applet", "ERROR", "Buttons.", buttons.1, buttons.1 )
|
---|
319 | call Quit
|
---|
320 | end */
|
---|
321 | return
|
---|
322 |
|
---|
323 | /*:VRX _MsgYesNo
|
---|
324 | */
|
---|
325 | _MsgYesNo:
|
---|
326 | buttons.0 = 2
|
---|
327 | buttons.1 = "~Yes"
|
---|
328 | buttons.2 = "~No"
|
---|
329 | default = 2
|
---|
330 | buttons.default = "~No"
|
---|
331 | esc = 2
|
---|
332 | buttons.esc = "~No"
|
---|
333 | RC = VRMessage( VRWindow(), Msg.Text, Msg.Title,"Q","buttons.",default, esc )
|
---|
334 | say 'Antwort: 'RC
|
---|
335 | return RC
|
---|
336 |
|
---|
337 | /*:VRX _QueryCurrentTrueTypeDriver
|
---|
338 | */
|
---|
339 | _QueryCurrentTrueTypeDriver:
|
---|
340 | TrueTypeChanged = 0
|
---|
341 | app = "PM_Font_Drivers"
|
---|
342 | key = "TRUETYPE"
|
---|
343 |
|
---|
344 | val = SysIni('USER', app, key)
|
---|
345 |
|
---|
346 | if val = "ERROR:" then val = "none"
|
---|
347 | /* strip the terminating NULL character */
|
---|
348 | else val = substr(val, 1, pos(d2c(0), val) - 1)
|
---|
349 |
|
---|
350 | if pos('TRUETYPE',translate(val)) > 1 then do
|
---|
351 | FreeTypeDetected = 0
|
---|
352 | TrueType = SysBootDrive()'\OS2\DLL\TRUETYPE.DLL'
|
---|
353 | TempFile = 'TRUETYPE.TMP'
|
---|
354 | 'bldlevel 'TrueType'>'TempFile
|
---|
355 | Zeile = ''
|
---|
356 | do until lines(TempFile) = 0
|
---|
357 | Zeile = translate(linein(TempFile))
|
---|
358 | if pos('VERSION:',Zeile) > 0 then leave
|
---|
359 | end
|
---|
360 | ok = stream(TempFile,'c','close')
|
---|
361 | ok = SysFileDelete(TempFile)
|
---|
362 | say Zeile
|
---|
363 | parse var Zeile stuff ':'TrueTypeVer
|
---|
364 | TrueTypeVer = strip(TrueTypeVer)
|
---|
365 | say 'Version='TrueTypeVer
|
---|
366 | end
|
---|
367 | if pos('FREETYPE',translate(val)) > 1 then FreeTypeDetected = 1
|
---|
368 | return
|
---|
369 |
|
---|
370 | /*:VRX _QueryFreeTypeOptions
|
---|
371 | */
|
---|
372 | _QueryFreeTypeOptions:
|
---|
373 | app = "FreeType/2"
|
---|
374 | key = "OpenFaces"
|
---|
375 | val = SysIni('USER', app, key)
|
---|
376 | if val = "ERROR:" | val = "" then val = "not set"
|
---|
377 | /* strip the terminating NULL character */
|
---|
378 | else val = substr(val, 1, pos(d2c(0), val) - 1)
|
---|
379 | ok = VRSet("EF_OpenFaces","Value",val)
|
---|
380 |
|
---|
381 | key = "Use_Fake_Bold"
|
---|
382 | val = SysIni('USER', app, key)
|
---|
383 | if val = "ERROR:" then val = 0
|
---|
384 | /* strip the terminating NULL character */
|
---|
385 | else val = substr(val, 1, pos(d2c(0), val) - 1)
|
---|
386 | ok = VRSet("CB_Use_Fake_Bold","Set", val)
|
---|
387 |
|
---|
388 | key = "Use_Netscape_Fix"
|
---|
389 | val = SysIni('USER', app, key)
|
---|
390 | if val = "ERROR:" then val = 0
|
---|
391 | /* strip the terminating NULL character */
|
---|
392 | else val = substr(val, 1, pos(d2c(0), val) - 1)
|
---|
393 | ok = VRSet("CB_Use_Netscape_Fix","Set", val)
|
---|
394 |
|
---|
395 | key = "Add_Uni_Encode"
|
---|
396 | val = SysIni('USER', app, key)
|
---|
397 | if val = "ERROR:" then val = 0
|
---|
398 | /* strip the terminating NULL character */
|
---|
399 | else val = substr(val, 1, pos(d2c(0), val) - 1)
|
---|
400 | ok = VRSet("CB_Add_Uni_Encode","Set", val)
|
---|
401 |
|
---|
402 | key = "Use_Facename_Alias"
|
---|
403 | val = SysIni('USER', app, key)
|
---|
404 | if val = "ERROR:" then val = 0
|
---|
405 | /* strip the terminating NULL character */
|
---|
406 | else val = substr(val, 1, pos(d2c(0), val) - 1)
|
---|
407 | ok = VRSet("CB_Use_Facename_Alias","Set", val)
|
---|
408 |
|
---|
409 | return
|
---|
410 |
|
---|
411 | /*:VRX _QueryInnotekFontengine
|
---|
412 | */
|
---|
413 | _QueryInnotekFontengine:
|
---|
414 | val = translate(strip(VRGetIni( "SYS_DLLS", "LoadPerProcess", "User" ),'T','00'x))
|
---|
415 | if pos('FT2LIB',val) > 0 then FontengineDetected = 1; else FontengineDetected = 0
|
---|
416 | if FontEngineDetected = 0 then return
|
---|
417 |
|
---|
418 | FT2LIB = SysBootDrive()'\OS2\DLL\FT2LIB.DLL'
|
---|
419 | TempFile = 'FT2Ver.TMP'
|
---|
420 | 'bldlevel 'FT2LIB'>'TempFile
|
---|
421 | Zeile = ''
|
---|
422 | do until lines(TempFile) = 0
|
---|
423 | Zeile = translate(linein(TempFile))
|
---|
424 | if pos('VERSION:',Zeile) > 0 then leave
|
---|
425 | end
|
---|
426 | ok = stream(TempFile,'c','close')
|
---|
427 | ok = SysFileDelete(TempFile)
|
---|
428 | say Zeile
|
---|
429 | parse var Zeile stuff ':'FT2Ver
|
---|
430 | FT2Ver = strip(FT2Ver)
|
---|
431 | say 'Version='FT2Ver
|
---|
432 | return
|
---|
433 |
|
---|
434 | /*:VRX _QueryInnotekFontengineOptions
|
---|
435 | */
|
---|
436 | _QueryInnotekFontengineOptions:
|
---|
437 | if FT2Ver >= "2.5.45" then FERoot = "HKLM"
|
---|
438 | else FERoot = "HKCU"
|
---|
439 |
|
---|
440 | result = spRegistry(FERoot"\Software\InnoTek\InnoTek Font Engine" , "Enabled" )
|
---|
441 | ok = VRset("CB_ITFE_enabled","set",result)
|
---|
442 |
|
---|
443 | result = spRegistry(FERoot"\Software\InnoTek\InnoTek Font Engine" , "Logging" )
|
---|
444 | ok = VRset("CB_ITFE_Logging","set",result)
|
---|
445 |
|
---|
446 | result = spRegistry(FERoot"\Software\InnoTek\InnoTek Font Engine\AntiAliasing" , "Enabled" )
|
---|
447 | ok = VRset("CB_ITFE_Antialiasing","set",result)
|
---|
448 |
|
---|
449 | result = spRegistry(FERoot"\Software\InnoTek\InnoTek Font Engine\AntiAliasing" , "Subpixel" )
|
---|
450 | ok = VRset("SPIN_SubpixelMode","value",result)
|
---|
451 |
|
---|
452 | result = spRegistry(FERoot"\Software\InnoTek\InnoTek Font Engine\AntiAliasing" , "FaceSizeThreshold" )
|
---|
453 | ok = VRset("SPIN_FaceSizeThreshold","value",result)
|
---|
454 |
|
---|
455 | result = spRegistry(FERoot"\Software\InnoTek\InnoTek Font Engine\Hinting" , "Mode" )
|
---|
456 | ok = VRset("CB_ITFE_HintingMode","Set",result)
|
---|
457 |
|
---|
458 | result = spRegistry(FERoot"\Software\InnoTek\InnoTek Font Engine\Applications", 'SUBKEYS:' , 'apps' )
|
---|
459 | ok = VRSet("CN_Apps", "Painting", 0)
|
---|
460 | ok = VRMethod( "CN_Apps", "RemoveRecord", "All" )
|
---|
461 |
|
---|
462 | if datatype(apps.0) = 'NUM' then do
|
---|
463 | do I = 1 to apps.0
|
---|
464 | result = spRegistry(FERoot"\Software\InnoTek\InnoTek Font Engine\Applications\"apps.I , "Enabled" )
|
---|
465 | RecHandle = VRMethod("CN_Apps","AddRecord")
|
---|
466 | ok = VRMethod("CN_Apps","SetfieldData",rechandle, AppFH, apps.I)
|
---|
467 | if Result = 1 then Status = '#50'; else Status = '#51'
|
---|
468 | ok = VRMethod("CN_Apps","SetfieldData",rechandle, StatusFH, Status)
|
---|
469 | end
|
---|
470 | end
|
---|
471 | ok = VRMethod( "CN_Apps", "SortRecords" )
|
---|
472 | ok = VRSet("CN_Apps", "Painting", 1)
|
---|
473 |
|
---|
474 | ok = VRSet("CN_Fontmap", "Painting", 0)
|
---|
475 | ok = VRMethod( "CN_Fontmap", "RemoveRecord", "All" )
|
---|
476 | result = spRegistry(FERoot"\Software\InnoTek\InnoTek Font Engine\Fonts", 'SUBKEYS:' , 'fonts' )
|
---|
477 |
|
---|
478 | if datatype(fonts.0) = 'NUM' then do
|
---|
479 | do I = 1 to fonts.0
|
---|
480 | MappedTo = spRegistry(FERoot"\Software\InnoTek\InnoTek Font Engine\Fonts\"fonts.I , "Mapping" )
|
---|
481 | if MappedTo = "ERROR:" | MappedTo = "" then MappedTo = ""
|
---|
482 | Ignore = spRegistry(FERoot"\Software\InnoTek\InnoTek Font Engine\Fonts\"fonts.I , "Ignore" )
|
---|
483 | if Ignore = "1" then Status = '#50'; else Status = '#51'
|
---|
484 | RecHandle = VRMethod("CN_Fontmap","AddRecord")
|
---|
485 | ok = VRMethod("CN_Fontmap","SetfieldData",rechandle, OriginalFH, fonts.I,MappedToFH, MappedTo, IgnoreFH, Status)
|
---|
486 | end
|
---|
487 | ok = VRMethod( "CN_Fontmap", "SortRecords" )
|
---|
488 | end
|
---|
489 |
|
---|
490 | ok = VRSet("CN_Fontmap", "Painting", 1)
|
---|
491 | return
|
---|
492 |
|
---|
493 | /*
|
---|
494 | Mode 1: Setting single value.
|
---|
495 | Syntax: result = spRegistry ( key , name , val , [ type ] )
|
---|
496 |
|
---|
497 | Mode 2: Setting default value of a certain key.
|
---|
498 | Syntax: result = spRegistry ( key , [ 'DEFAULT:' ] , val )
|
---|
499 |
|
---|
500 | Mode 3: Querying single value.
|
---|
501 | Syntax: result = spRegistry ( key , name )
|
---|
502 |
|
---|
503 | Mode 4: Query default value of a certain key.
|
---|
504 | Syntax: result = spRegistry ( key [ , [ 'DEFAULT:' ] ] )
|
---|
505 |
|
---|
506 | Mode 5: Query type of a single value.
|
---|
507 |
|
---|
508 | Syntax: result = spRegistry ( key , [ 'TYPE:' ] , name )
|
---|
509 | Mode 6: Deleting a single value.
|
---|
510 |
|
---|
511 | Syntax: result = spRegistry ( key , name , 'DELETE:' )
|
---|
512 | Mode 7: Deleting default value of a certain key.
|
---|
513 |
|
---|
514 | Syntax: result = spRegistry ( key , [ 'DEFAULT:' ] , 'DELETE:' )
|
---|
515 | Mode 8: Deleting an key and all associated subkeys and values.
|
---|
516 |
|
---|
517 | Syntax: result = spRegistry ( key , 'DELETE:' )
|
---|
518 | Mode 9: Querying names of all values associated with a certain key.
|
---|
519 |
|
---|
520 | Syntax: result = spRegistry ( key , 'VALUES:' , 'stem' )
|
---|
521 | Mode 10: Querying subkeys of a certain key.
|
---|
522 |
|
---|
523 | Syntax: result = spRegistry ( key , 'SUBKEYS:' , 'stem' )
|
---|
524 | Parameters: key - Registry key.
|
---|
525 | name - Name of the value to be set, queried, or deleted.
|
---|
526 | val - Value to be set, queried, or deleted.
|
---|
527 | stem - The result of the enumerating operations will be set into this stem
|
---|
528 | veriable.
|
---|
529 | Returns: For successful setting invocations, result will equal ''. (1,2)
|
---|
530 | For successful querying invocations, result will be given the value of the specified
|
---|
531 | registry value. (3,4,5)
|
---|
532 | For successful deleting invocations, result will equal ''. (6,7,8)
|
---|
533 | For succesful enumerating operations, result will be number of items returned.
|
---|
534 | (9,10)
|
---|
535 | Possible types returned by mode 5 are 'dword:' (2 byte values), 'hex:' (variable
|
---|
536 | length binary data), '' (variable length strings).
|
---|
537 | */
|
---|
538 |
|
---|
539 | /*:VRX _QueryMiscFontOptions
|
---|
540 | */
|
---|
541 | _QueryMiscFontOptions:
|
---|
542 | INIFile = "USER"
|
---|
543 | App = "PM_SystemFonts"
|
---|
544 | CurDefaultFont = VRGetIni( App, "DefaultFont", INIFIle )
|
---|
545 | if CurDefaultFont = "" then CurDefaultFont = "10.System Proportional"
|
---|
546 | return
|
---|
547 |
|
---|
548 | /*:VRX _RebootMsg
|
---|
549 | */
|
---|
550 | _RebootMsg:
|
---|
551 | Buttons.1 = "OK"
|
---|
552 | Buttons.0 = 1
|
---|
553 | id = VRMessage( VRWindow(), "Please reboot to make changes effective!", "TrueType configuration changed", "Information", "Buttons.", buttons.1, buttons.1 )
|
---|
554 | return
|
---|
555 |
|
---|
556 | /*:VRX _SaveFontengineOptions
|
---|
557 | */
|
---|
558 | _SaveFontengineOptions:
|
---|
559 | if VRGet("CB_ITFE_enabled","Set") then val = '01';else val = '00'
|
---|
560 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine" , "Enabled", "DWORD:"val)
|
---|
561 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine" , "Enabled", "DWORD:"val)
|
---|
562 |
|
---|
563 | if VRGet("CB_ITFE_logging","Set") then val = '01';else val = '00'
|
---|
564 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine" , "Logging", "DWORD:"val)
|
---|
565 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine" , "Logging", "DWORD:"val)
|
---|
566 |
|
---|
567 | if VRGet("CB_ITFE_Antialiasing","Set") then val = '01';else val = '00'
|
---|
568 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\AntiAliasing" , "Enabled", "DWORD:"val)
|
---|
569 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\AntiAliasing" , "Enabled", "DWORD:"val)
|
---|
570 |
|
---|
571 | val = right('0'||VRGet("SPIN_SubpixelMode","Value"),2)
|
---|
572 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\AntiAliasing" , "Subpixel", "DWORD:"val)
|
---|
573 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\AntiAliasing" , "Subpixel", "DWORD:"val)
|
---|
574 |
|
---|
575 | val = right('0'||VRGet("SPIN_FaceSizeThreshold","Value"),2)
|
---|
576 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\AntiAliasing" , "FaceSizeThreshold", "DWORD:"val)
|
---|
577 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\AntiAliasing" , "FaceSizeThreshold", "DWORD:"val)
|
---|
578 |
|
---|
579 | val = right('0'||VRGet("CB_ITFE_HintingMode","Set"),2)
|
---|
580 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\Hinting" , "Mode", "DWORD:"val)
|
---|
581 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\Hinting" , "Mode", "DWORD:"val)
|
---|
582 |
|
---|
583 | ok = VRMethod( "CN_Apps", "GetRecordList", "All", "AppsRecH." )
|
---|
584 | if AppsRecH.0 <> 0 then do
|
---|
585 | /* Clear old application lists */
|
---|
586 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\Applications", 'SUBKEYS:' , 'apps' )
|
---|
587 | if datatype(Apps.0) = 'NUM' then do
|
---|
588 | do I = 1 to apps.0
|
---|
589 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\Applications\"apps.I , "DELETE:" )
|
---|
590 | say 'Delete result='result
|
---|
591 | end
|
---|
592 | end
|
---|
593 |
|
---|
594 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\Applications", 'SUBKEYS:' , 'apps' )
|
---|
595 | if datatype(Apps.0) = 'NUM' then do
|
---|
596 | do I = 1 to apps.0
|
---|
597 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\Applications\"apps.I , "DELETE:" )
|
---|
598 | say 'Delete result='result
|
---|
599 | end
|
---|
600 | end
|
---|
601 |
|
---|
602 | /* Write new apps list */
|
---|
603 | do I = 1 to AppsRecH.0
|
---|
604 | say AppsRecH.I
|
---|
605 | Status = VRMethod("CN_Apps","getFieldData", AppsRecH.I, StatusFH)
|
---|
606 | if Status = "#50" then val = "01"
|
---|
607 | else val = "00"
|
---|
608 | AppName = VRMethod("CN_Apps","getFieldData", AppsRecH.I, AppFH)
|
---|
609 | if AppName = "" | Appname = ".exe" then iterate
|
---|
610 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\Applications\"AppName, "Enabled", "DWORD:"val )
|
---|
611 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\Applications\"AppName, "Enabled", "DWORD:"val )
|
---|
612 | end
|
---|
613 | end
|
---|
614 |
|
---|
615 | ok = VRMethod( "CN_Fontmap", "GetRecordList", "All", "FontMapRecH." )
|
---|
616 | if FontMapRec.0 <> 0 then do
|
---|
617 | /* Clear font list */
|
---|
618 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\Fonts", 'SUBKEYS:' , 'fonts' )
|
---|
619 | if datatype(fonts.0) = 'NUM' then do
|
---|
620 | do I = 1 to fonts.0
|
---|
621 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\Fonts\"fonts.I , "DELETE:" )
|
---|
622 | say 'Delete result='result
|
---|
623 | end
|
---|
624 | end
|
---|
625 |
|
---|
626 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\Fonts", 'SUBKEYS:' , 'fonts' )
|
---|
627 | if datatype(fonts.0) = 'NUM' then do
|
---|
628 | do I = 1 to fonts.0
|
---|
629 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\Fonts\"fonts.I , "DELETE:" )
|
---|
630 | say 'Delete result='result
|
---|
631 | end
|
---|
632 | end
|
---|
633 |
|
---|
634 | /* Write new font list */
|
---|
635 | do I = 1 to FontMapRecH.0
|
---|
636 | say FontMapRecH.I
|
---|
637 | Original = VRMethod("CN_Apps","getFieldData", FontMapRecH.I, OriginalFH)
|
---|
638 | if Original = "" then iterate
|
---|
639 | MappedTo = VRMethod("CN_Apps","getFieldData", FontMapRecH.I, MappedToFH)
|
---|
640 | Status = VRMethod("CN_Apps","getFieldData", FontMapRecH.I, IgnoreFH)
|
---|
641 | if Status = "#50" then val = "01"
|
---|
642 | else val = "00"
|
---|
643 | if val = "01" then do
|
---|
644 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\Fonts\"Original, "Ignore", "DWORD:"val )
|
---|
645 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\Fonts\"Original, "Ignore", "DWORD:"val )
|
---|
646 | end
|
---|
647 |
|
---|
648 | if MappedTo <> "" then do
|
---|
649 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\Fonts\"Original, "Mapping", MappedTo )
|
---|
650 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\Fonts\"Original, "Mapping", MappedTo )
|
---|
651 | end
|
---|
652 |
|
---|
653 | end
|
---|
654 | end
|
---|
655 |
|
---|
656 | FontEngineChanged = 0
|
---|
657 | return
|
---|
658 | /*:VRX _SaveMiscFontOptions
|
---|
659 | */
|
---|
660 | _SaveMiscFontOptions:
|
---|
661 | INIFile = "USER"
|
---|
662 | App = "PM_SystemFonts"
|
---|
663 | CurDefaultFont = VRSetIni( App, "DefaultFont", VRGet("PB_DefaultFont","Font"), INIFIle )
|
---|
664 | return
|
---|
665 |
|
---|
666 | /*:VRX _SaveTrueTypeOptions
|
---|
667 | */
|
---|
668 | _SaveTrueTypeOptions:
|
---|
669 | app = "PM_Font_Drivers"
|
---|
670 | key = "TRUETYPE"
|
---|
671 |
|
---|
672 | if VRGet("RB_IBM_trueType","set") then do
|
---|
673 | /* look for TRUETYPE.DLL */
|
---|
674 | rc = SysFileTree(left(bootdrive,1) || ":\OS2\DLL\TRUETYPE.DLL", "file", "F")
|
---|
675 |
|
---|
676 | if file.0 = 1 then do
|
---|
677 | val = "\OS2\DLL\TRUETYPE.DLL" || d2c(0)
|
---|
678 | SysIni('BOTH', app, key, val)
|
---|
679 | end
|
---|
680 | /* else no driver file! */
|
---|
681 | end
|
---|
682 | if VRGet("RB_FreeType","set") then do
|
---|
683 | /* look for FREETYPE.DLL */
|
---|
684 | rc = SysFileTree(left(bootdrive,1) || ":\OS2\DLL\FREETYPE.DLL", "file", "F")
|
---|
685 |
|
---|
686 | if file.0 = 1 then do
|
---|
687 | val = "\OS2\DLL\FREETYPE.DLL" || d2c(0)
|
---|
688 | SysIni('BOTH', app, key, val)
|
---|
689 | app = "FreeType/2"
|
---|
690 |
|
---|
691 | key = "OpenFaces"
|
---|
692 | val = VRget("EF_"key,"Value")
|
---|
693 | if datatype(val) = 'NUM' then do
|
---|
694 | val = min(val,256)
|
---|
695 | val = max(val,8)
|
---|
696 | szval = val || d2c(0)
|
---|
697 | rc = SysIni('USER', app, key, szval)
|
---|
698 | end
|
---|
699 | else rc = SysIni('USER', app, key, "")
|
---|
700 |
|
---|
701 | key = "Use_Fake_Bold"
|
---|
702 | val = VRget("CB_"key,"Set")
|
---|
703 | szval = val || d2c(0)
|
---|
704 | rc = SysIni('USER', app, key, szval)
|
---|
705 |
|
---|
706 | key = "Use_Netscape_Fix"
|
---|
707 | val = VRget("CB_"key,"Set")
|
---|
708 | szval = val || d2c(0)
|
---|
709 | rc = SysIni('USER', app, key, szval)
|
---|
710 |
|
---|
711 | key = "Add_Uni_Encode"
|
---|
712 | val = VRget("CB_"key,"Set")
|
---|
713 | szval = val || d2c(0)
|
---|
714 | rc = SysIni('USER', app, key, szval)
|
---|
715 | end
|
---|
716 | /* else no driver file! */
|
---|
717 | end
|
---|
718 | RebootRequired = 1
|
---|
719 | TrueTypeChanged = 0
|
---|
720 | return
|
---|
721 |
|
---|
722 | /*:VRX Activate
|
---|
723 | */
|
---|
724 | Activate:
|
---|
725 | parse arg Nr
|
---|
726 | call PushbackAll
|
---|
727 | CurrentPageNr = Nr
|
---|
728 | /* ok = VRSet("PB_"Nr,"Font","9.WarpSans Bold") */
|
---|
729 | ok = VRSet("TAB_"Nr,"Top", TabTop-8)
|
---|
730 | ok = VRSet("TAB_"Nr,"Left",TabWidth*(Nr-1)+PageLeft)
|
---|
731 | ok = VRSet("TAB_"Nr,"PicturePath", "#1"||Nr||";#1"||Nr)
|
---|
732 | ok = VRset("DT_PageName", "Caption", VRGet("TAB_"Nr, "UserData"))
|
---|
733 | ok = VRSet("Page_"Nr,"Visible", 1)
|
---|
734 | /* ok = VRSet("PB_help", "HelpTag", VRget("Page_"Nr,"HelpTag")) */
|
---|
735 | select
|
---|
736 | when Nr = 1 then ok = VRSet("IPB_paper","PicturePath","#4;#4")
|
---|
737 | when Nr = Pages then ok = VRSet("IPB_paper","PicturePath","#6;#6")
|
---|
738 | otherwise ok = VRSet("IPB_paper","PicturePath","#5;#5")
|
---|
739 | end
|
---|
740 | return
|
---|
741 |
|
---|
742 | /*:VRX CB_Add_Uni_Encode_Click
|
---|
743 | */
|
---|
744 | CB_Add_Uni_Encode_Click:
|
---|
745 | if InitDone then TrueTypeChanged = 1
|
---|
746 | return
|
---|
747 |
|
---|
748 | /*:VRX CB_ITFE_Antialiasing_Click
|
---|
749 | */
|
---|
750 | CB_ITFE_Antialiasing_Click:
|
---|
751 | ok = VRSet("SPIN_Subpixelmode" ,"Enabled",VRGet("CB_ITFE_Antialiasing","Set"))
|
---|
752 | ok = VRSet("SPIN_FaceSizeThreshold" ,"Enabled",VRGet("CB_ITFE_Antialiasing","Set"))
|
---|
753 | FontEngineChanged = 1
|
---|
754 | return
|
---|
755 |
|
---|
756 | /*:VRX CB_ITFE_enabled_Click
|
---|
757 | */
|
---|
758 | CB_ITFE_enabled_Click:
|
---|
759 | FontEngineChanged = 1
|
---|
760 | return
|
---|
761 |
|
---|
762 | /*:VRX CB_ITFE_HintingMode_Click
|
---|
763 | */
|
---|
764 | CB_ITFE_HintingMode_Click:
|
---|
765 | say 'Start CB_HintingMode_Click'
|
---|
766 | if InitDone then FontEngineChanged = 1
|
---|
767 | say 'Done CB_HintingMode_Click'
|
---|
768 | return
|
---|
769 |
|
---|
770 | /*:VRX CB_ITFE_Installed_Click
|
---|
771 | */
|
---|
772 | CB_ITFE_Installed_Click:
|
---|
773 | call _QueryInnotekFontengine
|
---|
774 | if FontengineDetected
|
---|
775 | then do
|
---|
776 | call _EnableFontengineOptions
|
---|
777 | ok = VRset("CB_ITFE_Installed","set", 1)
|
---|
778 | end
|
---|
779 | else do
|
---|
780 | call _DisableFontengineOptions
|
---|
781 | ok = VRset("CB_ITFE_Installed","set", 0)
|
---|
782 | end
|
---|
783 | return
|
---|
784 |
|
---|
785 | /*:VRX CB_ITFE_logging_Click
|
---|
786 | */
|
---|
787 | CB_ITFE_logging_Click:
|
---|
788 | FontEngineChanged = 1
|
---|
789 | return
|
---|
790 |
|
---|
791 | /*:VRX CB_Use_Facename_Alias_Click
|
---|
792 | */
|
---|
793 | CB_Use_Facename_Alias_Click:
|
---|
794 | if InitDone then TrueTypeChanged = 1
|
---|
795 | return
|
---|
796 |
|
---|
797 | /*:VRX CB_Use_Fake_Bold_Click
|
---|
798 | */
|
---|
799 | CB_Use_Fake_Bold_Click:
|
---|
800 | if InitDone then TrueTypeChanged = 1
|
---|
801 | return
|
---|
802 |
|
---|
803 | /*:VRX CB_Use_Netscape_Fix_Click
|
---|
804 | */
|
---|
805 | CB_Use_Netscape_Fix_Click:
|
---|
806 | if InitDone then TrueTypeChanged = 1
|
---|
807 | return
|
---|
808 |
|
---|
809 | /*:VRX CN_Apps_DoubleClick
|
---|
810 | */
|
---|
811 | CN_Apps_DoubleClick:
|
---|
812 | ok = VRMethod( "CN_Apps", "GetRecordList", "Selected", "Selected." )
|
---|
813 | if Selected.0 = 0 then return
|
---|
814 | do I = 1 to Selected.0
|
---|
815 | say Selected.I
|
---|
816 | Status = VRMethod("CN_Apps","getFieldData", Selected.I, StatusFH)
|
---|
817 | if Status = "#50" then Status = "#51"
|
---|
818 | else Status = "#50"
|
---|
819 | ok = VRMethod("CN_Apps","SetFieldData", Selected.I, StatusFH, Status)
|
---|
820 | end
|
---|
821 | FontEngineChanged = 1
|
---|
822 | return
|
---|
823 |
|
---|
824 | /*:VRX CN_Apps_DragDrop
|
---|
825 | */
|
---|
826 | CN_Apps_DragDrop:
|
---|
827 | AppFile = VRInfo("SourceFile")
|
---|
828 | if AppFile = '' then return
|
---|
829 | RecHandle = VRMethod("CN_Apps", "AddRecord")
|
---|
830 | Appfile = VRParseFilename(Appfile, 'NE')
|
---|
831 | ok = VRMethod("CN_Apps", "SetFieldData", RecHandle, AppFH, AppFile, StatusFH, "#50")
|
---|
832 | FontEngineChanged = 1
|
---|
833 | return
|
---|
834 |
|
---|
835 | /*:VRX CN_Apps_EndEdit
|
---|
836 | */
|
---|
837 | CN_Apps_EndEdit:
|
---|
838 | FontEngineChanged = 1
|
---|
839 | return
|
---|
840 |
|
---|
841 | /*:VRX CN_FontMap_DoubleClick
|
---|
842 | */
|
---|
843 | CN_FontMap_DoubleClick:
|
---|
844 | ok = VRMethod( "CN_FontMap", "GetRecordList", "Selected", "Selected." )
|
---|
845 | if Selected.0 = 0 then return
|
---|
846 |
|
---|
847 | OriginalWidth = VRMethod("CN_FontMap","GetFieldAttr", OriginalFH, "Width")
|
---|
848 | MappedFontWidth = VRMethod("CN_FontMap","GetFieldAttr", MappedToFH, "Width")
|
---|
849 |
|
---|
850 | MousePos = VRInfo("Left")
|
---|
851 | if MousePos > OriginalWidth+MappedFontWidth+580 then do
|
---|
852 | say "Ignore-Stuff ("MousePos')'
|
---|
853 | do I = 1 to Selected.0
|
---|
854 | say Selected.I
|
---|
855 | Status = VRMethod("CN_FontMap","GetFieldData", Selected.I, IgnoreFH)
|
---|
856 | if Status = "#50" then Status = "#51"; else Status = "#50"
|
---|
857 | ok = VRMethod("CN_FontMap","SetFieldData", Selected.I, IgnoreFH, Status)
|
---|
858 | end
|
---|
859 | end
|
---|
860 | else do
|
---|
861 | do I = 1 to Selected.0
|
---|
862 | say Selected.I
|
---|
863 | Original = VRMethod("CN_FontMap","getFieldData", Selected.I, OriginalFH)
|
---|
864 | MappedFont = VRMethod("CN_FontMap","getFieldData", Selected.I, MappedToFH)
|
---|
865 |
|
---|
866 | if Original = "WarpSans" then Pt = '9'; else pt = '8'
|
---|
867 | NewOriginalFont = VRFontDialog( VRWindow(), pt'.'Original, "Choose original font")
|
---|
868 | if NewOriginalFont = "" then return
|
---|
869 | parse var NewOriginalFont pt'.'NewOriginalFont
|
---|
870 |
|
---|
871 | if MappedFont = "WarpSans" then Pt = '9'; else pt = '8'
|
---|
872 | NewMappedFont = VRFontDialog( VRWindow(), pt'.'MappedFont, "Choose font to map "NewOriginalFont" to")
|
---|
873 | if NewMappedFont <> "" then parse var NewMappedFont pt'.'NewMappedFont
|
---|
874 |
|
---|
875 | ok = VRMethod("CN_FontMap","SetFieldData", Selected.I, OriginalFH, NewOriginalFont, MappedToFH, NewMappedFont)
|
---|
876 | end
|
---|
877 | end
|
---|
878 | FontEngineChanged = 1
|
---|
879 | return
|
---|
880 |
|
---|
881 | /*:VRX CN_FontMap_EndEdit
|
---|
882 | */
|
---|
883 | CN_FontMap_EndEdit:
|
---|
884 | FontEngineChanged = 1
|
---|
885 | return
|
---|
886 |
|
---|
887 | /*:VRX EF_OpenFaces_Change
|
---|
888 | */
|
---|
889 | EF_OpenFaces_Change:
|
---|
890 | if InitDone then TrueTypeChanged = 1
|
---|
891 | return
|
---|
892 |
|
---|
893 | /*:VRX Fini
|
---|
894 | */
|
---|
895 | Fini:
|
---|
896 | window = VRWindow()
|
---|
897 | call VRSet window, "Visible", 0
|
---|
898 | drop window
|
---|
899 | return 0
|
---|
900 |
|
---|
901 | /*:VRX GetBootDrive
|
---|
902 | */
|
---|
903 | GetBootDrive:
|
---|
904 | /* Use SysBootDrive if possible */
|
---|
905 | If Rxfuncadd('SysBootDrive', 'RexxUtil', 'SysBootDrive') Then
|
---|
906 | Return Left(Value('RUNWORKPLACE',,'OS2ENVIRONMENT'),2)
|
---|
907 | Else
|
---|
908 | Return SysBootDrive()
|
---|
909 |
|
---|
910 |
|
---|
911 | /*:VRX Halt
|
---|
912 | */
|
---|
913 | Halt:
|
---|
914 | signal _VREHalt
|
---|
915 | return
|
---|
916 |
|
---|
917 | /*:VRX Init
|
---|
918 | */
|
---|
919 | Init:
|
---|
920 | window = VRWindow()
|
---|
921 | call VRMethod window, "CenterWindow"
|
---|
922 | call VRSet window, "Visible", 0
|
---|
923 | call VRMethod window, "Activate"
|
---|
924 | drop window
|
---|
925 | return
|
---|
926 |
|
---|
927 | /*:VRX IPB_Add_Click
|
---|
928 | */
|
---|
929 | IPB_Add_Click:
|
---|
930 | AppFile = VRFileDialog( VRWindow(), "Choose application to add", "Open", "*.EXE", , , )
|
---|
931 | if AppFile = '' then return
|
---|
932 | RecHandle = VRMethod("CN_Apps", "AddRecord")
|
---|
933 | Appfile = VRParseFilename(Appfile, 'NE')
|
---|
934 | ok = VRMethod("CN_Apps", "SetFieldData", RecHandle, AppFH, AppFile, StatusFH, "#50")
|
---|
935 | FontEngineChanged = 1
|
---|
936 | return
|
---|
937 |
|
---|
938 | /*:VRX IPB_AddMapping_Click
|
---|
939 | */
|
---|
940 | IPB_AddMapping_Click:
|
---|
941 | NewOriginalFont = VRFontDialog( VRWindow(), , "Choose original font")
|
---|
942 | if NewOriginalFont = "" then return
|
---|
943 | parse var NewOriginalFont pt'.'NewOriginalFont
|
---|
944 |
|
---|
945 | NewMappedFont = VRFontDialog( VRWindow(), , "Choose font to map "NewOriginalFont" to")
|
---|
946 | if NewMappedFont <> "" then parse var NewMappedFont pt'.'NewMappedFont
|
---|
947 |
|
---|
948 | RecHandle = VRMethod("CN_Fontmap", "AddRecord")
|
---|
949 | ok = VRMethod("CN_Fontmap", "SetFieldData", RecHandle, OriginalFH, NewOriginalFont, MappedToFH, NewMappedFont)
|
---|
950 |
|
---|
951 | Msg.Title = "Ignore "NewOriginalFont"?"
|
---|
952 | Msg.Type = "Q"
|
---|
953 | Msg.Text = "Should the InnoTek Font Engine ignore this font (i.e. let GPI handle it)?"
|
---|
954 | ok = _MsgYesNo()
|
---|
955 | if ok = 1 then Status = '#50'; else Status = '#51'
|
---|
956 | ok = VRMethod("CN_FontMap","SetFieldData", RecHandle, IgnoreFH, Status)
|
---|
957 | FontEngineChanged = 1
|
---|
958 | return
|
---|
959 |
|
---|
960 | /*:VRX IPB_New_Click
|
---|
961 | */
|
---|
962 | IPB_New_Click:
|
---|
963 | RecHandle = VRMethod("CN_Apps", "AddRecord")
|
---|
964 | Appfile = '.exe'
|
---|
965 | ok = VRMethod("CN_Apps", "SetFieldData", RecHandle, AppFH, AppFile, StatusFH, "#51")
|
---|
966 | ok = VRMethod("CN_Apps", "SetRecordAttr", RecHandle, "Selected", 1)
|
---|
967 |
|
---|
968 | FontEngineChanged = 1
|
---|
969 | return
|
---|
970 |
|
---|
971 | /*:VRX IPB_NewMapping_Click
|
---|
972 | */
|
---|
973 | IPB_NewMapping_Click:
|
---|
974 | RecHandle = VRMethod("CN_Fontmap", "AddRecord")
|
---|
975 | ok = VRMethod("CN_Fontmap", "SetRecordAttr", RecHandle, "Selected", 1)
|
---|
976 | FontEngineChanged = 1
|
---|
977 | return
|
---|
978 |
|
---|
979 | /*:VRX IPB_Paper_Click
|
---|
980 | */
|
---|
981 | IPB_Paper_Click:
|
---|
982 | if VRInfo("Left") > VRInfo("Top") then call Activate min(CurrentPageNr+1,Pages)
|
---|
983 | if VRInfo("Left") <= VRInfo("Top") then call Activate max(CurrentPageNr-1,1)
|
---|
984 | return
|
---|
985 |
|
---|
986 | /*:VRX IPB_Remove_Click
|
---|
987 | */
|
---|
988 | IPB_Remove_Click:
|
---|
989 | ok = VRMethod( "CN_Apps", "GetRecordList", "Selected", "Selected." )
|
---|
990 | if Selected.0 = 0 then return
|
---|
991 | do I = 1 to Selected.0
|
---|
992 | say Selected.I
|
---|
993 | ok = VRMethod("CN_Apps","RemoveRecord", Selected.I)
|
---|
994 | end
|
---|
995 | FontEngineChanged = 1
|
---|
996 | return
|
---|
997 |
|
---|
998 | /*:VRX IPB_RemoveMapping_Click
|
---|
999 | */
|
---|
1000 | IPB_RemoveMapping_Click:
|
---|
1001 | ok = VRMethod( "CN_Fontmap", "GetRecordList", "Selected", "Selected." )
|
---|
1002 | if Selected.0 = 0 then return
|
---|
1003 | do I = 1 to Selected.0
|
---|
1004 | say Selected.I
|
---|
1005 | ok = VRMethod("CN_Fontmap","RemoveRecord", Selected.I)
|
---|
1006 | end
|
---|
1007 | FontEngineChanged = 1
|
---|
1008 | return
|
---|
1009 |
|
---|
1010 | /*:VRX IPB_Test_Click
|
---|
1011 | */
|
---|
1012 | IPB_Test_Click:
|
---|
1013 | AppFile = VRFileDialog( VRWindow(), "Choose application to test", "Open", "*.EXE", , , )
|
---|
1014 | if AppFile = '' then return
|
---|
1015 | AppName = VRParseFilename(Appfile, 'NE')
|
---|
1016 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\Applications\"AppName, "Enabled", "DWORD:01" )
|
---|
1017 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\Applications\"AppName, "Enabled", "DWORD:01" )
|
---|
1018 | OrgPath = directory()
|
---|
1019 | ok = VRChDir(VRParseFilename(Appfile, 'DP') )
|
---|
1020 | 'start 'Appfile
|
---|
1021 | ok = VRChDir(OrgPath )
|
---|
1022 | Msg.Title = "Testing "Appname" with InnoTek Font Engine"
|
---|
1023 | Msg.Type = "Q"
|
---|
1024 | Msg.Text = "Keep InnoTek Font Engine enabled for "AppName"?"
|
---|
1025 | ok = _MsgYesNo()
|
---|
1026 | if ok = 1 then do
|
---|
1027 | RecHandle = VRMethod("CN_Apps", "AddRecord")
|
---|
1028 | ok = VRMethod("CN_Apps", "SetFieldData", RecHandle, AppFH, AppName, StatusFH, "#50")
|
---|
1029 | FontEngineChanged = 1
|
---|
1030 | end
|
---|
1031 | else do
|
---|
1032 | result = spRegistry("HKCU\Software\InnoTek\InnoTek Font Engine\Applications\"AppName, "DELETE:" )
|
---|
1033 | result = spRegistry("HKLM\Software\InnoTek\InnoTek Font Engine\Applications\"AppName, "DELETE:" )
|
---|
1034 | end
|
---|
1035 | return
|
---|
1036 |
|
---|
1037 | /*:VRX Main_Close
|
---|
1038 | */
|
---|
1039 | Main_Close:
|
---|
1040 | call Quit
|
---|
1041 | return
|
---|
1042 |
|
---|
1043 | /*:VRX Main_Create
|
---|
1044 | */
|
---|
1045 | Main_Create:
|
---|
1046 | InitPhase = 1
|
---|
1047 | call _LoadOtherFuncs
|
---|
1048 |
|
---|
1049 | ok = VRMethod("PB_Save","SetFocus")
|
---|
1050 | call Page1_Create
|
---|
1051 | call Page2_Create
|
---|
1052 | call Page3_Create
|
---|
1053 | call Page4_Create
|
---|
1054 | call Page5_Create
|
---|
1055 | call Paper_Init
|
---|
1056 |
|
---|
1057 | call _INIRead
|
---|
1058 | call _QueryMiscFontOptions
|
---|
1059 | call _QueryCurrentTrueTypeDriver
|
---|
1060 | call _QueryInnotekFontengine
|
---|
1061 | call _GUIInit
|
---|
1062 | call TAB_1_Click
|
---|
1063 | return
|
---|
1064 |
|
---|
1065 | /*:VRX Main_Resize
|
---|
1066 | */
|
---|
1067 | Main_Resize:
|
---|
1068 | MainWin = "Main"
|
---|
1069 | ok = VRSet(MainWin,"Painting", 0)
|
---|
1070 | /* ok = VRset(MainWin,"Visible", 0) */
|
---|
1071 | ok = VRSet(MainWin,"Width",max(VRget(MainWin,"Width"),Pages*TabWidth+300))
|
---|
1072 | ok = VRset("GB_Main","width",VRget(MainWin,"Width")-150)
|
---|
1073 | ok = VRset("GB_Main","Height",VRget(MainWin,"Height")-1175-240)
|
---|
1074 | ok = VRset("GB_Main2","width",VRget("GB_Main","Width")-260)
|
---|
1075 | ok = VRset("GB_Main2","Height",VRget("GB_Main","Height")-275)
|
---|
1076 | ok = VRset("GB_VerticalLine","Left",VRget("GB_Main2","Width")-60)
|
---|
1077 | ok = VRset("GB_VerticalLine","Height",VRget("GB_Main2","Height")-410)
|
---|
1078 | ok = VRset("IPB_Paper","Left",VRget("GB_Main2","width")-420)
|
---|
1079 | ok = VRset("GB_HorLineTop","Width",VRget("GB_Main2","width")-440)
|
---|
1080 | ok = VRset("GB_HorLineTop","Width",VRget("GB_Main2","width")-440)
|
---|
1081 | ok = VRset("GB_LineSubtitle","Width",VRget("GB_Main2","width")-480)
|
---|
1082 | do I = 1 to Pages
|
---|
1083 | ok = VRSet("Page_"I,"Height", max(PageHeight,VRget("GB_Main2","Height")-600))
|
---|
1084 | ok = VRSet("Page_"I,"Width", max(PageWidth,VRget("GB_Main2","Width")-450))
|
---|
1085 | end
|
---|
1086 |
|
---|
1087 | ok = VRSEt("PB_Save","top",VRGet("GB_Main","Height")+325)
|
---|
1088 | ok = VRSEt("PB_Undo","top",VRGet("GB_Main","Height")+325)
|
---|
1089 | ok = VRSEt("PB_Cancel","top",VRGet("GB_Main","Height")+325)
|
---|
1090 |
|
---|
1091 | ok = VRset("CN_Apps","Top", 120)
|
---|
1092 | ok = VRset("CN_Apps","Left", 20)
|
---|
1093 | ok = VRset("CN_Apps","Width", VRGet("Page_3","Width")-600)
|
---|
1094 | ok = VRset("CN_Apps","Height", VRGet("Page_3","Height")-120)
|
---|
1095 |
|
---|
1096 | ok = VRset("CN_Fontmap","Top", 120)
|
---|
1097 | ok = VRset("CN_Fontmap","Left", 20)
|
---|
1098 | ok = VRset("CN_Fontmap","Width", VRGet("Page_4","Width")-600)
|
---|
1099 | ok = VRset("CN_Fontmap","Height", VRGet("Page_4","Height")-120)
|
---|
1100 |
|
---|
1101 | ok = VRSEt("IPB_Add","Left",VRGet("Page_3","Width")-400)
|
---|
1102 | ok = VRSEt("IPB_New","Left",VRGet("Page_3","Width")-400)
|
---|
1103 | ok = VRSEt("IPB_Test","Left",VRGet("Page_3","Width")-400)
|
---|
1104 | ok = VRSEt("IPB_Remove","Left",VRGet("Page_3","Width")-400)
|
---|
1105 |
|
---|
1106 | ok = VRSEt("IPB_Remove","Top",VRGet("CN_Apps","Height")-VRGet("IPB_Remove","Height"))
|
---|
1107 |
|
---|
1108 | FontFieldWidth = format((VRGet("CN_Fontmap","Width")-1300)/2,,0)
|
---|
1109 | ok = VRMethod("CN_Fontmap","SetFieldAttr",OriginalFH,"width", FontFieldWidth)
|
---|
1110 | ok = VRMethod("CN_Fontmap","SetFieldAttr",MappedToFH,"width", FontFieldWidth)
|
---|
1111 |
|
---|
1112 |
|
---|
1113 | ok = VRSEt("IPB_AddMapping","Left",VRGet("Page_4","Width")-400)
|
---|
1114 | ok = VRSEt("IPB_NewMapping","Left",VRGet("Page_4","Width")-400)
|
---|
1115 | ok = VRSEt("IPB_NewMapping","Left",VRGet("Page_4","Width")-400)
|
---|
1116 | ok = VRSEt("IPB_RemoveMapping","Left",VRGet("Page_4","Width")-400)
|
---|
1117 |
|
---|
1118 | ok = VRSEt("IPB_RemoveMapping","Top",VRGet("CN_Fontmap","Height")-VRGet("IPB_RemoveMapping","Height"))
|
---|
1119 |
|
---|
1120 | ButtonDist= 980
|
---|
1121 | ButtonNr = 3
|
---|
1122 | ButtonPos = format(max((VRget(MainWin,"Width")-ButtonDist*ButtonNr)/2,0),,0)
|
---|
1123 | ok = VRSEt("PB_Save","left",ButtonPos+ButtonDist*(ButtonNr-3))
|
---|
1124 | ok = VRSEt("PB_Undo","left",ButtonPos+ButtonDist*(ButtonNr-2))
|
---|
1125 | ok = VRSEt("PB_Cancel","left",ButtonPos+ButtonDist*(ButtonNr-1))
|
---|
1126 |
|
---|
1127 |
|
---|
1128 | /* check and empty event queue, trash spurious resize events */
|
---|
1129 | EventString = ''
|
---|
1130 | TrashedResize = 0
|
---|
1131 | do until EventString = 'nop'
|
---|
1132 | EventString = VREvent('N')
|
---|
1133 | if EventString <> 'nop' then do
|
---|
1134 | if EventString = 'CALL 'MainWin'_Resize' then TrashedResize = 1
|
---|
1135 | else interpret eventString
|
---|
1136 | end
|
---|
1137 | end
|
---|
1138 | if TrashedResize then CALL Main_Resize
|
---|
1139 | ok = VRSet(MainWin, "Painting", 1)
|
---|
1140 |
|
---|
1141 | /* ok = VRset(MainWin,"Visible", 1) */
|
---|
1142 | return
|
---|
1143 |
|
---|
1144 | /*:VRX Page1_Create
|
---|
1145 | */
|
---|
1146 | Page1_Create:
|
---|
1147 |
|
---|
1148 | Return
|
---|
1149 |
|
---|
1150 | /*:VRX Page1_Init
|
---|
1151 | */
|
---|
1152 | Page1_Init:
|
---|
1153 |
|
---|
1154 | return
|
---|
1155 |
|
---|
1156 | /*:VRX Page2_Create
|
---|
1157 | */
|
---|
1158 | Page2_create:
|
---|
1159 |
|
---|
1160 | Return
|
---|
1161 | /*:VRX Page2_init
|
---|
1162 | */
|
---|
1163 | Page2_init:
|
---|
1164 |
|
---|
1165 | return
|
---|
1166 |
|
---|
1167 | /*:VRX Page3_Create
|
---|
1168 | */
|
---|
1169 | Page3_create:
|
---|
1170 | call _ContainerInit
|
---|
1171 | Return
|
---|
1172 | /*:VRX Page3_Init
|
---|
1173 | */
|
---|
1174 | Page3_Init:
|
---|
1175 |
|
---|
1176 | return
|
---|
1177 |
|
---|
1178 | /*:VRX Page4_Create
|
---|
1179 | */
|
---|
1180 | Page4_Create:
|
---|
1181 |
|
---|
1182 | Return
|
---|
1183 | /*:VRX Page4_init
|
---|
1184 | */
|
---|
1185 | Page4_init:
|
---|
1186 |
|
---|
1187 | return
|
---|
1188 |
|
---|
1189 | /*:VRX Page5_Create
|
---|
1190 | */
|
---|
1191 | Page5_Create:
|
---|
1192 |
|
---|
1193 | return
|
---|
1194 |
|
---|
1195 | /*:VRX Page5_Init
|
---|
1196 | */
|
---|
1197 | Page5_Init:
|
---|
1198 |
|
---|
1199 | return
|
---|
1200 |
|
---|
1201 | /*:VRX Paper_Init
|
---|
1202 | */
|
---|
1203 | Paper_Init:
|
---|
1204 | ok = VRSet("IPB_Paper","Width" ,VRMethod( "Screen", "PixelsToTwips", 32 ))
|
---|
1205 | ok = VRSet("IPB_Paper","Height",VRMethod( "Screen", "PixelsToTwips", 32 ))
|
---|
1206 | ok = VRset("IPB_Paper","Left",VRget("GB_Main2","width")-420)
|
---|
1207 | return
|
---|
1208 |
|
---|
1209 | /*:VRX PB_Cancel_Click
|
---|
1210 | */
|
---|
1211 | PB_Cancel_Click:
|
---|
1212 | Call Quit
|
---|
1213 | return
|
---|
1214 |
|
---|
1215 | /*:VRX PB_DefaultFont_Click
|
---|
1216 | */
|
---|
1217 | PB_DefaultFont_Click:
|
---|
1218 | NewDefaultFont = VRFontDialog( object, VRget("PB_DefaultFont","Font"), "Set PM default font")
|
---|
1219 | if NewDefaultFont = "" then return
|
---|
1220 | MiscOptionsFontChanged = 1
|
---|
1221 | RebootRequired = 1
|
---|
1222 | ok = VRset("PB_DefaultFont","Caption", NewDefaultFont)
|
---|
1223 | ok = VRset("PB_DefaultFont","Font", NewDefaultFont)
|
---|
1224 | return
|
---|
1225 |
|
---|
1226 | /*:VRX PB_Exit_Click
|
---|
1227 | */
|
---|
1228 | PB_Exit_Click:
|
---|
1229 | call Quit
|
---|
1230 | return
|
---|
1231 |
|
---|
1232 | /*:VRX PB_Save_Click
|
---|
1233 | */
|
---|
1234 | PB_Save_Click:
|
---|
1235 | bootdrive = SysSearchPath('PATH', 'OS2.INI')
|
---|
1236 | bootdrive = left(bootdrive, 1)
|
---|
1237 |
|
---|
1238 | if TrueTypeChanged then call _SaveTrueTypeOptions
|
---|
1239 |
|
---|
1240 | if VRGet("CB_ITFE_installed","Set") then do
|
---|
1241 | call _SaveFontengineOptions
|
---|
1242 | end
|
---|
1243 |
|
---|
1244 | call _QueryCurrentTrueTypeDriver
|
---|
1245 | call _QueryInnotekFontengine
|
---|
1246 | if FontengineDetected then do
|
---|
1247 | call _EnableFontengineOptions
|
---|
1248 | call _QueryInnotekFontengineOptions
|
---|
1249 | end
|
---|
1250 |
|
---|
1251 | if MiscOptionsFontChanged then call _SaveMiscFontOptions
|
---|
1252 |
|
---|
1253 | ok = VRseT("PB_Undo","Enabled",0)
|
---|
1254 | ok = VRseT("PB_Save","Enabled",0)
|
---|
1255 | if RebootRequired then call _RebootMsg
|
---|
1256 | return
|
---|
1257 |
|
---|
1258 | /*:VRX PB_Undo_Click
|
---|
1259 | */
|
---|
1260 | PB_Undo_Click:
|
---|
1261 | call _QueryMiscFontOptions
|
---|
1262 | call _QueryCurrentTrueTypeDriver
|
---|
1263 | call _QueryInnotekFontengine
|
---|
1264 | if FontengineDetected then do
|
---|
1265 | call _EnableFontengineOptions
|
---|
1266 | call _QueryInnotekFontengineOptions
|
---|
1267 | end
|
---|
1268 | else do
|
---|
1269 | call _DisableFontengineOptions
|
---|
1270 | end
|
---|
1271 | ok = VRset("PB_DefaultFont","Caption", CurDefaultFont)
|
---|
1272 | ok = VRset("PB_DefaultFont","Font", CurDefaultFont)
|
---|
1273 | MiscOptionsFontChanged = 0
|
---|
1274 | return
|
---|
1275 |
|
---|
1276 | /*:VRX PushbackAll
|
---|
1277 | */
|
---|
1278 | PushbackAll:
|
---|
1279 | Pages = 5
|
---|
1280 | /* Tab distance from top */
|
---|
1281 | TabTop = 20
|
---|
1282 | TabWidth = VRMethod( "Screen", "PixelsToTwips", 96 )
|
---|
1283 | TabHeight= VRMethod( "Screen", "PixelsToTwips", 24 )
|
---|
1284 |
|
---|
1285 | /* Page Position */
|
---|
1286 | PageLeft = 120
|
---|
1287 | PageTop = PageLeft + TabTop + 330
|
---|
1288 |
|
---|
1289 | /* Page size */
|
---|
1290 | PageHeight = 3000
|
---|
1291 | PageWidth = 3000
|
---|
1292 | ok = VRset("DT_PageName", "Caption", "")
|
---|
1293 | ok = VRSet("GB_Main","Left", 0)
|
---|
1294 | ok = VRSet("GB_Main","Top", TabTop+230)
|
---|
1295 | do I = 1 to Pages
|
---|
1296 | ok = VRSet("TAB_"I,"Top", TabTop)
|
---|
1297 | ok = VRSet("TAB_"I,"PicturePath","#2"||I||";#2"||I)
|
---|
1298 | ok = VRSet("TAB_"I,"Left",TabWidth*(I-1)+PageLeft)
|
---|
1299 | ok = VRSet("TAB_"I,"Width",TabWidth)
|
---|
1300 | ok = VRSet("TAB_"I,"Height",TabHeight)
|
---|
1301 | ok = VRSet("Page_"I,"Visible", 0)
|
---|
1302 | ok = VRSet("Page_"I,"Left", PageLeft)
|
---|
1303 | ok = VRSet("Page_"I,"Top", PageTop)
|
---|
1304 | ok = VRSet("Page_"I,"Height", max(PageHeight,VRget("GB_Main2","Height")-600))
|
---|
1305 | ok = VRSet("Page_"I,"Width", max(PageWidth,VRget("GB_Main2","Width")-450))
|
---|
1306 | ok = VRSet("Page_"I,"BackColor", "<default>")
|
---|
1307 | end
|
---|
1308 | return
|
---|
1309 |
|
---|
1310 | return
|
---|
1311 |
|
---|
1312 | /*:VRX Quit
|
---|
1313 | */
|
---|
1314 | Quit:
|
---|
1315 | call _INIWrite
|
---|
1316 | window = VRWindow()
|
---|
1317 | call VRSet window, "Shutdown", 1
|
---|
1318 | drop window
|
---|
1319 | return
|
---|
1320 |
|
---|
1321 | /*:VRX RB_FreeType_Click
|
---|
1322 | */
|
---|
1323 | RB_FreeType_Click:
|
---|
1324 | call _EnableFreeTypeOptions
|
---|
1325 | call _QueryFreeTypeOptions
|
---|
1326 | if InitDone then TrueTypeChanged = 1
|
---|
1327 | return
|
---|
1328 |
|
---|
1329 | /*:VRX RB_IBM_TrueType_Click
|
---|
1330 | */
|
---|
1331 | RB_IBM_TrueType_Click:
|
---|
1332 | call _DisableFreeTypeOptions
|
---|
1333 | if InitDone then TrueTypeChanged = 1
|
---|
1334 | return
|
---|
1335 |
|
---|
1336 | /*:VRX SetTabWidth
|
---|
1337 | */
|
---|
1338 | SetTabWidth: procedure expose TabWidth
|
---|
1339 | PageNr = arg(1)
|
---|
1340 | select
|
---|
1341 | when PageNr = 2 then Tabwidth = VRMethod( "Screen", "PixelsToTwips", 96 )
|
---|
1342 | when PageNr = 3 then Tabwidth = VRMethod( "Screen", "PixelsToTwips", 96 )
|
---|
1343 | otherwise Tabwidth = VRMethod( "Screen", "PixelsToTwips", 96 )
|
---|
1344 | end
|
---|
1345 | return
|
---|
1346 |
|
---|
1347 | /*:VRX SPIN_FaceSizeThreshold_Change
|
---|
1348 | */
|
---|
1349 | SPIN_FaceSizeThreshold_Change:
|
---|
1350 | say 'Start SPIN_FaceSizeThreshold_Change'
|
---|
1351 | if InitDone then FontEngineChanged = 1
|
---|
1352 | say 'Done SPIN_FaceSizeThreshold_Change'
|
---|
1353 | return
|
---|
1354 |
|
---|
1355 | /*:VRX SPIN_SubpixelMode_Change
|
---|
1356 | */
|
---|
1357 | SPIN_SubpixelMode_Change:
|
---|
1358 | say 'start SPIN_SubpixelMode_Change'
|
---|
1359 | if InitDone then FontEngineChanged = 1
|
---|
1360 | say 'Done SPIN_SubpixelMode_Change'
|
---|
1361 | return
|
---|
1362 |
|
---|
1363 | /*:VRX TAB_1_Click
|
---|
1364 | */
|
---|
1365 | TAB_1_Click:
|
---|
1366 | call Activate 1
|
---|
1367 | return
|
---|
1368 |
|
---|
1369 | /*:VRX TAB_2_Click
|
---|
1370 | */
|
---|
1371 | TAB_2_Click:
|
---|
1372 | call Activate 2
|
---|
1373 | return
|
---|
1374 |
|
---|
1375 | /*:VRX TAB_3_Click
|
---|
1376 | */
|
---|
1377 | TAB_3_Click:
|
---|
1378 | call Activate 3
|
---|
1379 | return
|
---|
1380 |
|
---|
1381 | /*:VRX TAB_4_Click
|
---|
1382 | */
|
---|
1383 | TAB_4_Click:
|
---|
1384 | call Activate 4
|
---|
1385 | return
|
---|
1386 |
|
---|
1387 | /*:VRX TAB_5_Click
|
---|
1388 | */
|
---|
1389 | TAB_5_Click:
|
---|
1390 | call Activate 5
|
---|
1391 | return
|
---|
1392 |
|
---|
1393 | /*:VRX TM_ButtonsEnabler_ContextMenu
|
---|
1394 | */
|
---|
1395 | TM_ButtonsEnabler_ContextMenu:
|
---|
1396 |
|
---|
1397 | return
|
---|
1398 |
|
---|
1399 | /*:VRX TM_ButtonsEnabler_Trigger
|
---|
1400 | */
|
---|
1401 | TM_ButtonsEnabler_Trigger:
|
---|
1402 | /* say 'TM_ButtonEnabler: TrueTypeChanged='TrueTypeChanged
|
---|
1403 | say 'TM_ButtonEnabler: FontengineChanged='FontengineChanged */
|
---|
1404 |
|
---|
1405 | if VRGet("PB_DefaultFont", "Caption") <> VRGet("PB_DEfaultFont","Font") then do
|
---|
1406 | ok = VRSet("PB_DefaultFont", "Caption", VRGet("PB_DEfaultFont","Font"))
|
---|
1407 | MiscOptionsFontChanged = 1
|
---|
1408 | RebootRequired = 1
|
---|
1409 | end
|
---|
1410 |
|
---|
1411 | if TrueTypeChanged | FontengineChanged | MiscOptionsFontChanged then do
|
---|
1412 | ok = VRseT("PB_Undo","Enabled",1)
|
---|
1413 | ok = VRseT("PB_Save","Enabled",1)
|
---|
1414 | end
|
---|
1415 | else do
|
---|
1416 | ok = VRseT("PB_Undo","Enabled",0)
|
---|
1417 | ok = VRseT("PB_Save","Enabled",0)
|
---|
1418 | end
|
---|
1419 | ok = VRSet("SPIN_Subpixelmode" ,"Enabled",VRGet("CB_ITFE_Antialiasing","Set"))
|
---|
1420 | ok = VRSet("SPIN_FaceSizeThreshold" ,"Enabled",VRGet("CB_ITFE_Antialiasing","Set"))
|
---|
1421 |
|
---|
1422 | if InitDone = 0 then InitDone = 1
|
---|
1423 | return
|
---|
1424 |
|
---|