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++ Library : Other (not classified elsewhere) » SizeGrip Problem or Bug
SizeGrip Problem or Bug [message #15001] Tue, 25 March 2008 03:43 Go to next message
huanghuan is currently offline  huanghuan
Messages: 10
Registered: December 2007
Promising Member
void SizeGrip::LeftDown(Point p, dword flags)
{
	TopWindow *q = dynamic_cast<TopWindow *>(GetTopCtrl());
	if(!q || q->IsMaximized() || !q->IsSizeable()) return;
#ifdef PLATFORM_WIN32
	HWND hwnd = q->GetHWND();
	if(hwnd) {
		::SendMessage(hwnd, WM_SYSCOMMAND, 0xf008, MAKELONG(p.x, p.y));
		::SendMessage(hwnd, WM_LBUTTONUP, 0, MAKELONG(p.x, p.y));
	}
#endif


1. Why send these two message to the top window, and why 0xf008 ?
2. Maybe there is a bug in the second param make from "p". In a case, when SizeGrip leftdown, the ctrl in this window at the topleft will be also receive a leftdown call. These two p values are relative.
Re: SizeGrip Problem or Bug [message #15013 is a reply to message #15001] Tue, 25 March 2008 22:32 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
This is an undocumented way how to tell Win32 it should start window resize loop.

Mirek
Re: SizeGrip Problem or Bug [message #15017 is a reply to message #15013] Wed, 26 March 2008 07:16 Go to previous messageGo to next message
jerry is currently offline  jerry
Messages: 4
Registered: March 2008
Junior Member
I am a friend of Mr. huanghuan's.

The problem is:

>> ::SendMessage(hwnd, WM_SYSCOMMAND, 0xf008, MAKELONG(p.x, p.y));
>> ::SendMessage(hwnd, WM_LBUTTONUP, 0, MAKELONG(p.x, p.y));

'p' is a relative position to SizeGrip its self, send it to hwnd?
It's not problem? Laughing


6301079821bb4e47c5dfeea81d7a2804
Re: SizeGrip Problem or Bug [message #15019 is a reply to message #15017] Wed, 26 March 2008 08:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes, you are problably correct. Anyway, my guts feeling is that it would work with 0 instead too Wink

However, going to fix it.

Mirek
Re: SizeGrip Problem or Bug [message #15079 is a reply to message #15019] Fri, 28 March 2008 18:46 Go to previous messageGo to next message
huanghuan is currently offline  huanghuan
Messages: 10
Registered: December 2007
Promising Member
thank you.
BTW, as you words IF code like this:
::SendMessage(hwnd, WM_SYSCOMMAND, 0xf008, MAKELONG(0, 0));
::SendMessage(hwnd, WM_LBUTTONUP, 0, MAKELONG(0, 0));


maybe a leftup sended to the topwindow. Then if a ctrl there at (0,0) and accept this mouse event ...
So I think a relative location should be calculated.

In this leftdown function, as "SendMessage" work, the leftup will be called. It is a little strange.
Re: SizeGrip Problem or Bug [message #15082 is a reply to message #15079] Fri, 28 March 2008 21:37 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Ops, I should have checked before... but what you are quoting is from 2007.1 U++, right?

Current code is:

void SizeGrip::LeftDown(Point p, dword flags)
{
	TopWindow *q = dynamic_cast<TopWindow *>(GetTopCtrl());
	if(!q || q->IsMaximized() || !q->IsSizeable()) return;
#ifdef PLATFORM_WIN32
	HWND hwnd = q->GetHWND();
	p = GetMousePos() - q->GetRect().TopLeft();
	if(hwnd) {
		::SendMessage(hwnd, WM_SYSCOMMAND, 0xf008, MAKELONG(p.x, p.y));
		::SendMessage(hwnd, WM_LBUTTONUP, 0, MAKELONG(p.x, p.y));
	}



So it looks like I has been fixed already...

Mirek
Previous Topic: Visual Studio project files SVN rev. 197 (03/26/08)
Next Topic: New member needs help
Goto Forum:
  


Current Time: Thu Mar 28 10:31:05 CET 2024

Total time taken to generate the page: 0.01879 seconds