1. fixes to wxDC deleting logic (should fix ~wxPrinterDC leak), some code
reorganized/removed 2. applied (slightly modified) wxEnhMetaFileSimpleDataObject patch git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -37,6 +37,14 @@
|
|||||||
next if $wxHTML{$file} =~ /\b16\b/;
|
next if $wxHTML{$file} =~ /\b16\b/;
|
||||||
$project{"WXHTMLSRCS"} .= $file . " "
|
$project{"WXHTMLSRCS"} .= $file . " "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( Config("wxnodir") ) {
|
||||||
|
$WXDIR = ".";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ( $ENV{'wx'} ) { $WXDIR = "\$(wx)"; }
|
||||||
|
else { $WXDIR = "\$(WXWIN)"; }
|
||||||
|
}
|
||||||
#$}
|
#$}
|
||||||
# Microsoft Developer Studio Project File - Name="wxWindows" - Package Owner=<4>
|
# Microsoft Developer Studio Project File - Name="wxWindows" - Package Owner=<4>
|
||||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||||
@@ -81,7 +89,7 @@ RSC=rc.exe
|
|||||||
# PROP Intermediate_Dir "Release"
|
# PROP Intermediate_Dir "Release"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MT" /YX /FD /c
|
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MT" /YX /FD /c
|
||||||
# ADD CPP /nologo /MD /W4 /Zi /O2 /I "$(wx)\include" /I "$(wx)\src\zlib" /I "$(wx)\src\jpeg" /I "$(wx)\src\png" /I "$(wx)\src\tiff" /D "NDEBUG" /D wxUSE_GUI=1 /D WIN95=1 /D "__WIN95__" /D "WIN32" /D "_WIN32" /D WINVER=0x400 /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN32__" /D "_MT" /Yu"wx/wxprec.h" /FD /c
|
# ADD CPP /nologo /MD /W4 /Zi /O2 /I #$ $text = "\"$WXDIR\\include\" /I \"$WXDIR\\src\\zlib\" /I \"$WXDIR\\src\\jpeg\" /I \"$WXDIR\\src\\png\" /I \"$WXDIR\\src\\tiff\" /D \"NDEBUG\" /D wxUSE_GUI=1 /D WIN95=1 /D \"__WIN95__\" /D \"WIN32\" /D \"_WIN32\" /D WINVER=0x400 /D \"__WINDOWS__\" /D \"__WXMSW__\" /D \"__WIN32__\" /D \"_MT\" /Yu\"wx/wxprec.h\" /FD /c"
|
||||||
# ADD BASE RSC /l 0x409
|
# ADD BASE RSC /l 0x409
|
||||||
# ADD RSC /l 0x409
|
# ADD RSC /l 0x409
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
@@ -104,7 +112,7 @@ LIB32=link.exe -lib
|
|||||||
# PROP Intermediate_Dir "Debug"
|
# PROP Intermediate_Dir "Debug"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" -D "_MT" /YX /FD /c
|
# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" -D "_MT" /YX /FD /c
|
||||||
# ADD CPP /nologo /MDd /W4 /Zi /Od /I "$(wx)\include" /I "$(wx)\src\zlib" /I "$(wx)\src\jpeg" /I "$(wx)\src\png" /I "$(wx)\src\tiff" /D "_DEBUG" /D DEBUG=1 /D WXDEBUG=1 /D "__WXDEBUG__" /D wxUSE_GUI=1 /D "__WIN95__" /D "WIN32" /D "_WIN32" /D WINVER=0x400 /D "__WINDOWS__" /D "__WIN32__" /D "__WXMSW__" /Fr /D "_MT" /Yu"wx/wxprec.h" /FD /c
|
# ADD CPP /nologo /MDd /W4 /Zi /Od /I #$ $text = "\"$WXDIR\\include\" /I \"$WXDIR\\src\\zlib\" /I \"$WXDIR\\src\\jpeg\" /I \"$WXDIR\\src\\png\" /I \"$WXDIR\\src\\tiff\" /D \"_DEBUG\" /D DEBUG=1 /D WXDEBUG=1 /D \"__WXDEBUG__\" /D wxUSE_GUI=1 /D \"__WIN95__\" /D \"WIN32\" /D \"_WIN32\" /D WINVER=0x400 /D \"__WINDOWS__\" /D \"__WIN32__\" /D \"__WXMSW__\" /Fr /D \"_MT\" /Yu\"wx/wxprec.h\" /FD /c"
|
||||||
# ADD BASE RSC /l 0x409
|
# ADD BASE RSC /l 0x409
|
||||||
# ADD RSC /l 0x409
|
# ADD RSC /l 0x409
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
@@ -141,11 +149,12 @@ SOURCE=.\src\common\y_tab.c
|
|||||||
|
|
||||||
!IF "$(CFG)" == "wxWindows - Win32 Release"
|
!IF "$(CFG)" == "wxWindows - Win32 Release"
|
||||||
|
|
||||||
|
# ADD CPP /W1 /D "USE_DEFINE"
|
||||||
# SUBTRACT CPP /YX /Yc /Yu
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "wxWindows - Win32 Debug"
|
!ELSEIF "$(CFG)" == "wxWindows - Win32 Debug"
|
||||||
|
|
||||||
# ADD CPP /W1
|
# ADD CPP /W1 /D "USE_DEFINE"
|
||||||
# SUBTRACT CPP /YX /Yc /Yu
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
@@ -28,25 +28,47 @@
|
|||||||
Project('CONFIG += wx');
|
Project('CONFIG += wx');
|
||||||
}
|
}
|
||||||
if ( Config("wx") ) {
|
if ( Config("wx") ) {
|
||||||
|
if ( Config("wxnodir") ) {
|
||||||
|
$WXDIR = "..\\..";
|
||||||
|
}
|
||||||
|
else {
|
||||||
#! VC 6.0 supports env vars in include path
|
#! VC 6.0 supports env vars in include path
|
||||||
#! $WXDIR = $ENV{'WX'};
|
#! $WXDIR = $ENV{'WX'};
|
||||||
if ( $ENV{'wx'} ) { $WXDIR = "\$(wx)"; }
|
if ( $ENV{'wx'} ) { $WXDIR = "\$(wx)"; }
|
||||||
else { $WXDIR = "\$(WXWIN)"; }
|
else { $WXDIR = "\$(WXWIN)"; }
|
||||||
$TMAKE_INCDIR_WX = $WXDIR . "\\include";
|
}
|
||||||
AddIncludePath($TMAKE_INCDIR_WX);
|
|
||||||
|
AddIncludePath($WXDIR . "\\include");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( Config("unicode") ) {
|
||||||
|
$UNICODE="Unicode";
|
||||||
|
$UNICODE_SUFFIX="u";
|
||||||
|
$UNICODE_FLAGS="/D _UNICODE /D UNICODE ";
|
||||||
|
|
||||||
|
$project{"TARGET"} .= "Unicode";
|
||||||
|
$project{"MAKEFILE"} .= "Unicode";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$UNICODE="";
|
||||||
|
$UNICODE_SUFFIX="";
|
||||||
|
$UNICODE_FLAGS=" ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Config("dll") ) {
|
if ( Config("dll") ) {
|
||||||
$DLL="Dll";
|
$DLL="Dll";
|
||||||
$DLL_SUFFIX="d";
|
$DEBUG_SUFFIX="d";
|
||||||
$DLL_OR_LIB=(Config("wxbase") ? "wxbase" : "wxmsw") . "221";
|
$DLL_OR_LIB=(Config("wxbase") ? "wxbase" : "wxmsw") . "221";
|
||||||
$DLL_FLAGS="/D WXUSINGDLL ";
|
$DLL_FLAGS="/D WXUSINGDLL ";
|
||||||
$EXTRA_LIBS="";
|
$EXTRA_LIBS="";
|
||||||
|
|
||||||
|
$project{"TARGET"} .= "Dll";
|
||||||
|
$project{"MAKEFILE"} .= "Dll";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$DLL="";
|
$DLL="";
|
||||||
$DLL_SUFFIX="";
|
$DEBUG_SUFFIX="";
|
||||||
$DLL_OR_LIB="wxWindows";
|
$DLL_OR_LIB=Config("wxbase") ? "wxBase" : "wxWindows";
|
||||||
$DLL_FLAGS=" ";
|
$DLL_FLAGS=" ";
|
||||||
#! actually this depends on the contents of setup.h
|
#! actually this depends on the contents of setup.h
|
||||||
$EXTRA_LIBS=Config("wxbase") ? "" : "xpm zlib png jpeg tiff";
|
$EXTRA_LIBS=Config("wxbase") ? "" : "xpm zlib png jpeg tiff";
|
||||||
@@ -70,8 +92,8 @@
|
|||||||
if ( Config("wx") ) {
|
if ( Config("wx") ) {
|
||||||
$vc_base_libs .= "comctl32.lib rpcrt4.lib wsock32.lib ";
|
$vc_base_libs .= "comctl32.lib rpcrt4.lib wsock32.lib ";
|
||||||
|
|
||||||
$vc_link_release = "$WXDIR\\Release$DLL\\$DLL_OR_LIB.lib ";
|
$vc_link_release = "$WXDIR\\Release$UNICODE$DLL\\$DLL_OR_LIB$UNICODE_SUFFIX.lib ";
|
||||||
$vc_link_debug = "$WXDIR\\Debug$DLL\\$DLL_OR_LIB$DLL_SUFFIX.lib ";
|
$vc_link_debug = "$WXDIR\\Debug$UNICODE$DLL\\$DLL_OR_LIB$UNICODE_SUFFIX$DEBUG_SUFFIX.lib ";
|
||||||
foreach ( split(/ /, $EXTRA_LIBS) ) {
|
foreach ( split(/ /, $EXTRA_LIBS) ) {
|
||||||
$vc_link_release .= "$WXDIR\\src\\$_\\Release\\$_.lib ";
|
$vc_link_release .= "$WXDIR\\src\\$_\\Release\\$_.lib ";
|
||||||
$vc_link_debug .= "$WXDIR\\src\\$_\\Debug\\$_.lib ";
|
$vc_link_debug .= "$WXDIR\\src\\$_\\Debug\\$_.lib ";
|
||||||
@@ -80,12 +102,7 @@
|
|||||||
$vc_link_release .= '/nologo /subsystem:windows /machine:I386';
|
$vc_link_release .= '/nologo /subsystem:windows /machine:I386';
|
||||||
$vc_link_debug .= '/nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept';
|
$vc_link_debug .= '/nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept';
|
||||||
|
|
||||||
foreach ( split(/ /, Project('LIBPATH')) ) {
|
$vc_cpp_def_common = '/D "WIN32" /D "_WINDOWS" ' . $UNICODE_FLAGS . $DLL_FLAGS;
|
||||||
$vc_link_release .= " /libpath:$_\\Release";
|
|
||||||
$vc_link_debug .= " /libpath:$_\\Debug";
|
|
||||||
}
|
|
||||||
|
|
||||||
$vc_cpp_def_common = '/D "WIN32" /D "_WINDOWS" ' . $DLL_FLAGS;
|
|
||||||
$vc_cpp_def_release = '/D "NDEBUG" ' . $vc_cpp_def_common;
|
$vc_cpp_def_release = '/D "NDEBUG" ' . $vc_cpp_def_common;
|
||||||
$vc_cpp_def_debug = '/D "_DEBUG" ' . $vc_cpp_def_common;
|
$vc_cpp_def_debug = '/D "_DEBUG" ' . $vc_cpp_def_common;
|
||||||
} else {
|
} else {
|
||||||
@@ -94,16 +111,22 @@
|
|||||||
$vc_base_libs = 'kernel32.lib user32.lib advapi32.lib ';
|
$vc_base_libs = 'kernel32.lib user32.lib advapi32.lib ';
|
||||||
if ( Config("wx") ) {
|
if ( Config("wx") ) {
|
||||||
$vc_base_libs .= 'wsock32.lib ';
|
$vc_base_libs .= 'wsock32.lib ';
|
||||||
$vc_link_release = "$WXDIR\\Base${DLL}Release\\$DLL_OR_LIB.lib ";
|
$vc_link_release = "$WXDIR\\BaseRelease$UNICODE$DLL\\$DLL_OR_LIB$UNICODE_SUFFIX.lib ";
|
||||||
$vc_link_debug = "$WXDIR\\Base${DLL}Debug\\$DLL_OR_LIB" . "d.lib ";
|
$vc_link_debug = "$WXDIR\\BaseDebug$UNICODE$DLL\\$DLL_OR_LIB$UNICODE_SUFFIX$DEBUG_SUFFIX.lib ";
|
||||||
}
|
}
|
||||||
$vc_link_release .= '/nologo /subsystem:console /machine:I386';
|
$vc_link_release .= '/nologo /subsystem:console /machine:I386';
|
||||||
$vc_link_debug .= '/nologo /subsystem:console /debug /machine:I386 /pdbtype:sept';
|
$vc_link_debug .= '/nologo /subsystem:console /debug /machine:I386 /pdbtype:sept';
|
||||||
|
|
||||||
$vc_cpp_def_common = '/D "WIN32" /D "_CONSOLE" ' . $DLL_FLAGS;
|
$vc_cpp_def_common = '/D "WIN32" /D "_CONSOLE" ' . $UNICODE_FLAGS . $DLL_FLAGS;
|
||||||
$vc_cpp_def_release = '/D "NDEBUG" ' . $vc_cpp_def_common;
|
$vc_cpp_def_release = '/D "NDEBUG" ' . $vc_cpp_def_common;
|
||||||
$vc_cpp_def_debug = '/D "_DEBUG" ' . $vc_cpp_def_common;
|
$vc_cpp_def_debug = '/D "_DEBUG" ' . $vc_cpp_def_common;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ( split(/ /, Project('LIBPATH')) ) {
|
||||||
|
$vc_link_release .= " /libpath:$_\\Release";
|
||||||
|
$vc_link_debug .= " /libpath:$_\\Debug";
|
||||||
|
}
|
||||||
|
|
||||||
#! define wxWin debug flags in debug build
|
#! define wxWin debug flags in debug build
|
||||||
if ( Config("wx") ) {
|
if ( Config("wx") ) {
|
||||||
$vc_cpp_def_debug .= '/MDd /D "__WXDEBUG__" /D "WXDEBUG=1" ';
|
$vc_cpp_def_debug .= '/MDd /D "__WXDEBUG__" /D "WXDEBUG=1" ';
|
||||||
@@ -122,7 +145,7 @@
|
|||||||
}
|
}
|
||||||
#! else: disable C++ exception handling for wxWindows
|
#! else: disable C++ exception handling for wxWindows
|
||||||
|
|
||||||
$vc_cpp_opt_release = $vc_cpp_opt_common1 . '/O2 ';
|
$vc_cpp_opt_release = $vc_cpp_opt_common1 . '/O1 ';
|
||||||
$vc_cpp_opt_debug = $vc_cpp_opt_common1 . '/Zi /Od ';
|
$vc_cpp_opt_debug = $vc_cpp_opt_common1 . '/Zi /Od ';
|
||||||
$vc_cpp_opt_common = '/YX /FD /c';
|
$vc_cpp_opt_common = '/YX /FD /c';
|
||||||
$project{"VC_BASE_CPP_RELEASE"} = $vc_cpp_opt_release . $vc_cpp_def_release . $vc_cpp_opt_common;
|
$project{"VC_BASE_CPP_RELEASE"} = $vc_cpp_opt_release . $vc_cpp_def_release . $vc_cpp_opt_common;
|
||||||
@@ -220,13 +243,13 @@ RSC=rc.exe
|
|||||||
|
|
||||||
# PROP BASE Use_MFC 0
|
# PROP BASE Use_MFC 0
|
||||||
# PROP BASE Use_Debug_Libraries 0
|
# PROP BASE Use_Debug_Libraries 0
|
||||||
# PROP BASE Output_Dir "Release#$ $text = "$DLL" . '"'
|
# PROP BASE Output_Dir "Release#$ $text = "$UNICODE$DLL" . '"'
|
||||||
# PROP BASE Intermediate_Dir "Release#$ $text = "$DLL" . '"'
|
# PROP BASE Intermediate_Dir "Release#$ $text = "$UNICODE$DLL" . '"'
|
||||||
# PROP BASE Target_Dir ""
|
# PROP BASE Target_Dir ""
|
||||||
# PROP Use_MFC 0
|
# PROP Use_MFC 0
|
||||||
# PROP Use_Debug_Libraries 0
|
# PROP Use_Debug_Libraries 0
|
||||||
# PROP Output_Dir "Release#$ $text = "$DLL" . '"'
|
# PROP Output_Dir "Release#$ $text = "$UNICODE$DLL" . '"'
|
||||||
# PROP Intermediate_Dir "Release#$ $text = "$DLL" . '"'
|
# PROP Intermediate_Dir "Release#$ $text = "$UNICODE$DLL" . '"'
|
||||||
#$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
|
#$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP #$ Expand("VC_BASE_CPP_RELEASE");
|
# ADD BASE CPP #$ Expand("VC_BASE_CPP_RELEASE");
|
||||||
@@ -248,13 +271,13 @@ LINK32=link.exe
|
|||||||
|
|
||||||
# PROP BASE Use_MFC 0
|
# PROP BASE Use_MFC 0
|
||||||
# PROP BASE Use_Debug_Libraries 1
|
# PROP BASE Use_Debug_Libraries 1
|
||||||
# PROP BASE Output_Dir "Debug#$ $text = "$DLL" . '"'
|
# PROP BASE Output_Dir "Debug#$ $text = "$UNICODE$DLL" . '"'
|
||||||
# PROP BASE Intermediate_Dir "Debug#$ $text = "$DLL" . '"'
|
# PROP BASE Intermediate_Dir "Debug#$ $text = "$UNICODE$DLL" . '"'
|
||||||
# PROP BASE Target_Dir ""
|
# PROP BASE Target_Dir ""
|
||||||
# PROP Use_MFC 0
|
# PROP Use_MFC 0
|
||||||
# PROP Use_Debug_Libraries 1
|
# PROP Use_Debug_Libraries 1
|
||||||
# PROP Output_Dir "Debug#$ $text = "$DLL" . '"'
|
# PROP Output_Dir "Debug#$ $text = "$UNICODE$DLL" . '"'
|
||||||
# PROP Intermediate_Dir "Debug#$ $text = "$DLL" . '"'
|
# PROP Intermediate_Dir "Debug#$ $text = "$UNICODE$DLL" . '"'
|
||||||
#$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
|
#$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP #$ Expand("VC_BASE_CPP_DEBUG");
|
# ADD BASE CPP #$ Expand("VC_BASE_CPP_DEBUG");
|
||||||
|
@@ -17,53 +17,61 @@
|
|||||||
#include "wx/wxchar.h"
|
#include "wx/wxchar.h"
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
/**
|
// Debugging macros
|
||||||
@name Debugging macros
|
//
|
||||||
|
// All debugging macros rely on ASSERT() which in turn calls user-defined
|
||||||
All debugging macros rely on ASSERT() which in turn calls user-defined
|
// OnAssert() function. To keep things simple, it's called even when the
|
||||||
OnAssert() function. To keep things simple, it's called even when the
|
// expression is TRUE (i.e. everything is ok) and by default does nothing: just
|
||||||
expression is TRUE (i.e. everything is ok) and by default does nothing: just
|
// returns the same value back. But if you redefine it to do something more sexy
|
||||||
returns the same value back. But if you redefine it to do something more sexy
|
// (popping up a message box in your favourite GUI, sending you e-mail or
|
||||||
(popping up a message box in your favourite GUI, sending you e-mail or
|
// whatever) it will affect all ASSERTs, FAILs and CHECKs in your code.
|
||||||
whatever) it will affect all ASSERTs, FAILs and CHECKs in your code.
|
//
|
||||||
<BR>
|
// Warning: if you don't like advices on programming style, don't read
|
||||||
<BR>
|
// further! ;-)
|
||||||
<b>Warning</b>: if you don't like advices on programming style, don't read
|
//
|
||||||
further! ;-)
|
// Extensive use of these macros is recommended! Remember that ASSERTs are
|
||||||
<BR>
|
// disabled in final (without __WXDEBUG__ defined) build, so they add strictly
|
||||||
<BR>
|
// nothing to your program's code. On the other hand, CHECK macros do stay
|
||||||
Extensive use of these macros is recommended! Remember that ASSERTs are
|
// even in release builds, but in general are not much of a burden, while
|
||||||
disabled in final (without __WXDEBUG__ defined) build, so they add strictly
|
// a judicious use of them might increase your program's stability.
|
||||||
nothing to your program's code. On the other hand, CHECK macros do stay
|
|
||||||
even in release builds, but in general are not much of a burden, while
|
|
||||||
a judicious use of them might increase your program's stability.
|
|
||||||
|
|
||||||
@memo Debugging macros (replacement for standard assert()) and more.
|
|
||||||
*/
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
//@{
|
|
||||||
|
|
||||||
// Use of these suppresses compiler warnings about testing constant expression
|
// Use of these suppresses compiler warnings about testing constant expression
|
||||||
WXDLLEXPORT_DATA(extern const bool) wxTrue;
|
WXDLLEXPORT_DATA(extern const bool) wxTrue;
|
||||||
WXDLLEXPORT_DATA(extern const bool) wxFalse;
|
WXDLLEXPORT_DATA(extern const bool) wxFalse;
|
||||||
|
|
||||||
/** @name Macros which are completely disabled in 'release' mode */
|
// Macros which are completely disabled in 'release' mode
|
||||||
//@{
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
/**
|
/*
|
||||||
this function may be redefined to do something non trivial and is called
|
this function may be redefined to do something non trivial and is called
|
||||||
whenever one of debugging macros fails (i.e. condition is false in an
|
whenever one of debugging macros fails (i.e. condition is false in an
|
||||||
assertion)
|
assertion)
|
||||||
@param szFile and nLine - file name and line number of the ASSERT
|
|
||||||
|
parameters:
|
||||||
|
szFile and nLine - file name and line number of the ASSERT
|
||||||
szMsg - optional message explaining the reason
|
szMsg - optional message explaining the reason
|
||||||
*/
|
*/
|
||||||
void WXDLLEXPORT wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg = (const wxChar *) NULL);
|
void WXDLLEXPORT wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg = (const wxChar *) NULL);
|
||||||
|
|
||||||
/// generic assert macro
|
/*
|
||||||
#define wxASSERT(cond) if ( !(cond) ) wxOnAssert(__TFILE__, __LINE__)
|
notice the usage of else at the end of wxASSERT macro: this ensures that
|
||||||
|
the following code
|
||||||
|
|
||||||
/// assert with additional message explaining it's cause
|
if ( ... )
|
||||||
#define wxASSERT_MSG(x, m) if ( !(x) ) wxOnAssert(__TFILE__, __LINE__, m)
|
wxASSERT(...);
|
||||||
|
else
|
||||||
|
...
|
||||||
|
|
||||||
|
works like expected: if there were no "else", the one in the code above
|
||||||
|
would be matched with a wrong "if"
|
||||||
|
*/
|
||||||
|
|
||||||
|
// generic assert macro
|
||||||
|
#define wxASSERT(cond) if ( !(cond) ) wxOnAssert(__TFILE__, __LINE__); else
|
||||||
|
|
||||||
|
// assert with additional message explaining it's cause
|
||||||
|
#define wxASSERT_MSG(cond, msg) \
|
||||||
|
if ( !(cond) ) wxOnAssert(__TFILE__, __LINE__, msg); else
|
||||||
#else
|
#else
|
||||||
// nothing to do in release modes (hopefully at this moment there are
|
// nothing to do in release modes (hopefully at this moment there are
|
||||||
// no more bugs ;-)
|
// no more bugs ;-)
|
||||||
@@ -71,40 +79,39 @@ WXDLLEXPORT_DATA(extern const bool) wxFalse;
|
|||||||
#define wxASSERT_MSG(x, m)
|
#define wxASSERT_MSG(x, m)
|
||||||
#endif //__WXDEBUG__
|
#endif //__WXDEBUG__
|
||||||
|
|
||||||
/// special form of assert: always triggers it (in debug mode)
|
// special form of assert: always triggers it (in debug mode)
|
||||||
#define wxFAIL wxASSERT(wxFalse)
|
#define wxFAIL wxASSERT(wxFalse)
|
||||||
|
|
||||||
/// FAIL with some message
|
// FAIL with some message
|
||||||
#define wxFAIL_MSG(msg) wxASSERT_MSG(wxFalse, msg)
|
#define wxFAIL_MSG(msg) wxASSERT_MSG(wxFalse, msg)
|
||||||
//@}
|
|
||||||
|
|
||||||
// NB: these macros work also in release mode!
|
// NB: the following macros work also in release mode!
|
||||||
|
|
||||||
/**
|
/*
|
||||||
These macros must be used only in invalid situation: for example, an
|
These macros must be used only in invalid situation: for example, an
|
||||||
invalid parameter (NULL pointer) is passed to a function. Instead of
|
invalid parameter (NULL pointer) is passed to a function. Instead of
|
||||||
dereferencing it and causing core dump the function might try using
|
dereferencing it and causing core dump the function might try using
|
||||||
CHECK( p != NULL ) or CHECK( p != NULL, return LogError("p is NULL!!") )
|
CHECK( p != NULL ) or CHECK( p != NULL, return LogError("p is NULL!!") )
|
||||||
|
|
||||||
@name Macros which remain even in 'release' mode
|
|
||||||
*/
|
*/
|
||||||
//@{
|
|
||||||
/// check that expression is true, "return" if not (also FAILs in debug mode)
|
// check that expression is true, "return" if not (also FAILs in debug mode)
|
||||||
#define wxCHECK(x, rc) if (!(x)) {wxFAIL; return rc; }
|
#define wxCHECK(x, rc) if (!(x)) {wxFAIL; return rc; }
|
||||||
/// as wxCHECK but with a message explaining why we fail
|
|
||||||
|
// as wxCHECK but with a message explaining why we fail
|
||||||
#define wxCHECK_MSG(x, rc, msg) if (!(x)) {wxFAIL_MSG(msg); return rc; }
|
#define wxCHECK_MSG(x, rc, msg) if (!(x)) {wxFAIL_MSG(msg); return rc; }
|
||||||
/// check that expression is true, perform op if not
|
|
||||||
|
// check that expression is true, perform op if not
|
||||||
#define wxCHECK2(x, op) if (!(x)) {wxFAIL; op; }
|
#define wxCHECK2(x, op) if (!(x)) {wxFAIL; op; }
|
||||||
/// as wxCHECK2 but with a message explaining why we fail
|
|
||||||
|
// as wxCHECK2 but with a message explaining why we fail
|
||||||
#define wxCHECK2_MSG(x, op, msg) if (!(x)) {wxFAIL_MSG(msg); op; }
|
#define wxCHECK2_MSG(x, op, msg) if (!(x)) {wxFAIL_MSG(msg); op; }
|
||||||
/// special form of wxCHECK2: as wxCHECK, but for use in void functions
|
|
||||||
|
// special form of wxCHECK2: as wxCHECK, but for use in void functions
|
||||||
// NB: there is only one form (with msg parameter) and it's intentional:
|
// NB: there is only one form (with msg parameter) and it's intentional:
|
||||||
// there is no other way to tell the caller what exactly went wrong
|
// there is no other way to tell the caller what exactly went wrong
|
||||||
// from the void function (of course, the function shouldn't be void
|
// from the void function (of course, the function shouldn't be void
|
||||||
// to begin with...)
|
// to begin with...)
|
||||||
#define wxCHECK_RET(x, msg) if (!(x)) {wxFAIL_MSG(msg); return; }
|
#define wxCHECK_RET(x, msg) if (!(x)) {wxFAIL_MSG(msg); return; }
|
||||||
//@}
|
|
||||||
|
|
||||||
//@}
|
|
||||||
|
|
||||||
#endif // _WX_DEBUG_H_
|
#endif // _WX_DEBUG_H_
|
||||||
|
|
||||||
|
@@ -64,7 +64,9 @@
|
|||||||
#define PM_USE_SESSION_APIS 0
|
#define PM_USE_SESSION_APIS 0
|
||||||
#include <Carbon/Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
#endif
|
#endif
|
||||||
#elif defined(applec) || defined(THINK_C) || (defined(__MWERKS__) && !defined(__INTEL__))
|
#elif defined(applec) || \
|
||||||
|
defined(THINK_C) || \
|
||||||
|
(defined(__MWERKS__) && !defined(__INTEL__))
|
||||||
// MacOS
|
// MacOS
|
||||||
#elif defined(__WXMAC__) && defined(__APPLE__)
|
#elif defined(__WXMAC__) && defined(__APPLE__)
|
||||||
// MacOS X
|
// MacOS X
|
||||||
|
@@ -216,7 +216,6 @@ protected:
|
|||||||
// our HDC and its usage count: we only free it when the usage count drops
|
// our HDC and its usage count: we only free it when the usage count drops
|
||||||
// to 0
|
// to 0
|
||||||
WXHDC m_hDC;
|
WXHDC m_hDC;
|
||||||
int m_hDCCount;
|
|
||||||
|
|
||||||
// Store all old GDI objects when do a SelectObject, so we can select them
|
// Store all old GDI objects when do a SelectObject, so we can select them
|
||||||
// back in (this unselecting user's objects) so we can safely delete the
|
// back in (this unselecting user's objects) so we can safely delete the
|
||||||
|
@@ -38,34 +38,36 @@ WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
|
|||||||
|
|
||||||
class WXDLLEXPORT wxWindowDC : public wxDC
|
class WXDLLEXPORT wxWindowDC : public wxDC
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// default ctor
|
||||||
wxWindowDC();
|
wxWindowDC();
|
||||||
|
|
||||||
// Create a DC corresponding to the whole window
|
// Create a DC corresponding to the whole window
|
||||||
wxWindowDC(wxWindow *win);
|
wxWindowDC(wxWindow *win);
|
||||||
|
|
||||||
virtual ~wxWindowDC();
|
protected:
|
||||||
|
// intiialize the newly created DC
|
||||||
|
void InitDC();
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLEXPORT wxClientDC : public wxWindowDC
|
class WXDLLEXPORT wxClientDC : public wxWindowDC
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// default ctor
|
||||||
wxClientDC();
|
wxClientDC();
|
||||||
|
|
||||||
// Create a DC corresponding to the client area of the window
|
// Create a DC corresponding to the client area of the window
|
||||||
wxClientDC(wxWindow *win);
|
wxClientDC(wxWindow *win);
|
||||||
|
|
||||||
virtual ~wxClientDC();
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLEXPORT wxPaintDC : public wxWindowDC
|
class WXDLLEXPORT wxPaintDC : public wxWindowDC
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxPaintDC();
|
wxPaintDC();
|
||||||
|
|
||||||
@@ -82,6 +84,9 @@ protected:
|
|||||||
|
|
||||||
// find the entry for this DC in the cache (keyed by the window)
|
// find the entry for this DC in the cache (keyed by the window)
|
||||||
wxPaintDCInfo *FindInCache(size_t *index = NULL) const;
|
wxPaintDCInfo *FindInCache(size_t *index = NULL) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dcmemory.h
|
// Name: wx/msw/dcmemory.h
|
||||||
// Purpose: wxMemoryDC class
|
// Purpose: wxMemoryDC class
|
||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -24,13 +24,19 @@ public:
|
|||||||
wxMemoryDC();
|
wxMemoryDC();
|
||||||
wxMemoryDC(wxDC *dc); // Create compatible DC
|
wxMemoryDC(wxDC *dc); // Create compatible DC
|
||||||
|
|
||||||
~wxMemoryDC();
|
|
||||||
|
|
||||||
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
|
||||||
virtual void SelectObject(const wxBitmap& bitmap);
|
virtual void SelectObject(const wxBitmap& bitmap);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// override some base class virtuals
|
||||||
|
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
virtual void DoGetSize(int* width, int* height) const;
|
virtual void DoGetSize(int* width, int* height) const;
|
||||||
|
|
||||||
|
// create DC compatible with the given one or screen if dc == NULL
|
||||||
|
bool CreateCompatible(wxDC *dc);
|
||||||
|
|
||||||
|
// initialize the newly created DC
|
||||||
|
void Init();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
||||||
};
|
};
|
||||||
|
@@ -24,8 +24,6 @@
|
|||||||
class WXDLLEXPORT wxPrinterDC : public wxDC
|
class WXDLLEXPORT wxPrinterDC : public wxDC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DECLARE_CLASS(wxPrinterDC)
|
|
||||||
|
|
||||||
// Create a printer DC (obsolete function: use wxPrintData version now)
|
// Create a printer DC (obsolete function: use wxPrintData version now)
|
||||||
wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, int orientation = wxPORTRAIT);
|
wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, int orientation = wxPORTRAIT);
|
||||||
|
|
||||||
@@ -34,8 +32,6 @@ DECLARE_CLASS(wxPrinterDC)
|
|||||||
|
|
||||||
wxPrinterDC(WXHDC theDC);
|
wxPrinterDC(WXHDC theDC);
|
||||||
|
|
||||||
~wxPrinterDC(void);
|
|
||||||
|
|
||||||
// override some base class virtuals
|
// override some base class virtuals
|
||||||
virtual bool StartDoc(const wxString& message);
|
virtual bool StartDoc(const wxString& message);
|
||||||
virtual void EndDoc();
|
virtual void EndDoc();
|
||||||
@@ -50,7 +46,13 @@ protected:
|
|||||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||||
int rop = wxCOPY, bool useMask = FALSE);
|
int rop = wxCOPY, bool useMask = FALSE);
|
||||||
|
|
||||||
|
// init the dc
|
||||||
|
void Init();
|
||||||
|
|
||||||
wxPrintData m_printData;
|
wxPrintData m_printData;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_CLASS(wxPrinterDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Gets an HDC for the default printer configuration
|
// Gets an HDC for the default printer configuration
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dcscreen.h
|
// Name: wx/msw/dcscreen.h
|
||||||
// Purpose: wxScreenDC class
|
// Purpose: wxScreenDC class
|
||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -20,18 +20,17 @@
|
|||||||
|
|
||||||
class WXDLLEXPORT wxScreenDC : public wxWindowDC
|
class WXDLLEXPORT wxScreenDC : public wxWindowDC
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Create a DC representing the whole screen
|
// Create a DC representing the whole screen
|
||||||
wxScreenDC(void);
|
wxScreenDC();
|
||||||
~wxScreenDC(void);
|
|
||||||
|
|
||||||
// Compatibility with X's requirements for
|
// Compatibility with X's requirements for drawing on top of all windows
|
||||||
// drawing on top of all windows
|
|
||||||
static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return TRUE; }
|
static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return TRUE; }
|
||||||
static bool StartDrawingOnTop(wxRect* WXUNUSED(rect) = NULL) { return TRUE; }
|
static bool StartDrawingOnTop(wxRect* WXUNUSED(rect) = NULL) { return TRUE; }
|
||||||
static bool EndDrawingOnTop(void) { return TRUE; }
|
static bool EndDrawingOnTop(void) { return TRUE; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -94,12 +94,12 @@ private:
|
|||||||
DECLARE_DYNAMIC_CLASS(wxEnhMetaFileDC)
|
DECLARE_DYNAMIC_CLASS(wxEnhMetaFileDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxEnhMetaFileDataObject is a specialization of wxDataObject for enh metafile
|
// wxEnhMetaFileDataObject is a specialization of wxDataObject for enh metafile
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
|
||||||
|
|
||||||
// notice that we want to support both CF_METAFILEPICT and CF_ENHMETAFILE and
|
// notice that we want to support both CF_METAFILEPICT and CF_ENHMETAFILE and
|
||||||
// so we derive from wxDataObject and not from wxDataObjectSimple
|
// so we derive from wxDataObject and not from wxDataObjectSimple
|
||||||
class WXDLLEXPORT wxEnhMetaFileDataObject : public wxDataObject
|
class WXDLLEXPORT wxEnhMetaFileDataObject : public wxDataObject
|
||||||
@@ -130,6 +130,38 @@ protected:
|
|||||||
wxEnhMetaFile m_metafile;
|
wxEnhMetaFile m_metafile;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxEnhMetaFileSimpleDataObject does derive from wxDataObjectSimple which
|
||||||
|
// makes it more convenient to use (it can be used with wxDataObjectComposite)
|
||||||
|
// at the price of not supoprting any more CF_METAFILEPICT but only
|
||||||
|
// CF_ENHMETAFILE
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxEnhMetaFileSimpleDataObject : public wxDataObjectSimple
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// ctors
|
||||||
|
wxEnhMetaFileSimpleDataObject() : wxDataObjectSimple(wxDF_ENHMETAFILE) { }
|
||||||
|
wxEnhMetaFileSimpleDataObject(const wxEnhMetaFile& metafile)
|
||||||
|
: wxDataObjectSimple(wxDF_ENHMETAFILE), m_metafile(metafile) { }
|
||||||
|
|
||||||
|
// virtual functions which you may override if you want to provide data on
|
||||||
|
// demand only - otherwise, the trivial default versions will be used
|
||||||
|
virtual void SetEnhMetafile(const wxEnhMetaFile& metafile)
|
||||||
|
{ m_metafile = metafile; }
|
||||||
|
virtual wxEnhMetaFile GetEnhMetafile() const
|
||||||
|
{ return m_metafile; }
|
||||||
|
|
||||||
|
// implement base class pure virtuals
|
||||||
|
virtual size_t GetDataSize() const;
|
||||||
|
virtual bool GetDataHere(void *buf) const;
|
||||||
|
virtual bool SetData(size_t len, const void *buf);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxEnhMetaFile m_metafile;
|
||||||
|
};
|
||||||
|
|
||||||
#endif // wxUSE_DRAG_AND_DROP
|
#endif // wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
#endif // _WX_MSW_ENHMETA_H_
|
#endif // _WX_MSW_ENHMETA_H_
|
||||||
|
@@ -49,11 +49,12 @@
|
|||||||
//#define TEST_HASH
|
//#define TEST_HASH
|
||||||
//#define TEST_INFO_FUNCTIONS
|
//#define TEST_INFO_FUNCTIONS
|
||||||
//#define TEST_LIST
|
//#define TEST_LIST
|
||||||
#define TEST_LOCALE
|
//#define TEST_LOCALE
|
||||||
//#define TEST_LOG
|
//#define TEST_LOG
|
||||||
//#define TEST_LONGLONG
|
//#define TEST_LONGLONG
|
||||||
//#define TEST_MIME
|
//#define TEST_MIME
|
||||||
//#define TEST_PATHLIST
|
//#define TEST_PATHLIST
|
||||||
|
#define TEST_REGCONF
|
||||||
//#define TEST_REGISTRY
|
//#define TEST_REGISTRY
|
||||||
//#define TEST_SOCKETS
|
//#define TEST_SOCKETS
|
||||||
//#define TEST_STREAMS
|
//#define TEST_STREAMS
|
||||||
@@ -1599,14 +1600,28 @@ static void TestPathList()
|
|||||||
#endif // TEST_PATHLIST
|
#endif // TEST_PATHLIST
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// registry
|
// registry and related stuff
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// this is for MSW only
|
// this is for MSW only
|
||||||
#ifndef __WXMSW__
|
#ifndef __WXMSW__
|
||||||
|
#undef TEST_REGCONF
|
||||||
#undef TEST_REGISTRY
|
#undef TEST_REGISTRY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef TEST_REGCONF
|
||||||
|
|
||||||
|
#include <wx/confbase.h>
|
||||||
|
#include <wx/msw/regconf.h>
|
||||||
|
|
||||||
|
static void TestRegConfWrite()
|
||||||
|
{
|
||||||
|
wxRegConfig regconf(_T("console"), _T("wxwindows"));
|
||||||
|
regconf.Write(_T("Hello"), wxString(_T("world")));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // TEST_REGCONF
|
||||||
|
|
||||||
#ifdef TEST_REGISTRY
|
#ifdef TEST_REGISTRY
|
||||||
|
|
||||||
#include <wx/msw/registry.h>
|
#include <wx/msw/registry.h>
|
||||||
@@ -4680,6 +4695,10 @@ int main(int argc, char **argv)
|
|||||||
TestPathList();
|
TestPathList();
|
||||||
#endif // TEST_PATHLIST
|
#endif // TEST_PATHLIST
|
||||||
|
|
||||||
|
#ifdef TEST_REGCONF
|
||||||
|
TestRegConfWrite();
|
||||||
|
#endif // TEST_REGCONF
|
||||||
|
|
||||||
#ifdef TEST_REGISTRY
|
#ifdef TEST_REGISTRY
|
||||||
if ( 0 )
|
if ( 0 )
|
||||||
TestRegistryRead();
|
TestRegistryRead();
|
||||||
|
@@ -701,7 +701,9 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
|||||||
m_gaugeVert = new wxGauge( panel, -1, 100,
|
m_gaugeVert = new wxGauge( panel, -1, 100,
|
||||||
wxPoint(195,35), wxSize(30, 90),
|
wxPoint(195,35), wxSize(30, 90),
|
||||||
wxGA_VERTICAL | wxGA_SMOOTH | wxNO_BORDER );
|
wxGA_VERTICAL | wxGA_SMOOTH | wxNO_BORDER );
|
||||||
m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1), wxSL_LABELS );
|
m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1),
|
||||||
|
wxSL_AUTOTICKS | wxSL_LABELS );
|
||||||
|
m_slider->SetTickFreq(40, 0);
|
||||||
(void)new wxStaticBox( panel, -1, "&Explanation", wxPoint(230,10), wxSize(270,130) );
|
(void)new wxStaticBox( panel, -1, "&Explanation", wxPoint(230,10), wxSize(270,130) );
|
||||||
#ifdef __WXMOTIF__
|
#ifdef __WXMOTIF__
|
||||||
// No wrapping text in wxStaticText yet :-(
|
// No wrapping text in wxStaticText yet :-(
|
||||||
|
@@ -1,2 +1,4 @@
|
|||||||
|
dialogs ICON "dialogs.ico"
|
||||||
|
|
||||||
#include "wx/msw/wx.rc"
|
#include "wx/msw/wx.rc"
|
||||||
|
|
||||||
|
@@ -183,23 +183,29 @@ wxDC::wxDC()
|
|||||||
|
|
||||||
m_windowExtX = VIEWPORT_EXTENT;
|
m_windowExtX = VIEWPORT_EXTENT;
|
||||||
m_windowExtY = VIEWPORT_EXTENT;
|
m_windowExtY = VIEWPORT_EXTENT;
|
||||||
|
|
||||||
m_hDCCount = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxDC::~wxDC()
|
wxDC::~wxDC()
|
||||||
{
|
{
|
||||||
if ( m_hDC != 0 ) {
|
if ( m_hDC != 0 )
|
||||||
|
{
|
||||||
SelectOldObjects(m_hDC);
|
SelectOldObjects(m_hDC);
|
||||||
if ( m_bOwnsDC ) {
|
|
||||||
if ( m_canvas == NULL )
|
|
||||||
::DeleteDC(GetHdc());
|
|
||||||
else
|
|
||||||
::ReleaseDC((HWND)m_canvas->GetHWND(), GetHdc());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// if we own the HDC, we delete it, otherwise we just release it
|
||||||
|
|
||||||
|
if ( m_bOwnsDC )
|
||||||
|
{
|
||||||
|
::DeleteDC(GetHdc());
|
||||||
|
}
|
||||||
|
else // we don't own our HDC
|
||||||
|
{
|
||||||
|
// this is not supposed to happen as we can't free the HDC then
|
||||||
|
wxCHECK_RET( m_canvas, _T("no canvas in not owning ~wxDC?") );
|
||||||
|
|
||||||
|
::ReleaseDC(GetHwndOf(m_canvas), GetHdc());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This will select current objects out of the DC,
|
// This will select current objects out of the DC,
|
||||||
|
@@ -93,32 +93,29 @@ wxWindowDC::wxWindowDC()
|
|||||||
m_canvas = NULL;
|
m_canvas = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindowDC::wxWindowDC(wxWindow *the_canvas)
|
wxWindowDC::wxWindowDC(wxWindow *canvas)
|
||||||
{
|
{
|
||||||
m_canvas = the_canvas;
|
wxCHECK_RET( canvas, _T("invalid window in wxWindowDC") );
|
||||||
m_hDC = (WXHDC) ::GetWindowDC(GetWinHwnd(the_canvas) );
|
|
||||||
m_hDCCount++;
|
|
||||||
|
|
||||||
|
m_canvas = canvas;
|
||||||
|
m_hDC = (WXHDC) ::GetWindowDC(GetHwndOf(m_canvas));
|
||||||
|
|
||||||
|
// m_bOwnsDC was already set to false in the base class ctor, so the DC
|
||||||
|
// will be released (and not deleted) in ~wxDC
|
||||||
|
|
||||||
|
InitDC();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxWindowDC::InitDC()
|
||||||
|
{
|
||||||
|
// the background mode is only used for text background and is set in
|
||||||
|
// DrawText() to OPAQUE as required, otherwise always TRANSPARENT,
|
||||||
|
::SetBkMode(GetHdc(), TRANSPARENT);
|
||||||
|
|
||||||
|
// default bg colour is pne of the window
|
||||||
SetBackground(wxBrush(m_canvas->GetBackgroundColour(), wxSOLID));
|
SetBackground(wxBrush(m_canvas->GetBackgroundColour(), wxSOLID));
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindowDC::~wxWindowDC()
|
|
||||||
{
|
|
||||||
if (m_canvas && m_hDC)
|
|
||||||
{
|
|
||||||
SelectOldObjects(m_hDC);
|
|
||||||
|
|
||||||
if ( !::ReleaseDC(GetWinHwnd(m_canvas), GetHdc()) )
|
|
||||||
{
|
|
||||||
wxLogLastError(wxT("ReleaseDC"));
|
|
||||||
}
|
|
||||||
|
|
||||||
m_hDC = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_hDCCount--;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxClientDC
|
// wxClientDC
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -128,28 +125,17 @@ wxClientDC::wxClientDC()
|
|||||||
m_canvas = NULL;
|
m_canvas = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxClientDC::wxClientDC(wxWindow *the_canvas)
|
wxClientDC::wxClientDC(wxWindow *canvas)
|
||||||
{
|
{
|
||||||
m_canvas = the_canvas;
|
wxCHECK_RET( canvas, _T("invalid window in wxClientDC") );
|
||||||
m_hDC = (WXHDC) ::GetDC(GetWinHwnd(the_canvas));
|
|
||||||
|
|
||||||
// the background mode is only used for text background
|
m_canvas = canvas;
|
||||||
// and is set in DrawText() to OPAQUE as required, other-
|
m_hDC = (WXHDC)::GetDC(GetHwndOf(m_canvas));
|
||||||
// wise always TRANSPARENT, RR
|
|
||||||
::SetBkMode( GetHdc(), TRANSPARENT );
|
|
||||||
|
|
||||||
SetBackground(wxBrush(m_canvas->GetBackgroundColour(), wxSOLID));
|
// m_bOwnsDC was already set to false in the base class ctor, so the DC
|
||||||
}
|
// will be released (and not deleted) in ~wxDC
|
||||||
|
|
||||||
wxClientDC::~wxClientDC()
|
InitDC();
|
||||||
{
|
|
||||||
if ( m_canvas && GetHdc() )
|
|
||||||
{
|
|
||||||
SelectOldObjects(m_hDC);
|
|
||||||
|
|
||||||
::ReleaseDC(GetWinHwnd(m_canvas), GetHdc());
|
|
||||||
m_hDC = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -157,7 +143,7 @@ wxClientDC::~wxClientDC()
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// VZ: initial implementation (by JACS) only remembered the last wxPaintDC
|
// VZ: initial implementation (by JACS) only remembered the last wxPaintDC
|
||||||
// created and tried to reuse - this was supposed to take care of a
|
// created and tried to reuse it - this was supposed to take care of a
|
||||||
// situation when a derived class OnPaint() calls base class OnPaint()
|
// situation when a derived class OnPaint() calls base class OnPaint()
|
||||||
// because in this case ::BeginPaint() shouldn't be called second time.
|
// because in this case ::BeginPaint() shouldn't be called second time.
|
||||||
//
|
//
|
||||||
@@ -177,7 +163,6 @@ wxArrayDCInfo wxPaintDC::ms_cache;
|
|||||||
wxPaintDC::wxPaintDC()
|
wxPaintDC::wxPaintDC()
|
||||||
{
|
{
|
||||||
m_canvas = NULL;
|
m_canvas = NULL;
|
||||||
m_hDC = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPaintDC::wxPaintDC(wxWindow *canvas)
|
wxPaintDC::wxPaintDC(wxWindow *canvas)
|
||||||
@@ -204,16 +189,11 @@ wxPaintDC::wxPaintDC(wxWindow *canvas)
|
|||||||
}
|
}
|
||||||
else // not in cache, create a new one
|
else // not in cache, create a new one
|
||||||
{
|
{
|
||||||
m_hDC = (WXHDC)::BeginPaint(GetWinHwnd(m_canvas), &g_paintStruct);
|
m_hDC = (WXHDC)::BeginPaint(GetHwndOf(m_canvas), &g_paintStruct);
|
||||||
ms_cache.Add(new wxPaintDCInfo(m_canvas, this));
|
ms_cache.Add(new wxPaintDCInfo(m_canvas, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
// the background mode is only used for text background
|
InitDC();
|
||||||
// and is set in DrawText() to OPAQUE as required, other-
|
|
||||||
// wise always TRANSPARENT, RR
|
|
||||||
::SetBkMode( GetHdc(), TRANSPARENT );
|
|
||||||
|
|
||||||
SetBackground(wxBrush(m_canvas->GetBackgroundColour(), wxSOLID));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPaintDC::~wxPaintDC()
|
wxPaintDC::~wxPaintDC()
|
||||||
@@ -229,7 +209,7 @@ wxPaintDC::~wxPaintDC()
|
|||||||
|
|
||||||
if ( !--info->count )
|
if ( !--info->count )
|
||||||
{
|
{
|
||||||
::EndPaint(GetWinHwnd(m_canvas), &g_paintStruct);
|
::EndPaint(GetHwndOf(m_canvas), &g_paintStruct);
|
||||||
|
|
||||||
ms_cache.Remove(index);
|
ms_cache.Remove(index);
|
||||||
|
|
||||||
|
@@ -53,37 +53,47 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
|
|||||||
|
|
||||||
wxMemoryDC::wxMemoryDC()
|
wxMemoryDC::wxMemoryDC()
|
||||||
{
|
{
|
||||||
m_hDC = (WXHDC) ::CreateCompatibleDC((HDC) NULL);
|
CreateCompatible(NULL);
|
||||||
m_ok = (m_hDC != 0);
|
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMemoryDC::wxMemoryDC(wxDC *dc)
|
||||||
|
{
|
||||||
|
wxCHECK_RET( dc, _T("NULL dc in wxMemoryDC ctor") );
|
||||||
|
|
||||||
|
dc->BeginDrawing();
|
||||||
|
|
||||||
|
CreateCompatible(dc);
|
||||||
|
|
||||||
|
dc->EndDrawing();
|
||||||
|
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMemoryDC::Init()
|
||||||
|
{
|
||||||
|
if ( m_ok )
|
||||||
|
{
|
||||||
|
SetBrush(*wxWHITE_BRUSH);
|
||||||
|
SetPen(*wxBLACK_PEN);
|
||||||
|
|
||||||
|
// the background mode is only used for text background and is set in
|
||||||
|
// DrawText() to OPAQUE as required, otherwise always TRANSPARENT
|
||||||
|
::SetBkMode( GetHdc(), TRANSPARENT );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxMemoryDC::CreateCompatible(wxDC *dc)
|
||||||
|
{
|
||||||
|
m_hDC = (WXHDC)::CreateCompatibleDC(dc ? GetHdcOf(*dc) : NULL);
|
||||||
|
|
||||||
|
// as we created the DC, we must delete it in the dtor
|
||||||
m_bOwnsDC = TRUE;
|
m_bOwnsDC = TRUE;
|
||||||
|
|
||||||
SetBrush(*wxWHITE_BRUSH);
|
m_ok = m_hDC != 0;
|
||||||
SetPen(*wxBLACK_PEN);
|
|
||||||
|
|
||||||
// the background mode is only used for text background and is set in
|
return m_ok;
|
||||||
// DrawText() to OPAQUE as required, otherwise always TRANSPARENT
|
|
||||||
::SetBkMode( GetHdc(), TRANSPARENT );
|
|
||||||
}
|
|
||||||
|
|
||||||
wxMemoryDC::wxMemoryDC(wxDC *old_dc)
|
|
||||||
{
|
|
||||||
old_dc->BeginDrawing();
|
|
||||||
|
|
||||||
m_hDC = (WXHDC) ::CreateCompatibleDC(GetHdcOf(*old_dc));
|
|
||||||
m_ok = (m_hDC != 0);
|
|
||||||
|
|
||||||
old_dc->EndDrawing();
|
|
||||||
|
|
||||||
SetBrush(*wxWHITE_BRUSH);
|
|
||||||
SetPen(*wxBLACK_PEN);
|
|
||||||
|
|
||||||
// the background mode is only used for text background and is set in
|
|
||||||
// DrawText() to OPAQUE as required, otherwise always TRANSPARENT
|
|
||||||
::SetBkMode( GetHdc(), TRANSPARENT );
|
|
||||||
}
|
|
||||||
|
|
||||||
wxMemoryDC::~wxMemoryDC()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMemoryDC::SelectObject(const wxBitmap& bitmap)
|
void wxMemoryDC::SelectObject(const wxBitmap& bitmap)
|
||||||
|
@@ -70,11 +70,15 @@ IMPLEMENT_CLASS(wxPrinterDC, wxDC)
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// This form is deprecated
|
// This form is deprecated
|
||||||
wxPrinterDC::wxPrinterDC(const wxString& driver_name, const wxString& device_name, const wxString& file, bool interactive, int orientation)
|
wxPrinterDC::wxPrinterDC(const wxString& driver_name,
|
||||||
|
const wxString& device_name,
|
||||||
|
const wxString& file,
|
||||||
|
bool interactive,
|
||||||
|
int orientation)
|
||||||
{
|
{
|
||||||
m_isInteractive = interactive;
|
m_isInteractive = interactive;
|
||||||
|
|
||||||
if ( !!file )
|
if ( !file.empty() )
|
||||||
m_printData.SetFilename(file);
|
m_printData.SetFilename(file);
|
||||||
|
|
||||||
#if wxUSE_COMMON_DIALOGS
|
#if wxUSE_COMMON_DIALOGS
|
||||||
@@ -94,44 +98,33 @@ wxPrinterDC::wxPrinterDC(const wxString& driver_name, const wxString& device_nam
|
|||||||
pd.nCopies = 1;
|
pd.nCopies = 1;
|
||||||
pd.hInstance = (HINSTANCE)NULL;
|
pd.hInstance = (HINSTANCE)NULL;
|
||||||
|
|
||||||
if ( PrintDlg( &pd ) != 0 )
|
m_ok = PrintDlg( &pd ) != 0;
|
||||||
|
if ( m_ok )
|
||||||
{
|
{
|
||||||
m_hDC = (WXHDC) pd.hDC;
|
m_hDC = (WXHDC) pd.hDC;
|
||||||
m_ok = TRUE;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
m_ok = FALSE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// m_dontDelete = TRUE;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif // wxUSE_COMMON_DIALOGS
|
#endif // wxUSE_COMMON_DIALOGS
|
||||||
if ((!driver_name.IsNull() && driver_name != wxT("")) &&
|
|
||||||
(!device_name.IsNull() && device_name != wxT("")) &&
|
|
||||||
(!file.IsNull() && file != wxT("")))
|
|
||||||
{
|
{
|
||||||
m_hDC = (WXHDC) CreateDC(WXSTRINGCAST driver_name, WXSTRINGCAST device_name, WXSTRINGCAST file, NULL);
|
if ( !driver_name.empty() && !device_name.empty() && !file.empty() )
|
||||||
m_ok = m_hDC ? TRUE: FALSE;
|
{
|
||||||
|
m_hDC = (WXHDC) CreateDC(driver_name, device_name, file, NULL);
|
||||||
}
|
}
|
||||||
else
|
else // we don't have all parameters, ask the user
|
||||||
{
|
{
|
||||||
wxPrintData printData;
|
wxPrintData printData;
|
||||||
printData.SetOrientation(orientation);
|
printData.SetOrientation(orientation);
|
||||||
m_hDC = wxGetPrinterDC(printData);
|
m_hDC = wxGetPrinterDC(printData);
|
||||||
m_ok = m_hDC ? TRUE: FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_hDC)
|
m_ok = m_hDC ? TRUE: FALSE;
|
||||||
{
|
|
||||||
// int width = GetDeviceCaps(m_hDC, VERTRES);
|
// as we created it, we must delete it as well
|
||||||
// int height = GetDeviceCaps(m_hDC, HORZRES);
|
m_bOwnsDC = TRUE;
|
||||||
SetMapMode(wxMM_TEXT);
|
|
||||||
}
|
}
|
||||||
SetBrush(*wxBLACK_BRUSH);
|
|
||||||
SetPen(*wxBLACK_PEN);
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPrinterDC::wxPrinterDC(const wxPrintData& printData)
|
wxPrinterDC::wxPrinterDC(const wxPrintData& printData)
|
||||||
@@ -141,34 +134,33 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printData)
|
|||||||
m_isInteractive = FALSE;
|
m_isInteractive = FALSE;
|
||||||
|
|
||||||
m_hDC = wxGetPrinterDC(printData);
|
m_hDC = wxGetPrinterDC(printData);
|
||||||
m_ok = (m_hDC != 0);
|
m_ok = m_hDC != 0;
|
||||||
|
m_bOwnsDC = TRUE;
|
||||||
|
|
||||||
if (m_hDC)
|
Init();
|
||||||
SetMapMode(wxMM_TEXT);
|
|
||||||
|
|
||||||
SetBrush(*wxBLACK_BRUSH);
|
|
||||||
SetPen(*wxBLACK_PEN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxPrinterDC::wxPrinterDC(WXHDC theDC)
|
wxPrinterDC::wxPrinterDC(WXHDC dc)
|
||||||
{
|
{
|
||||||
m_isInteractive = FALSE;
|
m_isInteractive = FALSE;
|
||||||
|
|
||||||
m_hDC = theDC;
|
m_hDC = dc;
|
||||||
|
m_bOwnsDC = TRUE;
|
||||||
m_ok = TRUE;
|
m_ok = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPrinterDC::Init()
|
||||||
|
{
|
||||||
if ( m_hDC )
|
if ( m_hDC )
|
||||||
{
|
{
|
||||||
// int width = GetDeviceCaps(m_hDC, VERTRES);
|
// int width = GetDeviceCaps(m_hDC, VERTRES);
|
||||||
// int height = GetDeviceCaps(m_hDC, HORZRES);
|
// int height = GetDeviceCaps(m_hDC, HORZRES);
|
||||||
SetMapMode(wxMM_TEXT);
|
SetMapMode(wxMM_TEXT);
|
||||||
}
|
|
||||||
SetBrush(*wxBLACK_BRUSH);
|
SetBrush(*wxBLACK_BRUSH);
|
||||||
SetPen(*wxBLACK_PEN);
|
SetPen(*wxBLACK_PEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPrinterDC::~wxPrinterDC()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -229,7 +221,7 @@ void wxPrinterDC::EndPage()
|
|||||||
// Returns default device and port names
|
// Returns default device and port names
|
||||||
static bool wxGetDefaultDeviceName(wxString& deviceName, wxString& portName)
|
static bool wxGetDefaultDeviceName(wxString& deviceName, wxString& portName)
|
||||||
{
|
{
|
||||||
deviceName = "";
|
deviceName.clear();
|
||||||
|
|
||||||
LPDEVNAMES lpDevNames;
|
LPDEVNAMES lpDevNames;
|
||||||
LPSTR lpszDriverName;
|
LPSTR lpszDriverName;
|
||||||
@@ -359,7 +351,7 @@ WXHDC wxGetPrinterDC(int orientation)
|
|||||||
}
|
}
|
||||||
return (WXHDC) hDC;
|
return (WXHDC) hDC;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // 0
|
||||||
|
|
||||||
// Gets an HDC for the specified printer configuration
|
// Gets an HDC for the specified printer configuration
|
||||||
WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst)
|
WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dcscreen.cpp
|
// Name: src/msw/dcscreen.cpp
|
||||||
// Purpose: wxScreenDC class
|
// Purpose: wxScreenDC class
|
||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -33,22 +33,12 @@
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
|
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
|
||||||
|
|
||||||
// Create a DC representing the whole screen
|
// Create a DC representing the whole screen
|
||||||
wxScreenDC::wxScreenDC(void)
|
wxScreenDC::wxScreenDC()
|
||||||
{
|
{
|
||||||
m_hDC = (WXHDC) ::GetDC((HWND) NULL);
|
m_hDC = (WXHDC) ::GetDC((HWND) NULL);
|
||||||
m_hDCCount ++;
|
|
||||||
|
|
||||||
// the background mode is only used for text background
|
// the background mode is only used for text background and is set in
|
||||||
// and is set in DrawText() to OPAQUE as required, other-
|
// DrawText() to OPAQUE as required, otherwise always TRANSPARENT
|
||||||
// wise always TRANSPARENT, RR
|
|
||||||
::SetBkMode( GetHdc(), TRANSPARENT );
|
::SetBkMode( GetHdc(), TRANSPARENT );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxScreenDC::~wxScreenDC(void)
|
|
||||||
{
|
|
||||||
SelectOldObjects(m_hDC);
|
|
||||||
::ReleaseDC((HWND) NULL, (HDC) m_hDC);
|
|
||||||
m_hDC = 0;
|
|
||||||
m_hDCCount --;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@@ -56,7 +56,12 @@ DEFINE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED)
|
|||||||
DEFINE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED)
|
DEFINE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED)
|
||||||
|
|
||||||
// Doesn't yet compile under VC++ 4, BC++, Watcom C++: no wininet.h
|
// Doesn't yet compile under VC++ 4, BC++, Watcom C++: no wininet.h
|
||||||
#if !defined(__BORLANDC__) && !defined(__GNUWIN32_OLD__) && !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 0, 5 ) ) && !defined(__WATCOMC__) && ! (defined(__VISUALC__) && (__VISUALC__ < 1020))
|
#if !defined(__BORLANDC__) && \
|
||||||
|
!defined(__GNUWIN32_OLD__) && \
|
||||||
|
!defined(__WATCOMC__) && \
|
||||||
|
(!defined(__VISUALC__) || (__VISUALC__ >= 1020))
|
||||||
|
// FIXME: add this back as soon as wxCHECK_W32API_VERSION is chcked in
|
||||||
|
// (!defined(__GNUWIN32__) || wxCHECK_W32API_VERSION(0, 5)) && \
|
||||||
|
|
||||||
#include <ras.h>
|
#include <ras.h>
|
||||||
#include <raserror.h>
|
#include <raserror.h>
|
||||||
|
@@ -234,12 +234,12 @@ wxEnhMetaFileDC::~wxEnhMetaFileDC()
|
|||||||
m_hDC = 0;
|
m_hDC = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxEnhMetaFileDataObject
|
// wxEnhMetaFileDataObject
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
|
||||||
|
|
||||||
wxDataFormat
|
wxDataFormat
|
||||||
wxEnhMetaFileDataObject::GetPreferredFormat(Direction WXUNUSED(dir)) const
|
wxEnhMetaFileDataObject::GetPreferredFormat(Direction WXUNUSED(dir)) const
|
||||||
{
|
{
|
||||||
@@ -391,6 +391,46 @@ bool wxEnhMetaFileDataObject::SetData(const wxDataFormat& format,
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxEnhMetaFileSimpleDataObject
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
size_t wxEnhMetaFileSimpleDataObject::GetDataSize() const
|
||||||
|
{
|
||||||
|
// we pass data by handle and not HGLOBAL
|
||||||
|
return 0u;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxEnhMetaFileSimpleDataObject::GetDataHere(void *buf) const
|
||||||
|
{
|
||||||
|
wxCHECK_MSG( m_metafile.Ok(), FALSE, _T("copying invalid enh metafile") );
|
||||||
|
|
||||||
|
HENHMETAFILE hEMF = (HENHMETAFILE)m_metafile.GetHENHMETAFILE();
|
||||||
|
|
||||||
|
HENHMETAFILE hEMFCopy = ::CopyEnhMetaFile(hEMF, NULL);
|
||||||
|
if ( !hEMFCopy )
|
||||||
|
{
|
||||||
|
wxLogLastError(_T("CopyEnhMetaFile"));
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
*(HENHMETAFILE *)buf = hEMFCopy;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxEnhMetaFileSimpleDataObject::SetData(size_t WXUNUSED(len),
|
||||||
|
const void *buf)
|
||||||
|
{
|
||||||
|
HENHMETAFILE hEMF = *(HENHMETAFILE *)buf;
|
||||||
|
|
||||||
|
wxCHECK_MSG( hEMF, FALSE, _T("pasting invalid enh metafile") );
|
||||||
|
m_metafile.SetHENHMETAFILE((WXHANDLE)hEMF);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // wxUSE_DRAG_AND_DROP
|
#endif // wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
#endif // wxUSE_ENH_METAFILE
|
#endif // wxUSE_ENH_METAFILE
|
||||||
|
@@ -117,6 +117,11 @@ SOURCE=.\src\common\dbtable.cpp
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\src\msw\dummy.cpp
|
||||||
|
# ADD CPP /Yc"wx/wxprec.h"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\src\common\dynarray.cpp
|
SOURCE=.\src\common\dynarray.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
Reference in New Issue
Block a user