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:
parent
55196c5464
commit
c42404a58e
@ -138,9 +138,13 @@
|
||||
// we are setting this define because of the complex check
|
||||
// using NORLANDER as Cygwin may follow. (header author is Anders Norlander)
|
||||
#if defined(__MINGW32__) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95)))
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
# define wxUSE_NORLANDER_HEADERS 1
|
||||
#endif
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#define wxUSE_NORLANDER_HEADERS 1
|
||||
#endif
|
||||
#else
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#define wxUSE_NORLANDER_HEADERS 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// "old" GNUWIN32 is the one without Norlander's headers: it lacks the standard
|
||||
|
@ -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
|
||||
// window proc
|
||||
#if defined(__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS)
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
# define CASTWNDPROC (long unsigned)
|
||||
#else
|
||||
# ifdef __BORLANDC__
|
||||
@ -79,7 +79,6 @@ WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
|
||||
typedef int (pascal * WndProcCast) ();
|
||||
#endif
|
||||
# define CASTWNDPROC (WndProcCast)
|
||||
// # define CASTWNDPROC
|
||||
# else
|
||||
typedef int (pascal * WndProcCast) ();
|
||||
# define CASTWNDPROC (WndProcCast)
|
||||
|
@ -125,7 +125,7 @@ public:
|
||||
bool Exists() const;
|
||||
// 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
|
||||
size_t *pnMaxKeyLen, // max len of subkey name
|
||||
size_t *pnValues, // number of values
|
||||
|
@ -52,8 +52,6 @@ enum
|
||||
|
||||
class WXDLLEXPORT wxWindow : public wxWindowBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxWindow);
|
||||
|
||||
public:
|
||||
wxWindow() { Init(); }
|
||||
|
||||
@ -425,6 +423,10 @@ private:
|
||||
bool HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
||||
#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_EVENT_TABLE()
|
||||
};
|
||||
|
@ -71,14 +71,13 @@
|
||||
#include "wx/tooltip.h"
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
// OLE is used for drag-and-drop, clipboard, OLE Automation...
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#if defined(__GNUWIN32__) || defined(__SC__) || defined(__SALFORDC__)
|
||||
// OLE is used for drag-and-drop, clipboard, OLE Automation..., but some
|
||||
// compilers don't support it (missing headers, libs, ...)
|
||||
#if defined(__GNUWIN32_OLD__) || defined(__SC__) || defined(__SALFORDC__)
|
||||
#undef wxUSE_OLE
|
||||
|
||||
#define wxUSE_OLE 0
|
||||
#endif // broken compilers
|
||||
#endif
|
||||
|
||||
#if wxUSE_OLE
|
||||
#include <ole2.h>
|
||||
@ -87,7 +86,7 @@
|
||||
#include <string.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>
|
||||
#endif
|
||||
|
||||
|
@ -45,8 +45,8 @@
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#if defined(__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS)
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -30,8 +30,8 @@
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS)
|
||||
#include <commctrl.h>
|
||||
#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
|
||||
#include <commctrl.h>
|
||||
#endif
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
|
||||
|
@ -24,10 +24,8 @@
|
||||
#include <winuser.h>
|
||||
#endif
|
||||
|
||||
#ifndef __TWIN32__
|
||||
#if defined (__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS)
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
|
||||
#include "wx/wxchar.h"
|
||||
|
@ -48,9 +48,6 @@
|
||||
#include "wx/msw/private.h" // needs to be before #include <commdlg.h>
|
||||
|
||||
#if wxUSE_COMMON_DIALOGS
|
||||
#if wxUSE_NORLANDER_HEADERS
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <commdlg.h>
|
||||
#endif
|
||||
|
||||
|
@ -48,12 +48,8 @@
|
||||
|
||||
#include "wx/msw/dib.h"
|
||||
|
||||
#ifndef __TWIN32__
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#ifdef __GNUWIN32__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_CUR
|
||||
|
@ -27,8 +27,7 @@
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if defined(__WIN95__) && \
|
||||
(!defined(__GNUWIN32__) || defined(wxUSE_NORLANDER_HEADERS))
|
||||
#if defined(__WIN95__) && !defined(__GNUWIN32_OLD__)
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/utils.h"
|
||||
|
@ -29,8 +29,8 @@
|
||||
#include "wx/msw/gauge95.h"
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS)
|
||||
#include <commctrl.h>
|
||||
#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
|
||||
#include <commctrl.h>
|
||||
#endif
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxGauge95, wxControl)
|
||||
|
@ -46,7 +46,11 @@
|
||||
#include <ctype.h>
|
||||
#include <winsock.h>
|
||||
|
||||
/* if we use configure for MSW SOCKLEN_T will be already defined */
|
||||
#ifndef SOCKLEN_T
|
||||
#define SOCKLEN_T int
|
||||
#endif
|
||||
|
||||
#define CLASSNAME "_GSocket_Internal_Window_Class"
|
||||
#define WINDOWNAME "_GSocket_Internal_Window_Name"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@ -24,8 +24,8 @@
|
||||
#include "wx/window.h"
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#if !defined( __GNUWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS)
|
||||
#include <mmsystem.h>
|
||||
#ifndef __GNUWIN32_OLD__
|
||||
#include <mmsystem.h>
|
||||
#endif
|
||||
|
||||
#if !defined(__WIN32__) && !defined(_MMRESULT_)
|
||||
@ -33,12 +33,10 @@ typedef UINT MMRESULT;
|
||||
#endif
|
||||
|
||||
#ifndef __TWIN32__
|
||||
#ifdef __GNUWIN32__
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Why doesn't BC++ have joyGetPosEx?
|
||||
#if !defined(__WIN32__) || defined(__BORLANDC__) || defined(__TWIN32__)
|
||||
@ -53,7 +51,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxPoint wxJoystick::GetPosition(void) const
|
||||
wxPoint wxJoystick::GetPosition() const
|
||||
{
|
||||
JOYINFO joyInfo;
|
||||
MMRESULT res = joyGetPos(m_joystick, & joyInfo);
|
||||
@ -63,7 +61,7 @@ wxPoint wxJoystick::GetPosition(void) const
|
||||
return wxPoint(0, 0);
|
||||
}
|
||||
|
||||
int wxJoystick::GetZPosition(void) const
|
||||
int wxJoystick::GetZPosition() const
|
||||
{
|
||||
JOYINFO joyInfo;
|
||||
MMRESULT res = joyGetPos(m_joystick, & joyInfo);
|
||||
@ -73,7 +71,7 @@ int wxJoystick::GetZPosition(void) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetButtonState(void) const
|
||||
int wxJoystick::GetButtonState() const
|
||||
{
|
||||
JOYINFO joyInfo;
|
||||
MMRESULT res = joyGetPos(m_joystick, & joyInfo);
|
||||
@ -95,7 +93,7 @@ int wxJoystick::GetButtonState(void) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetPOVPosition(void) const
|
||||
int wxJoystick::GetPOVPosition() const
|
||||
{
|
||||
#ifndef NO_JOYGETPOSEX
|
||||
JOYINFOEX joyInfo;
|
||||
@ -112,7 +110,7 @@ int wxJoystick::GetPOVPosition(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetPOVCTSPosition(void) const
|
||||
int wxJoystick::GetPOVCTSPosition() const
|
||||
{
|
||||
#ifndef NO_JOYGETPOSEX
|
||||
JOYINFOEX joyInfo;
|
||||
@ -129,7 +127,7 @@ int wxJoystick::GetPOVCTSPosition(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetRudderPosition(void) const
|
||||
int wxJoystick::GetRudderPosition() const
|
||||
{
|
||||
#ifndef NO_JOYGETPOSEX
|
||||
JOYINFOEX joyInfo;
|
||||
@ -146,7 +144,7 @@ int wxJoystick::GetRudderPosition(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetUPosition(void) const
|
||||
int wxJoystick::GetUPosition() const
|
||||
{
|
||||
#ifndef NO_JOYGETPOSEX
|
||||
JOYINFOEX joyInfo;
|
||||
@ -163,7 +161,7 @@ int wxJoystick::GetUPosition(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetVPosition(void) const
|
||||
int wxJoystick::GetVPosition() const
|
||||
{
|
||||
#ifndef NO_JOYGETPOSEX
|
||||
JOYINFOEX joyInfo;
|
||||
@ -180,7 +178,7 @@ int wxJoystick::GetVPosition(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetMovementThreshold(void) const
|
||||
int wxJoystick::GetMovementThreshold() const
|
||||
{
|
||||
UINT thresh = 0;
|
||||
MMRESULT res = joyGetThreshold(m_joystick, & thresh);
|
||||
@ -201,19 +199,19 @@ void wxJoystick::SetMovementThreshold(int threshold)
|
||||
// Capabilities
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool wxJoystick::IsOk(void) const
|
||||
bool wxJoystick::IsOk() const
|
||||
{
|
||||
JOYINFO joyInfo;
|
||||
MMRESULT res = joyGetPos(m_joystick, & joyInfo);
|
||||
return ((joyGetNumDevs() > 0) || (res == JOYERR_NOERROR));
|
||||
}
|
||||
|
||||
int wxJoystick::GetNumberJoysticks(void) const
|
||||
int wxJoystick::GetNumberJoysticks() const
|
||||
{
|
||||
return joyGetNumDevs();
|
||||
}
|
||||
|
||||
int wxJoystick::GetManufacturerId(void) const
|
||||
int wxJoystick::GetManufacturerId() const
|
||||
{
|
||||
JOYCAPS joyCaps;
|
||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
||||
@ -222,7 +220,7 @@ int wxJoystick::GetManufacturerId(void) const
|
||||
return joyCaps.wMid;
|
||||
}
|
||||
|
||||
int wxJoystick::GetProductId(void) const
|
||||
int wxJoystick::GetProductId() const
|
||||
{
|
||||
JOYCAPS joyCaps;
|
||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
||||
@ -231,7 +229,7 @@ int wxJoystick::GetProductId(void) const
|
||||
return joyCaps.wPid;
|
||||
}
|
||||
|
||||
wxString wxJoystick::GetProductName(void) const
|
||||
wxString wxJoystick::GetProductName() const
|
||||
{
|
||||
JOYCAPS joyCaps;
|
||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
||||
@ -240,7 +238,7 @@ wxString wxJoystick::GetProductName(void) const
|
||||
return wxString(joyCaps.szPname);
|
||||
}
|
||||
|
||||
int wxJoystick::GetXMin(void) const
|
||||
int wxJoystick::GetXMin() const
|
||||
{
|
||||
JOYCAPS joyCaps;
|
||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
||||
@ -249,7 +247,7 @@ int wxJoystick::GetXMin(void) const
|
||||
return joyCaps.wXmin;
|
||||
}
|
||||
|
||||
int wxJoystick::GetYMin(void) const
|
||||
int wxJoystick::GetYMin() const
|
||||
{
|
||||
JOYCAPS joyCaps;
|
||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
||||
@ -258,7 +256,7 @@ int wxJoystick::GetYMin(void) const
|
||||
return joyCaps.wYmin;
|
||||
}
|
||||
|
||||
int wxJoystick::GetZMin(void) const
|
||||
int wxJoystick::GetZMin() const
|
||||
{
|
||||
JOYCAPS joyCaps;
|
||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
||||
@ -267,7 +265,7 @@ int wxJoystick::GetZMin(void) const
|
||||
return joyCaps.wZmin;
|
||||
}
|
||||
|
||||
int wxJoystick::GetXMax(void) const
|
||||
int wxJoystick::GetXMax() const
|
||||
{
|
||||
JOYCAPS joyCaps;
|
||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
||||
@ -276,7 +274,7 @@ int wxJoystick::GetXMax(void) const
|
||||
return joyCaps.wXmax;
|
||||
}
|
||||
|
||||
int wxJoystick::GetYMax(void) const
|
||||
int wxJoystick::GetYMax() const
|
||||
{
|
||||
JOYCAPS joyCaps;
|
||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
||||
@ -285,7 +283,7 @@ int wxJoystick::GetYMax(void) const
|
||||
return joyCaps.wYmax;
|
||||
}
|
||||
|
||||
int wxJoystick::GetZMax(void) const
|
||||
int wxJoystick::GetZMax() const
|
||||
{
|
||||
JOYCAPS joyCaps;
|
||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
||||
@ -294,7 +292,7 @@ int wxJoystick::GetZMax(void) const
|
||||
return joyCaps.wZmax;
|
||||
}
|
||||
|
||||
int wxJoystick::GetNumberButtons(void) const
|
||||
int wxJoystick::GetNumberButtons() const
|
||||
{
|
||||
JOYCAPS joyCaps;
|
||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
||||
@ -303,7 +301,7 @@ int wxJoystick::GetNumberButtons(void) const
|
||||
return joyCaps.wNumButtons;
|
||||
}
|
||||
|
||||
int wxJoystick::GetNumberAxes(void) const
|
||||
int wxJoystick::GetNumberAxes() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -316,7 +314,7 @@ int wxJoystick::GetNumberAxes(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetMaxButtons(void) const
|
||||
int wxJoystick::GetMaxButtons() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -329,7 +327,7 @@ int wxJoystick::GetMaxButtons(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetMaxAxes(void) const
|
||||
int wxJoystick::GetMaxAxes() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -342,7 +340,7 @@ int wxJoystick::GetMaxAxes(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetPollingMin(void) const
|
||||
int wxJoystick::GetPollingMin() const
|
||||
{
|
||||
JOYCAPS joyCaps;
|
||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
||||
@ -351,7 +349,7 @@ int wxJoystick::GetPollingMin(void) const
|
||||
return joyCaps.wPeriodMin;
|
||||
}
|
||||
|
||||
int wxJoystick::GetPollingMax(void) const
|
||||
int wxJoystick::GetPollingMax() const
|
||||
{
|
||||
JOYCAPS joyCaps;
|
||||
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
|
||||
@ -360,7 +358,7 @@ int wxJoystick::GetPollingMax(void) const
|
||||
return joyCaps.wPeriodMax;
|
||||
}
|
||||
|
||||
int wxJoystick::GetRudderMin(void) const
|
||||
int wxJoystick::GetRudderMin() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -373,7 +371,7 @@ int wxJoystick::GetRudderMin(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetRudderMax(void) const
|
||||
int wxJoystick::GetRudderMax() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -386,7 +384,7 @@ int wxJoystick::GetRudderMax(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetUMin(void) const
|
||||
int wxJoystick::GetUMin() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -399,7 +397,7 @@ int wxJoystick::GetUMin(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetUMax(void) const
|
||||
int wxJoystick::GetUMax() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -412,7 +410,7 @@ int wxJoystick::GetUMax(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetVMin(void) const
|
||||
int wxJoystick::GetVMin() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -425,7 +423,7 @@ int wxJoystick::GetVMin(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxJoystick::GetVMax(void) const
|
||||
int wxJoystick::GetVMax() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
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__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -452,7 +450,7 @@ bool wxJoystick::HasRudder(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
bool wxJoystick::HasZ(void) const
|
||||
bool wxJoystick::HasZ() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -465,7 +463,7 @@ bool wxJoystick::HasZ(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
bool wxJoystick::HasU(void) const
|
||||
bool wxJoystick::HasU() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -478,7 +476,7 @@ bool wxJoystick::HasU(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
bool wxJoystick::HasV(void) const
|
||||
bool wxJoystick::HasV() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -491,7 +489,7 @@ bool wxJoystick::HasV(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
bool wxJoystick::HasPOV(void) const
|
||||
bool wxJoystick::HasPOV() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -504,7 +502,7 @@ bool wxJoystick::HasPOV(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
bool wxJoystick::HasPOV4Dir(void) const
|
||||
bool wxJoystick::HasPOV4Dir() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -517,7 +515,7 @@ bool wxJoystick::HasPOV4Dir(void) const
|
||||
#endif
|
||||
}
|
||||
|
||||
bool wxJoystick::HasPOVCTS(void) const
|
||||
bool wxJoystick::HasPOVCTS() const
|
||||
{
|
||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||
JOYCAPS joyCaps;
|
||||
@ -540,7 +538,7 @@ bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq)
|
||||
return (res == JOYERR_NOERROR);
|
||||
}
|
||||
|
||||
bool wxJoystick::ReleaseCapture(void)
|
||||
bool wxJoystick::ReleaseCapture()
|
||||
{
|
||||
MMRESULT res = joyReleaseCapture(m_joystick);
|
||||
return (res == JOYERR_NOERROR);
|
||||
|
@ -48,10 +48,8 @@
|
||||
#endif
|
||||
|
||||
#ifndef __TWIN32__
|
||||
#if defined(__GNUWIN32__)
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#if defined(__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS)
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#else
|
||||
#include <commctrl.h>
|
||||
@ -554,13 +554,13 @@ bool wxListCtrl::SetColumnWidth(int col, int width)
|
||||
// visible area of the list control (list or report view)
|
||||
// or the total number of items in the list control (icon
|
||||
// or small icon view)
|
||||
int wxListCtrl::GetCountPerPage(void) const
|
||||
int wxListCtrl::GetCountPerPage() const
|
||||
{
|
||||
return ListView_GetCountPerPage(GetHwnd());
|
||||
}
|
||||
|
||||
// Gets the edit control for editing labels.
|
||||
wxTextCtrl* wxListCtrl::GetEditControl(void) const
|
||||
wxTextCtrl* wxListCtrl::GetEditControl() const
|
||||
{
|
||||
return m_textCtrl;
|
||||
}
|
||||
@ -787,7 +787,7 @@ bool wxListCtrl::SetItemPosition(long item, const wxPoint& pos)
|
||||
}
|
||||
|
||||
// Gets the number of items in the list control
|
||||
int wxListCtrl::GetItemCount(void) const
|
||||
int wxListCtrl::GetItemCount() const
|
||||
{
|
||||
return ListView_GetItemCount(GetHwnd());
|
||||
}
|
||||
@ -801,13 +801,13 @@ int wxListCtrl::GetItemSpacing(bool isSmall) const
|
||||
}
|
||||
|
||||
// Gets the number of selected items in the list control
|
||||
int wxListCtrl::GetSelectedItemCount(void) const
|
||||
int wxListCtrl::GetSelectedItemCount() const
|
||||
{
|
||||
return ListView_GetSelectedCount(GetHwnd());
|
||||
}
|
||||
|
||||
// Gets the text colour of the listview
|
||||
wxColour wxListCtrl::GetTextColour(void) const
|
||||
wxColour wxListCtrl::GetTextColour() const
|
||||
{
|
||||
COLORREF ref = ListView_GetTextColor(GetHwnd());
|
||||
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
|
||||
// list or report view
|
||||
long wxListCtrl::GetTopItem(void) const
|
||||
long wxListCtrl::GetTopItem() const
|
||||
{
|
||||
return (long) ListView_GetTopIndex(GetHwnd());
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@ -46,11 +46,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame)
|
||||
#include "wx/minifram.h"
|
||||
|
||||
#ifndef __TWIN32__
|
||||
#ifdef __GNUWIN32__
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame)
|
||||
|
@ -41,15 +41,13 @@
|
||||
#include <windowsx.h> // for SetWindowFont
|
||||
|
||||
#ifndef __TWIN32__
|
||||
#ifdef __GNUWIN32__
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(__GNUWIN32__) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS)
|
||||
#include <commctrl.h>
|
||||
#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
|
||||
#include <commctrl.h>
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -302,7 +302,7 @@ wxString wxRegKey::GetName(bool bShortPrefix) const
|
||||
return str;
|
||||
}
|
||||
|
||||
#if defined( __GNUWIN32__ ) && !defined(wxUSE_NORLANDER_HEADERS)
|
||||
#if defined( __GNUWIN32_OLD__ )
|
||||
bool wxRegKey::GetKeyInfo(size_t* pnSubKeys,
|
||||
size_t* pnMaxKeyLen,
|
||||
size_t* pnValues,
|
||||
|
@ -6,7 +6,7 @@
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@ -31,8 +31,8 @@
|
||||
#include "wx/msw/slider95.h"
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS)
|
||||
#include <commctrl.h>
|
||||
#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
|
||||
#include <commctrl.h>
|
||||
#endif
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxSlider95, wxControl)
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include "wx/spinbutt.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>
|
||||
#endif
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include "wx/spinctrl.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>
|
||||
#endif
|
||||
|
||||
|
@ -36,8 +36,8 @@
|
||||
#include "wx/msw/private.h"
|
||||
#include <windowsx.h>
|
||||
|
||||
#if !defined(__GNUWIN32__) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS)
|
||||
#include <commctrl.h>
|
||||
#if !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
|
||||
#include <commctrl.h>
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -6,7 +6,7 @@
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows license
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@ -32,16 +32,10 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS)
|
||||
#include <commctrl.h>
|
||||
#endif
|
||||
|
||||
#ifndef __TWIN32__
|
||||
#ifdef __GNUWIN32__
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#endif
|
||||
#if !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
|
||||
#include <commctrl.h>
|
||||
#else
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
|
||||
#include "wx/msw/dib.h"
|
||||
|
@ -1,13 +1,13 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// File: taskbar.cpp
|
||||
// Purpose: Implements wxTaskBarIcon class for manipulating icons on
|
||||
// Purpose: Implements wxTaskBarIcon class for manipulating icons on
|
||||
// the Windows task bar.
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 24/3/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@ -40,19 +40,17 @@
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#ifndef __TWIN32__
|
||||
#ifdef __GNUWIN32__
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __SALFORDC__
|
||||
#include <shellapi.h>
|
||||
#include <shellapi.h>
|
||||
#endif
|
||||
|
||||
LRESULT APIENTRY _EXPORT wxTaskBarIconWindowProc( HWND hWnd, unsigned msg,
|
||||
UINT wParam, LONG lParam );
|
||||
UINT wParam, LONG lParam );
|
||||
|
||||
wxChar *wxTaskBarWindowClass = wxT("wxTaskBarWindowClass");
|
||||
|
||||
@ -111,20 +109,20 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
|
||||
NOTIFYICONDATA notifyData;
|
||||
|
||||
memset(¬ifyData, 0, sizeof(notifyData));
|
||||
notifyData.cbSize = sizeof(notifyData);
|
||||
notifyData.hWnd = (HWND) m_hWnd;
|
||||
notifyData.uCallbackMessage = sm_taskbarMsg;
|
||||
notifyData.uFlags = NIF_MESSAGE ;
|
||||
if (icon.Ok())
|
||||
notifyData.cbSize = sizeof(notifyData);
|
||||
notifyData.hWnd = (HWND) m_hWnd;
|
||||
notifyData.uCallbackMessage = sm_taskbarMsg;
|
||||
notifyData.uFlags = NIF_MESSAGE ;
|
||||
if (icon.Ok())
|
||||
{
|
||||
notifyData.uFlags |= NIF_ICON;
|
||||
notifyData.hIcon = (HICON) icon.GetHICON();
|
||||
notifyData.uFlags |= NIF_ICON;
|
||||
notifyData.hIcon = (HICON) icon.GetHICON();
|
||||
}
|
||||
|
||||
if (((const wxChar*) tooltip != NULL) && (tooltip != wxT("")))
|
||||
{
|
||||
notifyData.uFlags |= NIF_TIP ;
|
||||
lstrcpyn(notifyData.szTip, WXSTRINGCAST tooltip, sizeof(notifyData.szTip));
|
||||
lstrcpyn(notifyData.szTip, WXSTRINGCAST tooltip, sizeof(notifyData.szTip));
|
||||
}
|
||||
|
||||
notifyData.uID = 99;
|
||||
@ -146,11 +144,11 @@ bool wxTaskBarIcon::RemoveIcon(void)
|
||||
NOTIFYICONDATA notifyData;
|
||||
|
||||
memset(¬ifyData, 0, sizeof(notifyData));
|
||||
notifyData.cbSize = sizeof(notifyData);
|
||||
notifyData.hWnd = (HWND) m_hWnd;
|
||||
notifyData.uCallbackMessage = sm_taskbarMsg;
|
||||
notifyData.uFlags = NIF_MESSAGE;
|
||||
notifyData.hIcon = 0 ; // hIcon;
|
||||
notifyData.cbSize = sizeof(notifyData);
|
||||
notifyData.hWnd = (HWND) m_hWnd;
|
||||
notifyData.uCallbackMessage = sm_taskbarMsg;
|
||||
notifyData.uFlags = NIF_MESSAGE;
|
||||
notifyData.hIcon = 0 ; // hIcon;
|
||||
notifyData.uID = 99;
|
||||
m_iconAdded = FALSE;
|
||||
|
||||
@ -265,8 +263,8 @@ bool wxTaskBarIcon::RegisterWindowClass()
|
||||
// Also register the taskbar message here
|
||||
sm_taskbarMsg = ::RegisterWindowMessage(wxT("wxTaskBarIconMessage"));
|
||||
|
||||
WNDCLASS wc;
|
||||
bool rc;
|
||||
WNDCLASS wc;
|
||||
bool rc;
|
||||
|
||||
HINSTANCE hInstance = GetModuleHandle(NULL);
|
||||
|
||||
@ -318,37 +316,37 @@ long wxTaskBarIcon::WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wPar
|
||||
|
||||
switch (lParam)
|
||||
{
|
||||
case WM_LBUTTONDOWN:
|
||||
case WM_LBUTTONDOWN:
|
||||
eventType = wxEVT_TASKBAR_LEFT_DOWN;
|
||||
break;
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
case WM_LBUTTONUP:
|
||||
eventType = wxEVT_TASKBAR_LEFT_UP;
|
||||
break;
|
||||
|
||||
case WM_RBUTTONDOWN:
|
||||
case WM_RBUTTONDOWN:
|
||||
eventType = wxEVT_TASKBAR_RIGHT_DOWN;
|
||||
break;
|
||||
|
||||
case WM_RBUTTONUP:
|
||||
case WM_RBUTTONUP:
|
||||
eventType = wxEVT_TASKBAR_RIGHT_UP;
|
||||
break;
|
||||
|
||||
case WM_LBUTTONDBLCLK:
|
||||
case WM_LBUTTONDBLCLK:
|
||||
eventType = wxEVT_TASKBAR_LEFT_DCLICK;
|
||||
break;
|
||||
|
||||
case WM_RBUTTONDBLCLK:
|
||||
case WM_RBUTTONDBLCLK:
|
||||
eventType = wxEVT_TASKBAR_RIGHT_DCLICK;
|
||||
break;
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
case WM_MOUSEMOVE:
|
||||
eventType = wxEVT_TASKBAR_MOVE;
|
||||
break;
|
||||
|
||||
default:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (eventType) {
|
||||
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,
|
||||
UINT wParam, LONG lParam )
|
||||
UINT wParam, LONG lParam )
|
||||
{
|
||||
wxTaskBarIcon* obj = wxTaskBarIcon::FindObjectForHWND((WXHWND) hWnd);
|
||||
if (obj)
|
||||
|
@ -58,7 +58,7 @@
|
||||
# include <fstream>
|
||||
#endif
|
||||
|
||||
#if wxUSE_RICHEDIT && (!defined(__GNUWIN32__) || defined(wxUSE_NORLANDER_HEADERS))
|
||||
#if wxUSE_RICHEDIT && !defined(__GNUWIN32_OLD__)
|
||||
#include <richedit.h>
|
||||
#endif
|
||||
|
||||
|
@ -47,13 +47,11 @@
|
||||
#include "wx/treectrl.h"
|
||||
#include "wx/settings.h"
|
||||
|
||||
#ifdef __GNUWIN32__
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
|
||||
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS)
|
||||
#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
|
||||
#include <commctrl.h>
|
||||
#endif
|
||||
|
||||
@ -327,13 +325,14 @@ bool wxTreeCtrl::Create(wxWindow *parent,
|
||||
if ( m_windowStyle & wxTR_LINES_AT_ROOT )
|
||||
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
|
||||
// up the image list we need for this if we do have multiple selections
|
||||
#if !defined(__VISUALC__) || (__VISUALC__ > 1010)
|
||||
if ( m_windowStyle & wxTR_MULTIPLE )
|
||||
wstyle |= TVS_CHECKBOXES;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Create the tree control.
|
||||
|
@ -6,7 +6,7 @@
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@ -31,16 +31,10 @@
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#if !defined( __GNUWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS)
|
||||
#include <mmsystem.h>
|
||||
#endif
|
||||
|
||||
#ifndef __TWIN32__
|
||||
#ifdef __GNUWIN32__
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#else
|
||||
#include <mmsystem.h>
|
||||
#endif
|
||||
|
||||
wxWave::wxWave()
|
||||
|
@ -79,7 +79,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if !defined(__GNUWIN32__)|| defined(wxUSE_NORLANDER_HEADERS)
|
||||
#ifndef __GNUWIN32_OLD__
|
||||
#include <shellapi.h>
|
||||
#include <mmsystem.h>
|
||||
#endif
|
||||
@ -88,15 +88,13 @@
|
||||
#include <windowsx.h>
|
||||
#endif
|
||||
|
||||
#if ( defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS)
|
||||
#include <commctrl.h>
|
||||
#endif
|
||||
|
||||
#ifndef __TWIN32__
|
||||
#ifdef __GNUWIN32__
|
||||
#ifndef wxUSE_NORLANDER_HEADERS
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#if !defined(__GNUWIN32_OLD__) && !defined(__TWIN32__)
|
||||
#ifndef __WIN95__
|
||||
#include <commctrl.h>
|
||||
#endif
|
||||
#else // broken compiler
|
||||
#ifndef __TWIN32__
|
||||
#include "wx/msw/gnuwin32/extra.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -131,6 +129,10 @@ wxWindow *wxFindWinFromHandle(WXHWND hWnd);
|
||||
// mouse clicks
|
||||
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
|
||||
// ---------------------------------------------------------------------------
|
||||
@ -1480,8 +1482,8 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
|
||||
|
||||
if ( bProcess )
|
||||
{
|
||||
bool bCtrlDown = (::GetKeyState(VK_CONTROL) & 0x100) != 0;
|
||||
bool bShiftDown = (::GetKeyState(VK_SHIFT) & 0x100) != 0;
|
||||
bool bCtrlDown = IsCtrlDown();
|
||||
bool bShiftDown = IsShiftDown();
|
||||
|
||||
// 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
|
||||
@ -1596,8 +1598,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
|
||||
// don't process system keys here
|
||||
if ( !(HIWORD(msg->lParam) & KF_ALTDOWN) )
|
||||
{
|
||||
if ( (msg->wParam == VK_TAB) &&
|
||||
(::GetKeyState(VK_CONTROL) & 0x100) != 0 )
|
||||
if ( (msg->wParam == VK_TAB) && IsCtrlDown() )
|
||||
{
|
||||
// find the first notebook parent and change its page
|
||||
wxWindow *win = this;
|
||||
@ -1610,7 +1611,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
|
||||
|
||||
if ( nbook )
|
||||
{
|
||||
bool forward = !(::GetKeyState(VK_SHIFT) & 0x100);
|
||||
bool forward = !IsShiftDown();
|
||||
|
||||
nbook->AdvanceSelection(forward);
|
||||
}
|
||||
@ -3149,12 +3150,43 @@ bool wxWindow::HandleMouseMove(int x, int y, WXUINT flags)
|
||||
// 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
|
||||
// WM_KEYDOWN one
|
||||
bool wxWindow::HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII)
|
||||
{
|
||||
bool ctrlDown = FALSE;
|
||||
|
||||
int id;
|
||||
bool tempControlDown = FALSE;
|
||||
if ( isASCII )
|
||||
{
|
||||
// If 1 -> 26, translate to CTRL plus a letter.
|
||||
@ -3163,142 +3195,86 @@ bool wxWindow::HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 13:
|
||||
{
|
||||
case 13:
|
||||
id = WXK_RETURN;
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
|
||||
case 8:
|
||||
id = WXK_BACK;
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
|
||||
case 9:
|
||||
id = WXK_TAB;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
tempControlDown = TRUE;
|
||||
|
||||
default:
|
||||
ctrlDown = TRUE;
|
||||
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
|
||||
// WM_CHAR (i.e. when isASCII = TRUE)
|
||||
// WM_CHAR (i.e. when isASCII = TRUE), don't process it now
|
||||
id = -1;
|
||||
}
|
||||
|
||||
if ( id != -1 )
|
||||
{
|
||||
wxKeyEvent event(wxEVT_CHAR);
|
||||
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;
|
||||
wxKeyEvent event(CreateKeyEvent(wxEVT_CHAR, id, lParam));
|
||||
if ( ctrlDown )
|
||||
{
|
||||
event.m_controlDown = TRUE;
|
||||
}
|
||||
|
||||
if ( GetEventHandler()->ProcessEvent(event) )
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if ( id != -1 )
|
||||
if ( id != -1 ) // VZ: does this ever happen (FIXME)?
|
||||
{
|
||||
wxKeyEvent event(wxEVT_KEY_DOWN);
|
||||
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;
|
||||
|
||||
wxKeyEvent event(CreateKeyEvent(wxEVT_KEY_DOWN, id, lParam));
|
||||
if ( GetEventHandler()->ProcessEvent(event) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if ( id != -1 )
|
||||
if ( id != -1 ) // VZ: does this ever happen (FIXME)?
|
||||
{
|
||||
wxKeyEvent event(wxEVT_KEY_UP);
|
||||
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;
|
||||
|
||||
wxKeyEvent event(CreateKeyEvent(wxEVT_KEY_UP, id, lParam));
|
||||
if ( GetEventHandler()->ProcessEvent(event) )
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@ -3716,7 +3692,7 @@ void wxSetKeyboardHook(bool doIt)
|
||||
UnhookWindowsHookEx(wxTheKeyboardHook);
|
||||
// avoids mingw warning about statement with no effect (FreeProcInstance
|
||||
// doesn't do anything under Win32)
|
||||
#ifndef __GNUWIN32__
|
||||
#ifndef __GNUC__
|
||||
FreeProcInstance(wxTheKeyboardHookProc);
|
||||
#endif
|
||||
}
|
||||
@ -3737,8 +3713,8 @@ wxKeyboardHook(int nCode, WORD wParam, DWORD lParam)
|
||||
|
||||
event.m_eventObject = NULL;
|
||||
event.m_keyCode = id;
|
||||
event.m_shiftDown = ::GetKeyState(VK_SHIFT) & 0x100 != 0;
|
||||
event.m_controlDown = ::GetKeyState(VK_CONTROL) & 0x100 != 0;
|
||||
event.m_shiftDown = IsShiftDown();
|
||||
event.m_controlDown = IsCtrlDown();
|
||||
event.SetTimestamp(s_currentMsg.time);
|
||||
|
||||
wxWindow *win = wxGetActiveWindow();
|
||||
|
Loading…
Reference in New Issue
Block a user