Home
main | mechanical | logistics | handheld devices | contact us   
Demos 
 
What are the Parametric2D Drawing Components

Screenshot

Parametric2D Drawing Components are visual components usable with Borland C++Builder and Delphi.

The main idea of using Parametric2D Drawing Components is to compile graphical drawings with the executables and to be able to modify the shapes of the drawings at runtime according to new variables. Instead of having static image with dimensions prompting the user to enter some values with Parametric2D Drawing Components you get a drawing that changes with the new entered values and gives visual control and understanding of the input for the user.

The Parametric2D Drawing Components version 1.0 by now consists of two components that are TParView and TParModel.

The minimum steps required to add Parametric2D Drawing functionality to a form enough to follow these steps:

  • Drop one TParView control from the Samples tab of the components palette on to the form and choose its size and alignment, let its name be ParView1;
  • Drop one TParModel component from the Samples tab of the components palette on to the form, let its name be ParModel1
  • Double click on the Vars property of ParModel1 and type the following two strings in the strings editor: Width=10 Height=5
  • Double click on the Desc property of ParModel1 and type the following string in the strings editor: Ellipse.1: X2=Width; Y2=Height;
  • Click on the Model property of ParView1 and select ParModel1 from the drop down list. ParView1 now displays the parametric ellipse you just described. More complex drawings need more Vars strings and more shapes described in Desc of the TParModel.

    The view is not notified when the variables or description of the model change. To see the changes you have to enforce the TParView to invalidate. If you are in design time you can select the model again in the Model property of TParView or force the form to repaint itself somehow. At runtime you can call the Invalidate method of TParView or Paint method immediately after you make changes to the TParModel.

    Download free binary and source

    « Back to Demos

  •