-// this macro is dangerous but still better than tons of (HWND)GetHWND()
-#define hwnd (HWND)GetHWND()
-
-bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
-{
- /*
- if (param == LBN_SELCANCEL)
- {
- event.extraLong = FALSE;
- }
- */
- if (param == LBN_SELCHANGE)
- {
- wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, m_windowId);
- wxArrayInt aSelections;
- int count = GetSelections(aSelections);
- if ( count > 0 )
- {
- event.m_commandInt = aSelections[0] ;
- event.m_clientData = GetClientData(event.m_commandInt);
- wxString str(GetString(event.m_commandInt));
- if (str != "")
- event.m_commandString = copystring((char *)(const char *)str);
- }
- else
- {
- event.m_commandInt = -1 ;
- event.m_commandString = copystring("") ;
- }
-
- event.SetEventObject( this );
- ProcessCommand(event);
- if (event.m_commandString)
- delete[] event.m_commandString ;
- return TRUE;
- }
- else if (param == LBN_DBLCLK)
- {
- wxCommandEvent event(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, m_windowId);
- event.SetEventObject( this );
- GetEventHandler()->ProcessEvent(event) ;
- return TRUE;
- }
-
- return FALSE;
-}