Line Test

by Gordon

email: gordon@mgcsoft.com

Home page for my Equation Editors: http://www.mgcsoft.com/

Demonstration of line drawing/snapping and rubber banding.

 

 

Purpose
With the "LineTest" you can draw 'free' lines, lines which snap to each other and measure angles. Lines can be highlighted with the trackbar and erased when the trackbar is released. Also demonstrates the creation of a LogFont for drawing the dimensions.

Materials and Equipments

Software Requirements
Windows 95, Delphi 3 (to recompile)

Compiled program:      LineTest.EXE

Hardware Requirements
VGA Display

Procedure

  1. Double click on the LineTest.EXE icon to start the program.

  2. Click and drag to draw lines. Lines will either snap to another which is in the cursor rectangle or start and finish at the X and Y co-ordinates                                                                                      
  3. Use the trackbar to select and erase lines.                                                                                                                                                    
  4. Measure angles between pairs of interconnected lines by: Clicking 'Measure Angle' then selecting, first the junction of the two lines and then the ends.

Discussion
The LineTestUnit.PAS unit contains the basic drawing functions. ProFuncUnit.Pas contains the text alignment AlignTextAngle and SetStatusPanelText procedures.

The program uses a number of math functions and demonstrates how to align dimension text with a vector. The scroll bar is used to highlight the indexed line and delete the selected line, OnMouseUp. The scroll bar isn't the best choice for this function, seperate up and down buttons would have been a better choice. It's been left in as much to show why it's a poor choice for this function.

<Home>


Download
Delphi 3 Source and EXE (160 KB): linetest.zip

Last Updated 11/06/98

Home Purchasing

Delphi Feedback