Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Commit 35081dc

Browse files
committed
Upload all files
1 parent dfcda84 commit 35081dc

File tree

964 files changed

+131929
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

964 files changed

+131929
-0
lines changed

Ch1/Auto.frm

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
VERSION 5.00
2+
Begin VB.Form frmAuto
3+
Caption = "Auto"
4+
ClientHeight = 4365
5+
ClientLeft = 1140
6+
ClientTop = 1515
7+
ClientWidth = 7095
8+
LinkTopic = "Form1"
9+
PaletteMode = 1 'UseZOrder
10+
ScaleHeight = 4365
11+
ScaleWidth = 7095
12+
Begin VB.PictureBox PaintPict
13+
Height = 4095
14+
Left = 3600
15+
ScaleHeight = 269
16+
ScaleMode = 3 'Pixel
17+
ScaleWidth = 229
18+
TabIndex = 1
19+
Top = 240
20+
Width = 3495
21+
End
22+
Begin VB.PictureBox AutoPict
23+
AutoRedraw = -1 'True
24+
Height = 4095
25+
Left = 0
26+
ScaleHeight = 269
27+
ScaleMode = 3 'Pixel
28+
ScaleWidth = 229
29+
TabIndex = 0
30+
Top = 240
31+
Width = 3495
32+
End
33+
Begin VB.Label Label1
34+
Alignment = 2 'Center
35+
Caption = "Paint Events"
36+
Height = 255
37+
Index = 1
38+
Left = 3600
39+
TabIndex = 3
40+
Top = 0
41+
Width = 3495
42+
End
43+
Begin VB.Label Label1
44+
Alignment = 2 'Center
45+
Caption = "AutoRedraw"
46+
Height = 255
47+
Index = 0
48+
Left = 0
49+
TabIndex = 2
50+
Top = 0
51+
Width = 3495
52+
End
53+
End
54+
Attribute VB_Name = "frmAuto"
55+
Attribute VB_GlobalNameSpace = False
56+
Attribute VB_Creatable = False
57+
Attribute VB_PredeclaredId = True
58+
Attribute VB_Exposed = False
59+
Option Explicit
60+
61+
' Draw squiggly lines.
62+
Private Sub DrawPict(ByVal pic As PictureBox)
63+
Const Amp = 3
64+
Const PI = 3.14159
65+
Const Per = 4 * PI
66+
67+
Dim i As Single
68+
Dim j As Single
69+
Dim hgt As Single
70+
Dim wid As Single
71+
72+
pic.ScaleMode = vbPixels
73+
pic.Cls ' Clear the picture box.
74+
75+
For i = 0 To pic.ScaleHeight Step 4
76+
pic.CurrentX = 0
77+
pic.CurrentY = i
78+
For j = 0 To pic.ScaleWidth
79+
pic.Line -(j, i + Amp * Sin(j / Per))
80+
Next j
81+
Next i
82+
For i = 1 To hgt Step 2
83+
pic.Line (0, i)-(wid, i)
84+
Next i
85+
End Sub
86+
' Draw on the PictureBox with AutoRedraw = True.
87+
Private Sub Form_Load()
88+
DrawPict AutoPict
89+
End Sub
90+
91+
' Draw on the PictureBox with AutoRedraw = False.
92+
Private Sub PaintPict_Paint()
93+
' This makes the other PictureBox refresh
94+
' itself before we start hogging the CPU.
95+
Refresh
96+
97+
DrawPict PaintPict
98+
End Sub

Ch1/Auto.vbp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Type=Exe
2+
Form=Auto.frm
3+
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\WINNT\System32\STDOLE2.TLB#Standard OLE Types
4+
Reference=*\G{00025E04-0000-0000-C000-000000000046}#3.5#0#..\..\..\..\..\..\Program Files\Common Files\Microsoft Shared\DAO\dao2535.tlb#Microsoft DAO 2.5 Object Library
5+
IconForm="frmAuto"
6+
Startup="frmAuto"
7+
Command32=""
8+
Name="Project1"
9+
HelpContextID="0"
10+
CompatibleMode="0"
11+
MajorVer=1
12+
MinorVer=0
13+
RevisionVer=0
14+
AutoIncrementVer=0
15+
ServerSupportFiles=0
16+
VersionCompanyName="Rocky Mountain Computer Consulting, Inc."
17+
CompilationType=0
18+
OptimizationType=0
19+
FavorPentiumPro(tm)=0
20+
CodeViewDebugInfo=0
21+
NoAliasing=0
22+
BoundsCheck=0
23+
OverflowCheck=0
24+
FlPointCheck=0
25+
FDIVCheck=0
26+
UnroundedFP=0
27+
StartMode=0
28+
Unattended=0
29+
Retained=0
30+
ThreadPerObject=0
31+
MaxNumberOfThreads=1

Ch1/Auto.vbw

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
frmAuto = 22, 22, 495, 306, , 22, 22, 494, 347, C

Ch1/Bars.frm

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
VERSION 5.00
2+
Begin VB.Form frmBars
3+
Caption = "Bars"
4+
ClientHeight = 3195
5+
ClientLeft = 60
6+
ClientTop = 345
7+
ClientWidth = 4680
8+
LinkTopic = "Form1"
9+
ScaleHeight = 3195
10+
ScaleWidth = 4680
11+
StartUpPosition = 3 'Windows Default
12+
End
13+
Attribute VB_Name = "frmBars"
14+
Attribute VB_GlobalNameSpace = False
15+
Attribute VB_Creatable = False
16+
Attribute VB_PredeclaredId = True
17+
Attribute VB_Exposed = False
18+
Option Explicit
19+
20+
Private Const NUM_VALUES = 7
21+
Private DataValue(1 To NUM_VALUES) As Integer
22+
' Create some random data.
23+
Private Sub Form_Load()
24+
Dim i As Integer
25+
26+
Randomize
27+
For i = 1 To NUM_VALUES
28+
DataValue(i) = Rnd * 100
29+
Next i
30+
End Sub
31+
32+
33+
' Draw the bar chart.
34+
Private Sub Form_Paint()
35+
Dim i As Integer
36+
37+
' Define the custom coordinate system.
38+
ScaleLeft = 0
39+
ScaleWidth = NUM_VALUES + 2
40+
ScaleTop = 110
41+
ScaleHeight = -120
42+
43+
' Clear the form.
44+
Cls
45+
46+
' Draw the bar chart.
47+
For i = 1 To NUM_VALUES
48+
' Pick a new fill style.
49+
FillStyle = i Mod 8
50+
51+
' Draw a box with i <= X <= i + 1 and
52+
' 0 <= Y <= Data(i).
53+
Line (i, 0)-(i + 1, DataValue(i)), , B
54+
Next i
55+
End Sub
56+
57+

Ch1/Bars.vbp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Type=Exe
2+
Form=Bars.frm
3+
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\WINNT\System32\STDOLE2.TLB#OLE Automation
4+
IconForm="frmBars"
5+
Startup="frmBars"
6+
Command32=""
7+
Name="Project1"
8+
HelpContextID="0"
9+
CompatibleMode="0"
10+
MajorVer=1
11+
MinorVer=0
12+
RevisionVer=0
13+
AutoIncrementVer=0
14+
ServerSupportFiles=0
15+
VersionCompanyName="Rocky Mountain Computer Consulting, Inc."
16+
CompilationType=0
17+
OptimizationType=0
18+
FavorPentiumPro(tm)=0
19+
CodeViewDebugInfo=0
20+
NoAliasing=0
21+
BoundsCheck=0
22+
OverflowCheck=0
23+
FlPointCheck=0
24+
FDIVCheck=0
25+
UnroundedFP=0
26+
StartMode=0
27+
Unattended=0
28+
Retained=0
29+
ThreadPerObject=0
30+
MaxNumberOfThreads=1

Ch1/Bars.vbw

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
frmBars = 0, 0, 0, 0, C, 44, 44, 450, 310, C

Ch1/Bars2.frm

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
VERSION 5.00
2+
Begin VB.Form frmBars2
3+
Caption = "Bars2"
4+
ClientHeight = 3195
5+
ClientLeft = 60
6+
ClientTop = 345
7+
ClientWidth = 4680
8+
LinkTopic = "Form1"
9+
ScaleHeight = 3195
10+
ScaleWidth = 4680
11+
StartUpPosition = 3 'Windows Default
12+
End
13+
Attribute VB_Name = "frmBars2"
14+
Attribute VB_GlobalNameSpace = False
15+
Attribute VB_Creatable = False
16+
Attribute VB_PredeclaredId = True
17+
Attribute VB_Exposed = False
18+
Option Explicit
19+
20+
Private Const NUM_VALUES = 7
21+
Private DataValue(1 To NUM_VALUES) As Integer
22+
' Create some random data.
23+
Private Sub Form_Load()
24+
Dim i As Integer
25+
26+
Randomize
27+
For i = 1 To NUM_VALUES
28+
DataValue(i) = Rnd * 100
29+
Next i
30+
End Sub
31+
32+
33+
' Draw the bar chart.
34+
Private Sub Form_Paint()
35+
Dim i As Integer
36+
37+
' Define the custom coordinate system.
38+
ScaleLeft = 0
39+
ScaleWidth = NUM_VALUES + 2
40+
ScaleTop = 110
41+
ScaleHeight = -120
42+
43+
' Clear the form.
44+
Cls
45+
46+
' Draw the bar chart.
47+
For i = 1 To NUM_VALUES
48+
' Pick a new fill style.
49+
FillStyle = i Mod 8
50+
51+
' Draw a box with i <= X <= i + 1 and
52+
' 0 <= Y <= Data(i).
53+
Line (i, 0)-(i + 1, DataValue(i)), , B
54+
Next i
55+
End Sub
56+
57+

Ch1/Bars2.vbp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Type=Exe
2+
Form=Bars2.frm
3+
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\WINNT\System32\STDOLE2.TLB#OLE Automation
4+
IconForm="frmBars2"
5+
Startup="frmBars2"
6+
Command32=""
7+
Name="Project1"
8+
HelpContextID="0"
9+
CompatibleMode="0"
10+
MajorVer=1
11+
MinorVer=0
12+
RevisionVer=0
13+
AutoIncrementVer=0
14+
ServerSupportFiles=0
15+
VersionCompanyName="Rocky Mountain Computer Consulting, Inc."
16+
CompilationType=0
17+
OptimizationType=0
18+
FavorPentiumPro(tm)=0
19+
CodeViewDebugInfo=0
20+
NoAliasing=0
21+
BoundsCheck=0
22+
OverflowCheck=0
23+
FlPointCheck=0
24+
FDIVCheck=0
25+
UnroundedFP=0
26+
StartMode=0
27+
Unattended=0
28+
Retained=0
29+
ThreadPerObject=0
30+
MaxNumberOfThreads=1

Ch1/Bars2.vbw

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
frmBars2 = 66, 66, 604, 457, , 44, 44, 450, 310, C

Ch1/Bars3.frm

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
VERSION 5.00
2+
Begin VB.Form frmBars3
3+
Caption = "Bars3"
4+
ClientHeight = 3195
5+
ClientLeft = 60
6+
ClientTop = 345
7+
ClientWidth = 4680
8+
LinkTopic = "Form1"
9+
ScaleHeight = 3195
10+
ScaleWidth = 4680
11+
StartUpPosition = 3 'Windows Default
12+
End
13+
Attribute VB_Name = "frmBars3"
14+
Attribute VB_GlobalNameSpace = False
15+
Attribute VB_Creatable = False
16+
Attribute VB_PredeclaredId = True
17+
Attribute VB_Exposed = False
18+
Option Explicit
19+
20+
Private Const NUM_VALUES = 7
21+
Private DataValue(1 To NUM_VALUES) As Integer
22+
23+
' Set the form's Scale properties.
24+
Private Sub SetTheScale(ByVal obj As Object, ByVal upper_left_x As Single, ByVal upper_left_y As Single, ByVal lower_right_x As Single, ByVal lower_right_y As Single)
25+
obj.ScaleLeft = upper_left_x
26+
obj.ScaleTop = upper_left_y
27+
obj.ScaleWidth = lower_right_x - upper_left_x
28+
obj.ScaleHeight = lower_right_y - upper_left_y
29+
End Sub
30+
' Create some random data.
31+
Private Sub Form_Load()
32+
Dim i As Integer
33+
34+
Randomize
35+
For i = 1 To NUM_VALUES
36+
DataValue(i) = Rnd * 100
37+
Next i
38+
End Sub
39+
40+
41+
' Draw the bar chart.
42+
Private Sub Form_Paint()
43+
Dim i As Integer
44+
Dim wid As Single
45+
Dim hgt As Single
46+
47+
' Define the custom coordinate system.
48+
SetTheScale Me, 0, 110, NUM_VALUES + 2, -10
49+
50+
' Clear the form.
51+
Cls
52+
53+
' Draw the bar chart.
54+
For i = 1 To NUM_VALUES
55+
' Pick a new fill style.
56+
FillStyle = i Mod 8
57+
58+
' Draw a box with i <= X <= i + 1 and
59+
' 0 <= Y <= Data(i).
60+
Line (i, 0)-(i + 1, DataValue(i)), , B
61+
Next i
62+
63+
' Draw a 5 by 5 pixel box at position
64+
' (NUM_VALUES / 2 + 1, 50).
65+
wid = ScaleX(5, vbPixels, ScaleMode)
66+
hgt = ScaleY(5, vbPixels, ScaleMode)
67+
Line (NUM_VALUES / 2 + 1, 50)-Step(wid, hgt), vbRed, BF
68+
End Sub
69+
70+

0 commit comments

Comments
 (0)