Board index » cppbuilder » passing parameter between

passing parameter between


2005-01-31 03:59:07 AM
cppbuilder95
Hi,
I am trying to build an MDI application.
The application has a 2D plotting functionality.
Each Time I press the 2D option on the Toolbar a childform opens which
has an frame named 2Dframe insert onto the child form.
On the 2Dframe I am using TImage component to draw the 2D graph. The
TImage component is passed on to the constructor of the 2DPlot class
which has the member and functionalities associated with the 2D
plotting. The 2Dplot class is defined in the ChildForm.cpp
The 2Dplot has the following functionality where i use Mousedown event
of the TImage to hightlight a rectangular region of the plot and get the
screen dimension of the rectangle. Using these dimension I can then get
the index of the data point lying inside the rectangle.
The MouseDown event is declared in the 2DFrame.cpp
The problem currently Iam facing is how to pass the screen dimension got
from the MouseDown listener defined in 2DFrame.cpp to the 2Dplot class
defined in ChildForm.cpp.
I hope the information I have provided is sufficient.
thank you
Johnson Abraham
 
 

Re:passing parameter between

Johnson Abraham < XXXX@XXXXX.COM >wrote:
Quote

[...] has an frame
I would recommend not using a frame unless the frame is used
in multiple applications. Otherwise, a simple application-wide
class is all that's needed.
Quote
[...] how to pass the screen dimension got from the
MouseDown listener defined in 2DFrame.cpp to the 2Dplot
class defined in ChildForm.cpp.
Define a global TRect. In the MouseDown, assign X,Y as
Rect.left and Rect.top. In the MouseUp, assign X,Y as
Rect.right and Rect.bottom.
~ JD