Solved

control points around object ( cf CorelDraw )

Posted on 1998-07-04
5
217 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
Comment Utility
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
Comment Utility
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
Comment Utility
I guess not.
0
 

Author Comment

by:pdroogma
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

771 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

11 Experts available now in Live!

Get 1:1 Help Now