From 217099990c2665d18d352c60058106da9a014ab8 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 29 Jun 2001 19:18:30 +0000 Subject: [PATCH] Further wxUniv fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10729 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/microwin.rsp | 32 ++++ distrib/msw/tarmicrowin.sh | 45 +++++ include/wx/confbase.h | 17 +- include/wx/generic/msgdlgg.h | 2 +- include/wx/msgdlg.h | 4 +- include/wx/univ/setup.h | 2 +- samples/widgets/WidgetsVC.dsp | 284 ++++++++++++++++++++++++++++++ samples/widgets/WidgetsVC.dsw | 29 +++ src/common/config.cpp | 9 +- src/common/gaugecmn.cpp | 117 +++++++++++++ src/common/utilscmn.cpp | 2 + src/generic/spinctlg.cpp | 321 ++++++++++++++++++++++++++++++++++ src/msw/ole/automtn.cpp | 2 +- src/msw/ole/dataobj.cpp | 28 ++- src/msw/ole/dropsrc.cpp | 2 +- src/msw/ole/droptgt.cpp | 2 +- src/msw/ole/oleutils.cpp | 5 + src/msw/ole/uuid.cpp | 2 +- src/univ/notebook.cpp | 3 + src/univ/textctrl.cpp | 1 + src/wxvc_universal.dsp | 16 ++ 21 files changed, 902 insertions(+), 23 deletions(-) create mode 100644 distrib/msw/microwin.rsp create mode 100644 distrib/msw/tarmicrowin.sh create mode 100644 samples/widgets/WidgetsVC.dsp create mode 100644 samples/widgets/WidgetsVC.dsw create mode 100644 src/common/gaugecmn.cpp create mode 100644 src/generic/spinctlg.cpp diff --git a/distrib/msw/microwin.rsp b/distrib/msw/microwin.rsp new file mode 100644 index 0000000000..3603b64159 --- /dev/null +++ b/distrib/msw/microwin.rsp @@ -0,0 +1,32 @@ +include/wx/*.h +include/wx/*.cpp +include/wx/*.inl +include/wx/microwin/*.h +include/wx/generic/*.h +include/wx/generic/*.xpm +include/wx/unix/*.h + +src/common/*.cpp +src/common/*.c +src/common/*.inc +src/generic/*.cpp +src/generic/*.c +src/unix/*.cpp +src/unix/*.c +src/microwin/*.cpp +src/microwin/*.c +src/microwin/Makefile + +samples/mw-minimal/*.cpp +samples/mw-minimal/*.h +samples/mw-minimal/Makefile +samples/mw-minimal/*.xpm + +lib/dummy.txt + +distrib/msw/microwin.rsp +distrib/msw/tarmicrowin.sh + +microwindows.patches + +docs/microwin/readme.txt diff --git a/distrib/msw/tarmicrowin.sh b/distrib/msw/tarmicrowin.sh new file mode 100644 index 0000000000..15deab230c --- /dev/null +++ b/distrib/msw/tarmicrowin.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# tardist: make up a tar.gz distribution of wxMicroWindows. + +init="" +if [ "$1" = "" ] +then + echo Usage: tardist wx-dir output-dir version + exit +fi + +if [ "$2" = "" ] +then + echo Usage: tardist wx-dir output-dir version + exit +fi + +if [ "$3" = "" ] +then + echo Usage: tardist wx-dir output-dir version + exit +fi + +WXVER=$3 + +echo About to archive wxWindows: +echo From $1 +echo To $2 +echo CTRL-C if this is not correct. +read dummy + +cd $1 + +echo Removing backup files... +rm *~ */*~ */*/*~ */*/*/*~ */*/*/*/*~ + +rm -f $2/wxMicroWindows-${WXVER}.* + +echo Tarring... + +ls `cat $1/distrib/msw/microwin.rsp` > /tmp/files.txt +tar cvf $2/wxMicroWindows-${WXVER}.tar -T /tmp/files.txt +gzip $2/wxMicroWindows-${WXVER}.tar +mv $2/wxMicroWindows-${WXVER}.tar.gz $2/wxMicroWindows-${WXVER}.tgz + +echo Done! diff --git a/include/wx/confbase.h b/include/wx/confbase.h index 4b06078b0e..95d9f8f282 100644 --- a/include/wx/confbase.h +++ b/include/wx/confbase.h @@ -20,10 +20,6 @@ #include "wx/defs.h" -#if wxUSE_CONFIG - -#include "wx/string.h" - // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -44,6 +40,10 @@ #define wxCONFIG_IMMUTABLE_PREFIX _T('!') #endif +#if wxUSE_CONFIG + +#include "wx/string.h" + /// should we use registry instead of configuration files under Windows? // (i.e. whether wxConfigBase::Create() will create a wxFileConfig (if it's // FALSE) or wxRegConfig (if it's true and we're under Win32) or wxIniConfig @@ -302,21 +302,18 @@ private: #endif // wxUSE_CONFIG -// ---------------------------------------------------------------------------- -// various helper global functions (defined even if !wxUSE_CONFIG) -// ---------------------------------------------------------------------------- - /* Replace environment variables ($SOMETHING) with their values. The format is $VARNAME or ${VARNAME} where VARNAME contains alphanumeric characters and '_' only. '$' must be escaped ('\$') in order to be taken literally. */ -extern WXDLLEXPORT wxString wxExpandEnvVars(const wxString &sz); +WXDLLEXPORT wxString wxExpandEnvVars(const wxString &sz); /* Split path into parts removing '..' in progress */ -extern WXDLLEXPORT void wxSplitPath(wxArrayString& aParts, const wxChar *sz); +WXDLLEXPORT void wxSplitPath(wxArrayString& aParts, const wxChar *sz); + #endif // _WX_CONFIG_H_ diff --git a/include/wx/generic/msgdlgg.h b/include/wx/generic/msgdlgg.h index df43bc5293..471c7d0521 100644 --- a/include/wx/generic/msgdlgg.h +++ b/include/wx/generic/msgdlgg.h @@ -43,7 +43,7 @@ private: DECLARE_EVENT_TABLE() }; -#if !defined( __WXMSW__ ) && !defined( __WXMAC__) && !defined(__WXPM__) +#if (!defined( __WXMSW__ ) && !defined( __WXMAC__) && !defined(__WXPM__)) || defined(__WXUNIVERSAL__) #define wxMessageDialog wxGenericMessageDialog #endif diff --git a/include/wx/msgdlg.h b/include/wx/msgdlg.h index 48d1a3c214..02e43e1f0b 100644 --- a/include/wx/msgdlg.h +++ b/include/wx/msgdlg.h @@ -3,7 +3,9 @@ #if wxUSE_MSGDLG -#if defined(__WXMSW__) +#if defined(__WXUNIVERSAL__) +#include "wx/generic/msgdlgg.h" +#elif defined(__WXMSW__) #include "wx/msw/msgdlg.h" #elif defined(__WXMOTIF__) #include "wx/motif/msgdlg.h" diff --git a/include/wx/univ/setup.h b/include/wx/univ/setup.h index 0f893e3c75..cbb152eb41 100644 --- a/include/wx/univ/setup.h +++ b/include/wx/univ/setup.h @@ -136,7 +136,7 @@ #define wxUSE_RESOURCES 0 #define wxUSE_CONSTRAINTS 1 #define wxUSE_CLIPBOARD 1 -#define wxUSE_DATAOBJ 1 +#define wxUSE_DATAOBJ 1 #define wxUSE_SPLINES 0 #define wxUSE_DRAG_AND_DROP 0 #define wxUSE_XPM_IN_MSW 1 diff --git a/samples/widgets/WidgetsVC.dsp b/samples/widgets/WidgetsVC.dsp new file mode 100644 index 0000000000..edf34460ac --- /dev/null +++ b/samples/widgets/WidgetsVC.dsp @@ -0,0 +1,284 @@ +# Microsoft Developer Studio Project File - Name="WidgetsVC" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=WidgetsVC - Win32 Univ Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "WidgetsVC.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "WidgetsVC.mak" CFG="WidgetsVC - Win32 Univ Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "WidgetsVC - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "WidgetsVC - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE "WidgetsVC - Win32 Debug DLL" (based on "Win32 (x86) Application") +!MESSAGE "WidgetsVC - Win32 Release DLL" (based on "Win32 (x86) Application") +!MESSAGE "WidgetsVC - Win32 Univ Release" (based on "Win32 (x86) Application") +!MESSAGE "WidgetsVC - Win32 Univ Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "WidgetsVC - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../include" /I "../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib png.lib zlib.lib jpeg.lib tiff.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"Release/widgets.exe" /libpath:"../../lib" /libpath:"../../contrib/lib" + +!ELSEIF "$(CFG)" == "WidgetsVC - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"Debug/widgets.exe" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib" + +!ELSEIF "$(CFG)" == "WidgetsVC - Win32 Debug DLL" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "DebugDLL" +# PROP BASE Intermediate_Dir "DebugDLL" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "DebugDLL" +# PROP Intermediate_Dir "DebugDLL" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D WXUSINGDLL=1 /Yu"wx/wxprec.h" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx23_2d.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /out:"DebugDLL/widgets.exe" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib" + +!ELSEIF "$(CFG)" == "WidgetsVC - Win32 Release DLL" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ReleaseDLL" +# PROP BASE Intermediate_Dir "ReleaseDLL" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ReleaseDLL" +# PROP Intermediate_Dir "ReleaseDLL" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../include" /I "../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D WXUSINGDLL=1 /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx23_2.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /out:"ReleaseDLL/widgets.exe" /libpath:"../../lib" /libpath:"../../contrib/lib" + +!ELSEIF "$(CFG)" == "WidgetsVC - Win32 Univ Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "WidgetsVC___Win32_Univ_Release" +# PROP BASE Intermediate_Dir "WidgetsVC___Win32_Univ_Release" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "UnivRelease" +# PROP Intermediate_Dir "UnivRelease" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../include" /I "../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../include" /I "../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib png.lib zlib.lib jpeg.lib tiff.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"Release/widgets.exe" /libpath:"../../lib" /libpath:"../../contrib/lib" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx_univ.lib png.lib zlib.lib jpeg.lib tiff.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"UnivRelease/widgets.exe" /libpath:"../../lib" /libpath:"../../contrib/lib" + +!ELSEIF "$(CFG)" == "WidgetsVC - Win32 Univ Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "WidgetsVC___Win32_Univ_Debug" +# PROP BASE Intermediate_Dir "WidgetsVC___Win32_Univ_Debug" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "UnivDebug" +# PROP Intermediate_Dir "UnivDebug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../contrib/include" /D "_DEBUG" /D DEBUG=1 /D "__WXDEBUG__" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"Debug/widgets.exe" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx_univd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"UnivDebug/widgets.exe" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib" + +!ENDIF + +# Begin Target + +# Name "WidgetsVC - Win32 Release" +# Name "WidgetsVC - Win32 Debug" +# Name "WidgetsVC - Win32 Debug DLL" +# Name "WidgetsVC - Win32 Release DLL" +# Name "WidgetsVC - Win32 Univ Release" +# Name "WidgetsVC - Win32 Univ Debug" +# Begin Source File + +SOURCE=.\button.cpp +# End Source File +# Begin Source File + +SOURCE=.\combobox.cpp +# End Source File +# Begin Source File + +SOURCE=.\gauge.cpp +# End Source File +# Begin Source File + +SOURCE=.\listbox.cpp +# End Source File +# Begin Source File + +SOURCE=.\notebook.cpp +# End Source File +# Begin Source File + +SOURCE=.\radiobox.cpp +# End Source File +# Begin Source File + +SOURCE=.\slider.cpp +# End Source File +# Begin Source File + +SOURCE=.\spinbtn.cpp +# End Source File +# Begin Source File + +SOURCE=.\static.cpp +# End Source File +# Begin Source File + +SOURCE=.\textctrl.cpp +# End Source File +# Begin Source File + +SOURCE=.\widgets.cpp + +!IF "$(CFG)" == "WidgetsVC - Win32 Release" + +!ELSEIF "$(CFG)" == "WidgetsVC - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "WidgetsVC - Win32 Debug DLL" + +# SUBTRACT BASE CPP /YX /Yc /Yu +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "WidgetsVC - Win32 Release DLL" + +!ELSEIF "$(CFG)" == "WidgetsVC - Win32 Univ Release" + +!ELSEIF "$(CFG)" == "WidgetsVC - Win32 Univ Debug" + +# SUBTRACT BASE CPP /YX /Yc /Yu +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\widgets.rc +# ADD BASE RSC /l 0x809 +# ADD RSC /l 0x809 /i "../../include" /i "../../contrib/include" +# End Source File +# End Target +# End Project diff --git a/samples/widgets/WidgetsVC.dsw b/samples/widgets/WidgetsVC.dsw new file mode 100644 index 0000000000..66f06fb1a9 --- /dev/null +++ b/samples/widgets/WidgetsVC.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "WidgetsVC"=.\WidgetsVC.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/src/common/config.cpp b/src/common/config.cpp index 1b614016b2..470acd97b1 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -27,6 +27,8 @@ #define wxUSE_CONFIG_NATIVE 1 #endif +#include "wx/config.h" + #if wxUSE_CONFIG && ((wxUSE_FILE && wxUSE_TEXTFILE) || wxUSE_CONFIG_NATIVE) #include "wx/app.h" @@ -38,8 +40,6 @@ #include "wx/utils.h" #include "wx/intl.h" -#include "wx/config.h" - #include #include #include @@ -266,6 +266,8 @@ wxConfigPathChanger::~wxConfigPathChanger() } } +#endif // wxUSE_CONFIG + // ---------------------------------------------------------------------------- // static & global functions // ---------------------------------------------------------------------------- @@ -381,6 +383,8 @@ wxString wxExpandEnvVars(const wxString& str) } // this function is used to properly interpret '..' in path +/// separates group and entry names (probably shouldn't be changed) + void wxSplitPath(wxArrayString& aParts, const wxChar *sz) { aParts.Empty(); @@ -418,5 +422,4 @@ void wxSplitPath(wxArrayString& aParts, const wxChar *sz) } } -#endif // wxUSE_CONFIG diff --git a/src/common/gaugecmn.cpp b/src/common/gaugecmn.cpp new file mode 100644 index 0000000000..585f8e6f68 --- /dev/null +++ b/src/common/gaugecmn.cpp @@ -0,0 +1,117 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: src/common/gaugecmn.cpp +// Purpose: wxGaugeBase: common to all ports methods of wxGauge +// Author: Vadim Zeitlin +// Modified by: +// Created: 20.02.01 +// RCS-ID: $Id$ +// Copyright: (c) 2001 Vadim Zeitlin +// License: wxWindows license +/////////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#ifdef __GNUG__ + #pragma implementation "gaugebase.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#endif //WX_PRECOMP + +#include "wx/gauge.h" + +#if wxUSE_GAUGE + +// ============================================================================ +// implementation +// ============================================================================ + +// ---------------------------------------------------------------------------- +// wxGauge creation +// ---------------------------------------------------------------------------- + +bool wxGaugeBase::Create(wxWindow *parent, + wxWindowID id, + int range, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + const wxString& name) +{ + if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) + return FALSE; + + SetName(name); + +#if wxUSE_VALIDATORS + SetValidator(validator); +#endif // wxUSE_VALIDATORS + + SetRange(range); + SetValue(0); + + return TRUE; +} + +// ---------------------------------------------------------------------------- +// wxGauge range/position +// ---------------------------------------------------------------------------- + +void wxGaugeBase::SetRange(int range) +{ + m_rangeMax = range; +} + +int wxGaugeBase::GetRange() const +{ + return m_rangeMax; +} + +void wxGaugeBase::SetValue(int pos) +{ + m_gaugePos = pos; +} + +int wxGaugeBase::GetValue() const +{ + return m_gaugePos; +} + +// ---------------------------------------------------------------------------- +// wxGauge appearance params +// ---------------------------------------------------------------------------- + +void wxGaugeBase::SetShadowWidth(int WXUNUSED(w)) +{ +} + +int wxGaugeBase::GetShadowWidth() const +{ + return 0; +} + + +void wxGaugeBase::SetBezelFace(int WXUNUSED(w)) +{ +} + +int wxGaugeBase::GetBezelFace() const +{ + return 0; +} + +#endif // wxUSE_GAUGE diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 1e70d44ab9..348cea4272 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -1295,3 +1295,5 @@ long wxExecute(const wxString& command, { return wxDoExecuteWithCapture(command, output, &error); } + + diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp new file mode 100644 index 0000000000..439e8987d2 --- /dev/null +++ b/src/generic/spinctlg.cpp @@ -0,0 +1,321 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: src/generic/spinctlg.cpp +// Purpose: implements wxSpinCtrl as a composite control +// Author: Vadim Zeitlin +// Modified by: +// Created: 29.01.01 +// RCS-ID: $Id$ +// Copyright: (c) 2001 Vadim Zeitlin +// License: wxWindows license +/////////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#ifdef __GNUG__ + #pragma implementation "spinctlg.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if !wxUSE_SPINBTN + #error "This file can only be compiled if wxSpinButton is available" +#endif // !wxUSE_SPINBTN + +#ifndef WX_PRECOMP + #include "wx/textctrl.h" +#endif //WX_PRECOMP + +#include "wx/spinbutt.h" +#include "wx/spinctrl.h" + +// ---------------------------------------------------------------------------- +// constants +// ---------------------------------------------------------------------------- + +// the margin between the text control and the spin +static const wxCoord MARGIN = 2; + +// ---------------------------------------------------------------------------- +// wxSpinCtrlText: text control used by spin control +// ---------------------------------------------------------------------------- + +class wxSpinCtrlText : public wxTextCtrl +{ +public: + wxSpinCtrlText(wxSpinCtrl *spin, const wxString& value) + : wxTextCtrl(spin->GetParent(), -1, value) + { + m_spin = spin; + } + +protected: + void OnTextChange(wxCommandEvent& event) + { + int val; + if ( m_spin->GetTextValue(&val) ) + { + m_spin->GetSpinButton()->SetValue(val); + } + + event.Skip(); + } + +private: + wxSpinCtrl *m_spin; + + DECLARE_EVENT_TABLE() +}; + +BEGIN_EVENT_TABLE(wxSpinCtrlText, wxTextCtrl) + EVT_TEXT(-1, wxSpinCtrlText::OnTextChange) +END_EVENT_TABLE() + +// ---------------------------------------------------------------------------- +// wxSpinCtrlButton: spin button used by spin control +// ---------------------------------------------------------------------------- + +class wxSpinCtrlButton : public wxSpinButton +{ +public: + wxSpinCtrlButton(wxSpinCtrl *spin, int style) + : wxSpinButton(spin->GetParent()) + { + m_spin = spin; + + SetWindowStyle(style); + } + +protected: + void OnSpinButton(wxSpinEvent& event) + { + m_spin->SetTextValue(event.GetPosition()); + + event.Skip(); + } + +private: + wxSpinCtrl *m_spin; + + DECLARE_EVENT_TABLE() +}; + +BEGIN_EVENT_TABLE(wxSpinCtrlButton, wxSpinButton) + EVT_SPIN(-1, wxSpinCtrlButton::OnSpinButton) +END_EVENT_TABLE() + +IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl) + +// ============================================================================ +// implementation +// ============================================================================ + +// ---------------------------------------------------------------------------- +// wxSpinCtrl creation +// ---------------------------------------------------------------------------- + +void wxSpinCtrl::Init() +{ + m_text = NULL; + m_btn = NULL; +} + +bool wxSpinCtrl::Create(wxWindow *parent, + wxWindowID id, + const wxString& value, + const wxPoint& pos, + const wxSize& size, + long style, + int min, + int max, + int initial, + const wxString& name) +{ + if ( !wxControl::Create(parent, id, pos, size, style, + wxDefaultValidator, name) ) + { + return FALSE; + } + + SetBackgroundColour(*wxRED); + + m_text = new wxSpinCtrlText(this, value); + m_btn = new wxSpinCtrlButton(this, style); + + m_btn->SetRange(min, max); + m_btn->SetValue(initial); + + DoSetSize(pos.x, pos.y, size.x, size.y); + + // have to disable this window to avoid interfering it with message + // processing to the text and the button... but pretend it is enabled to + // make IsEnabled() return TRUE + wxControl::Enable(FALSE); // don't use non virtual Disable() here! + m_isEnabled = TRUE; + + // we don't even need to show this window itself - and not doing it avoids + // that it overwrites the text control + wxControl::Show(FALSE); + m_isShown = TRUE; + + return TRUE; +} + +wxSpinCtrl::~wxSpinCtrl() +{ + // delete the controls now, don't leave them alive even though they woudl + // still be eventually deleted by our parent - but it will be too late, the + // user code expects them to be gone now + delete m_text; + delete m_btn; +} + +// ---------------------------------------------------------------------------- +// geometry +// ---------------------------------------------------------------------------- + +wxSize wxSpinCtrl::DoGetBestClientSize() const +{ + wxSize sizeBtn = m_btn->GetBestSize(), + sizeText = m_text->GetBestSize(); + + return wxSize(sizeBtn.x + sizeText.x + MARGIN, sizeText.y); +} + +void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height) +{ + wxControl::DoMoveWindow(x, y, width, height); + + // position the subcontrols inside the client area + wxSize sizeBtn = m_btn->GetSize(), + sizeText = m_text->GetSize(); + + wxCoord wText = width - sizeBtn.x; + m_text->SetSize(x, y, wText, height); + m_btn->SetSize(x + wText + MARGIN, y, -1, height); +} + +// ---------------------------------------------------------------------------- +// operations forwarded to the subcontrols +// ---------------------------------------------------------------------------- + +bool wxSpinCtrl::Enable(bool enable) +{ + if ( !wxControl::Enable(enable) ) + return FALSE; + + m_btn->Enable(enable); + m_text->Enable(enable); + + return TRUE; +} + +bool wxSpinCtrl::Show(bool show) +{ + if ( !wxControl::Show(show) ) + return FALSE; + + m_btn->Show(show); + m_text->Show(show); + + return TRUE; +} + +// ---------------------------------------------------------------------------- +// value and range access +// ---------------------------------------------------------------------------- + +bool wxSpinCtrl::GetTextValue(int *val) const +{ + long l; + if ( !m_text->GetValue().ToLong(&l) ) + { + // not a number at all + return FALSE; + } + + if ( l < GetMin() || l > GetMax() ) + { + // out of range + return FALSE; + } + + *val = l; + + return TRUE; +} + +int wxSpinCtrl::GetValue() const +{ + return m_btn ? m_btn->GetValue() : 0; +} + +int wxSpinCtrl::GetMin() const +{ + return m_btn ? m_btn->GetMin() : 0; +} + +int wxSpinCtrl::GetMax() const +{ + return m_btn ? m_btn->GetMax() : 0; +} + +// ---------------------------------------------------------------------------- +// changing value and range +// ---------------------------------------------------------------------------- + +void wxSpinCtrl::SetTextValue(int val) +{ + wxCHECK_RET( m_text, _T("invalid call to wxSpinCtrl::SetTextValue") ); + + m_text->SetValue(wxString::Format(_T("%d"), val)); + + // select all text + m_text->SetSelection(0, -1); + + // and give focus to the control! + m_text->SetFocus(); +} + +void wxSpinCtrl::SetValue(int val) +{ + wxCHECK_RET( m_btn, _T("invalid call to wxSpinCtrl::SetValue") ); + + SetTextValue(val); + + m_btn->SetValue(val); +} + +void wxSpinCtrl::SetValue(const wxString& text) +{ + wxCHECK_RET( m_text, _T("invalid call to wxSpinCtrl::SetValue") ); + + long val; + if ( text.ToLong(&val) && ((val > INT_MIN) && (val < INT_MAX)) ) + { + SetValue((int)val); + } + else // not a number at all or out of range + { + m_text->SetValue(text); + m_text->SetSelection(0, -1); + } +} + +void wxSpinCtrl::SetRange(int min, int max) +{ + wxCHECK_RET( m_btn, _T("invalid call to wxSpinCtrl::SetRange") ); + + m_btn->SetRange(min, max); +} + diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 7586cd9aae..ac4e48776d 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -24,7 +24,7 @@ // Watcom C++ gives a linker error if this is compiled in. // With Borland C++, all samples crash if this is compiled in. -#if !defined(__WATCOMC__) && !(defined(__BORLANDC__) && (__BORLANDC__ < 0x520)) && !defined(__CYGWIN10__) +#if wxUSE_OLE &&!defined(__WATCOMC__) && !(defined(__BORLANDC__) && (__BORLANDC__ < 0x520)) && !defined(__CYGWIN10__) #include "wx/log.h" #include "wx/msw/ole/automtn.h" diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index 9af22753cf..a6df1e1768 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -28,8 +28,6 @@ #pragma hdrstop #endif -#if defined(__WIN32__) && !defined(__GNUWIN32_OLD__) - #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" @@ -37,6 +35,8 @@ #include "wx/dataobj.h" +#if wxUSE_OLE && defined(__WIN32__) && !defined(__GNUWIN32_OLD__) + #include "wx/msw/private.h" // includes #if wxUSE_NORLANDER_HEADERS @@ -1186,5 +1186,27 @@ static const wxChar *GetTymedName(DWORD tymed) #endif // Debug -#endif // not using OLE at all +#else // not using OLE at all +// ---------------------------------------------------------------------------- +// wxDataObject +// ---------------------------------------------------------------------------- + +wxDataObject::wxDataObject() +{ +} + +wxDataObject::~wxDataObject() +{ +} + +void wxDataObject::SetAutoDelete() +{ +} + +const wxChar *wxDataObject::GetFormatName(wxDataFormat format) +{ + return NULL; +} + +#endif diff --git a/src/msw/ole/dropsrc.cpp b/src/msw/ole/dropsrc.cpp index 2439f0d542..9aa2b238c5 100644 --- a/src/msw/ole/dropsrc.cpp +++ b/src/msw/ole/dropsrc.cpp @@ -33,7 +33,7 @@ #include "wx/setup.h" -#if wxUSE_DRAG_AND_DROP +#if wxUSE_OLE && wxUSE_DRAG_AND_DROP #include "wx/log.h" #include "wx/dnd.h" diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index 57d4cb04e8..094ca925e4 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -30,7 +30,7 @@ #include "wx/setup.h" -#if wxUSE_DRAG_AND_DROP +#if wxUSE_OLE && wxUSE_DRAG_AND_DROP #include "wx/log.h" diff --git a/src/msw/ole/oleutils.cpp b/src/msw/ole/oleutils.cpp index 7649d712e2..2a23ca8085 100644 --- a/src/msw/ole/oleutils.cpp +++ b/src/msw/ole/oleutils.cpp @@ -31,6 +31,8 @@ #include "wx/setup.h" #include "wx/log.h" +#if wxUSE_OLE + #ifndef __CYGWIN10__ #include @@ -214,3 +216,6 @@ void wxLogRelease(const char *szInterface, ULONG cRef) #endif // __CYGWIN10__ +#endif + // wxUSE_OLE + diff --git a/src/msw/ole/uuid.cpp b/src/msw/ole/uuid.cpp index c23c4ca414..b00deaa7c0 100644 --- a/src/msw/ole/uuid.cpp +++ b/src/msw/ole/uuid.cpp @@ -26,7 +26,7 @@ #include "wx/setup.h" -#if wxUSE_DRAG_AND_DROP +#if wxUSE_OLE && wxUSE_DRAG_AND_DROP // standard headers #if wxCHECK_W32API_VERSION( 1, 0 ) diff --git a/src/univ/notebook.cpp b/src/univ/notebook.cpp index cb24dadee1..d359b2e455 100644 --- a/src/univ/notebook.cpp +++ b/src/univ/notebook.cpp @@ -48,6 +48,9 @@ static const size_t INVALID_PAGE = (size_t)-1; +DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED) +DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) + // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp index 98b53bda8a..9d5bdc38c3 100644 --- a/src/univ/textctrl.cpp +++ b/src/univ/textctrl.cpp @@ -138,6 +138,7 @@ #endif #include "wx/clipbrd.h" + #include "wx/textfile.h" #include "wx/caret.h" diff --git a/src/wxvc_universal.dsp b/src/wxvc_universal.dsp index 09ae4bb9ec..7b354a443b 100644 --- a/src/wxvc_universal.dsp +++ b/src/wxvc_universal.dsp @@ -253,6 +253,10 @@ SOURCE=.\common\ftp.cpp # End Source File # Begin Source File +SOURCE=.\common\gaugecmn.cpp +# End Source File +# Begin Source File + SOURCE=.\common\gdicmn.cpp # End Source File # Begin Source File @@ -660,6 +664,10 @@ SOURCE=.\generic\scrolwin.cpp # End Source File # Begin Source File +SOURCE=.\generic\spinctlg.cpp +# End Source File +# Begin Source File + SOURCE=.\generic\splash.cpp # End Source File # Begin Source File @@ -1123,6 +1131,10 @@ SOURCE=.\univ\gauge.cpp # End Source File # Begin Source File +SOURCE=.\univ\themes\gtk.cpp +# End Source File +# Begin Source File + SOURCE=.\univ\inphand.cpp # End Source File # Begin Source File @@ -1195,6 +1207,10 @@ SOURCE=.\univ\theme.cpp # End Source File # Begin Source File +SOURCE=.\univ\themes\win32.cpp +# End Source File +# Begin Source File + SOURCE=.\univ\winuniv.cpp # End Source File # End Group -- 2.47.2