Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Drag & Drop box
Re: Drag & Drop box [message #26677 is a reply to message #26675] Wed, 19 May 2010 10:02 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Rett,

If I understand correctly, you want boxes moveable by user. To achieve this, you have basically two options:
  1. Using single class, probably derived directly from Ctrl, which would draw the boxes in its Paint() function.
  2. Having each box as a separate widget. I would take e.g. StaticText a derived the box from that.
In both cases, you can implement the mouse handling inside the LeftDown(), MouseMove() and LeftUp() functions. The idea is: in LeftDown you store position where user clicked, in MouseMove, you calculate the difference between the saved point and current position of mouse pointer and repaint the widget(in 1.)/move the widget(in 2.) and finally in LeftUp you put some cleanup code, like clearing the saved position.

Best regards,
Honza
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: real size of window
Next Topic: Basic question regarding callbacks
Goto Forum:
  


Current Time: Thu May 09 05:59:28 CEST 2024

Total time taken to generate the page: 0.02262 seconds