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.

Comments

  • If you want to draw a diagonal line at design then use the drawing tool or you can go to the best institute in bhubaneswar where you can learn easily all the drawing techniques.
  • edited 2:39PM
    Hello,

    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 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.
  • edited May 2019
    My question is entirely about the custom component. Ignoring that is not helpful.

    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.
  • edited 2:39PM
    So, the only way I could fix this was to:

    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"

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.