1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: private.h
|
|
|
|
// Purpose: Private declarations
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
1998-10-14 23:53:24 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_PRIVATE_H_
|
|
|
|
#define _WX_PRIVATE_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
#define VIEWPORT_EXTENT 1000
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxFont ;
|
|
|
|
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font);
|
|
|
|
WXDLLEXPORT void wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos);
|
|
|
|
WXDLLEXPORT wxWindow* wxFindWinFromHandle(WXHWND hWnd);
|
|
|
|
WXDLLEXPORT void wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern HICON) wxSTD_FRAME_ICON;
|
|
|
|
WXDLLEXPORT_DATA(extern HICON) wxSTD_MDIPARENTFRAME_ICON;
|
|
|
|
WXDLLEXPORT_DATA(extern HICON) wxSTD_MDICHILDFRAME_ICON;
|
|
|
|
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_FRAME_ICON;
|
|
|
|
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDIPARENTFRAME_ICON;
|
|
|
|
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDICHILDFRAME_ICON;
|
|
|
|
WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
|
|
|
|
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT HINSTANCE wxGetInstance();
|
1999-02-19 19:35:30 +00:00
|
|
|
WXDLLEXPORT void wxSetInstance(HINSTANCE hInst);
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT void wxFillLogFont(LOGFONT *logFont, wxFont *font);
|
|
|
|
WXDLLEXPORT wxFont wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNew = TRUE);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
#ifdef __GNUWIN32__
|
1998-07-17 11:10:38 +00:00
|
|
|
# define CASTWNDPROC (long unsigned)
|
1998-05-20 14:12:05 +00:00
|
|
|
#else
|
1998-07-17 11:10:38 +00:00
|
|
|
# ifdef __BORLANDC__
|
1998-12-28 12:35:49 +00:00
|
|
|
|
|
|
|
# ifdef __WIN32__
|
1998-07-17 11:10:38 +00:00
|
|
|
# define CASTWNDPROC
|
1998-12-28 12:35:49 +00:00
|
|
|
# else
|
|
|
|
typedef int (pascal * WndProcCast) ();
|
|
|
|
# define CASTWNDPROC (WndProcCast)
|
|
|
|
# endif
|
|
|
|
|
1998-07-17 11:10:38 +00:00
|
|
|
# else
|
1998-08-06 19:42:06 +00:00
|
|
|
# if defined (__WIN32__) && defined(STRICT)
|
1998-07-27 09:47:57 +00:00
|
|
|
typedef long (_stdcall * WndProcCast) (HWND, unsigned int, unsigned int, long);
|
|
|
|
# define CASTWNDPROC (WndProcCast)
|
1998-12-20 23:49:21 +00:00
|
|
|
# elif defined(__WIN16__)
|
1998-12-28 12:35:49 +00:00
|
|
|
# ifdef __BORLANDC__
|
|
|
|
typedef int (pascal * WndProcCast) ();
|
|
|
|
# define CASTWNDPROC (WndProcCast)
|
|
|
|
# else
|
1998-12-20 23:49:21 +00:00
|
|
|
typedef int (PASCAL * WndProcCast) ();
|
|
|
|
# define CASTWNDPROC (WndProcCast)
|
1998-12-28 12:35:49 +00:00
|
|
|
# endif
|
1998-07-27 09:47:57 +00:00
|
|
|
# else
|
|
|
|
# define CASTWNDPROC
|
|
|
|
# endif
|
1998-07-17 11:10:38 +00:00
|
|
|
# endif
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
|
|
|
|
1998-10-14 23:53:24 +00:00
|
|
|
#if !defined(APIENTRY) // NT defines APIENTRY, 3.x not
|
1998-05-20 14:12:05 +00:00
|
|
|
#define APIENTRY FAR PASCAL
|
|
|
|
#endif
|
1998-10-14 23:53:24 +00:00
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
#ifdef __WIN32__
|
|
|
|
#define _EXPORT /**/
|
|
|
|
#else
|
|
|
|
#define _EXPORT _export
|
|
|
|
typedef signed short int SHORT ;
|
|
|
|
#endif
|
1998-10-14 23:53:24 +00:00
|
|
|
|
|
|
|
#if !defined(__WIN32__) // 3.x uses FARPROC for dialogs
|
1998-05-20 14:12:05 +00:00
|
|
|
#define DLGPROC FARPROC
|
|
|
|
#endif
|
|
|
|
|
1998-09-25 13:28:52 +00:00
|
|
|
#if wxUSE_PENWIN
|
1999-02-22 11:01:13 +00:00
|
|
|
WXDLLEXPORT void wxRegisterPenWin();
|
|
|
|
WXDLLEXPORT void wxCleanUpPenWin();
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT void wxEnablePenAppHooks (bool hook);
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
|
|
|
|
1998-09-25 13:28:52 +00:00
|
|
|
#if wxUSE_ITSY_BITSY
|
1998-05-20 14:12:05 +00:00
|
|
|
#define IBS_HORZCAPTION 0x4000L
|
|
|
|
#define IBS_VERTCAPTION 0x8000L
|
|
|
|
|
|
|
|
UINT WINAPI ibGetCaptionSize( HWND hWnd ) ;
|
|
|
|
UINT WINAPI ibSetCaptionSize( HWND hWnd, UINT nSize ) ;
|
|
|
|
LRESULT WINAPI ibDefWindowProc( HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam ) ;
|
|
|
|
VOID WINAPI ibAdjustWindowRect( HWND hWnd, LPRECT lprc ) ;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* When implementing a new item, be sure to:
|
|
|
|
*
|
|
|
|
* - add the item to the parent panel
|
|
|
|
* - set window_parent to the parent
|
|
|
|
* - NULL any extra child window pointers not created for this item
|
|
|
|
* (e.g. label control that wasn't needed)
|
|
|
|
* - delete any extra child windows in the destructor (e.g. label control)
|
1999-02-22 11:01:13 +00:00
|
|
|
* - implement DoSetSize
|
1998-05-20 14:12:05 +00:00
|
|
|
* - to find panel position if coordinates are (-1, -1), use GetPosition
|
|
|
|
* - call AdvanceCursor after creation, for panel layout mechanism.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
1999-02-02 12:37:14 +00:00
|
|
|
#if wxUSE_CTL3D
|
1998-05-20 14:12:05 +00:00
|
|
|
#include <wx/msw/ctl3d/ctl3d.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Decide what window classes we're going to use
|
|
|
|
* for this combination of CTl3D/FAFA settings
|
|
|
|
*/
|
1998-10-14 23:53:24 +00:00
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
#define STATIC_CLASS "STATIC"
|
|
|
|
#define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE)
|
|
|
|
#define CHECK_CLASS "BUTTON"
|
|
|
|
#define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD)
|
|
|
|
#define CHECK_IS_FAFA FALSE
|
|
|
|
#define RADIO_CLASS "BUTTON"
|
|
|
|
#define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE)
|
|
|
|
#define RADIO_SIZE 20
|
|
|
|
#define RADIO_IS_FAFA FALSE
|
|
|
|
#define PURE_WINDOWS
|
|
|
|
#define GROUP_CLASS "BUTTON"
|
|
|
|
#define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)
|
|
|
|
|
|
|
|
/*
|
|
|
|
#define BITCHECK_FLAGS (FB_BITMAP|FC_BUTTONDRAW|FC_DEFAULT|WS_VISIBLE)
|
|
|
|
#define BITRADIO_FLAGS (FC_BUTTONDRAW|FB_BITMAP|FC_RADIO|WS_CHILD|WS_VISIBLE)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define MEANING_CHARACTER '0'
|
|
|
|
#define DEFAULT_ITEM_WIDTH 200
|
|
|
|
#define DEFAULT_ITEM_HEIGHT 80
|
1998-09-20 21:13:46 +00:00
|
|
|
|
|
|
|
// Scale font to get edit control height
|
|
|
|
#define EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy) (3*(cy)/2)
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
// Generic subclass proc, for panel item moving/sizing and intercept
|
|
|
|
// EDIT control VK_RETURN messages
|
|
|
|
extern LONG APIENTRY _EXPORT
|
|
|
|
wxSubclassedGenericControlProc(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
|
|
|
|
// Find maximum size of window/rectangle
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT extern void wxFindMaxSize(WXHWND hwnd, RECT *rect);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
// List of scrollbar controls
|
|
|
|
WXDLLEXPORT_DATA(extern wxList) wxScrollBarList;
|
|
|
|
// The MakeProcInstance version of the function wxSubclassedGenericControlProc
|
|
|
|
WXDLLEXPORT_DATA(extern FARPROC) wxGenericControlSubClassProc;
|
|
|
|
WXDLLEXPORT_DATA(extern char*) wxBuffer;
|
|
|
|
WXDLLEXPORT_DATA(extern HINSTANCE) wxhInstance;
|
|
|
|
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT wxWindow* wxFindControlFromHandle(WXHWND hWnd);
|
|
|
|
WXDLLEXPORT void wxAddControlHandle(WXHWND hWnd, wxWindow *item);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1998-09-20 21:13:46 +00:00
|
|
|
// Safely get the window text (i.e. without using fixed size buffer)
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT extern wxString wxGetWindowText(WXHWND hWnd);
|
1998-09-20 21:13:46 +00:00
|
|
|
|
1998-10-14 23:53:24 +00:00
|
|
|
// Does this window style specify any border?
|
1998-11-22 22:32:53 +00:00
|
|
|
inline bool wxStyleHasBorder(long style)
|
1998-10-14 23:53:24 +00:00
|
|
|
{
|
|
|
|
return (style & (wxSIMPLE_BORDER | wxRAISED_BORDER |
|
|
|
|
wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0;
|
|
|
|
}
|
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
#if !defined(__WIN32__) && !defined(WS_EX_CLIENTEDGE)
|
1998-10-14 23:53:24 +00:00
|
|
|
#define WS_EX_CLIENTEDGE 0
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
|
|
|
|
1999-01-07 08:43:47 +00:00
|
|
|
#if defined(__WIN32__) && !defined(WS_EX_CLIENTEDGE)
|
|
|
|
#define WS_EX_CLIENTEDGE 0x00000200L
|
|
|
|
#endif
|
|
|
|
|
1998-11-29 21:20:12 +00:00
|
|
|
#if defined(__WIN95__) && defined(__WXDEBUG__) && wxUSE_DBWIN32
|
1999-01-19 18:23:02 +00:00
|
|
|
|
|
|
|
#ifndef __TWIN32__
|
1998-11-29 21:20:12 +00:00
|
|
|
#ifdef OutputDebugString
|
|
|
|
#undef OutputDebugString
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define OutputDebugString OutputDebugStringW95
|
1999-01-19 18:23:02 +00:00
|
|
|
#endif
|
|
|
|
|
1998-11-29 21:20:12 +00:00
|
|
|
extern void OutputDebugStringW95(const char*, ...);
|
|
|
|
#endif
|
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
1998-08-07 23:52:45 +00:00
|
|
|
// _WX_PRIVATE_H_
|