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