fixes for compilation with the old mingw32, wxUSE_NORLANDER_HEADERS is always

defined (as 0 or 1)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6012 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-14 18:21:21 +00:00
parent 55196c5464
commit c42404a58e
29 changed files with 237 additions and 286 deletions

View File

@@ -138,9 +138,13 @@
// we are setting this define because of the complex check // we are setting this define because of the complex check
// using NORLANDER as Cygwin may follow. (header author is Anders Norlander) // using NORLANDER as Cygwin may follow. (header author is Anders Norlander)
#if defined(__MINGW32__) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))) #if defined(__MINGW32__) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95)))
#ifndef wxUSE_NORLANDER_HEADERS #ifndef wxUSE_NORLANDER_HEADERS
# define wxUSE_NORLANDER_HEADERS 1 #define wxUSE_NORLANDER_HEADERS 1
#endif #endif
#else
#ifndef wxUSE_NORLANDER_HEADERS
#define wxUSE_NORLANDER_HEADERS 0
#endif
#endif #endif
// "old" GNUWIN32 is the one without Norlander's headers: it lacks the standard // "old" GNUWIN32 is the one without Norlander's headers: it lacks the standard

View File

@@ -67,7 +67,7 @@ WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
// this defines a CASTWNDPROC macro which casts a pointer to the type of a // this defines a CASTWNDPROC macro which casts a pointer to the type of a
// window proc // window proc
#if defined(__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS) #ifdef __GNUWIN32_OLD__
# define CASTWNDPROC (long unsigned) # define CASTWNDPROC (long unsigned)
#else #else
# ifdef __BORLANDC__ # ifdef __BORLANDC__
@@ -79,7 +79,6 @@ WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
typedef int (pascal * WndProcCast) (); typedef int (pascal * WndProcCast) ();
#endif #endif
# define CASTWNDPROC (WndProcCast) # define CASTWNDPROC (WndProcCast)
// # define CASTWNDPROC
# else # else
typedef int (pascal * WndProcCast) (); typedef int (pascal * WndProcCast) ();
# define CASTWNDPROC (WndProcCast) # define CASTWNDPROC (WndProcCast)

View File

@@ -125,7 +125,7 @@ public:
bool Exists() const; bool Exists() const;
// get the info about key (any number of these pointers may be NULL) // get the info about key (any number of these pointers may be NULL)
#if defined( __GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS) #if defined( __GNUWIN32_OLD__ )
bool GetKeyInfo(size_t *pnSubKeys, // number of subkeys bool GetKeyInfo(size_t *pnSubKeys, // number of subkeys
size_t *pnMaxKeyLen, // max len of subkey name size_t *pnMaxKeyLen, // max len of subkey name
size_t *pnValues, // number of values size_t *pnValues, // number of values

View File

@@ -52,8 +52,6 @@ enum
class WXDLLEXPORT wxWindow : public wxWindowBase class WXDLLEXPORT wxWindow : public wxWindowBase
{ {
DECLARE_DYNAMIC_CLASS(wxWindow);
public: public:
wxWindow() { Init(); } wxWindow() { Init(); }
@@ -425,6 +423,10 @@ private:
bool HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); bool HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
#endif // __WIN95__ #endif // __WIN95__
// the helper functions used by HandleChar/KeyXXX methods
wxKeyEvent CreateKeyEvent(wxEventType evType, int id, WXLPARAM lp) const;
DECLARE_DYNAMIC_CLASS(wxWindow);
DECLARE_NO_COPY_CLASS(wxWindow); DECLARE_NO_COPY_CLASS(wxWindow);
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@@ -71,14 +71,13 @@
#include "wx/tooltip.h" #include "wx/tooltip.h"
#endif // wxUSE_TOOLTIPS #endif // wxUSE_TOOLTIPS
// OLE is used for drag-and-drop, clipboard, OLE Automation... // OLE is used for drag-and-drop, clipboard, OLE Automation..., but some
#ifndef wxUSE_NORLANDER_HEADERS // compilers don't support it (missing headers, libs, ...)
#if defined(__GNUWIN32__) || defined(__SC__) || defined(__SALFORDC__) #if defined(__GNUWIN32_OLD__) || defined(__SC__) || defined(__SALFORDC__)
#undef wxUSE_OLE #undef wxUSE_OLE
#define wxUSE_OLE 0 #define wxUSE_OLE 0
#endif // broken compilers #endif // broken compilers
#endif
#if wxUSE_OLE #if wxUSE_OLE
#include <ole2.h> #include <ole2.h>
@@ -87,7 +86,7 @@
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
#include <commctrl.h> #include <commctrl.h>
#endif #endif

View File

@@ -45,8 +45,8 @@
#include <windows.h> #include <windows.h>
#include <windowsx.h> #include <windowsx.h>
#if defined(__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS) #ifdef __GNUWIN32_OLD__
#include "wx/msw/gnuwin32/extra.h" #include "wx/msw/gnuwin32/extra.h"
#endif #endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -30,8 +30,8 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
#include <commctrl.h> #include <commctrl.h>
#endif #endif
IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow) IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)

View File

@@ -24,10 +24,8 @@
#include <winuser.h> #include <winuser.h>
#endif #endif
#ifndef __TWIN32__ #ifdef __GNUWIN32_OLD__
#if defined (__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS) #include "wx/msw/gnuwin32/extra.h"
#include "wx/msw/gnuwin32/extra.h"
#endif
#endif #endif
#include "wx/wxchar.h" #include "wx/wxchar.h"

View File

@@ -48,9 +48,6 @@
#include "wx/msw/private.h" // needs to be before #include <commdlg.h> #include "wx/msw/private.h" // needs to be before #include <commdlg.h>
#if wxUSE_COMMON_DIALOGS #if wxUSE_COMMON_DIALOGS
#if wxUSE_NORLANDER_HEADERS
#include <windows.h>
#endif
#include <commdlg.h> #include <commdlg.h>
#endif #endif

View File

@@ -48,12 +48,8 @@
#include "wx/msw/dib.h" #include "wx/msw/dib.h"
#ifndef __TWIN32__ #ifdef __GNUWIN32_OLD__
#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h"
#ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h"
#endif
#endif
#endif #endif
#ifndef SEEK_CUR #ifndef SEEK_CUR

View File

@@ -27,8 +27,7 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#if defined(__WIN95__) && \ #if defined(__WIN95__) && !defined(__GNUWIN32_OLD__)
(!defined(__GNUWIN32__) || defined(wxUSE_NORLANDER_HEADERS))
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/utils.h" #include "wx/utils.h"

View File

@@ -29,8 +29,8 @@
#include "wx/msw/gauge95.h" #include "wx/msw/gauge95.h"
#include "wx/msw/private.h" #include "wx/msw/private.h"
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
#include <commctrl.h> #include <commctrl.h>
#endif #endif
IMPLEMENT_DYNAMIC_CLASS(wxGauge95, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxGauge95, wxControl)

View File

@@ -46,7 +46,11 @@
#include <ctype.h> #include <ctype.h>
#include <winsock.h> #include <winsock.h>
/* if we use configure for MSW SOCKLEN_T will be already defined */
#ifndef SOCKLEN_T
#define SOCKLEN_T int #define SOCKLEN_T int
#endif
#define CLASSNAME "_GSocket_Internal_Window_Class" #define CLASSNAME "_GSocket_Internal_Window_Class"
#define WINDOWNAME "_GSocket_Internal_Window_Name" #define WINDOWNAME "_GSocket_Internal_Window_Name"

View File

@@ -6,7 +6,7 @@
// Created: 04/01/98 // Created: 04/01/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem // Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
@@ -24,8 +24,8 @@
#include "wx/window.h" #include "wx/window.h"
#include "wx/msw/private.h" #include "wx/msw/private.h"
#if !defined( __GNUWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS) #ifndef __GNUWIN32_OLD__
#include <mmsystem.h> #include <mmsystem.h>
#endif #endif
#if !defined(__WIN32__) && !defined(_MMRESULT_) #if !defined(__WIN32__) && !defined(_MMRESULT_)
@@ -33,12 +33,10 @@ typedef UINT MMRESULT;
#endif #endif
#ifndef __TWIN32__ #ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32_OLD__
#ifndef wxUSE_NORLANDER_HEADERS
#include "wx/msw/gnuwin32/extra.h" #include "wx/msw/gnuwin32/extra.h"
#endif #endif
#endif #endif
#endif
// Why doesn't BC++ have joyGetPosEx? // Why doesn't BC++ have joyGetPosEx?
#if !defined(__WIN32__) || defined(__BORLANDC__) || defined(__TWIN32__) #if !defined(__WIN32__) || defined(__BORLANDC__) || defined(__TWIN32__)
@@ -53,7 +51,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
// Attributes // Attributes
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
wxPoint wxJoystick::GetPosition(void) const wxPoint wxJoystick::GetPosition() const
{ {
JOYINFO joyInfo; JOYINFO joyInfo;
MMRESULT res = joyGetPos(m_joystick, & joyInfo); MMRESULT res = joyGetPos(m_joystick, & joyInfo);
@@ -63,7 +61,7 @@ wxPoint wxJoystick::GetPosition(void) const
return wxPoint(0, 0); return wxPoint(0, 0);
} }
int wxJoystick::GetZPosition(void) const int wxJoystick::GetZPosition() const
{ {
JOYINFO joyInfo; JOYINFO joyInfo;
MMRESULT res = joyGetPos(m_joystick, & joyInfo); MMRESULT res = joyGetPos(m_joystick, & joyInfo);
@@ -73,7 +71,7 @@ int wxJoystick::GetZPosition(void) const
return 0; return 0;
} }
int wxJoystick::GetButtonState(void) const int wxJoystick::GetButtonState() const
{ {
JOYINFO joyInfo; JOYINFO joyInfo;
MMRESULT res = joyGetPos(m_joystick, & joyInfo); MMRESULT res = joyGetPos(m_joystick, & joyInfo);
@@ -95,7 +93,7 @@ int wxJoystick::GetButtonState(void) const
return 0; return 0;
} }
int wxJoystick::GetPOVPosition(void) const int wxJoystick::GetPOVPosition() const
{ {
#ifndef NO_JOYGETPOSEX #ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo; JOYINFOEX joyInfo;
@@ -112,7 +110,7 @@ int wxJoystick::GetPOVPosition(void) const
#endif #endif
} }
int wxJoystick::GetPOVCTSPosition(void) const int wxJoystick::GetPOVCTSPosition() const
{ {
#ifndef NO_JOYGETPOSEX #ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo; JOYINFOEX joyInfo;
@@ -129,7 +127,7 @@ int wxJoystick::GetPOVCTSPosition(void) const
#endif #endif
} }
int wxJoystick::GetRudderPosition(void) const int wxJoystick::GetRudderPosition() const
{ {
#ifndef NO_JOYGETPOSEX #ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo; JOYINFOEX joyInfo;
@@ -146,7 +144,7 @@ int wxJoystick::GetRudderPosition(void) const
#endif #endif
} }
int wxJoystick::GetUPosition(void) const int wxJoystick::GetUPosition() const
{ {
#ifndef NO_JOYGETPOSEX #ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo; JOYINFOEX joyInfo;
@@ -163,7 +161,7 @@ int wxJoystick::GetUPosition(void) const
#endif #endif
} }
int wxJoystick::GetVPosition(void) const int wxJoystick::GetVPosition() const
{ {
#ifndef NO_JOYGETPOSEX #ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo; JOYINFOEX joyInfo;
@@ -180,7 +178,7 @@ int wxJoystick::GetVPosition(void) const
#endif #endif
} }
int wxJoystick::GetMovementThreshold(void) const int wxJoystick::GetMovementThreshold() const
{ {
UINT thresh = 0; UINT thresh = 0;
MMRESULT res = joyGetThreshold(m_joystick, & thresh); MMRESULT res = joyGetThreshold(m_joystick, & thresh);
@@ -201,19 +199,19 @@ void wxJoystick::SetMovementThreshold(int threshold)
// Capabilities // Capabilities
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
bool wxJoystick::IsOk(void) const bool wxJoystick::IsOk() const
{ {
JOYINFO joyInfo; JOYINFO joyInfo;
MMRESULT res = joyGetPos(m_joystick, & joyInfo); MMRESULT res = joyGetPos(m_joystick, & joyInfo);
return ((joyGetNumDevs() > 0) || (res == JOYERR_NOERROR)); return ((joyGetNumDevs() > 0) || (res == JOYERR_NOERROR));
} }
int wxJoystick::GetNumberJoysticks(void) const int wxJoystick::GetNumberJoysticks() const
{ {
return joyGetNumDevs(); return joyGetNumDevs();
} }
int wxJoystick::GetManufacturerId(void) const int wxJoystick::GetManufacturerId() const
{ {
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
@@ -222,7 +220,7 @@ int wxJoystick::GetManufacturerId(void) const
return joyCaps.wMid; return joyCaps.wMid;
} }
int wxJoystick::GetProductId(void) const int wxJoystick::GetProductId() const
{ {
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
@@ -231,7 +229,7 @@ int wxJoystick::GetProductId(void) const
return joyCaps.wPid; return joyCaps.wPid;
} }
wxString wxJoystick::GetProductName(void) 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)
@@ -240,7 +238,7 @@ wxString wxJoystick::GetProductName(void) const
return wxString(joyCaps.szPname); return wxString(joyCaps.szPname);
} }
int wxJoystick::GetXMin(void) const int wxJoystick::GetXMin() const
{ {
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
@@ -249,7 +247,7 @@ int wxJoystick::GetXMin(void) const
return joyCaps.wXmin; return joyCaps.wXmin;
} }
int wxJoystick::GetYMin(void) const int wxJoystick::GetYMin() const
{ {
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
@@ -258,7 +256,7 @@ int wxJoystick::GetYMin(void) const
return joyCaps.wYmin; return joyCaps.wYmin;
} }
int wxJoystick::GetZMin(void) const int wxJoystick::GetZMin() const
{ {
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
@@ -267,7 +265,7 @@ int wxJoystick::GetZMin(void) const
return joyCaps.wZmin; return joyCaps.wZmin;
} }
int wxJoystick::GetXMax(void) const int wxJoystick::GetXMax() const
{ {
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
@@ -276,7 +274,7 @@ int wxJoystick::GetXMax(void) const
return joyCaps.wXmax; return joyCaps.wXmax;
} }
int wxJoystick::GetYMax(void) const int wxJoystick::GetYMax() const
{ {
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
@@ -285,7 +283,7 @@ int wxJoystick::GetYMax(void) const
return joyCaps.wYmax; return joyCaps.wYmax;
} }
int wxJoystick::GetZMax(void) const int wxJoystick::GetZMax() const
{ {
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
@@ -294,7 +292,7 @@ int wxJoystick::GetZMax(void) const
return joyCaps.wZmax; return joyCaps.wZmax;
} }
int wxJoystick::GetNumberButtons(void) const int wxJoystick::GetNumberButtons() const
{ {
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
@@ -303,7 +301,7 @@ int wxJoystick::GetNumberButtons(void) const
return joyCaps.wNumButtons; return joyCaps.wNumButtons;
} }
int wxJoystick::GetNumberAxes(void) const int wxJoystick::GetNumberAxes() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -316,7 +314,7 @@ int wxJoystick::GetNumberAxes(void) const
#endif #endif
} }
int wxJoystick::GetMaxButtons(void) const int wxJoystick::GetMaxButtons() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -329,7 +327,7 @@ int wxJoystick::GetMaxButtons(void) const
#endif #endif
} }
int wxJoystick::GetMaxAxes(void) const int wxJoystick::GetMaxAxes() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -342,7 +340,7 @@ int wxJoystick::GetMaxAxes(void) const
#endif #endif
} }
int wxJoystick::GetPollingMin(void) const int wxJoystick::GetPollingMin() const
{ {
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
@@ -351,7 +349,7 @@ int wxJoystick::GetPollingMin(void) const
return joyCaps.wPeriodMin; return joyCaps.wPeriodMin;
} }
int wxJoystick::GetPollingMax(void) const int wxJoystick::GetPollingMax() const
{ {
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
@@ -360,7 +358,7 @@ int wxJoystick::GetPollingMax(void) const
return joyCaps.wPeriodMax; return joyCaps.wPeriodMax;
} }
int wxJoystick::GetRudderMin(void) const int wxJoystick::GetRudderMin() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -373,7 +371,7 @@ int wxJoystick::GetRudderMin(void) const
#endif #endif
} }
int wxJoystick::GetRudderMax(void) const int wxJoystick::GetRudderMax() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -386,7 +384,7 @@ int wxJoystick::GetRudderMax(void) const
#endif #endif
} }
int wxJoystick::GetUMin(void) const int wxJoystick::GetUMin() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -399,7 +397,7 @@ int wxJoystick::GetUMin(void) const
#endif #endif
} }
int wxJoystick::GetUMax(void) const int wxJoystick::GetUMax() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -412,7 +410,7 @@ int wxJoystick::GetUMax(void) const
#endif #endif
} }
int wxJoystick::GetVMin(void) const int wxJoystick::GetVMin() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -425,7 +423,7 @@ int wxJoystick::GetVMin(void) const
#endif #endif
} }
int wxJoystick::GetVMax(void) const int wxJoystick::GetVMax() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -439,7 +437,7 @@ int wxJoystick::GetVMax(void) const
} }
bool wxJoystick::HasRudder(void) const bool wxJoystick::HasRudder() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -452,7 +450,7 @@ bool wxJoystick::HasRudder(void) const
#endif #endif
} }
bool wxJoystick::HasZ(void) const bool wxJoystick::HasZ() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -465,7 +463,7 @@ bool wxJoystick::HasZ(void) const
#endif #endif
} }
bool wxJoystick::HasU(void) const bool wxJoystick::HasU() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -478,7 +476,7 @@ bool wxJoystick::HasU(void) const
#endif #endif
} }
bool wxJoystick::HasV(void) const bool wxJoystick::HasV() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -491,7 +489,7 @@ bool wxJoystick::HasV(void) const
#endif #endif
} }
bool wxJoystick::HasPOV(void) const bool wxJoystick::HasPOV() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -504,7 +502,7 @@ bool wxJoystick::HasPOV(void) const
#endif #endif
} }
bool wxJoystick::HasPOV4Dir(void) const bool wxJoystick::HasPOV4Dir() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -517,7 +515,7 @@ bool wxJoystick::HasPOV4Dir(void) const
#endif #endif
} }
bool wxJoystick::HasPOVCTS(void) const bool wxJoystick::HasPOVCTS() const
{ {
#if defined(__WIN32__) && !defined(__TWIN32__) #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
@@ -540,7 +538,7 @@ bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq)
return (res == JOYERR_NOERROR); return (res == JOYERR_NOERROR);
} }
bool wxJoystick::ReleaseCapture(void) bool wxJoystick::ReleaseCapture()
{ {
MMRESULT res = joyReleaseCapture(m_joystick); MMRESULT res = joyReleaseCapture(m_joystick);
return (res == JOYERR_NOERROR); return (res == JOYERR_NOERROR);

View File

@@ -48,10 +48,8 @@
#endif #endif
#ifndef __TWIN32__ #ifndef __TWIN32__
#if defined(__GNUWIN32__) #ifdef __GNUWIN32_OLD__
#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h"
#include "wx/msw/gnuwin32/extra.h"
#endif
#endif #endif
#endif #endif

View File

@@ -40,7 +40,7 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#if defined(__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS) #ifdef __GNUWIN32_OLD__
#include "wx/msw/gnuwin32/extra.h" #include "wx/msw/gnuwin32/extra.h"
#else #else
#include <commctrl.h> #include <commctrl.h>
@@ -554,13 +554,13 @@ bool wxListCtrl::SetColumnWidth(int col, int width)
// visible area of the list control (list or report view) // visible area of the list control (list or report view)
// or the total number of items in the list control (icon // or the total number of items in the list control (icon
// or small icon view) // or small icon view)
int wxListCtrl::GetCountPerPage(void) const int wxListCtrl::GetCountPerPage() const
{ {
return ListView_GetCountPerPage(GetHwnd()); return ListView_GetCountPerPage(GetHwnd());
} }
// Gets the edit control for editing labels. // Gets the edit control for editing labels.
wxTextCtrl* wxListCtrl::GetEditControl(void) const wxTextCtrl* wxListCtrl::GetEditControl() const
{ {
return m_textCtrl; return m_textCtrl;
} }
@@ -787,7 +787,7 @@ bool wxListCtrl::SetItemPosition(long item, const wxPoint& pos)
} }
// Gets the number of items in the list control // Gets the number of items in the list control
int wxListCtrl::GetItemCount(void) const int wxListCtrl::GetItemCount() const
{ {
return ListView_GetItemCount(GetHwnd()); return ListView_GetItemCount(GetHwnd());
} }
@@ -801,13 +801,13 @@ int wxListCtrl::GetItemSpacing(bool isSmall) const
} }
// Gets the number of selected items in the list control // Gets the number of selected items in the list control
int wxListCtrl::GetSelectedItemCount(void) const int wxListCtrl::GetSelectedItemCount() const
{ {
return ListView_GetSelectedCount(GetHwnd()); return ListView_GetSelectedCount(GetHwnd());
} }
// Gets the text colour of the listview // Gets the text colour of the listview
wxColour wxListCtrl::GetTextColour(void) const wxColour wxListCtrl::GetTextColour() const
{ {
COLORREF ref = ListView_GetTextColor(GetHwnd()); COLORREF ref = ListView_GetTextColor(GetHwnd());
wxColour col(GetRValue(ref), GetGValue(ref), GetBValue(ref)); wxColour col(GetRValue(ref), GetGValue(ref), GetBValue(ref));
@@ -822,7 +822,7 @@ void wxListCtrl::SetTextColour(const wxColour& col)
// Gets the index of the topmost visible item when in // Gets the index of the topmost visible item when in
// list or report view // list or report view
long wxListCtrl::GetTopItem(void) const long wxListCtrl::GetTopItem() const
{ {
return (long) ListView_GetTopIndex(GetHwnd()); return (long) ListView_GetTopIndex(GetHwnd());
} }

View File

@@ -6,7 +6,7 @@
// Created: 04/01/98 // Created: 04/01/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem // Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
@@ -46,11 +46,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame)
#include "wx/minifram.h" #include "wx/minifram.h"
#ifndef __TWIN32__ #ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32_OLD__
#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h"
#include "wx/msw/gnuwin32/extra.h" #endif
#endif
#endif
#endif #endif
IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame) IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame)

View File

@@ -41,15 +41,13 @@
#include <windowsx.h> // for SetWindowFont #include <windowsx.h> // for SetWindowFont
#ifndef __TWIN32__ #ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32_OLD__
#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h"
#include "wx/msw/gnuwin32/extra.h" #endif
#endif
#endif
#endif #endif
#if !defined(__GNUWIN32__) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
#include <commctrl.h> #include <commctrl.h>
#endif #endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -302,7 +302,7 @@ wxString wxRegKey::GetName(bool bShortPrefix) const
return str; return str;
} }
#if defined( __GNUWIN32__ ) && !defined(wxUSE_NORLANDER_HEADERS) #if defined( __GNUWIN32_OLD__ )
bool wxRegKey::GetKeyInfo(size_t* pnSubKeys, bool wxRegKey::GetKeyInfo(size_t* pnSubKeys,
size_t* pnMaxKeyLen, size_t* pnMaxKeyLen,
size_t* pnValues, size_t* pnValues,

View File

@@ -6,7 +6,7 @@
// Created: 04/01/98 // Created: 04/01/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem // Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
@@ -31,8 +31,8 @@
#include "wx/msw/slider95.h" #include "wx/msw/slider95.h"
#include "wx/msw/private.h" #include "wx/msw/private.h"
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
#include <commctrl.h> #include <commctrl.h>
#endif #endif
IMPLEMENT_DYNAMIC_CLASS(wxSlider95, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxSlider95, wxControl)

View File

@@ -43,7 +43,7 @@
#include "wx/spinbutt.h" #include "wx/spinbutt.h"
#include "wx/msw/private.h" #include "wx/msw/private.h"
#if !defined(__GNUWIN32__) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
#include <commctrl.h> #include <commctrl.h>
#endif #endif

View File

@@ -40,7 +40,7 @@
#include "wx/spinctrl.h" #include "wx/spinctrl.h"
#include "wx/msw/private.h" #include "wx/msw/private.h"
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
#include <commctrl.h> #include <commctrl.h>
#endif #endif

View File

@@ -36,8 +36,8 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#include <windowsx.h> #include <windowsx.h>
#if !defined(__GNUWIN32__) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #if !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
#include <commctrl.h> #include <commctrl.h>
#endif #endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -6,7 +6,7 @@
// Created: 04/01/98 // Created: 04/01/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Julian Smart // Copyright: (c) Julian Smart
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
@@ -32,16 +32,10 @@
#include <windows.h> #include <windows.h>
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #if !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
#include <commctrl.h> #include <commctrl.h>
#endif #else
#include "wx/msw/gnuwin32/extra.h"
#ifndef __TWIN32__
#ifdef __GNUWIN32__
#ifndef wxUSE_NORLANDER_HEADERS
#include "wx/msw/gnuwin32/extra.h"
#endif
#endif
#endif #endif
#include "wx/msw/dib.h" #include "wx/msw/dib.h"

View File

@@ -1,13 +1,13 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// File: taskbar.cpp // File: taskbar.cpp
// Purpose: Implements wxTaskBarIcon class for manipulating icons on // Purpose: Implements wxTaskBarIcon class for manipulating icons on
// the Windows task bar. // the Windows task bar.
// Author: Julian Smart // Author: Julian Smart
// Modified by: // Modified by:
// Created: 24/3/98 // Created: 24/3/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) // Copyright: (c)
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
@@ -40,19 +40,17 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#ifndef __TWIN32__ #ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32_OLD__
#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h"
#include "wx/msw/gnuwin32/extra.h" #endif
#endif
#endif
#endif #endif
#ifdef __SALFORDC__ #ifdef __SALFORDC__
#include <shellapi.h> #include <shellapi.h>
#endif #endif
LRESULT APIENTRY _EXPORT wxTaskBarIconWindowProc( HWND hWnd, unsigned msg, LRESULT APIENTRY _EXPORT wxTaskBarIconWindowProc( HWND hWnd, unsigned msg,
UINT wParam, LONG lParam ); UINT wParam, LONG lParam );
wxChar *wxTaskBarWindowClass = wxT("wxTaskBarWindowClass"); wxChar *wxTaskBarWindowClass = wxT("wxTaskBarWindowClass");
@@ -111,20 +109,20 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
NOTIFYICONDATA notifyData; NOTIFYICONDATA notifyData;
memset(&notifyData, 0, sizeof(notifyData)); memset(&notifyData, 0, sizeof(notifyData));
notifyData.cbSize = sizeof(notifyData); notifyData.cbSize = sizeof(notifyData);
notifyData.hWnd = (HWND) m_hWnd; notifyData.hWnd = (HWND) m_hWnd;
notifyData.uCallbackMessage = sm_taskbarMsg; notifyData.uCallbackMessage = sm_taskbarMsg;
notifyData.uFlags = NIF_MESSAGE ; notifyData.uFlags = NIF_MESSAGE ;
if (icon.Ok()) if (icon.Ok())
{ {
notifyData.uFlags |= NIF_ICON; notifyData.uFlags |= NIF_ICON;
notifyData.hIcon = (HICON) icon.GetHICON(); notifyData.hIcon = (HICON) icon.GetHICON();
} }
if (((const wxChar*) tooltip != NULL) && (tooltip != wxT(""))) if (((const wxChar*) tooltip != NULL) && (tooltip != wxT("")))
{ {
notifyData.uFlags |= NIF_TIP ; notifyData.uFlags |= NIF_TIP ;
lstrcpyn(notifyData.szTip, WXSTRINGCAST tooltip, sizeof(notifyData.szTip)); lstrcpyn(notifyData.szTip, WXSTRINGCAST tooltip, sizeof(notifyData.szTip));
} }
notifyData.uID = 99; notifyData.uID = 99;
@@ -146,11 +144,11 @@ bool wxTaskBarIcon::RemoveIcon(void)
NOTIFYICONDATA notifyData; NOTIFYICONDATA notifyData;
memset(&notifyData, 0, sizeof(notifyData)); memset(&notifyData, 0, sizeof(notifyData));
notifyData.cbSize = sizeof(notifyData); notifyData.cbSize = sizeof(notifyData);
notifyData.hWnd = (HWND) m_hWnd; notifyData.hWnd = (HWND) m_hWnd;
notifyData.uCallbackMessage = sm_taskbarMsg; notifyData.uCallbackMessage = sm_taskbarMsg;
notifyData.uFlags = NIF_MESSAGE; notifyData.uFlags = NIF_MESSAGE;
notifyData.hIcon = 0 ; // hIcon; notifyData.hIcon = 0 ; // hIcon;
notifyData.uID = 99; notifyData.uID = 99;
m_iconAdded = FALSE; m_iconAdded = FALSE;
@@ -265,8 +263,8 @@ bool wxTaskBarIcon::RegisterWindowClass()
// Also register the taskbar message here // Also register the taskbar message here
sm_taskbarMsg = ::RegisterWindowMessage(wxT("wxTaskBarIconMessage")); sm_taskbarMsg = ::RegisterWindowMessage(wxT("wxTaskBarIconMessage"));
WNDCLASS wc; WNDCLASS wc;
bool rc; bool rc;
HINSTANCE hInstance = GetModuleHandle(NULL); HINSTANCE hInstance = GetModuleHandle(NULL);
@@ -318,37 +316,37 @@ long wxTaskBarIcon::WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wPar
switch (lParam) switch (lParam)
{ {
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
eventType = wxEVT_TASKBAR_LEFT_DOWN; eventType = wxEVT_TASKBAR_LEFT_DOWN;
break; break;
case WM_LBUTTONUP: case WM_LBUTTONUP:
eventType = wxEVT_TASKBAR_LEFT_UP; eventType = wxEVT_TASKBAR_LEFT_UP;
break; break;
case WM_RBUTTONDOWN: case WM_RBUTTONDOWN:
eventType = wxEVT_TASKBAR_RIGHT_DOWN; eventType = wxEVT_TASKBAR_RIGHT_DOWN;
break; break;
case WM_RBUTTONUP: case WM_RBUTTONUP:
eventType = wxEVT_TASKBAR_RIGHT_UP; eventType = wxEVT_TASKBAR_RIGHT_UP;
break; break;
case WM_LBUTTONDBLCLK: case WM_LBUTTONDBLCLK:
eventType = wxEVT_TASKBAR_LEFT_DCLICK; eventType = wxEVT_TASKBAR_LEFT_DCLICK;
break; break;
case WM_RBUTTONDBLCLK: case WM_RBUTTONDBLCLK:
eventType = wxEVT_TASKBAR_RIGHT_DCLICK; eventType = wxEVT_TASKBAR_RIGHT_DCLICK;
break; break;
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
eventType = wxEVT_TASKBAR_MOVE; eventType = wxEVT_TASKBAR_MOVE;
break; break;
default: default:
break; break;
} }
if (eventType) { if (eventType) {
wxEvent event; wxEvent event;
@@ -361,7 +359,7 @@ long wxTaskBarIcon::WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wPar
} }
LRESULT APIENTRY _EXPORT wxTaskBarIconWindowProc( HWND hWnd, unsigned msg, LRESULT APIENTRY _EXPORT wxTaskBarIconWindowProc( HWND hWnd, unsigned msg,
UINT wParam, LONG lParam ) UINT wParam, LONG lParam )
{ {
wxTaskBarIcon* obj = wxTaskBarIcon::FindObjectForHWND((WXHWND) hWnd); wxTaskBarIcon* obj = wxTaskBarIcon::FindObjectForHWND((WXHWND) hWnd);
if (obj) if (obj)

View File

@@ -58,7 +58,7 @@
# include <fstream> # include <fstream>
#endif #endif
#if wxUSE_RICHEDIT && (!defined(__GNUWIN32__) || defined(wxUSE_NORLANDER_HEADERS)) #if wxUSE_RICHEDIT && !defined(__GNUWIN32_OLD__)
#include <richedit.h> #include <richedit.h>
#endif #endif

View File

@@ -47,13 +47,11 @@
#include "wx/treectrl.h" #include "wx/treectrl.h"
#include "wx/settings.h" #include "wx/settings.h"
#ifdef __GNUWIN32__ #ifdef __GNUWIN32_OLD__
#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h"
#include "wx/msw/gnuwin32/extra.h"
#endif
#endif #endif
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
#include <commctrl.h> #include <commctrl.h>
#endif #endif
@@ -327,13 +325,14 @@ bool wxTreeCtrl::Create(wxWindow *parent,
if ( m_windowStyle & wxTR_LINES_AT_ROOT ) if ( m_windowStyle & wxTR_LINES_AT_ROOT )
wstyle |= TVS_LINESATROOT; wstyle |= TVS_LINESATROOT;
#if !defined( __GNUWIN32__ ) && !defined( __BORLANDC__ ) && !defined( __WATCOMC__ ) && !defined(wxUSE_NORLANDER_HEADERS) #if !defined( __GNUWIN32_OLD__ ) && \
!defined( __BORLANDC__ ) && \
!defined( __WATCOMC__ ) && \
(!defined(__VISUALC__) || (__VISUALC__ > 1010))
// we emulate the multiple selection tree controls by using checkboxes: set // we emulate the multiple selection tree controls by using checkboxes: set
// up the image list we need for this if we do have multiple selections // up the image list we need for this if we do have multiple selections
#if !defined(__VISUALC__) || (__VISUALC__ > 1010)
if ( m_windowStyle & wxTR_MULTIPLE ) if ( m_windowStyle & wxTR_MULTIPLE )
wstyle |= TVS_CHECKBOXES; wstyle |= TVS_CHECKBOXES;
#endif
#endif #endif
// Create the tree control. // Create the tree control.

View File

@@ -6,7 +6,7 @@
// Created: 04/01/98 // Created: 04/01/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem // Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
@@ -31,16 +31,10 @@
#include <windows.h> #include <windows.h>
#include <windowsx.h> #include <windowsx.h>
#if !defined( __GNUWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS) #ifdef __GNUWIN32_OLD__
#include <mmsystem.h> #include "wx/msw/gnuwin32/extra.h"
#endif #else
#include <mmsystem.h>
#ifndef __TWIN32__
#ifdef __GNUWIN32__
#ifndef wxUSE_NORLANDER_HEADERS
#include "wx/msw/gnuwin32/extra.h"
#endif
#endif
#endif #endif
wxWave::wxWave() wxWave::wxWave()

View File

@@ -79,7 +79,7 @@
#include <string.h> #include <string.h>
#if !defined(__GNUWIN32__)|| defined(wxUSE_NORLANDER_HEADERS) #ifndef __GNUWIN32_OLD__
#include <shellapi.h> #include <shellapi.h>
#include <mmsystem.h> #include <mmsystem.h>
#endif #endif
@@ -88,15 +88,13 @@
#include <windowsx.h> #include <windowsx.h>
#endif #endif
#if ( defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS) #if !defined(__GNUWIN32_OLD__) && !defined(__TWIN32__)
#include <commctrl.h> #ifndef __WIN95__
#endif #include <commctrl.h>
#endif
#ifndef __TWIN32__ #else // broken compiler
#ifdef __GNUWIN32__ #ifndef __TWIN32__
#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h"
#include "wx/msw/gnuwin32/extra.h"
#endif
#endif #endif
#endif #endif
@@ -131,6 +129,10 @@ wxWindow *wxFindWinFromHandle(WXHWND hWnd);
// mouse clicks // mouse clicks
static void TranslateKbdEventToMouse(wxWindow *win, int *x, int *y, WPARAM *flags); static void TranslateKbdEventToMouse(wxWindow *win, int *x, int *y, WPARAM *flags);
// get the current state of SHIFT/CTRL keys
static inline bool IsShiftDown() { return GetKeyState(VK_SHIFT)& 0x100 != 0; }
static inline bool IsCtrlDown() { return GetKeyState(VK_CONTROL)& 0x100 != 0; }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// event tables // event tables
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -1480,8 +1482,8 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
if ( bProcess ) if ( bProcess )
{ {
bool bCtrlDown = (::GetKeyState(VK_CONTROL) & 0x100) != 0; bool bCtrlDown = IsCtrlDown();
bool bShiftDown = (::GetKeyState(VK_SHIFT) & 0x100) != 0; bool bShiftDown = IsShiftDown();
// WM_GETDLGCODE: ask the control if it wants the key for itself, // WM_GETDLGCODE: ask the control if it wants the key for itself,
// don't process it if it's the case (except for Ctrl-Tab/Enter // don't process it if it's the case (except for Ctrl-Tab/Enter
@@ -1596,8 +1598,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
// don't process system keys here // don't process system keys here
if ( !(HIWORD(msg->lParam) & KF_ALTDOWN) ) if ( !(HIWORD(msg->lParam) & KF_ALTDOWN) )
{ {
if ( (msg->wParam == VK_TAB) && if ( (msg->wParam == VK_TAB) && IsCtrlDown() )
(::GetKeyState(VK_CONTROL) & 0x100) != 0 )
{ {
// find the first notebook parent and change its page // find the first notebook parent and change its page
wxWindow *win = this; wxWindow *win = this;
@@ -1610,7 +1611,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
if ( nbook ) if ( nbook )
{ {
bool forward = !(::GetKeyState(VK_SHIFT) & 0x100); bool forward = !IsShiftDown();
nbook->AdvanceSelection(forward); nbook->AdvanceSelection(forward);
} }
@@ -3149,12 +3150,43 @@ bool wxWindow::HandleMouseMove(int x, int y, WXUINT flags)
// keyboard handling // keyboard handling
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// create the key event of the given type for the given key - used by
// HandleChar and HandleKeyDown/Up
wxKeyEvent wxWindow::CreateKeyEvent(wxEventType evType,
int id,
WXLPARAM lParam) const
{
wxKeyEvent event(evType);
event.SetId(GetId());
event.m_shiftDown = IsShiftDown();
event.m_controlDown = IsCtrlDown();
event.m_altDown = (HIWORD(lParam) & KF_ALTDOWN) == KF_ALTDOWN;
event.m_eventObject = (wxWindow *)this; // const_cast
event.m_keyCode = id;
event.SetTimestamp(s_currentMsg.time);
// translate the position to client coords
POINT pt;
GetCursorPos(&pt);
RECT rect;
GetWindowRect(GetHwnd(),&rect);
pt.x -= rect.left;
pt.y -= rect.top;
event.m_x = pt.x;
event.m_y = pt.y;
return event;
}
// isASCII is TRUE only when we're called from WM_CHAR handler and not from // isASCII is TRUE only when we're called from WM_CHAR handler and not from
// WM_KEYDOWN one // WM_KEYDOWN one
bool wxWindow::HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII) bool wxWindow::HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII)
{ {
bool ctrlDown = FALSE;
int id; int id;
bool tempControlDown = FALSE;
if ( isASCII ) if ( isASCII )
{ {
// If 1 -> 26, translate to CTRL plus a letter. // If 1 -> 26, translate to CTRL plus a letter.
@@ -3163,142 +3195,86 @@ bool wxWindow::HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII)
{ {
switch (id) switch (id)
{ {
case 13: case 13:
{
id = WXK_RETURN; id = WXK_RETURN;
break; break;
}
case 8: case 8:
{
id = WXK_BACK; id = WXK_BACK;
break; break;
}
case 9: case 9:
{
id = WXK_TAB; id = WXK_TAB;
break; break;
}
default: default:
{ ctrlDown = TRUE;
tempControlDown = TRUE;
id = id + 96; id = id + 96;
}
} }
} }
} }
else if ( (id = wxCharCodeMSWToWX(wParam)) == 0 ) { else if ( (id = wxCharCodeMSWToWX(wParam)) == 0 )
{
// it's ASCII and will be processed here only when called from // it's ASCII and will be processed here only when called from
// WM_CHAR (i.e. when isASCII = TRUE) // WM_CHAR (i.e. when isASCII = TRUE), don't process it now
id = -1; id = -1;
} }
if ( id != -1 ) if ( id != -1 )
{ {
wxKeyEvent event(wxEVT_CHAR); wxKeyEvent event(CreateKeyEvent(wxEVT_CHAR, id, lParam));
event.m_shiftDown = (::GetKeyState(VK_SHIFT)&0x100?TRUE:FALSE); if ( ctrlDown )
event.m_controlDown = (::GetKeyState(VK_CONTROL)&0x100?TRUE:FALSE); {
if ( (HIWORD(lParam) & KF_ALTDOWN) == KF_ALTDOWN ) event.m_controlDown = TRUE;
event.m_altDown = TRUE; }
event.m_eventObject = this;
event.m_keyCode = id;
event.SetTimestamp(s_currentMsg.time);
POINT pt;
GetCursorPos(&pt);
RECT rect;
GetWindowRect(GetHwnd(),&rect);
pt.x -= rect.left;
pt.y -= rect.top;
event.m_x = pt.x; event.m_y = pt.y;
if ( GetEventHandler()->ProcessEvent(event) ) if ( GetEventHandler()->ProcessEvent(event) )
return TRUE; return TRUE;
else
return FALSE;
} }
else
return FALSE; return FALSE;
} }
bool wxWindow::HandleKeyDown(WXWORD wParam, WXLPARAM lParam) bool wxWindow::HandleKeyDown(WXWORD wParam, WXLPARAM lParam)
{ {
int id; int id = wxCharCodeMSWToWX(wParam);
if ( (id = wxCharCodeMSWToWX(wParam)) == 0 ) { if ( !id )
{
// normal ASCII char
id = wParam; id = wParam;
} }
if ( id != -1 ) if ( id != -1 ) // VZ: does this ever happen (FIXME)?
{ {
wxKeyEvent event(wxEVT_KEY_DOWN); wxKeyEvent event(CreateKeyEvent(wxEVT_KEY_DOWN, id, lParam));
event.m_shiftDown = (::GetKeyState(VK_SHIFT)&0x100?TRUE:FALSE);
event.m_controlDown = (::GetKeyState(VK_CONTROL)&0x100?TRUE:FALSE);
if ( (HIWORD(lParam) & KF_ALTDOWN) == KF_ALTDOWN )
event.m_altDown = TRUE;
event.m_eventObject = this;
event.m_keyCode = id;
event.SetTimestamp(s_currentMsg.time);
POINT pt;
GetCursorPos(&pt);
RECT rect;
GetWindowRect(GetHwnd(),&rect);
pt.x -= rect.left;
pt.y -= rect.top;
event.m_x = pt.x; event.m_y = pt.y;
if ( GetEventHandler()->ProcessEvent(event) ) if ( GetEventHandler()->ProcessEvent(event) )
{ {
return TRUE; return TRUE;
} }
else return FALSE;
}
else
{
return FALSE;
} }
return FALSE;
} }
bool wxWindow::HandleKeyUp(WXWORD wParam, WXLPARAM lParam) bool wxWindow::HandleKeyUp(WXWORD wParam, WXLPARAM lParam)
{ {
int id; int id = wxCharCodeMSWToWX(wParam);
if ( (id = wxCharCodeMSWToWX(wParam)) == 0 ) { if ( !id )
{
// normal ASCII char
id = wParam; id = wParam;
} }
if ( id != -1 ) if ( id != -1 ) // VZ: does this ever happen (FIXME)?
{ {
wxKeyEvent event(wxEVT_KEY_UP); wxKeyEvent event(CreateKeyEvent(wxEVT_KEY_UP, id, lParam));
event.m_shiftDown = (::GetKeyState(VK_SHIFT)&0x100?TRUE:FALSE);
event.m_controlDown = (::GetKeyState(VK_CONTROL)&0x100?TRUE:FALSE);
if ( (HIWORD(lParam) & KF_ALTDOWN) == KF_ALTDOWN )
event.m_altDown = TRUE;
event.m_eventObject = this;
event.m_keyCode = id;
event.SetTimestamp(s_currentMsg.time);
POINT pt;
GetCursorPos(&pt);
RECT rect;
GetWindowRect(GetHwnd(),&rect);
pt.x -= rect.left;
pt.y -= rect.top;
event.m_x = pt.x; event.m_y = pt.y;
if ( GetEventHandler()->ProcessEvent(event) ) if ( GetEventHandler()->ProcessEvent(event) )
return TRUE; return TRUE;
else
return FALSE;
} }
else
return FALSE; return FALSE;
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -3716,7 +3692,7 @@ void wxSetKeyboardHook(bool doIt)
UnhookWindowsHookEx(wxTheKeyboardHook); UnhookWindowsHookEx(wxTheKeyboardHook);
// avoids mingw warning about statement with no effect (FreeProcInstance // avoids mingw warning about statement with no effect (FreeProcInstance
// doesn't do anything under Win32) // doesn't do anything under Win32)
#ifndef __GNUWIN32__ #ifndef __GNUC__
FreeProcInstance(wxTheKeyboardHookProc); FreeProcInstance(wxTheKeyboardHookProc);
#endif #endif
} }
@@ -3737,8 +3713,8 @@ wxKeyboardHook(int nCode, WORD wParam, DWORD lParam)
event.m_eventObject = NULL; event.m_eventObject = NULL;
event.m_keyCode = id; event.m_keyCode = id;
event.m_shiftDown = ::GetKeyState(VK_SHIFT) & 0x100 != 0; event.m_shiftDown = IsShiftDown();
event.m_controlDown = ::GetKeyState(VK_CONTROL) & 0x100 != 0; event.m_controlDown = IsCtrlDown();
event.SetTimestamp(s_currentMsg.time); event.SetTimestamp(s_currentMsg.time);
wxWindow *win = wxGetActiveWindow(); wxWindow *win = wxGetActiveWindow();