return a more useful value from wxJoystick::GetProductName()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -47,6 +47,7 @@ wxMSW:
|
|||||||
- Fixed default size of wxStaticText controls with border being too small.
|
- Fixed default size of wxStaticText controls with border being too small.
|
||||||
- Fixed bugs with wxStatusBar positioning (with or withour sizers) (Jamie Gadd)
|
- Fixed bugs with wxStatusBar positioning (with or withour sizers) (Jamie Gadd)
|
||||||
- Mouse move events are now generated for all static controls (Jamie Gadd)
|
- Mouse move events are now generated for all static controls (Jamie Gadd)
|
||||||
|
- Made wxJoystick::GetProductName() more useful (John Ratliff)
|
||||||
|
|
||||||
wxGTK:
|
wxGTK:
|
||||||
|
|
||||||
|
@@ -28,18 +28,17 @@
|
|||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__WIN32__) && !defined(_MMRESULT_)
|
|
||||||
typedef UINT MMRESULT;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Why doesn't BC++ have joyGetPosEx?
|
// Why doesn't BC++ have joyGetPosEx?
|
||||||
#if !defined(__WIN32__) || defined(__BORLANDC__)
|
#if !defined(__WIN32__) || defined(__BORLANDC__)
|
||||||
#define NO_JOYGETPOSEX
|
#define NO_JOYGETPOSEX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
|
#include "wx/msw/registry.h"
|
||||||
#include "wx/msw/joystick.h"
|
#include "wx/msw/joystick.h"
|
||||||
|
|
||||||
|
#include <regstr.h>
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
|
||||||
|
|
||||||
// Attributes
|
// Attributes
|
||||||
@@ -299,10 +298,22 @@ int wxJoystick::GetProductId() const
|
|||||||
wxString wxJoystick::GetProductName() const
|
wxString wxJoystick::GetProductName() const
|
||||||
{
|
{
|
||||||
JOYCAPS joyCaps;
|
JOYCAPS joyCaps;
|
||||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
if (joyGetDevCaps(m_joystick, &joyCaps, sizeof(joyCaps)) != JOYERR_NOERROR)
|
||||||
return wxEmptyString;
|
return wxEmptyString;
|
||||||
else
|
|
||||||
return wxString(joyCaps.szPname);
|
wxRegKey key1(wxString::Format(wxT("HKEY_LOCAL_MACHINE\\%s\\%s\\%s"),
|
||||||
|
REGSTR_PATH_JOYCONFIG, joyCaps.szRegKey, REGSTR_KEY_JOYCURR));
|
||||||
|
|
||||||
|
wxString str;
|
||||||
|
key1.QueryValue(wxString::Format(wxT("Joystick%d%s"),
|
||||||
|
m_joystick + 1, REGSTR_VAL_JOYOEMNAME),
|
||||||
|
str);
|
||||||
|
|
||||||
|
wxRegKey key2(wxString::Format(wxT("HKEY_LOCAL_MACHINE\\%s\\%s"),
|
||||||
|
REGSTR_PATH_JOYOEM, str.c_str()));
|
||||||
|
key2.QueryValue(REGSTR_VAL_JOYOEMNAME, str);
|
||||||
|
|
||||||
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetXMin() const
|
int wxJoystick::GetXMin() const
|
||||||
|
Reference in New Issue
Block a user