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 » chess like drag&drop possible in u++ ?
Re: chess like drag&drop possible in u++ ? [message #28840 is a reply to message #28801] Sun, 19 September 2010 10:45 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1791
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Andrea!

Welcome to the forum Wink

I was hoping someone more skilled with the DnD will answer you, but since nobody did, I'll try myself. So, sorry it took so long. Hopefully someone corrects me if I make some mistakes.

Doing drag and drop apps is of course possible in U++, and it is not really difficult. The biggest problem is lack of documentation, but hopefully this example will help you.

What you have to do is to create your own widget, inherited from Ctrl (or some other widget, if you want to reuse some code and save some typing) and override few virtual methods that deal with the DnD. Absolute minimum is to implement LeftDrag() and DragAndDrop(). The first is taking care of the dragging and is called when you start dragging. It should contain call to DoDragAndDrop() which waits till you drop and let you perform any necessary cleanup. The second function, DragAndDrop is taking care of accepting the dragged item. It is called over and over again, until you drop the item.

I attach a simple example, hopefully it will help you. I left there LOG calls so you can get better idea of how the functions are called (you can view the log by pressing Alt+L after running the app).

Don't be afraid to ask if you need more details, there is always someone willing to answer in this forum Wink

Best regards,
Honza
  • Attachment: dnd.zip
    (Size: 1.56KB, Downloaded 249 times)
 
Read Message icon7.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Debugger: access to global variables.
Next Topic: TreeCtrl: How to...?
Goto Forum:
  


Current Time: Fri Jul 18 07:31:45 CEST 2025

Total time taken to generate the page: 0.04139 seconds