msflags |= WS_VISIBLE;
}
- return MSWCreate(wxCanvasClassName, NULL, pos, size, msflags, exstyle);
+ bool retVal = MSWCreate(wxCanvasClassName, NULL, pos, size, msflags, exstyle);
+ if (retVal)
+ SetWindowLong( (HWND)m_hWnd, GWL_WNDPROC, (LONG)wxWndProc);
+ return retVal;
}
// ---------------------------------------------------------------------------
WXHWND wxWindowMSW::MSWGetParent() const
{
- return m_parent ? m_parent->GetHWND() : NULL;
+ return m_parent ? m_parent->GetHWND() : WXHWND(NULL);
}
bool wxWindowMSW::MSWCreate(const wxChar *wclass,
// ---------------------------------------------------------------------------
#ifdef __WIN95__
-// FIXME: VZ: I'm not sure at all that the order of processing is correct
+
bool wxWindowMSW::HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
{
#ifndef __WXMICROWIN__
HWND hWnd = hdr->hwndFrom;
wxWindow *win = wxFindWinFromHandle((WXHWND)hWnd);
- // is this one of our windows?
+ // if the control is one of our windows, let it handle the message itself
if ( win )
{
return win->MSWOnNotify(idCtrl, lParam, result);
}
+ // VZ: why did we do it? normally this is unnecessary and, besides, it
+ // breaks the message processing for the toolbars because the tooltip
+ // notifications were being forwarded to the toolbar child controls
+ // (if it had any) before being passed to the toolbar itself, so in my
+ // example the tooltip for the combobox was always shown instead of the
+ // correct button tooltips
+#if 0
// try all our children
wxWindowList::Node *node = GetChildren().GetFirst();
while ( node )
node = node->GetNext();
}
+#endif // 0
- // finally try this window too (catches toolbar case)
+ // by default, handle it ourselves
return MSWOnNotify(idCtrl, lParam, result);
#else // __WXMICROWIN__
return FALSE;
// we need to handle it as well, otherwise no tooltips will be shown in
// this case
- if ( !(code == TTN_NEEDTEXTA || code == TTN_NEEDTEXTW) || ttip.empty() )
+ if ( !(code == (WXUINT) TTN_NEEDTEXTA || code == (WXUINT) TTN_NEEDTEXTW) || ttip.empty() )
{
// not a tooltip message or no tooltip to show anyhow
return FALSE;
LPTOOLTIPTEXT ttText = (LPTOOLTIPTEXT)lParam;
- if ( code == TTN_NEEDTEXTA )
+ if ( code == (WXUINT) TTN_NEEDTEXTA )
{
ttText->lpszText = (wxChar *)ttip.c_str();
}
return FALSE;
}
+
#endif // __WIN95__
// ---------------------------------------------------------------------------