]>
Commit | Line | Data |
---|---|---|
2bda0e17 KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: private.h | |
3 | // Purpose: Private declarations | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
bbcdf8bc | 8 | // Copyright: (c) Julian Smart |
c085e333 | 9 | // Licence: wxWindows licence |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_PRIVATE_H_ |
13 | #define _WX_PRIVATE_H_ | |
2bda0e17 KB |
14 | |
15 | #include "wx/defs.h" | |
16 | ||
17 | #include <windows.h> | |
18 | ||
19 | #define VIEWPORT_EXTENT 1000 | |
20 | ||
21 | class WXDLLEXPORT wxFont ; | |
22 | ||
184b5d99 JS |
23 | WXDLLEXPORT void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font); |
24 | WXDLLEXPORT void wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos); | |
25 | WXDLLEXPORT wxWindow* wxFindWinFromHandle(WXHWND hWnd); | |
26 | WXDLLEXPORT void wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos); | |
2bda0e17 KB |
27 | |
28 | WXDLLEXPORT_DATA(extern HICON) wxSTD_FRAME_ICON; | |
29 | WXDLLEXPORT_DATA(extern HICON) wxSTD_MDIPARENTFRAME_ICON; | |
30 | WXDLLEXPORT_DATA(extern HICON) wxSTD_MDICHILDFRAME_ICON; | |
31 | WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_FRAME_ICON; | |
32 | WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDIPARENTFRAME_ICON; | |
33 | WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDICHILDFRAME_ICON; | |
34 | WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT; | |
35 | ||
184b5d99 | 36 | WXDLLEXPORT HINSTANCE wxGetInstance(); |
b97b1af8 | 37 | WXDLLEXPORT void wxSetInstance(HINSTANCE hInst); |
184b5d99 JS |
38 | WXDLLEXPORT void wxFillLogFont(LOGFONT *logFont, wxFont *font); |
39 | WXDLLEXPORT wxFont wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNew = TRUE); | |
2bda0e17 KB |
40 | |
41 | #ifdef __GNUWIN32__ | |
d6a1743b | 42 | # define CASTWNDPROC (long unsigned) |
2bda0e17 | 43 | #else |
d6a1743b | 44 | # ifdef __BORLANDC__ |
62448488 JS |
45 | |
46 | # ifdef __WIN32__ | |
d6a1743b | 47 | # define CASTWNDPROC |
62448488 JS |
48 | # else |
49 | typedef int (pascal * WndProcCast) (); | |
50 | # define CASTWNDPROC (WndProcCast) | |
51 | # endif | |
52 | ||
d6a1743b | 53 | # else |
5de76427 | 54 | # if defined (__WIN32__) && defined(STRICT) |
81d66cf3 JS |
55 | typedef long (_stdcall * WndProcCast) (HWND, unsigned int, unsigned int, long); |
56 | # define CASTWNDPROC (WndProcCast) | |
1e6d9499 | 57 | # elif defined(__WIN16__) |
62448488 JS |
58 | # ifdef __BORLANDC__ |
59 | typedef int (pascal * WndProcCast) (); | |
60 | # define CASTWNDPROC (WndProcCast) | |
61 | # else | |
1e6d9499 JS |
62 | typedef int (PASCAL * WndProcCast) (); |
63 | # define CASTWNDPROC (WndProcCast) | |
62448488 | 64 | # endif |
81d66cf3 JS |
65 | # else |
66 | # define CASTWNDPROC | |
67 | # endif | |
d6a1743b | 68 | # endif |
2bda0e17 KB |
69 | #endif |
70 | ||
c085e333 | 71 | #if !defined(APIENTRY) // NT defines APIENTRY, 3.x not |
2bda0e17 KB |
72 | #define APIENTRY FAR PASCAL |
73 | #endif | |
c085e333 | 74 | |
2bda0e17 KB |
75 | #ifdef __WIN32__ |
76 | #define _EXPORT /**/ | |
77 | #else | |
78 | #define _EXPORT _export | |
79 | typedef signed short int SHORT ; | |
80 | #endif | |
c085e333 VZ |
81 | |
82 | #if !defined(__WIN32__) // 3.x uses FARPROC for dialogs | |
2bda0e17 KB |
83 | #define DLGPROC FARPROC |
84 | #endif | |
85 | ||
47d67540 | 86 | #if wxUSE_PENWIN |
bfc6fde4 VZ |
87 | WXDLLEXPORT void wxRegisterPenWin(); |
88 | WXDLLEXPORT void wxCleanUpPenWin(); | |
184b5d99 | 89 | WXDLLEXPORT void wxEnablePenAppHooks (bool hook); |
2bda0e17 KB |
90 | #endif |
91 | ||
47d67540 | 92 | #if wxUSE_ITSY_BITSY |
2bda0e17 KB |
93 | #define IBS_HORZCAPTION 0x4000L |
94 | #define IBS_VERTCAPTION 0x8000L | |
95 | ||
96 | UINT WINAPI ibGetCaptionSize( HWND hWnd ) ; | |
97 | UINT WINAPI ibSetCaptionSize( HWND hWnd, UINT nSize ) ; | |
98 | LRESULT WINAPI ibDefWindowProc( HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam ) ; | |
99 | VOID WINAPI ibAdjustWindowRect( HWND hWnd, LPRECT lprc ) ; | |
100 | #endif | |
101 | ||
102 | /* When implementing a new item, be sure to: | |
103 | * | |
104 | * - add the item to the parent panel | |
105 | * - set window_parent to the parent | |
106 | * - NULL any extra child window pointers not created for this item | |
107 | * (e.g. label control that wasn't needed) | |
108 | * - delete any extra child windows in the destructor (e.g. label control) | |
bfc6fde4 | 109 | * - implement DoSetSize |
2bda0e17 KB |
110 | * - to find panel position if coordinates are (-1, -1), use GetPosition |
111 | * - call AdvanceCursor after creation, for panel layout mechanism. | |
112 | * | |
113 | */ | |
114 | ||
1f112209 | 115 | #if wxUSE_CTL3D |
2bda0e17 KB |
116 | #include <wx/msw/ctl3d/ctl3d.h> |
117 | #endif | |
118 | ||
119 | /* | |
120 | * Decide what window classes we're going to use | |
121 | * for this combination of CTl3D/FAFA settings | |
122 | */ | |
c085e333 | 123 | |
2bda0e17 KB |
124 | #define STATIC_CLASS "STATIC" |
125 | #define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE) | |
126 | #define CHECK_CLASS "BUTTON" | |
127 | #define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD) | |
128 | #define CHECK_IS_FAFA FALSE | |
129 | #define RADIO_CLASS "BUTTON" | |
130 | #define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE) | |
131 | #define RADIO_SIZE 20 | |
132 | #define RADIO_IS_FAFA FALSE | |
133 | #define PURE_WINDOWS | |
134 | #define GROUP_CLASS "BUTTON" | |
135 | #define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE) | |
136 | ||
137 | /* | |
138 | #define BITCHECK_FLAGS (FB_BITMAP|FC_BUTTONDRAW|FC_DEFAULT|WS_VISIBLE) | |
139 | #define BITRADIO_FLAGS (FC_BUTTONDRAW|FB_BITMAP|FC_RADIO|WS_CHILD|WS_VISIBLE) | |
140 | */ | |
141 | ||
142 | #define MEANING_CHARACTER '0' | |
143 | #define DEFAULT_ITEM_WIDTH 200 | |
144 | #define DEFAULT_ITEM_HEIGHT 80 | |
1c4a764c VZ |
145 | |
146 | // Scale font to get edit control height | |
147 | #define EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy) (3*(cy)/2) | |
2bda0e17 KB |
148 | |
149 | // Generic subclass proc, for panel item moving/sizing and intercept | |
150 | // EDIT control VK_RETURN messages | |
151 | extern LONG APIENTRY _EXPORT | |
152 | wxSubclassedGenericControlProc(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam); | |
153 | ||
154 | // Find maximum size of window/rectangle | |
184b5d99 | 155 | WXDLLEXPORT extern void wxFindMaxSize(WXHWND hwnd, RECT *rect); |
2bda0e17 KB |
156 | |
157 | // List of scrollbar controls | |
158 | WXDLLEXPORT_DATA(extern wxList) wxScrollBarList; | |
159 | // The MakeProcInstance version of the function wxSubclassedGenericControlProc | |
160 | WXDLLEXPORT_DATA(extern FARPROC) wxGenericControlSubClassProc; | |
161 | WXDLLEXPORT_DATA(extern char*) wxBuffer; | |
162 | WXDLLEXPORT_DATA(extern HINSTANCE) wxhInstance; | |
163 | ||
184b5d99 JS |
164 | WXDLLEXPORT wxWindow* wxFindControlFromHandle(WXHWND hWnd); |
165 | WXDLLEXPORT void wxAddControlHandle(WXHWND hWnd, wxWindow *item); | |
2bda0e17 | 166 | |
1c4a764c | 167 | // Safely get the window text (i.e. without using fixed size buffer) |
184b5d99 | 168 | WXDLLEXPORT extern wxString wxGetWindowText(WXHWND hWnd); |
1c4a764c | 169 | |
c085e333 | 170 | // Does this window style specify any border? |
184b5d99 | 171 | inline bool wxStyleHasBorder(long style) |
c085e333 VZ |
172 | { |
173 | return (style & (wxSIMPLE_BORDER | wxRAISED_BORDER | | |
174 | wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0; | |
175 | } | |
176 | ||
2bda0e17 | 177 | #if !defined(__WIN32__) && !defined(WS_EX_CLIENTEDGE) |
c085e333 | 178 | #define WS_EX_CLIENTEDGE 0 |
2bda0e17 KB |
179 | #endif |
180 | ||
2432b92d JS |
181 | #if defined(__WIN32__) && !defined(WS_EX_CLIENTEDGE) |
182 | #define WS_EX_CLIENTEDGE 0x00000200L | |
183 | #endif | |
184 | ||
a0a302dc | 185 | #if defined(__WIN95__) && defined(__WXDEBUG__) && wxUSE_DBWIN32 |
57c208c5 JS |
186 | |
187 | #ifndef __TWIN32__ | |
a0a302dc JS |
188 | #ifdef OutputDebugString |
189 | #undef OutputDebugString | |
190 | #endif | |
191 | ||
192 | #define OutputDebugString OutputDebugStringW95 | |
57c208c5 JS |
193 | #endif |
194 | ||
a0a302dc JS |
195 | extern void OutputDebugStringW95(const char*, ...); |
196 | #endif | |
197 | ||
2bda0e17 | 198 | #endif |
bbcdf8bc | 199 | // _WX_PRIVATE_H_ |