haru-s
Joined: 28 Mar 2009 Posts: 8 Location: Japan
|
Posted: Fri Jan 01, 2010 2:09 am Post subject: A Patch for DFL rev 81 + dmd 2.038 |
|
|
Dear DFL friends!
I made a patch for DFL rev 81 + dmd 2.038
This patch contains some fixes.
First, In toolbar.d,
Code: |
protected override void onReflectedMessage(ref Message m) // <<<<<<<<<<<< (1)
{
switch(m.msg)
{
case WM_NOTIFY:
{
auto nmh = cast(LPNMHDR)m.lParam;
switch(nmh.code)
{
case NM_CLICK:
{
auto nmm = cast(LPNMMOUSE)nmh;
if(nmm.dwItemData)
{
auto tbb = cast(ToolBarButton)cast(void*)nmm.dwItemData;
scope ToolBarButtonClickEventArgs bcea = new ToolBarButtonClickEventArgs(tbb);
onButtonClick(bcea);
}
}
break;
case TBN_DROPDOWN:
version(DFL_TOOLBAR_NO_MENU) // This condition might be removed later.
{
}
else // Ditto.
{
auto nmtb = cast(LPNMTOOLBARA)nmh; // NMTOOLBARA/NMTOOLBARW doesn't matter here; string fields not used.
auto tbb = buttomFromID(nmtb.iItem);
if(tbb)
{
version(DFL_TOOLBAR_NO_MENU) // Keep this here in case the other condition is removed.
{
}
else // Ditto.
{
if(tbb._cmenu)
{
auto brect = tbb.rectangle;
tbb._cmenu.show(this, pointToScreen(Point(brect.x, brect.bottom)));
// Note: showing a menu also triggers a click!
}
}
}
}
return TBDDRET_DEFAULT; // <<<<<<<<<<<< (2)
default: ;
}
}
break;
default: ;
super.onReflectedMessage(m);
}
}
|
The function onReflectedMessage's return value type is void, but it returns TBDDRET_DEFAULT.
So I did comment out as quick-fix.
Second, I replaced from inout to ref.
Third, struct Point, Rect, and Size's opEquals had ref const parameter, but mutable parameter.
... and the other minor changes.
Happy New Year! |
|