home *** CD-ROM | disk | FTP | other *** search
- This is about as simple as an application can get. It is just a 2 inch
- tape measure that I wanted to have with me at all times. It is good
- for measuring short bolts. I also use it for measuring detail work on
- things like deck railings or picket fences that I see when I'm
- traveling. I rough out a sketch with Diddle use TapeMeasure to rough
- in the detail measurements.
-
- There is a flaw in the tape measure itself because of the positioning
- of the pixels on the Palm screen. The distance between 0 and 2" is
- correct. The problem is between 7/8" and 1-1/8". The 1" mark could not
- be exact by using the constant that I built into the program for
- spacing so I opted build the scale from 0 to 7/8" accurately and then
- from 2" back to 1-1/8" accurately. I chose these accuracy areas purely
- from my own experiences in the things I typically measure. The 64th of
- an inch or so that the 1" mark is off doesn't really matter to me, but
- it might to some.
-
- Again, thanks to Neal, Edwin, and Ron for Quartus Forth, doc
- interface, and string constants. I used Resource Edit to create the
- form. SmartDoc is my editor.
-
- Here is the entire source in text format. I guess the only thing of
- note here are the two buttons which are masquerading as the program
- title and my email address.
-
-
- \ TapeMeasure 4/7/00 4:45 pm DMB
-
- \ A 2" tape measure.
-
- needs condthens
- needs events
- needs fields
- needs graphics
- needs ids
- needs resources
-
- needs rdwin
- needs string-constants
-
- \ resource stuff
- (ID) DMBD (ID) rsrc use-resources
-
- 1005 constant tmFID
- 1020 constant tmTID
- 1021 constant tmMID
- 1030 constant tmTForm
- 1031 constant tmMForm
-
- \ program constants
- 150 constant ePos
- 50 constant wM \ whole inch measure in pixels
- 35 constant hM \ half inch measure in pixels
- 20 constant qM \ quarter inch measure in pixels
- 10 constant eM \ eighth inch measure in pixels
-
- 5 constant sRow
- 75 constant iLen
-
- s" 0" sconstant in0
- s" 1" sconstant in1
- s" 2" sconstant in2
- s" 1/8" sconstant eTxt
- s" 3/8" sconstant e3Txt
- s" 5/8" sconstant e5Txt
- s" 7/8" sconstant e7Txt
- s" 1/4" sconstant q1Txt
- s" 3/4" sconstant q3Txt
- s" 1/2" sconstant hTxt
-
- : dspTM ( -- )
- iLen 2 * sRow + 1 + sRow DO
-
- \ 0"
- i ePos wM -
- i ePos
- line
- \ 0" text
- sRow 5 -
- ePos wM - 10 -
- in0 string>win
-
- \ 1/8" line
- iLen 8 / i +
- ePos eM -
- iLen 8 / i + ePos
- line
- \ 1/8" text
- iLen 8 / i + 5 -
- ePos eM - 20 -
- eTxt string>win
-
- \ 1/4"
- iLen 4 / i +
- ePos qM -
- iLen 4 / i + ePos
- line
- \ 1/4" text
- iLen 4 / i + 5 -
- ePos qM - 28 -
- q1Txt string>win
-
- \ 3/8"
- iLen 8 / 3 * i +
- ePos eM -
- iLen 8 / 3 * i + ePos
- line
- \ 3/8" text
- iLen 8 / 3 * i + 5 -
- ePos eM - 20 -
- e3Txt string>win
-
- \ 1/2"
- iLen 2 / i +
- ePos hM -
- iLen 2 / i + ePos
- line
- \ 1/2" text
- iLen 2 / i + 5 -
- ePos hM - 25 -
- hTxt string>win
-
- \ 5/8"
- iLen dup 8 / 3 * - i +
- ePos eM -
- iLen dup 8 / 3 * - i + ePos
- line
- \ 5/8" text
- iLen dup 8 / 3 * - i + 5 -
- ePos eM - 20 -
- e5Txt string>win
-
- \ 3/4"
- iLen dup 4 / - i +
- ePos qM -
- iLen dup 4 / - i + ePos
- line
- \ 3/4" text
- iLen dup 4 / - i + 5 -
- ePos qM - 28 -
- q3Txt string>win
-
- \ 7/8"
- iLen dup 8 / - i +
- ePos eM -
- iLen dup 8 / - i + ePos
- line
- \ 7/8" text
- iLen dup 8 / - i + 5 -
- ePos eM - 20 -
- e7Txt string>win
-
- \ 1"
- i iLen +
- ePos wM -
- i iLen + ePos
- line
-
- iLen +LOOP
-
- sRow iLen + 5 -
- ePos wM - 10 -
- in1 string>win
-
- iLen 2 * sRow + 5 -
- ePos wM - 10 -
- in2 string>win
- ;
-
- : proc-event ( ekey -- )
- cond DUP ctlSelectEvent = IF
- event >abs itemid
- \ this is if they click on the title
- cond DUP tmTID = IF
- tmTForm FrmAlert DROP
- \ this is if they click on my email address
- ELSE DUP tmMID = IF
- tmMForm FrmAlert DROP
- thens DROP
- thens DROP ;
-
-
- : go ( -- )
- tmFID ShowForm
- dspTM
- BEGIN ekey proc-event AGAIN
- ;
-