]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/checklst.cpp
Better place for coordinate mirroring and removal
[wxWidgets.git] / src / univ / checklst.cpp
index a69725f51065a78a0877eab2f11de8f9999b63fb..95e1af791dd924541be6a30fc46a796dff3dae66 100644 (file)
 
 #if wxUSE_CHECKLISTBOX
 
 
 #if wxUSE_CHECKLISTBOX
 
+#include "wx/checklst.h"
+
 #ifndef WX_PRECOMP
     #include "wx/log.h"
 #ifndef WX_PRECOMP
     #include "wx/log.h"
-
     #include "wx/dcclient.h"
     #include "wx/dcclient.h"
-    #include "wx/checklst.h"
     #include "wx/validate.h"
 #endif
 
     #include "wx/validate.h"
 #endif
 
 #include "wx/univ/inphand.h"
 #include "wx/univ/theme.h"
 
 #include "wx/univ/inphand.h"
 #include "wx/univ/theme.h"
 
+// ----------------------------------------------------------------------------
+// wxStdCheckListBoxInputHandler
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxStdCheckListboxInputHandler : public wxStdInputHandler
+{
+public:
+    wxStdCheckListboxInputHandler(wxInputHandler *inphand);
+
+    virtual bool HandleKey(wxInputConsumer *consumer,
+                           const wxKeyEvent& event,
+                           bool pressed);
+    virtual bool HandleMouse(wxInputConsumer *consumer,
+                             const wxMouseEvent& event);
+};
+
 // ============================================================================
 // implementation of wxCheckListBox
 // ============================================================================
 // ============================================================================
 // implementation of wxCheckListBox
 // ============================================================================
@@ -226,13 +242,21 @@ bool wxCheckListBox::PerformAction(const wxControlAction& action,
     return true;
 }
 
     return true;
 }
 
+/* static */
+wxInputHandler *wxCheckListBox::GetStdInputHandler(wxInputHandler *handlerDef)
+{
+    static wxStdCheckListboxInputHandler s_handler(handlerDef);
+
+    return &s_handler;
+}
+
 // ----------------------------------------------------------------------------
 // wxStdCheckListboxInputHandler
 // ----------------------------------------------------------------------------
 
 wxStdCheckListboxInputHandler::
 wxStdCheckListboxInputHandler(wxInputHandler *inphand)
 // ----------------------------------------------------------------------------
 // wxStdCheckListboxInputHandler
 // ----------------------------------------------------------------------------
 
 wxStdCheckListboxInputHandler::
 wxStdCheckListboxInputHandler(wxInputHandler *inphand)
-    : wxStdListboxInputHandler(inphand)
+    : wxStdInputHandler(wxListBox::GetStdInputHandler(inphand))
 {
 }
 
 {
 }
 
@@ -243,7 +267,7 @@ bool wxStdCheckListboxInputHandler::HandleKey(wxInputConsumer *consumer,
     if ( pressed && (event.GetKeyCode() == WXK_SPACE) )
         consumer->PerformAction(wxACTION_CHECKLISTBOX_TOGGLE);
 
     if ( pressed && (event.GetKeyCode() == WXK_SPACE) )
         consumer->PerformAction(wxACTION_CHECKLISTBOX_TOGGLE);
 
-    return wxStdListboxInputHandler::HandleKey(consumer, event, pressed);
+    return wxStdInputHandler::HandleKey(consumer, event, pressed);
 }
 
 bool wxStdCheckListboxInputHandler::HandleMouse(wxInputConsumer *consumer,
 }
 
 bool wxStdCheckListboxInputHandler::HandleMouse(wxInputConsumer *consumer,
@@ -273,7 +297,7 @@ bool wxStdCheckListboxInputHandler::HandleMouse(wxInputConsumer *consumer,
         }
     }
 
         }
     }
 
-    return wxStdListboxInputHandler::HandleMouse(consumer, event);
+    return wxStdInputHandler::HandleMouse(consumer, event);
 }
 
 #endif // wxUSE_CHECKLISTBOX
 }
 
 #endif // wxUSE_CHECKLISTBOX