]> git.saurik.com Git - wxWidgets.git/commitdiff
Pressing build-in joystick on WinCE phones fires wxEVT_JOY_BUTTON_DOWN event.
authorWłodzimierz Skiba <abx@abx.art.pl>
Sat, 29 Oct 2005 12:48:07 +0000 (12:48 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Sat, 29 Oct 2005 12:48:07 +0000 (12:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36034 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/generic/choicdgg.h
src/generic/choicdgg.cpp
src/msw/window.cpp

index 0ef71d499aa775dc97dfb2417ad37ff252720edb..d356938603071644dbd2812c6c36f5335fd7d37c 100644 (file)
@@ -31,6 +31,10 @@ wxMSW:
 - Switching page of a hidden notebook doesn't lose focus (Jamie Gadd).
 - Removed wxImageList *GetImageList(int) const.
 
+wxWinCE:
+
+- Pressing build-in joystick on WinCE phones fires wxEVT_JOY_BUTTON_DOWN event.
+
 Unix:
 
 - NO_GCC_PRAGMA is not used any more, remove checks for it if you used it.
@@ -2526,5 +2530,3 @@ At this point, the following has been achieved:
 - utils/wxprop classes working (except maybe wxPropertyFormView)
   in preparation for use in Dialog Editor.
 - GNU-WIN32 compilation verified (a month or so ago).
-
-
index 074e9685e5e1ef4cc41f67c491f06b78c18cc0b0..6678bc16b4357ffefd2a2f0e615a22156ba1a297 100644 (file)
@@ -138,12 +138,19 @@ public:
 
     // implementation from now on
     void OnOK(wxCommandEvent& event);
+#ifndef __SMARTPHONE__
     void OnListBoxDClick(wxCommandEvent& event);
+#endif
+#ifdef __WXWINCE__
+    void OnJoystickButtonDown(wxJoystickEvent& event);
+#endif
 
 protected:
     int         m_selection;
     wxString    m_stringSelection;
 
+    void DoChoice();
+
 private:
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxSingleChoiceDialog)
     DECLARE_EVENT_TABLE()
@@ -301,4 +308,3 @@ WXDLLEXPORT size_t wxGetMultipleChoices(wxArrayInt& selections,
                                         int height = wxCHOICE_HEIGHT);
 
 #endif // __CHOICEDLGH_G__
-
index 9a4874208f21d3e64a2d5c67105ee625fa5da99a..cd5743cbae04035c59b0b55649ec243fe7c720b6 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        choicdgg.cpp
+// Name:        src/generic/choicdgg.cpp
 // Purpose:     Choice dialogs
 // Author:      Julian Smart
 // Modified by: 03.11.00: VZ to add wxArrayString and multiple sel functions
@@ -332,7 +332,12 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent,
 
 BEGIN_EVENT_TABLE(wxSingleChoiceDialog, wxDialog)
     EVT_BUTTON(wxID_OK, wxSingleChoiceDialog::OnOK)
+#ifndef __SMARTPHONE__
     EVT_LISTBOX_DCLICK(wxID_LISTBOX, wxSingleChoiceDialog::OnListBoxDClick)
+#endif
+#ifdef __WXWINCE__
+    EVT_JOY_BUTTON_DOWN(wxSingleChoiceDialog::OnJoystickButtonDown)
+#endif
 END_EVENT_TABLE()
 
 IMPLEMENT_DYNAMIC_CLASS(wxSingleChoiceDialog, wxDialog)
@@ -407,14 +412,24 @@ void wxSingleChoiceDialog::SetSelection(int sel)
 
 void wxSingleChoiceDialog::OnOK(wxCommandEvent& WXUNUSED(event))
 {
-    m_selection = m_listbox->GetSelection();
-    m_stringSelection = m_listbox->GetStringSelection();
-    if ( m_listbox->HasClientUntypedData() )
-        SetClientData(m_listbox->GetClientData(m_selection));
-    EndModal(wxID_OK);
+    DoChoice();
 }
 
+#ifndef __SMARTPHONE__
 void wxSingleChoiceDialog::OnListBoxDClick(wxCommandEvent& WXUNUSED(event))
+{
+    DoChoice();
+}
+#endif
+
+#ifdef __WXWINCE__
+void wxSingleChoiceDialog::OnJoystickButtonDown(wxJoystickEvent& WXUNUSED(event))
+{
+    DoChoice();
+}
+#endif
+
+void wxSingleChoiceDialog::DoChoice()
 {
     m_selection = m_listbox->GetSelection();
     m_stringSelection = m_listbox->GetStringSelection();
index 48d244b115cceb5ab09c2ff5bb8286ab059fbe5d..bc738d50580bc672a92331e15fec4e48bc95685e 100644 (file)
@@ -2064,6 +2064,12 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
                             else // no default button
 #endif // wxUSE_BUTTON
                             {
+#ifdef __WXWINCE__
+                                wxJoystickEvent event(wxEVT_JOY_BUTTON_DOWN);
+                                event.SetEventObject(this);
+                                if(GetEventHandler()->ProcessEvent(event))
+                                    return true;
+#endif
                                 // this is a quick and dirty test for a text
                                 // control
                                 if ( !(lDlgCode & DLGC_HASSETSEL) )
@@ -6202,4 +6208,3 @@ void wxWindowMSW::OnInitDialog( wxInitDialogEvent& event )
     event.Skip();
 }
 #endif
-