]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/listbox.cpp
reverted wxMGL-specific code (didn't mean to commit this...)
[wxWidgets.git] / src / univ / listbox.cpp
index b0ef47a462dab88629193d0d8d1248182978a823..37fe1fbd72fef07519e04321bd44838de2478c48 100644 (file)
@@ -5,7 +5,7 @@
 // Modified by:
 // Created:     30.08.00
 // RCS-ID:      $Id$
-// Copyright:   (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
+// Copyright:   (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
@@ -242,7 +242,7 @@ void wxListBox::DoClear()
         size_t count = m_itemsClientData.GetCount();
         for ( size_t n = 0; n < count; n++ )
         {
-            delete m_itemsClientData[n];
+            delete (wxClientData *) m_itemsClientData[n];
         }
     }
 
@@ -275,7 +275,7 @@ void wxListBox::Delete(int n)
 
     if ( HasClientObjectData() )
     {
-        delete m_itemsClientData[n];
+        delete (wxClientData *)m_itemsClientData[n];
     }
 
     m_itemsClientData.RemoveAt(n);
@@ -1236,7 +1236,7 @@ wxStdListboxInputHandler::SetupCapture(wxListBox *lbox,
     return action;
 }
 
-bool wxStdListboxInputHandler::HandleKey(wxControl *control,
+bool wxStdListboxInputHandler::HandleKey(wxInputConsumer *consumer,
                                          const wxKeyEvent& event,
                                          bool pressed)
 {
@@ -1244,7 +1244,7 @@ bool wxStdListboxInputHandler::HandleKey(wxControl *control,
     if ( pressed && !event.AltDown() )
     {
         bool isMoveCmd = TRUE;
-        int style = control->GetWindowStyle();
+        int style = consumer->GetInputWindow()->GetWindowStyle();
 
         wxControlAction action;
         wxString strArg;
@@ -1255,7 +1255,9 @@ bool wxStdListboxInputHandler::HandleKey(wxControl *control,
             // movement
             case WXK_UP:    action = wxACTION_LISTBOX_MOVEUP; break;
             case WXK_DOWN:  action = wxACTION_LISTBOX_MOVEDOWN; break;
+            case WXK_PAGEUP:
             case WXK_PRIOR: action = wxACTION_LISTBOX_PAGEUP; break;
+            case WXK_PAGEDOWN:
             case WXK_NEXT:  action = wxACTION_LISTBOX_PAGEDOWN; break;
             case WXK_HOME:  action = wxACTION_LISTBOX_START; break;
             case WXK_END:   action = wxACTION_LISTBOX_END; break;
@@ -1284,24 +1286,24 @@ bool wxStdListboxInputHandler::HandleKey(wxControl *control,
 
         if ( !!action )
         {
-            control->PerformAction(action, -1, strArg);
+            consumer->PerformAction(action, -1, strArg);
 
             if ( isMoveCmd )
             {
                 if ( style & wxLB_SINGLE )
                 {
                     // the current item is always the one selected
-                    control->PerformAction(wxACTION_LISTBOX_SELECT);
+                    consumer->PerformAction(wxACTION_LISTBOX_SELECT);
                 }
                 else if ( style & wxLB_EXTENDED )
                 {
                     if ( event.ShiftDown() )
-                        control->PerformAction(wxACTION_LISTBOX_EXTENDSEL);
+                        consumer->PerformAction(wxACTION_LISTBOX_EXTENDSEL);
                     else
                     {
                         // select the item and make it the new selection anchor
-                        control->PerformAction(wxACTION_LISTBOX_SELECT);
-                        control->PerformAction(wxACTION_LISTBOX_ANCHOR);
+                        consumer->PerformAction(wxACTION_LISTBOX_SELECT);
+                        consumer->PerformAction(wxACTION_LISTBOX_ANCHOR);
                     }
                 }
                 //else: nothing to do for multiple selection listboxes
@@ -1311,13 +1313,13 @@ bool wxStdListboxInputHandler::HandleKey(wxControl *control,
         }
     }
 
-    return wxStdInputHandler::HandleKey(control, event, pressed);
+    return wxStdInputHandler::HandleKey(consumer, event, pressed);
 }
 
-bool wxStdListboxInputHandler::HandleMouse(wxControl *control,
+bool wxStdListboxInputHandler::HandleMouse(wxInputConsumer *consumer,
                                            const wxMouseEvent& event)
 {
-    wxListBox *lbox = wxStaticCast(control, wxListBox);
+    wxListBox *lbox = wxStaticCast(consumer->GetInputWindow(), wxListBox);
     int item = HitTest(lbox, event);
     wxControlAction action;
 
@@ -1357,16 +1359,16 @@ bool wxStdListboxInputHandler::HandleMouse(wxControl *control,
         return TRUE;
     }
 
-    return wxStdInputHandler::HandleMouse(control, event);
+    return wxStdInputHandler::HandleMouse(consumer, event);
 }
 
-bool wxStdListboxInputHandler::HandleMouseMove(wxControl *control,
+bool wxStdListboxInputHandler::HandleMouseMove(wxInputConsumer *consumer,
                                                const wxMouseEvent& event)
 {
     wxWindow *winCapture = wxWindow::GetCapture();
     if ( winCapture && (event.GetEventObject() == winCapture) )
     {
-        wxListBox *lbox = wxStaticCast(control, wxListBox);
+        wxListBox *lbox = wxStaticCast(consumer->GetInputWindow(), wxListBox);
 
         if ( !m_btnCapture || !m_trackMouseOutside )
         {
@@ -1404,7 +1406,7 @@ bool wxStdListboxInputHandler::HandleMouseMove(wxControl *control,
         }
     }
 
-    return wxStdInputHandler::HandleMouseMove(control, event);
+    return wxStdInputHandler::HandleMouseMove(consumer, event);
 }
 
 #endif // wxUSE_LISTBOX