]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/joystick.cpp
wxSpinButton::GetValue() returns correct result now
[wxWidgets.git] / src / msw / joystick.cpp
index 7911b1338f77bd18b10295afaa3c43d917614ea1..407e7041308cef05985064547c04764f62a13735 100644 (file)
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#if defined(__BORLANDC__)
+#ifdef __BORLANDC__
 #pragma hdrstop
 #endif
 
-#include <windows.h>
+#include "wx/string.h"
+#include "wx/window.h"
+#include "wx/msw/private.h"
 
 #ifndef __GNUWIN32__
 #include <mmsystem.h>
 typedef UINT MMRESULT;
 #endif
 
+#ifndef __TWIN32__
 #ifdef __GNUWIN32__
 #include <wx/msw/gnuwin32/extra.h>
 #endif
+#endif
 
 // Why doesn't BC++ have joyGetPosEx?
-#if !defined(__WIN32__) || defined(__BORLANDC__)
+#if !defined(__WIN32__) || defined(__BORLANDC__) || defined(__TWIN32__)
 #define NO_JOYGETPOSEX
 #endif
 
+#include <wx/window.h>
 #include <wx/msw/joystick.h>
 
 IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
@@ -298,7 +303,7 @@ int wxJoystick::GetNumberButtons(void) const
 
 int wxJoystick::GetNumberAxes(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return 0;
@@ -311,7 +316,7 @@ int wxJoystick::GetNumberAxes(void) const
 
 int wxJoystick::GetMaxButtons(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return 0;
@@ -324,7 +329,7 @@ int wxJoystick::GetMaxButtons(void) const
 
 int wxJoystick::GetMaxAxes(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return 0;
@@ -355,7 +360,7 @@ int wxJoystick::GetPollingMax(void) const
 
 int wxJoystick::GetRudderMin(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return 0;
@@ -368,7 +373,7 @@ int wxJoystick::GetRudderMin(void) const
 
 int wxJoystick::GetRudderMax(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return 0;
@@ -381,7 +386,7 @@ int wxJoystick::GetRudderMax(void) const
 
 int wxJoystick::GetUMin(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return 0;
@@ -394,7 +399,7 @@ int wxJoystick::GetUMin(void) const
 
 int wxJoystick::GetUMax(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return 0;
@@ -407,7 +412,7 @@ int wxJoystick::GetUMax(void) const
 
 int wxJoystick::GetVMin(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return 0;
@@ -420,7 +425,7 @@ int wxJoystick::GetVMin(void) const
 
 int wxJoystick::GetVMax(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return 0;
@@ -434,7 +439,7 @@ int wxJoystick::GetVMax(void) const
 
 bool wxJoystick::HasRudder(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return FALSE;
@@ -447,7 +452,7 @@ bool wxJoystick::HasRudder(void) const
 
 bool wxJoystick::HasZ(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return FALSE;
@@ -460,7 +465,7 @@ bool wxJoystick::HasZ(void) const
 
 bool wxJoystick::HasU(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return FALSE;
@@ -473,7 +478,7 @@ bool wxJoystick::HasU(void) const
 
 bool wxJoystick::HasV(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return FALSE;
@@ -486,7 +491,7 @@ bool wxJoystick::HasV(void) const
 
 bool wxJoystick::HasPOV(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return FALSE;
@@ -499,7 +504,7 @@ bool wxJoystick::HasPOV(void) const
 
 bool wxJoystick::HasPOV4Dir(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return FALSE;
@@ -512,7 +517,7 @@ bool wxJoystick::HasPOV4Dir(void) const
 
 bool wxJoystick::HasPOVCTS(void) const
 {
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
     JOYCAPS joyCaps;
     if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
         return FALSE;