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