+ case WM_CONTROL:
+ switch(SHORT2FROMMP(wParam))
+ {
+ case BN_PAINT:
+ {
+ HWND hWnd = ::WinWindowFromID((HWND)GetHwnd(), SHORT1FROMMP(wParam));
+ wxWindowOS2* pWin = wxFindWinFromHandle(hWnd);
+
+ if (!pWin)
+ {
+ bProcessed = FALSE;
+ break;
+ }
+ if (pWin->IsKindOf(CLASSINFO(wxBitmapButton)))
+ {
+ wxBitmapButton* pBitmapButton = wxDynamicCast(pWin, wxBitmapButton);
+
+ pBitmapButton->OS2OnDraw((WXDRAWITEMSTRUCT *)lParam);
+ }
+ return 0;
+ }
+ break;
+
+ case BKN_PAGESELECTEDPENDING:
+ {
+ PPAGESELECTNOTIFY pPage = (PPAGESELECTNOTIFY)lParam;
+
+ if ((pPage->ulPageIdNew != pPage->ulPageIdCur) &&
+ (pPage->ulPageIdNew > 0L && pPage->ulPageIdCur > 0L))
+ {
+ wxWindowOS2* pWin = wxFindWinFromHandle(pPage->hwndBook);
+ wxNotebookEvent vEvent( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
+ ,(int)SHORT1FROMMP(wParam)
+ ,(int)pPage->ulPageIdNew
+ ,(int)pPage->ulPageIdCur
+ );
+ if (!pWin)
+ {
+ bProcessed = FALSE;
+ break;
+ }
+ if (pWin->IsKindOf(CLASSINFO(wxNotebook)))
+ {
+ wxNotebook* pNotebook = wxDynamicCast(pWin, wxNotebook);
+
+ vEvent.SetEventObject(pWin);
+ pNotebook->OnSelChange(vEvent);
+ bProcessed = TRUE;
+ }
+ else
+ bProcessed = FALSE;
+ }
+ else
+ bProcessed = FALSE;
+ }
+ break;
+
+ case BN_CLICKED: // Dups as LN_SELECT and CBN_LBSELECT
+ {
+ HWND hWnd = ::WinWindowFromID((HWND)GetHwnd(), SHORT1FROMMP(wParam));
+ wxWindowOS2* pWin = wxFindWinFromHandle(hWnd);
+
+ if (!pWin)
+ {
+ bProcessed = FALSE;
+ break;
+ }
+ //
+ // Simulate a WM_COMMAND here, as wxWidgets expects all control
+ // button clicks to generate WM_COMMAND msgs, not WM_CONTROL
+ //
+ if (pWin->IsKindOf(CLASSINFO(wxRadioBox)))
+ {
+ wxRadioBox* pRadioBox = wxDynamicCast(pWin, wxRadioBox);
+
+ pRadioBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
+ ,(WXUINT)SHORT1FROMMP(wParam)
+ );
+ }
+ if (pWin->IsKindOf(CLASSINFO(wxRadioButton)))
+ {
+ wxRadioButton* pRadioButton = wxDynamicCast(pWin, wxRadioButton);
+
+ pRadioButton->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
+ ,(WXUINT)SHORT1FROMMP(wParam)
+ );
+ }
+ if (pWin->IsKindOf(CLASSINFO(wxCheckBox)))
+ {
+ wxCheckBox* pCheckBox = wxDynamicCast(pWin, wxCheckBox);
+
+ pCheckBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
+ ,(WXUINT)SHORT1FROMMP(wParam)
+ );
+ }
+ if (pWin->IsKindOf(CLASSINFO(wxListBox)))
+ {
+ wxListBox* pListBox = wxDynamicCast(pWin, wxListBox);
+
+ pListBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
+ ,(WXUINT)SHORT1FROMMP(wParam)
+ );
+ if (pListBox->GetWindowStyle() & wxLB_OWNERDRAW)
+ Refresh();
+ }
+ if (pWin->IsKindOf(CLASSINFO(wxComboBox)))
+ {
+ wxComboBox* pComboBox = wxDynamicCast(pWin, wxComboBox);
+
+ pComboBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
+ ,(WXUINT)SHORT1FROMMP(wParam)
+ );
+ }
+ return 0;
+ }
+ break;
+
+ case LN_ENTER: /* dups as CBN_EFCHANGE */
+ {
+ HWND hWnd = HWNDFROMMP(lParam);
+ wxWindowOS2* pWin = wxFindWinFromHandle(hWnd);
+
+ if (!pWin)
+ {
+ bProcessed = FALSE;
+ break;
+ }
+ //
+ // Simulate a WM_COMMAND here, as wxWidgets expects all control
+ // button clicks to generate WM_COMMAND msgs, not WM_CONTROL
+ //
+ if (pWin->IsKindOf(CLASSINFO(wxListBox)))
+ {
+ wxListBox* pListBox = wxDynamicCast(pWin, wxListBox);
+
+ pListBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
+ ,(WXUINT)SHORT1FROMMP(wParam)
+ );
+ if (pListBox->GetWindowStyle() & wxLB_OWNERDRAW)
+ Refresh();
+
+ }
+ if (pWin->IsKindOf(CLASSINFO(wxComboBox)))
+ {
+ wxComboBox* pComboBox = wxDynamicCast(pWin, wxComboBox);
+
+ pComboBox->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
+ ,(WXUINT)SHORT1FROMMP(wParam)
+ );
+ }
+ return 0;
+ }
+ break;
+