?
Solved

control points around object ( cf CorelDraw )

Posted on 1998-07-04
5
Medium Priority
?
230 Views
Last Modified: 2010-04-01
I want to create an object in C++ Builder that i can use to resize/ rotate a line, rectangle, polyline much like the way coreldraw does, it has to be a seperate object that i can use for any kind of shape. All suggestions are welcome
0
Comment
Question by:pdroogma
  • 4
5 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1167176
you will probably want to use a class hierarchy.  You will want a base class that defines the interface to the other classes using a bunch of virtual functions.   One function, for example, would draw the object.  Then you would define derived classes that impliment the virtual functions for each shape, like elipses and rectangles etc.

You might want the base class to store a bounding rectangle for the shape, then the derived class would be responsible for drawing so as to fill the rectangle.  That way, when the object is resized the base class just resizes the bounding rectangle and tellss the derived class to redraw.  You would then draw the control points around the bounding rectangle at the corners and the middle of the edges.

I hope this helps.



0
 
LVL 22

Expert Comment

by:nietod
ID: 1167177
What's happening with this?  was the answer of any use to you?  do you need more?
0
 
LVL 22

Accepted Solution

by:
nietod earned 200 total points
ID: 1167178
I guess not.
0
 

Author Comment

by:pdroogma
ID: 1167179
Thanks for you're comment.

Maybe you can help me again, I need to write an event to capture the mouse clicks, for shapes there's not really a problem but a have to put the control boxes around a line when the user clicks on the line itself, any suggestions
0
 
LVL 22

Expert Comment

by:nietod
ID: 1167180
I'm not sure what exactly you are asking about or having problems with.  Is it fact that the line is too thin to have a control box?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question