Board index » cppbuilder » moving controls during runtime...

moving controls during runtime...


2006-06-20 06:50:43 PM
cppbuilder96
Hi everyone. I have been having a reoccurring problem now for the last
week or so and I'm really stuck. I am building an application that lets
users place and move controls around on a form during runtime. Given
that not all VCL components have a MouseDown method I'm using OnDrag
methods to allow the user to move the components around. This is working
Ok except for one MAJOR problem I can't seem to fix: whenever I click on
a GUI control to move it it jumps first so that the top left hand corner
aligns with the position of the cursor. I have searched through the
archives but every fix uses one of the Mouse Down/Move methods which not
all VCL components have access to, for example a TScrollBar. I posted
code yesterday under the subject OnDrag..., if anyone can point me in a
direction that does not uses a MouseDown method can you please let me
know. Failing that, can anyone suggest an easier way to do this?
Thanks,
Rory.
 
 

Re:moving controls during runtime...

Hi Rory,
I have an idea I've used several times for weird stuff I needed to do.
How about building a set of 'fake' controls? (that appear identical to
the real ones...) The real controls become non-visible when the user
grabs them and the fakes take their place. The fake controls would all
respond to mouse events and be very easy to manipulate... Once the user
places them they 'revert' to the actual controls. To facilitate selection
you might maintain a 'map' of the interface to stream line the selection
process. This would allow you to approach a somewhat 'virtual' interface.
(I've done weirder things... ???)
Bruce
 

Re:moving controls during runtime...

Got it!
groups.google.ie/group/borland.public.cppbuilder.vcl/browse_frm/thread/3226c29e89378693/02c14a443e005930
Rory.
Rory Walsh wrote:
Quote
Hi everyone. I have been having a reoccurring problem now for the last
week or so and I'm really stuck. I am building an application that lets
users place and move controls around on a form during runtime. Given
that not all VCL components have a MouseDown method I'm using OnDrag
 

{smallsort}

Re:moving controls during runtime...

Thanks Bruce, that was going to be my next approach! Thankfully it's now
sorted. What a relief!
Rory.
Bruce Larrabee wrote:
Quote

Hi Rory,

I have an idea I've used several times for weird stuff I needed to do.
How about building a set of 'fake' controls? (that appear identical to
the real ones...) The real controls become non-visible when the user
grabs them and the fakes take their place. The fake controls would all
respond to mouse events and be very easy to manipulate... Once the user
places them they 'revert' to the actual controls. To facilitate
selection
you might maintain a 'map' of the interface to stream line the
selection
process. This would allow you to approach a somewhat 'virtual'
interface.

(I've done weirder things... ???)

Bruce
 

Re:moving controls during runtime...

"Rory Walsh" < XXXX@XXXXX.COM >wrote in message
Quote
Thanks Bruce, that was going to be my next approach! Thankfully it's now
sorted. What a relief!

Rory.
Hi Rory,
It sounds like you might find the LMD Designpack useful...
www.lmd.de/mfs/products/LMDDsg20.php
I'm just a happy customer.
- Roddy
 

Re:moving controls during runtime...

Cheers I will check it out when I get a chance.
Rory.
Roddy Pratt wrote:
Quote
"Rory Walsh" < XXXX@XXXXX.COM >wrote in message
news:4497db1e$ XXXX@XXXXX.COM ...
>Thanks Bruce, that was going to be my next approach! Thankfully it's now
>sorted. What a relief!
>
>Rory.

Hi Rory,

It sounds like you might find the LMD Designpack useful...

www.lmd.de/mfs/products/LMDDsg20.php

I'm just a happy customer.

- Roddy