Solved

control points around object ( cf CorelDraw )

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

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

Suggested Solutions

Title # Comments Views Activity
thread-safe code in c++ 2 127
computer science syllabus 3 115
max float value 3 72
Need some help with mailto 16 42
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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.

732 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