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  |
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 #15017 is a reply to message #15013] |
Wed, 26 March 2008 07:16   |
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?
6301079821bb4e47c5dfeea81d7a2804
|
|
|
|
Re: SizeGrip Problem or Bug [message #15079 is a reply to message #15019] |
Fri, 28 March 2008 18:46   |
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  |
 |
mirek
Messages: 14255 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
|
|
|
Goto Forum:
Current Time: Mon Apr 28 00:50:47 CEST 2025
Total time taken to generate the page: 0.03237 seconds
|