home *** CD-ROM | disk | FTP | other *** search
/ Beginning Mac Programming / Beginning Mac Programming.bin / pc / Open Me for REALbasic 3 / REALbasic 3.2 / Example Projects / Techniques / ZegsRule / GraphicRuler < prev    next >
Unknown  |  2000-04-28  |  10.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text


This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
100% file data default
100% TrID PGN (Portable Gaming Notation) Compressed format default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 05 43 6c 61 73 73 0c 47 | 72 61 70 68 69 63 52 75 |.Class.G|raphicRu|
|00000010| 6c 65 72 86 03 8c 02 b8 | 0c 8f 09 07 00 0c 47 72 |ler.....|......Gr|
|00000020| 61 70 68 69 63 52 75 6c | 65 72 90 03 05 52 75 6c |aphicRul|er...Rul|
|00000030| 65 72 00 06 14 72 75 6c | 65 72 54 79 70 65 20 61 |er...rul|erType a|
|00000040| 73 20 69 6e 74 65 67 65 | 72 04 13 72 75 6c 65 72 |s intege|r..ruler|
|00000050| 50 69 63 20 61 73 20 70 | 69 63 74 75 72 65 00 18 |Pic as p|icture..|
|00000060| 63 75 72 72 65 6e 74 48 | 65 69 67 68 74 20 61 73 |currentH|eight as|
|00000070| 20 69 6e 74 65 67 65 72 | 00 17 63 75 72 72 65 6e | integer|..curren|
|00000080| 74 57 69 64 74 68 20 61 | 73 20 69 6e 74 65 67 65 |tWidth a|s intege|
|00000090| 72 00 11 6f 66 66 73 65 | 74 20 61 73 20 69 6e 74 |r..offse|t as int|
|000000a0| 65 67 65 72 00 12 70 6f | 73 69 74 69 6f 6e 20 61 |eger..po|sition a|
|000000b0| 73 20 64 6f 75 62 6c 65 | 00 0e 06 49 6e 63 68 31 |s double|...Inch1|
|000000c0| 30 00 00 00 3f 0c 3f 0c | af 01 0c 53 75 62 20 49 |0...?.?.|...Sub I|
|000000d0| 6e 63 68 31 30 28 29 2d | 27 20 64 72 61 77 20 61 |nch10()-|' draw a|
|000000e0| 6e 20 69 6e 63 68 20 72 | 75 6c 65 72 20 77 69 74 |n inch r|uler wit|
|000000f0| 68 20 31 2f 31 30 20 69 | 6e 63 68 20 64 69 76 69 |h 1/10 i|nch divi|
|00000100| 73 69 6f 6e 73 00 0c 49 | 6e 69 74 52 75 6c 65 72 |sions..I|nitRuler|
|00000110| 20 37 32 10 64 72 61 77 | 46 72 61 6d 65 20 3d 20 | 72.draw|Frame = |
|00000120| 74 72 75 65 00 13 69 66 | 20 73 63 61 6c 65 20 3c |true..if| scale <|
|00000130| 20 2e 30 33 20 74 68 65 | 6e 06 72 65 74 75 72 6e | .03 the|n.return|
|00000140| 00 17 65 6c 73 65 69 66 | 20 73 63 61 6c 65 20 3c |..elseif| scale <|
|00000150| 20 2e 30 34 20 74 68 65 | 6e 00 15 53 65 74 4d 61 | .04 the|n..SetMa|
|00000160| 6a 6f 72 28 35 30 2c 31 | 2c 30 2c 74 72 75 65 29 |jor(50,1|,0,true)|
|00000170| 14 53 65 74 54 65 78 74 | 28 35 30 2c 66 61 6c 73 |.SetText|(50,fals|
|00000180| 65 2c 22 22 29 00 10 53 | 65 74 4d 69 6e 6f 72 28 |e,"")..S|etMinor(|
|00000190| 31 30 2c 33 2c 32 29 0f | 53 65 74 4d 69 6e 6f 72 |10,3,2).|SetMinor|
|000001a0| 28 35 2c 35 2c 35 29 00 | 17 65 6c 73 65 69 66 20 |(5,5,5).|.elseif |
|000001b0| 73 63 61 6c 65 20 3c 20 | 2e 30 36 20 74 68 65 6e |scale < |.06 then|
|000001c0| 00 15 53 65 74 4d 61 6a | 6f 72 28 32 30 2c 31 2c |..SetMaj|or(20,1,|
|000001d0| 30 2c 74 72 75 65 29 14 | 53 65 74 54 65 78 74 28 |0,true).|SetText(|
|000001e0| 32 30 2c 66 61 6c 73 65 | 2c 22 22 29 00 11 53 65 |20,false|,"")..Se|
|000001f0| 74 4d 69 6e 6f 72 28 31 | 30 2c 35 2c 31 30 29 00 |tMinor(1|0,5,10).|
|00000200| 17 65 6c 73 65 69 66 20 | 73 63 61 6c 65 20 3c 20 |.elseif |scale < |
|00000210| 2e 31 30 20 74 68 65 6e | 00 15 53 65 74 4d 61 6a |.10 then|..SetMaj|
|00000220| 6f 72 28 31 30 2c 31 2c | 30 2c 74 72 75 65 29 14 |or(10,1,|0,true).|
|00000230| 53 65 74 54 65 78 74 28 | 31 30 2c 66 61 6c 73 65 |SetText(|10,false|
|00000240| 2c 22 22 29 00 11 53 65 | 74 4d 69 6e 6f 72 28 31 |,"")..Se|tMinor(1|
|00000250| 30 2c 35 2c 31 30 29 00 | 17 65 6c 73 65 69 66 20 |0,5,10).|.elseif |
|00000260| 73 63 61 6c 65 20 3c 20 | 2e 31 35 20 74 68 65 6e |scale < |.15 then|
|00000270| 00 14 53 65 74 4d 61 6a | 6f 72 28 35 2c 31 2c 30 |..SetMaj|or(5,1,0|
|00000280| 2c 74 72 75 65 29 13 53 | 65 74 54 65 78 74 28 35 |,true).S|etText(5|
|00000290| 2c 66 61 6c 73 65 2c 22 | 22 29 00 0f 53 65 74 4d |,false,"|")..SetM|
|000002a0| 69 6e 6f 72 28 35 2c 35 | 2c 35 29 00 17 65 6c 73 |inor(5,5|,5)..els|
|000002b0| 65 69 66 20 73 63 61 6c | 65 20 3c 20 2e 33 30 20 |eif scal|e < .30 |
|000002c0| 74 68 65 6e 00 14 53 65 | 74 4d 61 6a 6f 72 28 35 |then..Se|tMajor(5|
|000002d0| 2c 31 2c 30 2c 74 72 75 | 65 29 13 53 65 74 54 65 |,1,0,tru|e).SetTe|
|000002e0| 78 74 28 35 2c 66 61 6c | 73 65 2c 22 22 29 00 0f |xt(5,fal|se,"")..|
|000002f0| 53 65 74 4d 69 6e 6f 72 | 28 35 2c 38 2c 35 29 10 |SetMinor|(5,8,5).|
|00000300| 53 65 74 4d 69 6e 6f 72 | 28 31 30 2c 35 2c 32 29 |SetMinor|(10,5,2)|
|00000310| 00 17 65 6c 73 65 69 66 | 20 73 63 61 6c 65 20 3c |..elseif| scale <|
|00000320| 20 2e 35 30 20 74 68 65 | 6e 00 14 53 65 74 4d 61 | .50 the|n..SetMa|
|00000330| 6a 6f 72 28 32 2c 31 2c | 30 2c 74 72 75 65 29 13 |jor(2,1,|0,true).|
|00000340| 53 65 74 54 65 78 74 28 | 32 2c 66 61 6c 73 65 2c |SetText(|2,false,|
|00000350| 22 22 29 00 0f 53 65 74 | 4d 69 6e 6f 72 28 32 2c |"")..Set|Minor(2,|
|00000360| 38 2c 32 29 10 53 65 74 | 4d 69 6e 6f 72 28 31 30 |8,2).Set|Minor(10|
|00000370| 2c 35 2c 35 29 00 16 65 | 6c 73 65 69 66 20 73 63 |,5,5)..e|lseif sc|
|00000380| 61 6c 65 20 3c 20 2e 37 | 20 74 68 65 6e 00 14 53 |ale < .7| then..S|
|00000390| 65 74 4d 61 6a 6f 72 28 | 31 2c 31 2c 30 2c 74 72 |etMajor(|1,1,0,tr|
|000003a0| 75 65 29 13 53 65 74 54 | 65 78 74 28 31 2c 66 61 |ue).SetT|ext(1,fa|
|000003b0| 6c 73 65 2c 22 22 29 00 | 0f 53 65 74 4d 69 6e 6f |lse,"").|.SetMino|
|000003c0| 72 28 35 2c 35 2c 35 29 | 00 15 65 6c 73 65 69 66 |r(5,5,5)|..elseif|
|000003d0| 20 73 63 61 6c 65 20 3c | 20 32 20 74 68 65 6e 00 | scale <| 2 then.|
|000003e0| 14 53 65 74 4d 61 6a 6f | 72 28 31 2c 31 2c 30 2c |.SetMajo|r(1,1,0,|
|000003f0| 74 72 75 65 29 13 53 65 | 74 54 65 78 74 28 31 2c |true).Se|tText(1,|
|00000400| 66 61 6c 73 65 2c 22 22 | 29 00 0f 53 65 74 4d 69 |false,""|)..SetMi|
|00000410| 6e 6f 72 28 32 2c 38 2c | 32 29 10 53 65 74 4d 69 |nor(2,8,|2).SetMi|
|00000420| 6e 6f 72 28 31 30 2c 35 | 2c 35 29 00 15 65 6c 73 |nor(10,5|,5)..els|
|00000430| 65 69 66 20 73 63 61 6c | 65 20 3c 20 33 20 74 68 |eif scal|e < 3 th|
|00000440| 65 6e 00 15 53 65 74 4d | 61 6a 6f 72 28 2e 35 2c |en..SetM|ajor(.5,|
|00000450| 31 2c 30 2c 74 72 75 65 | 29 14 53 65 74 54 65 78 |1,0,true|).SetTex|
|00000460| 74 28 2e 35 2c 66 61 6c | 73 65 2c 22 22 29 00 0f |t(.5,fal|se,"")..|
|00000470| 53 65 74 4d 69 6e 6f 72 | 28 35 2c 35 2c 35 29 10 |SetMinor|(5,5,5).|
|00000480| 53 65 74 4d 69 6e 6f 72 | 28 31 30 2c 33 2c 32 29 |SetMinor|(10,3,2)|
|00000490| 00 15 65 6c 73 65 69 66 | 20 73 63 61 6c 65 20 3c |..elseif| scale <|
|000004a0| 20 38 20 74 68 65 6e 00 | 15 53 65 74 4d 61 6a 6f | 8 then.|.SetMajo|
|000004b0| 72 28 2e 32 2c 31 2c 30 | 2c 74 72 75 65 29 14 53 |r(.2,1,0|,true).S|
|000004c0| 65 74 54 65 78 74 28 2e | 32 2c 66 61 6c 73 65 2c |etText(.|2,false,|
|000004d0| 22 22 29 00 0f 53 65 74 | 4d 69 6e 6f 72 28 32 2c |"")..Set|Minor(2,|
|000004e0| 38 2c 32 29 10 53 65 74 | 4d 69 6e 6f 72 28 31 30 |8,2).Set|Minor(10|
|000004f0| 2c 35 2c 35 29 00 16 65 | 6c 73 65 69 66 20 73 63 |,5,5)..e|lseif sc|
|00000500| 61 6c 65 20 3c 20 31 30 | 20 74 68 65 6e 00 15 53 |ale < 10| then..S|
|00000510| 65 74 4d 61 6a 6f 72 28 | 2e 31 2c 31 2c 30 2c 74 |etMajor(|.1,1,0,t|
|00000520| 72 75 65 29 14 53 65 74 | 54 65 78 74 28 2e 31 2c |rue).Set|Text(.1,|
|00000530| 66 61 6c 73 65 2c 22 22 | 29 00 0f 53 65 74 4d 69 |false,""|)..SetMi|
|00000540| 6e 6f 72 28 35 2c 35 2c | 35 29 00 16 65 6c 73 65 |nor(5,5,|5)..else|
|00000550| 69 66 20 73 63 61 6c 65 | 20 3c 20 32 30 20 74 68 |if scale| < 20 th|
|00000560| 65 6e 00 15 53 65 74 4d | 61 6a 6f 72 28 2e 31 2c |en..SetM|ajor(.1,|
|00000570| 31 2c 30 2c 74 72 75 65 | 29 14 53 65 74 54 65 78 |1,0,true|).SetTex|
|00000580| 74 28 2e 31 2c 66 61 6c | 73 65 2c 22 22 29 00 0f |t(.1,fal|se,"")..|
|00000590| 53 65 74 4d 69 6e 6f 72 | 28 32 2c 38 2c 32 29 10 |SetMinor|(2,8,2).|
|000005a0| 53 65 74 4d 69 6e 6f 72 | 28 31 30 2c 35 2c 35 29 |SetMinor|(10,5,5)|
|000005b0| 00 04 65 6c 73 65 00 16 | 53 65 74 4d 61 6a 6f 72 |..else..|SetMajor|
|000005c0| 28 2e 30 35 2c 31 2c 30 | 2c 74 72 75 65 29 15 53 |(.05,1,0|,true).S|
|000005d0| 65 74 54 65 78 74 28 2e | 30 35 2c 66 61 6c 73 65 |etText(.|05,false|
|000005e0| 2c 22 22 29 00 0f 53 65 | 74 4d 69 6e 6f 72 28 35 |,"")..Se|tMinor(5|
|000005f0| 2c 35 2c 35 29 10 53 65 | 74 4d 69 6e 6f 72 28 31 |,5,5).Se|tMinor(1|
|00000600| 30 2c 33 2c 32 29 00 03 | 65 6e 64 00 07 45 6e 64 |0,3,2)..|end..End|
|00000610| 20 53 75 62 05 52 65 73 | 65 74 35 74 79 70 65 20 | Sub.Res|et5type |
|00000620| 61 73 20 69 6e 74 65 67 | 65 72 2c 74 65 78 74 4c |as integ|er,textL|
|00000630| 6f 63 20 61 73 20 69 6e | 74 65 67 65 72 2c 6e 65 |oc as in|teger,ne|
|00000640| 77 53 63 61 6c 65 20 61 | 73 20 64 6f 75 62 6c 65 |wScale a|s double|
|00000650| 00 00 15 0d 15 0d 2f 80 | 01 53 75 62 20 52 65 73 |....../.|.Sub Res|
|00000660| 65 74 28 74 79 70 65 20 | 61 73 20 69 6e 74 65 67 |et(type |as integ|
|00000670| 65 72 2c 74 65 78 74 4c | 6f 63 20 61 73 20 69 6e |er,textL|oc as in|
|00000680| 74 65 67 65 72 2c 6e 65 | 77 53 63 61 6c 65 20 61 |teger,ne|wScale a|
|00000690| 73 20 64 6f 75 62 6c 65 | 29 27 27 20 4d 61 69 6e |s double|)'' Main|
|000006a0| 20 72 6f 75 74 69 6e 65 | 20 66 6f 72 20 73 65 74 | routine| for set|
|000006b0| 74 69 6e 67 20 75 70 20 | 74 68 65 20 72 75 6c 65 |ting up |the rule|
|000006c0| 72 33 27 20 74 79 70 65 | 20 73 70 65 63 69 66 69 |r3' type| specifi|
|000006d0| 65 73 20 77 68 61 74 20 | 73 6f 72 74 20 6f 66 20 |es what |sort of |
|000006e0| 72 75 6c 65 72 20 77 65 | 20 77 61 6e 74 20 74 6f |ruler we| want to|
|000006f0| 20 64 72 61 77 35 27 20 | 74 65 78 74 4c 6f 63 20 | draw5' |textLoc |
|00000700| 73 70 65 63 69 66 69 65 | 73 20 77 68 65 72 65 20 |specifie|s where |
|00000710| 74 68 65 20 74 65 78 74 | 20 69 73 20 74 6f 20 62 |the text| is to b|
|00000720| 65 20 6c 61 79 65 64 20 | 6f 75 74 18 27 20 73 63 |e layed |out.' sc|
|00000730| 61 6c 65 20 69 73 20 74 | 68 65 20 6e 65 77 20 73 |ale is t|he new s|
|00000740| 63 61 6c 65 2e 27 20 69 | 66 20 61 6e 79 20 61 72 |cale.' i|f any ar|
|00000750| 65 20 73 65 74 20 74 6f | 20 30 20 77 65 20 75 73 |e set to| 0 we us|
|00000760| 65 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 76 61 |e the cu|rrent va|
|00000770| 6c 75 65 00 11 69 66 20 | 74 79 70 65 20 3c 3e 20 |lue..if |type <> |
|00000780| 30 20 74 68 65 6e 10 72 | 75 6c 65 72 54 79 70 65 |0 then.r|ulerType|
|00000790| 20 3d 20 74 79 70 65 03 | 65 6e 64 00 15 69 66 20 | = type.|end..if |
|000007a0| 6e 65 77 53 63 61 6c 65 | 20 3c 3e 20 30 20 74 68 |newScale| <> 0 th|
|000007b0| 65 6e 10 73 63 61 6c 65 | 20 3d 20 6e 65 77 53 63 |en.scale| = newSc|
|000007c0| 61 6c 65 03 65 6e 64 00 | 14 69 66 20 74 65 78 74 |ale.end.|.if text|
|000007d0| 4c 6f 63 20 3c 3e 20 30 | 20 74 68 65 6e 16 74 65 |Loc <> 0| then.te|
|000007e0| 78 74 4c 6f 63 61 74 69 | 6f 6e 20 3d 20 74 65 78 |xtLocati|on = tex|
|000007f0| 74 4c 6f 63 03 65 6e 64 | 00 22 43 68 61 6e 67 65 |tLoc.end|."Change|
|00000800| 46 6f 6e 74 28 22 47 65 | 6e 65 76 61 22 2c 39 2c |Font("Ge|neva",9,|
|00000810| 66 61 6c 73 65 2c 66 61 | 6c 73 65 29 00 16 27 20 |false,fa|lse)..' |
|00000820| 6e 6f 77 20 63 72 65 61 | 74 65 20 74 68 65 20 72 |now crea|te the r|
|00000830| 75 6c 65 72 15 73 65 6c | 65 63 74 20 63 61 73 65 |uler.sel|ect case|
|00000840| 20 72 75 6c 65 72 54 79 | 70 65 06 63 61 73 65 20 | rulerTy|pe.case |
|00000850| 31 04 63 6d 31 30 06 63 | 61 73 65 20 32 06 49 6e |1.cm10.c|ase 2.In|
|00000860| 63 68 31 30 06 63 61 73 | 65 20 33 06 69 6e 63 68 |ch10.cas|e 3.inch|
|00000870| 31 32 06 63 61 73 65 20 | 34 06 69 6e 63 68 31 36 |12.case |4.inch16|
|00000880| 06 63 61 73 65 20 35 07 | 43 75 73 74 6f 6d 31 06 |.case 5.|Custom1.|
|00000890| 63 61 73 65 20 36 07 43 | 75 73 74 6f 6d 32 03 65 |case 6.C|ustom2.e|
|000008a0| 6e 64 00 9f 01 27 20 73 | 61 6e 69 74 79 20 63 68 |nd...' s|anity ch|
|000008b0| 65 63 6b 2e 20 54 68 69 | 73 20 69 73 20 6e 6f 74 |eck. Thi|s is not|
|000008c0| 20 72 65 71 75 69 72 65 | 64 20 62 75 74 20 77 61 | require|d but wa|
|000008d0| 72 6e 73 20 79 6f 75 20 | 69 66 20 74 68 65 20 73 |rns you |if the s|
|000008e0| 63 61 6c 65 20 69 73 20 | 30 20 6f 72 20 79 6f 75 |cale is |0 or you|
|000008f0| 20 64 6f 6e 74 20 68 61 | 76 65 20 61 6e 79 20 6d | dont ha|ve any m|
|00000900| 61 6a 6f 72 0f 27 20 6c | 69 6e 65 73 20 64 65 66 |ajor.' l|ines def|
|00000910| 69 6e 65 64 17 69 66 20 | 6e 6f 74 20 53 61 6e 69 |ined.if |not Sani|
|00000920| 74 79 43 68 65 63 6b 20 | 74 68 65 6e 06 72 65 74 |tyCheck |then.ret|
|00000930| 75 72 6e 03 65 6e 64 00 | 19 27 20 64 72 61 77 20 |urn.end.|.' draw |
|00000940| 74 68 65 20 72 75 6c 65 | 72 20 6f 6e 73 63 72 65 |the rule|r onscre|
|00000950| 65 6e 06 55 70 64 61 74 | 65 00 07 45 6e 64 20 53 |en.Updat|e..End S|
|00000960| 75 62 0d 4d 6f 75 73 65 | 50 6f 73 69 74 69 6f 6e |ub.Mouse|Position|
|00000970| 3e 78 20 61 73 20 69 6e | 74 65 67 65 72 2c 79 20 |>x as in|teger,y |
|00000980| 61 73 20 69 6e 74 65 67 | 65 72 2c 64 6f 74 74 65 |as integ|er,dotte|
|00000990| 64 20 61 73 20 42 6f 6f | 6c 65 61 6e 2c 6c 69 6e |d as Boo|lean,lin|
|000009a0| 65 43 6f 6c 6f 72 20 61 | 73 20 43 6f 6c 6f 72 00 |eColor a|s Color.|
|000009b0| 00 08 37 08 37 1e 91 01 | 53 75 62 20 4d 6f 75 73 |..7.7...|Sub Mous|
|000009c0| 65 50 6f 73 69 74 69 6f | 6e 28 78 20 61 73 20 69 |ePositio|n(x as i|
|000009d0| 6e 74 65 67 65 72 2c 79 | 20 61 73 20 69 6e 74 65 |nteger,y| as inte|
|000009e0| 67 65 72 2c 64 6f 74 74 | 65 64 20 61 73 20 42 6f |ger,dott|ed as Bo|
|000009f0| 6f 6c 65 61 6e 2c 6c 69 | 6e 65 43 6f 6c 6f 72 20 |olean,li|neColor |
|00000a00| 61 73 20 43 6f 6c 6f 72 | 29 3e 27 20 65 72 61 73 |as Color|)>' eras|
|00000a10| 65 20 74 68 65 20 6f 6c | 64 20 6d 6f 75 73 65 20 |e the ol|d mouse |
|00000a20| 6d 61 72 6b 20 62 79 20 | 6a 75 73 74 20 72 65 64 |mark by |just red|
|00000a30| 72 61 77 69 6e 67 20 74 | 68 65 20 72 75 6c 65 72 |rawing t|he ruler|
|00000a40| 20 70 69 63 74 75 72 65 | 38 27 20 74 68 69 73 20 | picture|8' this |
|00000a50| 63 6f 75 6c 64 20 62 65 | 20 6f 70 74 69 6d 69 73 |could be| optimis|
|00000a60| 65 64 20 62 79 20 6a 75 | 73 74 20 72 65 64 72 61 |ed by ju|st redra|
|00000a70| 77 69 6e 67 20 74 68 65 | 20 6f 6c 64 20 61 72 65 |wing the| old are|
|00000a80| 61 10 64 69 6d 20 69 20 | 61 73 20 69 6e 74 65 67 |a.dim i |as integ|
|00000a90| 65 72 00 21 67 72 61 70 | 68 69 63 73 2e 64 72 61 |er.!grap|hics.dra|
|00000aa0| 77 70 69 63 74 75 72 65 | 20 72 75 6c 65 72 50 69 |wpicture| rulerPi|
|00000ab0| 63 2c 30 2c 30 1e 67 72 | 61 70 68 69 63 73 2e 66 |c,0,0.gr|aphics.f|
|00000ac0| 6f 72 65 43 6f 6c 6f 72 | 20 3d 20 6c 69 6e 65 43 |oreColor| = lineC|
|00000ad0| 6f 6c 6f 72 00 37 27 20 | 6e 6f 77 20 64 72 61 77 |olor.7' |now draw|
|00000ae0| 20 74 68 65 20 6e 65 77 | 20 6d 6f 75 73 65 20 6d | the new| mouse m|
|00000af0| 61 72 6b 20 2d 20 65 69 | 74 68 65 72 20 64 6f 74 |ark - ei|ther dot|
|00000b00| 74 65 64 20 6f 72 20 6e | 6f 72 6d 61 6c 15 69 66 |ted or n|ormal.if|
|00000b10| 20 64 6f 74 74 65 64 20 | 3d 20 74 72 75 65 20 74 | dotted |= true t|
|00000b20| 68 65 6e 15 27 20 64 72 | 61 77 20 61 20 64 6f 74 |hen.' dr|aw a dot|
|00000b30| 74 65 64 20 6c 69 6e 65 | 20 1c 69 66 20 73 69 64 |ted line| .if sid|
|00000b40| 65 20 3d 20 31 20 6f 72 | 20 73 69 64 65 20 3d 20 |e = 1 or| side = |
|00000b50| 33 20 74 68 65 6e 21 66 | 6f 72 20 69 20 3d 20 31 |3 then!f|or i = 1|
|00000b60| 20 74 6f 20 6d 65 2e 68 | 65 69 67 68 74 20 2d 20 | to me.h|eight - |
|00000b70| 32 20 73 74 65 70 20 32 | 1b 67 72 61 70 68 69 63 |2 step 2|.graphic|
|00000b80| 73 2e 64 72 61 77 6c 69 | 6e 65 28 78 2c 69 2c 78 |s.drawli|ne(x,i,x|
|00000b90| 2c 69 20 29 04 6e 65 78 | 74 04 65 6c 73 65 20 66 |,i ).nex|t.else f|
|00000ba0| 6f 72 20 69 20 3d 20 31 | 20 74 6f 20 6d 65 2e 77 |or i = 1| to me.w|
|00000bb0| 69 64 74 68 20 2d 20 32 | 20 73 74 65 70 20 32 1b |idth - 2| step 2.|
|00000bc0| 67 72 61 70 68 69 63 73 | 2e 64 72 61 77 6c 69 6e |graphics|.drawlin|
|00000bd0| 65 28 69 2c 79 2c 69 2c | 79 20 29 04 6e 65 78 74 |e(i,y,i,|y ).next|
|00000be0| 03 65 6e 64 04 65 6c 73 | 65 13 27 20 6a 75 73 74 |.end.els|e.' just|
|00000bf0| 20 64 72 61 77 20 61 20 | 6c 69 6e 65 20 1c 69 66 | draw a |line .if|
|00000c00| 20 73 69 64 65 20 3d 20 | 31 20 6f 72 20 73 69 64 | side = |1 or sid|
|00000c10| 65 20 3d 20 33 20 74 68 | 65 6e 26 67 72 61 70 68 |e = 3 th|en&graph|
|00000c20| 69 63 73 2e 64 72 61 77 | 6c 69 6e 65 28 78 2c 31 |ics.draw|line(x,1|
|00000c30| 2c 78 2c 6d 65 2e 68 65 | 69 67 68 74 20 2d 20 32 |,x,me.he|ight - 2|
|00000c40| 29 04 65 6c 73 65 25 67 | 72 61 70 68 69 63 73 2e |).else%g|raphics.|
|00000c50| 64 72 61 77 6c 69 6e 65 | 28 31 2c 79 2c 6d 65 2e |drawline|(1,y,me.|
|00000c60| 77 69 64 74 68 20 2d 20 | 32 2c 79 29 03 65 6e 64 |width - |2,y).end|
|00000c70| 03 65 6e 64 00 07 45 6e | 64 20 53 75 62 06 53 63 |.end..En|d Sub.Sc|
|00000c80| 72 6f 6c 6c 0c 78 20 61 | 73 20 69 6e 74 65 67 65 |roll.x a|s intege|
|00000c90| 72 00 00 04 0c 04 0c 07 | 18 53 75 62 20 53 63 72 |r.......|.Sub Scr|
|00000ca0| 6f 6c 6c 28 78 20 61 73 | 20 69 6e 74 65 67 65 72 |oll(x as| integer|
|00000cb0| 29 19 27 20 63 61 6c 6c | 65 64 20 66 72 6f 6d 20 |).' call|ed from |
|00000cc0| 61 20 73 63 72 6f 6c 6c | 62 61 72 0a 6f 66 66 73 |a scroll|bar.offs|
|00000cd0| 65 74 20 3d 20 78 00 0c | 27 20 6e 6f 77 20 72 65 |et = x..|' now re|
|00000ce0| 64 72 61 77 06 55 70 64 | 61 74 65 07 45 6e 64 20 |draw.Upd|ate.End |
|00000cf0| 53 75 62 09 53 65 74 4f | 72 69 67 69 6e 0b 78 20 |Sub.SetO|rigin.x |
|00000d00| 61 73 20 64 6f 75 62 6c | 65 00 00 08 00 08 00 0b |as doubl|e.......|
|00000d10| 1a 53 75 62 20 53 65 74 | 4f 72 69 67 69 6e 28 78 |.Sub Set|Origin(x|
|00000d20| 20 61 73 20 64 6f 75 62 | 6c 65 29 16 27 61 64 6a | as doub|le).'adj|
|00000d30| 75 73 74 20 74 68 65 20 | 7a 65 72 6f 20 70 6f 69 |ust the |zero poi|
|00000d40| 6e 74 0d 69 66 20 78 20 | 3d 20 30 20 74 68 65 6e |nt.if x |= 0 then|
|00000d50| 0e 70 6f 73 69 74 69 6f | 6e 20 20 3d 20 30 20 04 |.positio|n = 0 .|
|00000d60| 65 6c 73 65 1e 70 6f 73 | 69 74 69 6f 6e 20 20 3d |else.pos|ition =|
|00000d70| 20 28 78 20 2b 20 6f 66 | 66 73 65 74 29 2f 73 63 | (x + of|fset)/sc|
|00000d80| 61 6c 65 03 65 6e 64 00 | 0c 27 20 6e 6f 77 20 72 |ale.end.|.' now r|
|00000d90| 65 64 72 61 77 06 55 70 | 64 61 74 65 07 45 6e 64 |edraw.Up|date.End|
|00000da0| 20 53 75 62 06 55 70 64 | 61 74 65 00 00 00 03 01 | Sub.Upd|ate.....|
|00000db0| 03 01 13 0c 53 75 62 20 | 55 70 64 61 74 65 28 29 |....Sub |Update()|
|00000dc0| 88 01 27 20 63 61 6c 6c | 65 64 20 77 68 65 6e 20 |..' call|ed when |
|00000dd0| 77 65 20 73 63 72 6f 6c | 6c 2c 73 63 61 6c 65 20 |we scrol|l,scale |
|00000de0| 6f 72 20 63 68 61 6e 67 | 65 20 72 75 6c 65 72 20 |or chang|e ruler |
|00000df0| 74 79 70 65 20 28 69 6e | 63 6c 75 64 69 6e 67 20 |type (in|cluding |
|00000e00| 6e 65 77 20 72 75 6c 65 | 72 29 87 01 27 20 42 61 |new rule|r)..' Ba|
|00000e10| 73 69 63 61 6c 6c 79 20 | 63 6c 65 61 72 20 6f 75 |sically |clear ou|
|00000e20| 74 20 6f 75 72 20 70 69 | 63 74 75 72 65 2c 72 65 |t our pi|cture,re|
|00000e30| 64 72 61 77 20 74 68 65 | 20 72 75 6c 65 72 20 61 |draw the| ruler a|
|00000e40| 6e 64 20 62 6c 61 73 74 | 20 74 6f 20 73 63 72 65 |nd blast| to scre|
|00000e50| 65 6e 2e 11 64 69 6d 20 | 67 20 61 73 20 47 72 61 |en..dim |g as Gra|
|00000e60| 70 68 69 63 73 00 16 27 | 20 63 61 6c 63 75 6c 61 |phics..'| calcula|
|00000e70| 74 65 20 74 68 65 20 6f | 72 69 67 69 6e 23 6f 72 |te the o|rigin#or|
|00000e80| 69 67 69 6e 20 3d 20 70 | 6f 73 69 74 69 6f 6e 20 |igin = p|osition |
|00000e90| 2a 20 73 63 61 6c 65 20 | 20 2d 20 6f 66 66 73 65 |* scale | - offse|
|00000ea0| 74 00 15 67 20 3d 20 72 | 75 6c 65 72 50 69 63 2e |t..g = r|ulerPic.|
|00000eb0| 67 72 61 70 68 69 63 73 | 01 20 22 27 20 63 6c 65 |graphics|. "' cle|
|00000ec0| 61 72 20 6f 75 74 20 74 | 68 65 20 70 69 63 74 75 |ar out t|he pictu|
|00000ed0| 72 65 20 61 6e 64 20 72 | 65 64 72 61 77 17 67 2e |re and r|edraw.g.|
|00000ee0| 46 6f 72 65 43 6f 6c 6f | 72 20 3d 20 62 61 63 6b |ForeColo|r = back|
|00000ef0| 43 6f 6c 6f 72 31 67 2e | 46 69 6c 6c 52 65 63 74 |Color1g.|FillRect|
|00000f00| 28 30 2c 20 30 2c 20 72 | 75 6c 65 72 50 69 63 2e |(0, 0, r|ulerPic.|
|00000f10| 77 69 64 74 68 2c 20 72 | 75 6c 65 72 50 69 63 2e |width, r|ulerPic.|
|00000f20| 68 65 69 67 68 74 29 0b | 44 72 61 77 52 75 6c 65 |height).|DrawRule|
|00000f30| 72 20 67 00 11 27 20 62 | 6c 61 73 74 20 74 6f 20 |r g..' b|last to |
|00000f40| 73 63 72 65 65 6e 21 67 | 72 61 70 68 69 63 73 2e |screen!g|raphics.|
|00000f50| 64 72 61 77 70 69 63 74 | 75 72 65 20 72 75 6c 65 |drawpict|ure rule|
|00000f60| 72 50 69 63 2c 30 2c 30 | 00 07 45 6e 64 20 53 75 |rPic,0,0|..End Su|
|00000f70| 62 0d 55 73 65 72 44 72 | 61 77 73 54 65 78 74 8a |b.UserDr|awsText.|
|00000f80| 01 67 20 61 73 20 47 72 | 61 70 68 69 63 73 2c 73 |.g as Gr|aphics,s|
|00000f90| 20 61 73 20 73 74 72 69 | 6e 67 2c 63 6f 75 6e 74 | as stri|ng,count|
|00000fa0| 20 61 73 20 69 6e 74 65 | 67 65 72 2c 6c 6f 63 20 | as inte|ger,loc |
|00000fb0| 61 73 20 69 6e 74 65 67 | 65 72 2c 73 70 61 63 65 |as integ|er,space|
|00000fc0| 20 61 73 20 69 6e 74 65 | 67 65 72 00 08 0b 84 01 | as inte|ger.....|
|00000fd0| 0b 84 01 12 9d 01 53 75 | 62 20 55 73 65 72 44 72 |......Su|b UserDr|
|00000fe0| 61 77 73 54 65 78 74 28 | 67 20 61 73 20 47 72 61 |awsText(|g as Gra|
|00000ff0| 70 68 69 63 73 2c 73 20 | 61 73 20 73 74 72 69 6e |phics,s |as strin|
|00001000| 67 2c 63 6f 75 6e 74 20 | 61 73 20 69 6e 74 65 67 |g,count |as integ|
|00001010| 65 72 2c 6c 6f 63 20 61 | 73 20 69 6e 74 65 67 65 |er,loc a|s intege|
|00001020| 72 2c 73 70 61 63 65 20 | 61 73 20 69 6e 74 65 67 |r,space |as integ|
|00001030| 65 72 29 88 01 27 20 54 | 68 69 73 20 67 65 74 73 |er)..' T|his gets|
|00001040| 20 63 61 6c 6c 65 64 20 | 69 66 20 74 68 65 20 74 | called |if the t|
|00001050| 65 78 74 4c 6f 63 61 74 | 69 6f 6e 20 69 73 20 6e |extLocat|ion is n|
|00001060| 6f 74 20 6f 6e 65 20 6f | 66 20 74 68 65 20 62 75 |ot one o|f the bu|
|00001070| 69 6c 74 20 69 6e 20 74 | 79 70 65 73 2e 96 01 27 |ilt in t|ypes...'|
|00001080| 20 55 73 65 72 73 20 67 | 65 74 20 74 6f 20 6c 61 | Users g|et to la|
|00001090| 79 6f 75 74 20 74 68 65 | 20 74 65 78 74 20 61 73 |yout the| text as|
|000010a0| 20 74 68 65 79 20 6c 69 | 6b 65 2e 20 54 68 65 20 | they li|ke. The |
|000010b0| 66 6f 6e 74 20 73 69 7a | 65 2c 73 74 79 6c 65 2c |font siz|e,style,|
|000010c0| 63 6f 6c 6f 72 20 65 74 | 63 20 61 72 65 20 61 6c |color et|c are al|
|000010d0| 72 65 61 64 79 3c 27 20 | 73 65 74 20 61 6e 64 20 |ready<' |set and |
|000010e0| 72 65 66 6c 65 63 74 20 | 74 68 65 20 76 61 6c 75 |reflect |the valu|
|000010f0| 65 73 20 61 74 20 74 68 | 65 20 74 69 6d 65 20 53 |es at th|e time S|
|00001100| 65 74 54 65 78 74 20 77 | 61 73 20 63 61 6c 6c 65 |etText w|as calle|
|00001110| 64 2e 23 27 20 54 68 65 | 79 20 63 6f 75 6c 64 20 |d.#' The|y could |
|00001120| 62 65 20 63 68 61 6e 67 | 65 64 20 68 65 72 65 20 |be chang|ed here |
|00001130| 74 68 6f 75 67 68 1c 64 | 69 6d 20 77 2c 73 74 72 |though.d|im w,str|
|00001140| 4f 66 66 73 65 74 2c 69 | 20 61 73 20 69 6e 74 65 |Offset,i| as inte|
|00001150| 67 65 72 00 14 77 20 3d | 20 67 2e 53 74 72 69 6e |ger..w =| g.Strin|
|00001160| 67 57 69 64 74 68 28 73 | 29 00 1c 69 66 20 73 69 |gWidth(s|)..if si|
|00001170| 64 65 20 3d 20 31 20 6f | 72 20 73 69 64 65 20 3d |de = 1 o|r side =|
|00001180| 20 33 20 74 68 65 6e 19 | 73 74 72 4f 66 66 73 65 | 3 then.|strOffse|
|00001190| 74 20 3d 20 28 73 70 61 | 63 65 20 2d 20 77 29 2f |t = (spa|ce - w)/|
|000011a0| 32 84 01 67 2e 44 72 61 | 77 53 74 72 69 6e 67 20 |2..g.Dra|wString |
|000011b0| 73 2c 6c 6f 63 20 2b 20 | 73 74 72 4f 66 66 73 65 |s,loc + |strOffse|
|000011c0| 74 20 2b 20 31 2c 20 28 | 6d 65 2e 68 65 69 67 68 |t + 1, (|me.heigh|
|000011d0| 74 20 2b 20 67 2e 74 65 | 78 74 48 65 69 67 68 74 |t + g.te|xtHeight|
|000011e0| 29 2f 32 20 2d 20 32 04 | 65 6c 73 65 1c 73 74 72 |)/2 - 2.|else.str|
|000011f0| 4f 66 66 73 65 74 20 3d | 20 28 6d 65 2e 77 69 64 |Offset =| (me.wid|
|00001200| 74 68 20 2d 20 77 29 2f | 32 80 01 67 2e 44 72 61 |th - w)/|2..g.Dra|
|00001210| 77 53 74 72 69 6e 67 20 | 73 2c 73 74 72 4f 66 66 |wString |s,strOff|
|00001220| 73 65 74 20 2b 20 31 20 | 2c 6c 6f 63 20 2b 20 28 |set + 1 |,loc + (|
|00001230| 73 70 61 63 65 20 2b 20 | 67 2e 74 65 78 74 48 65 |space + |g.textHe|
|00001240| 69 67 68 74 29 2f 32 20 | 2d 20 31 03 65 6e 64 00 |ight)/2 |- 1.end.|
|00001250| 07 45 6e 64 20 53 75 62 | 04 63 6d 31 30 00 00 00 |.End Sub|.cm10...|
|00001260| 02 12 02 12 a6 01 0a 53 | 75 62 20 63 6d 31 30 28 |.......S|ub cm10(|
|00001270| 29 1a 27 20 62 75 69 6c | 64 20 61 20 63 65 6e 74 |).' buil|d a cent|
|00001280| 69 6d 65 74 65 72 20 73 | 63 61 6c 65 12 49 6e 69 |imeter s|cale.Ini|
|00001290| 74 52 75 6c 65 72 20 20 | 37 32 2f 32 2e 35 34 10 |tRuler |72/2.54.|
|000012a0| 64 72 61 77 46 72 61 6d | 65 20 3d 20 74 72 75 65 |drawFram|e = true|
|000012b0| 00 13 69 66 20 73 63 61 | 6c 65 20 3c 20 2e 30 33 |..if sca|le < .03|
|000012c0| 20 74 68 65 6e 06 72 65 | 74 75 72 6e 17 65 6c 73 | then.re|turn.els|
|000012d0| 65 69 66 20 73 63 61 6c | 65 20 3c 20 2e 30 34 20 |eif scal|e < .04 |
|000012e0| 74 68 65 6e 00 15 53 65 | 74 4d 61 6a 6f 72 28 35 |then..Se|tMajor(5|
|000012f0| 30 2c 31 2c 30 2c 74 72 | 75 65 29 14 53 65 74 54 |0,1,0,tr|ue).SetT|
|00001300| 65 78 74 28 35 30 2c 66 | 61 6c 73 65 2c 22 22 29 |ext(50,f|alse,"")|
|00001310| 0f 53 65 74 4d 69 6e 6f | 72 28 35 2c 35 2c 35 29 |.SetMino|r(5,5,5)|
|00001320| 00 16 65 6c 73 65 69 66 | 20 73 63 61 6c 65 20 3c |..elseif| scale <|
|00001330| 20 2e 31 20 74 68 65 6e | 00 15 53 65 74 4d 61 6a | .1 then|..SetMaj|
|00001340| 6f 72 28 35 30 2c 31 2c | 30 2c 74 72 75 65 29 14 |or(50,1,|0,true).|
|00001350| 53 65 74 54 65 78 74 28 | 35 30 2c 66 61 6c 73 65 |SetText(|50,false|
|00001360| 2c 22 22 29 10 53 65 74 | 4d 69 6e 6f 72 28 31 30 |,"").Set|Minor(10|
|00001370| 2c 33 2c 32 29 0f 53 65 | 74 4d 69 6e 6f 72 28 35 |,3,2).Se|tMinor(5|
|00001380| 2c 35 2c 35 29 00 17 65 | 6c 73 65 69 66 20 73 63 |,5,5)..e|lseif sc|
|00001390| 61 6c 65 20 3c 20 2e 31 | 38 20 74 68 65 6e 00 15 |ale < .1|8 then..|
|000013a0| 53 65 74 4d 61 6a 6f 72 | 28 32 30 2c 31 2c 30 2c |SetMajor|(20,1,0,|
|000013b0| 74 72 75 65 29 14 53 65 | 74 54 65 78 74 28 32 30 |true).Se|tText(20|
|000013c0| 2c 66 61 6c 73 65 2c 22 | 22 29 11 53 65 74 4d 69 |,false,"|").SetMi|
|000013d0| 6e 6f 72 28 31 30 2c 35 | 2c 31 30 29 00 17 65 6c |nor(10,5|,10)..el|
|000013e0| 73 65 69 66 20 73 63 61 | 6c 65 20 3c 20 2e 32 35 |seif sca|le < .25|
|000013f0| 20 74 68 65 6e 00 15 53 | 65 74 4d 61 6a 6f 72 28 | then..S|etMajor(|
|00001400| 31 30 2c 31 2c 30 2c 74 | 72 75 65 29 14 53 65 74 |10,1,0,t|rue).Set|
|00001410| 54 65 78 74 28 31 30 2c | 66 61 6c 73 65 2c 22 22 |Text(10,|false,""|
|00001420| 29 11 53 65 74 4d 69 6e | 6f 72 28 31 30 2c 35 2c |).SetMin|or(10,5,|
|00001430| 31 30 29 00 16 65 6c 73 | 65 69 66 20 73 63 61 6c |10)..els|eif scal|
|00001440| 65 20 3c 20 2e 34 20 74 | 68 65 6e 00 14 53 65 74 |e < .4 t|hen..Set|
|00001450| 4d 61 6a 6f 72 28 35 2c | 31 2c 30 2c 74 72 75 65 |Major(5,|1,0,true|
|00001460| 29 13 53 65 74 54 65 78 | 74 28 35 2c 66 61 6c 73 |).SetTex|t(5,fals|
|00001470| 65 2c 22 22 29 0f 53 65 | 74 4d 69 6e 6f 72 28 35 |e,"").Se|tMinor(5|
|00001480| 2c 35 2c 35 29 00 17 65 | 6c 73 65 69 66 20 73 63 |,5,5)..e|lseif sc|
|00001490| 61 6c 65 20 3c 20 2e 38 | 30 20 74 68 65 6e 00 14 |ale < .8|0 then..|
|000014a0| 53 65 74 4d 61 6a 6f 72 | 28 35 2c 31 2c 30 2c 74 |SetMajor|(5,1,0,t|
|000014b0| 72 75 65 29 13 53 65 74 | 54 65 78 74 28 35 2c 66 |rue).Set|Text(5,f|
|000014c0| 61 6c 73 65 2c 22 22 29 | 0f 53 65 74 4d 69 6e 6f |alse,"")|.SetMino|
|000014d0| 72 28 35 2c 38 2c 35 29 | 10 53 65 74 4d 69 6e 6f |r(5,8,5)|.SetMino|
|000014e0| 72 28 31 30 2c 35 2c 32 | 29 00 15 65 6c 73 65 69 |r(10,5,2|)..elsei|
|000014f0| 66 20 73 63 61 6c 65 20 | 3c 20 31 20 74 68 65 6e |f scale |< 1 then|
|00001500| 00 14 53 65 74 4d 61 6a | 6f 72 28 32 2c 31 2c 30 |..SetMaj|or(2,1,0|
|00001510| 2c 74 72 75 65 29 13 53 | 65 74 54 65 78 74 28 32 |,true).S|etText(2|
|00001520| 2c 66 61 6c 73 65 2c 22 | 22 29 0f 53 65 74 4d 69 |,false,"|").SetMi|
|00001530| 6e 6f 72 28 32 2c 38 2c | 32 29 10 53 65 74 4d 69 |nor(2,8,|2).SetMi|
|00001540| 6e 6f 72 28 31 30 2c 35 | 2c 35 29 00 17 65 6c 73 |nor(10,5|,5)..els|
|00001550| 65 69 66 20 73 63 61 6c | 65 20 3c 20 31 2e 38 20 |eif scal|e < 1.8 |
|00001560| 74 68 65 6e 00 14 53 65 | 74 4d 61 6a 6f 72 28 31 |then..Se|tMajor(1|
|00001570| 2c 31 2c 30 2c 74 72 75 | 65 29 0f 53 65 74 4d 69 |,1,0,tru|e).SetMi|
|00001580| 6e 6f 72 28 35 2c 35 2c | 35 29 13 53 65 74 54 65 |nor(5,5,|5).SetTe|
|00001590| 78 74 28 31 2c 66 61 6c | 73 65 2c 22 22 29 00 15 |xt(1,fal|se,"")..|
|000015a0| 65 6c 73 65 69 66 20 73 | 63 61 6c 65 20 3c 20 34 |elseif s|cale < 4|
|000015b0| 20 74 68 65 6e 00 14 53 | 65 74 4d 61 6a 6f 72 28 | then..S|etMajor(|
|000015c0| 31 2c 31 2c 30 2c 74 72 | 75 65 29 12 53 65 74 54 |1,1,0,tr|ue).SetT|
|000015d0| 65 78 74 28 31 2c 74 72 | 75 65 2c 22 22 29 0f 53 |ext(1,tr|ue,"").S|
|000015e0| 65 74 4d 69 6e 6f 72 28 | 35 2c 38 2c 35 29 10 53 |etMinor(|5,8,5).S|
|000015f0| 65 74 4d 69 6e 6f 72 28 | 31 30 2c 35 2c 32 29 00 |etMinor(|10,5,2).|
|00001600| 15 65 6c 73 65 69 66 20 | 73 63 61 6c 65 20 3c 20 |.elseif |scale < |
|00001610| 38 20 74 68 65 6e 00 15 | 53 65 74 4d 61 6a 6f 72 |8 then..|SetMajor|
|00001620| 28 2e 35 2c 31 2c 30 2c | 74 72 75 65 29 14 53 65 |(.5,1,0,|true).Se|
|00001630| 74 54 65 78 74 28 2e 35 | 2c 66 61 6c 73 65 2c 22 |tText(.5|,false,"|
|00001640| 22 29 10 53 65 74 4d 69 | 6e 6f 72 28 31 30 2c 33 |").SetMi|nor(10,3|
|00001650| 2c 32 29 0f 53 65 74 4d | 69 6e 6f 72 28 35 2c 35 |,2).SetM|inor(5,5|
|00001660| 2c 35 29 00 16 65 6c 73 | 65 69 66 20 73 63 61 6c |,5)..els|eif scal|
|00001670| 65 20 3c 20 31 31 20 74 | 68 65 6e 00 15 53 65 74 |e < 11 t|hen..Set|
|00001680| 4d 61 6a 6f 72 28 2e 32 | 2c 31 2c 30 2c 74 72 75 |Major(.2|,1,0,tru|
|00001690| 65 29 14 53 65 74 54 65 | 78 74 28 2e 32 2c 66 61 |e).SetTe|xt(.2,fa|
|000016a0| 6c 73 65 2c 22 22 29 0f | 53 65 74 4d 69 6e 6f 72 |lse,"").|SetMinor|
|000016b0| 28 32 2c 38 2c 32 29 0f | 53 65 74 4d 69 6e 6f 72 |(2,8,2).|SetMinor|
|000016c0| 28 34 2c 35 2c 32 29 00 | 16 65 6c 73 65 69 66 20 |(4,5,2).|.elseif |
|000016d0| 73 63 61 6c 65 20 3c 20 | 32 30 20 74 68 65 6e 00 |scale < |20 then.|
|000016e0| 15 53 65 74 4d 61 6a 6f | 72 28 2e 32 2c 31 2c 30 |.SetMajo|r(.2,1,0|
|000016f0| 2c 74 72 75 65 29 14 53 | 65 74 54 65 78 74 28 2e |,true).S|etText(.|
|00001700| 32 2c 66 61 6c 73 65 2c | 22 22 29 10 53 65 74 4d |2,false,|"").SetM|
|00001710| 69 6e 6f 72 28 31 30 2c | 35 2c 35 29 0f 53 65 74 |inor(10,|5,5).Set|
|00001720| 4d 69 6e 6f 72 28 32 2c | 38 2c 32 29 00 16 65 6c |Minor(2,|8,2)..el|
|00001730| 73 65 69 66 20 73 63 61 | 6c 65 20 3c 20 32 38 20 |seif sca|le < 28 |
|00001740| 74 68 65 6e 00 15 53 65 | 74 4d 61 6a 6f 72 28 2e |then..Se|tMajor(.|
|00001750| 31 2c 31 2c 30 2c 74 72 | 75 65 29 14 53 65 74 54 |1,1,0,tr|ue).SetT|
|00001760| 65 78 74 28 2e 31 2c 66 | 61 6c 73 65 2c 22 22 29 |ext(.1,f|alse,"")|
|00001770| 0f 53 65 74 4d 69 6e 6f | 72 28 35 2c 35 2c 35 29 |.SetMino|r(5,5,5)|
|00001780| 00 04 65 6c 73 65 00 15 | 53 65 74 4d 61 6a 6f 72 |..else..|SetMajor|
|00001790| 28 2e 31 2c 31 2c 30 2c | 74 72 75 65 29 14 53 65 |(.1,1,0,|true).Se|
|000017a0| 74 54 65 78 74 28 2e 31 | 2c 66 61 6c 73 65 2c 22 |tText(.1|,false,"|
|000017b0| 22 29 10 53 65 74 4d 69 | 6e 6f 72 28 31 30 2c 33 |").SetMi|nor(10,3|
|000017c0| 2c 32 29 0f 53 65 74 4d | 69 6e 6f 72 28 35 2c 35 |,2).SetM|inor(5,5|
|000017d0| 2c 35 29 00 03 65 6e 64 | 00 07 45 6e 64 20 53 75 |,5)..end|..End Su|
|000017e0| 62 06 69 6e 63 68 31 32 | 00 00 00 03 0c 03 0c 9f |b.inch12|........|
|000017f0| 01 0c 53 75 62 20 69 6e | 63 68 31 32 28 29 2d 27 |..Sub in|ch12()-'|
|00001800| 20 64 72 61 77 20 61 6e | 20 69 6e 63 68 20 72 75 | draw an| inch ru|
|00001810| 6c 65 72 20 77 69 74 68 | 20 31 2f 31 32 20 69 6e |ler with| 1/12 in|
|00001820| 63 68 20 64 69 76 69 73 | 69 6f 6e 73 00 0c 49 6e |ch divis|ions..In|
|00001830| 69 74 52 75 6c 65 72 20 | 37 32 10 64 72 61 77 46 |itRuler |72.drawF|
|00001840| 72 61 6d 65 20 3d 20 74 | 72 75 65 00 13 69 66 20 |rame = t|rue..if |
|00001850| 73 63 61 6c 65 20 3c 20 | 2e 30 33 20 74 68 65 6e |scale < |.03 then|
|00001860| 06 72 65 74 75 72 6e 00 | 17 65 6c 73 65 69 66 20 |.return.|.elseif |
|00001870| 73 63 61 6c 65 20 3c 20 | 2e 30 34 20 74 68 65 6e |scale < |.04 then|
|00001880| 00 15 53 65 74 4d 61 6a | 6f 72 28 34 38 2c 31 2c |..SetMaj|or(48,1,|
|00001890| 30 2c 74 72 75 65 29 14 | 53 65 74 54 65 78 74 28 |0,true).|SetText(|
|000018a0| 34 38 2c 66 61 6c 73 65 | 2c 22 22 29 00 0f 53 65 |48,false|,"")..Se|
|000018b0| 74 4d 69 6e 6f 72 28 32 | 2c 38 2c 32 29 10 53 65 |tMinor(2|,8,2).Se|
|000018c0| 74 4d 69 6e 6f 72 28 31 | 32 2c 35 2c 36 29 00 17 |tMinor(1|2,5,6)..|
|000018d0| 65 6c 73 65 69 66 20 73 | 63 61 6c 65 20 3c 20 2e |elseif s|cale < .|
|000018e0| 30 38 20 74 68 65 6e 00 | 15 53 65 74 4d 61 6a 6f |08 then.|.SetMajo|
|000018f0| 72 28 32 34 2c 31 2c 30 | 2c 74 72 75 65 29 14 53 |r(24,1,0|,true).S|
|00001900| 65 74 54 65 78 74 28 32 | 34 2c 66 61 6c 73 65 2c |etText(2|4,false,|
|00001910| 22 22 29 00 0f 53 65 74 | 4d 69 6e 6f 72 28 32 2c |"")..Set|Minor(2,|
|00001920| 38 2c 32 29 10 53 65 74 | 4d 69 6e 6f 72 28 31 32 |8,2).Set|Minor(12|
|00001930| 2c 35 2c 36 29 00 17 65 | 6c 73 65 69 66 20 73 63 |,5,6)..e|lseif sc|
|00001940| 61 6c 65 20 3c 20 2e 31 | 30 20 74 68 65 6e 00 15 |ale < .1|0 then..|
|00001950| 53 65 74 4d 61 6a 6f 72 | 28 31 32 2c 31 2c 30 2c |SetMajor|(12,1,0,|
|00001960| 74 72 75 65 29 14 53 65 | 74 54 65 78 74 28 31 32 |true).Se|tText(12|
|00001970| 2c 66 61 6c 73 65 2c 22 | 22 29 00 0f 53 65 74 4d |,false,"|")..SetM|
|00001980| 69 6e 6f 72 28 32 2c 38 | 2c 32 29 10 53 65 74 4d |inor(2,8|,2).SetM|
|00001990| 69 6e 6f 72 28 31 32 2c | 35 2c 36 29 00 17 65 6c |inor(12,|5,6)..el|
|000019a0| 73 65 69 66 20 73 63 61 | 6c 65 20 3c 20 2e 31 35 |seif sca|le < .15|
|000019b0| 20 74 68 65 6e 00 14 53 | 65 74 4d 61 6a 6f 72 28 | then..S|etMajor(|
|000019c0| 36 2c 31 2c 30 2c 74 72 | 75 65 29 13 53 65 74 54 |6,1,0,tr|ue).SetT|
|000019d0| 65 78 74 28 36 2c 66 61 | 6c 73 65 2c 22 22 29 00 |ext(6,fa|lse,"").|
|000019e0| 0f 53 65 74 4d 69 6e 6f | 72 28 32 2c 38 2c 32 29 |.SetMino|r(2,8,2)|
|000019f0| 0f 53 65 74 4d 69 6e 6f | 72 28 36 2c 35 2c 33 29 |.SetMino|r(6,5,3)|
|00001a00| 00 17 65 6c 73 65 69 66 | 20 73 63 61 6c 65 20 3c |..elseif| scale <|
|00001a10| 20 2e 33 35 20 74 68 65 | 6e 00 14 53 65 74 4d 61 | .35 the|n..SetMa|
|00001a20| 6a 6f 72 28 36 2c 31 2c | 30 2c 74 72 75 65 29 13 |jor(6,1,|0,true).|
|00001a30| 53 65 74 54 65 78 74 28 | 36 2c 66 61 6c 73 65 2c |SetText(|6,false,|
|00001a40| 22 22 29 00 0f 53 65 74 | 4d 69 6e 6f 72 28 32 2c |"")..Set|Minor(2,|
|00001a50| 38 2c 32 29 0f 53 65 74 | 4d 69 6e 6f 72 28 36 2c |8,2).Set|Minor(6,|
|00001a60| 35 2c 33 29 10 53 65 74 | 4d 69 6e 6f 72 28 31 32 |5,3).Set|Minor(12|
|00001a70| 2c 33 2c 32 29 00 17 65 | 6c 73 65 69 66 20 73 63 |,3,2)..e|lseif sc|
|00001a80| 61 6c 65 20 3c 20 2e 35 | 30 20 74 68 65 6e 00 14 |ale < .5|0 then..|
|00001a90| 53 65 74 4d 61 6a 6f 72 | 28 32 2c 31 2c 30 2c 74 |SetMajor|(2,1,0,t|
|00001aa0| 72 75 65 29 13 53 65 74 | 54 65 78 74 28 32 2c 66 |rue).Set|Text(2,f|
|00001ab0| 61 6c 73 65 2c 22 22 29 | 00 0f 53 65 74 4d 69 6e |alse,"")|..SetMin|
|00001ac0| 6f 72 28 32 2c 38 2c 32 | 29 0f 53 65 74 4d 69 6e |or(2,8,2|).SetMin|
|00001ad0| 6f 72 28 34 2c 35 2c 32 | 29 10 53 65 74 4d 69 6e |or(4,5,2|).SetMin|
|00001ae0| 6f 72 28 31 32 2c 33 2c | 33 29 00 17 65 6c 73 65 |or(12,3,|3)..else|
|00001af0| 69 66 20 73 63 61 6c 65 | 20 3c 20 2e 38 35 20 74 |if scale| < .85 t|
|00001b00| 68 65 6e 00 14 53 65 74 | 4d 61 6a 6f 72 28 31 2c |hen..Set|Major(1,|
|00001b10| 31 2c 30 2c 74 72 75 65 | 29 13 53 65 74 54 65 78 |1,0,true|).SetTex|
|00001b20| 74 28 31 2c 66 61 6c 73 | 65 2c 22 22 29 00 0f 53 |t(1,fals|e,"")..S|
|00001b30| 65 74 4d 69 6e 6f 72 28 | 32 2c 38 2c 32 29 0f 53 |etMinor(|2,8,2).S|
|00001b40| 65 74 4d 69 6e 6f 72 28 | 36 2c 35 2c 33 29 00 17 |etMinor(|6,5,3)..|
|00001b50| 65 6c 73 65 69 66 20 73 | 63 61 6c 65 20 3c 20 31 |elseif s|cale < 1|
|00001b60| 2e 38 20 74 68 65 6e 00 | 14 53 65 74 4d 61 6a 6f |.8 then.|.SetMajo|
|00001b70| 72 28 31 2c 31 2c 30 2c | 74 72 75 65 29 13 53 65 |r(1,1,0,|true).Se|
|00001b80| 74 54 65 78 74 28 31 2c | 66 61 6c 73 65 2c 22 22 |tText(1,|false,""|
|00001b90| 29 00 0f 53 65 74 4d 69 | 6e 6f 72 28 32 2c 38 2c |)..SetMi|nor(2,8,|
|00001ba0| 32 29 0f 53 65 74 4d 69 | 6e 6f 72 28 36 2c 35 2c |2).SetMi|nor(6,5,|
|00001bb0| 33 29 10 53 65 74 4d 69 | 6e 6f 72 28 31 32 2c 33 |3).SetMi|nor(12,3|
|00001bc0| 2c 32 29 00 15 65 6c 73 | 65 69 66 20 73 63 61 6c |,2)..els|eif scal|
|00001bd0| 65 20 3c 20 33 20 74 68 | 65 6e 00 15 53 65 74 4d |e < 3 th|en..SetM|
|00001be0| 61 6a 6f 72 28 2e 35 2c | 31 2c 30 2c 74 72 75 65 |ajor(.5,|1,0,true|
|00001bf0| 29 14 53 65 74 54 65 78 | 74 28 2e 35 2c 66 61 6c |).SetTex|t(.5,fal|
|00001c00| 73 65 2c 22 22 29 00 0f | 53 65 74 4d 69 6e 6f 72 |se,"")..|SetMinor|
|00001c10| 28 33 2c 38 2c 33 29 0f | 53 65 74 4d 69 6e 6f 72 |(3,8,3).|SetMinor|
|00001c20| 28 36 2c 35 2c 32 29 00 | 04 65 6c 73 65 00 16 53 |(6,5,2).|.else..S|
|00001c30| 65 74 4d 61 6a 6f 72 28 | 2e 32 35 2c 31 2c 30 2c |etMajor(|.25,1,0,|
|00001c40| 74 72 75 65 29 15 53 65 | 74 54 65 78 74 28 2e 32 |true).Se|tText(.2|
|00001c50| 35 2c 66 61 6c 73 65 2c | 22 22 29 00 0f 53 65 74 |5,false,|"")..Set|
|00001c60| 4d 69 6e 6f 72 28 33 2c | 35 2c 33 29 0f 53 65 74 |Minor(3,|5,3).Set|
|00001c70| 4d 69 6e 6f 72 28 36 2c | 33 2c 32 29 00 03 65 6e |Minor(6,|3,2)..en|
|00001c80| 64 00 07 45 6e 64 20 53 | 75 62 06 69 6e 63 68 31 |d..End S|ub.inch1|
|00001c90| 36 00 00 00 03 00 03 00 | b7 01 0c 53 75 62 20 69 |6.......|...Sub i|
|00001ca0| 6e 63 68 31 36 28 29 2d | 27 20 64 72 61 77 20 61 |nch16()-|' draw a|
|00001cb0| 6e 20 69 6e 63 68 20 72 | 75 6c 65 72 20 77 69 74 |n inch r|uler wit|
|00001cc0| 68 20 31 2f 31 36 20 69 | 6e 63 68 20 64 69 76 69 |h 1/16 i|nch divi|
|00001cd0| 73 69 6f 6e 73 00 0c 49 | 6e 69 74 52 75 6c 65 72 |sions..I|nitRuler|
|00001ce0| 20 37 32 10 64 72 61 77 | 46 72 61 6d 65 20 3d 20 | 72.draw|Frame = |
|00001cf0| 74 72 75 65 00 13 69 66 | 20 73 63 61 6c 65 20 3c |true..if| scale <|
|00001d00| 20 2e 30 33 20 74 68 65 | 6e 06 72 65 74 75 72 6e | .03 the|n.return|
|00001d10| 00 17 65 6c 73 65 69 66 | 20 73 63 61 6c 65 20 3c |..elseif| scale <|
|00001d20| 20 2e 30 34 20 74 68 65 | 6e 00 15 53 65 74 4d 61 | .04 the|n..SetMa|
|00001d30| 6a 6f 72 28 36 34 2c 31 | 2c 30 2c 74 72 75 65 29 |jor(64,1|,0,true)|
|00001d40| 14 53 65 74 54 65 78 74 | 28 36 34 2c 66 61 6c 73 |.SetText|(64,fals|
|00001d50| 65 2c 22 22 29 00 0f 53 | 65 74 4d 69 6e 6f 72 28 |e,"")..S|etMinor(|
|00001d60| 32 2c 38 2c 32 29 0f 53 | 65 74 4d 69 6e 6f 72 28 |2,8,2).S|etMinor(|
|00001d70| 34 2c 35 2c 32 29 0f 53 | 65 74 4d 69 6e 6f 72 28 |4,5,2).S|etMinor(|
|00001d80| 38 2c 33 2c 32 29 00 17 | 65 6c 73 65 69 66 20 73 |8,3,2)..|elseif s|
|00001d90| 63 61 6c 65 20 3c 20 2e | 30 35 20 74 68 65 6e 00 |cale < .|05 then.|
|00001da0| 15 53 65 74 4d 61 6a 6f | 72 28 33 32 2c 31 2c 30 |.SetMajo|r(32,1,0|
|00001db0| 2c 74 72 75 65 29 14 53 | 65 74 54 65 78 74 28 33 |,true).S|etText(3|
|00001dc0| 32 2c 66 61 6c 73 65 2c | 22 22 29 00 0f 53 65 74 |2,false,|"")..Set|
|00001dd0| 4d 69 6e 6f 72 28 32 2c | 38 2c 32 29 0f 53 65 74 |Minor(2,|8,2).Set|
|00001de0| 4d 69 6e 6f 72 28 34 2c | 35 2c 32 29 0f 53 65 74 |Minor(4,|5,2).Set|
|00001df0| 4d 69 6e 6f 72 28 38 2c | 33 2c 32 29 00 17 65 6c |Minor(8,|3,2)..el|
|00001e00| 73 65 69 66 20 73 63 61 | 6c 65 20 3c 20 2e 31 30 |seif sca|le < .10|
|00001e10| 20 74 68 65 6e 00 15 53 | 65 74 4d 61 6a 6f 72 28 | then..S|etMajor(|
|00001e20| 31 36 2c 31 2c 30 2c 74 | 72 75 65 29 14 53 65 74 |16,1,0,t|rue).Set|
|00001e30| 54 65 78 74 28 31 36 2c | 66 61 6c 73 65 2c 22 22 |Text(16,|false,""|
|00001e40| 29 00 0f 53 65 74 4d 69 | 6e 6f 72 28 32 2c 38 2c |)..SetMi|nor(2,8,|
|00001e50| 32 29 0f 53 65 74 4d 69 | 6e 6f 72 28 34 2c 35 2c |2).SetMi|nor(4,5,|
|00001e60| 32 29 0f 53 65 74 4d 69 | 6e 6f 72 28 38 2c 33 2c |2).SetMi|nor(8,3,|
|00001e70| 32 29 00 17 65 6c 73 65 | 69 66 20 73 63 61 6c 65 |2)..else|if scale|
|00001e80| 20 3c 20 2e 31 35 20 74 | 68 65 6e 00 14 53 65 74 | < .15 t|hen..Set|
|00001e90| 4d 61 6a 6f 72 28 38 2c | 31 2c 30 2c 74 72 75 65 |Major(8,|1,0,true|
|00001ea0| 29 13 53 65 74 54 65 78 | 74 28 38 2c 66 61 6c 73 |).SetTex|t(8,fals|
|00001eb0| 65 2c 22 22 29 00 0f 53 | 65 74 4d 69 6e 6f 72 28 |e,"")..S|etMinor(|
|00001ec0| 32 2c 38 2c 32 29 0f 53 | 65 74 4d 69 6e 6f 72 28 |2,8,2).S|etMinor(|
|00001ed0| 34 2c 35 2c 32 29 0f 53 | 65 74 4d 69 6e 6f 72 28 |4,5,2).S|etMinor(|
|00001ee0| 38 2c 33 2c 32 29 00 17 | 65 6c 73 65 69 66 20 73 |8,3,2)..|elseif s|
|00001ef0| 63 61 6c 65 20 3c 20 2e | 33 35 20 74 68 65 6e 00 |cale < .|35 then.|
|00001f00| 14 53 65 74 4d 61 6a 6f | 72 28 34 2c 31 2c 30 2c |.SetMajo|r(4,1,0,|
|00001f10| 74 72 75 65 29 13 53 65 | 74 54 65 78 74 28 34 2c |true).Se|tText(4,|
|00001f20| 66 61 6c 73 65 2c 22 22 | 29 00 0f 53 65 74 4d 69 |false,""|)..SetMi|
|00001f30| 6e 6f 72 28 32 2c 38 2c | 32 29 0f 53 65 74 4d 69 |nor(2,8,|2).SetMi|
|00001f40| 6e 6f 72 28 34 2c 35 2c | 32 29 0f 53 65 74 4d 69 |nor(4,5,|2).SetMi|
|00001f50| 6e 6f 72 28 38 2c 33 2c | 32 29 00 17 65 6c 73 65 |nor(8,3,|2)..else|
|00001f60| 69 66 20 73 63 61 6c 65 | 20 3c 20 2e 35 30 20 74 |if scale| < .50 t|
|00001f70| 68 65 6e 00 14 53 65 74 | 4d 61 6a 6f 72 28 32 2c |hen..Set|Major(2,|
|00001f80| 31 2c 30 2c 74 72 75 65 | 29 13 53 65 74 54 65 78 |1,0,true|).SetTex|
|00001f90| 74 28 32 2c 66 61 6c 73 | 65 2c 22 22 29 00 0f 53 |t(2,fals|e,"")..S|
|00001fa0| 65 74 4d 69 6e 6f 72 28 | 32 2c 38 2c 32 29 0f 53 |etMinor(|2,8,2).S|
|00001fb0| 65 74 4d 69 6e 6f 72 28 | 34 2c 35 2c 32 29 0f 53 |etMinor(|4,5,2).S|
|00001fc0| 65 74 4d 69 6e 6f 72 28 | 38 2c 33 2c 32 29 00 17 |etMinor(|8,3,2)..|
|00001fd0| 65 6c 73 65 69 66 20 73 | 63 61 6c 65 20 3c 20 2e |elseif s|cale < .|
|00001fe0| 37 35 20 74 68 65 6e 00 | 14 53 65 74 4d 61 6a 6f |75 then.|.SetMajo|
|00001ff0| 72 28 31 2c 31 2c 30 2c | 74 72 75 65 29 13 53 65 |r(1,1,0,|true).Se|
|00002000| 74 54 65 78 74 28 31 2c | 66 61 6c 73 65 2c 22 22 |tText(1,|false,""|
|00002010| 29 00 0f 53 65 74 4d 69 | 6e 6f 72 28 32 2c 38 2c |)..SetMi|nor(2,8,|
|00002020| 32 29 0f 53 65 74 4d 69 | 6e 6f 72 28 34 2c 35 2c |2).SetMi|nor(4,5,|
|00002030| 32 29 00 17 65 6c 73 65 | 69 66 20 73 63 61 6c 65 |2)..else|if scale|
|00002040| 20 3c 20 31 2e 36 20 74 | 68 65 6e 00 14 53 65 74 | < 1.6 t|hen..Set|
|00002050| 4d 61 6a 6f 72 28 31 2c | 31 2c 30 2c 74 72 75 65 |Major(1,|1,0,true|
|00002060| 29 13 53 65 74 54 65 78 | 74 28 31 2c 66 61 6c 73 |).SetTex|t(1,fals|
|00002070| 65 2c 22 22 29 00 0f 53 | 65 74 4d 69 6e 6f 72 28 |e,"")..S|etMinor(|
|00002080| 32 2c 38 2c 32 29 0f 53 | 65 74 4d 69 6e 6f 72 28 |2,8,2).S|etMinor(|
|00002090| 34 2c 35 2c 32 29 0f 53 | 65 74 4d 69 6e 6f 72 28 |4,5,2).S|etMinor(|
|000020a0| 38 2c 33 2c 32 29 00 15 | 65 6c 73 65 69 66 20 73 |8,3,2)..|elseif s|
|000020b0| 63 61 6c 65 20 3c 20 33 | 20 74 68 65 6e 00 15 53 |cale < 3| then..S|
|000020c0| 65 74 4d 61 6a 6f 72 28 | 2e 35 2c 31 2c 30 2c 74 |etMajor(|.5,1,0,t|
|000020d0| 72 75 65 29 14 53 65 74 | 54 65 78 74 28 2e 35 2c |rue).Set|Text(.5,|
|000020e0| 66 61 6c 73 65 2c 22 22 | 29 00 0f 53 65 74 4d 69 |false,""|)..SetMi|
|000020f0| 6e 6f 72 28 32 2c 38 2c | 32 29 0f 53 65 74 4d 69 |nor(2,8,|2).SetMi|
|00002100| 6e 6f 72 28 34 2c 35 2c | 32 29 0f 53 65 74 4d 69 |nor(4,5,|2).SetMi|
|00002110| 6e 6f 72 28 38 2c 33 2c | 32 29 00 15 65 6c 73 65 |nor(8,3,|2)..else|
|00002120| 69 66 20 73 63 61 6c 65 | 20 3c 20 37 20 74 68 65 |if scale| < 7 the|
|00002130| 6e 00 16 53 65 74 4d 61 | 6a 6f 72 28 2e 32 35 2c |n..SetMa|jor(.25,|
|00002140| 31 2c 30 2c 74 72 75 65 | 29 15 53 65 74 54 65 78 |1,0,true|).SetTex|
|00002150| 74 28 2e 32 35 2c 66 61 | 6c 73 65 2c 22 22 29 00 |t(.25,fa|lse,"").|
|00002160| 0f 53 65 74 4d 69 6e 6f | 72 28 32 2c 38 2c 32 29 |.SetMino|r(2,8,2)|
|00002170| 0f 53 65 74 4d 69 6e 6f | 72 28 34 2c 35 2c 32 29 |.SetMino|r(4,5,2)|
|00002180| 0f 53 65 74 4d 69 6e 6f | 72 28 38 2c 33 2c 32 29 |.SetMino|r(8,3,2)|
|00002190| 00 16 65 6c 73 65 69 66 | 20 73 63 61 6c 65 20 3c |..elseif| scale <|
|000021a0| 20 31 35 20 74 68 65 6e | 00 17 53 65 74 4d 61 6a | 15 then|..SetMaj|
|000021b0| 6f 72 28 2e 31 32 35 2c | 31 2c 30 2c 74 72 75 65 |or(.125,|1,0,true|
|000021c0| 29 16 53 65 74 54 65 78 | 74 28 2e 31 32 35 2c 66 |).SetTex|t(.125,f|
|000021d0| 61 6c 73 65 2c 22 22 29 | 00 0f 53 65 74 4d 69 6e |alse,"")|..SetMin|
|000021e0| 6f 72 28 32 2c 38 2c 32 | 29 0f 53 65 74 4d 69 6e |or(2,8,2|).SetMin|
|000021f0| 6f 72 28 34 2c 35 2c 32 | 29 0f 53 65 74 4d 69 6e |or(4,5,2|).SetMin|
|00002200| 6f 72 28 38 2c 33 2c 32 | 29 00 04 65 6c 73 65 00 |or(8,3,2|)..else.|
|00002210| 18 53 65 74 4d 61 6a 6f | 72 28 2e 30 36 32 35 2c |.SetMajo|r(.0625,|
|00002220| 31 2c 30 2c 74 72 75 65 | 29 17 53 65 74 54 65 78 |1,0,true|).SetTex|
|00002230| 74 28 2e 30 36 32 35 2c | 66 61 6c 73 65 2c 22 22 |t(.0625,|false,""|
|00002240| 29 00 0f 53 65 74 4d 69 | 6e 6f 72 28 32 2c 38 2c |)..SetMi|nor(2,8,|
|00002250| 32 29 0f 53 65 74 4d 69 | 6e 6f 72 28 34 2c 35 2c |2).SetMi|nor(4,5,|
|00002260| 32 29 0f 53 65 74 4d 69 | 6e 6f 72 28 38 2c 33 2c |2).SetMi|nor(8,3,|
|00002270| 32 29 00 03 65 6e 64 00 | 07 45 6e 64 20 53 75 62 |2)..end.|.End Sub|
|00002280| 07 43 75 73 74 6f 6d 31 | 00 00 00 03 00 03 00 0f |.Custom1|........|
|00002290| 0d 53 75 62 20 43 75 73 | 74 6f 6d 31 28 29 32 27 |.Sub Cus|tom1()2'|
|000022a0| 20 73 65 65 20 63 75 73 | 74 6f 6d 69 73 61 74 69 | see cus|tomisati|
|000022b0| 6f 6e 20 62 6c 75 72 62 | 20 66 6f 72 20 65 78 61 |on blurb| for exa|
|000022c0| 6d 70 6c 65 73 20 74 6f | 20 70 75 74 20 68 65 72 |mples to| put her|
|000022d0| 65 2b 27 20 74 68 69 73 | 20 6a 75 73 74 20 64 72 |e+' this| just dr|
|000022e0| 61 77 73 20 61 20 67 72 | 69 64 20 77 69 74 68 20 |aws a gr|id with |
|000022f0| 6e 75 6d 62 65 72 73 20 | 69 6e 20 69 74 00 0c 49 |numbers |in it..I|
|00002300| 6e 69 74 52 75 6c 65 72 | 20 38 30 00 25 43 68 61 |nitRuler| 80.%Cha|
|00002310| 6e 67 65 46 6f 6e 74 28 | 22 48 65 6c 76 65 74 69 |ngeFont(|"Helveti|
|00002320| 63 61 22 2c 31 32 2c 74 | 72 75 65 2c 66 61 6c 73 |ca",12,t|rue,fals|
|00002330| 65 29 00 14 53 65 74 4d | 61 6a 6f 72 28 31 2c 31 |e)..SetM|ajor(1,1|
|00002340| 2c 30 2c 74 72 75 65 29 | 13 53 65 74 54 65 78 74 |,0,true)|.SetText|
|00002350| 28 31 2c 66 61 6c 73 65 | 2c 22 22 29 00 28 27 20 |(1,false|,"").(' |
|00002360| 74 68 69 73 20 63 61 75 | 73 65 73 20 55 73 65 72 |this cau|ses User|
|00002370| 44 72 61 77 73 54 65 78 | 74 20 74 6f 20 62 65 20 |DrawsTex|t to be |
|00002380| 63 61 6c 6c 65 64 11 74 | 65 78 74 4c 6f 63 61 74 |called.t|extLocat|
|00002390| 69 6f 6e 20 3d 20 32 30 | 00 07 45 6e 64 20 53 75 |ion = 20|..End Su|
|000023a0| 62 0a 43 68 61 6e 67 65 | 53 69 7a 65 00 00 00 03 |b.Change|Size....|
|000023b0| 00 03 00 08 10 53 75 62 | 20 43 68 61 6e 67 65 53 |.....Sub| ChangeS|
|000023c0| 69 7a 65 28 29 88 01 27 | 20 63 68 61 6e 67 65 20 |ize()..'| change |
|000023d0| 74 68 65 20 73 69 7a 65 | 20 6f 66 20 74 68 65 20 |the size| of the |
|000023e0| 70 69 63 74 75 72 65 20 | 69 6e 20 72 65 73 70 6f |picture |in respo|
|000023f0| 6e 73 65 20 74 6f 20 74 | 68 65 20 63 61 6e 76 61 |nse to t|he canva|
|00002400| 73 20 62 65 69 6e 67 20 | 72 65 73 69 7a 65 64 00 |s being |resized.|
|00002410| 14 63 75 72 72 65 6e 74 | 57 69 64 74 68 20 3d 20 |.current|Width = |
|00002420| 77 69 64 74 68 16 63 75 | 72 72 65 6e 74 48 65 69 |width.cu|rrentHei|
|00002430| 67 68 74 20 3d 20 68 65 | 69 67 68 74 37 72 75 6c |ght = he|ight7rul|
|00002440| 65 72 50 69 63 20 3d 20 | 6e 69 6c 20 20 2f 2f 20 |erPic = |nil // |
|00002450| 66 69 78 20 66 6f 72 20 | 6d 65 6d 6f 72 79 20 6c |fix for |memory l|
|00002460| 65 61 6b 20 77 69 74 68 | 20 70 69 63 74 75 72 65 |eak with| picture|
|00002470| 73 20 3f 3f 23 72 75 6c | 65 72 50 69 63 3d 6e 65 |s ??#rul|erPic=ne|
|00002480| 77 50 69 63 74 75 72 65 | 28 77 69 64 74 68 2c 68 |wPicture|(width,h|
|00002490| 65 69 67 68 74 2c 38 29 | 07 45 6e 64 20 53 75 62 |eight,8)|.End Sub|
|000024a0| 0a 49 6e 69 74 69 61 6c | 69 7a 65 23 72 65 67 6f |.Initial|ize#rego|
|000024b0| 20 61 73 20 53 74 72 69 | 6e 67 2c 77 68 69 63 68 | as Stri|ng,which|
|000024c0| 53 69 64 65 20 61 73 20 | 69 6e 74 65 67 65 72 00 |Side as |integer.|
|000024d0| 00 01 00 01 00 0c 33 53 | 75 62 20 49 6e 69 74 69 |......3S|ub Initi|
|000024e0| 61 6c 69 7a 65 28 72 65 | 67 6f 20 61 73 20 53 74 |alize(re|go as St|
|000024f0| 72 69 6e 67 2c 77 68 69 | 63 68 53 69 64 65 20 61 |ring,whi|chSide a|
|00002500| 73 20 69 6e 74 65 67 65 | 72 29 10 44 69 6d 20 72 |s intege|r).Dim r|
|00002510| 20 61 73 20 42 6f 6f 6c | 65 61 6e 00 12 72 20 3d | as Bool|ean..r =|
|00002520| 20 52 65 67 69 73 74 65 | 72 28 72 65 67 6f 29 00 | Registe|r(rego).|
|00002530| 10 73 69 64 65 20 3d 20 | 77 68 69 63 68 53 69 64 |.side = |whichSid|
|00002540| 65 00 1c 62 61 63 6b 43 | 6f 6c 6f 72 20 3d 20 52 |e..backC|olor = R|
|00002550| 47 42 28 32 35 35 2c 32 | 35 35 2c 32 35 35 29 00 |GB(255,2|55,255).|
|00002560| 23 72 75 6c 65 72 50 69 | 63 3d 6e 65 77 50 69 63 |#rulerPi|c=newPic|
|00002570| 74 75 72 65 28 77 69 64 | 74 68 2c 68 65 69 67 68 |ture(wid|th,heigh|
|00002580| 74 2c 38 29 00 07 45 6e | 64 20 53 75 62 07 43 75 |t,8)..En|d Sub.Cu|
|00002590| 73 74 6f 6d 32 00 00 00 | 01 00 01 32 03 0d 53 75 |stom2...|...2..Su|
|000025a0| 62 20 43 75 73 74 6f 6d | 32 28 29 32 27 20 73 65 |b Custom|2()2' se|
|000025b0| 65 20 63 75 73 74 6f 6d | 69 73 61 74 69 6f 6e 20 |e custom|isation |
|000025c0| 62 6c 75 72 62 20 66 6f | 72 20 65 78 61 6d 70 6c |blurb fo|r exampl|
|000025d0| 65 73 20 74 6f 20 70 75 | 74 20 68 65 72 65 07 45 |es to pu|t here.E|
|000025e0| 6e 64 20 53 75 62 03 05 | 50 61 69 6e 74 0d 67 20 |nd Sub..|Paint.g |
|000025f0| 61 73 20 47 72 61 70 68 | 69 63 73 07 42 6f 6f 6c |as Graph|ics.Bool|
|00002600| 65 61 6e 09 4d 6f 75 73 | 65 4d 6f 76 65 19 78 20 |ean.Mous|eMove.x |
|00002610| 61 73 20 69 6e 74 65 67 | 65 72 2c 79 20 61 73 20 |as integ|er,y as |
|00002620| 69 6e 74 65 67 65 72 07 | 42 6f 6f 6c 65 61 6e 09 |integer.|Boolean.|
|00002630| 4d 6f 75 73 65 45 78 69 | 74 00 07 42 6f 6f 6c 65 |MouseExi|t..Boole|
|00002640| 61 6e 04 04 4f 70 65 6e | 01 00 01 00 03 0a 53 75 |an..Open|......Su|
|00002650| 62 20 4f 70 65 6e 28 29 | 00 07 45 6e 64 20 53 75 |b Open()|..End Su|
|00002660| 62 05 50 61 69 6e 74 0a | 0c 0a 0c 0e 18 53 75 62 |b.Paint.|.....Sub|
|00002670| 20 50 61 69 6e 74 28 67 | 20 41 73 20 47 72 61 70 | Paint(g| As Grap|
|00002680| 68 69 63 73 29 81 01 27 | 20 69 66 20 74 68 65 20 |hics)..'| if the |
|00002690| 77 69 6e 64 6f 77 20 69 | 73 20 62 65 69 6e 67 20 |window i|s being |
|000026a0| 72 65 73 69 7a 65 64 20 | 77 65 20 68 61 76 65 20 |resized |we have |
|000026b0| 74 6f 20 72 65 63 72 65 | 61 74 65 20 74 68 65 20 |to recre|ate the |
|000026c0| 70 69 63 74 75 72 65 20 | 8c 01 27 20 74 6f 20 74 |picture |..' to t|
|000026d0| 68 65 20 6e 65 77 20 73 | 69 7a 65 20 61 6e 64 20 |he new s|ize and |
|000026e0| 64 72 61 77 20 74 68 65 | 20 72 75 6c 65 72 2e 20 |draw the| ruler. |
|000026f0| 44 6f 69 6e 67 20 69 74 | 20 74 68 69 73 20 77 61 |Doing it| this wa|
|00002700| 79 20 6d 65 61 6e 73 20 | 77 65 20 64 6f 6e 74 20 |y means |we dont |
|00002710| 6e 65 65 64 20 61 18 27 | 20 73 65 70 65 72 61 74 |need a.'| seperat|
|00002720| 65 20 72 65 73 69 7a 65 | 20 6d 65 74 68 6f 64 00 |e resize| method.|
|00002730| 27 27 20 63 68 65 63 6b | 20 69 66 20 73 75 62 43 |'' check| if subC|
|00002740| 6c 61 73 73 20 28 69 66 | 20 61 6e 79 29 20 68 61 |lass (if| any) ha|
|00002750| 6e 64 6c 65 73 20 69 74 | 14 69 66 20 6e 6f 74 20 |ndles it|.if not |
|00002760| 50 61 69 6e 74 28 67 29 | 20 74 68 65 6e 38 69 66 |Paint(g)| then8if|
|00002770| 20 77 69 64 74 68 20 3c | 3e 20 63 75 72 72 65 6e | width <|> curren|
|00002780| 74 57 69 64 74 68 20 6f | 72 20 68 65 69 67 68 74 |tWidth o|r height|
|00002790| 20 3c 3e 20 63 75 72 72 | 65 6e 74 48 65 69 67 68 | <> curr|entHeigh|
|000027a0| 74 20 74 68 65 6e 0a 43 | 68 61 6e 67 65 53 69 7a |t then.C|hangeSiz|
|000027b0| 65 03 65 6e 64 0c 27 20 | 6e 6f 77 20 72 65 64 72 |e.end.' |now redr|
|000027c0| 61 77 06 55 70 64 61 74 | 65 03 65 6e 64 07 45 6e |aw.Updat|e.end.En|
|000027d0| 64 20 53 75 62 09 4d 6f | 75 73 65 45 78 69 74 04 |d Sub.Mo|useExit.|
|000027e0| 18 04 18 07 0f 53 75 62 | 20 4d 6f 75 73 65 45 78 |.....Sub| MouseEx|
|000027f0| 69 74 28 29 97 01 27 20 | 6f 6e 6c 79 20 72 65 71 |it()..' |only req|
|00002800| 75 69 72 65 64 20 69 66 | 20 77 65 20 61 72 65 20 |uired if| we are |
|00002810| 73 68 6f 77 69 6e 67 20 | 74 68 65 20 6d 6f 75 73 |showing |the mous|
|00002820| 65 20 70 6f 73 69 74 69 | 6f 6e 20 77 68 65 6e 20 |e positi|on when |
|00002830| 74 68 65 20 6d 6f 75 73 | 65 20 69 73 20 77 69 74 |the mous|e is wit|
|00002840| 68 69 6e 20 74 68 65 20 | 72 75 6c 65 72 20 27 20 |hin the |ruler ' |
|00002850| 41 6c 73 6f 20 6c 65 74 | 73 20 73 75 62 63 6c 61 |Also let|s subcla|
|00002860| 73 73 65 73 20 68 61 6e | 64 6c 65 20 69 74 15 69 |sses han|dle it.i|
|00002870| 66 20 6e 6f 74 20 4d 6f | 75 73 65 45 78 69 74 20 |f not Mo|useExit |
|00002880| 74 68 65 6e 25 4d 6f 75 | 73 65 50 6f 73 69 74 69 |then%Mou|sePositi|
|00002890| 6f 6e 20 2d 31 2c 2d 31 | 2c 74 72 75 65 2c 52 47 |on -1,-1|,true,RG|
|000028a0| 42 28 32 35 35 2c 30 2c | 30 29 03 65 6e 64 07 45 |B(255,0,|0).end.E|
|000028b0| 6e 64 20 53 75 62 09 4d | 6f 75 73 65 4d 6f 76 65 |nd Sub.M|ouseMove|
|000028c0| 05 23 05 23 09 29 53 75 | 62 20 4d 6f 75 73 65 4d |.#.#.)Su|b MouseM|
|000028d0| 6f 76 65 28 58 20 41 73 | 20 49 6e 74 65 67 65 72 |ove(X As| Integer|
|000028e0| 2c 20 59 20 41 73 20 49 | 6e 74 65 67 65 72 29 3e |, Y As I|nteger)>|
|000028f0| 27 20 69 66 20 79 6f 75 | 20 64 6f 6e 74 20 77 61 |' if you| dont wa|
|00002900| 6e 74 20 74 6f 20 73 68 | 6f 77 20 74 68 65 20 6d |nt to sh|ow the m|
|00002910| 6f 75 73 65 20 70 6f 73 | 69 74 69 6f 6e 20 77 69 |ouse pos|ition wi|
|00002920| 74 68 69 6e 20 74 68 65 | 20 72 75 6c 65 72 8a 01 |thin the| ruler..|
|00002930| 27 20 74 68 65 6e 20 63 | 6f 6d 6d 65 6e 74 20 74 |' then c|omment t|
|00002940| 68 69 73 20 6f 75 74 2e | 20 54 68 69 73 20 61 6c |his out.| This al|
|00002950| 73 6f 20 63 68 65 63 6b | 73 20 69 66 20 61 20 73 |so check|s if a s|
|00002960| 75 62 63 6c 61 73 73 20 | 77 61 6e 74 73 20 74 6f |ubclass |wants to|
|00002970| 20 68 61 6e 64 6c 65 20 | 69 74 00 1a 69 66 20 6e | handle |it..if n|
|00002980| 6f 74 20 4d 6f 75 73 65 | 4d 6f 76 65 28 78 2c 79 |ot Mouse|Move(x,y|
|00002990| 29 20 74 68 65 6e 23 4d | 6f 75 73 65 50 6f 73 69 |) then#M|ousePosi|
|000029a0| 74 69 6f 6e 20 78 2c 79 | 2c 74 72 75 65 2c 52 47 |tion x,y|,true,RG|
|000029b0| 42 28 32 35 35 2c 30 2c | 30 29 03 65 6e 64 00 07 |B(255,0,|0).end..|
|000029c0| 45 6e 64 20 53 75 62 00 | 00 00 |End Sub.|.. |
+--------+-------------------------+-------------------------+--------+--------+