[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: comctl32: SysDateTimePick32 control add Alt+down hot key likewindows(try 2)
From:       "=?utf-8?B?Q2hhbmdodWkgTGl1?=" <liuchanghui () linuxdeepin ! com>
Date:       2015-02-26 3:38:22
Message-ID: tencent_233A20AC3BFE2C3562F5129D () qq ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

Hi Nikolay,
I update a new patch, do you think is it OK now ?
Thank you.






------------------
Regards,
Changhui.
 

 
 
 
------------------ Original ------------------
From:  "Nikolay Sivov"<bunglehead@gmail.com>;
Date:  Wed, Feb 25, 2015 04:12 PM
To:  "Changhui Liu"<liuchanghui@linuxdeepin.com>; 
Cc:  "wine-devel"<wine-devel@winehq.org>; 
Subject:  Re: comctl32: SysDateTimePick32 control add Alt+down hot key likewindows(try 2)

 
On 25.02.2015 10:56, Changhui Liu wrote:
> Superseded patch 109085
> http://source.winehq.org/patches/data/109085
>
> Change log:
> 1, Pass test on all Windows.
>
> 2, Add DTN_DROPDOWN and DTN_CLOSEUPnotification test.
>
> 3,
>
>>>/  +    case WM_SYSKEYDOWN:
> />>/  +        if (wParam == VK_DOWN)
> />>/  +        {
> />>/  +            POINT pt;
> />>/  +            RECT rect;
> />>/  +            GetClientRect(hwnd, &rect);
> />>/  +            pt.x = rect.right - GetSystemMetrics(SM_CXVSCROLL)/2;
> />>/  +            pt.y = rect.top + GetSystemMetrics(SM_CYHSCROLL)/2;
> />>/  +
> />>/  +            return DATETIME_LButtonDown (infoPtr, (SHORT)pt.x, (SHORT)pt.y);
> />>/  +        }
> />>/  +
> />>
>>>If it really works this way you should just make it drop directly,
>>without faking click point coordinates.
>
> Because most of code of the directly implement are same as DATETIME_LButtonDown,
> and too many repeat code looks bad.
> So faking click point coordinates can reuse code.
>

I'm not saying you should duplicate it, but reuse it in a clean way 
without hit testing - move relevant code somewhere and use it.

> +    if (WM_NOTIFY == message)
> +    {
> +        NMHDR* hdr = (NMHDR*)lParam;
> +
> +        if (hdr->code == DTN_DROPDOWN)
> +        {
> +            g_hWndMonthCal = (HWND)SendMessageA(hdr->hwndFrom, DTM_GETMONTHCAL, 0, 0);
> +            trace("open SysMonthCal32=%p\n", g_hWndMonthCal );
> +        }
> +        else if (hdr->code == DTN_CLOSEUP)
> +        {
> +            trace("close SysMonthCal32=%p\n", g_hWndMonthCal);
> +        }
> +    }

That's not a notification test as you don't check anything. Please add a 
proper message sequence test, we have tons of examples for those.
[Attachment #5 (text/html)]

<div>Hi Nikolay,</div><div>I update a new patch, do you think is it OK now \
?</div><div>Thank you.</div><div><br></div><div><sign signid="0"><div \
style="color:#909090;font-family:Arial \
Narrow;font-size:12px"><br><br><br><br>------------------</div><div \
style="font-size:14px;font-family:Verdana;color:#000;"><div>Regards,</div><div>Changhui.</div>
 </div></sign></div><div>&nbsp;</div><div><includetail><div>&nbsp;</div><div>&nbsp;</div><div \
style="font:Verdana normal 14px;color:#000;"><div style="FONT-SIZE: 12px;FONT-FAMILY: \
Arial Narrow;padding:2px 0 2px \
0;">------------------&nbsp;Original&nbsp;------------------</div><div \
style="FONT-SIZE: 12px;background:#efefef;padding:8px;"><div \
id="menu_sender"><b>From: </b>&nbsp;"Nikolay \
Sivov"&lt;bunglehead@gmail.com&gt;;</div><div><b>Date: </b>&nbsp;Wed, Feb 25, 2015 \
04:12 PM</div><div><b>To: </b>&nbsp;"Changhui \
Liu"&lt;liuchanghui@linuxdeepin.com&gt;; <wbr></div><div><b>Cc: \
</b>&nbsp;"wine-devel"&lt;wine-devel@winehq.org&gt;; <wbr></div><div><b>Subject: \
</b>&nbsp;Re: comctl32: SysDateTimePick32 control add Alt+down hot key \
likewindows(try 2)</div></div><div>&nbsp;</div>On 25.02.2015 10:56, Changhui Liu \
wrote:<br>&gt; Superseded patch 109085<br>&gt; \
http://source.winehq.org/patches/data/109085<br>&gt;<br>&gt; Change log:<br>&gt; 1, \
Pass test on all Windows.<br>&gt;<br>&gt; 2, Add DTN_DROPDOWN and \
DTN_CLOSEUPnotification test.<br>&gt;<br>&gt; 3,<br>&gt;<br>&gt;&gt;&gt;/&nbsp; \
+&nbsp;&nbsp;&nbsp; case WM_SYSKEYDOWN:<br>&gt; /&gt;&gt;/&nbsp; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (wParam == VK_DOWN)<br>&gt; \
/&gt;&gt;/&nbsp; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt; \
/&gt;&gt;/&nbsp; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
POINT pt;<br>&gt; /&gt;&gt;/&nbsp; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RECT \
rect;<br>&gt; /&gt;&gt;/&nbsp; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
GetClientRect(hwnd, &amp;rect);<br>&gt; /&gt;&gt;/&nbsp; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pt.x = rect.right \
- GetSystemMetrics(SM_CXVSCROLL)/2;<br>&gt; /&gt;&gt;/&nbsp; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pt.y = rect.top + \
GetSystemMetrics(SM_CYHSCROLL)/2;<br>&gt; /&gt;&gt;/&nbsp; +<br>&gt; /&gt;&gt;/&nbsp; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return \
DATETIME_LButtonDown (infoPtr, (SHORT)pt.x, (SHORT)pt.y);<br>&gt; /&gt;&gt;/&nbsp; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; /&gt;&gt;/&nbsp; +<br>&gt; \
/&gt;&gt;<br>&gt;&gt;&gt;If it really works this way you should just make it drop \
directly,<br>&gt;&gt;without faking click point coordinates.<br>&gt;<br>&gt; Because \
most of code of the directly implement are same as DATETIME_LButtonDown,<br>&gt; and \
too many repeat code looks bad.<br>&gt; So faking click point coordinates can reuse \
code.<br>&gt;<br><br>I'm not saying you should duplicate it, but reuse it in a clean \
way <br>without hit testing - move relevant code somewhere and use it.<br><br>&gt; \
+&nbsp;&nbsp;&nbsp; if (WM_NOTIFY == message)<br>&gt; +&nbsp;&nbsp;&nbsp; {<br>&gt; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NMHDR* hdr = (NMHDR*)lParam;<br>&gt; \
+<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (hdr-&gt;code == \
DTN_DROPDOWN)<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_hWndMonthCal = \
(HWND)SendMessageA(hdr-&gt;hwndFrom, DTM_GETMONTHCAL, 0, 0);<br>&gt; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; trace("open \
SysMonthCal32=%p\n", g_hWndMonthCal );<br>&gt; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if (hdr-&gt;code == \
DTN_CLOSEUP)<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; trace("close \
SysMonthCal32=%p\n", g_hWndMonthCal);<br>&gt; \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; +&nbsp;&nbsp;&nbsp; \
}<br><br>That's not a notification test as you don't check anything. Please add a \
<br>proper message sequence test, we have tons of examples for \
those.<br></div><!--<![endif]--></includetail></div>


["0003-comctl32-SysDateTimePick32-add-Alt-down-hot-key-like-w.txt" (application/octet-stream)]



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic