1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Private declarations: as this header is only included by
4 // wxWindows itself, it may contain identifiers which don't start
6 // Author: Julian Smart
10 // Copyright: (c) Julian Smart
11 // Licence: wxWindows licence
12 /////////////////////////////////////////////////////////////////////////////
14 #ifndef _WX_PRIVATE_H_
15 #define _WX_PRIVATE_H_
19 class WXDLLEXPORT wxFont
;
21 // ---------------------------------------------------------------------------
22 // standard icons from the resources
23 // ---------------------------------------------------------------------------
25 WXDLLEXPORT_DATA(extern HICON
) wxSTD_FRAME_ICON
;
26 WXDLLEXPORT_DATA(extern HICON
) wxSTD_MDIPARENTFRAME_ICON
;
27 WXDLLEXPORT_DATA(extern HICON
) wxSTD_MDICHILDFRAME_ICON
;
28 WXDLLEXPORT_DATA(extern HICON
) wxDEFAULT_FRAME_ICON
;
29 WXDLLEXPORT_DATA(extern HICON
) wxDEFAULT_MDIPARENTFRAME_ICON
;
30 WXDLLEXPORT_DATA(extern HICON
) wxDEFAULT_MDICHILDFRAME_ICON
;
31 WXDLLEXPORT_DATA(extern HFONT
) wxSTATUS_LINE_FONT
;
33 // ---------------------------------------------------------------------------
34 // this defines a CASTWNDPROC macro which casts a pointer to the type of a
36 // ---------------------------------------------------------------------------
38 # define CASTWNDPROC (long unsigned)
45 typedef int (pascal * WndProcCast
) ();
46 # define CASTWNDPROC (WndProcCast)
50 # if defined (__WIN32__) && defined(STRICT)
51 typedef long (_stdcall
* WndProcCast
) (HWND
, unsigned int, unsigned int, long);
52 # define CASTWNDPROC (WndProcCast)
53 # elif defined(__WIN16__)
55 typedef int (pascal * WndProcCast
) ();
56 # define CASTWNDPROC (WndProcCast)
58 typedef int (PASCAL
* WndProcCast
) ();
59 # define CASTWNDPROC (WndProcCast)
67 // ---------------------------------------------------------------------------
68 // some stuff for old Windows versions (FIXME: what does it do here??)
69 // ---------------------------------------------------------------------------
71 #if !defined(APIENTRY) // NT defines APIENTRY, 3.x not
72 #define APIENTRY FAR PASCAL
78 #define _EXPORT _export
82 typedef signed short int SHORT
;
85 #if !defined(__WIN32__) // 3.x uses FARPROC for dialogs
86 #define DLGPROC FARPROC
90 WXDLLEXPORT
void wxRegisterPenWin();
91 WXDLLEXPORT
void wxCleanUpPenWin();
92 WXDLLEXPORT
void wxEnablePenAppHooks (bool hook
);
93 #endif // wxUSE_PENWIN
96 #define IBS_HORZCAPTION 0x4000L
97 #define IBS_VERTCAPTION 0x8000L
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
106 #include "wx/msw/ctl3d/ctl3d.h"
107 #endif // wxUSE_CTL3D
110 * Decide what window classes we're going to use
111 * for this combination of CTl3D/FAFA settings
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
124 #define GROUP_CLASS "BUTTON"
125 #define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)
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)
132 // ---------------------------------------------------------------------------
134 // ---------------------------------------------------------------------------
136 #define MEANING_CHARACTER '0'
137 #define DEFAULT_ITEM_WIDTH 200
138 #define DEFAULT_ITEM_HEIGHT 80
140 // Scale font to get edit control height
141 #define EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy) (3*(cy)/2)
143 // Generic subclass proc, for panel item moving/sizing and intercept
144 // EDIT control VK_RETURN messages
145 extern LONG APIENTRY _EXPORT
146 wxSubclassedGenericControlProc(WXHWND hWnd
, WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
148 // ---------------------------------------------------------------------------
149 // constants which might miss from some compilers' headers
150 // ---------------------------------------------------------------------------
152 #if !defined(__WIN32__) && !defined(WS_EX_CLIENTEDGE)
153 #define WS_EX_CLIENTEDGE 0
156 #if defined(__WIN32__) && !defined(WS_EX_CLIENTEDGE)
157 #define WS_EX_CLIENTEDGE 0x00000200L
160 #ifndef ENDSESSION_LOGOFF
161 #define ENDSESSION_LOGOFF 0x80000000
164 // ---------------------------------------------------------------------------
166 // ---------------------------------------------------------------------------
167 #if defined(__WIN95__) && defined(__WXDEBUG__) && wxUSE_DBWIN32
170 #ifdef OutputDebugString
171 #undef OutputDebugString
174 #define OutputDebugString OutputDebugStringW95
177 extern void OutputDebugStringW95(const wxChar
*, ...);
178 #endif // USE_DBWIN32
180 // ---------------------------------------------------------------------------
181 // macros to make casting between WXFOO and FOO a bit easier
182 // ---------------------------------------------------------------------------
184 #define GetHwnd() ((HWND)GetHWND())
185 #define GetWinHwnd(win) ((HWND)((win)->GetHWND()))
187 #define GetHdc() ((HDC)GetHDC())
189 #define GetHaccel() ((HACCEL)GetHACCEL())
190 #define GetTableHaccel(table) ((HACCEL)((table)->GetHACCEL()))
192 // ---------------------------------------------------------------------------
194 // ---------------------------------------------------------------------------
196 // The MakeProcInstance version of the function wxSubclassedGenericControlProc
197 WXDLLEXPORT_DATA(extern FARPROC
) wxGenericControlSubClassProc
;
198 WXDLLEXPORT_DATA(extern wxChar
*) wxBuffer
;
199 WXDLLEXPORT_DATA(extern HINSTANCE
) wxhInstance
;
201 // ---------------------------------------------------------------------------
203 // ---------------------------------------------------------------------------
205 WXDLLEXPORT HINSTANCE
wxGetInstance();
206 WXDLLEXPORT
void wxSetInstance(HINSTANCE hInst
);
208 WXDLLEXPORT wxWindow
* wxFindWinFromHandle(WXHWND hWnd
);
210 WXDLLEXPORT
void wxGetCharSize(WXHWND wnd
, int *x
, int *y
,wxFont
*the_font
);
211 WXDLLEXPORT
void wxFillLogFont(LOGFONT
*logFont
, wxFont
*font
);
212 WXDLLEXPORT wxFont
wxCreateFontFromLogFont(LOGFONT
*logFont
);
214 WXDLLEXPORT
void wxSliderEvent(WXHWND control
, WXWORD wParam
, WXWORD pos
);
215 WXDLLEXPORT
void wxScrollBarEvent(WXHWND hbar
, WXWORD wParam
, WXWORD pos
);
217 // Find maximum size of window/rectangle
218 WXDLLEXPORT
extern void wxFindMaxSize(WXHWND hwnd
, RECT
*rect
);
220 WXDLLEXPORT wxWindow
* wxFindControlFromHandle(WXHWND hWnd
);
221 WXDLLEXPORT
void wxAddControlHandle(WXHWND hWnd
, wxWindow
*item
);
223 // Safely get the window text (i.e. without using fixed size buffer)
224 WXDLLEXPORT
extern wxString
wxGetWindowText(WXHWND hWnd
);
226 // get the window class name
227 WXDLLEXPORT
extern wxString
wxGetWindowClass(WXHWND hWnd
);
230 WXDLLEXPORT
extern wxWindowID
wxGetWindowId(WXHWND hWnd
);
232 // Does this window style specify any border?
233 inline bool wxStyleHasBorder(long style
)
235 return (style
& (wxSIMPLE_BORDER
| wxRAISED_BORDER
|
236 wxSUNKEN_BORDER
| wxDOUBLE_BORDER
)) != 0;