Author: Erik Robertsson
Date: 15:40:33 11/30/01
Go up one level in this thread
On November 30, 2001 at 12:46:40, Eran wrote: > >I develop a chess interface based on MFC 6. The draggable chess pieces, from >bitmap sources, are not based on Ole Drag and Drop at all but based on >OnLButtonDown, OnMouseMove, and OnLButtonUp functions. I successfully drag them >smoothly every where on the chess board window, but I do not know how to write >code that make a dragged chess piece snapped into a new square. In addition, I >do not know how to write another code that when a chess player cancels dragging >a chess piece, it should automatically snap back to an old square. I do not know >whether the CRectTracker::AdjustRect function works out for it. > >If you know how to do it or if you have a nice code as a sample, please let me >know. > >I would appreciate your help a lot. > >Thanks in advance, >Eran >Owner of MS Visual C++ 6 program >My new email address: erk@012.net.il What you can do is lock all mouse messages to your window while the user drags a piece. This way you can have the functionality of dropping the piece outside the window for cancelling a piece drag. Just like in Winboard. Erik
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.