Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

control points around object ( cf CorelDraw )

Posted on 1998-07-04
5
Medium Priority
?
227 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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

609 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