// 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
// 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__
typedef int (pascal * WndProcCast) ();
#endif
# define CASTWNDPROC (WndProcCast)
-// # define CASTWNDPROC
# else
typedef int (pascal * WndProcCast) ();
# define CASTWNDPROC (WndProcCast)
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
class WXDLLEXPORT wxWindow : public wxWindowBase
{
- DECLARE_DYNAMIC_CLASS(wxWindow);
-
public:
wxWindow() { Init(); }
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()
};
#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>
#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
#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
// ----------------------------------------------------------------------------
#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)
#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"
#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
#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
#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"
#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)
#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"
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#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_)
#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__)
// Attributes
////////////////////////////////////////////////////////////////////////////
-wxPoint wxJoystick::GetPosition(void) const
+wxPoint wxJoystick::GetPosition() const
{
JOYINFO joyInfo;
MMRESULT res = joyGetPos(m_joystick, & joyInfo);
return wxPoint(0, 0);
}
-int wxJoystick::GetZPosition(void) const
+int wxJoystick::GetZPosition() const
{
JOYINFO joyInfo;
MMRESULT res = joyGetPos(m_joystick, & joyInfo);
return 0;
}
-int wxJoystick::GetButtonState(void) const
+int wxJoystick::GetButtonState() const
{
JOYINFO joyInfo;
MMRESULT res = joyGetPos(m_joystick, & joyInfo);
return 0;
}
-int wxJoystick::GetPOVPosition(void) const
+int wxJoystick::GetPOVPosition() const
{
#ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo;
#endif
}
-int wxJoystick::GetPOVCTSPosition(void) const
+int wxJoystick::GetPOVCTSPosition() const
{
#ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo;
#endif
}
-int wxJoystick::GetRudderPosition(void) const
+int wxJoystick::GetRudderPosition() const
{
#ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo;
#endif
}
-int wxJoystick::GetUPosition(void) const
+int wxJoystick::GetUPosition() const
{
#ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo;
#endif
}
-int wxJoystick::GetVPosition(void) const
+int wxJoystick::GetVPosition() const
{
#ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo;
#endif
}
-int wxJoystick::GetMovementThreshold(void) const
+int wxJoystick::GetMovementThreshold() const
{
UINT thresh = 0;
MMRESULT res = joyGetThreshold(m_joystick, & thresh);
// 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)
return joyCaps.wMid;
}
-int wxJoystick::GetProductId(void) const
+int wxJoystick::GetProductId() const
{
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return joyCaps.wPid;
}
-wxString wxJoystick::GetProductName(void) const
+wxString wxJoystick::GetProductName() const
{
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return wxString(joyCaps.szPname);
}
-int wxJoystick::GetXMin(void) const
+int wxJoystick::GetXMin() const
{
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return joyCaps.wXmin;
}
-int wxJoystick::GetYMin(void) const
+int wxJoystick::GetYMin() const
{
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return joyCaps.wYmin;
}
-int wxJoystick::GetZMin(void) const
+int wxJoystick::GetZMin() const
{
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return joyCaps.wZmin;
}
-int wxJoystick::GetXMax(void) const
+int wxJoystick::GetXMax() const
{
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return joyCaps.wXmax;
}
-int wxJoystick::GetYMax(void) const
+int wxJoystick::GetYMax() const
{
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return joyCaps.wYmax;
}
-int wxJoystick::GetZMax(void) const
+int wxJoystick::GetZMax() const
{
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return joyCaps.wZmax;
}
-int wxJoystick::GetNumberButtons(void) const
+int wxJoystick::GetNumberButtons() const
{
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return joyCaps.wNumButtons;
}
-int wxJoystick::GetNumberAxes(void) const
+int wxJoystick::GetNumberAxes() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-int wxJoystick::GetMaxButtons(void) const
+int wxJoystick::GetMaxButtons() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-int wxJoystick::GetMaxAxes(void) const
+int wxJoystick::GetMaxAxes() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-int wxJoystick::GetPollingMin(void) const
+int wxJoystick::GetPollingMin() const
{
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return joyCaps.wPeriodMin;
}
-int wxJoystick::GetPollingMax(void) const
+int wxJoystick::GetPollingMax() const
{
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return joyCaps.wPeriodMax;
}
-int wxJoystick::GetRudderMin(void) const
+int wxJoystick::GetRudderMin() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-int wxJoystick::GetRudderMax(void) const
+int wxJoystick::GetRudderMax() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-int wxJoystick::GetUMin(void) const
+int wxJoystick::GetUMin() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-int wxJoystick::GetUMax(void) const
+int wxJoystick::GetUMax() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-int wxJoystick::GetVMin(void) const
+int wxJoystick::GetVMin() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-int wxJoystick::GetVMax(void) const
+int wxJoystick::GetVMax() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
}
-bool wxJoystick::HasRudder(void) const
+bool wxJoystick::HasRudder() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-bool wxJoystick::HasZ(void) const
+bool wxJoystick::HasZ() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-bool wxJoystick::HasU(void) const
+bool wxJoystick::HasU() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-bool wxJoystick::HasV(void) const
+bool wxJoystick::HasV() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-bool wxJoystick::HasPOV(void) const
+bool wxJoystick::HasPOV() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-bool wxJoystick::HasPOV4Dir(void) const
+bool wxJoystick::HasPOV4Dir() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
#endif
}
-bool wxJoystick::HasPOVCTS(void) const
+bool wxJoystick::HasPOVCTS() const
{
#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
return (res == JOYERR_NOERROR);
}
-bool wxJoystick::ReleaseCapture(void)
+bool wxJoystick::ReleaseCapture()
{
MMRESULT res = joyReleaseCapture(m_joystick);
return (res == JOYERR_NOERROR);
#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
#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>
// 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;
}
}
// Gets the number of items in the list control
-int wxListCtrl::GetItemCount(void) const
+int wxListCtrl::GetItemCount() const
{
return ListView_GetItemCount(GetHwnd());
}
}
// 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));
// 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());
}
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#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)
#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
// ----------------------------------------------------------------------------
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,
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#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)
#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
#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
#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
// ----------------------------------------------------------------------------
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#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"
/////////////////////////////////////////////////////////////////////////
// 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__
#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");
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;
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;
// Also register the taskbar message here
sm_taskbarMsg = ::RegisterWindowMessage(wxT("wxTaskBarIconMessage"));
- WNDCLASS wc;
- bool rc;
+ WNDCLASS wc;
+ bool rc;
HINSTANCE hInstance = GetModuleHandle(NULL);
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;
}
LRESULT APIENTRY _EXPORT wxTaskBarIconWindowProc( HWND hWnd, unsigned msg,
- UINT wParam, LONG lParam )
+ UINT wParam, LONG lParam )
{
wxTaskBarIcon* obj = wxTaskBarIcon::FindObjectForHWND((WXHWND) hWnd);
if (obj)
# include <fstream>
#endif
-#if wxUSE_RICHEDIT && (!defined(__GNUWIN32__) || defined(wxUSE_NORLANDER_HEADERS))
+#if wxUSE_RICHEDIT && !defined(__GNUWIN32_OLD__)
#include <richedit.h>
#endif
#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
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.
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#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()
#include <string.h>
-#if !defined(__GNUWIN32__)|| defined(wxUSE_NORLANDER_HEADERS)
+#ifndef __GNUWIN32_OLD__
#include <shellapi.h>
#include <mmsystem.h>
#endif
#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
// 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
// ---------------------------------------------------------------------------
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
// 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;
if ( nbook )
{
- bool forward = !(::GetKeyState(VK_SHIFT) & 0x100);
+ bool forward = !IsShiftDown();
nbook->AdvanceSelection(forward);
}
// 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.
{
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;
}
// ---------------------------------------------------------------------------
UnhookWindowsHookEx(wxTheKeyboardHook);
// avoids mingw warning about statement with no effect (FreeProcInstance
// doesn't do anything under Win32)
-#ifndef __GNUWIN32__
+#ifndef __GNUC__
FreeProcInstance(wxTheKeyboardHookProc);
#endif
}
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();