1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: private.h
|
1999-05-13 17:21:04 -04:00
|
|
|
// Purpose: Private declarations: as this header is only included by
|
|
|
|
// wxWindows itself, it may contain identifiers which don't start
|
|
|
|
// with "wx".
|
1998-05-20 10:12:05 -04:00
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
1998-10-14 19:53:24 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_PRIVATE_H_
|
|
|
|
#define _WX_PRIVATE_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
1999-05-18 20:53:27 -04:00
|
|
|
// undefine conflicting symbols which were defined in windows.h
|
|
|
|
#include "wx/msw/winundef.h"
|
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
class WXDLLEXPORT wxFont;
|
1999-06-13 18:54:04 -04:00
|
|
|
class WXDLLEXPORT wxWindow;
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-05-18 20:53:27 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// private constants
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Conversion
|
|
|
|
static const double METRIC_CONVERSION_CONSTANT = 0.0393700787;
|
|
|
|
|
|
|
|
// Scaling factors for various unit conversions
|
|
|
|
static const double mm2inches = (METRIC_CONVERSION_CONSTANT);
|
|
|
|
static const double inches2mm = (1/METRIC_CONVERSION_CONSTANT);
|
|
|
|
|
|
|
|
static const double mm2twips = (METRIC_CONVERSION_CONSTANT*1440);
|
|
|
|
static const double twips2mm = (1/(METRIC_CONVERSION_CONSTANT*1440));
|
|
|
|
|
|
|
|
static const double mm2pt = (METRIC_CONVERSION_CONSTANT*72);
|
|
|
|
static const double pt2mm = (1/(METRIC_CONVERSION_CONSTANT*72));
|
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// standard icons from the resources
|
|
|
|
// ---------------------------------------------------------------------------
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern HICON) wxSTD_FRAME_ICON;
|
|
|
|
WXDLLEXPORT_DATA(extern HICON) wxSTD_MDIPARENTFRAME_ICON;
|
|
|
|
WXDLLEXPORT_DATA(extern HICON) wxSTD_MDICHILDFRAME_ICON;
|
|
|
|
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_FRAME_ICON;
|
|
|
|
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDIPARENTFRAME_ICON;
|
|
|
|
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDICHILDFRAME_ICON;
|
|
|
|
WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
|
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// this defines a CASTWNDPROC macro which casts a pointer to the type of a
|
|
|
|
// window proc
|
|
|
|
// ---------------------------------------------------------------------------
|
1999-06-08 16:56:50 -04:00
|
|
|
|
1999-08-03 20:42:51 -04:00
|
|
|
#if defined(__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS)
|
1998-07-17 07:10:38 -04:00
|
|
|
# define CASTWNDPROC (long unsigned)
|
1998-05-20 10:12:05 -04:00
|
|
|
#else
|
1998-07-17 07:10:38 -04:00
|
|
|
# ifdef __BORLANDC__
|
1998-12-28 07:35:49 -05:00
|
|
|
|
|
|
|
# ifdef __WIN32__
|
1998-07-17 07:10:38 -04:00
|
|
|
# define CASTWNDPROC
|
1998-12-28 07:35:49 -05:00
|
|
|
# else
|
|
|
|
typedef int (pascal * WndProcCast) ();
|
|
|
|
# define CASTWNDPROC (WndProcCast)
|
|
|
|
# endif
|
|
|
|
|
1998-07-17 07:10:38 -04:00
|
|
|
# else
|
1999-08-03 20:42:51 -04:00
|
|
|
# if defined (__WIN32__) && defined(STRICT)
|
1998-07-27 05:47:57 -04:00
|
|
|
typedef long (_stdcall * WndProcCast) (HWND, unsigned int, unsigned int, long);
|
|
|
|
# define CASTWNDPROC (WndProcCast)
|
1998-12-20 18:49:21 -05:00
|
|
|
# elif defined(__WIN16__)
|
1998-12-28 07:35:49 -05:00
|
|
|
# ifdef __BORLANDC__
|
|
|
|
typedef int (pascal * WndProcCast) ();
|
|
|
|
# define CASTWNDPROC (WndProcCast)
|
|
|
|
# else
|
1999-06-14 03:12:16 -04:00
|
|
|
# if defined(__VISUALC__) && defined(STRICT)
|
|
|
|
# define CASTWNDPROC (WNDPROC)
|
|
|
|
# else
|
|
|
|
typedef int (PASCAL * WndProcCast) ();
|
|
|
|
# define CASTWNDPROC (WndProcCast)
|
|
|
|
# endif
|
1998-12-28 07:35:49 -05:00
|
|
|
# endif
|
1998-07-27 05:47:57 -04:00
|
|
|
# else
|
|
|
|
# define CASTWNDPROC
|
|
|
|
# endif
|
1998-07-17 07:10:38 -04:00
|
|
|
# endif
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// some stuff for old Windows versions (FIXME: what does it do here??)
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
1998-10-14 19:53:24 -04:00
|
|
|
#if !defined(APIENTRY) // NT defines APIENTRY, 3.x not
|
1999-05-13 17:21:04 -04:00
|
|
|
#define APIENTRY FAR PASCAL
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
1998-10-14 19:53:24 -04:00
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
#ifdef __WIN32__
|
1999-05-13 17:21:04 -04:00
|
|
|
#define _EXPORT
|
1998-05-20 10:12:05 -04:00
|
|
|
#else
|
1999-05-13 17:21:04 -04:00
|
|
|
#define _EXPORT _export
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __WIN32__
|
|
|
|
typedef signed short int SHORT;
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
1998-10-14 19:53:24 -04:00
|
|
|
|
|
|
|
#if !defined(__WIN32__) // 3.x uses FARPROC for dialogs
|
1999-06-14 03:12:16 -04:00
|
|
|
#ifndef STRICT
|
1999-05-13 17:21:04 -04:00
|
|
|
#define DLGPROC FARPROC
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
1999-06-14 03:12:16 -04:00
|
|
|
#endif
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1998-09-25 09:28:52 -04:00
|
|
|
#if wxUSE_PENWIN
|
1999-05-09 20:42:57 -04:00
|
|
|
WXDLLEXPORT void wxRegisterPenWin();
|
|
|
|
WXDLLEXPORT void wxCleanUpPenWin();
|
|
|
|
WXDLLEXPORT void wxEnablePenAppHooks (bool hook);
|
|
|
|
#endif // wxUSE_PENWIN
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1998-09-25 09:28:52 -04:00
|
|
|
#if wxUSE_ITSY_BITSY
|
1999-05-13 17:21:04 -04:00
|
|
|
#define IBS_HORZCAPTION 0x4000L
|
|
|
|
#define IBS_VERTCAPTION 0x8000L
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
UINT WINAPI ibGetCaptionSize( HWND hWnd ) ;
|
|
|
|
UINT WINAPI ibSetCaptionSize( HWND hWnd, UINT nSize ) ;
|
|
|
|
LRESULT WINAPI ibDefWindowProc( HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam ) ;
|
|
|
|
VOID WINAPI ibAdjustWindowRect( HWND hWnd, LPRECT lprc ) ;
|
|
|
|
#endif // wxUSE_ITSY_BITSY
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-02-02 07:37:14 -05:00
|
|
|
#if wxUSE_CTL3D
|
1999-05-13 17:21:04 -04:00
|
|
|
#include "wx/msw/ctl3d/ctl3d.h"
|
|
|
|
#endif // wxUSE_CTL3D
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Decide what window classes we're going to use
|
|
|
|
* for this combination of CTl3D/FAFA settings
|
|
|
|
*/
|
1998-10-14 19:53:24 -04:00
|
|
|
|
1999-06-10 14:12:13 -04:00
|
|
|
#define STATIC_CLASS _T("STATIC")
|
1998-05-20 10:12:05 -04:00
|
|
|
#define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE)
|
1999-06-10 14:12:13 -04:00
|
|
|
#define CHECK_CLASS _T("BUTTON")
|
1998-05-20 10:12:05 -04:00
|
|
|
#define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD)
|
|
|
|
#define CHECK_IS_FAFA FALSE
|
1999-06-10 14:12:13 -04:00
|
|
|
#define RADIO_CLASS _T("BUTTON")
|
1998-05-20 10:12:05 -04:00
|
|
|
#define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE)
|
|
|
|
#define RADIO_SIZE 20
|
|
|
|
#define RADIO_IS_FAFA FALSE
|
|
|
|
#define PURE_WINDOWS
|
1999-06-10 14:12:13 -04:00
|
|
|
#define GROUP_CLASS _T("BUTTON")
|
1998-05-20 10:12:05 -04:00
|
|
|
#define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)
|
|
|
|
|
|
|
|
/*
|
|
|
|
#define BITCHECK_FLAGS (FB_BITMAP|FC_BUTTONDRAW|FC_DEFAULT|WS_VISIBLE)
|
|
|
|
#define BITRADIO_FLAGS (FC_BUTTONDRAW|FB_BITMAP|FC_RADIO|WS_CHILD|WS_VISIBLE)
|
|
|
|
*/
|
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// misc macros
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
#define MEANING_CHARACTER '0'
|
|
|
|
#define DEFAULT_ITEM_WIDTH 200
|
|
|
|
#define DEFAULT_ITEM_HEIGHT 80
|
1998-09-20 17:13:46 -04:00
|
|
|
|
|
|
|
// Scale font to get edit control height
|
|
|
|
#define EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy) (3*(cy)/2)
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
// Generic subclass proc, for panel item moving/sizing and intercept
|
|
|
|
// EDIT control VK_RETURN messages
|
|
|
|
extern LONG APIENTRY _EXPORT
|
|
|
|
wxSubclassedGenericControlProc(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// constants which might miss from some compilers' headers
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#if !defined(__WIN32__) && !defined(WS_EX_CLIENTEDGE)
|
|
|
|
#define WS_EX_CLIENTEDGE 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__WIN32__) && !defined(WS_EX_CLIENTEDGE)
|
|
|
|
#define WS_EX_CLIENTEDGE 0x00000200L
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ENDSESSION_LOGOFF
|
|
|
|
#define ENDSESSION_LOGOFF 0x80000000
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// debug messages
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
#if defined(__WIN95__) && defined(__WXDEBUG__) && wxUSE_DBWIN32
|
|
|
|
|
|
|
|
#ifndef __TWIN32__
|
|
|
|
#ifdef OutputDebugString
|
|
|
|
#undef OutputDebugString
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define OutputDebugString OutputDebugStringW95
|
|
|
|
#endif // __TWIN32__
|
|
|
|
|
|
|
|
extern void OutputDebugStringW95(const wxChar*, ...);
|
|
|
|
#endif // USE_DBWIN32
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
1999-05-18 20:53:27 -04:00
|
|
|
// macros to make casting between WXFOO and FOO a bit easier: the GetFoo()
|
1999-06-28 17:39:49 -04:00
|
|
|
// returns Foo cast to the Windows type for oruselves, while GetFooOf() takes
|
|
|
|
// an argument which should be a pointer or reference to the object of the
|
|
|
|
// corresponding class (this depends on the macro)
|
1999-05-13 17:21:04 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#define GetHwnd() ((HWND)GetHWND())
|
1999-06-28 17:39:49 -04:00
|
|
|
#define GetHwndOf(win) ((HWND)((win)->GetHWND()))
|
|
|
|
// old name
|
|
|
|
#define GetWinHwnd GetHwndOf
|
1999-05-13 17:21:04 -04:00
|
|
|
|
|
|
|
#define GetHdc() ((HDC)GetHDC())
|
1999-06-28 17:39:49 -04:00
|
|
|
#define GetHdcOf(dc) ((HDC)(dc).GetHDC())
|
1999-05-13 17:21:04 -04:00
|
|
|
|
1999-05-18 20:53:27 -04:00
|
|
|
#define GetHicon() ((HICON)GetHICON())
|
1999-06-28 17:39:49 -04:00
|
|
|
#define GetHiconOf(icon) ((HICON)(icon).GetHICON())
|
1999-05-18 20:53:27 -04:00
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
#define GetHaccel() ((HACCEL)GetHACCEL())
|
1999-06-28 17:39:49 -04:00
|
|
|
#define GetHaccelOf(table) ((HACCEL)((table).GetHACCEL()))
|
|
|
|
|
|
|
|
#define GetHmenu() ((HMENU)GetHMenu())
|
|
|
|
#define GetHmenuOf(menu) ((HMENU)menu->GetHMenu())
|
1999-05-13 17:21:04 -04:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
// ---------------------------------------------------------------------------
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
// The MakeProcInstance version of the function wxSubclassedGenericControlProc
|
|
|
|
WXDLLEXPORT_DATA(extern FARPROC) wxGenericControlSubClassProc;
|
1999-04-19 14:04:57 -04:00
|
|
|
WXDLLEXPORT_DATA(extern wxChar*) wxBuffer;
|
1998-05-20 10:12:05 -04:00
|
|
|
WXDLLEXPORT_DATA(extern HINSTANCE) wxhInstance;
|
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// global functions
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
WXDLLEXPORT HINSTANCE wxGetInstance();
|
|
|
|
WXDLLEXPORT void wxSetInstance(HINSTANCE hInst);
|
|
|
|
|
|
|
|
WXDLLEXPORT wxWindow* wxFindWinFromHandle(WXHWND hWnd);
|
|
|
|
|
|
|
|
WXDLLEXPORT void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font);
|
|
|
|
WXDLLEXPORT void wxFillLogFont(LOGFONT *logFont, wxFont *font);
|
|
|
|
WXDLLEXPORT wxFont wxCreateFontFromLogFont(LOGFONT *logFont);
|
|
|
|
|
|
|
|
WXDLLEXPORT void wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos);
|
|
|
|
WXDLLEXPORT void wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos);
|
|
|
|
|
|
|
|
// Find maximum size of window/rectangle
|
|
|
|
WXDLLEXPORT extern void wxFindMaxSize(WXHWND hwnd, RECT *rect);
|
|
|
|
|
1998-11-22 17:32:53 -05:00
|
|
|
WXDLLEXPORT wxWindow* wxFindControlFromHandle(WXHWND hWnd);
|
|
|
|
WXDLLEXPORT void wxAddControlHandle(WXHWND hWnd, wxWindow *item);
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1998-09-20 17:13:46 -04:00
|
|
|
// Safely get the window text (i.e. without using fixed size buffer)
|
1998-11-22 17:32:53 -05:00
|
|
|
WXDLLEXPORT extern wxString wxGetWindowText(WXHWND hWnd);
|
1998-09-20 17:13:46 -04:00
|
|
|
|
1999-05-09 20:42:57 -04:00
|
|
|
// get the window class name
|
|
|
|
WXDLLEXPORT extern wxString wxGetWindowClass(WXHWND hWnd);
|
|
|
|
|
1999-05-18 20:53:27 -04:00
|
|
|
// get the window id (should be unsigned, hence this is not wxWindowID which
|
|
|
|
// is, for mainly historical reasons, signed)
|
|
|
|
WXDLLEXPORT extern WXWORD wxGetWindowId(WXHWND hWnd);
|
1999-05-09 20:42:57 -04:00
|
|
|
|
1998-10-14 19:53:24 -04:00
|
|
|
// Does this window style specify any border?
|
1998-11-22 17:32:53 -05:00
|
|
|
inline bool wxStyleHasBorder(long style)
|
1998-10-14 19:53:24 -04:00
|
|
|
{
|
|
|
|
return (style & (wxSIMPLE_BORDER | wxRAISED_BORDER |
|
|
|
|
wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0;
|
|
|
|
}
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_PRIVATE_H_
|