473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Q: Creating Vector Controls

MC
Hi all,

I have created my own "arrow" control where the user can drag the head
or tail around to reposition it, much like any vector-based line that
has an arrow head. It draws over top of other controls like any
vector graphic should but it has some problems.. In order to get as
far as I've gotten, I've 1) made the control transparent using
CreateParams.ExStyle |= WS_EX_TRANSPARENT (got this as a sample; it
was the only way it would work correctly for what I'm doing) 2)
overridden OnPaintBackground() and commented out the base class call,
and 3) made the control's Size the same size as its container, so that
the user could drag it anywhere around the container. Two things are
bad about this design (okay, maybe more that you can point out): the
control is as big as the container, which means no other control gets
mouse events and second, moving the arrow makes it flicker.

I think I can solve the first problem using regions, yes? Would it be
a good idea to restrict the size to one that is just big enough to be
a bounding rectangle for the arrow (which would require me to change
that size whenever the length/angle of the arrow changes)? Or should
I keep the size the same as the container's and just create a region
that is identical to the contour of the arrow?

As for the flicker problem, it seems to require my own double
buffering (I couldn't get ControlStyles.DoubleBuffer to work for me
but maybe I'm doing it wrong.) In order to do that, it seems that I
need to ask the container to repaint itself to a buffer that belongs
to the arrow control (it would need to repaint itself, and all its
controls, save the one that I'll repaint myself). If I'm not
mistaken, I can't simply do a capture of the container because I'll
end up capturing the the arrow in the process, which has not yet been
repositioned. But how do you tell a control (i.e. the container) to
repaint, not to the screen, but to a buffer? Am I barking up the
wrong tree on this one?

Thanks for any help. Please follow up--my email has been
"spamproofed".

Craig
Nov 15 '05 #1
0 1061

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mani | last post by:
Hi, can anyone help me on how to create a control array in C++ builder like we create in VB. I have another question regarding controls. I want to clear a group of text boxes in the form on a...
7
by: nog | last post by:
What's the best approach to creating many objects of a class? I have in mind using something analogous to a table to hold the data - which is in a form similar to (char name, char address, date...
2
by: Patrick | last post by:
I want to define a set of web-form templates in XML and render the equivalent web-form with ASP.NET, then process any input server controls on the form. Reading the XML file from Page_load is...
2
by: monkeydragon | last post by:
#define MAX_TABLE = 1024; BYTE* dynamic1D = new BYTE; later.. i want to create a dynamic 2d ARRAY like this: >] >] >]
9
by: aaragon | last post by:
I am trying to create a vector of type T and everything goes fine until I try to iterate over it. For some reason, the compiler gives me an error when I declare std::vector<T>::iterator iter;...
9
by: Jess | last post by:
Hello, I tried to clear a vector "v" using "v.clear()". If "v" contains those objects that are non-built-in (e.g. string), then "clear()" can indeed remove all contents. However, if "v"...
8
by: Bryan | last post by:
Hello all. I'm fairly new to c++. I've written several programs using std::vectors, and they've always worked just fine. Until today. The following is a snippet of my code (sorry, can't...
5
by: Peted | last post by:
Ive seen on the web third party componets such as custom buttons and guages and dashboard graphics in controls that graphicaly look realy good. I was wonderinghow they do thos great looking...
10
by: oktayarslan | last post by:
Hi all; I have a problem when inserting an element to a vector. All I want is reading some data from a file and putting them into a vector. But the program is crashing after pushing a data which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.