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 » U++ Library support » U++ Widgets - General questions or Mixed problems » Label and Focus
Label and Focus [message #13251] Wed, 26 December 2007 10:45 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I put a picture made with the iml designer inside a label to build a piece of a chessboard. I can drag it over an empty layout with this snippet:

void Chessboard::LeftDown(Point pos, dword flags) 
{   if (!piece.HasCapture()) piece.SetCapture();
	else piece.ReleaseCapture();      
}

 
void Chessboard::MouseMove(Point pos, dword flags) 
{     
    p = pos;    
    if (piece.HasCapture()) piece.LeftPosZ(p.x - D/2, D).TopPosZ(p.y - D/2, D);
 	Refresh();
}


Unfortunately the piece is moved even when I click click and drag OUT of the label size.
Perhaps I've programmed in a bad way, but now I need to know when I leftclick if I clicked the label or the empty layout. Is there a way?
In future, with many pieces on the board (32), I need to recover the name/adress of the piece. In this case a button with a focus maybe a better ctrl? By the way, in the previous snippet If I change the Label with a Button I'm not able to click and drag anything.

Thank you,
Luigi

PS: I attach the whole package, just other few lines, for a better understanding
 
Read Message
Read Message
Read Message
Previous Topic: Horizontal scrolling for ArrayCtrl
Next Topic: Button color Foreground Background
Goto Forum:
  


Current Time: Thu May 16 06:16:18 CEST 2024

Total time taken to generate the page: 0.02182 seconds