-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrmMain.frm
More file actions
934 lines (886 loc) · 30.3 KB
/
frmMain.frm
File metadata and controls
934 lines (886 loc) · 30.3 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmMain
Caption = "ANSI Express"
ClientHeight = 4500
ClientLeft = 165
ClientTop = 450
ClientWidth = 9600
Icon = "frmMain.frx":0000
LinkTopic = "Form1"
ScaleHeight = 4500
ScaleWidth = 9600
StartUpPosition = 2 'CenterScreen
Begin VB.Timer tmrBlink
Interval = 200
Left = 480
Top = 1200
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 480
Top = 600
_ExtentX = 847
_ExtentY = 847
_Version = 393216
CancelError = -1 'True
DialogTitle = "Open ANSI"
Filter = "ANSI Files (*.ans;*.asc; *.txt; *.vt)|*.ANS;*.ASC;*.TXT;*.VT|All Files (*.*)|*.*"
End
Begin VB.PictureBox picNorm
AutoRedraw = -1 'True
BackColor = &H00000000&
BorderStyle = 0 'None
BeginProperty Font
Name = "Terminal"
Size = 9
Charset = 255
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 4500
Left = 0
ScaleHeight = 300
ScaleMode = 0 'User
ScaleWidth = 640
TabIndex = 0
Top = 0
Width = 9600
End
Begin VB.PictureBox picBlnk
AutoRedraw = -1 'True
BackColor = &H00000000&
BorderStyle = 0 'None
BeginProperty Font
Name = "Terminal"
Size = 9
Charset = 255
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 4500
Left = 0
ScaleHeight = 300
ScaleMode = 0 'User
ScaleWidth = 640
TabIndex = 1
Top = 0
Width = 9600
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuOpen
Caption = "&Open ANSI..."
Shortcut = ^O
End
Begin VB.Menu mnuDash2
Caption = "-"
End
Begin VB.Menu mnuCopy
Caption = "&Copy Screen to Clipboard"
Shortcut = ^C
End
Begin VB.Menu mnuDash1
Caption = "-"
End
Begin VB.Menu mnuPrint
Caption = "&Print..."
Shortcut = ^P
End
Begin VB.Menu mnuDash3
Caption = "-"
End
Begin VB.Menu mnuExit
Caption = "E&xit"
Shortcut = ^X
End
End
Begin VB.Menu mnuView
Caption = "&Tools"
Begin VB.Menu mnuDraw
Caption = "Draw &Speed"
Begin VB.Menu mnuSpeed
Caption = "300 baud"
Index = 0
End
Begin VB.Menu mnuSpeed
Caption = "1200 baud"
Index = 1
End
Begin VB.Menu mnuSpeed
Caption = "2400 baud"
Index = 2
End
Begin VB.Menu mnuSpeed
Caption = "9600 baud"
Index = 3
End
Begin VB.Menu mnuSpeed
Caption = "14400 baud"
Index = 4
End
Begin VB.Menu mnuSpeed
Caption = "28800 baud"
Index = 5
End
Begin VB.Menu mnuSpeed
Caption = "33600 baud"
Index = 6
End
Begin VB.Menu mnuSpeed
Caption = "56700 baud"
Index = 7
End
Begin VB.Menu mnuSpeed
Caption = "Other..."
Index = 8
End
Begin VB.Menu mnuSpeed
Caption = "Unlimited"
Index = 9
End
End
Begin VB.Menu mnuTerminal
Caption = "&Text Size"
Begin VB.Menu mnuVerySmall
Caption = "Very Small"
End
Begin VB.Menu mnuSmall
Caption = "Small"
End
Begin VB.Menu mnuNormal
Caption = "Normal"
Checked = -1 'True
End
Begin VB.Menu mnuLarge
Caption = "Large"
End
Begin VB.Menu mnuVeryLarge
Caption = "Very Large"
End
End
Begin VB.Menu mnuAttrib
Caption = "&Text Attributes"
Begin VB.Menu mnuBold
Caption = "&Bold"
End
Begin VB.Menu mnuItalic
Caption = "&Italic"
End
End
Begin VB.Menu mnuDash5
Caption = "-"
End
Begin VB.Menu mnuScreen
Caption = "&Screen Size..."
End
Begin VB.Menu mnuRate
Caption = "&Blink Rate..."
End
Begin VB.Menu mnuDash4
Caption = "-"
End
Begin VB.Menu mnuClear
Caption = "&Clear Screen"
Shortcut = {F2}
End
Begin VB.Menu mnuRedraw
Caption = "&Redraw Screen"
Shortcut = {F5}
End
Begin VB.Menu mnuDash6
Caption = "-"
End
Begin VB.Menu mnuAbout
Caption = "&About ANSI Express..."
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'http://barney.cs.uni-potsdam.de/pipermail/kmud/1999-October/000008.html
'Something like:
' Set to GetTickCount before starting. Then before each character:
Dim x As Integer, Y As Integer, iLastColor As Long
Dim SaveX As Integer, SaveY As Integer, f As String
Dim xOffSet As Integer, yOffSet As Integer
Public xScreenSize As Integer, yScreenSize As Integer
Dim bFontBold As Boolean, bFontItalic As Boolean
Dim bBlinkUsed As Boolean
Dim MyTime As Double, TempTime As Double
Public DisplayRate As Long
Dim ScrollTop As Integer, ScrollBottom As Integer, iLines As Integer
Public Sub Display(data As String)
Dim c
Dim tx As Integer, ty As Integer
Dim bEscMode As Boolean
Dim bBold As Boolean
Dim bBlink As Boolean
Dim sCmd As String
Dim Commands() As String
MyTime = Timer
iLines = 0
ScrollTop = 1
ScrollBottom = yScreenSize
bEscMode = False
bBold = False
bBlink = False
bBlinkUsed = False
picBlnk.Visible = False
picNorm.Visible = True
sCmd = ""
For i = 1 To Len(data)
If DisplayRate > 0 Then
TempTime = Timer ' Don't know if you need ()
If TempTime < MyTime Then
DoEvents
TempTime = Timer
If (MyTime > TempTime + 0.005) Then
Sleep 1000 * (MyTime - TempTime)
DoEvents
End If
End If
If DisplayRate > 0 Then MyTime = MyTime + (10# / DisplayRate)
End If
c = Mid(data, i, 1)
If c = Chr(27) Then
bEscMode = True
ElseIf bEscMode = True Then
If c <> "[" Then
Select Case c
Case "m"
Commands = Split(sCmd, ";")
sCmd = ""
For Each cmd In Commands
If cmd <> "" Then
Select Case cmd
Case 0
picNorm.ForeColor = QBColor(7)
picNorm.FillColor = QBColor(0)
picBlnk.ForeColor = QBColor(7)
picBlnk.FillColor = QBColor(0)
iLastColor = 7
bBold = False
bBlink = False
Case 1
picNorm.ForeColor = GetColor(iLastColor + 8)
picBlnk.ForeColor = GetColor(iLastColor + 8)
bBold = True
Case 5
bBlink = True
bBlinkUsed = True
Case 30 To 37
If bBold = False Then
picNorm.ForeColor = GetColor(cmd - 30)
picBlnk.ForeColor = GetColor(cmd - 30)
Else
picNorm.ForeColor = GetColor((cmd - 30) + 8)
picBlnk.ForeColor = GetColor(cmd - 30)
End If
iLastColor = cmd - 30
Case 40 To 47
picNorm.FillColor = GetColor(cmd - 40)
picBlnk.FillColor = GetColor(cmd - 40)
End Select
End If
Next
bEscMode = False
Case "A"
If sCmd = "" Then
Y = Y - yOffSet
ElseIf IsNumeric(sCmd) = True Then
Y = Y - (sCmd * yOffSet)
End If
bEscMode = False
sCmd = ""
Case "B"
If sCmd = "" Then
Y = Y + yOffSet
iLines = iLines + 1
ElseIf IsNumeric(sCmd) = True Then
Y = Y + (sCmd * yOffSet)
iLines = iLines + sCmd
End If
bEscMode = False
sCmd = ""
Case "C"
If sCmd = "" Then
x = x + xOffSet
ElseIf IsNumeric(sCmd) = True Then
x = x + (sCmd * xOffSet)
End If
bEscMode = False
sCmd = ""
Case "D"
If sCmd = "" Then
x = x - xOffSet
ElseIf IsNumeric(sCmd) = True Then
x = x - (sCmd * xOffSet)
End If
If x < 0 Then x = 0
bEscMode = False
sCmd = ""
Case "L"
If sCmd = "" Then sCmd = 1
BitBlt picNorm.hDC, 0, Y + (yOffSet * sCmd), xOffSet * xScreenSize, (yOffSet * yScreenSize) * sCmd, picNorm.hDC, 0, Y, vbSrcCopy
BitBlt picBlnk.hDC, 0, Y + (yOffSet * sCmd), xOffSet * xScreenSize, (yOffSet * yScreenSize) * sCmd, picBlnk.hDC, 0, Y, vbSrcCopy
picNorm.Line (0, Y)-(xOffSet * xScreenSize, (Y + (yOffSet * sCmd)) - 1), picNorm.FillColor, BF
picBlnk.Line (0, Y)-(xOffSet * xScreenSize, (Y + (yOffSet * sCmd)) - 1), picBlnk.FillColor, BF
bEscMode = False
sCmd = ""
Case "M", "Y"
Case "H"
'sCmd = Replace(sCmd, "(", "")
If sCmd <> "" Then
l = InStr(1, sCmd, ";")
If l = 0 Then
Y = (sCmd - 1) * yOffSet
x = 0
ElseIf l = 1 Then
If sCmd = ";" Then
x = 0
Y = 0
Else
x = (Mid(sCmd, 2) - 1) * xOffSet
Y = 0
End If
Else
Y = CInt((Mid(sCmd, 1, l - 1)) - 1) * yOffSet
x = CInt((Mid(sCmd, l + 1)) - 1) * xOffSet
End If
Else
x = 0
Y = 0
End If
bEscMode = False
sCmd = ""
Case "K"
If sCmd = "" Or sCmd = "0" Then
picNorm.Line (x, Y)-(xOffSet * xScreenSize, Y + yOffSet - 1), picNorm.FillColor, BF
picBlnk.Line (x, Y)-(xOffSet * xScreenSize, Y + yOffSet - 1), picNorm.FillColor, BF
ElseIf sCmd = 1 Then
picNorm.Line (0, Y)-(x, Y + yOffSet - 1), picNorm.FillColor, BF
picBlnk.Line (0, Y)-(x, Y + yOffSet - 1), picNorm.FillColor, BF
ElseIf sCmd = 2 Then
picNorm.Line (0, Y)-(xOffSet * xScreenSize, Y + yOffSet - 1), picNorm.FillColor, BF
picBlnk.Line (0, Y)-(xOffSet * xScreenSize, Y + yOffSet - 1), picNorm.FillColor, BF
End If
Case "u"
x = SaveX
Y = SaveY
bEscMode = False
sCmd = ""
Case "s"
SaveX = x
SaveY = Y
bEscMode = False
sCmd = ""
Case "L"
scrollup 1, ScrollTop, ScrollBottom
bEscMode = False
sCmd = ""
Case "M"
scrolldown 1, ScrollTop, ScrollBottom
bEscMode = False
sCmd = ""
Case "J"
picNorm.Cls
picBlnk.Cls
x = 0
Y = 0
bEscMode = False
sCmd = ""
Case "r"
If sCmd = "" Then
ScrollTop = 1
ScrollBottom = yScreenSize
Else
l = InStr(1, sCmd, ";")
If l = 0 Then
ScrollTop = sCmd
ScrollBottom = yScreenSize
Else
ScrollTop = Mid(sCmd, 1, l - 1)
ScrollBottom = Mid(sCmd, l + 1)
End If
End If
bEscMode = False
sCmd = ""
Case "l", "h"
bEscMode = False
sCmd = ""
Case Is > "?"
'MsgBox "unrecognized command: " & sCmd & c
bEscMode = False
sCmd = ""
Case Else
sCmd = sCmd & c
End Select
End If
ElseIf c = Chr(13) Or c = Chr(10) Then
picNorm.CurrentX = x
picNorm.CurrentY = Y
picBlnk.CurrentX = x
picBlnk.CurrentY = Y
x = 0
Y = Y + yOffSet
iLines = iLines + 1
If Y > ((yOffSet * ScrollBottom) - yOffSet) Then
scrollup 1, ScrollTop, ScrollBottom
Y = yOffSet * (ScrollBottom - 1)
End If
Else
If x >= (xOffSet * xScreenSize) Then
x = 0
Y = Y + yOffSet
iLines = iLines + 1
End If
If Y > ((yOffSet * ScrollBottom) - yOffSet) Then
scrollup 1, ScrollTop, ScrollBottom
Y = yOffSet * (ScrollBottom - 1)
End If
picNorm.Line (x, Y)-(x + (xOffSet - 1), Y + (yOffSet - 1)), picNorm.FillColor, BF
picNorm.CurrentX = x
picNorm.CurrentY = Y
picNorm.Print c
picBlnk.Line (x, Y)-(x + (xOffSet - 1), Y + (yOffSet - 1)), picBlnk.FillColor, BF
picBlnk.CurrentX = x
picBlnk.CurrentY = Y
picBlnk.ForeColor = picNorm.ForeColor
If bBlink = False Then picBlnk.Print c
x = x + xOffSet
tx = x / xOffSet
ty = Y / yOffSet
End If
Next i
If bBlinkUsed = True Then tmrBlink.Enabled = True
End Sub
Private Function GetColor(clr As Integer) As Long
Select Case clr
Case 0
GetColor = QBColor(0)
Case 1
GetColor = QBColor(4)
Case 2
GetColor = QBColor(2)
Case 3
GetColor = QBColor(6)
Case 4
GetColor = QBColor(1)
Case 5
GetColor = QBColor(5)
Case 6
GetColor = QBColor(3)
Case 7
GetColor = QBColor(7)
Case 8
GetColor = QBColor(8)
Case 9
GetColor = QBColor(12)
Case 10
GetColor = QBColor(10)
Case 11
GetColor = QBColor(14)
Case 12
GetColor = QBColor(9)
Case 13
GetColor = QBColor(13)
Case 14
GetColor = QBColor(11)
Case 15
GetColor = QBColor(15)
End Select
End Function
Private Sub Form_Load()
On Error GoTo Err_Handler
RegApp
picNorm.ForeColor = GetColor(7)
picBlnk.ForeColor = GetColor(7)
picNorm.FontSize = 9
picBlnk.FontSize = 9
xOffSet = GetSetting("ASNIExpress", "Settings", "xOffSet", 8)
yOffSet = GetSetting("ASNIExpress", "Settings", "yOffSet", 12)
xScreenSize = GetSetting("ASNIExpress", "Settings", "xScreenSize", 80)
yScreenSize = GetSetting("ASNIExpress", "Settings", "yScreenSize", 24)
ScrollTop = 1
ScrollBottom = yScreenSize
bFontBold = GetSetting("ASNIExpress", "Settings", "FontBold", False)
mnuBold.Checked = bFontBold
bFontItalic = GetSetting("ASNIExpress", "Settings", "FontItalic", False)
mnuItalic.Checked = bFontItalic
tmrBlink.Interval = GetSetting("ASNIExpress", "Settings", "BlinkRate", 200)
DisplayRate = GetSetting("ASNIExpress", "Settings", "DisplayRate", 0)
Select Case DisplayRate
Case 300
mnuSpeed(0).Checked = True
Case 1200
mnuSpeed(1).Checked = True
Case 2400
mnuSpeed(2).Checked = True
Case 9600
mnuSpeed(3).Checked = True
Case 14400
mnuSpeed(4).Checked = True
Case 28800
mnuSpeed(5).Checked = True
Case 33600
mnuSpeed(6).Checked = True
Case 56700
mnuSpeed(7).Checked = True
Case 0
mnuSpeed(9).Checked = True
Case Else
mnuSpeed(8).Checked = True
End Select
Select Case GetSetting("ASNIExpress", "Settings", "TextSize", 3)
Case 1
mnuVerySmall_Click
Case 2
mnuSmall_Click
Case 3
mnuNormal_Click
Case 4
mnuLarge_Click
Case 5
mnuVeryLarge_Click
End Select
If Command <> "" Then
Me.Show
DoEvents
Dim t As String
x = 0
Y = 0
picNorm.Cls
picNorm.CurrentX = 0
picNorm.CurrentY = 0
picBlnk.Cls
picBlnk.CurrentX = 0
picBlnk.CurrentY = 0
SaveX = 0
SaveY = 0
f = ""
Open Command For Input As #1
Do While Not EOF(1)
Line Input #1, t
f = f & t & vbCr
Loop
Close #1
f = Left(f, Len(f) - 1)
f = Replace(f, "[?7h", "")
Display f
End If
Exit Sub
Err_Handler:
If Err.Number <> 32755 Then
MsgBox Err.Description, vbCritical, "Error opening file"
End If
End Sub
Private Sub mnuAbout_Click()
MsgBox "ANSI Express version 1.2" & vbCr & vbCr & "(C) 2004-2008 Strinum Software" & vbCr & vbCr & "support@strinum.com" & vbCr & vbCr & "http://www.strinum.com", vbInformation, "About ANSI Express"
End Sub
Private Sub mnuBold_Click()
If bFontBold = False Then
bFontBold = True
mnuBold.Checked = True
SaveSetting "ASNIExpress", "Settings", "FontBold", True
Else
bFontBold = False
mnuBold.Checked = False
SaveSetting "ASNIExpress", "Settings", "FontBold", False
End If
AdjustScreen
End Sub
Private Sub mnuClear_Click()
picNorm.Cls
picBlnk.Cls
picNorm.CurrentX = 0
picNorm.CurrentY = 0
picBlnk.CurrentX = 0
picBlnk.CurrentY = 0
x = 0
Y = 0
End Sub
Private Sub mnuCopy_Click()
DoEvents
Dim b As Picture
Set b = CaptureWindow(picNorm.hwnd, True, 0, 0, xOffSet * xScreenSize, yOffSet * yScreenSize)
Clipboard.Clear
Clipboard.SetData b
End Sub
Private Sub mnuExit_Click()
End
End Sub
Private Sub mnuItalic_Click()
If bFontItalic = False Then
bFontItalic = True
mnuItalic.Checked = True
SaveSetting "ASNIExpress", "Settings", "FontItalic", True
Else
bFontItalic = False
mnuItalic.Checked = False
SaveSetting "ASNIExpress", "Settings", "FontItalic", False
End If
AdjustScreen
End Sub
Private Sub mnuOpen_Click()
On Error GoTo Err_Handler
Dim t As String
CommonDialog1.ShowOpen
x = 0
Y = 0
picNorm.Cls
picNorm.CurrentX = 0
picNorm.CurrentY = 0
picBlnk.Cls
picBlnk.CurrentX = 0
picBlnk.CurrentY = 0
SaveX = 0
SaveY = 0
f = ""
Open CommonDialog1.FileName For Input As #1
Do While Not EOF(1)
Line Input #1, t
f = f & t & vbCr
Loop
Close #1
f = Left(f, Len(f) - 1)
f = Replace(f, "[?7h", "")
Display f
Exit Sub
Err_Handler:
If Err.Number <> 32755 Then
MsgBox Err.Description, vbCritical, "Error opening file"
End If
End Sub
Private Sub mnuPrint_Click()
On Error GoTo Err_Handler
Dim b As Picture
Set b = CaptureWindow(picNorm.hwnd, True, 0, 0, xOffSet * xScreenSize, yOffSet * yScreenSize)
CommonDialog1.Flags = cdlPDSelection
CommonDialog1.ShowPrinter
Printer.PaintPicture b, 0, 0
Printer.EndDoc
Exit Sub
Err_Handler:
If Err.Number <> 32755 Then
MsgBox Err.Description, vbCritical, "Error opening file"
End If
End Sub
Private Sub mnuRate_Click()
frmBlinkRate.Show 1
End Sub
Private Sub mnuRedraw_Click()
picNorm.Cls
picBlnk.Cls
picNorm.CurrentX = 0
picNorm.CurrentY = 0
picBlnk.CurrentX = 0
picBlnk.CurrentY = 0
x = 0
Y = 0
Display f
End Sub
Private Sub mnuScreen_Click()
Dim tx, ty
tx = xScreenSize
ty = yScreenSize
frmScreenSize.Show 1
If tx <> xScreenSize Or ty <> yScreenSize Then
ScrollTop = 1
ScrollBottom = yScreenSize
AdjustScreen
End If
End Sub
Private Sub mnuSpeed_Click(Index As Integer)
Select Case Index
Case 0
DisplayRate = 300
Case 1
DisplayRate = 1200
Case 2
DisplayRate = 2400
Case 3
DisplayRate = 9600
Case 4
DisplayRate = 14400
Case 5
DisplayRate = 28800
Case 6
DisplayRate = 33600
Case 7
DisplayRate = 56700
Case 8
frmDisplayRate.Show 1
Case 9
DisplayRate = 0
End Select
For i = 0 To 9
mnuSpeed(i).Checked = False
Next i
Select Case DisplayRate
Case 300
mnuSpeed(0).Checked = True
Case 1200
mnuSpeed(1).Checked = True
Case 2400
mnuSpeed(2).Checked = True
Case 9600
mnuSpeed(3).Checked = True
Case 14400
mnuSpeed(4).Checked = True
Case 28800
mnuSpeed(5).Checked = True
Case 33600
mnuSpeed(6).Checked = True
Case 56700
mnuSpeed(7).Checked = True
Case 0
mnuSpeed(9).Checked = True
Case Else
mnuSpeed(8).Checked = True
End Select
SaveSetting "ASNIExpress", "Settings", "DisplayRate", DisplayRate
mnuRedraw_Click
End Sub
Private Sub mnuVerySmall_Click()
mnuVerySmall.Checked = True
mnuSmall.Checked = False
mnuNormal.Checked = False
mnuLarge.Checked = False
mnuVeryLarge.Checked = False
SaveSetting "ASNIExpress", "Settings", "TextSize", 1
picNorm.FontSize = 5
picBlnk.FontSize = 5
xOffSet = 4
yOffSet = 6
AdjustScreen
End Sub
Private Sub mnuSmall_Click()
mnuVerySmall.Checked = False
mnuSmall.Checked = True
mnuNormal.Checked = False
mnuLarge.Checked = False
mnuVeryLarge.Checked = False
SaveSetting "ASNIExpress", "Settings", "TextSize", 2
picNorm.FontSize = 6
picBlnk.FontSize = 6
xOffSet = 6
yOffSet = 8
AdjustScreen
End Sub
Private Sub mnuNormal_Click()
mnuVerySmall.Checked = False
mnuSmall.Checked = False
mnuNormal.Checked = True
mnuLarge.Checked = False
mnuVeryLarge.Checked = False
SaveSetting "ASNIExpress", "Settings", "TextSize", 3
picNorm.FontSize = 9
picBlnk.FontSize = 9
xOffSet = 8
yOffSet = 12
AdjustScreen
End Sub
Private Sub mnuLarge_Click()
mnuVerySmall.Checked = False
mnuSmall.Checked = False
mnuNormal.Checked = False
mnuLarge.Checked = True
mnuVeryLarge.Checked = False
SaveSetting "ASNIExpress", "Settings", "TextSize", 4
picNorm.FontSize = 14
picBlnk.FontSize = 14
xOffSet = 10
yOffSet = 18
AdjustScreen
End Sub
Private Sub mnuVeryLarge_Click()
mnuVerySmall.Checked = False
mnuSmall.Checked = False
mnuNormal.Checked = False
mnuLarge.Checked = False
mnuVeryLarge.Checked = True
SaveSetting "ASNIExpress", "Settings", "TextSize", 5
picNorm.FontSize = 12
picBlnk.FontSize = 12
xOffSet = 12
yOffSet = 16
AdjustScreen
End Sub
Public Sub AdjustScreen()
On Error Resume Next
picNorm.FontBold = bFontBold
picNorm.FontItalic = bFontItalic
picNorm.Width = (xOffSet * xScreenSize) * 15
picNorm.Height = (yOffSet * yScreenSize) * 15
Me.Width = picNorm.Width + 120
Me.Height = picNorm.Height + 690
picBlnk.FontBold = bFontBold
picBlnk.FontItalic = bFontItalic
picBlnk.Width = (xOffSet * xScreenSize) * 15
picBlnk.Height = (yOffSet * yScreenSize) * 15
x = 0
Y = 0
picNorm.Cls
picNorm.CurrentX = 0
picNorm.CurrentY = 0
picBlnk.Cls
picBlnk.CurrentX = 0
picBlnk.CurrentY = 0
SaveX = 0
SaveY = 0
Display f
End Sub
Private Sub tmrBlink_Timer()
If picNorm.Visible = True Then
picNorm.Visible = False
picBlnk.Visible = True
Else
picNorm.Visible = True
picBlnk.Visible = False
End If
End Sub
Public Sub scrollup(numlines As Integer, Top As Integer, bot As Integer)
If numlines >= bot - Top + 1 Then
' Just clear from top to bottom
picNorm.Line (0, yOffSet * (Top - 1))-(xOffSet * xScreenSize, yOffSet * (bot)), picNorm.FillColor, BF
picBlnk.Line (0, yOffSet * (Top - 1))-(xOffSet * xScreenSize, yOffSet * (bot)), picBlnk.FillColor, BF
Else
' Copy bot-top+1 - numlines lines from (top+numlines) to (top)
BitBlt picNorm.hDC, 0, (Top - 1) * yOffSet, xOffSet * xScreenSize, _
yOffSet * (bot - Top + 1 - numlines), picNorm.hDC, 0, yOffSet * (Top + numlines - 1), vbSrcCopy
BitBlt picBlnk.hDC, 0, (Top - 1) * yOffSet, xOffSet * xScreenSize, _
yOffSet * (bot - Top + 1 - numlines), picBlnk.hDC, 0, yOffSet * (Top + numlines - 1), vbSrcCopy
' Erase lines bot-numlines to bot
picNorm.Line (0, yOffSet * (bot - numlines))-(xOffSet * xScreenSize, yOffSet * (bot)), picNorm.FillColor, BF
picBlnk.Line (0, yOffSet * (bot - numlines))-(xOffSet * xScreenSize, yOffSet * (bot)), picBlnk.FillColor, BF
End If
End Sub
Public Sub scrolldown(numlines As Integer, Top As Integer, bot As Integer)
If numlines >= bot - Top + 1 Then
' Just clear from top to bottom
picNorm.Line (0, yOffSet * (Top - 1))-(xOffSet * xScreenSize, yOffSet * (bot)), picNorm.FillColor, BF
picBlnk.Line (0, yOffSet * (Top - 1))-(xOffSet * xScreenSize, yOffSet * (bot)), picBlnk.FillColor, BF
Else
' Copy bot-top+1 - numlines lines from (top+numlines) to (top)
BitBlt picNorm.hDC, 0, yOffSet * (Top + numlines - 1), xOffSet * xScreenSize, _
yOffSet * (bot - Top + 1 - numlines), picNorm.hDC, 0, (Top - 1) * yOffSet, vbSrcCopy
BitBlt picBlnk.hDC, 0, yOffSet * (Top + numlines - 1), xOffSet * xScreenSize, _
yOffSet * (bot - Top + 1 - numlines), picBlnk.hDC, 0, (Top - 1) * yOffSet, vbSrcCopy
' Erase lines bot-numlines to bot
picNorm.Line (0, yOffSet * (Top - 1))-(xOffSet * xScreenSize, yOffSet * (Top + numlines - 1)), picNorm.FillColor, BF
picBlnk.Line (0, yOffSet * (Top - 1))-(xOffSet * xScreenSize, yOffSet * (Top + numlines - 1)), picBlnk.FillColor, BF
End If
End Sub
Public Sub Scroll()
BitBlt picNorm.hDC, 0, 0, xOffSet * xScreenSize, (((yOffSet * yScreenSize) - yOffSet)), picNorm.hDC, 0, yOffSet, vbSrcCopy
BitBlt picBlnk.hDC, 0, 0, xOffSet * xScreenSize, (((yOffSet * yScreenSize) - yOffSet)), picBlnk.hDC, 0, yOffSet, vbSrcCopy
picNorm.Line (0, (yOffSet * yScreenSize) - yOffSet)-(xOffSet * xScreenSize, yOffSet * yScreenSize), picNorm.FillColor, BF
picBlnk.Line (0, (yOffSet * yScreenSize) - yOffSet)-(xOffSet * xScreenSize, yOffSet * yScreenSize), picBlnk.FillColor, BF
End Sub