Custom Component: How to draw diagonal line at design
I have a custom Component that is a descendant of the TfrxLineView. Ideally, I want it to behave like the diagonal line during design time. However, I'm running into an issue during the initial draw (when you are first putting it down).
1. It draws as a line, not as the component.
2. It draws as a straight line, not a diagonal line, no matter what.
3. FX, FX1, etc. are always the bounding box, not where the original and current cursor positions. This means that my line draws to the bounding box, from left to right, regardless of what it is expecting.
Obviously there is some sort of "initial draw" function, but I have no idea what to do or which one to override.
1. It draws as a line, not as the component.
2. It draws as a straight line, not a diagonal line, no matter what.
3. FX, FX1, etc. are always the bounding box, not where the original and current cursor positions. This means that my line draws to the bounding box, from left to right, regardless of what it is expecting.
Obviously there is some sort of "initial draw" function, but I have no idea what to do or which one to override.
Comments
I cant comment since you are using custom Component but in Fast Report there are options under the drawing options. You can see ss attached.
Regards.
I have a component that is a child component of the Line Object. What I want it to do is draw my object from start to finish.
However, right now what is happening is that when the user starts, they are greeted with a non-diagonal line. And then, after placing it, the bounding box drawn turns into my object.
Obviously there is some sort of "Initial Draw" that is called first, and then all the parameters are passed to a "Draw" function. However, I cannot find it because I don't think it is part of the class--I think it might be on the fast report drawing code itself.
Attached are two pictures "Initial Draw", which is where the user has placed one point down and is drawing. What is resulting is a horizontal line, even though the mouse is clearly not horizontal.
Next I have the other issue: I finally get access to the "Draw", but the FX, FY, and FX1, FY1 variables are of the bounding box, not of the points. FX,FY are ALWAYS the upper left corner of the bounding box, not the anchor point like it should be.
A. Make the Parent class the "TfrxLineView" instead of "TfrxCustomLineView"
B. Make sure the "flags" constructor is made
C. Register the component with a flag of "1"