]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/private.h
* prgodlgg.h: Update() use wxString instead of 'char *'
[wxWidgets.git] / include / wx / msw / private.h
CommitLineData
2bda0e17
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: private.h
a23fd0e1
VZ
3// Purpose: Private declarations: as this header is only included by
4// wxWindows itself, it may contain identifiers which don't start
5// with "wx".
2bda0e17
KB
6// Author: Julian Smart
7// Modified by:
8// Created: 01/02/97
9// RCS-ID: $Id$
bbcdf8bc 10// Copyright: (c) Julian Smart
c085e333 11// Licence: wxWindows licence
2bda0e17
KB
12/////////////////////////////////////////////////////////////////////////////
13
bbcdf8bc
JS
14#ifndef _WX_PRIVATE_H_
15#define _WX_PRIVATE_H_
2bda0e17 16
2bda0e17
KB
17#include <windows.h>
18
a23fd0e1 19class WXDLLEXPORT wxFont;
2bda0e17 20
a23fd0e1
VZ
21// ---------------------------------------------------------------------------
22// standard icons from the resources
23// ---------------------------------------------------------------------------
2bda0e17
KB
24
25WXDLLEXPORT_DATA(extern HICON) wxSTD_FRAME_ICON;
26WXDLLEXPORT_DATA(extern HICON) wxSTD_MDIPARENTFRAME_ICON;
27WXDLLEXPORT_DATA(extern HICON) wxSTD_MDICHILDFRAME_ICON;
28WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_FRAME_ICON;
29WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDIPARENTFRAME_ICON;
30WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDICHILDFRAME_ICON;
31WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
32
a23fd0e1
VZ
33// ---------------------------------------------------------------------------
34// this defines a CASTWNDPROC macro which casts a pointer to the type of a
35// window proc
36// ---------------------------------------------------------------------------
2bda0e17 37#ifdef __GNUWIN32__
d6a1743b 38# define CASTWNDPROC (long unsigned)
2bda0e17 39#else
d6a1743b 40# ifdef __BORLANDC__
62448488
JS
41
42# ifdef __WIN32__
d6a1743b 43# define CASTWNDPROC
62448488
JS
44# else
45 typedef int (pascal * WndProcCast) ();
46# define CASTWNDPROC (WndProcCast)
47# endif
48
d6a1743b 49# else
5de76427 50# if defined (__WIN32__) && defined(STRICT)
81d66cf3
JS
51 typedef long (_stdcall * WndProcCast) (HWND, unsigned int, unsigned int, long);
52# define CASTWNDPROC (WndProcCast)
1e6d9499 53# elif defined(__WIN16__)
62448488
JS
54# ifdef __BORLANDC__
55 typedef int (pascal * WndProcCast) ();
56# define CASTWNDPROC (WndProcCast)
57# else
1e6d9499
JS
58 typedef int (PASCAL * WndProcCast) ();
59# define CASTWNDPROC (WndProcCast)
62448488 60# endif
81d66cf3
JS
61# else
62# define CASTWNDPROC
63# endif
d6a1743b 64# endif
2bda0e17
KB
65#endif
66
a23fd0e1
VZ
67// ---------------------------------------------------------------------------
68// some stuff for old Windows versions (FIXME: what does it do here??)
69// ---------------------------------------------------------------------------
70
c085e333 71#if !defined(APIENTRY) // NT defines APIENTRY, 3.x not
a23fd0e1 72 #define APIENTRY FAR PASCAL
2bda0e17 73#endif
c085e333 74
2bda0e17 75#ifdef __WIN32__
a23fd0e1 76 #define _EXPORT
2bda0e17 77#else
a23fd0e1
VZ
78 #define _EXPORT _export
79#endif
80
81#ifndef __WIN32__
82 typedef signed short int SHORT;
2bda0e17 83#endif
c085e333
VZ
84
85#if !defined(__WIN32__) // 3.x uses FARPROC for dialogs
a23fd0e1 86 #define DLGPROC FARPROC
2bda0e17
KB
87#endif
88
47d67540 89#if wxUSE_PENWIN
cc2b7472
VZ
90 WXDLLEXPORT void wxRegisterPenWin();
91 WXDLLEXPORT void wxCleanUpPenWin();
92 WXDLLEXPORT void wxEnablePenAppHooks (bool hook);
93#endif // wxUSE_PENWIN
2bda0e17 94
47d67540 95#if wxUSE_ITSY_BITSY
a23fd0e1
VZ
96 #define IBS_HORZCAPTION 0x4000L
97 #define IBS_VERTCAPTION 0x8000L
2bda0e17 98
a23fd0e1
VZ
99 UINT WINAPI ibGetCaptionSize( HWND hWnd ) ;
100 UINT WINAPI ibSetCaptionSize( HWND hWnd, UINT nSize ) ;
101 LRESULT WINAPI ibDefWindowProc( HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam ) ;
102 VOID WINAPI ibAdjustWindowRect( HWND hWnd, LPRECT lprc ) ;
103#endif // wxUSE_ITSY_BITSY
2bda0e17 104
1f112209 105#if wxUSE_CTL3D
a23fd0e1
VZ
106 #include "wx/msw/ctl3d/ctl3d.h"
107#endif // wxUSE_CTL3D
2bda0e17
KB
108
109/*
110 * Decide what window classes we're going to use
111 * for this combination of CTl3D/FAFA settings
112 */
c085e333 113
2bda0e17
KB
114#define STATIC_CLASS "STATIC"
115#define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE)
116#define CHECK_CLASS "BUTTON"
117#define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD)
118#define CHECK_IS_FAFA FALSE
119#define RADIO_CLASS "BUTTON"
120#define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE)
121#define RADIO_SIZE 20
122#define RADIO_IS_FAFA FALSE
123#define PURE_WINDOWS
124#define GROUP_CLASS "BUTTON"
125#define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)
126
127/*
128#define BITCHECK_FLAGS (FB_BITMAP|FC_BUTTONDRAW|FC_DEFAULT|WS_VISIBLE)
129#define BITRADIO_FLAGS (FC_BUTTONDRAW|FB_BITMAP|FC_RADIO|WS_CHILD|WS_VISIBLE)
130*/
131
a23fd0e1
VZ
132// ---------------------------------------------------------------------------
133// misc macros
134// ---------------------------------------------------------------------------
135
2bda0e17
KB
136#define MEANING_CHARACTER '0'
137#define DEFAULT_ITEM_WIDTH 200
138#define DEFAULT_ITEM_HEIGHT 80
1c4a764c
VZ
139
140// Scale font to get edit control height
141#define EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy) (3*(cy)/2)
2bda0e17
KB
142
143// Generic subclass proc, for panel item moving/sizing and intercept
144// EDIT control VK_RETURN messages
145extern LONG APIENTRY _EXPORT
146 wxSubclassedGenericControlProc(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
147
a23fd0e1
VZ
148// ---------------------------------------------------------------------------
149// constants which might miss from some compilers' headers
150// ---------------------------------------------------------------------------
151
152#if !defined(__WIN32__) && !defined(WS_EX_CLIENTEDGE)
153 #define WS_EX_CLIENTEDGE 0
154#endif
155
156#if defined(__WIN32__) && !defined(WS_EX_CLIENTEDGE)
157 #define WS_EX_CLIENTEDGE 0x00000200L
158#endif
159
160#ifndef ENDSESSION_LOGOFF
161 #define ENDSESSION_LOGOFF 0x80000000
162#endif
163
164// ---------------------------------------------------------------------------
165// debug messages
166// ---------------------------------------------------------------------------
167#if defined(__WIN95__) && defined(__WXDEBUG__) && wxUSE_DBWIN32
168
169 #ifndef __TWIN32__
170 #ifdef OutputDebugString
171 #undef OutputDebugString
172 #endif
173
174 #define OutputDebugString OutputDebugStringW95
175 #endif // __TWIN32__
176
177 extern void OutputDebugStringW95(const wxChar*, ...);
178#endif // USE_DBWIN32
179
180// ---------------------------------------------------------------------------
181// macros to make casting between WXFOO and FOO a bit easier
182// ---------------------------------------------------------------------------
183
184#define GetHwnd() ((HWND)GetHWND())
185#define GetWinHwnd(win) ((HWND)((win)->GetHWND()))
186
187#define GetHdc() ((HDC)GetHDC())
188
189#define GetHaccel() ((HACCEL)GetHACCEL())
190#define GetTableHaccel(table) ((HACCEL)((table)->GetHACCEL()))
191
192// ---------------------------------------------------------------------------
193// global data
194// ---------------------------------------------------------------------------
2bda0e17 195
2bda0e17
KB
196// The MakeProcInstance version of the function wxSubclassedGenericControlProc
197WXDLLEXPORT_DATA(extern FARPROC) wxGenericControlSubClassProc;
621ae68a 198WXDLLEXPORT_DATA(extern wxChar*) wxBuffer;
2bda0e17
KB
199WXDLLEXPORT_DATA(extern HINSTANCE) wxhInstance;
200
a23fd0e1
VZ
201// ---------------------------------------------------------------------------
202// global functions
203// ---------------------------------------------------------------------------
204
205WXDLLEXPORT HINSTANCE wxGetInstance();
206WXDLLEXPORT void wxSetInstance(HINSTANCE hInst);
207
208WXDLLEXPORT wxWindow* wxFindWinFromHandle(WXHWND hWnd);
209
210WXDLLEXPORT void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font);
211WXDLLEXPORT void wxFillLogFont(LOGFONT *logFont, wxFont *font);
212WXDLLEXPORT wxFont wxCreateFontFromLogFont(LOGFONT *logFont);
213
214WXDLLEXPORT void wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos);
215WXDLLEXPORT void wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos);
216
217// Find maximum size of window/rectangle
218WXDLLEXPORT extern void wxFindMaxSize(WXHWND hwnd, RECT *rect);
219
184b5d99
JS
220WXDLLEXPORT wxWindow* wxFindControlFromHandle(WXHWND hWnd);
221WXDLLEXPORT void wxAddControlHandle(WXHWND hWnd, wxWindow *item);
2bda0e17 222
1c4a764c 223// Safely get the window text (i.e. without using fixed size buffer)
184b5d99 224WXDLLEXPORT extern wxString wxGetWindowText(WXHWND hWnd);
1c4a764c 225
cc2b7472
VZ
226// get the window class name
227WXDLLEXPORT extern wxString wxGetWindowClass(WXHWND hWnd);
228
229// get the window id
230WXDLLEXPORT extern wxWindowID wxGetWindowId(WXHWND hWnd);
231
c085e333 232// Does this window style specify any border?
184b5d99 233inline bool wxStyleHasBorder(long style)
c085e333
VZ
234{
235 return (style & (wxSIMPLE_BORDER | wxRAISED_BORDER |
236 wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0;
237}
238
2bda0e17 239#endif
bbcdf8bc 240 // _WX_PRIVATE_H_