Pressing build-in joystick on WinCE phones fires wxEVT_JOY_BUTTON_DOWN event.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36034 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-10-29 12:48:07 +00:00
parent 2cb94e7ad6
commit 7b504551c2
4 changed files with 38 additions and 10 deletions

View File

@@ -31,6 +31,10 @@ wxMSW:
- Switching page of a hidden notebook doesn't lose focus (Jamie Gadd). - Switching page of a hidden notebook doesn't lose focus (Jamie Gadd).
- Removed wxImageList *GetImageList(int) const. - Removed wxImageList *GetImageList(int) const.
wxWinCE:
- Pressing build-in joystick on WinCE phones fires wxEVT_JOY_BUTTON_DOWN event.
Unix: Unix:
- NO_GCC_PRAGMA is not used any more, remove checks for it if you used it. - 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) - utils/wxprop classes working (except maybe wxPropertyFormView)
in preparation for use in Dialog Editor. in preparation for use in Dialog Editor.
- GNU-WIN32 compilation verified (a month or so ago). - GNU-WIN32 compilation verified (a month or so ago).

View File

@@ -138,12 +138,19 @@ public:
// implementation from now on // implementation from now on
void OnOK(wxCommandEvent& event); void OnOK(wxCommandEvent& event);
#ifndef __SMARTPHONE__
void OnListBoxDClick(wxCommandEvent& event); void OnListBoxDClick(wxCommandEvent& event);
#endif
#ifdef __WXWINCE__
void OnJoystickButtonDown(wxJoystickEvent& event);
#endif
protected: protected:
int m_selection; int m_selection;
wxString m_stringSelection; wxString m_stringSelection;
void DoChoice();
private: private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxSingleChoiceDialog) DECLARE_DYNAMIC_CLASS_NO_COPY(wxSingleChoiceDialog)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
@@ -301,4 +308,3 @@ WXDLLEXPORT size_t wxGetMultipleChoices(wxArrayInt& selections,
int height = wxCHOICE_HEIGHT); int height = wxCHOICE_HEIGHT);
#endif // __CHOICEDLGH_G__ #endif // __CHOICEDLGH_G__

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: choicdgg.cpp // Name: src/generic/choicdgg.cpp
// Purpose: Choice dialogs // Purpose: Choice dialogs
// Author: Julian Smart // Author: Julian Smart
// Modified by: 03.11.00: VZ to add wxArrayString and multiple sel functions // 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) BEGIN_EVENT_TABLE(wxSingleChoiceDialog, wxDialog)
EVT_BUTTON(wxID_OK, wxSingleChoiceDialog::OnOK) EVT_BUTTON(wxID_OK, wxSingleChoiceDialog::OnOK)
#ifndef __SMARTPHONE__
EVT_LISTBOX_DCLICK(wxID_LISTBOX, wxSingleChoiceDialog::OnListBoxDClick) EVT_LISTBOX_DCLICK(wxID_LISTBOX, wxSingleChoiceDialog::OnListBoxDClick)
#endif
#ifdef __WXWINCE__
EVT_JOY_BUTTON_DOWN(wxSingleChoiceDialog::OnJoystickButtonDown)
#endif
END_EVENT_TABLE() END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxSingleChoiceDialog, wxDialog) IMPLEMENT_DYNAMIC_CLASS(wxSingleChoiceDialog, wxDialog)
@@ -407,14 +412,24 @@ void wxSingleChoiceDialog::SetSelection(int sel)
void wxSingleChoiceDialog::OnOK(wxCommandEvent& WXUNUSED(event)) void wxSingleChoiceDialog::OnOK(wxCommandEvent& WXUNUSED(event))
{ {
m_selection = m_listbox->GetSelection(); DoChoice();
m_stringSelection = m_listbox->GetStringSelection();
if ( m_listbox->HasClientUntypedData() )
SetClientData(m_listbox->GetClientData(m_selection));
EndModal(wxID_OK);
} }
#ifndef __SMARTPHONE__
void wxSingleChoiceDialog::OnListBoxDClick(wxCommandEvent& WXUNUSED(event)) 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_selection = m_listbox->GetSelection();
m_stringSelection = m_listbox->GetStringSelection(); m_stringSelection = m_listbox->GetStringSelection();

View File

@@ -2064,6 +2064,12 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
else // no default button else // no default button
#endif // wxUSE_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 // this is a quick and dirty test for a text
// control // control
if ( !(lDlgCode & DLGC_HASSETSEL) ) if ( !(lDlgCode & DLGC_HASSETSEL) )
@@ -6202,4 +6208,3 @@ void wxWindowMSW::OnInitDialog( wxInitDialogEvent& event )
event.Skip(); event.Skip();
} }
#endif #endif