Solved

control points around object ( cf CorelDraw )

Posted on 1998-07-04
5
218 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 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

919 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now