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