Source: wxwindows=V
Section: libs
Priority: optional
-Build-Depends: debhelper, flex, bison, libgtk1.2-dev, python-dev (>=1.5), zlib1g-dev, libjpeg62-dev, libpng2-dev, libtiff3g-dev, mesag-dev
+Build-Depends: debhelper, flex, bison, libgtk1.2-dev, python-dev (>=1.5.2), zlib1g-dev, libjpeg62-dev, libpng2-dev, libtiff3g-dev, mesag-dev
Maintainer: Ron Lee <ron@debian.org>
Standards-Version: 3.1.1
Package: libwxgtk=V-python
Architecture: any
Section: interpreters
-Depends: libwxgtk=V (= ${Source-Version}), python-base (>=1.5), ${shlibs:Depends}
+Depends: libwxgtk=V (= ${Source-Version}), python-base (>=1.5.2), ${shlibs:Depends}
Suggests: wxwin=V-doc
Description: wxWindows Cross-platform C++ GUI toolkit (Python binding)
wxWindows is a class library for C++ providing GUI (Graphical User
This package provides the common header files required to build applications
using the wxWindows toolkit.
+Package: wxwin=V-i18n
+Architecture: all
+Section: libs
+Conflicts: wxwin-i18n
+Replaces: wxwin-i18n
+Provides: wxwin-i18n
+Description: wxWindows Cross-platform C++ GUI toolkit (i18n support)
+ wxWindows is a class library for C++ providing GUI (Graphical User
+ Interface) and other facilities on more than one platform. Version =V
+ currently supports subsets of GTK+, Motif, and MS Windows.
+ .
+ This package provides the i18n message catalogs for wxWindows.
+
Package: wxwin=V-doc
Architecture: all
Section: doc
package_gtk_contrib=libwxgtk$(release)-contrib
package_gtk_contrib_dev=libwxgtk$(release)-contrib-dev
package_headers=wxwin$(release)-headers
+package_i18n=wxwin$(release)-i18n
package_doc=wxwin$(release)-doc
package_examples=wxwin$(release)-examples
objdir_doc_cruft=objs_doc_con
objdir_doc=docs/wxWindows-manual.html
objdir_examples=docs/examples
+objdir_i18n=locale
objdirs=$(objdir_wxbase_shared) $(objdir_wxbase_static) $(objdir_wxbase_debug) \
$(objdir_gtk_shared) $(objdir_gtk_static) $(objdir_gtk_debug) \
$(objdir_doc) $(objdir_examples)
build-wxbase-debug-stamp build-gtk-shared-stamp \
build-gtk-static-stamp build-gtk-debug-stamp \
build-contrib-shared-stamp build-contrib-static-stamp \
- build-gtk-python-stamp build-examples-stamp build-doc-stamp
+ build-gtk-python-stamp build-examples-stamp build-doc-stamp \
+ build-i18n-stamp
install_all=install-wxbase-lib install-wxbase-dev install-wxbase-dbg \
install-gtk-lib install-gtk-dev install-gtk-dbg \
install-gtk-contrib install-gtk-contrib-dev install-gtk-py \
- install-headers install-doc install-examples
+ install-headers install-i18n install-doc install-examples
wxconfig:=$(shell pwd)/$(objdir_gtk_shared)/wx-config \
--prefix=$(shell pwd) \
echo "generating control file $(package_headers).$$f"; \
cp debian/wxwin-headers.$$f debian/$(package_headers).$$f; \
done;
+ @for f in dirs docs files; do \
+ echo "generating control file $(package_i18n).$$f"; \
+ cp debian/wxwin-i18n.$$f debian/$(package_i18n).$$f; \
+ done;
@for f in dirs docs doc-base; do \
echo "generating control file $(package_doc).$$f"; \
cp debian/wxwin-doc.$$f debian/$(package_doc).$$f; \
done;
touch $@
+build-i18n-stamp: build-gtk-shared-stamp
+ dh_testdir
+ cd $(objdir_i18n) \
+ && $(MAKE) allmo
+ touch $@
+
clean: debian/control
dh_testdir
dh_testroot
rm -f debian/$(package_gtk_contrib).*
rm -f debian/$(package_gtk_contrib_dev).*
rm -f debian/$(package_headers).*
+ rm -f debian/$(package_i18n).*
rm -f debian/$(package_doc).*
rm -f debian/$(package_examples).*
zlib.3 \
png.5
+install-i18n: DH_OPTIONS=-p$(package_i18n)
+install-i18n: build-i18n-stamp install-gtk-lib
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+ dh_movefiles --sourcedir=debian/$(package_gtk_lib)
+
install-doc: DH_OPTIONS=-p$(package_doc)
install-doc: build-doc-stamp
dh_testdir
binary-wxbase-dbg binary-doc install install-wxbase-lib \
install-wxbase-dev install-wxbase-dbg install-gtk-lib install-gtk-dev \
install-gtk-dbg install-gtk-contrib install-gtk-contrib-dev \
- install-gtk-py install-headers install-doc install-examples
+ install-gtk-py install-headers install-i18n install-doc install-examples
--- /dev/null
+/usr/share/locale
+
--- /dev/null
+docs/licence.txt
+
--- /dev/null
+/usr/share/locale/
+
--- /dev/null
+@echo off
+rem Expands wildcards in response file (arg 1) into output file (arg 2)
+rem Note: requires ls.exe from GNU-WIN32 distribution, renamed to ls2.exe.
+rem Correction: this is too slow, so we're using the built in 'dir'.
+
+set newname=%temp\temp.tmp
+sed -e "s/\//\\/g" %1 > %newname
+
+set len=%@LINES[%newname]
+rem set len=%@DEC[%len]
+do i = 0 to %len by 1
+ set line=%@LINE[%newname,%i]
+ if NOT "%line" == "" dir /FB %line >> %2
+enddo
+
--- /dev/null
+@echo off
+Rem Replace a string with another string in the given files.
+Rem The first argument is the string to be replaced.
+Rem The second argument is the replacement string.
+Rem The third argument is a file listing the files to be processed.
+
+set keyword=%1
+set repl=%2
+set files=%3
+echo s/%keyword/%repl/g > script.tmp
+
+call %wxwin\distrib\msw\expdwild.bat %3 list.tmp
+
+set len=%@LINES[%files]
+do i = 0 to %len by 1
+ set line=%@LINE[list.tmp,%i]
+ if "%line" == "**EOF**" enddo
+rem echo Cmd: grep %keyword %line
+ grep %keyword %line > size.tmp
+ if "%@FILESIZE[size.tmp]" == "0" enddo
+ sed -f script.tmp %line > file.tmp
+ move file.tmp %line
+enddo
+erase script.tmp
+erase list.tmp
+erase size.tmp
+:end
splitter.cpp G
statline.cpp G U,R,P
statusbr.cpp G
-tabg.cpp G P
+tabg.cpp G 16,P
numdlgg.cpp G
tbarsmpl.cpp G
textdlgg.cpp G
DUMMYOBJ=$D\dummy.obj
!endif
-# Please set these according to the settings in setup.h, so we can include
-# the appropriate libraries in wx.lib
-
# This one overrides the others, to be consistent with the settings in setup.h
MINIMAL_WXWINDOWS_SETUP=0
PERIPH_TARGET=
PERIPH_CLEAN_TARGET=
+# Set to 0 if not using GLCanvas (only affects DLL build)
+USE_GLCANVAS=1
+
# These are absolute paths, so that the compiler
# generates correct __FILE__ symbols for debugging.
# Otherwise you don't be able to double-click on a memory
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MT" /YX /FD /c
-# ADD CPP /nologo /MT /W4 /Zi /O2 /I "$(wx)\include" /I "$(wx)\src\zlib" /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 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 BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" -D "_MT" /YX /FD /c
-# ADD CPP /nologo /MTd /W4 /Zi /Od /I "$(wx)\include" /I "$(wx)\src\zlib" /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 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 BASE RSC /l 0x409
# ADD RSC /l 0x409
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 /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib advapi32.lib wsock32.lib /nologo /version:2.2 /dll /machine:I386
+# 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 /nologo /dll /machine:I386 /out:"BaseDllRelease/wxbase221.dll"
+# ADD LINK32 kernel32.lib user32.lib advapi32.lib wsock32.lib /nologo /version:2.2 /dll /machine:I386 /out:"BaseDllRelease/wxbase221.dll"
!ELSEIF "$(CFG)" == "wxBaseDll - Win32 Debug"
# PROP Intermediate_Dir "BaseDllDebug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXBASEDLL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W4 /Gm /ZI /Od /I "$(wx)\include" /I "$(wx)\src\zlib" /D "_DEBUG" /D wxUSE_GUI=0 /D "__WIN95__" /D "WIN32" /D "_WIN32" /D WINVER=0x400 /D "__WINDOWS__" /D "__WIN32__" /D "__WXMSW__" /D "_MT" /D "WXMAKINGDLL" /D "__WXDEBUG__" /Yu"wx/wxprec.h" /FD /GZ /c
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXBASEDLL_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W4 /Gm /Zi /Od /I "$(wx)\include" /I "$(wx)\src\zlib" /D "_DEBUG" /D wxUSE_GUI=0 /D "__WIN95__" /D "WIN32" /D "_WIN32" /D WINVER=0x400 /D "__WINDOWS__" /D "__WIN32__" /D "__WXMSW__" /D "_MT" /D "WXMAKINGDLL" /D "__WXDEBUG__" /Yu"wx/wxprec.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# 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 /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib advapi32.lib wsock32.lib /nologo /version:2.2 /dll /debug /machine:I386 /pdbtype:sept
+# 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 /nologo /dll /debug /machine:I386 /pdbtype:sept /out:"BaseDllDebug/wxbase221d.dll"
+# ADD LINK32 kernel32.lib user32.lib advapi32.lib wsock32.lib /nologo /version:2.2 /dll /debug /machine:I386 /pdbtype:sept /out:"BaseDllDebug/wxbase221d.dll"
!ENDIF
# Name "wxBaseDll - Win32 Debug"
# Begin Source File
+SOURCE=.\src\common\base.rc
+# End Source File
+# Begin Source File
+
SOURCE=.\src\msw\dummydll.cpp
# ADD CPP /Yc"wx/wxprec.h"
# End Source File
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W4 /GX /O2 /I "$(wx)\include" /I "$(wx)\src\zlib" /D "NDEBUG" /D wxUSE_GUI=1 /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /D "__WXMSW__" /D "__WIN95__" /D "__WINDOWS__" /D "__WIN32__" /D "WXMAKINGDLL" /Yu"wx/wxprec.h" /FD /c
+# ADD CPP /nologo /MD /W4 /GX /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 "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /D "__WXMSW__" /D "__WIN95__" /D "__WINDOWS__" /D "__WIN32__" /D "WXMAKINGDLL" /Yu"wx/wxprec.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /i "$(wx)\include" /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 winmm.lib src\png\Release\png.lib src\xpm\Release\xpm.lib src\zlib\Release\zlib.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib uuid.lib rpcrt4.lib comctl32.lib winmm.lib src\png\Release\png.lib src\xpm\Release\xpm.lib src\zlib\Release\zlib.lib /nologo /dll /machine:I386
+# 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 winmm.lib src\jpeg\Release\jpeg.lib src\tiff\Release\tiff.lib src\png\Release\png.lib src\xpm\Release\xpm.lib src\zlib\Release\zlib.lib /nologo /dll /machine:I386 /out:"ReleaseDll/wxmsw221.dll"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib uuid.lib rpcrt4.lib comctl32.lib wsock32.lib winmm.lib src\jpeg\Release\jpeg.lib src\tiff\Release\tiff.lib src\png\Release\png.lib src\xpm\Release\xpm.lib src\zlib\Release\zlib.lib /nologo /dll /machine:I386 /out:"ReleaseDll/wxmsw221.dll"
!ELSEIF "$(CFG)" == "wxWinDll - Win32 Debug"
# PROP Intermediate_Dir "DebugDLL"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W4 /Gm /ZI /Od /I "$(wx)\include" /I "$(wx)\src\zlib" /D "_DEBUG" /D "__WXDEBUG__" /D wxUSE_GUI=1 /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /D "__WXMSW__" /D "__WIN95__" /D "__WINDOWS__" /D "__WIN32__" /D "WXMAKINGDLL" /Yu"wx/wxprec.h" /FD /GZ /c
+# ADD BASE CPP /nologo /MDd /W4 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W4 /Gm /Zi /Od /I "$(wx)\include" /I "$(wx)\src\zlib" /I "$(wx)\src\jpeg" /I "$(wx)\src\png" /I "$(wx)\src\tiff" /D "_DEBUG" /D "__WXDEBUG__" /D wxUSE_GUI=1 /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /D "__WXMSW__" /D "__WIN95__" /D "__WINDOWS__" /D "__WIN32__" /D "WXMAKINGDLL" /Yu"wx/wxprec.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /i "$(wx)\include" /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 winmm.lib src\png\Debug\png.lib src\xpm\Debug\xpm.lib src\zlib\Debug\zlib.lib /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib uuid.lib rpcrt4.lib comctl32.lib wsock32.lib winmm.lib src\png\Debug\png.lib src\xpm\Debug\xpm.lib src\zlib\Debug\zlib.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# 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 winmm.lib src\jpeg\Debug\jpeg.lib src\tiff\Debug\tiff.lib src\png\Debug\png.lib src\xpm\Debug\xpm.lib src\zlib\Debug\zlib.lib /dll /debug /machine:I386 /pdbtype:sept /out:"DebugDll/wxmsw221d.dll"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib uuid.lib rpcrt4.lib comctl32.lib wsock32.lib winmm.lib src\jpeg\Debug\jpeg.lib src\tiff\Debug\tiff.lib src\png\Debug\png.lib src\xpm\Debug\xpm.lib src\zlib\Debug\zlib.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /out:"DebugDll/wxmsw221d.dll"
!ENDIF
# Begin Source File
+SOURCE=.\src\msw\version.rc
+# End Source File
+# Begin Source File
+
SOURCE=.\src\common\y_tab.c
!IF "$(CFG)" == "wxWinDll - Win32 Release"
+# ADD CPP /W1
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "wxWinDll - Win32 Debug"
if ( Config("wx") ) {
#! VC 6.0 supports env vars in include path
#! $WXDIR = $ENV{'WX'};
- $WXDIR = "\$(WX)";
+ if ( $ENV{'wx'} ) { $WXDIR = "\$(wx)"; }
+ else { $WXDIR = "\$(WXWIN)"; }
$TMAKE_INCDIR_WX = $WXDIR . "\\include";
AddIncludePath($TMAKE_INCDIR_WX);
}
if ( Config("dll") ) {
$DLL="Dll";
- $DLL_OR_LIB="wxWinDll";
+ $DLL_SUFFIX="d";
+ $DLL_OR_LIB=(Config("wxbase") ? "wxbase" : "wxmsw") . "221";
$DLL_FLAGS="/D WXUSINGDLL ";
+ $EXTRA_LIBS="";
}
else {
$DLL="";
+ $DLL_SUFFIX="";
$DLL_OR_LIB="wxWindows";
$DLL_FLAGS=" ";
+ #! actually this depends on the contents of setup.h
+ $EXTRA_LIBS=Config("wxbase") ? "" : "xpm zlib png jpeg tiff";
}
#! let's be smarter: first of all, if no extension is given, add .lib
if ( Config("wx") ) {
$vc_base_libs .= "comctl32.lib rpcrt4.lib wsock32.lib ";
- $vc_link_release = "$WXDIR\\Release$DLL\\$DLL_OR_LIB.lib $WXDIR\\src\\xpm\\Release\\xpm.lib ";
- $vc_link_debug = "$WXDIR\\Debug$DLL\\$DLL_OR_LIB.lib $WXDIR\\src\\xpm\\Debug\\xpm.lib ";
+ $vc_link_release = "$WXDIR\\Release$DLL\\$DLL_OR_LIB.lib ";
+ $vc_link_debug = "$WXDIR\\Debug$DLL\\$DLL_OR_LIB$DLL_SUFFIX.lib ";
+ foreach ( split(/ /, $EXTRA_LIBS) ) {
+ $vc_link_release .= "$WXDIR\\src\\$_\\Release\\$_.lib ";
+ $vc_link_debug .= "$WXDIR\\src\\$_\\Debug\\$_.lib ";
+ }
}
$vc_link_release .= '/nologo /subsystem:windows /machine:I386';
$vc_link_debug .= '/nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept';
+ foreach ( split(/ /, Project('LIBPATH')) ) {
+ $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_debug = '/D "_DEBUG" ' . $vc_cpp_def_common;
$vc_base_libs = 'kernel32.lib user32.lib advapi32.lib ';
if ( Config("wx") ) {
$vc_base_libs .= 'wsock32.lib ';
- $vc_link_release = "$WXDIR\\Base${DLL}Release\\wxBase$DLL.lib ";
- $vc_link_debug = "$WXDIR\\Base${DLL}Debug\\wxBase$DLL.lib ";
+ $vc_link_release = "$WXDIR\\Base${DLL}Release\\$DLL_OR_LIB.lib ";
+ $vc_link_debug = "$WXDIR\\Base${DLL}Debug\\$DLL_OR_LIB" . "d.lib ";
}
$vc_link_release .= '/nologo /subsystem:console /machine:I386';
$vc_link_debug .= '/nologo /subsystem:console /debug /machine:I386 /pdbtype:sept';
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Output_Dir "Release#$ $text = "$DLL" . '"'
+# PROP BASE Intermediate_Dir "Release#$ $text = "$DLL" . '"'
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir "Release#$ $text = "$DLL" . '"'
+# PROP Intermediate_Dir "Release#$ $text = "$DLL" . '"'
#$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
# PROP Target_Dir ""
# ADD BASE CPP #$ Expand("VC_BASE_CPP_RELEASE");
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Output_Dir "Debug#$ $text = "$DLL" . '"'
+# PROP BASE Intermediate_Dir "Debug#$ $text = "$DLL" . '"'
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
+# PROP Output_Dir "Debug#$ $text = "$DLL" . '"'
+# PROP Intermediate_Dir "Debug#$ $text = "$DLL" . '"'
#$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
# PROP Target_Dir ""
# ADD BASE CPP #$ Expand("VC_BASE_CPP_DEBUG");
--- /dev/null
+@echo off
+Rem Replace the DLL version number in the VC++ project files
+
+input Enter the old version name (e.g. wx22_0): %%oldName
+input Enter the new version name (e.g. wx22_1): %%newName
+
+call %wxwin\distrib\msw\filerepl.bat %oldName %newName %wxwin\distrib\msw\vc.rsp
+echo Done.
+
-10th July 2000: wxWindows 2.2 released
+
+22nd July 2000: wxWindows 2.2.1 released
+
+Minor build fixes.
+
+Corrected guffow-scrolling so that no surplus expose
+events are generated.
+
+Corrected bug in wxMask creation on 16-bit displays.
+
+Minor correction to wxDC::DrawRoundedRectangle.
+
+Added support for <INSERT> and <DELETE> menu accelerators.
+
+Use the wxCommmandEvent::IsChecked() function for checkable
+menu items.
+
+Made wxComboBox case-sensitive.
+
+Minor correction to doc-view architecture.
+
+10th July 2000: wxWindows 2.2.0 released
Added code for writing BMP images.
</tr>
</table>
+<H3>July 28th, 2000</H3><P>
+
+<ul>
+<li>Vaclav Slavik has recently written an
+<a href="http://www.root.cz/clanek.phtml?id=425" target=_top>article about wxWindows</a> for a Czech ezine.
+<li>Hurray! There is a lot of traffic on the wxStudio mailing list, and
+Gerd Mueller has offered to make the <a href="http://www.softwarebuero.de" target=_top>WipeOut</a> IDE
+open source and merge it with wxStudio.
+</ul>
+
<H3><a name="release2_2_0">July 9th, 2000</H3><P>
<ul>
<tr>
<td bgcolor="#F0F0F0" align=center valign=center rowspan=2>AIX</td>
<td>wxGTK with AIX CC</td><td align=center><IMG SRC="icons/no.gif" ALT=Unknown></td><td><br></td><td><br></td>
-<tr> <td>wxMotif with AIX CC</td><td align=center><IMG SRC="icons/no.gif" ALT=Unknown></td><td><br></td><td><br></td>
+<tr> <td>wxMotif with xlC (AIX 4.2)</td><td align=center><IMG SRC="icons/yes.gif" ALT=Ok></td>
+ <td>Bernhard Eck</td>
+ <td>Some problems with OpenGL and native X server</td>
</tr>
<tr>
\twocolitem{{\bf EVT\_TEXT(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_UPDATED command,
which is generated by a wxTextCtrl control.}
\twocolitem{{\bf EVT\_TEXT\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_ENTER command,
-which is generated by a wxTextCtrl control.}
+which is generated by a wxTextCtrl control. Note that you must use
+wxTE\_PROCESS\_ENTER flag when creating the control if you want it to generate
+such events.}
\twocolitem{{\bf EVT\_MENU(id, func)}}{Process a wxEVT\_COMMAND\_MENU\_SELECTED command,
which is generated by a menu item.}
\twocolitem{{\bf EVT\_MENU\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_MENU\_RANGE command,
\membersection{wxCommandEvent::Checked}
-\func{bool}{Checked}{\void}
+\constfunc{bool}{Checked}{\void}
-Returns TRUE or FALSE for a checkbox selection event.
+Deprecated, use \helpref{IsChecked}{wxcommandeventischecked} instead.
\membersection{wxCommandEvent::GetClientData}
\func{void*}{GetClientData}{\void}
Returns client data pointer for a listbox or choice selection event
-(not valid for a deselection). Beware, this is not implmented anywhere...
+(not valid for a deselection).
\membersection{wxCommandEvent::GetExtraLong}
Returns item string for a listbox or choice selection event (not valid for
a deselection).
+\membersection{wxCommandEvent::IsChecked}\label{wxcommandeventischecked}
+
+\constfunc{bool}{IsChecked}{\void}
+
+This method can be used with checkbox and menu events: for the checkboxes, the
+method returns {\tt TRUE} for a selection event and {\tt FALSE} for a
+deselection one. For the menu events, this method indicates if the menu item
+just has become checked or unchecked (and thus only makes sense for checkable
+menu items).
+
\membersection{wxCommandEvent::IsSelection}
\func{bool}{IsSelection}{\void}
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxCB\_SIMPLE}}{Creates a combobox with a permanently displayed list. Windows only. }
\twocolitem{\windowstyle{wxCB\_DROPDOWN}}{Creates a combobox with a drop-down list.}
-\twocolitem{\windowstyle{wxCB\_READONLY}}{Creates a combo box consisting of a drop-down list and static text item
-displaying the current selection.}
+\twocolitem{\windowstyle{wxCB\_READONLY}}{Same as wxCB\_DROPDOWN but only the
+strings specified as the combobox choices can be selected, it is impossible to
+select (even from a program) a string which is not in the choices list.}
\twocolitem{\windowstyle{wxCB\_SORT}}{Sorts the entries in the list alphabetically.}
\end{twocollist}
Sets the text for the combobox text field.
+{\bf NB:} For a combobox with {\tt wxCB\_READONLY} style the string must be in
+the combobox choices list, otherwise the call to SetValue() is ignored.
+
\wxheading{Parameters}
\docparam{text}{The text to set.}
Every database object represents an ODBC connection.
The connection may be closed and reopened.
-Note: this class is considered obsolete, replaced by the Remstar wxDB/wxTable classes
-(documented separately in Word and PDF format, as odbc.doc and odbc.pdf).
-
\wxheading{Derived from}
\helpref{wxObject}{wxobject}
Commits previous transactions. Not implemented.
-\membersection{wxDatabase::ErrorOccurred}
+\membersection{wxDatabase::ErrorOccured}
-\func{bool}{ErrorOccurred}{\void}
+\func{bool}{ErrorOccured}{\void}
Returns TRUE if the last action caused an error.
\func{void}{ErrorSnapshot}{\param{HSTMT}{ statement = SQL\_NULL\_HSTMT}}
-This function will be called whenever an ODBC error occurred. It stores the
+This function will be called whenever an ODBC error occured. It stores the
error related information returned by ODBC. If a statement handle of the
concerning ODBC action is available it should be passed to the function.
-\section{\class{wxDB}}\label{wxdb}
+\section{\class{wxDb}}\label{wxdb}
-A wxDB instance is a connection to an ODBC data source which may
+A wxDb instance is a connection to an ODBC data source which may
be opened, closed, and re-opened an unlimited number of times. A
database connection allows function to be performed directly on the
data source, as well as allowing access to any tables/views defined in
<wx/isqlext.h>
<wx/db.h>
+\latexignore{\rtfignore{\wxheading{Members}}}
+\wxheading{Enumerated types}
+
+\label{wxdbenumsqllogstate}\docparam{enum {\bf wxDbSqlLogState}}{sqlLogOFF, sqlLogON}
+
+{\it enum {\bf wxDBMS}}
+
+These are the databases currently tested and working with these ODBC classes.
+A call to \helpref{wxDb::Dbms}{wxdbdbms} will return one of these enumerated values listed below.
+
+\begin{verbatim}
+ dbmsUNIDENTIFIED,
+ dbmsORACLE,
+ dbmsSYBASE_ASA, // Adaptive Server Anywhere
+ dbmsSYBASE_ASE, // Adaptive Server Enterprise
+ dbmsMS_SQL_SERVER,
+ dbmsMY_SQL,
+ dbmsPOSTGRES,
+ dbmsACCESS,
+ dbmsDBASE,
+ dbmsINFORMIX
+\end{verbatim}
+
+See the remarks in \helpref{wxDb::Dbms}{wxdbdbms} for exceptions/issues with
+each of these database engines.
+
+
+\wxheading{Public member variables}
+
+\docparam{SWORD {\bf wxDb::cbErrorMsg}}{This member variable is populated as a result of
+calling \helpref{wxDb::GetNextError}{wxdbgetnexterror}. Contains the count of bytes in the wxDb::errorMsg string.}
+
+\label{wxdbdbstatus}\docparam{int {\bf wxDb::DB_STATUS}}{The last ODBC error that occured on this data connection. Possible codes are:}
+
+\begin{verbatim}
+ DB_ERR_GENERAL_WARNING // SqlState = '01000'
+ DB_ERR_DISCONNECT_ERROR // SqlState = '01002'
+ DB_ERR_DATA_TRUNCATED // SqlState = '01004'
+ DB_ERR_PRIV_NOT_REVOKED // SqlState = '01006'
+ DB_ERR_INVALID_CONN_STR_ATTR // SqlState = '01S00'
+ DB_ERR_ERROR_IN_ROW // SqlState = '01S01'
+ DB_ERR_OPTION_VALUE_CHANGED // SqlState = '01S02'
+ DB_ERR_NO_ROWS_UPD_OR_DEL // SqlState = '01S03'
+ DB_ERR_MULTI_ROWS_UPD_OR_DEL // SqlState = '01S04'
+ DB_ERR_WRONG_NO_OF_PARAMS // SqlState = '07001'
+ DB_ERR_DATA_TYPE_ATTR_VIOL // SqlState = '07006'
+ DB_ERR_UNABLE_TO_CONNECT // SqlState = '08001'
+ DB_ERR_CONNECTION_IN_USE // SqlState = '08002'
+ DB_ERR_CONNECTION_NOT_OPEN // SqlState = '08003'
+ DB_ERR_REJECTED_CONNECTION // SqlState = '08004'
+ DB_ERR_CONN_FAIL_IN_TRANS // SqlState = '08007'
+ DB_ERR_COMM_LINK_FAILURE // SqlState = '08S01'
+ DB_ERR_INSERT_VALUE_LIST_MISMATCH // SqlState = '21S01'
+ DB_ERR_DERIVED_TABLE_MISMATCH // SqlState = '21S02'
+ DB_ERR_STRING_RIGHT_TRUNC // SqlState = '22001'
+ DB_ERR_NUMERIC_VALUE_OUT_OF_RNG // SqlState = '22003'
+ DB_ERR_ERROR_IN_ASSIGNMENT // SqlState = '22005'
+ DB_ERR_DATETIME_FLD_OVERFLOW // SqlState = '22008'
+ DB_ERR_DIVIDE_BY_ZERO // SqlState = '22012'
+ DB_ERR_STR_DATA_LENGTH_MISMATCH // SqlState = '22026'
+ DB_ERR_INTEGRITY_CONSTRAINT_VIOL // SqlState = '23000'
+ DB_ERR_INVALID_CURSOR_STATE // SqlState = '24000'
+ DB_ERR_INVALID_TRANS_STATE // SqlState = '25000'
+ DB_ERR_INVALID_AUTH_SPEC // SqlState = '28000'
+ DB_ERR_INVALID_CURSOR_NAME // SqlState = '34000'
+ DB_ERR_SYNTAX_ERROR_OR_ACCESS_VIOL // SqlState = '37000'
+ DB_ERR_DUPLICATE_CURSOR_NAME // SqlState = '3C000'
+ DB_ERR_SERIALIZATION_FAILURE // SqlState = '40001'
+ DB_ERR_SYNTAX_ERROR_OR_ACCESS_VIOL2 // SqlState = '42000'
+ DB_ERR_OPERATION_ABORTED // SqlState = '70100'
+ DB_ERR_UNSUPPORTED_FUNCTION // SqlState = 'IM001'
+ DB_ERR_NO_DATA_SOURCE // SqlState = 'IM002'
+ DB_ERR_DRIVER_LOAD_ERROR // SqlState = 'IM003'
+ DB_ERR_SQLALLOCENV_FAILED // SqlState = 'IM004'
+ DB_ERR_SQLALLOCCONNECT_FAILED // SqlState = 'IM005'
+ DB_ERR_SQLSETCONNECTOPTION_FAILED // SqlState = 'IM006'
+ DB_ERR_NO_DATA_SOURCE_DLG_PROHIB // SqlState = 'IM007'
+ DB_ERR_DIALOG_FAILED // SqlState = 'IM008'
+ DB_ERR_UNABLE_TO_LOAD_TRANSLATION_DLL // SqlState = 'IM009'
+ DB_ERR_DATA_SOURCE_NAME_TOO_LONG // SqlState = 'IM010'
+ DB_ERR_DRIVER_NAME_TOO_LONG // SqlState = 'IM011'
+ DB_ERR_DRIVER_KEYWORD_SYNTAX_ERROR // SqlState = 'IM012'
+ DB_ERR_TRACE_FILE_ERROR // SqlState = 'IM013'
+ DB_ERR_TABLE_OR_VIEW_ALREADY_EXISTS // SqlState = 'S0001'
+ DB_ERR_TABLE_NOT_FOUND // SqlState = 'S0002'
+ DB_ERR_INDEX_ALREADY_EXISTS // SqlState = 'S0011'
+ DB_ERR_INDEX_NOT_FOUND // SqlState = 'S0012'
+ DB_ERR_COLUMN_ALREADY_EXISTS // SqlState = 'S0021'
+ DB_ERR_COLUMN_NOT_FOUND // SqlState = 'S0022'
+ DB_ERR_NO_DEFAULT_FOR_COLUMN // SqlState = 'S0023'
+ DB_ERR_GENERAL_ERROR // SqlState = 'S1000'
+ DB_ERR_MEMORY_ALLOCATION_FAILURE // SqlState = 'S1001'
+ DB_ERR_INVALID_COLUMN_NUMBER // SqlState = 'S1002'
+ DB_ERR_PROGRAM_TYPE_OUT_OF_RANGE // SqlState = 'S1003'
+ DB_ERR_SQL_DATA_TYPE_OUT_OF_RANGE // SqlState = 'S1004'
+ DB_ERR_OPERATION_CANCELLED // SqlState = 'S1008'
+ DB_ERR_INVALID_ARGUMENT_VALUE // SqlState = 'S1009'
+ DB_ERR_FUNCTION_SEQUENCE_ERROR // SqlState = 'S1010'
+ DB_ERR_OPERATION_INVALID_AT_THIS_TIME // SqlState = 'S1011'
+ DB_ERR_INVALID_TRANS_OPERATION_CODE // SqlState = 'S1012'
+ DB_ERR_NO_CURSOR_NAME_AVAIL // SqlState = 'S1015'
+ DB_ERR_INVALID_STR_OR_BUF_LEN // SqlState = 'S1090'
+ DB_ERR_DESCRIPTOR_TYPE_OUT_OF_RANGE // SqlState = 'S1091'
+ DB_ERR_OPTION_TYPE_OUT_OF_RANGE // SqlState = 'S1092'
+ DB_ERR_INVALID_PARAM_NO // SqlState = 'S1093'
+ DB_ERR_INVALID_SCALE_VALUE // SqlState = 'S1094'
+ DB_ERR_FUNCTION_TYPE_OUT_OF_RANGE // SqlState = 'S1095'
+ DB_ERR_INF_TYPE_OUT_OF_RANGE // SqlState = 'S1096'
+ DB_ERR_COLUMN_TYPE_OUT_OF_RANGE // SqlState = 'S1097'
+ DB_ERR_SCOPE_TYPE_OUT_OF_RANGE // SqlState = 'S1098'
+ DB_ERR_NULLABLE_TYPE_OUT_OF_RANGE // SqlState = 'S1099'
+ DB_ERR_UNIQUENESS_OPTION_TYPE_OUT_OF_RANGE // SqlState = 'S1100'
+ DB_ERR_ACCURACY_OPTION_TYPE_OUT_OF_RANGE // SqlState = 'S1101'
+ DB_ERR_DIRECTION_OPTION_OUT_OF_RANGE // SqlState = 'S1103'
+ DB_ERR_INVALID_PRECISION_VALUE // SqlState = 'S1104'
+ DB_ERR_INVALID_PARAM_TYPE // SqlState = 'S1105'
+ DB_ERR_FETCH_TYPE_OUT_OF_RANGE // SqlState = 'S1106'
+ DB_ERR_ROW_VALUE_OUT_OF_RANGE // SqlState = 'S1107'
+ DB_ERR_CONCURRENCY_OPTION_OUT_OF_RANGE // SqlState = 'S1108'
+ DB_ERR_INVALID_CURSOR_POSITION // SqlState = 'S1109'
+ DB_ERR_INVALID_DRIVER_COMPLETION // SqlState = 'S1110'
+ DB_ERR_INVALID_BOOKMARK_VALUE // SqlState = 'S1111'
+ DB_ERR_DRIVER_NOT_CAPABLE // SqlState = 'S1C00'
+ DB_ERR_TIMEOUT_EXPIRED // SqlState = 'S1T00'
+\end{verbatim}
+
+
+\docparam{struct {\bf wxDb::dbInf}}{This structure is internal to the wxDb class and contains
+details of the ODBC datasource that the current instance of the wxDb is connected to
+in its members. When the data source is opened, all of the information contained in
+the dbInf structure is queried from the data source. This information is used almost
+exclusively within the ODBC class library. Where there is a need for this information
+outside of the class library a member function such as wxTable::IsCursorClosedOnCommit()
+has been added for ease of use.}
+
+\begin{verbatim}
+ char dbmsName[40] - Name of the dbms product
+ char dbmsVer[64] - Version # of the dbms product
+ char driverName[40] - Driver name
+ char odbcVer[60] - ODBC version of the driver
+ char drvMgrOdbcVer[60] - ODBC version of the driver manager
+ char driverVer[60] - Driver version
+ char serverName[80] - Server Name, typically a connect string
+ char databaseName[128] - Database filename
+ char outerJoins[2] - Does datasource support outer joins
+ char procedureSupport[2] - Does datasource support stored procedures
+ UWORD maxConnections - Maximum # of connections datasource supports
+ UWORD maxStmts - Maximum # of HSTMTs per HDBC
+ UWORD apiConfLvl - ODBC API conformance level
+ UWORD cliConfLvl - Is datasource SAG compliant
+ UWORD sqlConfLvl - SQL conformance level
+ UWORD cursorCommitBehavior - How cursors are affected on db commit
+ UWORD cursorRollbackBehavior - How cursors are affected on db rollback
+ UWORD supportNotNullClause - Does datasource support NOT NULL clause
+ char supportIEF[2] - Integrity Enhancement Facility (Ref. Integrity)
+ UDWORD txnIsolation - Transaction isolation level supported by driver
+ UDWORD txnIsolationOptions - Transaction isolation level options available
+ UDWORD fetchDirections - Fetch directions supported
+ UDWORD lockTypes - Lock types supported in SQLSetPos
+ UDWORD posOperations - Position operations supported in SQLSetPos
+ UDWORD posStmts - Position statements supported
+ UDWORD scrollConcurrency - Scrollable cursor concurrency options supported
+ UDWORD scrollOptions - Scrollable cursor options supported
+ UDWORD staticSensitivity - Can additions/deletions/updates be detected
+ UWORD txnCapable - Indicates if datasource supports transactions
+ UDWORD loginTimeout - Number seconds to wait for a login request
+\end{verbatim}
+
+\docparam{char {\bf wxDb::errorList}[DB_MAX_ERROR_HISTORY][DB_MAX_ERROR_MSG_LEN]}{The last n ODBC errors that have occured on this database connection.}
+
+\docparam{char {\bf wxDb::errorMsg}[SQL_MAX_MESSAGE_LENGTH]}{This member variable is populated as a result of calling \helpref{wxDb::GetNextError}{wxdbgetnexterror}. It contains the ODBC error message text.}
+
+\docparam{SDWORD {\bf wxDb::nativeError}}{Set by wxDb::DispAllErrors, wxDb::GetNextError, and wxDb::DispNextError. It contains the datasource-specific error code returned by the datasource to the ODBC driver. Used for reporting ODBC errors.}
+
+\docparam{wxChar {\bf wxDb::sqlState}[20]}{Set by wxDb::TranslateSqlState(). Indicates the error state after a failed ODBC operation. Used for reporting ODBC errors.}
+
+\docparam{unsigned int {\bf nTables}}{Number of wxDbTable objects connected to this wxDb instance. {\bf FOR INTERNAL USE ONLY} by wxDbTable!!!}
+
+{\it wxDbSqlTypeInfo {\bf typeInfVarchar}}
+
+{\it wxDbSqlTypeInfo {\bf typeInfInteger}}
+
+{\it wxDbSqlTypeInfo {\bf typeInfFloat}}
+
+{\it wxDbSqlTypeInfo {\bf typeInfDate}}
+
+\begin{indented}{1cm}
+The four wxDbSqlTypeInfo member variables listed above contain information about logical data types VARCHAR, INTEGER, FLOAT and DATE.
+
+This information is obtained from the ODBC driver by use of the ::SQLGetTypeInfo() function. The key piece of information is the type name the datasource uses for each logical data type. e.g. VARCHAR; Oracle calls it VARCHAR2.
+\end{indented}
+
\wxheading{Remarks}
-By default, cursor directional scrolling is defined by wxODBC_FWD_ONLY_CURSORS
+Default cursor scrolling is defined by wxODBC_FWD_ONLY_CURSORS in setup.h
when the wxWindows library is built. This behavior can be overridden when
-an instance of a wxDB is created (see \helpref{wxDB constructor}{wxdbconstr}
+an instance of a wxDb is created (see \helpref{wxDb constructor}{wxdbconstr}
\wxheading{See also}
-\helpref{wxTable}{wxtable}
+\helpref{wxDbColFor}{wxdbcolfor}, \helpref{wxDbColInf}{wxdbcolinf}, \helpref{wxDbTable}{wxdbtable}, \helpref{wxDbTableInf}{wxdbtableinf}, \helpref{wxDbInf}{wxdbinf}
-\latexignore{\rtfignore{\wxheading{Members}}}
-\membersection{wxDB::wxDB}\label{wxdbconstr}
-\func{}{wxDB}{\void}
+\membersection{wxDb::wxDb}\label{wxdbconstr}
+
+\func{}{wxDb}{\void}
Default constructor.
-\func{}{wxDB}{\param{HENV\& }{aHenv}}
+\func{}{wxDb}{\param{HENV\& }{aHenv}}
Constructor, used to create an ODBC connection to a data source.
\wxheading{Remarks}
-This is the constructor for the wxDB class. The wxDB object must
+This is the constructor for the wxDb class. The wxDb object must
be created and opened before any database activity can occur.
\wxheading{Example}
\begin{verbatim}
- HENV Db;
- ....Set values for member variables here
+ wxDbConnectInf ConnectInf;
+ ....Set values for member variables of ConnectInf here
- wxDB sampleDB(Db.Henv);
- if (!sampleDB.Open(Db.Dsn, Db.Uid, Db.AuthStr))
+ wxDb sampleDB(ConnectInf.Henv);
+ if (!sampleDB.Open(ConnectInf.Dsn, ConnectInf.Uid, ConnectInf.AuthStr))
{
// Error opening data source
}
\end{verbatim}
-\membersection{wxDB::Catalog}
+\membersection{wxDb::Catalog}\label{wxdbcatalog}
\func{bool}{Catalog}{\param{char *}{ userID}, \param{char *}{fileName = SQL_CATALOG_FILENAME}}
+Allows a data "dictionary" of the data source to be created, dumping pertinent information about all data tables to which the user specified in userID has access.
+
\wxheading{Parameters}
\docparam{userID}{Database user name to use in accessing the database. All tables to which this user has rights will be evaluated in the catalog.}
\docparam{fileName}{OPTIONAL argument. Name of the text file to create and write the DB catalog to.}
-\wxheading{Remarks}
+\wxheading{Return value}
-Allows a data "dictionary" of the data source to be created, dumping pertinent information about all data tables to which the user specified in userID has access.
+Returns TRUE if the catalog request was successful, of FALSE if there was some reason the catalog could not be generated
\wxheading{Example}
\begin{verbatim}
\end{verbatim}
-\membersection{wxDB::Close}
+\membersection{wxDb::Close}\label{wxdbclose}
\func{void}{Close}{\void}
+Closes the database connection.
+
\wxheading{Remarks}
-At the end of your program, when you have finished all of your database work, you must close the ODBC connection to the data source. There are actually four steps involved in doing this as illustrated in the example.
+At the end of your program, when you have finished all of your database work, you must close the ODBC connection to the data source. There are actually four steps involved in doing this as illustrated in the example.
+
+Any wxTable instances which use this connection must be deleted before closing the database connection.
\wxheading{Example}
\begin{verbatim}
// Delete any remaining wxTable objects allocated with new
delete parts;
- // Close the wxDB connection when finished with it
+ // Close the wxDb connection when finished with it
sampleDB.Close();
// Free Environment Handle that ODBC uses
}
\end{verbatim}
+
+\membersection{wxDb::CommitTrans}\label{wxdbcommittrans}
+
+\func{bool}{CommitTrans}{\void}
+
+Permanently "commits" changes (insertions/deletions/updates) to the database.
+
+\wxheading{Return value}
+
+Returns TRUE if the commit was successful, or FALSE if the commit failed.
+
+\wxheading{Remarks}
+
+Transactions begin implicitly as soon as you make a change to the database. At any time thereafter, you can save your work to the database ("Commit") or roll back all of your changes ("Rollback"). Calling this member function commits all open transactions on this ODBC connection.
+
+\wxheading{Special Note : {\it Cursors} }
+
+\normalbox{It is important to understand that different database/ODBC driver combinations handle
+transactions differently. One thing in particular that you must pay attention to is
+cursors, in regard to transactions. Cursors are what allow you to scroll through
+records forward and backward and to manipulate records as you scroll through them.
+When you issue a query, a cursor is created behind the scenes. The cursor keeps track
+of the query and keeps track of the current record pointer. After you commit or
+rollback a transaction, the cursor may be closed automatically. This means you must
+requery the data source before you can perform any additional work against the wxTable
+object. This is only necessary however if the data source closes the cursor after a
+commit or rollback. Use the wxTable::IsCursorClosedOnCommit() member function to
+determine the data source's transaction behavior. Note, it would be very inefficient
+to just assume the data source closes the cursor and always requery. This could put
+a significant, unnecessary load on data sources that leave the cursors open after a
+transaction.}
+
+
+\membersection{wxDb::CreateView}\label{wxdbcreateviews}
+
+\func{bool}{CreateView}{\param{char *}{ viewName}, \param{char *}{ colList}, \param{char *}{pSqlStmt}}
+
+Creates a SQL VIEW.
+
+\wxheading{Parameters}
+
+\docparam{viewName}{The name of the view. e.g. PARTS_V}
+\docparam{colList}{{\it OPTIONAL} Pass in a comma delimited list of column names if you
+wish to explicitly name each column in the result set. If not desired, pass in an
+empty string.}
+\docparam{pSqlStmt}{Pointer to the select statement portion of the CREATE VIEW statement.
+Must be a complete, valid SQL SELECT statement.}
+
+\wxheading{Remarks}
+
+A 'view' is a logical table that derives columns from one or more other tables or views. Once the view is created, it can be queried exactly like any other table in the database.
+
+NOTE: Views are not available with all datasources. Oracle is one example of a datasouce which does support views.
+
+\wxheading{Example}
+\begin{verbatim}
+ // Incomplete code sample
+ db.CreateView("PARTS_SD1", "PN, PD, QTY",
+ "SELECT PART_NO, PART_DESC, QTY_ON_HAND * 1.1 FROM PARTS WHERE STORAGE_DEVICE = 1");
+
+ // PARTS_SD1 can now be queried just as if it were a data table.
+ // e.g. SELECT PN, PD, QTY FROM PARTS_SD1
+\end{verbatim}
+
+
+\membersection{wxDb::DispAllErrors}\label{wxdbdispallerrors}
+
+\func{bool}{DispAllErrors}{\param{HENV}{ aHenv}, {\param}{HDBC}{ aHdbc = SQL_NULL_HDBC}, {\param}{HSTMT}{ aHstmt = SQL_NULL_HSTMT}}
+
+Logs all database errors that occurred as a result of the last executed database command. This logging also includes debug logging when compiled in debug mode via \helpref{wxLogDebug}{wxlogdebug}. If logging is turned on via \helpref{wxDb::SetSqlLogging}{wxdbsetsqllogging}, then an entry is also logged to the defined log file.
+
+\wxheading{Parameters}
+
+\docparam{aHenv}{A handle to the ODBC environment.}
+\docparam{aHdbc}{A handle to the ODBC connection. Pass this in if the ODBC function call that
+erred out required a hdbc or hstmt argument.}
+\docparam{AHstmt}{A handle to the ODBC statement being executed against. Pass this in if the
+ODBC function call that erred out required a hstmt argument.}
+
+\wxheading{Remarks}
+
+This member function will display all of the ODBC error messages for the last ODBC function call that was made. Normally used internally within the ODBC class library. Would be used externally if calling ODBC functions directly (i.e. SQLFreeEnv()).
+
+\wxheading{See also}
+
+\helpref{wxDb::SetSqlLogging}{wxdbsetsqllogging}, \helpref{wxDbSqlLog}{wxdbsqllog}
+
+\wxheading{Example}
+\begin{verbatim}
+ if (SQLExecDirect(hstmt, (UCHAR FAR *) pSqlStmt, SQL_NTS) != SQL_SUCCESS)
+ // Display all ODBC errors for this stmt
+ return(db.DispAllErrors(db.henv, db.hdbc, hstmt));
+\end{verbatim}
+
+
+\membersection{wxDb::DispNextError}\label{wxdbdispnexterror}
+
+\func{void}{DispNextError}{\void}
+
+\wxheading{Remarks}
+
+This function is normally used internally within the ODBC class library.
+It could be used externally if calling ODBC functions directly. This
+function works in conjunction with \helpref{wxDb::GetNextError}{wxdbgetnexterror} when errors (or
+sometimes informational messages) returned from ODBC need to be analyzed
+rather than simply displaying them as an error. GetNextError() retrieves
+the next ODBC error from the ODBC error queue. The wxDb member variables
+"sqlState", "nativeError" and "errorMsg" could then be evaluated. To
+display the error retrieved, DispNextError() could then be called.
+The combination of GetNextError() and DispNextError() can be used to
+iteratively step through the errors returned from ODBC evaluating each
+one in context and displaying the ones you choose.
+
+\wxheading{Example}
+\begin{verbatim}
+ // Drop the table before attempting to create it
+ sprintf(sqlStmt, "DROP TABLE %s", tableName);
+ // Execute the drop table statement
+ if (SQLExecDirect(hstmt,(UCHAR FAR *)sqlStmt,SQL_NTS) != SQL_SUCCESS)
+ {
+ // Check for sqlState = S0002, "Table or view not found".
+ // Ignore this error, bomb out on any other error.
+ pDb->GetNextError(henv, hdbc, hstmt);
+ if (strcmp(pDb->sqlState, "S0002"))
+ {
+ pDb->DispNextError(); // Displayed error retrieved
+ pDb->DispAllErrors(henv, hdbc, hstmt); // Display all other errors, if any
+ pDb->RollbackTrans(); // Rollback the transaction
+ CloseCursor(); // Close the cursor
+ return(FALSE); // Return Failure
+ }
+ }
+\end{verbatim}
+
+
+\membersection{wxDb::DropView}\label{wxdbdropview}
+
+\func{bool}{DropView}{\param{const char *}{viewName}}
+
+Drops the data table view named in 'viewName'.
+
+\wxheading{Parameters}
+
+\docparam{viewName}{Name of the view to be dropped.}
+
+\wxheading{Remarks}
+
+If the view does not exist, this function will return TRUE. Note that views are not supported with all data soruces.
+
+
+\membersection{wxDb::ExecSql}\label{wxdbexecsql}
+
+\func{bool}{ExecSql}{\param{char *}{pSqlStmt}}
+
+Allows a native SQL command to be executed directly against the datasource. In addition to being able to run any standard SQL command, use of this function allows a user to (potentially) utilize features specific to the datasource they are connected to that may not be available through ODBC. The ODBC driver will pass the specified command directly to the datasource.
+
+\wxheading{Parameters}
+
+\docparam{pSqlStmt}{Pointer to the SQL statement to be executed.}
+
+\wxheading{Remarks}
+
+This member extends the wxDb class and allows you to build and execute ANY VALID
+SQL statement against the data source. This allows you to extend the class
+library by being able to issue any SQL statement that the data source is capable
+of processing.
+
+\wxheading{See also}
+
+\helpref{wxDb::GetData}{wxdbgetdata}, \helpref{wxDb::GetNext}{wxdbgetnext}
+
+
+\membersection{wxDb::FwdOnlyCursors}\label{wxdbfwdonlycursors}
+
+\func{bool}{FwdOnlyCursors}{\void}
+
+Indicates whether this connection to the datasource only allows forward scrolling cursors or not. This state is set at connection creation time.
+
+\wxheading{See also}
+
+\helpref{wxDb::wxDb}{wxdbconstruct}, \helpref{wxDbGetConnection}{wxdbgetconnection}
+
+
+\membersection{wxDb::GetCatalog}\label{wxdbgetcatalog}
+
+\func{wxDbInf *}{GetCatalog}{\param{char *}{userID}}
+
+Returns a wxDbInf pointer that points to the catalog(data source) name, schema, number of tables accessible to the current user, and a wxDbTableInf pointer to all data pertaining to all tables in the users catalog.
+
+\wxheading{Parameters}
+
+\docparam{userID}{Owner of the table. Specify a userID when the datasource you are connected
+to allows multiple unique tables with the same name to be owned by different users. {\it userID}
+is evaluated as follows:}
+
+\begin{verbatim}
+ userID == NULL ... UserID is ignored (DEFAULT)
+ userID == "" ... UserID set equal to 'this->uid'
+ userID != "" ... UserID set equal to 'userID'
+\end{verbatim}
+
+\wxheading{Remarks}
+
+The returned catalog will only contain catalog entries for tables to which the user specified in 'userID' has sufficient privileges. If no user is specified (NULL passed in), a catalog pertaining to all tables in the datasource accessible via this connection will be returned.
+
+
+\membersection{wxDb::GetColumnCount}\label{wxdbgetcolumncount}
+
+\func{int}{GetColumnCount}{\param{char *}{tableName}, \param{const char *}{userID}}
+
+\wxheading{Parameters}
+
+\docparam{tableName}{A table name you wish to obtain column information about.}
+\docparam{userID}{Name of the user that owns the table(s). Required for some datasources for
+situations where there may be multiple tables with the same name in the datasource, but owned
+by different users. {\it userID} is evaluated in the following manner:}
+
+\begin{verbatim}
+ userID == NULL ... UserID is ignored (DEFAULT)
+ userID == "" ... UserID set equal to 'this->uid'
+ userID != "" ... UserID set equal to 'userID'
+\end{verbatim}
+
+\wxheading{Return value}
+
+Returns a count of how many columns are in the specified table. If an error occurs retrieving the number of columns the function will return a -1.
+
+
+\membersection{wxDb::GetColumns}\label{wxdbgetcolumns}
+
+\func{wxDbColInf *}{GetColumns}{\param{char *}{tableName}, \param{int *}{numCols}, \param{const char *}{userID=NULL}}
+
+\func{wxDbColInf *}{GetColumns}{\param{char *}{tableName[]}, \param{const char *}{userID}}
+
+\wxheading{Parameters}
+
+\docparam{tableName}{A table name you wish to obtain column information about.}
+\docparam{tableName[]}{An array of pointers to table names you wish to obtain column information about.
+The last element of this array must be a NULL string.}
+\docparam{numCols}{A pointer to a integer which will hold a count of the number
+of columns returned by this function}
+\docparam{userID}{Name of the user that owns the table(s). Required for some datasources for
+situations where there may be multiple tables with the same name in the datasource, but owned
+by different users. {\it userID} is evaluated in the following manner:}
+
+\begin{verbatim}
+ userID == NULL ... UserID is ignored (DEFAULT)
+ userID == "" ... UserID set equal to 'this->uid'
+ userID != "" ... UserID set equal to 'userID'
+\end{verbatim}
+
+\wxheading{Return value}
+
+This function returns an array of wxDbColInf structures. This allows you to obtain
+information regarding the columns of your table(s). If no columns were found, or
+an error occured, this pointer will be zero (null).
+
+THE CALLING FUNCTION IS RESPONSIBLE FOR DELETING THE {\it wxDbColInf} MEMORY WHEN IT IS
+FINISHED WITH IT.
+
+\normalbox{ALL column bindings associated with this wxDb instance are unbound
+by this function. This function should use its own wxDb instance
+to avoid undesired unbinding of columns.}
+
+\wxheading{See also}
+
+\helpref{wxDbColInf}{wxdbcolinf}
+
+\wxheading{Example}
+\begin{verbatim}
+ char *tableList[] = {"PARTS", 0};
+ wxDbColInf *colInf = pDb->GetColumns(tableList);
+ if (colInf)
+ {
+ // Use the column inf
+ .......
+ // Destroy the memory
+ delete [] colInf;
+ }
+\end{verbatim}
+
+
+\membersection{wxDb::GetData}\label{wxdbgetdata}
+
+\func{bool}{GetData}{\param{UWORD}{ colNo}, \param{SWORD}{ cType}, \param{PTR}{ pData}, \param{SDWORD}{ maxLen}, \param{SDWORD FAR *}{ cbReturned} }
+
+Used to retrieve result set data without binding column values to memory variables (i.e. not using a wxDbTable instance to access table data).
+
+\wxheading{Parameters}
+
+\docparam{colNo}{Ordinal number of column in the result set to be returned.}
+\docparam{cType}{The C data type that is to be returned.}
+\docparam{pData}{Memory buffer which will hold the data returned by the call to this function.}
+\docparam{maxLen}{Maximum size of the buffer that will hold the returned value.}
+\docparam{cbReturned}{Pointer to the buffer containing the length of the actual data returned. If this value comes back as SQL_NULL_DATA, then the GetData() call has failed.}
+
+\wxheading{See also}
+
+\helpref{wxDb::GetNext}{wxdbgetnext}, \helpref{wxDb::ExecSql}{wxdbexecsql}
+
+\wxheading{Example}
+\begin{verbatim}
+ SDWORD cb;
+ ULONG reqQty;
+ wxString sqlStmt;
+ sqlStmt = "SELECT SUM(REQUIRED_QTY - PICKED_QTY) FROM ORDER_TABLE WHERE PART_RECID = 1450 AND REQUIRED_QTY > PICKED_QTY";
+
+ // Perform the query
+ if (!pDb->ExecSql(sqlStmt.c_str()))
+ {
+ // ERROR
+ return(0);
+ }
+
+ // Request the first row of the result set
+ if (!pDb->GetNext())
+ {
+ // ERROR
+ return(0);
+ }
+
+ Read column #1 of this row of the result set and store the value in 'reqQty'
+ if (!pDb->GetData(1, SQL_C_ULONG, &reqQty, 0, &cb))
+ {
+ // ERROR
+ return(0);
+ }
+
+ // Check for a NULL result
+ if (cb == SQL_NULL_DATA)
+ return(0);
+\end{verbatim}
+
+\wxheading{Remarks}
+
+When requesting multiple columns to be returned from the result set (for example, the SQL query
+requested 3 columns be returned), the calls to GetData must request the columns in ordinal
+sequence (1,2,3 or 1,3 or 2,3).
+
+
+\membersection{wxDb::GetDatabaseName}\label{wxdbgetdatabasename}
+
+\func{char *}{GetDatabaseName}{\void}
+
+Returns the name of the database engine.
+
+
+\membersection{wxDb::GetDataSource}\label{wxdbgetdatasource}
+
+\func{char *}{GetDataSource}{\void}
+
+Returns the ODBC datasource name.
+
+
+\membersection{wxDb::GetHDBC}\label{wxdbgethdbc}
+
+\func{HDBC}{GetHDBC}{\void}
+
+Returns the ODBC handle to the database connection.
+
+
+\membersection{wxDb::GetHENV}\label{wxdbgethenv}
+
+\func{HENV}{GetHENV}{\void}
+
+Returns the ODBC environment handle.
+
+
+\membersection{wxDb::GetHSTMT}\label{wxdbgethstmt}
+
+\func{HSTMT}{GetHSTMT}{\void}
+
+Returns the ODBC statement handle associated with this database connection.
+
+
+\membersection{wxDb::GetKeyFields}\label{wxdbgetkeyfields}
+
+\func{int}{GetKeyFields}{\param{char *}{tableName}, \param{wxDbColInf *}{colInf}, \param{int}{nocols}}
+
+Used to determine which columns are members of primary or non-primary indexes on the specified table. If a column is a member of a foreign key for some other table, that information is detected also.
+
+This function is primarily for use by the wxDb::GetColumns() function, but may be called if desired from the client application.
+
+\wxheading{Parameters}
+
+\docparam{tableName}{Name of the table for which the columns will be evaluated as to their inclusion in any indexes.}
+\docparam{colInf}{Data structure containing the column definitions (obtained with wxDb::GetColumns()). This function populates the PkCol, PkTableName, and FkTableName members of the colInf structure.}
+\docparam{nocols}{Number of columns defined in the instance of colInf.}
+
+\wxheading{Return value}
+
+Currently always returns TRUE.
+
+\wxheading{See also}
+
+\helpref{wxDbColInf}{wxdbcolinf}, \helpref{wxDb::GetColumns}{wxdbgetcolumns}
+
+
+\membersection{wxDb::GetNext}\label{wxdbgetnext}
+
+\func{HSTMT}{GetNext}{\void}
+
+Requests the next row in the result set obtained by issueing a query through a direct request using wxDb::ExecSql().
+
+\wxheading{See also}
+
+\helpref{wxDb::ExecSql}{wxdbexecsql}, \helpref{wxDb::GetData}{wxdbgetdata}
+
+
+\membersection{wxDb::GetNextError}\label{wxdbgetnexterror}
+
+\func{bool}{GetNextError}{\param{HENV}{ aHenv}, \param{HDBC}{ aHdbc = SQL_NULL_HDBC}, \param{HSTMT}{ aHstmt = SQL_NULL_HSTMT}}
+
+\wxheading{Parameters}
+
+\docparam{aHenv}{A handle to the ODBC environment.}
+\docparam{aHdbc}{A handle to the ODBC connection. Pass this in if the ODBC function call that
+erred out required a hdbc or hstmt argument.}
+\docparam{AHstmt}{A handle to the ODBC statement being executed against. Pass this in if the
+ODBC function call that erred out requires a hstmt argument.}
+
+\wxheading{See also}
+
+\helpref{wxDb::DispNextError}{wxdbdispnexterror}, \helpref{wxDb::DispAllErrors}{wxdbdispallerrors}
+
+\wxheading{Example}
+\begin{verbatim}
+ if (SQLExecDirect(hstmt, (UCHAR FAR *) pSqlStmt, SQL_NTS) != SQL_SUCCESS)
+ {
+ // Display all ODBC errors for this stmt
+ return(db.DispAllErrors(db.henv, db.hdbc, hstmt));
+ }
+\end{verbatim}
+
+
+\membersection{wxDb::GetPassword}\label{wxdbgetpassword}
+
+\func{char *}{GetPassword}{\void}
+
+Returns the password used to connect to the datasource.
+
+
+\membersection{wxDb::GetTableCount}\label{wxdbgettablecount}
+
+\func{int}{GetTableCount}{\void}
+
+Returns the number of wxDbTable() instances currently using this data source connection.
+
+
+\membersection{wxDb::GetUsername}\label{wxdbgetusername}
+
+\func{char *}{GetUsername}{\void}
+
+Returns the user name used to access the datasource.
+
+
+\membersection{wxDb::Grant}\label{wxdbgrant}
+
+\func{bool}{Grant}{\param{int}{ privileges}, \param{char *}{tableName}, \param{char *}{userList = "PUBLIC"}}
+
+Use this member function to GRANT privileges to users for accessing tables in the datasource.
+
+\wxheading{Parameters}
+
+\docparam{privileges}{Use this argument to select which privileges you want to grant. Pass
+ DB_GRANT_ALL to grant all privileges. To grant individual privileges pass
+ one or more of the following OR'd together:}
+\begin{verbatim}
+ DB_GRANT_SELECT = 1
+ DB_GRANT_INSERT = 2
+ DB_GRANT_UPDATE = 4
+ DB_GRANT_DELETE = 8
+ DB_GRANT_ALL = DB_GRANT_SELECT | DB_GRANT_INSERT |
+ DB_GRANT_UPDATE | DB_GRANT_DELETE
+\end{verbatim}
+\docparam{tableName}{The name of the table you wish to grant privileges on.}
+\docparam{userList}{A comma delimited list of users to grant the privileges to. If this argument is not
+passed in, the privileges will be given to the general PUBLIC.}
+
+\wxheading{Remarks}
+
+Some databases require user names to be specified in all capital letters (i.e. Oracle). This function does not automatically capitalize the user names passed in the comma-separated list. This is the responsibility of the calling routine.
+
+\wxheading{Example}
+\begin{verbatim}
+ db.Grant(DB_GRANT_SELECT | DB_GRANT_INSERT, "PARTS", "mary, sue");
+\end{verbatim}
+
+
+\membersection{wxDb::IsOpen}\label{wxdbisopen}
+
+\func{bool}{IsOpen}{\void}
+
+Indicates whether the database connection to the datasource is currently opened.
+
+
+\membersection{wxDb::Open}\label{wxdbopen}
+
+\func{bool}{Open}{\param{char *}{Dsn}, \param{char *}{Uid}, \param{char *}{AuthStr}}
+
+\wxheading{Parameters}
+
+\docparam{Dsn}{Data source name. The name of the ODBC data source as
+assigned when the data source is initially set up through the ODBC data
+source manager.}
+\docparam{Uid}{User ID. The name (ID) of the user you wish to connect as
+to the data source. The user name (ID) determines what objects you
+have access to in the datasource and what datasource privileges you have.
+Privileges include being able to create new objects, update objects, delete
+objects and so on. Users and privileges are normally administered by the
+database administrator.}
+\docparam{AuthStr}{The password associated witht the Uid.}
+
+\wxheading{Remarks}
+
+After a wxDb instance is created, it must then be opened. When opening a data source, there must be hree pieces of information passed. The data source name, user name (ID) and the password for the user. No database activity on the data source can be performed until it is opened. This would normally be done at program startup and the data source would remain open for the duration of the program run. Note: It is possible to have multiple data sources open at the same time to support distributed database connections.
+
+\wxheading{Example}
+\begin{verbatim}
+ wxDb sampleDB(Db.Henv);
+ if (!sampleDB.Open("Oracle 7.1 HP/UX", "gtasker", "myPassword"))
+ {
+ // Error opening data source
+ }
+\end{verbatim}
+
+
+\membersection{wxDb::RollbackTrans}\label{wxdbrollbacktrans}
+
+\func{bool}{RollbackTrans}{\void}
+
+Function to "rollback" changes made to the database. After an insert/update/delete, the operation may be "undone" by issuing this command any time before a \helpref{wxDb::CommitTrans}{wxdbcommittrans} is called on the database connection.
+
+\wxheading{Remarks}
+
+Transactions begin implicitly as soon as you make a change to the database. At any time thereafter, you can save your work to the database (using \helpref{wxDb::CommitTrans}{wxdbcommittrans}) or undo all of your changes using this function.
+
+\normalbox{Calling this member function rolls back ALL open (uncommitted) transactions on this ODBC connection.}
+
+\wxheading{See also}
+
+\helpref{wxDb::CommitTrans}{wxdbcommittrans} for a special note on cursors
+
+
+\membersection{wxDb::SetSqlLogging}\label{wxdbsetsqllogging}
+
+\func{bool}{SetSqlLogging}{\param{wxDbSqlLogState}{ state}, \param{const wxChar *}{filename = SQL_LOG_FILENAME}, \param{bool}{ append = FALSE}}
+
+\wxheading{Parameters}
+
+\docparam{state}{Either sqlLogOFF or sqlLogON (see \helpref{enum wxDbSqlLogState}{wxdbenumsqllogstate}). Turns logging of SQL commands sent to the data
+source OFF or ON.}
+\docparam{filename}{{\it OPTIONAL}. Name of the file to which the log text is to be written.}
+\docparam{append}{{\it OPTIONAL}. Whether the file is appended to or overwritten.}
+
+\wxheading{Remarks}
+
+When called with {\it sqlLogON}, all commands sent to the data source engine are logged to the file specified by {\it filename}. Logging is done by embedded WriteSqlLog() calls in the database member functions, or may be manually logged by adding calls to WriteSqlLog() in your own source code.
+
+When called with {\it sqlLogOFF}, the logging file is closed, and any calls to WriteSqlLog() are ignored.
+
+
+\membersection{wxDb::TableExists}\label{wxdbtablexists}
+
+\func{bool}{TableExists}{\param{const char *}{tableName}, \param{const char *}{userID=NULL}, \param{const char *}{path=NULL}}
+
+Checks the ODBC data source for the existence of a table. If a {\it userID} is specified, then the table must be accessible by that user (user must have at least minimal privileges to the table).
+
+\wxheading{Parameters}
+
+\docparam{tableName}{Name of the table to check for the existence of}
+\docparam{userID}{Owner of the table. Specify a userID when the datasource you are connected
+to allows multiple unique tables with the same name to be owned by different users. {\it userID}
+is evaluated as follows:}
+
+\begin{verbatim}
+ userID == NULL ... UserID is ignored (DEFAULT)
+ userID == "" ... UserID set equal to 'this->uid'
+ userID != "" ... UserID set equal to 'userID'
+\end{verbatim}
+
+\wxheading{Remarks}
+
+{\it tableName} may refer to a table, view, alias or synonym.
+
+This function does not indicate whether or not the user has privleges to query or perform other functions on the table.
+
+
+\membersection{wxDb::TranslateSqlState}\label{wxdbtranslatesqlstate}
+
+\func{int}{TranslateSqlState}{\param{const wxChar *}{SQLState}}
+
+\wxheading{Parameters}
+
+\docparam{SQLState}{Converts an ODBC sqlstate to an internal error code.}
+
+\wxheading{Return value}
+
+Returns the internal class DB_ERR code. See \helpref{wxDb::DB_STATUS}{wxdbdbstatus} definition.
+
+
+\membersection{wxDb::WriteSqlLog}\label{wxdbwritesqllog}
+
+\func{bool}{WriteSqlLog}{\param{const wxChar *}{logMsg}}
+
+\wxheading{Parameters}
+
+\docparam{logMsg}{Free form string to be written to the log file.}
+
+\wxheading{Remarks}
+
+Very useful debugging tool that may be turned on/off during run time. The
+passed in string {\it logMsg} will be written to a log file if SQL logging
+is turned on (see \helpref{wxDb::SetSqlLogging}{wxdbsetsqllogging} for details on turning logging on/off).
+
+\wxheading{Return value}
+
+If SQL logging is off when a call to WriteSqlLog() is made, or there is a
+failure to write the log message to the log file, the function returns
+FALSE without performing the requested log, otherwise TRUE is returned.
+
+\wxheading{See also}
+
+\helpref{wxDb::SetSqlLogging}{wxdbsetsqllogging}
+
+==============
+\membersection{wxDb::IsFwdOnlyCursors}\label{wxdbisfwdonlycursors}
+
+\func{bool}{IsFwdOnlyCursors}{\void}
+
+\wxheading{Remarks}
+
+This setting indicates whether this database connection was created
+as being capable of using only forward scrolling cursors. This function
+does NOT indicate if the ODBC driver or datasource supports backward
+scrolling cursors. There is no standard way of detecting if the driver
+or datasource can support backward scrolling cursors.
+
+If a wxDb instance was created as being forward only cursors, then even if
+the datasource and ODBC driver support backward scrolling cursors, then
+tables using this database connection can only use forward scrolling
+cursors.
+
+The default setting of whether a wxDb connection to a database allows
+forward-only or also backward scrolling cursors is defined in setup.h by
+the wxODBC_FWD_ONLY_CURSORS value. This default setting can be overridden
+when the wxDb connection is initially created (see \helpref{wxDb constructor}{wxdbconstr}).
+
+\wxheading{Return value}
+
+Returns TRUE if this datasource connection is defined as using only forward
+scrolling cursors, or FALSE if the connection is defined as being capable
+of supporting backward scrolling cursors (see note above).
+
+\wxheading{See also}
+
+\helpref{wxDb constructor}{wxdbconstr}
+
+=======
+\membersection{wxDb::Dbms}\label{wxdbdbms}
+
+\func{wxDBMS }{Dbms}{\void}
+
+\wxheading{Remarks}
+
+The return value will be of the enumerated type wxDBMS. This enumerated
+type contains a list of all the currently tested and supported databases.
+
+Additional databases may be work with these classes, but these databases
+returned by this function have been tested and confirmed to work with
+these ODBC classes.
+
+enum wxDBMS includes:
+\begin{verbatim}
+ dbmsUNIDENTIFIED
+ dbmsORACLE
+ dbmsSYBASE_ASA
+ dbmsSYBASE_ASE
+ dbmsMY_SQL_SERVER
+ dbmsMY_SQL
+ dbmsPOSTGRES
+ dbmsACCESS
+ dbmsDBASE
+ dbmsINFORMIX
+\end{verbatim}
+
+There are known issues with conformance to the ODBC standards with several
+datasources listed above. Please see the overview for specific details on
+on which datasource have which issues.
+
+\wxheading{Return value}
+
+The return value will indicate which of the supported datasources is
+currently connected to by this connection. In the event that the
+datasource is not recognized, a value of 'dbmsUNIDENTIFIED' is returned.
+
+==========
+\membersection{wxDb::SetDebugErrorMessages}\label{wxdbsetdebugerrormessages}
+
+\func{void}{SetDebugErrorMessages}{\param{bool}{state}}
+
+\docparam{state}{Either TRUE (debug messages are displayed) or FALSE (debug
+messages are not displayed.}
+
+\wxheading{Remarks}
+
+Turns on/off debug error messages from the ODBC class library. When
+this function is passed TRUE, errors are reported to the user automatically
+in a text or pop-up dialog when an ODBC error occurs. When passed FALSE,
+errors are silently handled.
+
+When compiled in release mode (FINAL=1), this setting has no affect.
+
+\wxheading{See also}
+
+\helpref{wxDb constructor}{wxdbconstr}
+
+
+
+==========
+\membersection{wxDb::LogError}\label{wxdblogerror}
+
+\func{void}{LogError}{\param{const char *}{errMsg} \param{const char *}{SQLState=0}}
+
+\docparam{errMsg}{Free-form text to display describing the error to be logged.}
+\docparam{SQLState}{Native SQL state error}
+
+\wxheading{Remarks}
+Calling this function will enter a log message in the error list maintained
+for the database connection. This log message is free form and can be
+anything the programmer wants to enter in the error list.
+
+If SQL logging is turned on, the call to this function will also log the
+text into the SQL log file.
+
+\wxheading{See also}
+
+\helpref{wxDb::WriteSqlLog}{wxdbwritesqllog}
+
+
+
+==========
+\membersection{wxDb::GetTypeInfXxxxx}\label{wxdbgettypeinf}
+
+\func{wxDbSqlTypeInfo }{GetTypeInfDate}{\void}
+\func{wxDbSqlTypeInfo }{GetTypeInfFloat}{\void}
+\func{wxDbSqlTypeInfo }{GetTypeInfInteger}{\void}
+\func{wxDbSqlTypeInfo }{GetTypeInfVarchar}{\void}
+
+
+\wxheading{Remarks}
+
+
+\wxheading{Return value}
+
--- /dev/null
+%
+% automatically generated by HelpGen from
+% grid.h at 11/May/00 18:30:18
+%
+
+
+\section{\class{wxGridCellWorker}}\label{wxgridcellworker}
+
+
+
+wxGridCellWorker: common base class for wxGridCellRenderer and
+wxGridCellEditor
+NB: this is more an implementation convenience than a design issue, so this
+class is not documented and is not public at all
+
+
+\wxheading{Derived from}
+
+No base class
+
+\wxheading{Data structures}
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
+
+\membersection{wxGridCellWorker::wxGridCellWorker}\label{wxgridcellworkerwxgridcellworker}
+
+\func{}{wxGridCellWorker}{\void}
+
+
+\membersection{wxGridCellWorker::IncRef}\label{wxgridcellworkerincref}
+
+\func{void}{IncRef}{\void}
+
+this class is ref counted: it is created with ref count of 1, so
+calling DecRef() once will delete it. Calling IncRef() allows to lock
+it until the matching DecRef() is called
+
+
+\membersection{wxGridCellWorker::DecRef}\label{wxgridcellworkerdecref}
+
+\func{void}{DecRef}{\void}
+
+
+\membersection{wxGridCellWorker::SetParameters}\label{wxgridcellworkersetparameters}
+
+\func{void}{SetParameters}{\param{const wxString\& }{params}}
+
+interpret renderer parameters: arbitrary string whose interpretatin is
+left to the derived classes
+
+
+\membersection{wxGridCellWorker::\destruct{wxGridCellWorker}}\label{wxgridcellworkerdtor}
+
+\func{}{\destruct{wxGridCellWorker}}{\void}
+
+virtual dtor for any base class - private because only DecRef() can
+delete us
+
the image quality won't be perfect (and could be better for photo images using more
sophisticated dithering algorithms).
+On Windows, if there is a palette present (set with SetPalette), it will be used when
+creating the wxBitmap (most useful in 8-bit display mode). On other platforms,
+the palette is currently ignored.
+
\membersection{wxImage::Copy}\label{wximagecopy}
\constfunc{wxImage}{Copy}{\void}
Gets the red value of the mask colour.
+\membersection{wxImage::GetPalette}\label{wximagegetpalette}
+
+\constfunc{const wxPalette\&}{GetPalette}{\void}
+
+Returns the palette associated with the image. Currently the palette is only
+used in ConvertToBitmap under Windows.
+
+Eventually wxImage handlers will set the palette if one exists in the image file.
+
\membersection{wxImage::GetSubImage}\label{wximagegetsubimage}
\constfunc{wxImage}{GetSubImage}{\param{const wxRect\&}{ rect}}
\helpref{wxImage::GetOptionInt}{wximagegetoptionint},\rtfsp
\helpref{wxImage::HasOption}{wximagehasoption}
+\membersection{wxImage::SetPalette}\label{wximagesetpalette}
+
+\func{void}{SetPalette}{\param{const wxPalette\&}{ palette}}
+
+Associates a palette with the image. Currently, the palette is not used.
+
\membersection{wxImage::SetRGB}\label{wximagesetrgb}
\func{void}{SetRGB}{\param{int }{x}, \param{int }{y}, \param{unsigned char }{red}, \param{unsigned char }{green}, \param{unsigned char }{blue}}
set locale is restored and so the changes described in
\helpref{Init}{wxlocaleinit} documentation are rolled back.
-\membersection{wxLocale::GetLocale}\label{wxlocalegetlocale}
-
-\constfunc{const char*}{GetLocale}{\void}
-
-Returns the locale name as passed to the constructor or
-\helpref{Init()}{wxlocaleinit}.
-
\membersection{wxLocale::AddCatalog}\label{wxlocaleaddcatalog}
\func{bool}{AddCatalog}{\param{const char }{*szDomain}}
This only applies to subsequent invocations of AddCatalog()!
+\membersection{wxLocale::GetLocale}\label{wxlocalegetlocale}
+
+\constfunc{const char*}{GetLocale}{\void}
+
+Returns the locale name as passed to the constructor or
+\helpref{Init()}{wxlocaleinit}.
+
+\membersection{wxLocale::GetName}\label{wxlocalegetname}
+
+\constfunc{const wxString\&}{GetName}{\void}
+
+Returns the current short name for the locale (as given to the constructor or
+the Init() function).
+
+\membersection{wxLocale::GetString}\label{wxlocalegetstring}
+
+\constfunc{const char*}{GetString}{\param{const char }{*szOrigString}, \param{const char }{*szDomain = NULL}}
+
+Retrieves the translation for a string in all loaded domains unless the szDomain
+parameter is specified (and then only this catalog/domain is searched).
+
+Returns original string if translation is not available
+(in this case an error message is generated the first time
+a string is not found; use \helpref{wxLogNull}{wxlogoverview} to suppress it).
+
+\wxheading{Remarks}
+
+Domains are searched in the last to first order, i.e. catalogs
+added later override those added before.
+
\membersection{wxLocale::Init}\label{wxlocaleinit}
\func{bool}{Init}{\param{const char }{*szName}, \param{const char }{*szShort = NULL}, \param{const char }{*szLocale = NULL}, \param{bool }{bLoadDefault = TRUE}}
See also: \helpref{AddCatalog}{wxlocaleaddcatalog}
-\membersection{wxLocale::GetName}\label{wxlocalegetname}
-
-\constfunc{const wxString\&}{GetName}{\void}
-
-Returns the current short name for the locale (as given to the constructor or
-the Init() function).
-
-\membersection{wxLocale::GetString}\label{wxlocalegetstring}
-
-\constfunc{const char*}{GetString}{\param{const char }{*szOrigString}, \param{const char }{*szDomain = NULL}}
-
-Retrieves the translation for a string in all loaded domains unless the szDomain
-parameter is specified (and then only this catalog/domain is searched).
-
-Returns original string if translation is not available
-(in this case an error message is generated the first time
-a string is not found; use \helpref{wxLogNull}{wxlogoverview} to suppress it).
+\membersection{wxLocale::IsOk}\label{wxlocaleisok}
-\wxheading{Remarks}
+\constfunc{bool}{IsOk}{\void}
-Domains are searched in the last to first order, i.e. catalogs
-added later override those added before.
+Returns TRUE if the locale could be set successfully.
as wxSpinButton is not implemented for all platforms (Win32 and GTK only
currently).
+{\bf NB:} the range supported by this control (and wxSpinCtrl) depends on the
+platform but is at least {\tt SHRT\_MIN} to {\tt SHRT\_MAX}.
+
\wxheading{Derived from}
\helpref{wxControl}{wxcontrol}\\
Classes: \helpref{wxLayoutConstraints}{wxlayoutconstraints}, \helpref{wxIndividualLayoutConstraint}{wxindividuallayoutconstraint}.
-Objects of class wxLayoutConstraint can be associated with a window to define the
-way its subwindows are laid out, with respect to their siblings or parent.
+Objects of class wxLayoutConstraint can be associated with a window to define
+the way it is laid out, with respect to its siblings or the parent.
The class consists of the following eight constraints of class wxIndividualLayoutConstraint,
some or all of which should be accessed directly to set the appropriate
The constrains calculation is done in \helpref{wxWindow::Layout}{wxwindowlayout}
function which evaluates constraints. To call it you can either call
-wxWindow::SetAutoLayout to tell default OnSize handlers to call Layout
-automatically whenever the window size changes, or override OnSize and call Layout
-yourself.
+\helpref{wxWindow::SetAutoLayout}{wxwindowsetautolayout} if the parent window
+is a frame, panel or a dialog to tell default OnSize handlers to call Layout
+automatically whenever the window size changes, or override OnSize and call
+Layout yourself (note that you do have to call
+\helpref{Layout}{wxwindowlayout} yourself if the parent window is not a
+frame, panel or dialog).
\subsection{Constraint layout: more detail}
write something like:
\begin{verbatim}
-for ( str = GetFirstLine(); !Eof(); str = GetNextLine() )
+wxTextFile file;
+...
+for ( str = file.GetFirstLine(); !file.Eof(); str = file.GetNextLine() )
{
// do something with the current line in str
}
+// do something with the last line in str
\end{verbatim}
\membersection{wxTextFile::GetNextLine}\label{wxtextfilegetnextline}
\func{wxString\&}{GetLastLine}{\void}
-Gets the last line of the file.
+Gets the last line of the file. Together with
+\helpref{GetPrevLine}{wxtextfilegetprevline} it allows to enumerate the lines
+in the file from the end to the beginning like this:
+
+\begin{verbatim}
+wxTextFile file;
+...
+for ( str = file.GetLastLine();
+ file.GetCurrentLine() > 0;
+ str = file.GetPrevLine() )
+{
+ // do something with the current line in str
+}
+// do something with the first line in str
+\end{verbatim}
\membersection{wxTextFile::GetLineType}\label{wxtextfilegetlinetype}
\membersection{wxToolBar::AddTool}\label{wxtoolbaraddtool}
+\func{wxToolBarTool*}{AddTool}{\param{int}{ toolId}, \param{const wxBitmap\&}{ bitmap1},\rtfsp
+\param{const wxString\& }{shortHelpString = ""}, \param{const wxString\& }{longHelpString = ""}}
+
\func{wxToolBarTool*}{AddTool}{\param{int}{ toolId}, \param{const wxBitmap\&}{ bitmap1},\rtfsp
\param{const wxBitmap\&}{ bitmap2 = wxNullBitmap}, \param{bool}{ isToggle = FALSE},\rtfsp
\param{long}{ xPos = -1}, \param{long}{ yPos = -1},\rtfsp
\param{wxObject* }{clientData = NULL}, \param{const wxString\& }{shortHelpString = ""}, \param{const wxString\& }{longHelpString = ""}}
-Adds a tool to the toolbar.
+Adds a tool to the toolbar. The first (short and most commonly used) version
+adds a normal (and not a togglable) button without any associated client data.
\wxheading{Parameters}
\twocolwidtha{7cm}
\begin{twocollist}\itemsep=0pt
-\twocolitem{{\bf EVT\_UPDATE\_UI(id, func)}}{Process a wxEVT\_UPDATE\_UI event.}
+\twocolitem{{\bf EVT\_UPDATE\_UI(id, func)}}{Process a wxEVT\_UPDATE\_UI event for the command with the given id.}
+\twocolitem{{\bf EVT\_UPDATE\_UI\_RANGE(id1, id2, func)}}{Process a wxEVT\_UPDATE\_UI event for any command with id included in the given range.}
\end{twocollist}%
\wxheading{Remarks}
tex2rtf manual.tex manual.rtf -rtf -twice
+If you wish to have a GUI display show the status of what is happening
+as the conversion is happening, use the '-interactive' command line
+parameter, and then choose FILE|GO from the menu. For example:
+
+ tex2rtf manual.tex manual.rtf -rtf -twice -interactive
+
+NOTE: You must be using the latest tex2rtf which was released with
+v2.2.0 of wxWindowsto use the -interactive switch
+
If you wish to generate documentation for wxHTML Help Viewer
(or Windows HTML Help), set htmlWorkshopFiles to true in your
tex2rtf.ini file. See also the wxHTML Notes section in the
// source such as opening and closing the data source.
// Author: Doug Card
// Modified by: George Tasker
+// Bart Jourquin
+// Mark Johnson
// Mods: Dec, 1998:
// -Added support for SQL statement logging and database cataloging
// April, 1999
// BJO 20000503: introduce new GetColumns members which are more database independant and
// return columns in the order they were created
#define OLD_GETCOLUMNS 1
-
+#define EXPERIMENTAL_WXDB_FUNCTIONS 0
// Use this line for wxWindows v1.x
//#include "wx_ver.h"
#if wxMAJOR_VERSION == 2
#ifdef __GNUG__
- #pragma interface "db.h"
+ #pragma interface "db.h"
#endif
#endif
public:
wxString s_Field; // Formated String for Output
wxString s_Format[7]; // Formated Objects - TIMESTAMP has the biggest (7)
- wxString s_Menge[7]; // Formated Objects - amount of things that can be formatted
- int i_Menge[7]; // Formated Objects - TT MM YYYY HH MM SS m
+ wxString s_Amount[7]; // Formated Objects - amount of things that can be formatted
+ int i_Amount[7]; // Formated Objects - TT MM YYYY HH MM SS m
int i_Nation; // 0 = timestamp , 1=EU, 2=UK, 3=International, 4=US
int i_dbDataType; // conversion of the 'sqlDataType' to the generic data type used by these classes
SWORD i_sqlDataType;
int FkCol; // Foreign key column 0=No; 1= First Key, 2 = Second Key etc.
char FkTableName[DB_MAX_TABLE_NAME_LEN+1]; // Foreign key table name
wxDbColFor *pColFor; // How should this columns be formatted
+
+ wxDbColInf();
+ ~wxDbColInf();
};
char tableRemarks[254+1];
int numCols; // How many Columns does this Table have: GetColumnCount(..);
wxDbColInf *pColInf; // pColInf = NULL ; User can later call GetColumns(..);
+ wxDbTableInf();
+ ~wxDbTableInf();
};
char schema[128+1];
int numTables; // How many tables does this database have
wxDbTableInf *pTableInf; // pTableInf = new wxDbTableInf[numTables];
+
+ wxDbInf();
+ ~wxDbInf();
};
unsigned int nTables;
// Information about logical data types VARCHAR, INTEGER, FLOAT and DATE.
- //
+ //
// This information is obtained from the ODBC driver by use of the
// SQLGetTypeInfo() function. The key piece of information is the
// type name the data source uses for each logical data type.
char databaseName[128]; // Database filename
char outerJoins[2]; // Indicates whether the data source supports outer joins
char procedureSupport[2]; // Indicates whether the data source supports stored procedures
+#if EXPERIMENTAL_WXDB_FUNCTIONS // will be added in 2.4
+ char accessibleTables[2]; // Indicates whether the data source only reports accessible tables in SQLTables.
+#endif
UWORD maxConnections; // Maximum # of connections the data source supports
UWORD maxStmts; // Maximum # of HSTMTs per HDBC
UWORD apiConfLvl; // ODBC API conformance level
#if wxODBC_BACKWARD_COMPATABILITY
// Information about logical data types VARCHAR, INTEGER, FLOAT and DATE.
- //
+ //
// This information is obtained from the ODBC driver by use of the
// SQLGetTypeInfo() function. The key piece of information is the
// type name the data source uses for each logical data type.
#endif
// Public member functions
- wxDb(HENV &aHenv, bool FwdOnlyCursors=(bool)TRUE);
+ wxDb(HENV &aHenv, bool FwdOnlyCursors=(bool)wxODBC_FWD_ONLY_CURSORS);
bool Open(char *Dsn, char *Uid, char *AuthStr); // Data Source Name, User ID, Password
void Close(void);
bool CommitTrans(void);
wxDbSqlTypeInfo GetTypeInfDate() {return typeInfDate;}
bool TableExists(const char *tableName, const char *userID=NULL, const char *path=NULL); // Table name can refer to a table, view, alias or synonym
+#if EXPERIMENTAL_WXDB_FUNCTIONS // will be added in 2.4
+ bool TablePrivileges(const char *tableName, const char* priv, const char *userID=NULL, const char *path=NULL); // Table name can refer to a table, view, alias or synonym
+#endif
void LogError(const char *errMsg, const char *SQLState = 0) {logError(errMsg, SQLState);}
void SetDebugErrorMessages(bool state) { silent = !state; }
bool SetSqlLogging(wxDbSqlLogState state, const wxChar *filename = SQL_LOG_FILENAME, bool append = FALSE);
// Purpose: Declaration of the wxDbTable class.
// Author: Doug Card
// Modified by: George Tasker
+// Bart Jourquin
+// Mark Johnson
// Created: 9.96
// RCS-ID: $Id$
// Copyright: (c) 1996 Remstar International, Inc.
#if wxMAJOR_VERSION == 2
#ifdef __GNUG__
- #pragma interface "dbtable.h"
+ #pragma interface "dbtable.h"
#endif
#endif
class WXDLLEXPORT wxDbTable
{
private:
- ULONG tableID; // Used for debugging. This can help to match up mismatched constructors/destructors
+ ULONG tableID; // Used for debugging. This can help to match up mismatched constructors/destructors
// Private member variables
- UDWORD cursorType;
- bool insertable;
+ UDWORD cursorType;
+ bool insertable;
// Private member functions
- bool bindInsertParams(void);
- bool bindUpdateParams(void);
- bool bindCols(HSTMT cursor);
- bool getRec(UWORD fetchType);
- bool execDelete(const char *pSqlStmt);
- bool execUpdate(const char *pSqlStmt);
- bool query(int queryType, bool forUpdate, bool distinct, const char *pSqlStmt = 0);
+ bool bindInsertParams(void);
+ bool bindUpdateParams(void);
+ bool bindCols(HSTMT cursor);
+ bool getRec(UWORD fetchType);
+ bool execDelete(const char *pSqlStmt);
+ bool execUpdate(const char *pSqlStmt);
+ bool query(int queryType, bool forUpdate, bool distinct, const char *pSqlStmt = 0);
#if !wxODBC_BACKWARD_COMPATABILITY
// these were public
bool CreateIndex(const char * idxName, bool unique, int noIdxCols, wxDbIdxDef *pIdxDefs, bool attemptDrop=TRUE);
bool DropIndex(const char * idxName);
-// Accessors
+ // Accessors
// The member variables returned by these accessors are all
// set when the wxDbTable instance is createand cannot be
// changed, hence there is no corresponding SetXxxx function
- wxDb *GetDb() { return pDb; }
- const char *GetTableName() { return tableName; }
- const char *GetQueryTableName() { return queryTableName; }
- const char *GetTablePath() { return tablePath; }
+ wxDb *GetDb() { return pDb; }
+ const char *GetTableName() { return tableName; }
+ const char *GetQueryTableName() { return queryTableName; }
+ const char *GetTablePath() { return tablePath; }
- int GetNumberOfColumns() { return noCols; } // number of "defined" columns for this wxDbTable instance
+ int GetNumberOfColumns() { return noCols; } // number of "defined" columns for this wxDbTable instance
- const char *GetFromClause() { return from; }
- const char *GetOrderByClause() { return orderBy; }
- const char *GetWhereClause() { return where; }
+ const char *GetFromClause() { return from; }
+ const char *GetOrderByClause() { return orderBy; }
+ const char *GetWhereClause() { return where; }
- bool IsQueryOnly() { return queryOnly; }
+ bool IsQueryOnly() { return queryOnly; }
#if wxODBC_BACKWARD_COMPATABILITY
void SetFromClause(const char *From) { from = (char *)From; }
- void SetOrderByClause(const char *OrderBy) { orderBy = (char *)OrderBy; }
- void SetWhereClause(const char *Where) { where = (char *)Where; }
+ void SetOrderByClause(const char *OrderBy) { orderBy = (char *)OrderBy; }
+ void SetWhereClause(const char *Where) { where = (char *)Where; }
#else
- void SetFromClause(const wxString& From) { from = From; }
- void SetOrderByClause(const wxString& OrderBy) { orderBy = OrderBy; }
- void SetWhereClause(const wxString& Where) { where = Where; }
+ void SetFromClause(const wxString& From) { from = From; }
+ void SetOrderByClause(const wxString& OrderBy) { orderBy = OrderBy; }
+ void SetWhereClause(const wxString& Where) { where = Where; }
#endif
int Insert(void);
bool Update(void);
# pragma warning(disable:4100) // unreferenced formal parameter
# pragma warning(disable:4511) // copy ctor couldn't be generated
# pragma warning(disable:4512) // operator=() couldn't be generated
-# pragma warning(disable:4699) // Using precompiled header
+# pragma warning(disable:4699) // using precompiled header
# pragma warning(disable:4134) // conversion between pointers to members of same class
+# pragma warning(disable:4710) // function not inlined
#ifndef WIN32
# pragma warning(disable:4135) // conversion between different integral types
# pragma warning(disable:4769) // assignment of near pointer to long integer
wxString GetString() const { return m_commandString; }
// Get checkbox value
- bool Checked() const { return (m_commandInt != 0); }
+ bool IsChecked() const { return m_commandInt != 0; }
// TRUE if the listbox event was a selection.
bool IsSelection() const { return (m_extraLong != 0); }
void CopyObject(wxObject& obj) const;
+#ifdef WXWIN_COMPATIBILITY_2
+ bool Checked() const { return IsChecked(); }
+#endif // WXWIN_COMPATIBILITY_2
+
public:
wxString m_commandString; // String event argument
int m_commandInt;
{ wxEVT_JOY_BUTTON_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
{ wxEVT_JOY_BUTTON_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
{ wxEVT_JOY_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
- { wxEVT_JOY_ZMOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
+ { wxEVT_JOY_ZMOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
// Idle event
#define EVT_IDLE(func) \
- { wxEVT_IDLE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) & func, (wxObject *) NULL },\
+ { wxEVT_IDLE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) & func, (wxObject *) NULL },
// Update UI event
#define EVT_UPDATE_UI(id, func) \
- { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },\
+ { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },
+#define EVT_UPDATE_UI_RANGE(id1, id2, func) \
+ { wxEVT_UPDATE_UI, id1, id2, (wxObjectEventFunction)(wxEventFunction)(wxUpdateUIEventFunction)&func, (wxObject *) NULL },
// ----------------------------------------------------------------------------
// Global data
// restores old locale
~wxLocale();
+ // return TRUE if the locale was set successfully
+ bool IsOk() const { return m_pszOldLocale != NULL; }
+
// returns locale name
const wxChar *GetLocale() const { return m_strLocale; }
// domains are searched in the last to first order, i.e. catalogs
// added later override those added before.
const wxMB2WXbuf GetString(const wxChar *szOrigString,
- const wxChar *szDomain = (const wxChar *) NULL) const;
+ const wxChar *szDomain = (const wxChar *) NULL) const;
// Returns the current short name for the locale
const wxString& GetName() const { return m_strShort; }
wxLocale *m_pOldLocale; // previous wxLocale
wxMsgCatalog *m_pMsgCat; // pointer to linked list of catalogs
-
+
bool m_bConvertEncoding;
};
/////////////////////////////////////////////////////////////////////////////
-// Name: minifram.h
+// Name: wx/msw/minifram.h
// Purpose: wxMiniFrame class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MINIFRAM_H_
#ifdef __WIN32__
-class WXDLLEXPORT wxMiniFrame: public wxFrame {
-
- DECLARE_DYNAMIC_CLASS(wxMiniFrame)
-
+class WXDLLEXPORT wxMiniFrame : public wxFrame
+{
public:
- inline wxMiniFrame(void) {}
- inline wxMiniFrame(wxWindow *parent,
- wxWindowID id,
- const wxString& title,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE,
- const wxString& name = wxFrameNameStr)
+ wxMiniFrame() { }
+ wxMiniFrame(wxWindow *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER,
+ const wxString& name = wxFrameNameStr)
{
Create(parent, id, title, pos, size, style | wxFRAME_TOOL_WINDOW | wxFRAME_FLOAT_ON_PARENT, name);
}
protected:
+ DECLARE_DYNAMIC_CLASS(wxMiniFrame)
};
-#else
-
-class WXDLLEXPORT wxMiniFrame: public wxFrame {
-
- DECLARE_DYNAMIC_CLASS(wxMiniFrame)
+#else // !Win32
+class WXDLLEXPORT wxMiniFrame : public wxFrame
+{
public:
- inline wxMiniFrame(void) {}
- inline wxMiniFrame(wxWindow *parent,
- wxWindowID id,
- const wxString& title,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION_HORIZ,
- const wxString& name = wxFrameNameStr)
+ wxMiniFrame() { }
+ wxMiniFrame(wxWindow *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION_HORIZ,
+ const wxString& name = wxFrameNameStr)
{
Create(parent, id, title, pos, size, style, name);
}
- ~wxMiniFrame(void);
+ virtual ~wxMiniFrame();
- long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+ virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
-protected:
+ DECLARE_DYNAMIC_CLASS(wxMiniFrame)
};
-#endif
-
+#endif // Win32/!Win32
#endif
// _WX_MINIFRAM_H_
#endif // WXWIN_COMPATIBILITY
protected:
+ // subclass one radio button
void SubclassRadioButton(WXHWND hWndBtn);
+ // get the max size of radio buttons
+ wxSize GetMaxButtonSize() const;
+
+ // get the total size occupied by the radio box buttons
+ wxSize GetTotalButtonSize(const wxSize& sizeBtn) const;
+
WXHWND * m_radioButtons;
int m_majorDim;
int * m_radioWidth; // for bitmaps
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
+ virtual wxSize DoGetBestSize() const;
};
#endif
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SETUP_H_
// Recommended setting: 0
#define wxICON_IS_BITMAP 0
+// Define as 1 for font size to be backward compatible to 1.63 and earlier.
+// 1.64 and later define point sizes to be compatible with Windows.
+//
+// Default is 0
+//
+// Recommended setting: 0
+#define wxFONT_SIZE_COMPATIBILITY 0
+
+// Set to 0 for accurate dialog units, else 1 to be as per 2.1.16 and before.
+// If migrating between versions, your dialogs may seem to shrink.
+//
+// Default is 1
+//
+// Recommended setting: 0 (the new calculations are more correct!)
+#define wxDIALOG_UNIT_COMPATIBILITY 1
+
// ----------------------------------------------------------------------------
// debugging settings
// ----------------------------------------------------------------------------
// If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows
// to connect/disconnect from the network and be notified whenever the dial-up
-// network connection is established/terminated.
+// network connection is established/terminated. Requires wxUSE_DYNLIB_CLASS.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_DIALUP_MANAGER 1
-// Compile in wxLibrary class for run-time DLL loading and function calling
+// Compile in wxLibrary class for run-time DLL loading and function calling.
+// Required by wxUSE_DIALUP_MANAGER.
//
// This setting is for Win32 only
//
// Set to 1 to use socket classes
#define wxUSE_SOCKETS 1
-// Set to 1 to enable virtual file systems
-// (needed by wxHTML)
+#if wxUSE_GUI
+
+// Set to 1 to enable virtual file systems (required by wxHTML)
#define wxUSE_FILESYSTEM 1
+
+// Set to 1 to enable virtual ZIP filesystem (requires wxUSE_FILESYSTEM)
#define wxUSE_FS_ZIP 1
+
+// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM)
#define wxUSE_FS_INET 1
-// input stream for reading from zip archives
+// Set to 1 to compile wxZipInput/OutputStream classes.
#define wxUSE_ZIPSTREAM 1
+// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by
+// wxUSE_LIBPNG.
+#define wxUSE_ZLIB 1
+
+#else // !wxUSE_GUI
+
+// although it is possible to compile all of those in wxBase, this is not done
+// by default
+#define wxUSE_FILESYSTEM 0
+#define wxUSE_FS_ZIP 0
+#define wxUSE_FS_INET 0
+#define wxUSE_ZIPSTREAM 0
+#define wxUSE_ZLIB 0
+
+#endif // wxUSE_GUI/!wxUSE_GUI
+
+// If enabled, the code written by Apple will be used to write, in a portable
+// way, float on the disk. See extended.c for the license which is different
+// from wxWindows one.
+//
+// Default is 1.
+//
+// Recommended setting: 1 unless you don't like the license terms (unlikely)
#define wxUSE_APPLE_IEEE 1
- // if enabled, the float codec written by Apple
- // will be used to write, in a portable way,
- // float on the disk
-// use wxFile class - required by i18n code, wxConfig and others - recommended
+// Use wxFile class.
+//
+// Default is 1.
+//
+// Recommended setting: 1 (highly recommended, required i18n code, wxConfig...)
#define wxUSE_FILE 1
-// use wxTextFile class: requires wxFile, required by wxConfig
+// use wxTextFile class: requires wxFile, required by wxFileConfig
#define wxUSE_TEXTFILE 1
-// i18n support: _() macro, wxLocale class. Requires wxFile
+// i18n support: _() macro, wxLocale class. Requires wxTextFile.
#define wxUSE_INTL 1
-#define wxUSE_DYNAMIC_CLASSES 1
- // If 1, enables provision of run-time type information.
- // NOW MANDATORY: don't change.
-
// ----------------------------------------------------------------------------
// Optional controls
// ----------------------------------------------------------------------------
// of disabled controls)
#define wxUSE_CARET 1
#define wxUSE_CHECKBOX 1
-#define wxUSE_CHECKLISTBOX 1
+#define wxUSE_CHECKLISTBOX 1 // requires wxUSE_OWNER_DRAWN
#define wxUSE_CHOICE 1
#define wxUSE_COMBOBOX 1
#define wxUSE_GAUGE 1
// Default is 1 for both options.
//
// Recommended setting: 1 for wxUSE_NEW_GRID, 0 if you have an old code using
-// wxGrid and 100% backwards compatible (with all old wxGrid quirks) is
+// wxGrid and 100% backwards compatibality (with all old wxGrid quirks) is
// essential.
//
// WIN16/BC++ resets wxUSE_NEW_GRID to 0 because it exceeds the data limit.
// Use .wxr resource mechanism (requires PrologIO library)
// ----------------------------------------------------------------------------
-// Postscript support settings
+// postscript support settings
// ----------------------------------------------------------------------------
+// Set to 1 for PostScript device context.
#define wxUSE_POSTSCRIPT 0
- // 0 for no PostScript device context
+
+// Set to 1 to use font metric files in GetTextExtent
#define wxUSE_AFM_FOR_POSTSCRIPT 0
- // 1 to use font metric files in GetTextExtent
+// Set to 0 to disable PostScript print/preview architecture code under Windows
+// (just use Windows printing).
#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
- // Set to 0 to disable PostScript print/preview architecture code
- // under Windows (just use Windows printing).
// ----------------------------------------------------------------------------
// database classes
// ----------------------------------------------------------------------------
+// Define 1 to use ODBC classes
#define wxUSE_ODBC 0
- // Define 1 to use ODBC classes
+// For backward compatibility reasons, this parameter now only controls the
+// default scrolling method used by cursors. This default behavior can be
+// overriden by setting the second param of wxDB::wxDbGetConnection() or
+// wxDb() constructor to indicate whether the connection (and any wxDbTable()s
+// that use the connection) should support forward only scrolling of cursors,
+// or both forward and backward support for backward scrolling cursors is
+// dependent on the data source as well as the ODBC driver being used.
#define wxODBC_FWD_ONLY_CURSORS 1
- // For backward compatibility reasons, this parameter now only
- // controls the default scrolling method used by cursors. This
- // default behavior can be overriden by setting the second param
- // of wxDB::GetDbConnection() to indicate whether the connection
- // (and any wxTable()s that use the connection) should support
- // forward only scrolling of cursors, or both forward and backward
- // Support for backward scrolling cursors is dependent on the
- // data source as well as the ODBC driver being used.
+// Default is 0. Set to 1 to use the deprecated classes, enum types, function,
+// member variables. With a setting of 1, full backward compatability with the
+// 2.0.x release is possible. It is STRONGLY recommended that this be set to 0,
+// as future development will be done only on the non-deprecated
+// functions/classes/member variables/etc.
#define wxODBC_BACKWARD_COMPATABILITY 0
- // Default is 0. Set to 1 to use the deprecated classes, enum
- // types, function, member variables. With a setting of 1, full
- // backward compatability with the 2.0.x release is possible.
- // It is STRONGLY recommended that this be set to 0, as
- // future development will be done only on the non-deprecated
- // functions/classes/member variables/etc.
// ----------------------------------------------------------------------------
// other compiler (mis)features
// image format support
// ----------------------------------------------------------------------------
-#define wxUSE_ZLIB 1
- // Use zlib for compression in streams and PNG code
+// wxImage supports many different image formats which can be configured at
+// compile-time. BMP is always supported, others are optional and can be safely
+// disabled if you don't plan to use images in such format sometimes saving
+// substantial amount of code in the final library.
+//
+// Some formats require an extra library which is included in wxWin sources
+// which is mentioned if it is the case.
+
+// Set to 1 for PNG format support (requires libpng). Also requires wxUSE_ZLIB.
#define wxUSE_LIBPNG 1
- // Use PNG bitmap/image code
+
+// Set to 1 for JPEG format support (requires libjpeg)
#define wxUSE_LIBJPEG 1
- // Use JPEG bitmap/image code
+
+// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
- // Use TIFF bitmap/image code
+
+// Set to 1 for GIF format support
#define wxUSE_GIF 1
- // Use GIF bitmap/image code
+
+// Set to 1 for PNM format support
#define wxUSE_PNM 1
- // Use PNM bitmap/image code
+
+// Set to 1 for PCX format support
#define wxUSE_PCX 1
- // Use PCX bitmap/image code
// ----------------------------------------------------------------------------
// Windows-only settings
// ----------------------------------------------------------------------------
-// Make settings compatible with MFC
+// Set this to 1 if you want to use wxWindows and MFC in the same program. This
+// will override some other settings (see below)
+//
+// Default is 0.
+//
+// Recommended setting: 0 unless you really have to use MFC
#define wxUSE_MFC 0
-// required for drag-and-drop, clipboard, OLE Automation
+// Set this to 1 for generic OLE support: this is required for drag-and-drop,
+// clipboard, OLE Automation. Only set it to 0 if your compiler is very old and
+// can't compile/doesn't have the OLE headers.
+//
+// Default is 1.
+//
+// Recommended setting: 1
#define wxUSE_OLE 1
+// Set this to 1 to use Microsoft CTL3D library for "3D-look" under Win16 or NT
+// 3.x. This setting is ignored under Win9x and NT 4.0+.
+//
+// Default is 0 for (most) Win32 (systems), 1 for Win16
+//
+// Recommended setting: same as default
#if defined(__WIN95__)
#define wxUSE_CTL3D 0
#else
-// Define 1 to use Microsoft CTL3D library.
#define wxUSE_CTL3D 1
#endif
-// can we use RICHEDIT control?
+// Define as 1 to use Microsoft's ItsyBitsy small title bar library, for
+// wxMiniFrame. This setting is only used for Win3.1; Win9x and NT use native
+// miniframes support instead.
+//
+// Default is 0 for (most) Win32 (systems), 1 for Win16
+//
+// Recommended setting: same as default
+#if defined(__WIN95__)
+#define wxUSE_ITSY_BITSY 0
+#else
+#define wxUSE_ITSY_BITSY 1
+#endif
+
+// Set this to 1 to use RICHEDIT controls for wxTextCtrl with style wxTE_RICH
+// which allows to put more than ~32Kb of text in it even under Win9x (NT
+// doesn't have such limitation).
+//
+// Default is 1 for compilers which support it
+//
+// Recommended setting: 1, only set it to 0 if your compiler doesn't have
+// or can't compile <richedit.h>
#if defined(__WIN95__) && !defined(__TWIN32__) && !defined(__GNUWIN32_OLD__)
#define wxUSE_RICHEDIT 1
#else
#define wxUSE_RICHEDIT 0
#endif
-#define wxUSE_ITSY_BITSY 1
- // Define 1 to use Microsoft's ItsyBitsy
- // small title bar library, for wxMiniFrame.
- // This setting is only used for Win3.1;
- // Win9x and NT use native miniframes
- // support instead.
-#define wxUSE_BITMAP_MESSAGE 1
- // Define 1 to use bitmap messages.
-#define wxFONT_SIZE_COMPATIBILITY 0
- // Define 1 for font size to be backward compatible
- // to 1.63 and earlier. 1.64 and later define point
- // sizes to be compatible with Windows.
-#define wxDIALOG_UNIT_COMPATIBILITY 0
- // Set to 0 for accurate dialog units, else
- // 1 to be as per 2.1.16 and before. If migrating
- // between versions, your dialogs may seem to shrink.
+// Set this to 1 to enable support for the owner-drawn menu and listboxes. This
+// is required by wxUSE_CHECKLISTBOX.
+//
+// Default is 1.
+//
+// Recommended setting: 1, set to 0 for a small library size reduction
+#define wxUSE_OWNER_DRAWN 1
+
+// ----------------------------------------------------------------------------
+// obsolete settings
+// ----------------------------------------------------------------------------
+
+// NB: all settings in this section are obsolete and should not be used/changed
+// at all, they will disappear
+
+// Set to 1 to use PenWindows
#define wxUSE_PENWINDOWS 0
- // Set to 1 to use PenWindows
-#define wxUSE_OWNER_DRAWN 1
- // Owner-drawn menus and listboxes
+// Define 1 to use bitmap messages.
+#define wxUSE_BITMAP_MESSAGE 1
+
+// If 1, enables provision of run-time type information.
+// NOW MANDATORY: don't change.
+#define wxUSE_DYNAMIC_CLASSES 1
+
+// ----------------------------------------------------------------------------
+// disable the settings which don't work for some compilers
+// ----------------------------------------------------------------------------
#if (defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95)))
#ifndef wxUSE_NORLANDER_HEADERS
#endif
#endif
-// ----------------------------------------------------------------------------
-// disable the settings which don't work for some compilers
-// ----------------------------------------------------------------------------
-
#if defined(__GNUWIN32__)
// These don't work as expected for mingw32 and cygwin32
#undef wxUSE_MEMORY_TRACING
#define wxUSE_MS_HTML_HELP 0
#endif
-// wxUSE_DBEUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode
+// wxUSE_DEBUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode
#if defined(__BORLANDC__) && (defined(WXMAKINGDLL) || defined(WXUSINGDLL))
#undef wxUSE_DEBUG_NEW_ALWAYS
#define wxUSE_DEBUG_NEW_ALWAYS 0
#endif // Win16
+// ----------------------------------------------------------------------------
+// undef the things which don't make sense for wxBase build
+// ----------------------------------------------------------------------------
+
+#if !wxUSE_GUI
+
+#undef wxUSE_HTML
+#define wxUSE_HTML 0
+
+#endif // !wxUSE_GUI
+
// ----------------------------------------------------------------------------
// check the settings consistency: do it here to abort compilation immediately
// and not almost in the very end when the relevant file fails to compile and
// toolbar construction
// --------------------
+ // the most commonly used version of AddTool()
+ wxToolBarToolBase *AddTool(int id,
+ const wxBitmap& bitmap,
+ const wxString& shortHelpString = wxEmptyString,
+ const wxString& longHelpString = wxEmptyString)
+ {
+ return AddTool(id, bitmap, wxNullBitmap, FALSE, NULL,
+ shortHelpString, longHelpString);
+ }
+
// If pushedBitmap is NULL, a reversed version of bitmap is created and
// used as the pushed/toggled image. If toggle is TRUE, the button toggles
// between the two states.
RemoveAt__14wxArrayOptionsFUi
;wxArrayParams::Insert(const wxCmdLineParam&,unsigned int)
Insert__13wxArrayParamsFRC14wxCmdLineParamUi
- ;wxArrayOptions::Empty()
- Empty__14wxArrayOptionsFv
;wxCmdLineParserData::wxCmdLineParserData()
__ct__19wxCmdLineParserDataFv
;wxCmdLineParser::SetCmdLine(const wxString&)
Insert__14wxArrayOptionsFRC15wxCmdLineOptionUi
;wxArrayParams::Add(const wxCmdLineParam&)
Add__13wxArrayParamsFRC14wxCmdLineParam
+ ;wxArrayParams::DoEmpty()
+ DoEmpty__13wxArrayParamsFv
;wxArrayOptions::~wxArrayOptions()
__dt__14wxArrayOptionsFv
;wxCmdLineParser::Usage()
__dt__15wxCmdLineParserFv
;wxArrayParams::~wxArrayParams()
__dt__13wxArrayParamsFv
- ;wxArrayParams::Empty()
- Empty__13wxArrayParamsFv
;wxArrayParams::operator=(const wxArrayParams&)
__as__13wxArrayParamsFRC13wxArrayParams
;wxCmdLineParser::AddOption(const wxString&,const wxString&,const wxString&,wxCmdLineParamType,int)
AddOption__15wxCmdLineParserFRC8wxStringN2118wxCmdLineParamTypei
+ ;wxArrayOptions::DoEmpty()
+ DoEmpty__14wxArrayOptionsFv
;wxCmdLineParser::GetParamCount() const
GetParamCount__15wxCmdLineParserCFv
;wxArrayOptions::DoCopy(const wxArrayOptions&)
GetDays__10wxTimeSpanCFv
;wxDateTime::GetCurrentMonth(wxDateTime::Calendar)
GetCurrentMonth__10wxDateTimeFQ2_10wxDateTime8Calendar
+ ;wxDateTimeArray::DoEmpty()
+ DoEmpty__15wxDateTimeArrayFv
;wxDateTime::Add(const wxTimeSpan&) const
Add__10wxDateTimeCFRC10wxTimeSpan
;wxDateTime::SetMinute(unsigned short)
GetHours__10wxTimeSpanCFv
;wxDateTime::GetCurrentYear(wxDateTime::Calendar)
GetCurrentYear__10wxDateTimeFQ2_10wxDateTime8Calendar
+ ;wxDateSpan::Add(const wxDateSpan&)
+ Add__10wxDateSpanFRC10wxDateSpan
;wxDateTime::SetDay(unsigned short)
SetDay__10wxDateTimeFUs
;wxDateTime::SetHour(unsigned short)
GetNumberOfDays__10wxDateTimeFiQ2_10wxDateTime8Calendar
;wxDateTime::GetCountry()
GetCountry__10wxDateTimeFv
- ;wxDateTimeArray::Empty()
- Empty__15wxDateTimeArrayFv
+ ;wxDateSpan::Add(const wxDateSpan&) const
+ Add__10wxDateSpanCFRC10wxDateSpan
;wxDateTime::ParseRfc822Date(const char*)
ParseRfc822Date__10wxDateTimeFPCc
;wxDateTime::ParseTime(const char*)
__apl__10wxDateTimeFRC10wxTimeSpan
;wxDateTime::operator-=(const wxDateSpan&)
__ami__10wxDateTimeFRC10wxDateSpan
+ ;wxDateSpan::operator-=(const wxDateSpan&)
+ __ami__10wxDateSpanFRC10wxDateSpan
;wxTimeSpan::Subtract(const wxTimeSpan&) const
Subtract__10wxTimeSpanCFRC10wxTimeSpan
+ ;wxDateSpan::Subtract(const wxDateSpan&) const
+ Subtract__10wxDateSpanCFRC10wxDateSpan
;wxDateTime::SetToCurrent()
SetToCurrent__10wxDateTimeFv
;wxDateSpan::Negate() const
__apl__10wxDateSpanFRC10wxDateSpan
;wxDateTime::operator-=(const wxTimeSpan&)
__ami__10wxDateTimeFRC10wxTimeSpan
+ ;wxDateTime::UNow()
+ UNow__10wxDateTimeFv
;wxDateTime::Today()
Today__10wxDateTimeFv
;wxDateTime::Subtract(const wxTimeSpan&) const
Subtract__10wxDateTimeCFRC10wxTimeSpan
+ ;wxDateSpan::Subtract(const wxDateSpan&)
+ Subtract__10wxDateSpanFRC10wxDateSpan
;wxDateTime::IsEqualUpTo(const wxDateTime&,const wxTimeSpan&) const
IsEqualUpTo__10wxDateTimeCFRC10wxDateTimeRC10wxTimeSpan
;wxDateTime::GetWeekDay(wxDateTime::WeekDay,int,wxDateTime::Month,int) const
Add__10wxDateTimeFRC10wxDateSpan
;wxTimeSpan::Abs() const
Abs__10wxTimeSpanCFv
- ;wxTimeSpan::Format(const char*) const
- Format__10wxTimeSpanCFPCc
- ;wxDateTime::SetToYearDay(unsigned short)
- SetToYearDay__10wxDateTimeFUs
;wxDateTime::GetYearDay(unsigned short) const
GetYearDay__10wxDateTimeCFUs
+ ;wxDateTime::SetToYearDay(unsigned short)
+ SetToYearDay__10wxDateTimeFUs
+ ;wxTimeSpan::Format(const char*) const
+ Format__10wxTimeSpanCFPCc
;From object file: ..\common\datstrm.cpp
;PUBDEFs (Symbols available from object file):
;wxDataOutputStream::operator<<(unsigned int)
;PUBDEFs (Symbols available from object file):
;wxBMPHandler::sm_classwxBMPHandler
sm_classwxBMPHandler__12wxBMPHandler
+ ;wxBMPHandler::SaveFile(wxImage*,wxOutputStream&,unsigned long)
+ SaveFile__12wxBMPHandlerFP7wxImageR14wxOutputStreamUl
;wxConstructorForwxBMPHandler()
wxConstructorForwxBMPHandler__Fv
;wxBMPHandler::LoadFile(wxImage*,wxInputStream&,unsigned long,int)
ExpandCommand__10wxFileTypeFRC8wxStringRCQ2_10wxFileType17MessageParameters
;wxMimeTypesManager::IsOfType(const wxString&,const wxString&)
IsOfType__18wxMimeTypesManagerFRC8wxStringT1
+ ;wxArrayFileTypeInfo::DoEmpty()
+ DoEmpty__19wxArrayFileTypeInfoFv
+ wxTheMimeTypesManager
;wxArrayFileTypeInfo::~wxArrayFileTypeInfo()
__dt__19wxArrayFileTypeInfoFv
- wxTheMimeTypesManager
;wxFileType::wxFileType()
__ct__10wxFileTypeFv
;wxFileType::GetIcon(wxIcon*) const
RemoveAt__19wxArrayFileTypeInfoFUi
;wxMimeTypeCmnModule::sm_classwxMimeTypeCmnModule
sm_classwxMimeTypeCmnModule__19wxMimeTypeCmnModule
- ;wxArrayFileTypeInfo::Empty()
- Empty__19wxArrayFileTypeInfoFv
+ ;wxMimeTypesManager::wxMimeTypesManager()
+ __ct__18wxMimeTypesManagerFv
;wxConstructorForwxMimeTypeCmnModule()
wxConstructorForwxMimeTypeCmnModule__Fv
;wxMimeTypesManager::~wxMimeTypesManager()
__dt__18wxMimeTypesManagerFv
- ;wxMimeTypesManager::wxMimeTypesManager()
- __ct__18wxMimeTypesManagerFv
;wxArrayFileTypeInfo::operator=(const wxArrayFileTypeInfo&)
__as__19wxArrayFileTypeInfoFRC19wxArrayFileTypeInfo
;wxFileType::GetOpenCommand(wxString*,const wxFileType::MessageParameters&) const
__vft10wxPrintout8wxObject
;wxPrintout::HasPage(int)
HasPage__10wxPrintoutFi
+ ;wxPrinterBase::sm_lastError
+ sm_lastError__13wxPrinterBase
;wxPrinterBase::sm_abortWindow
sm_abortWindow__13wxPrinterBase
;wxPrintPreviewBase::wxPrintPreviewBase(wxPrintout*,wxPrintout*,wxPrintDialogData*)
PaintPage__18wxPrintPreviewBaseFP8wxWindowR4wxDC
;From object file: ..\common\process.cpp
;PUBDEFs (Symbols available from object file):
+ ;wxProcess::SetPipeStreams(wxInputStream*,wxOutputStream*,wxInputStream*)
+ SetPipeStreams__9wxProcessFP13wxInputStreamP14wxOutputStreamT1
;wxConstructorForwxProcess()
wxConstructorForwxProcess__Fv
;wxProcess::Init(wxEvtHandler*,int,unsigned long)
Init__9wxProcessFP12wxEvtHandleriUl
__vft9wxProcess8wxObject
- ;wxProcess::SetPipeStreams(wxInputStream*,wxOutputStream*)
- SetPipeStreams__9wxProcessFP13wxInputStreamP14wxOutputStream
;wxProcess::~wxProcess()
__dt__9wxProcessFv
;wxConstructorForwxProcessEvent()
insert__8wxStringFUiRC8wxString
;operator+(const wxString&,const char*)
__pl__FRC8wxStringPCc
+ ;wxArrayString::operator==(const wxArrayString&) const
+ __eq__13wxArrayStringCFRC13wxArrayString
;wxString::operator=(const wchar_t*)
__as__8wxStringFPCw
;wxString::StartsWith(const char*,wxString*) const
;wxTextInputStream::operator>>(unsigned int&)
__rs__17wxTextInputStreamFRUi
__vft18wxTextOutputStream
- ;wxTextInputStream::operator>>(wxString&)
- __rs__17wxTextInputStreamFR8wxString
+ ;wxTextInputStream::EatEOL(const char&)
+ EatEOL__17wxTextInputStreamFRCc
;wxTextInputStream::operator>>(short&)
__rs__17wxTextInputStreamFRs
;wxTextInputStream::operator>>(unsigned short&)
__rs__17wxTextInputStreamFRUs
+ ;wxTextInputStream::operator>>(wxString&)
+ __rs__17wxTextInputStreamFR8wxString
;wxTextOutputStream::operator<<(const wxString&)
__ls__18wxTextOutputStreamFRC8wxString
;wxTextOutputStream::Write8(unsigned char)
wxMessageBox__FRC8wxStringT1lP8wxWindowiT5
;wxNewId()
wxNewId__Fv
+ ;wxExecute(const wxString&,wxArrayString&,wxArrayString&)
+ wxExecute__FRC8wxStringR13wxArrayStringT2
;wxHexToDec(const wxString&)
wxHexToDec__FRC8wxString
;wxExecute(const wxString&,wxArrayString&)
;wxZipInputStream::OnSysRead(void*,unsigned int)
OnSysRead__16wxZipInputStreamFPvUi
__vft16wxZipInputStream12wxStreamBase
+ ;wxZipInputStream::Eof() const
+ Eof__16wxZipInputStreamCFv
;From object file: ..\common\zstream.cpp
;PUBDEFs (Symbols available from object file):
;wxZlibInputStream::wxZlibInputStream(wxInputStream&)
Create__14wxCalendarCtrlFP8wxWindowiRC10wxDateTimeRC7wxPointRC6wxSizelRC8wxString
;wxCalendarCtrl::Show(unsigned long)
Show__14wxCalendarCtrlFUl
+ ;wxCalendarEvent::sm_classwxCalendarEvent
+ sm_classwxCalendarEvent__15wxCalendarEvent
;wxCalendarCtrl::OnDClick(wxMouseEvent&)
OnDClick__14wxCalendarCtrlFR12wxMouseEvent
;wxCalendarCtrl::RefreshDate(const wxDateTime&)
DoSetSize__14wxCalendarCtrlFiN41
;wxMonthComboBox::GetEventTable() const
GetEventTable__15wxMonthComboBoxCFv
+ ;wxConstructorForwxCalendarEvent()
+ wxConstructorForwxCalendarEvent__Fv
;wxCalendarCtrl::~wxCalendarCtrl()
__dt__14wxCalendarCtrlFv
;wxCalendarCtrl::SetHolidayAttrs()
__dt__7wxCaretFv
;wxCaretTimer::wxCaretTimer(wxCaret*)
__ct__12wxCaretTimerFP7wxCaret
+ ;wxCaret::OnTimer()
+ OnTimer__7wxCaretFv
+ ;wxCaret::Refresh()
+ Refresh__7wxCaretFv
+ ;wxCaret::OnSetFocus()
+ OnSetFocus__7wxCaretFv
+ ;wxCaret::OnKillFocus()
+ OnKillFocus__7wxCaretFv
;wxCaret::DoShow()
DoShow__7wxCaretFv
;wxCaret::DoHide()
__dt__18wxGenericDragImageFv
;wxGenericDragImage::Create(const wxIcon&,const wxCursor&,const wxPoint&)
Create__18wxGenericDragImageFRC6wxIconRC8wxCursorRC7wxPoint
- ;wxGenericDragImage::wxGenericDragImage()
- __ct__18wxGenericDragImageFv
+ ;wxGenericDragImage::BeginDrag(const wxPoint&,wxWindow*,wxWindow*)
+ BeginDrag__18wxGenericDragImageFRC7wxPointP8wxWindowT2
;wxGenericDragImage::Show()
Show__18wxGenericDragImageFv
;wxGenericDragImage::Hide()
Hide__18wxGenericDragImageFv
- ;wxGenericDragImage::BeginDrag(const wxPoint&,wxWindow*,wxWindow*)
- BeginDrag__18wxGenericDragImageFRC7wxPointP8wxWindowT2
;wxGenericDragImage::Create(const wxTreeCtrl&,wxTreeItemId&)
Create__18wxGenericDragImageFRC10wxTreeCtrlR12wxTreeItemId
__vft18wxGenericDragImage8wxObject
Init__18wxGenericDragImageFv
;wxGenericDragImage::EndDrag()
EndDrag__18wxGenericDragImageFv
+ ;wxGenericDragImage::UpdateBackingFromWindow(wxDC&,wxMemoryDC&,const wxRect&,const wxRect&) const
+ UpdateBackingFromWindow__18wxGenericDragImageCFR4wxDCR10wxMemoryDCRC6wxRectT3
+ ;wxGenericDragImage::Create(const wxCursor&,const wxPoint&)
+ Create__18wxGenericDragImageFRC8wxCursorRC7wxPoint
+ ;wxGenericDragImage::DoDrawImage(wxDC&,const wxPoint&) const
+ DoDrawImage__18wxGenericDragImageCFR4wxDCRC7wxPoint
;wxGenericDragImage::Create(const wxListCtrl&,long)
Create__18wxGenericDragImageFRC10wxListCtrll
;wxGenericDragImage::sm_classwxGenericDragImage
Replace__11wxImageListFiRC8wxBitmap
;wxImageList::wxImageList(int,int,unsigned long,int)
__ct__11wxImageListFiT1UlT1
+ ;wxImageList::Create(int,int,unsigned long,int)
+ Create__11wxImageListFiT1UlT1
;wxImageList::~wxImageList()
__dt__11wxImageListFv
;wxImageList::GetSize(int,int&,int&) const
OnIdle__10wxListCtrlFR11wxIdleEvent
;wxListMainWindow::DeleteItem(long)
DeleteItem__16wxListMainWindowFl
- ;wxListItemData::SetSize(int,int)
- SetSize__14wxListItemDataFiT1
+ ;wxListLineDataArray::wxListLineDataArray(const wxListLineDataArray&)
+ __ct__19wxListLineDataArrayFRC19wxListLineDataArray
;wxListEvent::wxListEvent(int,int)
__ct__11wxListEventFiT1
+ ;wxListItemData::SetSize(int,int)
+ SetSize__14wxListItemDataFiT1
;wxListLineData::SetItem(int,const wxListItem&)
SetItem__14wxListLineDataFiRC10wxListItem
;wxListMainWindow::SendNotify(wxListLineData*,int)
GetItemRect__16wxListMainWindowFlR6wxRect
;wxListEvent::CopyObject(wxObject&) const
CopyObject__11wxListEventCFR8wxObject
- ;wxListItemData::IsHit(int,int) const
- IsHit__14wxListItemDataCFiT1
+ ;wxListLineDataArray::operator=(const wxListLineDataArray&)
+ __as__19wxListLineDataArrayFRC19wxListLineDataArray
;wxListLineData::sm_classwxListLineData
sm_classwxListLineData__14wxListLineData
;wxListItem::sm_classwxListItem
SelectLine__16wxListMainWindowFP14wxListLineData
;wxListHeaderData::IsHit(int,int) const
IsHit__16wxListHeaderDataCFiT1
+ ;wxListItemData::IsHit(int,int) const
+ IsHit__14wxListItemDataCFiT1
;wxListCtrl::InsertItem(wxListItem&)
InsertItem__10wxListCtrlFR10wxListItem
;wxListMainWindow::HitTest(int,int,int&)
OnChar__14wxListTextCtrlFR10wxKeyEvent
;wxListLineData::IsInRect(int,int,const wxRect&)
IsInRect__14wxListLineDataFiT1RC6wxRect
+ ;wxListLineDataArray::Index(const wxListLineData&,unsigned long) const
+ Index__19wxListLineDataArrayCFRC14wxListLineDataUl
;wxListLineData::Hilight(unsigned long)
Hilight__14wxListLineDataFUl
;wxListCtrl::FindItem(long,const wxString&,unsigned long)
FindItem__10wxListCtrlFlRC8wxStringUl
;wxListLineData::DrawRubberBand(wxDC*,unsigned long)
DrawRubberBand__14wxListLineDataFP4wxDCUl
- ;wxListItemData::SetPosition(int,int)
- SetPosition__14wxListItemDataFiT1
+ ;wxListLineDataArray::RemoveAt(unsigned int)
+ RemoveAt__19wxListLineDataArrayFUi
;wxListHeaderData::wxListHeaderData(const wxListItem&)
__ct__16wxListHeaderDataFRC10wxListItem
;wxListHeaderData::SetWidth(int)
SetWidth__16wxListHeaderDataFi
;wxListHeaderData::SetPosition(int,int)
SetPosition__16wxListHeaderDataFiT1
+ ;wxListItemData::SetPosition(int,int)
+ SetPosition__14wxListItemDataFiT1
;wxListCtrl::SetItemState(long,long,long)
SetItemState__10wxListCtrlFlN21
;wxListHeaderData::SetHeight(int)
DeleteItem__10wxListCtrlFl
;wxListLineData::AssignRect(wxRect&,const wxRect&)
AssignRect__14wxListLineDataFR6wxRectRC6wxRect
- ;wxListItemData::SetImage(int)
- SetImage__14wxListItemDataFi
+ ;wxListLineDataArray::DoCopy(const wxListLineDataArray&)
+ DoCopy__19wxListLineDataArrayFRC19wxListLineDataArray
;wxListMainWindow::UnfocusLine(wxListLineData*)
UnfocusLine__16wxListMainWindowFP14wxListLineData
+ ;wxListItemData::SetImage(int)
+ SetImage__14wxListItemDataFi
;wxListCtrl::SetColumn(int,wxListItem&)
SetColumn__10wxListCtrlFiR10wxListItem
;wxListLineData::InitItems(int)
DeleteColumn__16wxListMainWindowFi
;wxListLineData::CalculateSize(wxDC*,int)
CalculateSize__14wxListLineDataFP4wxDCi
- ;wxListMainWindow::GetImageSize(int,int&,int&)
- GetImageSize__16wxListMainWindowFiRiT2
+ ;wxListLineDataArray::~wxListLineDataArray()
+ __dt__19wxListLineDataArrayFv
;wxConstructorForwxListItem()
wxConstructorForwxListItem__Fv
;wxListCtrl::~wxListCtrl()
GetSelectedItemCount__10wxListCtrlCFv
;wxListMainWindow::GetMode() const
GetMode__16wxListMainWindowCFv
+ ;wxListMainWindow::GetImageSize(int,int&,int&)
+ GetImageSize__16wxListMainWindowFiRiT2
;wxListHeaderWindow::GetEventTable() const
GetEventTable__18wxListHeaderWindowCFv
;wxListCtrl::GetDropTarget() const
EnsureVisible__16wxListMainWindowFl
;wxListCtrl::EnsureVisible(long)
EnsureVisible__10wxListCtrlFl
- ;wxListItemData::wxListItemData(const wxListItem&)
- __ct__14wxListItemDataFRC10wxListItem
+ ;wxListLineDataArray::Add(const wxListLineData&)
+ Add__19wxListLineDataArrayFRC14wxListLineData
;wxListItemData::sm_classwxListItemData
sm_classwxListItemData__14wxListItemData
;wxListHeaderData::sm_classwxListHeaderData
sm_classwxListHeaderData__16wxListHeaderData
+ ;wxListItemData::wxListItemData(const wxListItem&)
+ __ct__14wxListItemDataFRC10wxListItem
;wxListMainWindow::SetItem(wxListItem&)
SetItem__16wxListMainWindowFR10wxListItem
;wxListItemData::SetItem(const wxListItem&)
ScrollList__10wxListCtrlFiT1
;wxListLineData::IsHit(int,int)
IsHit__14wxListLineDataFiT1
+ ;wxListLineDataArray::Insert(const wxListLineData&,unsigned int)
+ Insert__19wxListLineDataArrayFRC14wxListLineDataUi
;wxListMainWindow::InsertItem(wxListItem&)
InsertItem__16wxListMainWindowFR10wxListItem
;wxListCtrl::InsertItem(long,const wxString&,int)
FindItem__10wxListCtrlFlRC7wxPointi
;wxListMainWindow::DeleteLine(wxListLineData*)
DeleteLine__16wxListMainWindowFP14wxListLineData
+ ;wxListLineDataArray::DoEmpty()
+ DoEmpty__19wxListLineDataArrayFv
;wxConstructorForwxListItemData()
wxConstructorForwxListItemData__Fv
;wxConstructorForwxListHeaderWindow()
__ct__18wxListHeaderWindowFP8wxWindowiP16wxListMainWindowRC7wxPointRC6wxSizelRC8wxString
;wxListMainWindow::wxListMainWindow(wxWindow*,int,const wxPoint&,const wxSize&,long,const wxString&)
__ct__16wxListMainWindowFP8wxWindowiRC7wxPointRC6wxSizelRC8wxString
+ ;wxListHeaderWindow::AdjustDC(wxDC&)
+ AdjustDC__18wxListHeaderWindowFR4wxDC
;From object file: ..\generic\logg.cpp
;PUBDEFs (Symbols available from object file):
;wxLogDialog::wxLogDialog(wxWindow*,const wxArrayString&,const wxArrayInt&,const wxArrayLong&,const wxString&,long)
Flush__8wxLogGuiFv
;wxLogFrame::DoClose()
DoClose__10wxLogFrameFv
+ ;wxLogDialog::CreateDetailsControls()
+ CreateDetailsControls__11wxLogDialogFv
;wxLogGui::DoLog(unsigned long,const char*,long)
DoLog__8wxLogGuiFUlPCcl
;wxLogDialog::OnListSelect(wxListEvent&)
__vft11wxLogWindow5wxLog
;wxLogTextCtrl::DoLogString(const char*,long)
DoLogString__13wxLogTextCtrlFPCcl
+ ;wxLogDialog::OnSave(wxCommandEvent&)
+ OnSave__11wxLogDialogFR14wxCommandEvent
;wxLogFrame::OnCloseWindow(wxCloseEvent&)
OnCloseWindow__10wxLogFrameFR12wxCloseEvent
;wxLogWindow::DoLogString(const char*,long)
SetFocus__7wxPanelFv
;wxPanel::SetFocusToChild()
SetFocusToChild__7wxPanelFv
+ ;wxSetFocusToChild(wxWindow*,wxWindow**)
+ wxSetFocusToChild__FP8wxWindowPP8wxWindow
;From object file: ..\generic\plot.cpp
;PUBDEFs (Symbols available from object file):
;wxPlotXAxisArea::OnMouse(wxMouseEvent&)
GetAt__12wxPlotWindowFUi
;wxPlotWindow::Delete(wxPlotOnOffCurve*)
Delete__12wxPlotWindowFP16wxPlotOnOffCurve
- ;wxArrayPlotOnOff::Empty()
- Empty__16wxArrayPlotOnOffFv
- ;wxConstructorForwxPlotYAxisArea()
- wxConstructorForwxPlotYAxisArea__Fv
;wxArrayPlotOnOff::wxArrayPlotOnOff(const wxArrayPlotOnOff&)
__ct__16wxArrayPlotOnOffFRC16wxArrayPlotOnOff
+ ;wxConstructorForwxPlotYAxisArea()
+ wxConstructorForwxPlotYAxisArea__Fv
;wxPlotWindow::RedrawXAxis()
RedrawXAxis__12wxPlotWindowFv
;wxPlotWindow::GetOnOffCurveCount()
sm_classwxPlotXAxisArea__15wxPlotXAxisArea
;wxPlotWindow::Add(wxPlotOnOffCurve*)
Add__12wxPlotWindowFP16wxPlotOnOffCurve
- ;wxPlotCurve::wxPlotCurve(int,double,double)
- __ct__11wxPlotCurveFidT2
+ ;wxArrayPlotOnOff::DoEmpty()
+ DoEmpty__16wxArrayPlotOnOffFv
;wxConstructorForwxPlotXAxisArea()
wxConstructorForwxPlotXAxisArea__Fv
;wxPlotWindow::~wxPlotWindow()
__dt__12wxPlotWindowFv
+ ;wxPlotCurve::wxPlotCurve(int,double,double)
+ __ct__11wxPlotCurveFidT2
;wxPlotXAxisArea::GetEventTable() const
GetEventTable__15wxPlotXAxisAreaCFv
;wxPlotArea::GetEventTable() const
OnCompareItems__10wxTreeCtrlFRC12wxTreeItemIdT1
;wxTreeCtrl::CalculateLevel(wxGenericTreeItem*,wxDC&,int,int&)
CalculateLevel__10wxTreeCtrlFP17wxGenericTreeItemR4wxDCiRi
- ;wxArrayTreeItemIds::Empty()
- Empty__18wxArrayTreeItemIdsFv
+ ;wxTreeCtrl::OnRenameAccept()
+ OnRenameAccept__10wxTreeCtrlFv
;wxConstructorForwxTreeEvent()
wxConstructorForwxTreeEvent__Fv
;wxConstructorForwxTreeCtrl()
SetItemTextColour__10wxTreeCtrlFRC12wxTreeItemIdRC8wxColour
;wxTreeCtrl::SetItemBackgroundColour(const wxTreeItemId&,const wxColour&)
SetItemBackgroundColour__10wxTreeCtrlFRC12wxTreeItemIdRC8wxColour
- ;wxTreeCtrl::OnRenameAccept()
- OnRenameAccept__10wxTreeCtrlFv
;wxTreeCtrl::GetStateImageList() const
GetStateImageList__10wxTreeCtrlCFv
;wxTreeCtrl::GetCount() const
PaintLevel__10wxTreeCtrlFP17wxGenericTreeItemR4wxDCiRi
;wxTreeCtrl::AddRoot(const wxString&,int,int,wxTreeItemData*)
AddRoot__10wxTreeCtrlFRC8wxStringiT2P14wxTreeItemData
- ;wxTreeCtrl::SetItemImage(const wxTreeItemId&,int,wxTreeItemIcon)
- SetItemImage__10wxTreeCtrlFRC12wxTreeItemIdi14wxTreeItemIcon
+ ;wxArrayTreeItemIds::DoEmpty()
+ DoEmpty__18wxArrayTreeItemIdsFv
;wxArrayTreeItemIds::~wxArrayTreeItemIds()
__dt__18wxArrayTreeItemIdsFv
+ ;wxTreeCtrl::SetItemImage(const wxTreeItemId&,int,wxTreeItemIcon)
+ SetItemImage__10wxTreeCtrlFRC12wxTreeItemIdi14wxTreeItemIcon
;wxTreeCtrl::SelectItem(const wxTreeItemId&,unsigned long,unsigned long)
SelectItem__10wxTreeCtrlFRC12wxTreeItemIdUlT2
;wxGenericTreeItem::Reset()
__as__18wxHtmlBookRecArrayFRC18wxHtmlBookRecArray
;HP_TagHandler::WriteOut(wxHtmlContentsItem*&,int&)
WriteOut__13HP_TagHandlerFRP18wxHtmlContentsItemRi
- ;wxHtmlBookRecArray::Empty()
- Empty__18wxHtmlBookRecArrayFv
+ ;wxHtmlBookRecArray::DoEmpty()
+ DoEmpty__18wxHtmlBookRecArrayFv
;wxHtmlBookRecArray::Add(const wxHtmlBookRecord&)
Add__18wxHtmlBookRecArrayFRC16wxHtmlBookRecord
;wxHtmlHelpData::SaveCachedBook(wxHtmlBookRecord*,wxOutputStream*)
DoCopy__16HtmlHistoryArrayFRC16HtmlHistoryArray
;HtmlHistoryArray::Add(const HtmlHistoryItem&)
Add__16HtmlHistoryArrayFRC15HtmlHistoryItem
- ;HtmlHistoryArray::Empty()
- Empty__16HtmlHistoryArrayFv
+ ;HtmlHistoryArray::DoEmpty()
+ DoEmpty__16HtmlHistoryArrayFv
;wxConstructorForwxHtmlWinModule()
wxConstructorForwxHtmlWinModule__Fv
;wxHtmlWindow::HistoryClear()
__ct__22wxHtmlImageMapAreaCellFQ2_22wxHtmlImageMapAreaCell8celltypeR8wxStringd
;wxHtmlImageMapAreaCell::GetLink(int,int) const
GetLink__22wxHtmlImageMapAreaCellCFiT1
- ;CoordArray::Empty()
- Empty__10CoordArrayFv
;wxHtmlImageMapCell::Find(int,const void*) const
Find__18wxHtmlImageMapCellCFiPCv
;HTML_ModuleImage::sm_classHTML_ModuleImage
sm_classHTML_ModuleImage__16HTML_ModuleImage
;_link_dummy_func_m_image()
_link_dummy_func_m_image__Fv
+ ;CoordArray::DoEmpty()
+ DoEmpty__10CoordArrayFv
;wxHtmlImageCell::wxHtmlImageCell(wxFSFile*,int,int,double,int,wxString)
__ct__15wxHtmlImageCellFP8wxFSFileiT2dT28wxString
__vft18wxHtmlImageMapCell8wxObject
wxTheApp
;wxApp::sm_classwxApp
sm_classwxApp__5wxApp
- ;wxMsgArray::Empty()
- Empty__10wxMsgArrayFv
+ ;wxConstructorForwxApp()
+ wxConstructorForwxApp__Fv
;wxWakeUpIdle()
wxWakeUpIdle__Fv
wxSTD_MDICHILDFRAME_ICON
- ;wxConstructorForwxApp()
- wxConstructorForwxApp__Fv
vHabmain
;wxApp::~wxApp()
__dt__5wxAppFv
DoCopy__10wxMsgArrayFRC10wxMsgArray
;wxMsgArray::operator=(const wxMsgArray&)
__as__10wxMsgArrayFRC10wxMsgArray
- ;wxApp::GetEventTable() const
- GetEventTable__5wxAppCFv
;wxYield()
wxYield__Fv
wxSTD_FRAME_ICON
MainLoop__5wxAppFv
;wxApp::Initialized()
Initialized__5wxAppFv
+ ;wxApp::GetEventTable() const
+ GetEventTable__5wxAppCFv
+ ;wxMsgArray::DoEmpty()
+ DoEmpty__10wxMsgArrayFv
wxFrameClassNameNoRedraw
;wxSetInstance(unsigned long)
wxSetInstance__FUl
sm_classwxCursor__8wxCursor
;wxCursor::FreeResource(unsigned long)
FreeResource__8wxCursorFUl
- ;wxCursor::~wxCursor()
- __dt__8wxCursorFv
;wxSetCursor(const wxCursor&)
wxSetCursor__FRC8wxCursor
+ ;wxCursor::~wxCursor()
+ __dt__8wxCursorFv
;wxCursor::wxCursor(const char*,int,int,int,int,const char*)
__ct__8wxCursorFPCciN32T1
__vft15wxCursorRefData15wxObjectRefData
wxITALIC_FONT
wxGREY_BRUSH
wxWHITE
- wxHOURGLASS_CURSOR
+ wxBLACK_PEN
wxScrollBarNameStr
wxSTANDARD_CURSOR
wxMessageBoxCaptionStr
+ wxHOURGLASS_CURSOR
wxComboBoxNameStr
wxCROSS_CURSOR
- wxBLACK_PEN
wxTopLevelWindows
wxTRANSPARENT_BRUSH
wxWHITE_BRUSH
RemoveAt__13wxArrayDCInfoFUi
;wxPaintDC::FindInCache(unsigned int*) const
FindInCache__9wxPaintDCCFPUi
+ ;wxArrayDCInfo::DoEmpty()
+ DoEmpty__13wxArrayDCInfoFv
;wxWindowDC::~wxWindowDC()
__dt__10wxWindowDCFv
;wxClientDC::~wxClientDC()
wxConstructorForwxClientDC__Fv
;wxWindowDC::wxWindowDC()
__ct__10wxWindowDCFv
- ;wxArrayDCInfo::Empty()
- Empty__13wxArrayDCInfoFv
;wxArrayDCInfo::wxArrayDCInfo(const wxArrayDCInfo&)
__ct__13wxArrayDCInfoFRC13wxArrayDCInfo
;wxWindowDC::sm_classwxWindowDC
msgid ""
msgstr ""
"Project-Id-Version: wxWindows-2.2\n"
-"POT-Creation-Date: 2000-07-01 14:41+0200\n"
+"POT-Creation-Date: 2000-07-09 00:08+0200\n"
"PO-Revision-Date: 2000-06-17 19:23+0200\n"
"Last-Translator: Vaclav Slavik <v.slavik@volny.cz>\n"
"Language-Team: wxWindows Team <wx-devel@wxwindows.org>\n"
msgid "%i of %i"
msgstr "%i z %i"
-#: ../src/common/cmdline.cpp:727
+#: ../src/common/cmdline.cpp:735
#, c-format
msgid "%s (or %s)"
msgstr "%s (nebo %s)"
#: ../src/generic/logg.cpp:239
+#, c-format
msgid "%s Error"
msgstr "%s - chyba"
#: ../src/generic/logg.cpp:247
+#, c-format
msgid "%s Information"
msgstr "%s - informace"
#: ../src/generic/logg.cpp:243
+#, c-format
msgid "%s Warning"
msgstr "%s - varovánÃ"
msgid "'%s' is invalid"
msgstr "'%s' je neplatný"
-#: ../src/common/cmdline.cpp:649
+#: ../src/common/cmdline.cpp:657
#, c-format
msgid "'%s' is not a correct numeric value for option '%s'."
msgstr "'%s' nenà správná èÃselná hodnota pro volbu '%s'."
#: ../src/generic/filedlgg.cpp:323
msgid "<DIR> "
-msgstr "<ADR >"
+msgstr "<ADR> "
#: ../src/generic/filedlgg.cpp:357
msgid "<LINK>"
msgid "Add current page to bookmarks"
msgstr "Pøidá tuto stránku k zálo¾kám"
-#: ../src/generic/colrdlgg.cpp:272
+#: ../src/generic/colrdlgg.cpp:269
msgid "Add to custom colours"
msgstr "Pøidat k u¾ivatelským barvám"
msgid "Can't set value of '%s'"
msgstr "Nemohu nastavit hodnotu '%s'"
-#: ../src/common/dlgcmn.cpp:148 ../src/common/prntbase.cpp:107
+#: ../src/common/dlgcmn.cpp:148 ../src/common/prntbase.cpp:109
#: ../src/generic/dcpsg.cpp:2241 ../src/generic/dirdlgg.cpp:424
#: ../src/generic/filedlgg.cpp:916 ../src/generic/fontdlgg.cpp:257
#: ../src/generic/prntdlgg.cpp:468 ../src/generic/progdlgg.cpp:179
msgid "Clear the log contents"
msgstr "Smazat obsah logu"
-#: ../src/common/prntbase.cpp:357 ../src/generic/progdlgg.cpp:307
+#: ../src/common/prntbase.cpp:359 ../src/generic/progdlgg.cpp:307
#: ../src/generic/proplist.cpp:518
msgid "Close"
msgstr "ZavøÃt"
"Nemohu zjistit id menu '%s'. Pou¾ijte (nenulové) èÃslo\n"
"nebo poskytnìte #define (viz. manuál)"
-#: ../src/common/prntbase.cpp:709
+#: ../src/common/prntbase.cpp:711
msgid "Could not start document preview."
msgstr "Nemohu zobrazit náhled dokumentu."
-#: ../src/generic/printps.cpp:200 ../src/msw/printwin.cpp:242
+#: ../src/generic/printps.cpp:209 ../src/msw/printwin.cpp:252
msgid "Could not start printing."
msgstr "Nemohu zahájit tisk."
-#: ../src/common/wincmn.cpp:777
+#: ../src/common/wincmn.cpp:782
msgid "Could not transfer data to window"
msgstr "Nemohu pøenést data do okna."
msgstr ""
"Chyba bìhem expanze promìnných prostøedÃ: chybà '%c' na pozici %d v '%s'."
-#: ../src/generic/dcpsg.cpp:1584 ../src/generic/dirdlgg.cpp:268
-#: ../src/generic/dirdlgg.cpp:286 ../src/generic/dirdlgg.cpp:297
-#: ../src/generic/dirdlgg.cpp:604 ../src/generic/filedlgg.cpp:625
-#: ../src/generic/filedlgg.cpp:717 ../src/generic/filedlgg.cpp:731
-#: ../src/generic/filedlgg.cpp:744 ../src/generic/filedlgg.cpp:1043
-#: ../src/generic/filedlgg.cpp:1092 ../src/generic/helpxlp.cpp:241
-#: ../src/gtk/filedlg.cpp:83 ../src/gtk/fontdlg.cpp:72
+#: ../src/generic/dirdlgg.cpp:268 ../src/generic/dirdlgg.cpp:286
+#: ../src/generic/dirdlgg.cpp:297 ../src/generic/dirdlgg.cpp:604
+#: ../src/generic/filedlgg.cpp:625 ../src/generic/filedlgg.cpp:717
+#: ../src/generic/filedlgg.cpp:731 ../src/generic/filedlgg.cpp:744
+#: ../src/generic/filedlgg.cpp:1043 ../src/generic/filedlgg.cpp:1092
+#: ../src/generic/helpxlp.cpp:241 ../src/gtk/filedlg.cpp:83
+#: ../src/gtk/fontdlg.cpp:72
msgid "Error"
msgstr "Chyba"
msgid "Failed to get data from the clipboard"
msgstr "Nelze zÃskat data ze schránky"
-#: ../src/common/timercmn.cpp:243
+#: ../src/common/timercmn.cpp:237
msgid "Failed to get the UTC system time."
msgstr "Nemohu zjistit systémový UTC èas."
-#: ../src/common/timercmn.cpp:195
+#: ../src/common/timercmn.cpp:189
msgid "Failed to get the local system time"
msgstr "Nepodaøilo se zjistit mÃstnà systémový èas"
msgid "Option '%s' requires a value, '=' expected."
msgstr "Volba '%s' vy¾aduje hodnotu, oèekávám '='."
-#: ../src/common/cmdline.cpp:609
+#: ../src/common/cmdline.cpp:610
#, c-format
msgid "Option '%s' requires a value."
msgstr "Volba '%s' vy¾aduje hodnotu."
-#: ../src/common/cmdline.cpp:663
+#: ../src/common/cmdline.cpp:671
#, c-format
msgid "Option '%s': '%s' cannot be converted to a date."
msgstr "Volba '%s': '%s' neudává datum."
msgid "PNM: File seems truncated."
msgstr "PNM: Soubor je nejspù uøÃznutý pøed koncem."
-#: ../src/common/prntbase.cpp:729
+#: ../src/common/prntbase.cpp:731
#, c-format
msgid "Page %d"
msgstr "Strana %d"
-#: ../src/common/prntbase.cpp:727
+#: ../src/common/prntbase.cpp:729
#, c-format
msgid "Page %d of %d"
msgstr "Strana %d z %d"
msgid "Please choose which ISP do you want to connect to"
msgstr "ProsÃm vyberte si poskytovatele (ISP), ke kterému se chcete pøipojit"
-#: ../src/common/prntbase.cpp:105
+#: ../src/common/prntbase.cpp:107
msgid "Please wait..."
msgstr "Èekejte prosÃm..."
msgid "Preview:"
msgstr "Náhled:"
-#: ../src/html/htmprint.cpp:486
-msgid "Previewing"
-msgstr "VytváøÃm náhled"
-
#: ../src/html/helpfrm.cpp:512
msgid "Previous page"
msgstr "Pøedchozà stránka"
msgid "Print"
msgstr "Vytisknout"
-#: ../src/generic/printps.cpp:200
-msgid "Print Error"
-msgstr "Chyba tisku"
-
#: ../src/common/docview.cpp:895
msgid "Print Preview"
msgstr "Náhled tisku"
-#: ../src/common/prntbase.cpp:685 ../src/common/prntbase.cpp:709
+#: ../src/common/prntbase.cpp:687 ../src/common/prntbase.cpp:711
msgid "Print Preview Failure"
msgstr "Chyba bìhem vytváøenà náhledu."
msgid "Print to File"
msgstr "Tisknout do souboru"
-#: ../src/common/prntbase.cpp:364
+#: ../src/common/prntbase.cpp:366
msgid "Print..."
msgstr "Tisknout..."
msgid "Printer..."
msgstr "Tiskárna..."
-#: ../src/common/prntbase.cpp:104 ../src/common/prntbase.cpp:146
-#: ../src/html/htmprint.cpp:507
+#: ../src/common/prntbase.cpp:106 ../src/common/prntbase.cpp:148
msgid "Printing"
msgstr "Tisk"
-#: ../src/common/prntbase.cpp:118
+#: ../src/common/prntbase.cpp:120
msgid "Printing Error"
msgstr "Chyba tisku"
-#: ../src/generic/printps.cpp:218
+#: ../src/generic/printps.cpp:232
#, c-format
msgid "Printing page %d..."
msgstr "Tisknu stranu %d..."
-#: ../src/generic/printps.cpp:185
+#: ../src/generic/printps.cpp:192
msgid "Printing..."
msgstr "Tisknu..."
msgid "Send to Printer"
msgstr "Poslat na tiskárnu"
+#: ../src/common/cmdline.cpp:627
+#, c-format
+msgid "Separator expected after the option '%s'."
+msgstr ""
+
#: ../src/common/dlgcmn.cpp:138
msgid "Setup"
msgstr "NastavenÃ"
msgid "Sorry, could not save this file."
msgstr "Tento soubor nelze ulo¾it."
-#: ../src/common/prntbase.cpp:685
+#: ../src/common/prntbase.cpp:687
msgid "Sorry, not enough memory to create a preview."
msgstr "Nedostatek pamìti na vytvoøenà náhledu."
"Soubor '%s' neexistuje.\n"
"Bude odstranìn ze seznamu nedávno otevøených souborù."
-#: ../src/common/cmdline.cpp:753
+#: ../src/common/cmdline.cpp:761
#, c-format
msgid "The required parameter '%s' was not specified."
msgstr "Po¾adovaný parametr '%s' nebyl zadán."
msgid "The text couldn't be saved."
msgstr "Text nelze ulo¾it."
-#: ../src/common/cmdline.cpp:732
+#: ../src/common/cmdline.cpp:740
#, c-format
msgid "The value for the option '%s' must be specified."
msgstr "MusÃte zadat hodnotu volby '%s'."
"Verze Remote Access Service (RAS) na tomto poèÃtaèi je pøÃli¹ stará, prosÃm "
"upgradujte (chybà tato funkce: %s)."
-#: ../src/html/htmprint.cpp:486
-msgid ""
-"There was a problem previewing.\n"
-"Perhaps your current printer is not set correctly?"
-msgstr ""
-"Pøi vytváøenà náhledu se vyskytl problém.\n"
-"Mo¾ná nemáte správnì nastavenou tiskárnu?"
-
-#: ../src/html/htmprint.cpp:507
-msgid ""
-"There was a problem printing.\n"
-"Perhaps your current printer is not set correctly?"
-msgstr ""
-"Pøi tisku se vyskytla chyba.\n"
-"Mo¾ná máte ¹patnì nastavenou tiskárnu?"
-
#: ../src/msw/thread.cpp:1058
msgid ""
"Thread module initialization failed: can not store value in thread local "
msgid "Unexpected end of file whilst parsing resource."
msgstr "Neoèekávaný konec souboru bìhem zpracovánà resource"
-#: ../src/common/cmdline.cpp:704
+#: ../src/common/cmdline.cpp:712
#, c-format
msgid "Unexpected parameter '%s'"
msgstr "Neoèekávaný parametr '%s'"
msgid "Unsupported clipboard format."
msgstr "Nepodporovaný formát schránky."
-#: ../src/common/cmdline.cpp:789
+#: ../src/common/cmdline.cpp:797
#, c-format
msgid "Usage: %s"
msgstr "Pou¾itÃ: %s"
msgid "ctrl"
msgstr "ctrl"
-#: ../src/common/cmdline.cpp:897
+#: ../src/common/cmdline.cpp:910
msgid "date"
msgstr "datum"
-#: ../src/common/datetime.cpp:3213
+#: ../src/common/datetime.cpp:3232
msgid "eighteenth"
msgstr "osmnáctý"
-#: ../src/common/datetime.cpp:3203
+#: ../src/common/datetime.cpp:3222
msgid "eighth"
msgstr "osmý"
-#: ../src/common/datetime.cpp:3206
+#: ../src/common/datetime.cpp:3225
msgid "eleventh"
msgstr "jedenáctý"
msgid "failed to flush the file '%s'"
msgstr "nelze vyprázdnit buffer souboru '%s'"
-#: ../src/common/datetime.cpp:3210
+#: ../src/common/datetime.cpp:3229
msgid "fifteenth"
msgstr "patnáctý"
-#: ../src/common/datetime.cpp:3200
+#: ../src/common/datetime.cpp:3219
msgid "fifth"
msgstr "pátý"
msgid "file '%s': unexpected character %c at line %d."
msgstr "soubor '%s': neoèekávaný znak %c na øádku %d."
-#: ../src/common/datetime.cpp:3196
+#: ../src/common/datetime.cpp:3215
msgid "first"
msgstr "prvnÃ"
-#: ../src/common/datetime.cpp:3209
+#: ../src/common/datetime.cpp:3228
msgid "fourteenth"
msgstr "ètrnáctý"
-#: ../src/common/datetime.cpp:3199
+#: ../src/common/datetime.cpp:3218
msgid "fourth"
msgstr "ètvrtý"
-#: ../src/common/timercmn.cpp:239
+#: ../src/common/timercmn.cpp:233
msgid "gmtime() failed"
msgstr "gmtime() selhalo"
msgid "medium"
msgstr "støednÃ"
-#: ../src/common/datetime.cpp:3360
+#: ../src/common/datetime.cpp:3379
msgid "midnight"
msgstr "Tenké"
-#: ../src/common/timercmn.cpp:235
+#: ../src/common/timercmn.cpp:229
msgid "mktime() failed"
msgstr "mktime() selhalo"
-#: ../src/common/datetime.cpp:3214
+#: ../src/common/datetime.cpp:3233
msgid "nineteenth"
msgstr "devatenáctý"
-#: ../src/common/datetime.cpp:3204
+#: ../src/common/datetime.cpp:3223
msgid "ninth"
msgstr "devátý"
msgid "noname"
msgstr "bezejmenná"
-#: ../src/common/datetime.cpp:3359
+#: ../src/common/datetime.cpp:3378
msgid "noon"
msgstr "poledne"
-#: ../src/common/cmdline.cpp:896
+#: ../src/common/cmdline.cpp:909
msgid "num"
msgstr "èÃslo"
msgid "reentrancy problem."
msgstr "problém reentrance."
-#: ../src/common/datetime.cpp:3197
+#: ../src/common/datetime.cpp:3216
msgid "second"
msgstr "druhý"
-#: ../src/common/datetime.cpp:3212
+#: ../src/common/datetime.cpp:3231
msgid "seventeenth"
msgstr "sedmnáctý"
-#: ../src/common/datetime.cpp:3202
+#: ../src/common/datetime.cpp:3221
msgid "seventh"
msgstr "sedmý"
msgid "shift"
msgstr "shift"
-#: ../src/common/datetime.cpp:3211
+#: ../src/common/datetime.cpp:3230
msgid "sixteenth"
msgstr "¹estnáctý"
-#: ../src/common/datetime.cpp:3201
+#: ../src/common/datetime.cpp:3220
msgid "sixth"
msgstr "¹estý"
msgid "small"
msgstr "malé"
-#: ../src/common/cmdline.cpp:895
+#: ../src/common/cmdline.cpp:908
msgid "str"
msgstr "øetìzec"
-#: ../src/common/datetime.cpp:3205
+#: ../src/common/datetime.cpp:3224
msgid "tenth"
msgstr "desátý"
msgid "the response to the transaction caused the DDE_FBUSY bit to be set."
msgstr "odpovìï na transakci zpùsobila nastavenà bitu DDE_FBUSY."
-#: ../src/common/datetime.cpp:3198
+#: ../src/common/datetime.cpp:3217
msgid "third"
msgstr "tøetÃ"
-#: ../src/common/datetime.cpp:3208
+#: ../src/common/datetime.cpp:3227
msgid "thirteenth"
msgstr "tøináctý"
-#: ../src/common/datetime.cpp:3003
+#: ../src/common/datetime.cpp:3022
msgid "today"
msgstr "dnes"
-#: ../src/common/datetime.cpp:3005
+#: ../src/common/datetime.cpp:3024
msgid "tomorrow"
msgstr "vèera"
-#: ../src/common/datetime.cpp:3207
+#: ../src/common/datetime.cpp:3226
msgid "twelfth"
msgstr "dvanáctý"
-#: ../src/common/datetime.cpp:3215
+#: ../src/common/datetime.cpp:3234
msgid "twentieth"
msgstr "dvacátý"
msgid "very small"
msgstr "velmi malé"
-#: ../src/common/timercmn.cpp:266
+#: ../src/common/timercmn.cpp:260
msgid "wxGetTimeOfDay failed."
msgstr "wxGetTimeOfDay selhalo."
msgid "wxWindows: error finding temporary file name.\n"
msgstr "wxWindows: chyba pøi hledánà jména doèasného souboru.\n"
-#: ../src/common/datetime.cpp:3004
+#: ../src/common/datetime.cpp:3023
msgid "yesterday"
msgstr "vèera"
+#~ msgid "Previewing"
+#~ msgstr "VytváøÃm náhled"
+
+#~ msgid "Print Error"
+#~ msgstr "Chyba tisku"
+
+#~ msgid ""
+#~ "There was a problem previewing.\n"
+#~ "Perhaps your current printer is not set correctly?"
+#~ msgstr ""
+#~ "Pøi vytváøenà náhledu se vyskytl problém.\n"
+#~ "Mo¾ná nemáte správnì nastavenou tiskárnu?"
+
+#~ msgid ""
+#~ "There was a problem printing.\n"
+#~ "Perhaps your current printer is not set correctly?"
+#~ msgstr ""
+#~ "Pøi tisku se vyskytla chyba.\n"
+#~ "Mo¾ná máte ¹patnì nastavenou tiskárnu?"
+
#~ msgid "Baltic II (ISO-8859-10)"
#~ msgstr "Baltské II (ISO-8859-10)"
//#define TEST_ARRAYS
//#define TEST_CMDLINE
-#define TEST_DATETIME
+//#define TEST_DATETIME
//#define TEST_DIR
//#define TEST_DLLLOADER
//#define TEST_EXECUTE
-//#define TEST_FILE
+#define TEST_FILE
//#define TEST_FILECONF
//#define TEST_HASH
//#define TEST_LIST
//#define TEST_STRINGS
//#define TEST_THREADS
//#define TEST_TIMER
-//#define TEST_VCARD
+//#define TEST_VCARD -- don't enable this (VZ)
//#define TEST_WCHAR
//#define TEST_ZIP
+//#define TEST_ZLIB
// ----------------------------------------------------------------------------
// test class for container objects
puts("File dump:\n----------");
- static const size_t len = 1024;
+ static const off_t len = 1024;
char buf[len];
for ( ;; )
{
{
printf("Number of lines: %u\n", file.GetLineCount());
printf("Last line: '%s'\n", file.GetLastLine().c_str());
+
+ wxString s;
+
+ puts("\nDumping the entire file:");
+ for ( s = file.GetFirstLine(); !file.Eof(); s = file.GetNextLine() )
+ {
+ printf("%6u: %s\n", file.GetCurrentLine() + 1, s.c_str());
+ }
+ printf("%6u: %s\n", file.GetCurrentLine() + 1, s.c_str());
+
+ puts("\nAnd now backwards:");
+ for ( s = file.GetLastLine();
+ file.GetCurrentLine() != 0;
+ s = file.GetPrevLine() )
+ {
+ printf("%6u: %s\n", file.GetCurrentLine() + 1, s.c_str());
+ }
+ printf("%6u: %s\n", file.GetCurrentLine() + 1, s.c_str());
}
else
{
#endif // TEST_ZIP
+// ----------------------------------------------------------------------------
+// ZLIB stream
+// ----------------------------------------------------------------------------
+
+#ifdef TEST_ZLIB
+
+#include <wx/zstream.h>
+#include <wx/wfstream.h>
+
+static const wxChar *FILENAME_GZ = _T("test.gz");
+static const char *TEST_DATA = "hello and hello again";
+
+static void TestZlibStreamWrite()
+{
+ puts("*** Testing Zlib stream reading ***\n");
+
+ wxFileOutputStream fileOutStream(FILENAME_GZ);
+ wxZlibOutputStream ostr(fileOutStream, 0);
+ printf("Compressing the test string... ");
+ ostr.Write(TEST_DATA, sizeof(TEST_DATA));
+ if ( !ostr )
+ {
+ puts("(ERROR: failed)");
+ }
+ else
+ {
+ puts("(ok)");
+ }
+
+ puts("\n----- done ------");
+}
+
+static void TestZlibStreamRead()
+{
+ puts("*** Testing Zlib stream reading ***\n");
+
+ wxFileInputStream fileInStream(FILENAME_GZ);
+ wxZlibInputStream istr(fileInStream);
+ printf("Archive size: %u\n", istr.GetSize());
+
+ puts("Dumping the file:");
+ while ( !istr.Eof() )
+ {
+ putchar(istr.GetC());
+ fflush(stdout);
+ }
+
+ puts("\n----- done ------");
+}
+
+#endif // TEST_ZLIB
+
// ----------------------------------------------------------------------------
// date time
// ----------------------------------------------------------------------------
printf("Now = %s\n", dt1.Format("%H:%M:%S:%l").c_str());
printf("UNow = %s\n", dt2.Format("%H:%M:%S:%l").c_str());
- printf("Difference is %s\n", (dt2 - dt1).Format("%l").c_str());
+ printf("Dummy loop: ");
+ for ( int i = 0; i < 6000; i++ )
+ {
+ //for ( int j = 0; j < 10; j++ )
+ {
+ wxString s;
+ s.Printf("%g", sqrt(i));
+ }
+
+ if ( !(i % 100) )
+ putchar('.');
+ }
+ puts(", done");
+
+ dt1 = dt2;
+ dt2 = wxDateTime::UNow();
+ printf("UNow = %s\n", dt2.Format("%H:%M:%S:%l").c_str());
+
+ printf("Loop executed in %s ms\n", (dt2 - dt1).Format("%l").c_str());
puts("\n*** done ***");
}
#endif // TEST_LOG
#ifdef TEST_FILE
- TestFileRead();
+ if ( 0 )
+ TestFileRead();
TestTextFileRead();
#endif // TEST_FILE
TestTimeArithmetics();
TestTimeHolidays();
TestTimeFormat();
+ TestTimeMS();
TestTimeZoneBug();
}
- TestTimeMS();
if ( 0 )
TestInteractive();
#endif // TEST_DATETIME
TestZipStreamRead();
#endif // TEST_ZIP
+#ifdef TEST_ZLIB
+ if ( 0 )
+ TestZlibStreamWrite();
+ TestZlibStreamRead();
+#endif // TEST_ZLIB
+
wxUninitialize();
return 0;
// parse the cmd line
int x = 50,
y = 50;
- if ( argc == 2 )
+ if ( argc == 3 )
{
wxSscanf(argv[1], "%d", &x);
wxSscanf(argv[2], "%d", &y);
/*
* This function will return the exact string(s) from the database engine
* indicating all error conditions which have just occured during the
- * last call to the database engine.
+ * last call to the database engine for the database connection pointed
+ * to by pDb.
*
* This demo uses the returned string by displaying it in a wxMessageBox. The
* formatting therefore is not the greatest, but this is just a demo, not a
* NOTE: The value returned by this function is for temporary use only and
* should be copied for long term use
*/
-char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine)
+const char *GetExtendedDBErrorMsg(wxDb *pDb, char *ErrFile, int ErrLine)
{
static wxString msg;
+ msg = "";
wxString tStr;
msg.Append ("\nODBC errors:\n");
msg += "\n";
- /* Scan through each database connection displaying
- * any ODBC errors that have occured. */
- wxDbList *pDbList;
- for (pDbList = PtrBegDbList; pDbList; pDbList = pDbList->PtrNext)
- {
- // Skip over any free connections
- if (pDbList->Free)
- continue;
- // Display errors for this connection
- int i;
- for (i = 0; i < DB_MAX_ERROR_HISTORY; i++)
+ // Display errors for this connection
+ int i;
+ for (i = 0; i < DB_MAX_ERROR_HISTORY; i++)
+ {
+ if (pDb->errorList[i])
{
- if (pDbList->PtrDb->errorList[i])
- {
- msg.Append(pDbList->PtrDb->errorList[i]);
- if (wxStrcmp(pDbList->PtrDb->errorList[i],"") != 0)
- msg.Append("\n");
- }
+ msg.Append(pDb->errorList[i]);
+ if (wxStrcmp(pDb->errorList[i],"") != 0)
+ msg.Append("\n");
+ // Clear the errmsg buffer so the next error will not
+ // end up showing the previous error that have occurred
+ wxStrcpy(pDb->errorList[i],"");
}
}
msg += "\n";
- return (char*) (const char*) msg;
+ return msg.c_str();
} // GetExtendedDBErrorMsg
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(FILE_CREATE, "&Create contact table");
+ file_menu->Append(FILE_CREATE, "&Create CONTACT table");
+ file_menu->Append(FILE_RECREATE_TABLE, "&Recreate CONTACT table");
+ file_menu->Append(FILE_RECREATE_INDEXES, "&Recreate CONTACT indexes");
file_menu->Append(FILE_EXIT, "E&xit");
wxMenu *edit_menu = new wxMenu;
params.Password[0] = 0;
params.DirPath[0] = 0;
+ // Show the frame
+ DemoFrame->Show(TRUE);
+
FILE *paramFile;
if ((paramFile = fopen(paramFilename, "r")) == NULL)
{
DemoFrame->BuildEditorDialog();
// Show the frame
- DemoFrame->Show(TRUE);
+ DemoFrame->Refresh();
return TRUE;
} // DatabaseDemoApp::OnInit()
+
BEGIN_EVENT_TABLE(DatabaseDemoFrame, wxFrame)
EVT_MENU(FILE_CREATE, DatabaseDemoFrame::OnCreate)
+ EVT_MENU(FILE_RECREATE_TABLE, DatabaseDemoFrame::OnRecreateTable)
+ EVT_MENU(FILE_RECREATE_INDEXES, DatabaseDemoFrame::OnRecreateIndexes)
EVT_MENU(FILE_EXIT, DatabaseDemoFrame::OnExit)
EVT_MENU(EDIT_PARAMETERS, DatabaseDemoFrame::OnEditParameters)
EVT_MENU(ABOUT_DEMO, DatabaseDemoFrame::OnAbout)
EVT_CLOSE(DatabaseDemoFrame::OnCloseWindow)
END_EVENT_TABLE()
+
// DatabaseDemoFrame constructor
DatabaseDemoFrame::DatabaseDemoFrame(wxFrame *frame, const wxString& title,
- const wxPoint& pos, const wxSize& size):
- wxFrame(frame, -1, title, pos, size)
+ const wxPoint& pos, const wxSize& size):
+ wxFrame(frame, -1, title, pos, size)
{
-// Put any code in necessary for initializing the main frame here
-}
+ // Put any code in necessary for initializing the main frame here
+ pEditorDlg = NULL;
+ pParamDlg = NULL;
+} // DatabaseDemoFrame constructor
+
void DatabaseDemoFrame::OnCreate(wxCommandEvent& event)
{
- CreateDataTable();
-}
+ CreateDataTable(FALSE);
+} // DatabaseDemoFrame::OnCreate()
+
+
+void DatabaseDemoFrame::OnRecreateTable(wxCommandEvent& event)
+{
+ CreateDataTable(TRUE);
+} // DatabaseDemoFrame::OnRecreate()
+
+
+void DatabaseDemoFrame::OnRecreateIndexes(wxCommandEvent& event)
+{
+ // Using a new connection to the database so as not to disturb
+ // the current cursors on the table in use in the editor dialog
+ Ccontact *Contact = new Ccontact();
+
+ if (!Contact)
+ {
+ wxEndBusyCursor();
+ wxMessageBox("Error allocating memory for 'Ccontact'object.\n\nTable could not be opened.","Error...",wxOK | wxICON_EXCLAMATION);
+ return;
+ }
+
+ if (!Contact->CreateIndexes())
+ {
+ wxEndBusyCursor();
+ wxString tStr;
+ tStr = "Error creating CONTACTS indexes.\nNew indexes will be unavailable.\n\n";
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
+ wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
+ }
+
+ delete Contact;
+ Contact = NULL;
+} // DatabaseDemoFrame::OnRecreateIndexes()
void DatabaseDemoFrame::OnExit(wxCommandEvent& event)
{
Close();
-}
+} // DatabaseDemoFrame::OnExit()
+
void DatabaseDemoFrame::OnEditParameters(wxCommandEvent& event)
{
BuildParameterDialog(this);
else
wxMessageBox("Cannot change database parameters while creating or editing a record","Notice...",wxOK | wxICON_INFORMATION);
-}
+} // DatabaseDemoFrame::OnEditParameters()
+
void DatabaseDemoFrame::OnAbout(wxCommandEvent& event)
{
wxMessageBox("wxWindows sample program for database classes\n\nContributed on 27 July 1998","About...",wxOK | wxICON_INFORMATION);
-}
+} // DatabaseDemoFrame::OnAbout()
+
void DatabaseDemoFrame::OnCloseWindow(wxCloseEvent& event)
{
// to close the program here that is not done elsewhere
// Clean up time
- if (pEditorDlg->Close())
+ if (pEditorDlg && pEditorDlg->Close())
pEditorDlg = NULL;
else
{
- event.Veto();
- return;
+ if (pEditorDlg)
+ {
+ event.Veto();
+ return;
+ }
}
+ // This function will close all the connections to the database that have been
+ // previously cached.
+ wxDbCloseConnections();
+
// Cleans up the environment space allocated for the SQL/ODBC connection handle
SQLFreeEnv(DbConnectInf.Henv);
} // DatabaseDemoFrame::OnCloseWindow()
-void DatabaseDemoFrame::CreateDataTable()
+void DatabaseDemoFrame::CreateDataTable(bool recreate)
{
- bool Ok = (wxMessageBox("Any data currently residing in the table will be erased.\n\nAre you sure?","Confirm",wxYES_NO|wxICON_QUESTION) == wxYES);
+ bool Ok = TRUE;
+ if (recreate)
+ Ok = (wxMessageBox("Any data currently residing in the table will be erased.\n\nAre you sure?","Confirm",wxYES_NO|wxICON_QUESTION) == wxYES);
if (!Ok)
return;
return;
}
- if (!Contact->CreateTable(FALSE))
+ if (!Contact->CreateTable(recreate))
{
wxEndBusyCursor();
wxString tStr;
tStr = "Error creating CONTACTS table.\nTable was not created.\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
success = FALSE;
}
- else
+ else
{
if (!Contact->CreateIndexes())
{
wxEndBusyCursor();
wxString tStr;
tStr = "Error creating CONTACTS indexes.\nIndexes will be unavailable.\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
success = FALSE;
}
wxEndBusyCursor();
delete Contact;
+ Contact = NULL;
if (success)
wxMessageBox("Table and index(es) were successfully created.","Notice...",wxOK | wxICON_INFORMATION);
void DatabaseDemoFrame::BuildEditorDialog()
{
+ pEditorDlg = NULL;
pEditorDlg = new CeditorDlg(this);
- if (!pEditorDlg)
+ if (pEditorDlg)
+ {
+ pEditorDlg->Initialize();
+ if (!pEditorDlg->initialized)
+ {
+ pEditorDlg->Close();
+ delete pEditorDlg;
+ wxMessageBox("Unable to initialize the editor dialog for some reason","Error...",wxOK | wxICON_EXCLAMATION);
+ DemoFrame->Close();
+ }
+ }
+ else
+ {
wxMessageBox("Unable to create the editor dialog for some reason","Error...",wxOK | wxICON_EXCLAMATION);
+ DemoFrame->Close();
+ }
} // DatabaseDemoFrame::BuildEditorDialog()
{
wxString tStr;
tStr = "Unable to Free the Ccontact data table handle\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+ tStr += GetExtendedDBErrorMsg(GetDb(),__FILE__,__LINE__);
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
}
}
EVT_CLOSE(CeditorDlg::OnCloseWindow)
END_EVENT_TABLE()
-CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 1, 1, 460, 455)
+CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 0, 0, 537, 480)
{
// Since the ::OnCommand() function is overridden, this prevents the widget
// detection in ::OnCommand() until all widgets have been initialized to prevent
// uninitialized pointers from crashing the program
widgetPtrsSet = FALSE;
- // Create the data structure and a new database connection.
- // (As there is not a pDb being passed in the constructor, a new database
- // connection is created)
- Contact = new Ccontact();
-
- if (!Contact)
- {
- wxMessageBox("Unable to instantiate an instance of Ccontact","Error...",wxOK | wxICON_EXCLAMATION);
- return;
- }
-
- // Check if the table exists or not. If it doesn't, ask the user if they want to
- // create the table. Continue trying to create the table until it exists, or user aborts
- while (!Contact->GetDb()->TableExists((char *)CONTACT_TABLE_NAME,DbConnectInf.Uid,DbConnectInf.defaultDir))
- {
- wxString tStr;
- tStr.Printf("Unable to open the table '%s'.\n\nTable may need to be created...?\n\n",CONTACT_TABLE_NAME);
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
- wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
-
- bool createTable = (wxMessageBox("Do you wish to try to create/clear the CONTACTS table?","Confirm",wxYES_NO|wxICON_QUESTION) == wxYES);
-
- if (!createTable)
- {
- delete Contact;
- Close();
- DemoFrame->Close();
- return;
- }
- else
- DemoFrame->CreateDataTable();
- }
-
- // Tables must be "opened" before anything other than creating/deleting table can be done
- if (!Contact->Open())
- {
- // Table does exist, there was some problem opening it. Currently this should
- // never fail, except in the case of the table not exisiting. Open() basically
- // only sets up variable/pointer values, other than checking for table existence.
- if (Contact->GetDb()->TableExists((char *)CONTACT_TABLE_NAME))
- {
- wxString tStr;
- tStr.Printf("Unable to open the table '%s'.\n\n",CONTACT_TABLE_NAME);
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
- wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
- delete Contact;
- Close();
- DemoFrame->Close();
- return;
- }
- }
+ initialized = FALSE;
- // Build the dialog
+ Contact = NULL;
- (void)new wxStaticBox(this, EDITOR_DIALOG_FN_GROUP, "", wxPoint(15, 1), wxSize(497, 69), 0, "FunctionGrp");
- (void)new wxStaticBox(this, EDITOR_DIALOG_SEARCH_GROUP, "", wxPoint(417, 1), wxSize(95, 242), 0, "SearchGrp");
-
- pCreateBtn = new wxButton(this, EDITOR_DIALOG_CREATE, "&Create", wxPoint( 25, 21), wxSize( 70, 35), 0, wxDefaultValidator, "CreateBtn");
- pEditBtn = new wxButton(this, EDITOR_DIALOG_EDIT, "&Edit", wxPoint(102, 21), wxSize( 70, 35), 0, wxDefaultValidator, "EditBtn");
- pDeleteBtn = new wxButton(this, EDITOR_DIALOG_DELETE, "&Delete", wxPoint(179, 21), wxSize( 70, 35), 0, wxDefaultValidator, "DeleteBtn");
- pCopyBtn = new wxButton(this, EDITOR_DIALOG_COPY, "Cop&y", wxPoint(256, 21), wxSize( 70, 35), 0, wxDefaultValidator, "CopyBtn");
- pSaveBtn = new wxButton(this, EDITOR_DIALOG_SAVE, "&Save", wxPoint(333, 21), wxSize( 70, 35), 0, wxDefaultValidator, "SaveBtn");
- pCancelBtn = new wxButton(this, EDITOR_DIALOG_CANCEL, "C&ancel", wxPoint(430, 21), wxSize( 70, 35), 0, wxDefaultValidator, "CancelBtn");
- pPrevBtn = new wxButton(this, EDITOR_DIALOG_PREV, "<< &Prev", wxPoint(430, 81), wxSize( 70, 35), 0, wxDefaultValidator, "PrevBtn");
- pNextBtn = new wxButton(this, EDITOR_DIALOG_NEXT, "&Next >>", wxPoint(430, 121), wxSize( 70, 35), 0, wxDefaultValidator, "NextBtn");
- pQueryBtn = new wxButton(this, EDITOR_DIALOG_QUERY, "&Query", wxPoint(430, 161), wxSize( 70, 35), 0, wxDefaultValidator, "QueryBtn");
- pResetBtn = new wxButton(this, EDITOR_DIALOG_RESET, "&Reset", wxPoint(430, 200), wxSize( 70, 35), 0, wxDefaultValidator, "ResetBtn");
- pNameMsg = new wxStaticText(this, EDITOR_DIALOG_NAME_MSG, "Name:", wxPoint( 17, 80), wxSize( -1, -1), 0, "NameMsg");
- pNameTxt = new wxTextCtrl(this, EDITOR_DIALOG_NAME_TEXT, "", wxPoint( 17, 97), wxSize(308, 25), 0, wxDefaultValidator, "NameTxt");
- pNameListBtn = new wxButton(this, EDITOR_DIALOG_LOOKUP, "&Lookup", wxPoint(333, 97), wxSize( 70, 24), 0, wxDefaultValidator, "LookupBtn");
- pAddress1Msg = new wxStaticText(this, EDITOR_DIALOG_ADDRESS1_MSG, "Address:", wxPoint( 17, 130), wxSize( -1, -1), 0, "Address1Msg");
- pAddress1Txt = new wxTextCtrl(this, EDITOR_DIALOG_ADDRESS2_TEXT, "", wxPoint( 17, 147), wxSize(308, 25), 0, wxDefaultValidator, "Address1Txt");
- pAddress2Msg = new wxStaticText(this, EDITOR_DIALOG_ADDRESS2_MSG, "Address:", wxPoint( 17, 180), wxSize( -1, -1), 0, "Address2Msg");
- pAddress2Txt = new wxTextCtrl(this, EDITOR_DIALOG_ADDRESS2_TEXT, "", wxPoint( 17, 197), wxSize(308, 25), 0, wxDefaultValidator, "Address2Txt");
- pCityMsg = new wxStaticText(this, EDITOR_DIALOG_CITY_MSG, "City:", wxPoint( 17, 230), wxSize( -1, -1), 0, "CityMsg");
- pCityTxt = new wxTextCtrl(this, EDITOR_DIALOG_CITY_TEXT, "", wxPoint( 17, 247), wxSize(225, 25), 0, wxDefaultValidator, "CityTxt");
- pStateMsg = new wxStaticText(this, EDITOR_DIALOG_STATE_MSG, "State:", wxPoint(250, 230), wxSize( -1, -1), 0, "StateMsg");
- pStateTxt = new wxTextCtrl(this, EDITOR_DIALOG_STATE_TEXT, "", wxPoint(250, 247), wxSize(153, 25), 0, wxDefaultValidator, "StateTxt");
- pCountryMsg = new wxStaticText(this, EDITOR_DIALOG_COUNTRY_MSG, "Country:", wxPoint( 17, 280), wxSize( -1, -1), 0, "CountryMsg");
- pCountryTxt = new wxTextCtrl(this, EDITOR_DIALOG_COUNTRY_TEXT, "", wxPoint( 17, 297), wxSize(225, 25), 0, wxDefaultValidator, "CountryTxt");
- pPostalCodeMsg = new wxStaticText(this, EDITOR_DIALOG_POSTAL_MSG, "Postal Code:",wxPoint(250, 280), wxSize( -1, -1), 0, "PostalCodeMsg");
- pPostalCodeTxt = new wxTextCtrl(this, EDITOR_DIALOG_POSTAL_TEXT, "", wxPoint(250, 297), wxSize(153, 25), 0, wxDefaultValidator, "PostalCodeTxt");
-
- wxString choice_strings[5];
- choice_strings[0] = "English";
- choice_strings[1] = "French";
- choice_strings[2] = "German";
- choice_strings[3] = "Spanish";
- choice_strings[4] = "Other";
-
- pNativeLangChoice = new wxChoice(this, EDITOR_DIALOG_LANG_CHOICE, wxPoint( 17, 346), wxSize(277, -1), 5, choice_strings);
- pNativeLangMsg = new wxStaticText(this, EDITOR_DIALOG_LANG_MSG, "Native language:", wxPoint( 17, 330), wxSize( -1, -1), 0, "NativeLangMsg");
-
- wxString radio_strings[2];
- radio_strings[0] = "No";
- radio_strings[1] = "Yes";
- pDeveloperRadio = new wxRadioBox(this,EDITOR_DIALOG_DEVELOPER, "Developer:", wxPoint(303, 330), wxSize( -1, -1), 2, radio_strings, 2, wxHORIZONTAL);
- pJoinDateMsg = new wxStaticText(this, EDITOR_DIALOG_JOIN_MSG, "Date joined:", wxPoint( 17, 380), wxSize( -1, -1), 0, "JoinDateMsg");
- pJoinDateTxt = new wxTextCtrl(this, EDITOR_DIALOG_JOIN_TEXT, "", wxPoint( 17, 397), wxSize(150, 25), 0, wxDefaultValidator, "JoinDateTxt");
- pContribMsg = new wxStaticText(this, EDITOR_DIALOG_CONTRIB_MSG,"Contributions:", wxPoint(175, 380), wxSize( -1, -1), 0, "ContribMsg");
- pContribTxt = new wxTextCtrl(this, EDITOR_DIALOG_CONTRIB_TEXT, "", wxPoint(175, 397), wxSize(120, 25), 0, wxDefaultValidator, "ContribTxt");
- pLinesMsg = new wxStaticText(this, EDITOR_DIALOG_LINES_MSG, "Lines of code:", wxPoint(303, 380), wxSize( -1, -1), 0, "LinesMsg");
- pLinesTxt = new wxTextCtrl(this, EDITOR_DIALOG_LINES_TEXT, "", wxPoint(303, 397), wxSize(100, 25), 0, wxDefaultValidator, "LinesTxt");
-
- // Now that all the widgets on the panel are created, its safe to allow ::OnCommand() to
- // handle all widget processing
- widgetPtrsSet = TRUE;
-
- // Setup the orderBy and where clauses to return back a single record as the result set,
- // as there will only be one record being shown on the dialog at a time, this optimizes
- // network traffic by only returning a one row result
-
- Contact->SetOrderByClause("NAME"); // field name to sort by
-
- // The wxString "whereStr" is not a member of the wxDbTable object, it is a member variable
- // specifically in the Ccontact class. It is used here for simpler construction of a varying
- // length string, and then after the string is built, the wxDbTable member variable "where" is
- // assigned the pointer to the constructed string.
- //
- // The constructed where clause below has a sub-query within it "SELECT MIN(NAME) FROM %s"
- // to achieve a single row (in this case the first name in alphabetical order).
-
- if (Contact->GetDb()->Dbms() != dbmsPOSTGRES)
- {
- Contact->whereStr.sprintf("NAME = (SELECT MIN(NAME) FROM %s)",Contact->GetTableName());
- // NOTE: (const char*) returns a pointer which may not be valid later, so this is short term use only
- Contact->SetWhereClause(Contact->whereStr.c_str());
- }
- else
- Contact->SetWhereClause("");
-
- // Perform the Query to get the result set.
- // NOTE: If there are no rows returned, that is a valid result, so Query() would return TRUE.
- // Only if there is a database error will Query() come back as FALSE
- if (!Contact->Query())
- {
- wxString tStr;
- tStr = "ODBC error during Query()\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
- wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
- GetParent()->Close();
- return;
- }
-
- // Since Query succeeded, now get the row that was returned
- if (!Contact->GetNext())
- // If the GetNext() failed at this point, then there are no rows to retrieve,
- // so clear the values in the members of "Contact" so that PutData() blanks the
- // widgets on the dialog
- Contact->Initialize();
-
- SetMode(mView);
- PutData();
-
- Show(TRUE);
+ Show(FALSE);
} // CeditorDlg constructor
if ((mode != mCreate) && (mode != mEdit))
{
if (Contact)
+ {
delete Contact;
+ Contact = NULL;
+ }
this->Destroy();
}
else
} // CeditorDlg::OnCloseWindow()
-void CeditorDlg::OnButton( wxCommandEvent &event )
+void CeditorDlg::OnButton(wxCommandEvent &event)
{
- wxWindow *win = (wxWindow*) event.GetEventObject();
- OnCommand( *win, event );
-}
+ wxWindow *win = (wxWindow*) event.GetEventObject();
+ OnCommand( *win, event );
+} // CeditorDlg::OnButton()
void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
}
// Previous record not available, retrieve first record in table
- if (Contact->GetDb()->Dbms() != dbmsPOSTGRES)
+ if (Contact->GetDb()->Dbms() != dbmsPOSTGRES && Contact->GetDb()->Dbms() != dbmsMY_SQL)
{
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
Contact->whereStr += Contact->GetTableName();
{
wxString tStr;
tStr = "ODBC error during Query()\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
SetMode(mView);
return;
// display it, if the query string has changed.
if (wxStrcmp(qryWhere, (const char*) Contact->qryWhereStr))
{
-
Contact->whereStr = "";
Contact->SetOrderByClause("NAME");
- if (Contact->GetDb()->Dbms() != dbmsPOSTGRES)
+ if (Contact->GetDb()->Dbms() != dbmsPOSTGRES && Contact->GetDb()->Dbms() != dbmsMY_SQL)
{
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
Contact->whereStr += CONTACT_TABLE_NAME;
{
wxString tStr;
tStr = "ODBC error during Query()\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
return;
}
Contact->qryWhereStr = "";
Contact->SetOrderByClause("NAME");
- if (Contact->GetDb()->Dbms() != dbmsPOSTGRES)
+ if (Contact->GetDb()->Dbms() != dbmsPOSTGRES && Contact->GetDb()->Dbms() != dbmsMY_SQL)
{
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
Contact->whereStr += CONTACT_TABLE_NAME;
{
wxString tStr;
tStr = "ODBC error during Query()\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
return;
}
return;
}
-
} // CeditorDlg::OnCommand()
+bool CeditorDlg::Initialize()
+{
+ // Create the data structure and a new database connection.
+ // (As there is not a pDb being passed in the constructor, a new database
+ // connection is created)
+ Contact = new Ccontact();
+
+ if (!Contact)
+ {
+ wxMessageBox("Unable to instantiate an instance of Ccontact","Error...",wxOK | wxICON_EXCLAMATION);
+ return FALSE;
+ }
+
+ // Check if the table exists or not. If it doesn't, ask the user if they want to
+ // create the table. Continue trying to create the table until it exists, or user aborts
+ while (!Contact->GetDb()->TableExists((char *)CONTACT_TABLE_NAME,DbConnectInf.Uid,DbConnectInf.defaultDir))
+ {
+ wxString tStr;
+ tStr.Printf("Unable to open the table '%s'.\n\nTable may need to be created...?\n\n",CONTACT_TABLE_NAME);
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
+ wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
+
+ bool createTable = (wxMessageBox("Do you wish to try to create/clear the CONTACTS table?","Confirm",wxYES_NO|wxICON_QUESTION) == wxYES);
+
+ if (!createTable)
+ {
+// Close();
+ return FALSE;
+ }
+ else
+ DemoFrame->CreateDataTable(TRUE);
+ }
+
+ // Tables must be "opened" before anything other than creating/deleting table can be done
+ if (!Contact->Open())
+ {
+ // Table does exist, or there was some problem opening it. Currently this should
+ // never fail, except in the case of the table not exisiting or the current
+ // user has insufficent privileges to access the table
+#if 0
+// This code is experimenting with a new function that will hopefully be available
+// in the 2.4 release. This check will determine whether the open failing was due
+// to the table not existing, or the users privileges being insufficient to
+// open the table.
+ if (!Contact->GetDb()->TablePrivileges(CONTACT_TABLE_NAME,"SELECT",Contact->GetDb()->GetUsername(),DbConnectInf.defaultDir))
+ {
+ wxString tStr;
+ tStr.Printf("Unable to open the table '%s'.\n\n",CONTACT_TABLE_NAME);
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
+ wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
+ }
+ else
+#endif
+ if (Contact->GetDb()->TableExists(CONTACT_TABLE_NAME,Contact->GetDb()->GetUsername(),DbConnectInf.defaultDir))
+ {
+ wxString tStr;
+ tStr.Printf("Unable to open the table '%s'.\n\n",CONTACT_TABLE_NAME);
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
+ wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
+ }
+
+ return FALSE;
+ }
+
+ // Build the dialog
+
+ (void)new wxStaticBox(this, EDITOR_DIALOG_FN_GROUP, "", wxPoint(15, 1), wxSize(497, 69), 0, "FunctionGrp");
+ (void)new wxStaticBox(this, EDITOR_DIALOG_SEARCH_GROUP, "", wxPoint(417, 1), wxSize(95, 242), 0, "SearchGrp");
+
+ pCreateBtn = new wxButton(this, EDITOR_DIALOG_CREATE, "&Create", wxPoint( 25, 21), wxSize( 70, 35), 0, wxDefaultValidator, "CreateBtn");
+ pEditBtn = new wxButton(this, EDITOR_DIALOG_EDIT, "&Edit", wxPoint(102, 21), wxSize( 70, 35), 0, wxDefaultValidator, "EditBtn");
+ pDeleteBtn = new wxButton(this, EDITOR_DIALOG_DELETE, "&Delete", wxPoint(179, 21), wxSize( 70, 35), 0, wxDefaultValidator, "DeleteBtn");
+ pCopyBtn = new wxButton(this, EDITOR_DIALOG_COPY, "Cop&y", wxPoint(256, 21), wxSize( 70, 35), 0, wxDefaultValidator, "CopyBtn");
+ pSaveBtn = new wxButton(this, EDITOR_DIALOG_SAVE, "&Save", wxPoint(333, 21), wxSize( 70, 35), 0, wxDefaultValidator, "SaveBtn");
+ pCancelBtn = new wxButton(this, EDITOR_DIALOG_CANCEL, "C&ancel", wxPoint(430, 21), wxSize( 70, 35), 0, wxDefaultValidator, "CancelBtn");
+ pPrevBtn = new wxButton(this, EDITOR_DIALOG_PREV, "<< &Prev", wxPoint(430, 81), wxSize( 70, 35), 0, wxDefaultValidator, "PrevBtn");
+ pNextBtn = new wxButton(this, EDITOR_DIALOG_NEXT, "&Next >>", wxPoint(430, 121), wxSize( 70, 35), 0, wxDefaultValidator, "NextBtn");
+ pQueryBtn = new wxButton(this, EDITOR_DIALOG_QUERY, "&Query", wxPoint(430, 161), wxSize( 70, 35), 0, wxDefaultValidator, "QueryBtn");
+ pResetBtn = new wxButton(this, EDITOR_DIALOG_RESET, "&Reset", wxPoint(430, 200), wxSize( 70, 35), 0, wxDefaultValidator, "ResetBtn");
+ pNameMsg = new wxStaticText(this, EDITOR_DIALOG_NAME_MSG, "Name:", wxPoint( 17, 80), wxSize( -1, -1), 0, "NameMsg");
+ pNameTxt = new wxTextCtrl(this, EDITOR_DIALOG_NAME_TEXT, "", wxPoint( 17, 97), wxSize(308, 25), 0, wxDefaultValidator, "NameTxt");
+ pNameListBtn = new wxButton(this, EDITOR_DIALOG_LOOKUP, "&Lookup", wxPoint(333, 97), wxSize( 70, 24), 0, wxDefaultValidator, "LookupBtn");
+ pAddress1Msg = new wxStaticText(this, EDITOR_DIALOG_ADDRESS1_MSG, "Address:", wxPoint( 17, 130), wxSize( -1, -1), 0, "Address1Msg");
+ pAddress1Txt = new wxTextCtrl(this, EDITOR_DIALOG_ADDRESS2_TEXT, "", wxPoint( 17, 147), wxSize(308, 25), 0, wxDefaultValidator, "Address1Txt");
+ pAddress2Msg = new wxStaticText(this, EDITOR_DIALOG_ADDRESS2_MSG, "Address:", wxPoint( 17, 180), wxSize( -1, -1), 0, "Address2Msg");
+ pAddress2Txt = new wxTextCtrl(this, EDITOR_DIALOG_ADDRESS2_TEXT, "", wxPoint( 17, 197), wxSize(308, 25), 0, wxDefaultValidator, "Address2Txt");
+ pCityMsg = new wxStaticText(this, EDITOR_DIALOG_CITY_MSG, "City:", wxPoint( 17, 230), wxSize( -1, -1), 0, "CityMsg");
+ pCityTxt = new wxTextCtrl(this, EDITOR_DIALOG_CITY_TEXT, "", wxPoint( 17, 247), wxSize(225, 25), 0, wxDefaultValidator, "CityTxt");
+ pStateMsg = new wxStaticText(this, EDITOR_DIALOG_STATE_MSG, "State:", wxPoint(250, 230), wxSize( -1, -1), 0, "StateMsg");
+ pStateTxt = new wxTextCtrl(this, EDITOR_DIALOG_STATE_TEXT, "", wxPoint(250, 247), wxSize(153, 25), 0, wxDefaultValidator, "StateTxt");
+ pCountryMsg = new wxStaticText(this, EDITOR_DIALOG_COUNTRY_MSG, "Country:", wxPoint( 17, 280), wxSize( -1, -1), 0, "CountryMsg");
+ pCountryTxt = new wxTextCtrl(this, EDITOR_DIALOG_COUNTRY_TEXT, "", wxPoint( 17, 297), wxSize(225, 25), 0, wxDefaultValidator, "CountryTxt");
+ pPostalCodeMsg = new wxStaticText(this, EDITOR_DIALOG_POSTAL_MSG, "Postal Code:",wxPoint(250, 280), wxSize( -1, -1), 0, "PostalCodeMsg");
+ pPostalCodeTxt = new wxTextCtrl(this, EDITOR_DIALOG_POSTAL_TEXT, "", wxPoint(250, 297), wxSize(153, 25), 0, wxDefaultValidator, "PostalCodeTxt");
+
+ wxString choice_strings[5];
+ choice_strings[0] = "English";
+ choice_strings[1] = "French";
+ choice_strings[2] = "German";
+ choice_strings[3] = "Spanish";
+ choice_strings[4] = "Other";
+
+ pNativeLangChoice = new wxChoice(this, EDITOR_DIALOG_LANG_CHOICE, wxPoint( 17, 346), wxSize(277, -1), 5, choice_strings);
+ pNativeLangMsg = new wxStaticText(this, EDITOR_DIALOG_LANG_MSG, "Native language:", wxPoint( 17, 330), wxSize( -1, -1), 0, "NativeLangMsg");
+
+ wxString radio_strings[2];
+ radio_strings[0] = "No";
+ radio_strings[1] = "Yes";
+ pDeveloperRadio = new wxRadioBox(this,EDITOR_DIALOG_DEVELOPER, "Developer:", wxPoint(303, 330), wxSize( -1, -1), 2, radio_strings, 2, wxHORIZONTAL);
+ pJoinDateMsg = new wxStaticText(this, EDITOR_DIALOG_JOIN_MSG, "Date joined:", wxPoint( 17, 380), wxSize( -1, -1), 0, "JoinDateMsg");
+ pJoinDateTxt = new wxTextCtrl(this, EDITOR_DIALOG_JOIN_TEXT, "", wxPoint( 17, 397), wxSize(150, 25), 0, wxDefaultValidator, "JoinDateTxt");
+ pContribMsg = new wxStaticText(this, EDITOR_DIALOG_CONTRIB_MSG,"Contributions:", wxPoint(175, 380), wxSize( -1, -1), 0, "ContribMsg");
+ pContribTxt = new wxTextCtrl(this, EDITOR_DIALOG_CONTRIB_TEXT, "", wxPoint(175, 397), wxSize(120, 25), 0, wxDefaultValidator, "ContribTxt");
+ pLinesMsg = new wxStaticText(this, EDITOR_DIALOG_LINES_MSG, "Lines of code:", wxPoint(303, 380), wxSize( -1, -1), 0, "LinesMsg");
+ pLinesTxt = new wxTextCtrl(this, EDITOR_DIALOG_LINES_TEXT, "", wxPoint(303, 397), wxSize(100, 25), 0, wxDefaultValidator, "LinesTxt");
+
+ // Now that all the widgets on the panel are created, its safe to allow ::OnCommand() to
+ // handle all widget processing
+ widgetPtrsSet = TRUE;
+
+ // Setup the orderBy and where clauses to return back a single record as the result set,
+ // as there will only be one record being shown on the dialog at a time, this optimizes
+ // network traffic by only returning a one row result
+
+ Contact->SetOrderByClause("NAME"); // field name to sort by
+
+ // The wxString "whereStr" is not a member of the wxDbTable object, it is a member variable
+ // specifically in the Ccontact class. It is used here for simpler construction of a varying
+ // length string, and then after the string is built, the wxDbTable member variable "where" is
+ // assigned the pointer to the constructed string.
+ //
+ // The constructed where clause below has a sub-query within it "SELECT MIN(NAME) FROM %s"
+ // to achieve a single row (in this case the first name in alphabetical order).
+
+ if (Contact->GetDb()->Dbms() != dbmsPOSTGRES && Contact->GetDb()->Dbms() != dbmsMY_SQL)
+ {
+ Contact->whereStr.sprintf("NAME = (SELECT MIN(NAME) FROM %s)",Contact->GetTableName());
+ // NOTE: (const char*) returns a pointer which may not be valid later, so this is short term use only
+ Contact->SetWhereClause(Contact->whereStr.c_str());
+ }
+ else
+ Contact->SetWhereClause("");
+
+ // Perform the Query to get the result set.
+ // NOTE: If there are no rows returned, that is a valid result, so Query() would return TRUE.
+ // Only if there is a database error will Query() come back as FALSE
+ if (!Contact->Query())
+ {
+ wxString tStr;
+ tStr = "ODBC error during Query()\n\n";
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
+ wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
+// GetParent()->Close();
+ return FALSE;
+ }
+
+ // Since Query succeeded, now get the row that was returned
+ if (!Contact->GetNext())
+ // If the GetNext() failed at this point, then there are no rows to retrieve,
+ // so clear the values in the members of "Contact" so that PutData() blanks the
+ // widgets on the dialog
+ Contact->Initialize();
+
+ SetMode(mView);
+ PutData();
+
+ Show(TRUE);
+
+ initialized = TRUE;
+ return TRUE;
+} // CeditorDlg::Initialize()
+
+
void CeditorDlg::FieldsEditable()
{
pNameTxt->Enable((mode == mCreate) || (mode == mEdit));
void CeditorDlg::SetMode(enum DialogModes m)
{
- bool edit = FALSE;
+ bool edit = FALSE;
mode = m;
switch (mode)
{
wxString tStr;
tStr = "A duplicate key value already exists in the table.\nUnable to save record\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
}
else
// Some other unexpexted error occurred
wxString tStr;
tStr = "Database insert failed\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
}
}
{
wxString tStr;
tStr = "Database update failed\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
failed = TRUE;
}
{
wxString w;
- if (Contact->GetDb()->Dbms() != dbmsPOSTGRES)
+ if (Contact->GetDb()->Dbms() != dbmsPOSTGRES && Contact->GetDb()->Dbms() != dbmsMY_SQL)
{
w = "NAME = (SELECT MIN(NAME) FROM ";
w += Contact->GetTableName();
{
wxString w;
- if (Contact->GetDb()->Dbms() != dbmsPOSTGRES)
+ if (Contact->GetDb()->Dbms() != dbmsPOSTGRES && Contact->GetDb()->Dbms() != dbmsMY_SQL)
{
w = "NAME = (SELECT MAX(NAME) FROM ";
w += Contact->GetTableName();
{
wxString tStr;
tStr = "ODBC error during Query()\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+ tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
return(FALSE);
if (!saved)
{
bool Ok = (wxMessageBox("No changes have been saved.\n\nAre you sure you wish exit the parameter screen?","Confirm",wxYES_NO|wxICON_QUESTION) == wxYES);
-
+
if (!Ok)
{
event.Veto();
return;
}
-
+
wxGetApp().params = savedParamSettings;
}
if (GetParent() != NULL)
GetParent()->SetFocus();
- this->Destroy();
-} // Cparameter::OnCloseWindow()
+ while (wxIsBusy())
+ wxEndBusyCursor();
+
+ Show(FALSE);
+ SetReturnCode(0); // added so BoundsChecker would not report use of uninitialized variable
+
+ this->Destroy();
+} // CparameterDlg::OnCloseWindow()
void CparameterDlg::OnButton( wxCommandEvent &event )
OnCommand( *win, event );
}
+
void CparameterDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
{
wxString widgetName;
int i;
for (i = 0; wxStrlen(p[i]); i++)
pParamODBCSourceList->Append(p[i]);
+
+ delete p;
} // CparameterDlg::CparameterDlg::FillDataSourceList()
EVT_BUTTON(-1, CqueryDlg::OnButton)
EVT_CLOSE(CqueryDlg::OnCloseWindow)
END_EVENT_TABLE()
+
// CqueryDlg() constructor
CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, char *tblName[], char *pWhereArg) : wxDialog (parent, QUERY_DIALOG, "Query", wxPoint(-1, -1), wxSize(480, 360))
// Initialize the WHERE clause from the string passed in
pWhere = pWhereArg; // Save a pointer to the output buffer
- if (wxStrlen(pWhere) > DB_MAX_WHERE_CLAUSE_LEN) // Check the length of the buffer passed in
+ if (wxStrlen(pWhere) > (unsigned int)DB_MAX_WHERE_CLAUSE_LEN) // Check the length of the buffer passed in
{
wxString s;
s.Printf("Maximum where clause length exceeded.\nLength must be less than %d", DB_MAX_WHERE_CLAUSE_LEN+1);
pQuerySqlWhereMtxt = new wxTextCtrl(this, QUERY_DIALOG_WHERE_TEXT, "", wxPoint( 10, 159), wxSize(377, 134), wxTE_MULTILINE, wxDefaultValidator, "QuerySqlWhereMtxt");
pQueryAddBtn = new wxButton(this, QUERY_DIALOG_ADD, "&Add", wxPoint(406, 24), wxSize( 56, 26), 0, wxDefaultValidator, "QueryAddBtn");
pQueryAndBtn = new wxButton(this, QUERY_DIALOG_AND, "A&nd", wxPoint(406, 58), wxSize( 56, 26), 0, wxDefaultValidator, "QueryAndBtn");
- pQueryOrBtn = new wxButton(this, QUERY_DIALOG_OR, "&Or", wxPoint(406, 92), wxSize( 56, 26), 0, wxDefaultValidator, "QueryOrBtn");
+ pQueryOrBtn = new wxButton(this, QUERY_DIALOG_OR, "&Or", wxPoint(406, 92), wxSize( 56, 26), 0, wxDefaultValidator, "QueryOrBtn");
pQueryLParenBtn = new wxButton(this, QUERY_DIALOG_LPAREN, "(", wxPoint(406, 126), wxSize( 26, 26), 0, wxDefaultValidator, "QueryLParenBtn");
pQueryRParenBtn = new wxButton(this, QUERY_DIALOG_RPAREN, ")", wxPoint(436, 126), wxSize( 26, 26), 0, wxDefaultValidator, "QueryRParenBtn");
pQueryDoneBtn = new wxButton(this, QUERY_DIALOG_DONE, "&Done", wxPoint(406, 185), wxSize( 56, 26), 0, wxDefaultValidator, "QueryDoneBtn");
wxEndBusyCursor();
wxString tStr;
tStr = "ODBC error during GetColumns()\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+ tStr += GetExtendedDBErrorMsg(pDb,__FILE__,__LINE__);
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
return;
}
// Display the dialog window
Centre(wxBOTH);
ShowModal();
-
} // CqueryDlg() constructor
} // CqueryDlg::~CqueryDlg() destructor
-void CqueryDlg::OnButton( wxCommandEvent &event )
+void CqueryDlg::OnButton(wxCommandEvent &event)
{
wxWindow *win = (wxWindow*) event.GetEventObject();
OnCommand( *win, event );
-}
+} // CqueryDlg::OnButton()
+
void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
{
// Set the help text
switch((qryOp) pQueryOperatorChoice->GetSelection())
{
- case qryOpEQ:
- pQueryHintMsg->SetLabel(langQRY_EQ);
- break;
- case qryOpLT:
- pQueryHintMsg->SetLabel(langQRY_LT);
- break;
- case qryOpGT:
- pQueryHintMsg->SetLabel(langQRY_GT);
- break;
- case qryOpLE:
- pQueryHintMsg->SetLabel(langQRY_LE);
- break;
- case qryOpGE:
- pQueryHintMsg->SetLabel(langQRY_GE);
- break;
- case qryOpBEGINS:
- pQueryHintMsg->SetLabel(langQRY_BEGINS);
- break;
- case qryOpCONTAINS:
- pQueryHintMsg->SetLabel(langQRY_CONTAINS);
- break;
- case qryOpLIKE:
- pQueryHintMsg->SetLabel(langQRY_LIKE);
- break;
- case qryOpBETWEEN:
- pQueryHintMsg->SetLabel(langQRY_BETWEEN);
- break;
+ case qryOpEQ:
+ pQueryHintMsg->SetLabel(langQRY_EQ);
+ break;
+ case qryOpLT:
+ pQueryHintMsg->SetLabel(langQRY_LT);
+ break;
+ case qryOpGT:
+ pQueryHintMsg->SetLabel(langQRY_GT);
+ break;
+ case qryOpLE:
+ pQueryHintMsg->SetLabel(langQRY_LE);
+ break;
+ case qryOpGE:
+ pQueryHintMsg->SetLabel(langQRY_GE);
+ break;
+ case qryOpBEGINS:
+ pQueryHintMsg->SetLabel(langQRY_BEGINS);
+ break;
+ case qryOpCONTAINS:
+ pQueryHintMsg->SetLabel(langQRY_CONTAINS);
+ break;
+ case qryOpLIKE:
+ pQueryHintMsg->SetLabel(langQRY_LIKE);
+ break;
+ case qryOpBETWEEN:
+ pQueryHintMsg->SetLabel(langQRY_BETWEEN);
+ break;
}
// Hide the value2 widget
// Disable the NOT operator for <, <=, >, >=
switch((qryOp) pQueryOperatorChoice->GetSelection())
{
- case qryOpLT:
- case qryOpGT:
- case qryOpLE:
- case qryOpGE:
- pQueryNotCheck->SetValue(0);
- pQueryNotCheck->Enable(FALSE);
- break;
- default:
- pQueryNotCheck->Enable(TRUE);
- break;
+ case qryOpLT:
+ case qryOpGT:
+ case qryOpLE:
+ case qryOpGE:
+ pQueryNotCheck->SetValue(0);
+ pQueryNotCheck->Enable(FALSE);
+ break;
+ default:
+ pQueryNotCheck->Enable(TRUE);
+ break;
}
// Manipulate the dialog to handle the selected operator
switch((qryOp) pQueryOperatorChoice->GetSelection())
{
- case qryOpEQ:
- case qryOpLT:
- case qryOpGT:
- case qryOpLE:
- case qryOpGE:
- pQueryCol2Choice->Enable(TRUE);
- if (pQueryCol2Choice->GetSelection()) // Column name is highlighted
- {
- pQueryValue1Msg->Show(FALSE);
- pQueryValue1Txt->Show(FALSE);
- }
- else // "Value" is highlighted
- {
+ case qryOpEQ:
+ case qryOpLT:
+ case qryOpGT:
+ case qryOpLE:
+ case qryOpGE:
+ pQueryCol2Choice->Enable(TRUE);
+ if (pQueryCol2Choice->GetSelection()) // Column name is highlighted
+ {
+ pQueryValue1Msg->Show(FALSE);
+ pQueryValue1Txt->Show(FALSE);
+ }
+ else // "Value" is highlighted
+ {
+ pQueryValue1Msg->Show(TRUE);
+ pQueryValue1Txt->Show(TRUE);
+ pQueryValue1Txt->SetFocus();
+ }
+ break;
+ case qryOpBEGINS:
+ case qryOpCONTAINS:
+ case qryOpLIKE:
+ pQueryCol2Choice->SetSelection(0);
+ pQueryCol2Choice->Enable(FALSE);
pQueryValue1Msg->Show(TRUE);
pQueryValue1Txt->Show(TRUE);
pQueryValue1Txt->SetFocus();
- }
- break;
- case qryOpBEGINS:
- case qryOpCONTAINS:
- case qryOpLIKE:
- pQueryCol2Choice->SetSelection(0);
- pQueryCol2Choice->Enable(FALSE);
- pQueryValue1Msg->Show(TRUE);
- pQueryValue1Txt->Show(TRUE);
- pQueryValue1Txt->SetFocus();
- break;
- case qryOpBETWEEN:
- pQueryCol2Choice->SetSelection(0);
- pQueryCol2Choice->Enable(FALSE);
- pQueryValue2Msg->Show(TRUE);
- pQueryValue2Txt->Show(TRUE);
- pQueryValue1Msg->Show(TRUE);
- pQueryValue1Txt->Show(TRUE);
- pQueryValue1Txt->SetFocus();
- break;
+ break;
+ case qryOpBETWEEN:
+ pQueryCol2Choice->SetSelection(0);
+ pQueryCol2Choice->Enable(FALSE);
+ pQueryValue2Msg->Show(TRUE);
+ pQueryValue2Txt->Show(TRUE);
+ pQueryValue1Msg->Show(TRUE);
+ pQueryValue1Txt->Show(TRUE);
+ pQueryValue1Txt->SetFocus();
+ break;
}
return;
pQueryValue1Txt->SetFocus();
}
return;
-
} // Column 2 choice
// Add button
{
ProcessAddBtn();
return;
-
} // Add button
// And button
{
AppendToWhere(" AND\n");
return;
-
} // And button
// Or button
{
AppendToWhere(" OR\n");
return;
-
} // Or button
// Left Paren button
{
AppendToWhere("(");
return;
-
} // Left Paren button
// Right paren button
{
AppendToWhere(")");
return;
-
} // Right Paren button
// Done button
if (widgetName == pQueryDoneBtn->GetName())
{
// Be sure the where clause will not overflow the output buffer
- if (wxStrlen(pQuerySqlWhereMtxt->GetValue()) > DB_MAX_WHERE_CLAUSE_LEN)
+ if (wxStrlen(pQuerySqlWhereMtxt->GetValue()) > (unsigned int)DB_MAX_WHERE_CLAUSE_LEN)
{
wxString s;
s.Printf("Maximum where clause length exceeded.\nLength must be less than %d", DB_MAX_WHERE_CLAUSE_LEN+1);
wxStrcpy(pWhere, pQuerySqlWhereMtxt->GetValue());
Close();
return;
-
} // Done button
// Clear button
if (Ok)
pQuerySqlWhereMtxt->SetValue("");
return;
-
} // Clear button
// Count button
ProcessCountBtn();
wxEndBusyCursor();
return;
-
} // Count button
} // CqueryDlg::OnCommand
wxEndBusyCursor();
Show(FALSE);
- this->Destroy();
+ SetReturnCode(1); // added so BoundsChecker would not report use of uninitialized variable
+ this->Destroy();
} // CqueryDlg::OnCloseWindow()
void CqueryDlg::AppendToWhere(char *s)
{
- wxString whereStr = pQuerySqlWhereMtxt->GetValue();
- whereStr += s;
- pQuerySqlWhereMtxt->SetValue(whereStr);
-
+ wxString whereStr = pQuerySqlWhereMtxt->GetValue();
+ whereStr += s;
+ pQuerySqlWhereMtxt->SetValue(whereStr);
} // CqueryDlg::AppendToWhere()
{
wxString tStr;
tStr = "ODBC error during Open()\n\n";
- tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+ tStr += GetExtendedDBErrorMsg(dbTable->GetDb(),__FILE__,__LINE__);
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
return;
}
enum DialogModes {mView,mCreate,mEdit,mSearch};
// ID for the menu quit command
-#define FILE_CREATE 100
-#define FILE_EXIT 199
-#define EDIT_PARAMETERS 200
+#define FILE_CREATE 100
+#define FILE_RECREATE_TABLE 110
+#define FILE_RECREATE_INDEXES 120
+#define FILE_EXIT 199
+#define EDIT_PARAMETERS 200
#define ABOUT_DEMO 300
// this seems to be missing, Robert Roebling (?)
void OnCloseWindow(wxCloseEvent& event);
void OnCreate(wxCommandEvent& event);
+ void OnRecreateTable(wxCommandEvent& event);
+ void OnRecreateIndexes(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);
void OnEditParameters(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
- void CreateDataTable();
+ void CreateDataTable(bool recreate);
void BuildEditorDialog();
void BuildParameterDialog(wxWindow *parent);
class CeditorDlg : public wxPanel
{
private:
- bool widgetPtrsSet;
- wxString saveName;
+ bool widgetPtrsSet;
+ wxString saveName;
// Pointers to all widgets on the dialog
wxButton *pCreateBtn, *pEditBtn, *pDeleteBtn, *pCopyBtn, *pSaveBtn, *pCancelBtn;
wxStaticText *pNativeLangMsg;
public:
- enum DialogModes mode;
- Ccontact *Contact; // this is the table object that will be being manipulated
+ bool initialized;
+ enum DialogModes mode;
+ Ccontact *Contact; // this is the table object that will be being manipulated
CeditorDlg(wxWindow *parent);
void OnCommand(wxWindow& win, wxCommandEvent& event);
void OnActivate(bool) {}; // necessary for hot keys
+ bool Initialize();
void FieldsEditable();
void SetMode(enum DialogModes m);
bool PutData();
wxStaticBox *pQueryHintGrp;
wxStaticText *pQueryHintMsg;
- wxTextCtrl *pFocusTxt;
+ wxTextCtrl *pFocusTxt;
CqueryDlg(wxWindow *parent, wxDb *pDb, char *tblName[], char *pWhereArg);
~CqueryDlg();
* NOTE: The value returned by this function is for temporary use only and
* should be copied for long term use
*/
-char *GetExtendedDBErrorMsg2(char *ErrFile, int ErrLine)
+const char *GetExtendedDBErrorMsg2(char *ErrFile, int ErrLine)
{
static wxString msg;
+ msg = "";
wxString tStr;
msg.Append(pDbList->PtrDb->errorList[i]);
if (wxStrcmp(pDbList->PtrDb->errorList[i],"") != 0)
msg.Append("\n");
+ // Clear the errmsg buffer so the next error will not
+ // end up showing the previous error that have occurred
+ wxStrcpy(pDbList->PtrDb->errorList[i],"");
}
}
}
msg += "\n";
- return (char*) (const char*) msg;
+ return /*(char*) (const char*) msg*/msg.c_str();
} // GetExtendedDBErrorMsg
if (lookup2)
delete lookup2;
+ SetReturnCode(1);
+
while (wxIsBusy()) wxEndBusyCursor();
- event.Skip();
+ event.Skip();
// return TRUE;
void MyFrame::PasswordEntry(wxCommandEvent& WXUNUSED(event))
{
wxString pwd = wxGetPasswordFromUser("Enter password:",
- "Passowrd entry dialog",
+ "Password entry dialog",
"",
this);
if ( !!pwd )
void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
{
- wxBrush* brush4 = new wxBrush(*gs_bmp4);
+// wxBrush* brush4 = new wxBrush(*gs_bmp4);
+ wxBrush* brush4 = new wxBrush(*wxBLACK,wxFDIAGONAL_HATCH);
wxBrush* brush4_mono = new wxBrush(*gs_bmp4_mono);
wxBrush* brush36 = new wxBrush(*gs_bmp36);
{
wxPaintDC dc(this);
PrepareDC(dc);
+
m_owner->PrepareDC(dc);
dc.SetBackgroundMode( m_owner->m_backgroundMode );
case Show_Ops:
DrawWithLogicalOps(dc);
break;
+
+ default:
+ {
+ dc.SetPen( *wxBLACK_PEN );
+ dc.DrawLine( 0,0,100,100 );
+ }
+
}
}
void MyFrame::OnShow(wxCommandEvent& event)
{
- m_canvas->Show((ScreenToShow)(event.GetInt() - MenuShow_First));
+ m_canvas->Show((ScreenToShow)(event.GetId() - MenuShow_First));
}
void MyFrame::OnOption(wxCommandEvent& event)
{
- switch (event.GetInt())
+ switch (event.GetId())
{
case MapMode_Text:
m_mapMode = wxMM_TEXT;
public:
MyFrame();
- virtual ~MyFrame() { delete m_menu; }
+ virtual ~MyFrame();
+
+ void LogMenuEvent(const wxCommandEvent& event);
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
+// A small helper class which intercepts all menu events and logs them
+class MyEvtHandler : public wxEvtHandler
+{
+public:
+ MyEvtHandler(MyFrame *frame) { m_frame = frame; }
+
+ void OnMenuEvent(wxCommandEvent& event)
+ {
+ m_frame->LogMenuEvent(event);
+
+ event.Skip();
+ }
+
+private:
+ MyFrame *m_frame;
+
+ DECLARE_EVENT_TABLE()
+};
+
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
EVT_RIGHT_DOWN(MyFrame::OnRightDown)
END_EVENT_TABLE()
+BEGIN_EVENT_TABLE(MyEvtHandler, wxEvtHandler)
+ EVT_MENU(-1, MyEvtHandler::OnMenuEvent)
+END_EVENT_TABLE()
+
// ============================================================================
// implementation
// ============================================================================
m_menu = NULL;
m_countDummy = 0;
- CreateStatusBar();
+ CreateStatusBar(2);
// create the menubar
wxMenu *fileMenu = new wxMenu;
// associate the menu bar with the frame
SetMenuBar(menuBar);
+
+ // intercept all menu events and log them in this custom event handler
+ PushEventHandler(new MyEvtHandler(this));
+}
+
+MyFrame::~MyFrame()
+{
+ delete m_menu;
+
+ // delete the event handler installed in ctor
+ PopEventHandler(TRUE);
}
wxMenu *MyFrame::CreateDummyMenu(wxString *title)
}
}
+void MyFrame::LogMenuEvent(const wxCommandEvent& event)
+{
+ int id = event.GetId();
+ wxString msg = wxString::Format("Menu command %d", id);
+ if ( GetMenuBar()->FindItem(id)->IsCheckable() )
+ {
+ msg += wxString::Format(" (the item is currently %schecked)",
+ event.IsChecked() ? "" : "not ");
+ }
+
+ SetStatusText(msg, 1);
+}
+
+// ----------------------------------------------------------------------------
+// menu callbacks
+// ----------------------------------------------------------------------------
+
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Close(TRUE);
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: src/base/base.rc
+// Purpose: contains version info resource for wxBase DLL build
+// Author: Vadim Zeitlin
+// Modified by:
+// Created: 09.07.00
+// RCS-ID: $Id$
+// Copyright: (c) 2000 Vadim Zeitlin
+// Licence: wxWindows license
+///////////////////////////////////////////////////////////////////////////////
+
+#include "wx/version.h"
+
+#ifdef _DEBUG
+ #define DLL_FLAGS 0x1L
+ #define DLL_SUFFIX "d"
+#else
+ #define DLL_FLAGS 0x0L
+ #define DLL_SUFFIX ""
+#endif
+
+1 VERSIONINFO
+ FILEVERSION wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxBETA_NUMBER
+ PRODUCTVERSION wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxBETA_NUMBER
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS DLL_FLAGS
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "wxBase (part of Windows) cross-platform framework\0"
+ VALUE "CompanyName", "wxWindows development team\0"
+ VALUE "FileDescription", "wxBase is a non GUI part of wxWindows\0"
+ VALUE "FileVersion", "2.2.1\0"
+ VALUE "InternalName", "wxBase\0"
+ VALUE "LegalCopyright", "Copyright © 1993, 2000 wxWindows development team\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "wxbase221" DLL_SUFFIX ".dll\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "wxWindows\0"
+ VALUE "ProductVersion", "2.2.1\0"
+ VALUE "SpecialBuild", "\0"
+ END
+ END
+END
}
}
+ // We try to guess what we have here: for each new (numeric) token, we
+ // determine if it can be a month, day or a year. Of course, there is an
+ // ambiguity as some numbers may be days as well as months, so we also
+ // have the ability to back track.
+
// what do we have?
bool haveDay = FALSE, // the months day?
haveWDay = FALSE, // the day of week?
while ( tok.HasMoreTokens() )
{
wxString token = tok.GetNextToken();
+ if ( !token )
+ continue;
// is it a number?
unsigned long val;
bool isDay = FALSE,
isMonth = FALSE,
- // only years are counted from 0
- isYear = (val == 0) || (val > 31);
- if ( !isYear )
+ isYear = FALSE;
+
+ if ( !haveMon && val > 0 && val <= 12 )
{
- // may be the month or month day or the year, assume the
- // month day by default and fallback to month if the range
- // allow it or to the year if our assumption doesn't work
- if ( haveDay )
+ // assume it is month
+ isMonth = TRUE;
+ }
+ else // not the month
+ {
+ wxDateTime_t maxDays = haveMon
+ ? GetNumOfDaysInMonth(haveYear ? year : Inv_Year, mon)
+ : 31;
+
+ // can it be day?
+ if ( (val == 0) || (val > maxDays) )
{
- // we already have the day, so may only be a month or year
- if ( val > 12 )
- {
- isYear = TRUE;
- }
- else
- {
- isMonth = TRUE;
- }
+ isYear = TRUE;
}
- else // it may be day
+ else
{
isDay = TRUE;
-
- // check the range
- if ( haveMon )
- {
- if ( val > GetNumOfDaysInMonth(haveYear ? year
- : Inv_Year,
- mon) )
- {
- // oops, it can't be a day finally
- isDay = FALSE;
-
- if ( val > 12 )
- {
- isYear = TRUE;
- }
- else
- {
- isMonth = TRUE;
- }
- }
- }
}
}
- // remember that we have this and stop the scan if it's the second
- // time we find this, except for the day logic (see there)
if ( isYear )
{
if ( haveYear )
- {
break;
- }
haveYear = TRUE;
- // no roll over - 99 means 99, not 1999 for us
year = (wxDateTime_t)val;
}
- else if ( isMonth )
+ else if ( isDay )
{
- if ( haveMon )
- {
+ if ( haveDay )
break;
- }
- haveMon = TRUE;
+ haveDay = TRUE;
- // month 1 is Jan
- mon = (wxDateTime::Month)(val - 1);
+ day = (wxDateTime_t)val;
}
- else
+ else if ( isMonth )
{
- wxASSERT_MSG( isDay, _T("logic error") );
-
- if ( haveDay )
- {
- // may be were mistaken when we found it for the first
- // time? may be it was a month or year instead?
- //
- // this ability to "backtrack" allows us to correctly parse
- // both things like 01/13 and 13/01 - but, of course, we
- // still can't resolve the ambiguity in 01/02 (it will be
- // Feb 1 for us, not Jan 2 as americans might expect!)
- if ( (day <= 12) && !haveMon )
- {
- // exchange day and month
- mon = (wxDateTime::Month)(day - 1);
-
- haveMon = TRUE;
- }
- else if ( !haveYear )
- {
- // exchange day and year
- year = day;
-
- haveYear = TRUE;
- }
- }
-
- haveDay = TRUE;
+ haveMon = TRUE;
- day = (wxDateTime_t)val;
+ mon = (Month)(val - 1);
}
}
else // not a number
// source such as opening and closing the data source.
// Author: Doug Card
// Modified by: George Tasker
+// Bart Jourquin
+// Mark Johnson
// Mods: Dec, 1998:
// -Added support for SQL statement logging and database cataloging
// Mods: April, 1999
#if wxMAJOR_VERSION == 2
#ifdef __GNUG__
- #pragma implementation "db.h"
+ #pragma implementation "db.h"
#endif
#endif
wxDbSqlLogState SQLLOGstate = sqlLogOFF;
//char SQLLOGfn[wxDB_PATH_MAX+1] = SQL_LOG_FILENAME;
-wxChar *SQLLOGfn = (wxChar*) SQL_LOG_FILENAME;
+//wxChar *SQLLOGfn = (wxChar*) SQL_LOG_FILENAME;
+static wxString SQLLOGfn = SQL_LOG_FILENAME;
// The wxDb::errorList is copied to this variable when the wxDb object
// is closed. This way, the error list is still available after the
// connection fails so the calling application can show the operator
// why the connection failed. Note: as each wxDb object is closed, it
// will overwrite the errors of the previously destroyed wxDb object in
-// this variable.
+// this variable. NOTE: This occurs during a CLOSE, not a FREEing of the
+// connection
char DBerrorList[DB_MAX_ERROR_HISTORY][DB_MAX_ERROR_MSG_LEN];
+#if EXPERIMENTAL_WXDB_FUNCTIONS // will be added in 2.4
+// This type defines the return row-struct form
+// SQLTablePrivileges, and is used by wxDB::TablePrivileges.
+typedef struct
+{
+ char tableQual[129];
+ char tableOwner[129];
+ char tableName[129];
+ char grantor[129];
+ char grantee[129];
+ char privilege[129];
+ char grantable[4];
+} wxDbTablePrivilegeInfo;
+#endif
+
/********** wxDbColFor Constructor **********/
wxDbColFor::wxDbColFor()
{
- i_Nation = 0; // 0=EU, 1=UK, 2=International, 3=US
- s_Field = "";
+ s_Field = "";
int i;
for (i=0;i<7;i++)
{
s_Format[i] = "";
- s_Menge[i] = "";
- i_Menge[i] = 0;
+ s_Amount[i] = "";
+ i_Amount[i] = 0;
}
- Format(1,DB_DATA_TYPE_VARCHAR,0,0,0); // the Function that does the work
+ i_Nation = 0; // 0=EU, 1=UK, 2=International, 3=US
+ i_dbDataType = 0;
+ i_sqlDataType = 0;
+ Format(1,DB_DATA_TYPE_VARCHAR,0,0,0); // the Function that does the work
} // wxDbColFor::wxDbColFor()
} // wxDbColFor::~wxDbColFor()
+/********** wxDbColInf Con / Destructor **********/
+wxDbColInf::wxDbColInf()
+{
+ catalog[0] = 0;
+ schema[0] = 0;
+ tableName[0] = 0;
+ colName[0] = 0;
+ sqlDataType = 0;
+ typeName[0] = 0;
+ columnSize = 0;
+ bufferLength = 0;
+ decimalDigits = 0;
+ numPrecRadix = 0;
+ nullable = 0;
+ remarks[0] = 0;
+ dbDataType = 0;
+ PkCol = 0;
+ PkTableName[0] = 0;
+ FkCol = 0;
+ FkTableName[0] = 0;
+ pColFor = NULL;
+} // wxDbColInf::wxDbColFor()
+
+
+wxDbColInf::~wxDbColInf()
+{
+ if (pColFor)
+ delete pColFor;
+ pColFor = NULL;
+} // wxDbColInf::~wxDbColInf()
+
+
+/********** wxDbTableInf Constructor ********/
+wxDbTableInf::wxDbTableInf()
+{
+ tableName[0] = 0;
+ tableType[0] = 0;
+ tableRemarks[0] = 0;
+ numCols = 0;
+ pColInf = NULL;
+} // wxDbTableInf::wxDbTableFor()
+
+
+/********** wxDbTableInf Constructor ********/
+wxDbTableInf::~wxDbTableInf()
+{
+ if (pColInf)
+ delete [] pColInf;
+ pColInf = NULL;
+} // wxDbTableInf::~wxDbTableInf()
+
+
+/********** wxDbInf Constructor *************/
+wxDbInf::wxDbInf()
+{
+ catalog[0] = 0;
+ schema[0] = 0;
+ numTables = 0;
+ pTableInf = NULL;
+} // wxDbInf::wxDbFor()
+
+
+/********** wxDbInf Destructor *************/
+wxDbInf::~wxDbInf()
+{
+ if (pTableInf)
+ delete [] pTableInf;
+ pTableInf = NULL;
+} // wxDbInf::~wxDbInf()
+
+
+/*************************************************/
+
+
int wxDbColFor::Format(int Nation,int dbDataType,SWORD sqlDataType,short columnSize,short decimalDigits)
{
// ----------------------------------------------------------------------------------------
// -- 19991224 : mj10777@gmx.net : Create
// There is still a lot of work to do here, but it is a start
// It handles all the basic data-types that I have run into up to now
- // The main work will have be with Dates and float Formatting (US 1,000.00 ; EU 1.000,00)
- // There are wxWindow plans for locale support and the new wxDateTime.
- // - if they define some constants (wxEUROPEAN) that can be gloably used,
+ // The main work will have be with Dates and float Formatting
+ // (US 1,000.00 ; EU 1.000,00)
+ // There are wxWindow plans for locale support and the new wxDateTime. If
+ // they define some constants (wxEUROPEAN) that can be gloably used,
// they should be used here.
// ----------------------------------------------------------------------------------------
- // There should also be a Function to scan in a string to fill the variable
+ // There should also be a function to scan in a string to fill the variable
// ----------------------------------------------------------------------------------------
wxString Temp0;
- i_Nation = Nation; // 0 = timestamp , 1=EU, 2=UK, 3=International, 4=US
+ i_Nation = Nation; // 0 = timestamp , 1=EU, 2=UK, 3=International, 4=US
i_dbDataType = dbDataType;
i_sqlDataType = sqlDataType;
- s_Field.Printf(wxT("%s%d"),s_Menge[1].c_str(),i_Menge[1]); // OK for VARCHAR, INTEGER and FLOAT
- if (i_dbDataType == 0) // Filter unsupported dbDataTypes
+ s_Field.Printf(wxT("%s%d"),s_Amount[1].c_str(),i_Amount[1]); // OK for VARCHAR, INTEGER and FLOAT
+ if (i_dbDataType == 0) // Filter unsupported dbDataTypes
{
if ((i_sqlDataType == SQL_VARCHAR) || (i_sqlDataType == SQL_LONGVARCHAR))
i_dbDataType = DB_DATA_TYPE_VARCHAR;
switch(i_dbDataType) // -A-> Still a lot of proper formatting to do
{
case DB_DATA_TYPE_VARCHAR:
- s_Field = "%s"; //
+ s_Field = "%s";
break;
case DB_DATA_TYPE_INTEGER:
- s_Field = "%d"; //
+ s_Field = "%d";
break;
case DB_DATA_TYPE_FLOAT:
if (decimalDigits == 0)
decimalDigits = 2;
Temp0 = "%";
Temp0.Printf(wxT("%s%d.%d"),Temp0.c_str(),columnSize,decimalDigits);
- s_Field.Printf(wxT("%sf"),Temp0.c_str()); //
+ s_Field.Printf(wxT("%sf"),Temp0.c_str());
break;
case DB_DATA_TYPE_DATE:
if (i_Nation == 0) // timestamp YYYY-MM-DD HH:MM:SS.SSS (tested for SYBASE)
}
break;
default:
- s_Field.Printf(wxT("-E-> unknown Format(%d)-sql(%d)"),dbDataType,sqlDataType); //
+ s_Field.Printf(wxT("Unknown Format(%d)-SQL(%d)"),dbDataType,sqlDataType); //
break;
};
return TRUE;
// SQL_INTEGER type name = 'LONG', Precision = 10
// VARCHAR = Variable length character string
- if (! getDataTypeInfo(SQL_VARCHAR, typeInfVarchar))
- if (! getDataTypeInfo(SQL_CHAR, typeInfVarchar))
+ if (!getDataTypeInfo(SQL_VARCHAR, typeInfVarchar))
+ if (!getDataTypeInfo(SQL_CHAR, typeInfVarchar))
return(FALSE);
else
typeInfVarchar.FsqlType = SQL_CHAR;
typeInfVarchar.FsqlType = SQL_VARCHAR;
// Float
- if (! getDataTypeInfo(SQL_DOUBLE, typeInfFloat))
+ if (!getDataTypeInfo(SQL_DOUBLE,typeInfFloat))
- if (! getDataTypeInfo(SQL_REAL, typeInfFloat))
- if (! getDataTypeInfo(SQL_FLOAT, typeInfFloat))
- if (! getDataTypeInfo(SQL_DECIMAL, typeInfFloat))
- if (! getDataTypeInfo(SQL_NUMERIC, typeInfFloat))
+ if (!getDataTypeInfo(SQL_REAL,typeInfFloat))
+ if (!getDataTypeInfo(SQL_FLOAT,typeInfFloat))
+ if (!getDataTypeInfo(SQL_DECIMAL,typeInfFloat))
+ if (!getDataTypeInfo(SQL_NUMERIC,typeInfFloat))
return(FALSE);
else
typeInfFloat.FsqlType = SQL_NUMERIC;
// Integer
- if (! getDataTypeInfo(SQL_INTEGER, typeInfInteger))
- // If SQL_INTEGER is not supported, use the floating point
- // data type to store integers as well as floats
- if (! getDataTypeInfo(typeInfFloat.FsqlType, typeInfInteger))
+ if (!getDataTypeInfo(SQL_INTEGER, typeInfInteger))
+ {
+ // If SQL_INTEGER is not supported, use the floating point
+ // data type to store integers as well as floats
+ if (!getDataTypeInfo(typeInfFloat.FsqlType, typeInfInteger))
return(FALSE);
else
typeInfInteger.FsqlType = typeInfFloat.FsqlType;
+ }
else
typeInfInteger.FsqlType = SQL_INTEGER;
// Date/Time
if (Dbms() != dbmsDBASE)
- {
- if (! getDataTypeInfo(SQL_TIMESTAMP, typeInfDate))
+ {
+ if (! getDataTypeInfo(SQL_TIMESTAMP,typeInfDate))
return(FALSE);
else
typeInfDate.FsqlType = SQL_TIMESTAMP;
}
else
{
- if (! getDataTypeInfo(SQL_DATE, typeInfDate))
+ if (!getDataTypeInfo(SQL_DATE,typeInfDate))
return(FALSE);
else
typeInfDate.FsqlType = SQL_DATE;
if (SQLGetInfo(hdbc, SQL_PROCEDURES, (UCHAR*) dbInf.procedureSupport, 2, &cb) != SQL_SUCCESS)
return(DispAllErrors(henv, hdbc));
-
+#if EXPERIMENTAL_WXDB_FUNCTIONS // will be added in 2.4
+ if (SQLGetInfo(hdbc, SQL_ACCESSIBLE_TABLES, (UCHAR*) dbInf.accessibleTables, 2, &cb) != SQL_SUCCESS)
+ return(DispAllErrors(henv, hdbc));
+#endif
if (SQLGetInfo(hdbc, SQL_CURSOR_COMMIT_BEHAVIOR, (UCHAR*) &dbInf.cursorCommitBehavior, sizeof(dbInf.cursorCommitBehavior), &cb) != SQL_SUCCESS)
return(DispAllErrors(henv, hdbc));
cout << "SQL Conf. Level: ";
switch(dbInf.sqlConfLvl)
{
- case SQL_OSC_MINIMUM: cout << "Minimum Grammer"; break;
- case SQL_OSC_CORE: cout << "Core Grammer"; break;
- case SQL_OSC_EXTENDED: cout << "Extended Grammer"; break;
+ case SQL_OSC_MINIMUM: cout << "Minimum Grammar"; break;
+ case SQL_OSC_CORE: cout << "Core Grammar"; break;
+ case SQL_OSC_EXTENDED: cout << "Extended Grammar"; break;
}
cout << endl;
cout << "Max. Connections: " << dbInf.maxConnections << endl;
cout << "Outer Joins: " << dbInf.outerJoins << endl;
cout << "Support for Procedures: " << dbInf.procedureSupport << endl;
-
+#if EXPERIMENTAL_WXDB_FUNCTIONS // will be added in 2.4
+ cout << "All tables accessible : " << dbInf.accessibleTables << endl;
+#endif
cout << "Cursor COMMIT Behavior: ";
switch(dbInf.cursorCommitBehavior)
{
return(DispAllErrors(henv, hdbc, hstmt));
// Fetch the record
if ((retcode = SQLFetch(hstmt)) != SQL_SUCCESS)
- {
+ {
#ifdef DBDEBUG_CONSOLE
- if (retcode == SQL_NO_DATA_FOUND)
- cout << "SQL_NO_DATA_FOUND fetching inf. about data type." << endl;
+ if (retcode == SQL_NO_DATA_FOUND)
+ cout << "SQL_NO_DATA_FOUND fetching inf. about data type." << endl;
#endif
- DispAllErrors(henv, hdbc, hstmt);
- SQLFreeStmt(hstmt, SQL_CLOSE);
- return(FALSE);
- }
+ DispAllErrors(henv, hdbc, hstmt);
+ SQLFreeStmt(hstmt, SQL_CLOSE);
+ return(FALSE);
+ }
// Obtain columns from the record
if (SQLGetData(hstmt, 1, SQL_C_CHAR, (UCHAR*) structSQLTypeInfo.TypeName, DB_TYPE_NAME_LEN, &cbRet) != SQL_SUCCESS)
return(DispAllErrors(henv, hdbc, hstmt));
#if OLD_GETCOLUMNS
// BJO 991209
if (Dbms() == dbmsMY_SQL)
- {
+ {
if (!wxStrcmp(structSQLTypeInfo.TypeName, "middleint")) wxStrcpy(structSQLTypeInfo.TypeName, "mediumint");
if (!wxStrcmp(structSQLTypeInfo.TypeName, "middleint unsigned")) wxStrcpy(structSQLTypeInfo.TypeName, "mediumint unsigned");
if (!wxStrcmp(structSQLTypeInfo.TypeName, "integer")) wxStrcpy(structSQLTypeInfo.TypeName, "int");
if (!wxStrcmp(structSQLTypeInfo.TypeName, "integer unsigned")) wxStrcpy(structSQLTypeInfo.TypeName, "int unsigned");
if (!wxStrcmp(structSQLTypeInfo.TypeName, "middleint")) wxStrcpy(structSQLTypeInfo.TypeName, "mediumint");
if (!wxStrcmp(structSQLTypeInfo.TypeName, "varchar")) wxStrcpy(structSQLTypeInfo.TypeName, "char");
- }
+ }
// BJO 20000427 : OpenLink driver
if (!wxStrncmp(dbInf.driverName, "oplodbc", 7) ||
- !wxStrncmp(dbInf.driverName, "OLOD", 4))
- if (!wxStrcmp(structSQLTypeInfo.TypeName, "double precision")) wxStrcpy(structSQLTypeInfo.TypeName, "real");
+ !wxStrncmp(dbInf.driverName, "OLOD", 4))
+ {
+ if (!wxStrcmp(structSQLTypeInfo.TypeName, "double precision"))
+ wxStrcpy(structSQLTypeInfo.TypeName, "real");
+ }
#endif
if (SQLGetData(hstmt, 3, SQL_C_LONG, (UCHAR*) &structSQLTypeInfo.Precision, 0, &cbRet) != SQL_SUCCESS)
/********** wxDb::DispNextError() **********/
void wxDb::DispNextError(void)
{
-// char odbcErrMsg[DB_MAX_ERROR_MSG_LEN];
wxString odbcErrMsg;
odbcErrMsg.sprintf("SQL State = %s\nNative Error Code = %li\nError Message = %s\n", sqlState, nativeError, errorMsg);
wxLogDebug(odbcErrMsg,wxT("ODBC DEBUG MESSAGE"));
#endif // __WXDEBUG__
-
} // wxDb::DispNextError()
/********** wxDb::Grant() **********/
bool wxDb::Grant(int privileges, const char *tableName, const char *userList)
{
-// char sqlStmt[DB_MAX_STATEMENT_LEN];
wxString sqlStmt;
// Build the grant statement
/********** wxDb::CreateView() **********/
bool wxDb::CreateView(const char *viewName, const char *colList, const char *pSqlStmt, bool attemptDrop)
{
-// char sqlStmt[DB_MAX_STATEMENT_LEN];
wxString sqlStmt;
// Drop the view first
for (i=0;i<noCols;i++) // Find the Column name
if (!wxStrcmp(colInf[i].colName,szPkCol)) // We have found the Column
colInf[i].PkCol = iKeySeq; // Which Primary Key is this (first, second usw.) ?
- } // if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
- } // while ((retcode == SQL_SUCCESS) || (retcode == SQL_SUCCESS_WITH_INFO))
+ } // if
+ } // while
SQLFreeStmt(hstmt, SQL_CLOSE); /* Close the cursor (the hstmt is still allocated). */
/*---------------------------------------------------------------------*/
GetData( 7, SQL_C_CHAR, szFkTable, DB_MAX_TABLE_NAME_LEN+1, &cb);
GetData( 8, SQL_C_CHAR, szFkCol, DB_MAX_COLUMN_NAME_LEN+1, &cb);
Temp0.Printf(wxT("%s[%s] "),Temp0.c_str(),szFkTable); // [ ] in case there is a blank in the Table name
- } // if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
- } // while ((retcode == SQL_SUCCESS) || (retcode == SQL_SUCCESS_WITH_INFO))
+ } // if
+ } // while
Temp0.Trim(); // Get rid of any unneeded blanks
if (Temp0 != wxT(""))
{
- for (i=0;i<noCols;i++) // Find the Column name
- if (!wxStrcmp(colInf[i].colName,szPkCol)) // We have found the Column, store the Information
- wxStrcpy(colInf[i].PkTableName,Temp0.c_str()); // Name of the Tables where this Primary Key is used as a Foreign Key
- } // if (Temp0 != "")
+ for (i=0;i<noCols;i++)
+ { // Find the Column name
+ if (!wxStrcmp(colInf[i].colName,szPkCol)) // We have found the Column, store the Information
+ wxStrcpy(colInf[i].PkTableName,Temp0.c_str()); // Name of the Tables where this Primary Key is used as a Foreign Key
+ }
+ } // if
SQLFreeStmt(hstmt, SQL_CLOSE); /* Close the cursor (the hstmt is still allocated). */
/*---------------------------------------------------------------------*/
if (!wxStrcmp(colInf[i].colName,szFkCol)) // We have found the (Foreign Key) Column
{
colInf[i].FkCol = iKeySeq; // Which Foreign Key is this (first, second usw.) ?
- wxStrcpy(colInf[i].FkTableName,szPkTable); // Name of the Table where this Foriegn is the Primary Key
- } // if (!wxStrcmp(colInf[i].colName,szFkCol))
- } // for (i=0;i<noCols;i++)
- } // if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
- } // while ((retcode == SQL_SUCCESS) || (retcode == SQL_SUCCESS_WITH_INFO))
+ wxStrcpy(colInf[i].FkTableName,szPkTable); // Name of the Table where this Foriegn is the Primary Key
+ } // if
+ } // for
+ } // if
+ } // while
SQLFreeStmt(hstmt, SQL_CLOSE); /* Close the cursor (the hstmt is still allocated). */
- /*---------------------------------------------------------------------*/
return TRUE;
+
} // wxDb::GetKeyFields()
GetData(10, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].numPrecRadix, 0, &cb);
GetData(11, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].nullable, 0, &cb);
GetData(12, SQL_C_CHAR, (UCHAR*) colInf[colNo].remarks, 254+1, &cb);
-
+
// Determine the wxDb data type that is used to represent the native data type of this data source
colInf[colNo].dbDataType = 0;
if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
colInf[colNo].FkCol = 0; // Foreign key column 0=No; 1= First Key, 2 = Second Key etc.
colInf[colNo].FkTableName[0] = 0; // Foreign key table name
- // BJO 20000428 : Virtuoso returns type names with upper cases!
- if (Dbms() == dbmsVIRTUOSO)
- {
- wxString s = colInf[colNo].typeName;
- s = s.MakeLower();
- wxStrcmp(colInf[colNo].typeName, s.c_str());
- }
-
- // Determine the wxDb data type that is used to represent the native data type of this data source
- colInf[colNo].dbDataType = 0;
- if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
- {
- if (colInf[colNo].columnSize < 1)
- {
- // IODBC does not return a correct columnSize, so we set
- // columnSize = bufferLength if no column size was returned
- colInf[colNo].columnSize = colInf[colNo].bufferLength;
- }
- colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
- }
- else if (!wxStricmp(typeInfInteger.TypeName,colInf[colNo].typeName))
- colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
- else if (!wxStricmp(typeInfFloat.TypeName,colInf[colNo].typeName))
- colInf[colNo].dbDataType = DB_DATA_TYPE_FLOAT;
- else if (!wxStricmp(typeInfDate.TypeName,colInf[colNo].typeName))
- colInf[colNo].dbDataType = DB_DATA_TYPE_DATE;
-
+ // BJO 20000428 : Virtuoso returns type names with upper cases!
+ if (Dbms() == dbmsVIRTUOSO)
+ {
+ wxString s = colInf[colNo].typeName;
+ s = s.MakeLower();
+ wxStrcmp(colInf[colNo].typeName, s.c_str());
+ }
+
+ // Determine the wxDb data type that is used to represent the native data type of this data source
+ colInf[colNo].dbDataType = 0;
+ if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
+ {
+ if (colInf[colNo].columnSize < 1)
+ {
+ // IODBC does not return a correct columnSize, so we set
+ // columnSize = bufferLength if no column size was returned
+ colInf[colNo].columnSize = colInf[colNo].bufferLength;
+ }
+ colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
+ }
+ else if (!wxStricmp(typeInfInteger.TypeName,colInf[colNo].typeName))
+ colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
+ else if (!wxStricmp(typeInfFloat.TypeName,colInf[colNo].typeName))
+ colInf[colNo].dbDataType = DB_DATA_TYPE_FLOAT;
+ else if (!wxStricmp(typeInfDate.TypeName,colInf[colNo].typeName))
+ colInf[colNo].dbDataType = DB_DATA_TYPE_DATE;
+
colNo++;
}
}
}
if (retcode != SQL_NO_DATA_FOUND)
- { // Error occured, abort
+ { // Error occured, abort
DispAllErrors(henv, hdbc, hstmt);
if (colInf)
- delete [] colInf;
+ delete [] colInf;
SQLFreeStmt(hstmt, SQL_CLOSE);
if (numCols)
- *numCols = 0;
+ *numCols = 0;
return(0);
- }
+ }
}
SQLFreeStmt(hstmt, SQL_CLOSE);
} // wxDb::GetColumns()
-#else // New GetColumns
+#else // New GetColumns
/*
-
-BJO 20000503
-
-These are tentative new GetColumns members:
-
-- The first one (wxDbColInf *wxDb::GetColumns(char *tableName[], const char* userID)) calls
- the second implementation for each separate table before merging the results. This makes the
- code easier to maintain as only one member (the second) makes the real work
-- wxDbColInf *wxDb::GetColumns(char *tableName, int *numCols, const char *userID) is a little bit improved
- - It doesn't anymore rely on the type-name to find out which database-type each column has
- - It ends by sorting the columns, so that they are returned in the same order they were created
-
+ BJO 20000503
+ These are tentative new GetColumns members which should be more database
+ independant and which always returns the columns in the order they were
+ created.
+
+ - The first one (wxDbColInf *wxDb::GetColumns(char *tableName[], const
+ char* userID)) calls the second implementation for each separate table
+ before merging the results. This makes the code easier to maintain as
+ only one member (the second) makes the real work
+ - wxDbColInf *wxDb::GetColumns(char *tableName, int *numCols, const
+ char *userID) is a little bit improved
+ - It doesn't anymore rely on the type-name to find out which database-type
+ each column has
+ - It ends by sorting the columns, so that they are returned in the same
+ order they were created
*/
typedef struct
{
- int noCols;
- wxDbColInf *colInf;
+ int noCols;
+ wxDbColInf *colInf;
} _TableColumns;
+
wxDbColInf *wxDb::GetColumns(char *tableName[], const char* userID)
{
- int i, j;
- // The last array element of the tableName[] argument must be zero (null).
- // This is how the end of the array is detected.
-
- int noCols = 0;
-
- // How many tables ?
- int tbl;
- for (tbl = 0 ; tableName[tbl]; tbl++);
-
- // Create a table to maintain the columns for each separate table
- _TableColumns *TableColumns = new _TableColumns[tbl];
-
- // Fill the table
- for (i = 0 ; i < tbl ; i++)
-
- {
- TableColumns[i].colInf = GetColumns(tableName[i], &TableColumns[i].noCols, userID);
- if (TableColumns[i].colInf == NULL) return NULL;
- noCols += TableColumns[i].noCols;
- }
-
- // Now merge all the separate table infos
- wxDbColInf *colInf = new wxDbColInf[noCols+1];
-
- // Mark the end of the array
- wxStrcpy(colInf[noCols].tableName, wxT(""));
- wxStrcpy(colInf[noCols].colName, wxT(""));
- colInf[noCols].sqlDataType = 0;
-
- // Merge ...
- int offset = 0;
-
- for (i = 0 ; i < tbl ; i++)
- {
- for (j = 0 ; j < TableColumns[i].noCols ; j++)
- {
- colInf[offset++] = TableColumns[i].colInf[j];
- }
- }
-
- delete [] TableColumns;
-
- return colInf;
-}
+ int i, j;
+ // The last array element of the tableName[] argument must be zero (null).
+ // This is how the end of the array is detected.
+
+ int noCols = 0;
+
+ // How many tables ?
+ int tbl;
+ for (tbl = 0 ; tableName[tbl]; tbl++);
+
+ // Create a table to maintain the columns for each separate table
+ _TableColumns *TableColumns = new _TableColumns[tbl];
+
+ // Fill the table
+ for (i = 0 ; i < tbl ; i++)
+
+ {
+ TableColumns[i].colInf = GetColumns(tableName[i], &TableColumns[i].noCols, userID);
+ if (TableColumns[i].colInf == NULL)
+ return NULL;
+ noCols += TableColumns[i].noCols;
+ }
+
+ // Now merge all the separate table infos
+ wxDbColInf *colInf = new wxDbColInf[noCols+1];
+
+ // Mark the end of the array
+ wxStrcpy(colInf[noCols].tableName, wxT(""));
+ wxStrcpy(colInf[noCols].colName, wxT(""));
+ colInf[noCols].sqlDataType = 0;
+
+ // Merge ...
+ int offset = 0;
+
+ for (i = 0 ; i < tbl ; i++)
+ {
+ for (j = 0 ; j < TableColumns[i].noCols ; j++)
+ {
+ colInf[offset++] = TableColumns[i].colInf[j];
+ }
+ }
+
+ delete [] TableColumns;
+
+ return colInf;
+} // wxDb::GetColumns() -- NEW
wxDbColInf *wxDb::GetColumns(char *tableName, int *numCols, const char *userID)
- //
- // Same as the above GetColumns() function except this one gets columns
- // only for a single table, and if 'numCols' is not NULL, the number of
- // columns stored in the returned wxDbColInf is set in '*numCols'
- //
- // userID is evaluated in the following manner:
- // userID == NULL ... UserID is ignored
- // userID == "" ... UserID set equal to 'this->uid'
- // userID != "" ... UserID set equal to 'userID'
- //
- // NOTE: ALL column bindings associated with this wxDb instance are unbound
- // by this function. This function should use its own wxDb instance
- // to avoid undesired unbinding of columns.
-
+//
+// Same as the above GetColumns() function except this one gets columns
+// only for a single table, and if 'numCols' is not NULL, the number of
+// columns stored in the returned wxDbColInf is set in '*numCols'
+//
+// userID is evaluated in the following manner:
+// userID == NULL ... UserID is ignored
+// userID == "" ... UserID set equal to 'this->uid'
+// userID != "" ... UserID set equal to 'userID'
+//
+// NOTE: ALL column bindings associated with this wxDb instance are unbound
+// by this function. This function should use its own wxDb instance
+// to avoid undesired unbinding of columns.
{
- SWORD noCols = 0;
- int colNo = 0;
- wxDbColInf *colInf = 0;
-
- RETCODE retcode;
- SDWORD cb;
-
- wxString UserID;
- wxString TableName;
-
- if (userID)
- {
- if (!wxStrlen(userID))
- UserID = uid;
- else
- UserID = userID;
- }
- else
- UserID = "";
-
- // dBase does not use user names, and some drivers fail if you try to pass one
- if (Dbms() == dbmsDBASE)
- UserID = "";
-
- // Oracle user names may only be in uppercase, so force
- // the name to uppercase
- if (Dbms() == dbmsORACLE)
- UserID = UserID.Upper();
-
- // Pass 1 - Determine how many columns there are.
- // Pass 2 - Allocate the wxDbColInf array and fill in
- // the array with the column information.
- int pass;
- for (pass = 1; pass <= 2; pass++)
- {
- if (pass == 2)
+ SWORD noCols = 0;
+ int colNo = 0;
+ wxDbColInf *colInf = 0;
+
+ RETCODE retcode;
+ SDWORD cb;
+
+ wxString UserID;
+ wxString TableName;
+
+ if (userID)
+ {
+ if (!wxStrlen(userID))
+ UserID = uid;
+ else
+ UserID = userID;
+ }
+ else
+ UserID = "";
+
+ // dBase does not use user names, and some drivers fail if you try to pass one
+ if (Dbms() == dbmsDBASE)
+ UserID = "";
+
+ // Oracle user names may only be in uppercase, so force
+ // the name to uppercase
+ if (Dbms() == dbmsORACLE)
+ UserID = UserID.Upper();
+
+ // Pass 1 - Determine how many columns there are.
+ // Pass 2 - Allocate the wxDbColInf array and fill in
+ // the array with the column information.
+ int pass;
+ for (pass = 1; pass <= 2; pass++)
+ {
+ if (pass == 2)
{
- if (noCols == 0) // Probably a bogus table name(s)
- break;
- // Allocate n wxDbColInf objects to hold the column information
- colInf = new wxDbColInf[noCols+1];
- if (!colInf)
- break;
- // Mark the end of the array
- wxStrcpy(colInf[noCols].tableName, wxT(""));
- wxStrcpy(colInf[noCols].colName, wxT(""));
- colInf[noCols].sqlDataType = 0;
+ if (noCols == 0) // Probably a bogus table name(s)
+ break;
+ // Allocate n wxDbColInf objects to hold the column information
+ colInf = new wxDbColInf[noCols+1];
+ if (!colInf)
+ break;
+ // Mark the end of the array
+ wxStrcpy(colInf[noCols].tableName, wxT(""));
+ wxStrcpy(colInf[noCols].colName, wxT(""));
+ colInf[noCols].sqlDataType = 0;
}
-
- TableName = tableName;
- // Oracle table names are uppercase only, so force
- // the name to uppercase just in case programmer forgot to do this
- if (Dbms() == dbmsORACLE)
- TableName = TableName.Upper();
-
- SQLFreeStmt(hstmt, SQL_CLOSE);
-
- // MySQL and Access cannot accept a user name when looking up column names, so we
- // use the call below that leaves out the user name
- if (wxStrcmp(UserID.c_str(),wxT("")) &&
- Dbms() != dbmsMY_SQL &&
- Dbms() != dbmsACCESS)
+
+ TableName = tableName;
+ // Oracle table names are uppercase only, so force
+ // the name to uppercase just in case programmer forgot to do this
+ if (Dbms() == dbmsORACLE)
+ TableName = TableName.Upper();
+
+ SQLFreeStmt(hstmt, SQL_CLOSE);
+
+ // MySQL and Access cannot accept a user name when looking up column names, so we
+ // use the call below that leaves out the user name
+ if (wxStrcmp(UserID.c_str(),wxT("")) &&
+ Dbms() != dbmsMY_SQL &&
+ Dbms() != dbmsACCESS)
{
- retcode = SQLColumns(hstmt,
- NULL, 0, // All qualifiers
- (UCHAR *) UserID.c_str(), SQL_NTS, // Owner
- (UCHAR *) TableName.c_str(), SQL_NTS,
- NULL, 0); // All columns
+ retcode = SQLColumns(hstmt,
+ NULL, 0, // All qualifiers
+ (UCHAR *) UserID.c_str(), SQL_NTS, // Owner
+ (UCHAR *) TableName.c_str(), SQL_NTS,
+ NULL, 0); // All columns
}
- else
+ else
{
- retcode = SQLColumns(hstmt,
- NULL, 0, // All qualifiers
- NULL, 0, // Owner
- (UCHAR *) TableName.c_str(), SQL_NTS,
- NULL, 0); // All columns
+ retcode = SQLColumns(hstmt,
+ NULL, 0, // All qualifiers
+ NULL, 0, // Owner
+ (UCHAR *) TableName.c_str(), SQL_NTS,
+ NULL, 0); // All columns
}
- if (retcode != SQL_SUCCESS)
+ if (retcode != SQL_SUCCESS)
{ // Error occured, abort
- DispAllErrors(henv, hdbc, hstmt);
- if (colInf)
- delete [] colInf;
- SQLFreeStmt(hstmt, SQL_CLOSE);
- if (numCols)
- *numCols = 0;
- return(0);
+ DispAllErrors(henv, hdbc, hstmt);
+ if (colInf)
+ delete [] colInf;
+ SQLFreeStmt(hstmt, SQL_CLOSE);
+ if (numCols)
+ *numCols = 0;
+ return(0);
}
-
+
while ((retcode = SQLFetch(hstmt)) == SQL_SUCCESS)
{
if (pass == 1) // First pass, just add up the number of columns
colInf[colNo].PkTableName[0] = 0; // Tablenames where Primary Key is used as a Foreign Key
colInf[colNo].FkCol = 0; // Foreign key column 0=No; 1= First Key, 2 = Second Key etc.
colInf[colNo].FkTableName[0] = 0; // Foreign key table name
-
-#ifdef _IODBC_
- // IODBC returns the columnSize in bufferLength.. (bug)
- colInf[colNo].columnSize = colInf[colNo].bufferLength;
+
+#ifdef _IODBC_
+ // IODBC returns the columnSize in bufferLength.. (bug)
+ colInf[colNo].columnSize = colInf[colNo].bufferLength;
#endif
-
- // Determine the wxDb data type that is used to represent the native data type of this data source
- colInf[colNo].dbDataType = 0;
- // Get the intern datatype
- switch (colInf[colNo].sqlDataType)
- {
- case SQL_VARCHAR:
- case SQL_CHAR:
- colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
- break;
-
- case SQL_TINYINT:
- case SQL_SMALLINT:
- case SQL_INTEGER:
- colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
- break;
- case SQL_DOUBLE:
- case SQL_DECIMAL:
- case SQL_NUMERIC:
- case SQL_FLOAT:
- case SQL_REAL:
- colInf[colNo].dbDataType = DB_DATA_TYPE_FLOAT;
- break;
- case SQL_DATE:
- colInf[colNo].dbDataType = DB_DATA_TYPE_DATE;
- break;
-
-
+
+ // Determine the wxDb data type that is used to represent the native data type of this data source
+ colInf[colNo].dbDataType = 0;
+ // Get the intern datatype
+ switch (colInf[colNo].sqlDataType)
+ {
+ case SQL_VARCHAR:
+ case SQL_CHAR:
+ colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
+ break;
+
+ case SQL_TINYINT:
+ case SQL_SMALLINT:
+ case SQL_INTEGER:
+ colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
+ break;
+ case SQL_DOUBLE:
+ case SQL_DECIMAL:
+ case SQL_NUMERIC:
+ case SQL_FLOAT:
+ case SQL_REAL:
+ colInf[colNo].dbDataType = DB_DATA_TYPE_FLOAT;
+ break;
+ case SQL_DATE:
+ colInf[colNo].dbDataType = DB_DATA_TYPE_DATE;
+ break;
#ifdef __WXDEBUG__
- default:
- wxString errMsg;
- errMsg.sprintf("SQL Data type %d currently not supported by wxWindows", colInf[colNo].sqlDataType);
- wxLogDebug(errMsg,wxT("ODBC DEBUG MESSAGE"));
-#endif
- }
-
-
-
+ default:
+ wxString errMsg;
+ errMsg.sprintf("SQL Data type %d currently not supported by wxWindows", colInf[colNo].sqlDataType);
+ wxLogDebug(errMsg,wxT("ODBC DEBUG MESSAGE"));
+#endif
+ }
colNo++;
}
}
}
if (retcode != SQL_NO_DATA_FOUND)
- { // Error occured, abort
+ { // Error occured, abort
DispAllErrors(henv, hdbc, hstmt);
if (colInf)
- delete [] colInf;
+ delete [] colInf;
SQLFreeStmt(hstmt, SQL_CLOSE);
if (numCols)
- *numCols = 0;
+ *numCols = 0;
return(0);
- }
- }
-
- SQLFreeStmt(hstmt, SQL_CLOSE);
-
- // Store Primary and Foreign Keys
- GetKeyFields(tableName,colInf,noCols);
-
-
-
- ///////////////////////////////////////////////////////////////////////////
- // Now sort the the columns in order to make them appear in the right order
- ///////////////////////////////////////////////////////////////////////////
-
- // Build a generic SELECT statement which returns 0 rows
- wxString Stmt;
-
- Stmt.sprintf("select * from %s where 0=1", tableName);
-
- // Execute query
- if (SQLExecDirect(hstmt, (UCHAR FAR *) Stmt.c_str(), SQL_NTS) != SQL_SUCCESS)
- {
- DispAllErrors(henv, hdbc, hstmt);
- return NULL;
+ }
+ }
+
+ SQLFreeStmt(hstmt, SQL_CLOSE);
+
+ // Store Primary and Foreign Keys
+ GetKeyFields(tableName,colInf,noCols);
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Now sort the the columns in order to make them appear in the right order
+ ///////////////////////////////////////////////////////////////////////////
+
+ // Build a generic SELECT statement which returns 0 rows
+ wxString Stmt;
+
+ Stmt.sprintf("select * from %s where 0=1", tableName);
+
+ // Execute query
+ if (SQLExecDirect(hstmt, (UCHAR FAR *) Stmt.c_str(), SQL_NTS) != SQL_SUCCESS)
+ {
+ DispAllErrors(henv, hdbc, hstmt);
+ return NULL;
}
-
- // Get the number of result columns
- if (SQLNumResultCols (hstmt, &noCols) != SQL_SUCCESS)
- {
- DispAllErrors(henv, hdbc, hstmt);
- return NULL;
- }
-
- if (noCols == 0) // Probably a bogus table name
- return NULL;
-
- // Get the name
- int i;
- short colNum;
- UCHAR name[100];
- SWORD Sword;
- SDWORD Sdword;
- for (colNum = 0; colNum < noCols; colNum++)
+
+ // Get the number of result columns
+ if (SQLNumResultCols (hstmt, &noCols) != SQL_SUCCESS)
+ {
+ DispAllErrors(henv, hdbc, hstmt);
+ return NULL;
+ }
+
+ if (noCols == 0) // Probably a bogus table name
+ return NULL;
+
+ // Get the name
+ int i;
+ short colNum;
+ UCHAR name[100];
+ SWORD Sword;
+ SDWORD Sdword;
+ for (colNum = 0; colNum < noCols; colNum++)
{
- if (SQLColAttributes(hstmt,colNum+1, SQL_COLUMN_NAME,
- name, sizeof(name),
- &Sword, &Sdword) != SQL_SUCCESS)
- {
- DispAllErrors(henv, hdbc, hstmt);
- return NULL;
- }
-
- wxString Name1 = name;
- Name1 = Name1.Upper();
-
- // Where is this name in the array ?
- for (i = colNum ; i < noCols ; i++)
- {
- wxString Name2 = colInf[i].colName;
- Name2 = Name2.Upper();
- if (Name2 == Name1)
- {
- if (colNum != i) // swap to sort
- {
- wxDbColInf tmpColInf = colInf[colNum];
- colInf[colNum] = colInf[i];
- colInf[i] = tmpColInf;
- }
- break;
- }
- }
+ if (SQLColAttributes(hstmt,colNum+1, SQL_COLUMN_NAME,
+ name, sizeof(name),
+ &Sword, &Sdword) != SQL_SUCCESS)
+ {
+ DispAllErrors(henv, hdbc, hstmt);
+ return NULL;
+ }
+
+ wxString Name1 = name;
+ Name1 = Name1.Upper();
+
+ // Where is this name in the array ?
+ for (i = colNum ; i < noCols ; i++)
+ {
+ wxString Name2 = colInf[i].colName;
+ Name2 = Name2.Upper();
+ if (Name2 == Name1)
+ {
+ if (colNum != i) // swap to sort
+ {
+ wxDbColInf tmpColInf = colInf[colNum];
+ colInf[colNum] = colInf[i];
+ colInf[i] = tmpColInf;
+ }
+ break;
+ }
+ }
}
- SQLFreeStmt(hstmt, SQL_CLOSE);
-
- ///////////////////////////////////////////////////////////////////////////
- // End sorting
- ///////////////////////////////////////////////////////////////////////////
-
+ SQLFreeStmt(hstmt, SQL_CLOSE);
+ ///////////////////////////////////////////////////////////////////////////
+ // End sorting
+ ///////////////////////////////////////////////////////////////////////////
-
- if (numCols)
- *numCols = noCols;
- return colInf;
-
+ if (numCols)
+ *numCols = noCols;
+ return colInf;
+
} // wxDb::GetColumns()
-#endif
+#endif // #else OLD_GETCOLUMNS
/********** wxDb::GetColumnCount() **********/
{
retcode = SQLColumns(hstmt,
NULL, 0, // All qualifiers
- (UCHAR *) UserID.c_str(), SQL_NTS, // Owner
+ (UCHAR *) UserID.c_str(), SQL_NTS, // Owner
(UCHAR *) TableName.c_str(), SQL_NTS,
NULL, 0); // All columns
}
int pass;
RETCODE retcode;
SDWORD cb;
-// char tblNameSave[DB_MAX_TABLE_NAME_LEN+1];
wxString tblNameSave;
wxString UserID;
//-------------------------------------------------------------
pDbInf = new wxDbInf; // Create the Database Arrray
- pDbInf->catalog[0] = 0;
- pDbInf->schema[0] = 0;
- pDbInf->numTables = 0; // Counter for Tables
- pDbInf->pTableInf = NULL; // Array of Tables
//-------------------------------------------------------------
// Table Information
// Pass 1 - Determine how many Tables there are.
// - Create the Cols array = NULL
//-------------------------------------------------------------
-
for (pass = 1; pass <= 2; pass++)
{
SQLFreeStmt(hstmt, SQL_CLOSE); // Close if Open
tblNameSave = wxT("");
if (wxStrcmp(UserID.c_str(),wxT("")) &&
- Dbms() != dbmsMY_SQL &&
- Dbms() != dbmsACCESS)
+ Dbms() != dbmsMY_SQL &&
+ Dbms() != dbmsACCESS)
{
-
retcode = SQLTables(hstmt,
NULL, 0, // All qualifiers
- (UCHAR *) UserID.c_str(), SQL_NTS, // User specified
+ (UCHAR *) UserID.c_str(), SQL_NTS, // User specified
NULL, 0, // All tables
NULL, 0); // All columns
}
else
{
-
retcode = SQLTables(hstmt,
NULL, 0, // All qualifiers
NULL, 0, // User specified
if (retcode != SQL_SUCCESS)
{
-
DispAllErrors(henv, hdbc, hstmt);
pDbInf = NULL;
SQLFreeStmt(hstmt, SQL_CLOSE);
return pDbInf;
}
-
+
while ((retcode = SQLFetch(hstmt)) == SQL_SUCCESS) // Table Information
{
-
if (pass == 1) // First pass, just count the Tables
{
if (pDbInf->numTables == 0)
if (pDbInf->pTableInf == NULL) // Has the Table Array been created
{ // no, then create the Array
pDbInf->pTableInf = new wxDbTableInf[pDbInf->numTables];
- for (noTab=0;noTab<pDbInf->numTables;noTab++)
- {
- (pDbInf->pTableInf+noTab)->tableName[0] = 0;
- (pDbInf->pTableInf+noTab)->tableType[0] = 0;
- (pDbInf->pTableInf+noTab)->tableRemarks[0] = 0;
- (pDbInf->pTableInf+noTab)->numCols = 0;
- (pDbInf->pTableInf+noTab)->pColInf = NULL;
- }
noTab = 0;
- } // if (pDbInf->pTableInf == NULL) // Has the Table Array been created
+ } // if (pDbInf->pTableInf == NULL) // Has the Table Array been created
GetData( 3, SQL_C_CHAR, (UCHAR*) (pDbInf->pTableInf+noTab)->tableName, DB_MAX_TABLE_NAME_LEN+1, &cb);
GetData( 4, SQL_C_CHAR, (UCHAR*) (pDbInf->pTableInf+noTab)->tableType, 30+1, &cb);
GetData( 5, SQL_C_CHAR, (UCHAR*) (pDbInf->pTableInf+noTab)->tableRemarks, 254+1, &cb);
-
+
noTab++;
- } // if (pass == 2) We now know the amount of Tables
- } // while ((retcode = SQLFetch(hstmt)) == SQL_SUCCESS)
- } // for (pass = 1; pass <= 2; pass++)
+ } // if
+ } // while
+ } // for
SQLFreeStmt(hstmt, SQL_CLOSE);
// Query how many columns are in each table
{
(pDbInf->pTableInf+noTab)->numCols = GetColumnCount((pDbInf->pTableInf+noTab)->tableName,UserID);
}
+
return pDbInf;
+
} // wxDb::GetCatalog()
{
retcode = SQLColumns(hstmt,
NULL, 0, // All qualifiers
- (UCHAR *) UserID.c_str(), SQL_NTS, // User specified
+ (UCHAR *) UserID.c_str(), SQL_NTS, // User specified
NULL, 0, // All tables
NULL, 0); // All columns
}
{
wxString UserID;
wxString TableName;
-
+
assert(tableName && wxStrlen(tableName));
-
+
if (Dbms() == dbmsDBASE)
{
-
- wxString dbName;
- if (tablePath && wxStrlen(tablePath))
- dbName.sprintf("%s\\%s.dbf",tablePath,tableName);
- else
- dbName.sprintf("%s.dbf",tableName);
-
- bool exists;
- exists = wxFileExists(dbName.c_str());
- return exists;
+ wxString dbName;
+ if (tablePath && wxStrlen(tablePath))
+ dbName.sprintf("%s\\%s.dbf",tablePath,tableName);
+ else
+ dbName.sprintf("%s.dbf",tableName);
+
+ bool exists;
+ exists = wxFileExists(dbName.c_str());
+ return exists;
}
-
+
if (userID)
{
if (!wxStrlen(userID))
}
else
UserID = "";
-
+
// Oracle user names may only be in uppercase, so force
// the name to uppercase
if (Dbms() == dbmsORACLE)
UserID = UserID.Upper();
-
+
TableName = tableName;
// Oracle table names are uppercase only, so force
// the name to uppercase just in case programmer forgot to do this
if (Dbms() == dbmsORACLE)
TableName = TableName.Upper();
-
+
SQLFreeStmt(hstmt, SQL_CLOSE);
RETCODE retcode;
-
+
// MySQL and Access cannot accept a user name when looking up table names, so we
// use the call below that leaves out the user name
if (wxStrcmp(UserID,"") &&
- Dbms() != dbmsMY_SQL &&
- Dbms() != dbmsACCESS)
+ Dbms() != dbmsMY_SQL &&
+ Dbms() != dbmsACCESS)
{
retcode = SQLTables(hstmt,
- NULL, 0, // All qualifiers
+ NULL, 0, // All qualifiers
(UCHAR *) UserID.c_str(), SQL_NTS, // All owners
(UCHAR FAR *)TableName.c_str(), SQL_NTS,
- NULL, 0); // All table types
+ NULL, 0); // All table types
}
else
{
retcode = SQLTables(hstmt,
- NULL, 0, // All qualifiers
- NULL, 0, // All owners
+ NULL, 0, // All qualifiers
+ NULL, 0, // All owners
(UCHAR FAR *)TableName.c_str(), SQL_NTS,
- NULL, 0); // All table types
+ NULL, 0); // All table types
}
if (retcode != SQL_SUCCESS)
return(DispAllErrors(henv, hdbc, hstmt));
-
+
retcode = SQLFetch(hstmt);
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
{
SQLFreeStmt(hstmt, SQL_CLOSE);
return(DispAllErrors(henv, hdbc, hstmt));
}
-
+
SQLFreeStmt(hstmt, SQL_CLOSE);
- return(TRUE);
+ return(TRUE);
+
} // wxDb::TableExists()
+#if EXPERIMENTAL_WXDB_FUNCTIONS // will be added in 2.4
+/********** wxDB::TablePrivileges() **********/
+bool wxDB::TablePrivileges(const char *tableName, const char* priv,
+ const char *userID, const char *tablePath)
+{
+ wxDbTablePrivilegeInfo result;
+ SDWORD cbRetVal;
+ RETCODE retcode;
+
+ //We probably need to be able to dynamically set this based on
+ //the driver type, and state.
+ char curRole[]="public";
+
+ //Prologue here similar to db::TableExists()
+ wxString UserID;
+ wxString TableName;
+
+ assert(tableName && wxStrlen(tableName));
+
+ if (userID)
+ {
+ if (!wxStrlen(userID))
+ UserID = uid;
+ else
+ UserID = userID;
+ }
+ else
+ UserID = "";
+
+ // Oracle user names may only be in uppercase, so force
+ // the name to uppercase
+ if (Dbms() == dbmsORACLE)
+ UserID = UserID.Upper();
+
+ TableName = tableName;
+ // Oracle table names are uppercase only, so force
+ // the name to uppercase just in case programmer forgot to do this
+ if (Dbms() == dbmsORACLE)
+ TableName = TableName.Upper();
+
+ SQLFreeStmt(hstmt, SQL_CLOSE);
+
+ retcode = SQLTablePrivileges(hstmt,
+ NULL, 0, // All qualifiers
+ NULL, 0, // All owners
+ (UCHAR FAR *)TableName.GetData(), SQL_NTS);
+
+#ifdef DBDEBUG_CONSOLE
+ fprintf(stderr ,"SQLTablePrivileges() returned %i \n",retcode);
+#endif
+ retcode = SQLBindCol (hstmt, 1, SQL_C_CHAR , &result.tableQual, 128, &cbRetVal);
+
+ retcode = SQLBindCol (hstmt, 2, SQL_C_CHAR , &result.tableOwner, 128, &cbRetVal);
+
+ retcode = SQLBindCol (hstmt, 3, SQL_C_CHAR , &result.tableName, 128, &cbRetVal);
+
+ retcode = SQLBindCol (hstmt, 4, SQL_C_CHAR , &result.grantor, 128, &cbRetVal);
+
+ retcode = SQLBindCol (hstmt, 5, SQL_C_CHAR , &result.grantee, 128, &cbRetVal);
+
+ retcode = SQLBindCol (hstmt, 6, SQL_C_CHAR , &result.privilege, 128, &cbRetVal);
+
+ retcode = SQLBindCol (hstmt, 7, SQL_C_CHAR , &result.grantable, 3, &cbRetVal);
+
+ retcode = SQLFetch(hstmt);
+ while (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
+ {
+#ifdef DBDEBUG_CONSOLE
+ fprintf(stderr,"Scanning %s privilege on table %s.%s granted by %s to %s\n",
+ result.privilege,result.tabowner,result.tabname,
+ result.grantor, result.grantee);
+#endif
+ if (UserID.IsSameAs(result.tableOwner,false) )
+ return TRUE;
+
+ if (UserID.IsSameAs(result.grantee,false) &&
+ !strcmp(result.privilege,priv))
+ return TRUE;
+
+ if (!strcmp(result.grantee,curRole) &&
+ !strcmp(result.privilege,priv))
+ return TRUE;
+
+ retcode = SQLFetch(hstmt);
+ }
+
+ return FALSE;
+
+} // wxDB::TablePrivileges
+#endif
+
+
/********** wxDb::SetSqlLogging() **********/
bool wxDb::SetSqlLogging(wxDbSqlLogState state, const char *filename, bool append)
{
*
* SYBASE (Enterprise)
* - If a column is part of the Primary Key, the column cannot be NULL
+ * - Maximum row size is somewhere in the neighborhood of 1920 bytes
*
* MY_SQL
* - If a column is part of the Primary Key, the column cannot be NULL
* - Cannot support selecting for update [::CanSelectForUpdate()]. Always returns FALSE
+ * - Columns that are part of primary or secondary keys must be defined as being NOT NULL
+ * when they are created. Some code is added in ::CreateIndex to try to adjust the
+ * column definition if it is not defined correctly, but it is experimental
+ * - Does not support sub-queries in SQL statements
*
* POSTGRES
* - Does not support the keywords 'ASC' or 'DESC' as of release v6.5.0
- *
+ * - Does not support sub-queries in SQL statements
*
*/
{
wxChar baseName[25+1];
wxStrncpy(baseName,dbInf.dbmsName,25);
+ baseName[25] = 0;
// BJO 20000428 : add support for Virtuoso
if (!wxStricmp(dbInf.dbmsName,"OpenLink Virtuoso VDBMS"))
// BJO 20000427 : The "SQL Server" string is also returned by SQLServer when
// connected through an OpenLink driver.
// Is it also returned by Sybase Adapatitve server?
- // OpenLink driver name is OLOD3032.DLL for msw and oplodbc.so for unix
+ // OpenLink driver name is OLOD3032.DLL for msw and oplodbc.so for unix
if (!wxStricmp(dbInf.dbmsName,"SQL Server"))
+ {
if (!wxStrncmp(dbInf.driverName, "oplodbc", 7) ||
!wxStrncmp(dbInf.driverName, "OLOD", 4))
- return dbmsMS_SQL_SERVER; else return dbmsSYBASE_ASE;
-
+ return dbmsMS_SQL_SERVER; else return dbmsSYBASE_ASE;
+ }
if (!wxStricmp(dbInf.dbmsName,"Microsoft SQL Server"))
return(dbmsMS_SQL_SERVER);
if (!wxStricmp(baseName,"Informix"))
return(dbmsINFORMIX);
-
baseName[6] = 0;
if (!wxStricmp(baseName,"Oracle"))
return(dbmsORACLE);
return(dbmsDBASE);
return(dbmsUNIDENTIFIED);
+
} // wxDb::Dbms()
{
// The database connection must be for the same datasource
// name and must currently not be in use.
- if (pList->Free && (! wxStrcmp(pDbConfig->Dsn, pList->Dsn))) // Found a free connection
+ if (pList->Free &&
+ (pList->PtrDb->FwdOnlyCursors() == FwdOnlyCursors) &&
+ (!wxStrcmp(pDbConfig->Dsn, pList->Dsn))) // Found a free connection
{
pList->Free = FALSE;
return(pList->PtrDb);
pList->PtrNext->PtrPrev = pList;
pList = pList->PtrNext;
}
- else // Empty list
+ else // Empty list
{
// Create the first node on the list
pList = PtrBegDbList = new wxDbList;
// Scan the linked list searching for the database connection
for (pList = PtrBegDbList; pList; pList = pList->PtrNext)
{
- if (pList->PtrDb == pDb) // Found it!!!
- return(pList->Free = TRUE);
+ if (pList->PtrDb == pDb) // Found it, now free it!!!
+ return (pList->Free = TRUE);
}
// Never found the database object, return failure
}
SQLLOGstate = state;
- wxStrcpy(SQLLOGfn,filename);
+ SQLLOGfn = filename;
return(TRUE);
} // wxDbSqlLog()
-#if 0
+#if EXPERIMENTAL_WXDB_FUNCTIONS // will be added in 2.4
/********** wxDbCreateDataSource() **********/
int wxDbCreateDataSource(const char *driverName, const char *dsn, const char *description,
bool sysDSN, const char *defDir, wxWindow *parent)
else
result = TRUE;
-#else // __WXMSW__
+#else // using iODBC, so this function is not supported
#ifdef __WXDEBUG__
wxLogDebug("wxDbCreateDataSource() not available except under MSW","DEBUG MESSAGE");
#endif
// Purpose: Implementation of the wxDbTable class.
// Author: Doug Card
// Modified by: George Tasker
-// Mods: April 1999
-// -Dynamic cursor support - Only one predefined cursor, as many others as
-// you need may be created on demand
-// -Reduced number of active cursors significantly
-// -Query-Only wxDbTable objects
+// Bart Jourquin
+// Mark Johnson
// Created: 9.96
// RCS-ID: $Id$
// Copyright: (c) 1996 Remstar International, Inc.
#include "wx/version.h"
#if wxMAJOR_VERSION == 2
-# ifdef __GNUG__
-# pragma implementation "dbtable.h"
-# endif
+ #ifdef __GNUG__
+ #pragma implementation "dbtable.h"
+ #endif
#endif
#ifdef DBDEBUG_CONSOLE
wxStrcpy(tableName, tblName); // Table Name
if (tblPath)
wxStrcpy(tablePath, tblPath); // Table Path - used for dBase files
-
+
if (qryTblName) // Name of the table/view to query
wxStrcpy(queryTableName, qryTblName);
else
wxStrcpy(queryTableName, tblName);
-
+
if (!pDb)
return;
-
+
pDb->incrementTableCount();
-
+
wxString s;
tableID = ++lastTableID;
s.sprintf("wxDbTable constructor (%-20s) tableID:[%6lu] pDb:[%p]", tblName,tableID,pDb);
-
+
#ifdef __WXDEBUG__
wxTablesInUse *tableInUse;
tableInUse = new wxTablesInUse();
tableInUse->pDb = pDb;
TablesInUse.Append(tableInUse);
#endif
-
+
pDb->WriteSqlLog(s.c_str());
-
+
// Grab the HENV and HDBC from the wxDb object
henv = pDb->GetHENV();
hdbc = pDb->GetHDBC();
-
+
// Allocate space for column definitions
if (noCols)
colDefs = new wxDbColDef[noCols]; // Points to the first column defintion
-
+
// Allocate statement handles for the table
if (!queryOnly)
{
// Allocate a separate statement handle for internal use
if (SQLAllocStmt(hdbc, &hstmtInternal) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
-
+
// Set the cursor type for the statement handles
cursorType = SQL_CURSOR_STATIC;
-
+
if (SQLSetStmtOption(hstmtInternal, SQL_CURSOR_TYPE, cursorType) != SQL_SUCCESS)
- {
+ {
// Check to see if cursor type is supported
pDb->GetNextError(henv, hdbc, hstmtInternal);
if (! wxStrcmp(pDb->sqlState, "01S02")) // Option Value Changed
- {
-
+ {
// Datasource does not support static cursors. Driver
// will substitute a cursor type. Call SQLGetStmtOption()
// to determine which cursor type was selected.
if (SQLGetStmtOption(hstmtInternal, SQL_CURSOR_TYPE, &cursorType) != SQL_SUCCESS)
- pDb->DispAllErrors(henv, hdbc, hstmtInternal);
+ pDb->DispAllErrors(henv, hdbc, hstmtInternal);
#ifdef DBDEBUG_CONSOLE
cout << "Static cursor changed to: ";
switch(cursorType)
- {
- case SQL_CURSOR_FORWARD_ONLY:
- cout << "Forward Only"; break;
- case SQL_CURSOR_STATIC:
- cout << "Static"; break;
- case SQL_CURSOR_KEYSET_DRIVEN:
- cout << "Keyset Driven"; break;
- case SQL_CURSOR_DYNAMIC:
- cout << "Dynamic"; break;
- }
+ {
+ case SQL_CURSOR_FORWARD_ONLY:
+ cout << "Forward Only";
+ break;
+ case SQL_CURSOR_STATIC:
+ cout << "Static";
+ break;
+ case SQL_CURSOR_KEYSET_DRIVEN:
+ cout << "Keyset Driven";
+ break;
+ case SQL_CURSOR_DYNAMIC:
+ cout << "Dynamic";
+ break;
+ }
cout << endl << endl;
#endif
-
- // BJO20000425
- if (pDb->FwdOnlyCursors() && cursorType != SQL_CURSOR_FORWARD_ONLY)
- {
- // Force the use of a forward only cursor...
- cursorType = SQL_CURSOR_FORWARD_ONLY;
- if (SQLSetStmtOption(hstmtInternal, SQL_CURSOR_TYPE, cursorType) != SQL_SUCCESS)
- {
- // Should never happen
- pDb->GetNextError(henv, hdbc, hstmtInternal);
- return;
- }
- }
- }
- else
- {
+ // BJO20000425
+ if (pDb->FwdOnlyCursors() && cursorType != SQL_CURSOR_FORWARD_ONLY)
+ {
+ // Force the use of a forward only cursor...
+ cursorType = SQL_CURSOR_FORWARD_ONLY;
+ if (SQLSetStmtOption(hstmtInternal, SQL_CURSOR_TYPE, cursorType) != SQL_SUCCESS)
+ {
+ // Should never happen
+ pDb->GetNextError(henv, hdbc, hstmtInternal);
+ return;
+ }
+ }
+ }
+ else
+ {
pDb->DispNextError();
pDb->DispAllErrors(henv, hdbc, hstmtInternal);
- }
+ }
}
#ifdef DBDEBUG_CONSOLE
else
cout << "Cursor Type set to STATIC" << endl << endl;
#endif
-
+
if (!queryOnly)
{
// Set the cursor type for the INSERT statement handle
if (SQLSetStmtOption(hstmtUpdate, SQL_CURSOR_TYPE, SQL_CURSOR_FORWARD_ONLY) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc, hstmtUpdate);
}
-
+
// Make the default cursor the active cursor
hstmtDefault = GetNewCursor(FALSE,FALSE);
assert(hstmtDefault);
hstmt = *hstmtDefault;
-
+
} // wxDbTable::wxDbTable()
if (hstmtUpdate)
if (SQLFreeStmt(hstmtUpdate, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
-
}
+
if (hstmtInternal)
if (SQLFreeStmt(hstmtInternal, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
if (hstmtCount)
DeleteCursor(hstmtCount);
-
} // wxDbTable::~wxDbTable()
continue;
switch(colDefs[i].DbDataType)
{
-
- case DB_DATA_TYPE_VARCHAR:
- fSqlType = pDb->GetTypeInfVarchar().FsqlType;
- precision = colDefs[i].SzDataObj;
- scale = 0;
- colDefs[i].CbValue = SQL_NTS;
- break;
- case DB_DATA_TYPE_INTEGER:
- fSqlType = pDb->GetTypeInfInteger().FsqlType;
- precision = pDb->GetTypeInfInteger().Precision;
- scale = 0;
- colDefs[i].CbValue = 0;
- break;
- case DB_DATA_TYPE_FLOAT:
- fSqlType = pDb->GetTypeInfFloat().FsqlType;
- precision = pDb->GetTypeInfFloat().Precision;
- scale = pDb->GetTypeInfFloat().MaximumScale;
- // SQL Sybase Anywhere v5.5 returned a negative number for the
- // MaxScale. This caused ODBC to kick out an error on ibscale.
- // I check for this here and set the scale = precision.
- //if (scale < 0)
- // scale = (short) precision;
- colDefs[i].CbValue = 0;
- break;
- case DB_DATA_TYPE_DATE:
- fSqlType = pDb->GetTypeInfDate().FsqlType;
- precision = pDb->GetTypeInfDate().Precision;
- scale = 0;
- colDefs[i].CbValue = 0;
- break;
+ case DB_DATA_TYPE_VARCHAR:
+ fSqlType = pDb->GetTypeInfVarchar().FsqlType;
+ precision = colDefs[i].SzDataObj;
+ scale = 0;
+ colDefs[i].CbValue = SQL_NTS;
+ break;
+ case DB_DATA_TYPE_INTEGER:
+ fSqlType = pDb->GetTypeInfInteger().FsqlType;
+ precision = pDb->GetTypeInfInteger().Precision;
+ scale = 0;
+ colDefs[i].CbValue = 0;
+ break;
+ case DB_DATA_TYPE_FLOAT:
+ fSqlType = pDb->GetTypeInfFloat().FsqlType;
+ precision = pDb->GetTypeInfFloat().Precision;
+ scale = pDb->GetTypeInfFloat().MaximumScale;
+ // SQL Sybase Anywhere v5.5 returned a negative number for the
+ // MaxScale. This caused ODBC to kick out an error on ibscale.
+ // I check for this here and set the scale = precision.
+ //if (scale < 0)
+ // scale = (short) precision;
+ colDefs[i].CbValue = 0;
+ break;
+ case DB_DATA_TYPE_DATE:
+ fSqlType = pDb->GetTypeInfDate().FsqlType;
+ precision = pDb->GetTypeInfDate().Precision;
+ scale = 0;
+ colDefs[i].CbValue = 0;
+ break;
}
// Null values
if (colDefs[i].Null)
colDefs[i].Null = FALSE;
}
- if (SQLBindParameter(hstmtInsert, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype,
- fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj,
- precision+1,&colDefs[i].CbValue) != SQL_SUCCESS)
- return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
+ if (SQLBindParameter(hstmtInsert, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype,
+ fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj,
+ precision+1,&colDefs[i].CbValue) != SQL_SUCCESS)
+ {
+ return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
+ }
}
// Completed successfully
assert(!queryOnly);
if (queryOnly)
return(FALSE);
-
+
SWORD fSqlType = 0;
UDWORD precision = 0;
SWORD scale = 0;
continue;
switch(colDefs[i].DbDataType)
{
- case DB_DATA_TYPE_VARCHAR:
- fSqlType = pDb->GetTypeInfVarchar().FsqlType;
- precision = colDefs[i].SzDataObj;
- scale = 0;
- colDefs[i].CbValue = SQL_NTS;
- break;
- case DB_DATA_TYPE_INTEGER:
- fSqlType = pDb->GetTypeInfInteger().FsqlType;
- precision = pDb->GetTypeInfInteger().Precision;
- scale = 0;
- colDefs[i].CbValue = 0;
- break;
- case DB_DATA_TYPE_FLOAT:
- fSqlType = pDb->GetTypeInfFloat().FsqlType;
- precision = pDb->GetTypeInfFloat().Precision;
- scale = pDb->GetTypeInfFloat().MaximumScale;
- // SQL Sybase Anywhere v5.5 returned a negative number for the
- // MaxScale. This caused ODBC to kick out an error on ibscale.
- // I check for this here and set the scale = precision.
- //if (scale < 0)
- // scale = (short) precision;
- colDefs[i].CbValue = 0;
- break;
- case DB_DATA_TYPE_DATE:
- fSqlType = pDb->GetTypeInfDate().FsqlType;
- precision = pDb->GetTypeInfDate().Precision;
- scale = 0;
- colDefs[i].CbValue = 0;
- break;
+ case DB_DATA_TYPE_VARCHAR:
+ fSqlType = pDb->GetTypeInfVarchar().FsqlType;
+ precision = colDefs[i].SzDataObj;
+ scale = 0;
+ colDefs[i].CbValue = SQL_NTS;
+ break;
+ case DB_DATA_TYPE_INTEGER:
+ fSqlType = pDb->GetTypeInfInteger().FsqlType;
+ precision = pDb->GetTypeInfInteger().Precision;
+ scale = 0;
+ colDefs[i].CbValue = 0;
+ break;
+ case DB_DATA_TYPE_FLOAT:
+ fSqlType = pDb->GetTypeInfFloat().FsqlType;
+ precision = pDb->GetTypeInfFloat().Precision;
+ scale = pDb->GetTypeInfFloat().MaximumScale;
+ // SQL Sybase Anywhere v5.5 returned a negative number for the
+ // MaxScale. This caused ODBC to kick out an error on ibscale.
+ // I check for this here and set the scale = precision.
+ //if (scale < 0)
+ // scale = (short) precision;
+ colDefs[i].CbValue = 0;
+ break;
+ case DB_DATA_TYPE_DATE:
+ fSqlType = pDb->GetTypeInfDate().FsqlType;
+ precision = pDb->GetTypeInfDate().Precision;
+ scale = 0;
+ colDefs[i].CbValue = 0;
+ break;
+ }
+
+ if (SQLBindParameter(hstmtUpdate, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype,
+ fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj,
+ precision+1, &colDefs[i].CbValue) != SQL_SUCCESS)
+ {
+ return(pDb->DispAllErrors(henv, hdbc, hstmtUpdate));
}
-
- if (SQLBindParameter(hstmtUpdate, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype,
- fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj,
- precision+1, &colDefs[i].CbValue) != SQL_SUCCESS)
- return(pDb->DispAllErrors(henv, hdbc, hstmtUpdate));
}
-
+
// Completed successfully
return(TRUE);
// Bind each column of the table to a memory address for fetching data
int i;
for (i = 0; i < noCols; i++)
- {
- if (SQLBindCol(cursor, i+1, colDefs[i].SqlCtype, (UCHAR*) colDefs[i].PtrDataObj,
- colDefs[i].SzDataObj, &cb) != SQL_SUCCESS)
- return (pDb->DispAllErrors(henv, hdbc, cursor));
- }
+ {
+ if (SQLBindCol(cursor, i+1, colDefs[i].SqlCtype, (UCHAR*) colDefs[i].PtrDataObj,
+ colDefs[i].SzDataObj, &cb) != SQL_SUCCESS)
+ {
+ return (pDb->DispAllErrors(henv, hdbc, cursor));
+ }
+ }
// Completed successfully
return(TRUE);
retcode = SQLExtendedFetch(hstmt, fetchType, 0, &cRowsFetched, &rowStatus);
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
+ {
if (retcode == SQL_NO_DATA_FOUND)
return(FALSE);
else
return(pDb->DispAllErrors(henv, hdbc, hstmt));
+ }
}
else
{
/********** wxDbTable::query() **********/
bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const char *pSqlStmt)
{
-
-
-
-/* SQLFreeStmt(hstmt, SQL_CLOSE);
- if (SQLExecDirect(hstmt, (UCHAR FAR *) pSqlStmt, SQL_NTS) == SQL_SUCCESS)
- return(TRUE);
- else
- {
- pDb->DispAllErrors(henv, hdbc, hstmt);
- return(FALSE);
- }
-*/
-
-
char sqlStmt[DB_MAX_STATEMENT_LEN];
// Set the selectForUpdate member variable
// Set the SQL SELECT string
if (queryType != DB_SELECT_STATEMENT) // A select statement was not passed in,
- { // so generate a select statement.
+ { // so generate a select statement.
BuildSelectStmt(sqlStmt, queryType, distinct);
pDb->WriteSqlLog(sqlStmt);
- } else wxStrcpy(sqlStmt, pSqlStmt);
+ }
+ else
+ wxStrcpy(sqlStmt, pSqlStmt);
SQLFreeStmt(hstmt, SQL_CLOSE);
if (SQLExecDirect(hstmt, (UCHAR FAR *) sqlStmt, SQL_NTS) == SQL_SUCCESS)
- return(TRUE);
+ return(TRUE);
else
- {
+ {
pDb->DispAllErrors(henv, hdbc, hstmt);
return(FALSE);
- }
+ }
// Make sure the cursor is closed first
if (! CloseCursor(hstmt))
- return(FALSE);
+ return(FALSE);
// Execute the SQL SELECT statement
int retcode;
retcode = SQLExecDirect(hstmt, (UCHAR FAR *) (queryType == DB_SELECT_STATEMENT ? pSqlStmt : sqlStmt), SQL_NTS);
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
- return(pDb->DispAllErrors(henv, hdbc, hstmt));
+ return(pDb->DispAllErrors(henv, hdbc, hstmt));
// Completed successfully
return(TRUE);
{
if (!pDb)
return FALSE;
+
int i;
wxString sqlStmt;
// the wxDbTable object and the ODBC record.
if (!queryOnly)
{
-
if (!bindInsertParams()) // Inserts
return(FALSE);
if (!bindUpdateParams()) // Updates
return(FALSE);
-
}
+
if (!bindCols(*hstmtDefault)) // Selects
return(FALSE);
-
+
if (!bindCols(hstmtInternal)) // Internal use only
return(FALSE);
-
+
/*
* Do NOT bind the hstmtCount cursor!!!
*/
needComma = FALSE;
sqlStmt += ") VALUES (";
- int insertableCount = 0;
+ int insertableCount = 0;
for (i = 0; i < noCols; i++)
{
sqlStmt += ",";
sqlStmt += "?";
needComma = TRUE;
- insertableCount++;
+ insertableCount++;
}
sqlStmt += ")";
-
-// pDb->WriteSqlLog(sqlStmt);
-
+
// Prepare the insert statement for execution
if (insertableCount)
- {
+ {
if (SQLPrepare(hstmtInsert, (UCHAR FAR *) sqlStmt.c_str(), SQL_NTS) != SQL_SUCCESS)
return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
}
- else
+ else
insertable= FALSE;
}
}
else
return(getRec(SQL_FETCH_PRIOR));
+
} // wxDbTable::GetPrev()
}
else
return(getRec(SQL_FETCH_PRIOR));
+
} // wxDbTable::operator--
}
else
return(getRec(SQL_FETCH_FIRST));
+
} // wxDbTable::GetFirst()
}
else
return(getRec(SQL_FETCH_LAST));
+
} // wxDbTable::GetLast()
// or build a where clause. The typeOfSelect determines this.
switch(typeOfSelect)
{
- case DB_SELECT_WHERE:
+ case DB_SELECT_WHERE:
#if wxODBC_BACKWARD_COMPATABILITY
- if (where && wxStrlen(where)) // May not want a where clause!!!
+ if (where && wxStrlen(where)) // May not want a where clause!!!
#else
- if (where.Length()) // May not want a where clause!!!
+ if (where.Length()) // May not want a where clause!!!
#endif
- {
- wxStrcat(pSqlStmt, " WHERE ");
- wxStrcat(pSqlStmt, where);
- }
- break;
- case DB_SELECT_KEYFIELDS:
- BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
- if (wxStrlen(whereClause))
- {
- wxStrcat(pSqlStmt, " WHERE ");
- wxStrcat(pSqlStmt, whereClause);
- }
- break;
- case DB_SELECT_MATCHING:
- BuildWhereClause(whereClause, DB_WHERE_MATCHING);
- if (wxStrlen(whereClause))
- {
- wxStrcat(pSqlStmt, " WHERE ");
- wxStrcat(pSqlStmt, whereClause);
- }
- break;
+ {
+ wxStrcat(pSqlStmt, " WHERE ");
+ wxStrcat(pSqlStmt, where);
+ }
+ break;
+ case DB_SELECT_KEYFIELDS:
+ BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
+ if (wxStrlen(whereClause))
+ {
+ wxStrcat(pSqlStmt, " WHERE ");
+ wxStrcat(pSqlStmt, whereClause);
+ }
+ break;
+ case DB_SELECT_MATCHING:
+ BuildWhereClause(whereClause, DB_WHERE_MATCHING);
+ if (wxStrlen(whereClause))
+ {
+ wxStrcat(pSqlStmt, " WHERE ");
+ wxStrcat(pSqlStmt, whereClause);
+ }
+ break;
}
// Append the ORDER BY clause
#if wxODBC_BACKWARD_COMPATABILITY
if (orderBy && wxStrlen(orderBy))
#else
- if (orderBy.Length())
+ if (orderBy.Length())
#endif
{
wxStrcat(pSqlStmt, " ORDER BY ");
return FALSE;
int i, j;
-// char sqlStmt[DB_MAX_STATEMENT_LEN];
wxString sqlStmt;
#ifdef DBDEBUG_CONSOLE
continue;
// Comma Delimiter
if (needComma)
- sqlStmt += ",";
+ sqlStmt += ",";
// Column Name
sqlStmt += colDefs[i].ColName;
sqlStmt += " ";
switch(colDefs[i].DbDataType)
{
case DB_DATA_TYPE_VARCHAR:
- sqlStmt += pDb->GetTypeInfVarchar().TypeName; break;
+ sqlStmt += pDb->GetTypeInfVarchar().TypeName;
+ break;
case DB_DATA_TYPE_INTEGER:
- sqlStmt += pDb->GetTypeInfInteger().TypeName; break;
+ sqlStmt += pDb->GetTypeInfInteger().TypeName;
+ break;
case DB_DATA_TYPE_FLOAT:
- sqlStmt += pDb->GetTypeInfFloat().TypeName; break;
+ sqlStmt += pDb->GetTypeInfFloat().TypeName;
+ break;
case DB_DATA_TYPE_DATE:
- sqlStmt += pDb->GetTypeInfDate().TypeName; break;
+ sqlStmt += pDb->GetTypeInfDate().TypeName;
+ break;
}
// For varchars, append the size of the string
if (colDefs[i].DbDataType == DB_DATA_TYPE_VARCHAR)
}
// Commit the transaction and close the cursor
- if (! pDb->CommitTrans())
+ if (!pDb->CommitTrans())
return(FALSE);
- if (! CloseCursor(hstmt))
+ if (!CloseCursor(hstmt))
return(FALSE);
// Database table created successfully
if (SQLExecDirect(hstmt, (UCHAR FAR *) sqlStmt.c_str(), SQL_NTS) != SQL_SUCCESS)
{
// Check for "Base table not found" error and ignore
- pDb->GetNextError(henv, hdbc, hstmt);
+ pDb->GetNextError(henv, hdbc, hstmt);
if (wxStrcmp(pDb->sqlState,"S0002") && wxStrcmp(pDb->sqlState, "S1000")) // "Base table not found"
- {
+ {
// Check for product specific error codes
- if (!((pDb->Dbms() == dbmsSYBASE_ASA && !wxStrcmp(pDb->sqlState,"42000")) || // 5.x (and lower?)
- (pDb->Dbms() == dbmsSYBASE_ASE && !wxStrcmp(pDb->sqlState,"37000")) ||
- (pDb->Dbms() == dbmsPOSTGRES && !wxStrcmp(pDb->sqlState,"08S01"))))
+ if (!((pDb->Dbms() == dbmsSYBASE_ASA && !wxStrcmp(pDb->sqlState,"42000")) || // 5.x (and lower?)
+ (pDb->Dbms() == dbmsSYBASE_ASE && !wxStrcmp(pDb->sqlState,"37000")) ||
+ (pDb->Dbms() == dbmsPOSTGRES && !wxStrcmp(pDb->sqlState,"08S01"))))
{
pDb->DispNextError();
pDb->DispAllErrors(henv, hdbc, hstmt);
/********** wxDbTable::CreateIndex() **********/
bool wxDbTable::CreateIndex(const char * idxName, bool unique, int noIdxCols, wxDbIdxDef *pIdxDefs, bool attemptDrop)
{
-// char sqlStmt[DB_MAX_STATEMENT_LEN];
wxString sqlStmt;
// Drop the index first
if (attemptDrop && !DropIndex(idxName))
return (FALSE);
+ // MySQL (and possibly Sybase ASE?? - gt) require that any columns which are used as portions
+ // of an index have the columns defined as "NOT NULL". During initial table creation though,
+ // it may not be known which columns are necessarily going to be part of an index (e.g. the
+ // table was created, then months later you determine that an additional index while
+ // give better performance, so you want to add an index).
+ //
+ // The following block of code will modify the column definition to make the column be
+ // defined with the "NOT NULL" qualifier.
+ if (pDb->Dbms() == dbmsMY_SQL)
+ {
+ wxString sqlStmt;
+ int i;
+ bool ok = TRUE;
+ for (i = 0; i < noIdxCols && ok; i++)
+ {
+ int j = 0;
+ bool found = FALSE;
+ // Find the column definition that has the ColName that matches the
+ // index column name. We need to do this to get the DB_DATA_TYPE of
+ // the index column, as MySQL's syntax for the ALTER column requires
+ // this information
+ while (!found && (j < this->noCols))
+ {
+ if (wxStrcmp(colDefs[j].ColName,pIdxDefs[i].ColName) == 0)
+ found = TRUE;
+ if (!found)
+ j++;
+ }
+
+ if (found)
+ {
+ wxString typeNameAndSize;
+
+ switch(colDefs[j].DbDataType)
+ {
+ case DB_DATA_TYPE_VARCHAR:
+ typeNameAndSize = pDb->GetTypeInfVarchar().TypeName;
+ break;
+ case DB_DATA_TYPE_INTEGER:
+ typeNameAndSize = pDb->GetTypeInfInteger().TypeName;
+ break;
+ case DB_DATA_TYPE_FLOAT:
+ typeNameAndSize = pDb->GetTypeInfFloat().TypeName;
+ break;
+ case DB_DATA_TYPE_DATE:
+ typeNameAndSize = pDb->GetTypeInfDate().TypeName;
+ break;
+ }
+
+ // For varchars, append the size of the string
+ if (colDefs[j].DbDataType == DB_DATA_TYPE_VARCHAR)
+ {
+ wxString s;
+ s.sprintf("(%d)", colDefs[i].SzDataObj);
+ typeNameAndSize += s.c_str();
+ }
+
+ sqlStmt.sprintf("ALTER TABLE %s MODIFY %s %s NOT NULL",tableName,pIdxDefs[i].ColName,typeNameAndSize.c_str());
+ ok = pDb->ExecSql(sqlStmt.c_str());
+
+ if (!ok)
+ {
+ wxODBC_ERRORS retcode;
+ // Oracle returns a DB_ERR_GENERAL_ERROR if the column is already
+ // defined to be NOT NULL, but reportedly MySQL doesn't mind.
+ // This line is just here for debug checking of the value
+ retcode = (wxODBC_ERRORS)pDb->DB_STATUS;
+ }
+ }
+ else
+ ok = FALSE;
+ }
+ if (ok)
+ pDb->CommitTrans();
+ else
+ {
+ pDb->RollbackTrans();
+ return(FALSE);
+ }
+ }
+
// Build a CREATE INDEX statement
sqlStmt = "CREATE ";
if (unique)
sqlStmt += "UNIQUE ";
-
+
sqlStmt += "INDEX ";
sqlStmt += idxName;
sqlStmt += " ON ";
sqlStmt += tableName;
sqlStmt += " (";
-
+
// Append list of columns making up index
int i;
for (i = 0; i < noIdxCols; i++)
wxString sqlStmt;
- if (pDb->Dbms() == dbmsACCESS)
+ if (pDb->Dbms() == dbmsACCESS || pDb->Dbms() == dbmsMY_SQL)
sqlStmt.sprintf("DROP INDEX %s ON %s",idxName,tableName);
else if (pDb->Dbms() == dbmsSYBASE_ASE)
sqlStmt.sprintf("DROP INDEX %s.%s",tableName,idxName);
if (wxStrcmp(pDb->sqlState,"S0012")) // "Index not found"
{
// Check for product specific error codes
- if (!((pDb->Dbms() == dbmsSYBASE_ASA && !wxStrcmp(pDb->sqlState,"42000")) || // v5.x (and lower?)
- (pDb->Dbms() == dbmsSYBASE_ASE && !wxStrcmp(pDb->sqlState,"37000")) ||
- (pDb->Dbms() == dbmsMS_SQL_SERVER && !wxStrcmp(pDb->sqlState,"S1000")) ||
- (pDb->Dbms() == dbmsSYBASE_ASE && !wxStrcmp(pDb->sqlState,"S0002")) || // Base table not found
- (pDb->Dbms() == dbmsMY_SQL && !wxStrcmp(pDb->sqlState,"42S02")) || // untested
- (pDb->Dbms() == dbmsPOSTGRES && !wxStrcmp(pDb->sqlState,"08S01"))
- ))
+ if (!((pDb->Dbms() == dbmsSYBASE_ASA && !wxStrcmp(pDb->sqlState,"42000")) || // v5.x (and lower?)
+ (pDb->Dbms() == dbmsSYBASE_ASE && !wxStrcmp(pDb->sqlState,"37000")) ||
+ (pDb->Dbms() == dbmsMS_SQL_SERVER && !wxStrcmp(pDb->sqlState,"S1000")) ||
+ (pDb->Dbms() == dbmsSYBASE_ASE && !wxStrcmp(pDb->sqlState,"S0002")) || // Base table not found
+ (pDb->Dbms() == dbmsMY_SQL && !wxStrcmp(pDb->sqlState,"42S12")) || // tested by Christopher Ludwik Marino-Cebulski using v3.23.21beta
+ (pDb->Dbms() == dbmsPOSTGRES && !wxStrcmp(pDb->sqlState,"08S01"))
+ ))
{
pDb->DispNextError();
pDb->DispAllErrors(henv, hdbc, hstmt);
wxStrcat(pSqlStmt, " WHERE ");
switch(typeOfUpd)
{
- case DB_UPD_KEYFIELDS:
- // If the datasource supports the ROWID column, build
- // the where on ROWID for efficiency purposes.
- // e.g. UPDATE PARTS SET Col1 = ?, Col2 = ? WHERE ROWID = '111.222.333'
- if (CanUpdByROWID())
- {
- SDWORD cb;
- char rowid[wxDB_ROWID_LEN];
-
- // Get the ROWID value. If not successful retreiving the ROWID,
- // simply fall down through the code and build the WHERE clause
- // based on the key fields.
- if (SQLGetData(hstmt, noCols+1, SQL_C_CHAR, (UCHAR*) rowid, wxDB_ROWID_LEN, &cb) == SQL_SUCCESS)
+ case DB_UPD_KEYFIELDS:
+ // If the datasource supports the ROWID column, build
+ // the where on ROWID for efficiency purposes.
+ // e.g. UPDATE PARTS SET Col1 = ?, Col2 = ? WHERE ROWID = '111.222.333'
+ if (CanUpdByROWID())
{
- wxStrcat(pSqlStmt, "ROWID = '");
- wxStrcat(pSqlStmt, rowid);
- wxStrcat(pSqlStmt, "'");
- break;
+ SDWORD cb;
+ char rowid[wxDB_ROWID_LEN];
+
+ // Get the ROWID value. If not successful retreiving the ROWID,
+ // simply fall down through the code and build the WHERE clause
+ // based on the key fields.
+ if (SQLGetData(hstmt, noCols+1, SQL_C_CHAR, (UCHAR*) rowid, wxDB_ROWID_LEN, &cb) == SQL_SUCCESS)
+ {
+ wxStrcat(pSqlStmt, "ROWID = '");
+ wxStrcat(pSqlStmt, rowid);
+ wxStrcat(pSqlStmt, "'");
+ break;
+ }
}
- }
- // Unable to delete by ROWID, so build a WHERE
- // clause based on the keyfields.
- BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
- wxStrcat(pSqlStmt, whereClause);
- break;
- case DB_UPD_WHERE:
- wxStrcat(pSqlStmt, pWhereClause);
- break;
+ // Unable to delete by ROWID, so build a WHERE
+ // clause based on the keyfields.
+ BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
+ wxStrcat(pSqlStmt, whereClause);
+ break;
+ case DB_UPD_WHERE:
+ wxStrcat(pSqlStmt, pWhereClause);
+ break;
}
} // BuildUpdateStmt()
// Append the WHERE clause to the SQL DELETE statement
switch(typeOfDel)
{
- case DB_DEL_KEYFIELDS:
- // If the datasource supports the ROWID column, build
- // the where on ROWID for efficiency purposes.
- // e.g. DELETE FROM PARTS WHERE ROWID = '111.222.333'
- if (CanUpdByROWID())
- {
- SDWORD cb;
- char rowid[wxDB_ROWID_LEN];
-
- // Get the ROWID value. If not successful retreiving the ROWID,
- // simply fall down through the code and build the WHERE clause
- // based on the key fields.
- if (SQLGetData(hstmt, noCols+1, SQL_C_CHAR, (UCHAR*) rowid, wxDB_ROWID_LEN, &cb) == SQL_SUCCESS)
+ case DB_DEL_KEYFIELDS:
+ // If the datasource supports the ROWID column, build
+ // the where on ROWID for efficiency purposes.
+ // e.g. DELETE FROM PARTS WHERE ROWID = '111.222.333'
+ if (CanUpdByROWID())
{
- wxStrcat(pSqlStmt, "ROWID = '");
- wxStrcat(pSqlStmt, rowid);
- wxStrcat(pSqlStmt, "'");
- break;
+ SDWORD cb;
+ char rowid[wxDB_ROWID_LEN];
+
+ // Get the ROWID value. If not successful retreiving the ROWID,
+ // simply fall down through the code and build the WHERE clause
+ // based on the key fields.
+ if (SQLGetData(hstmt, noCols+1, SQL_C_CHAR, (UCHAR*) rowid, wxDB_ROWID_LEN, &cb) == SQL_SUCCESS)
+ {
+ wxStrcat(pSqlStmt, "ROWID = '");
+ wxStrcat(pSqlStmt, rowid);
+ wxStrcat(pSqlStmt, "'");
+ break;
+ }
}
- }
- // Unable to delete by ROWID, so build a WHERE
- // clause based on the keyfields.
- BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
- wxStrcat(pSqlStmt, whereClause);
- break;
- case DB_DEL_WHERE:
- wxStrcat(pSqlStmt, pWhereClause);
- break;
- case DB_DEL_MATCHING:
- BuildWhereClause(whereClause, DB_WHERE_MATCHING);
- wxStrcat(pSqlStmt, whereClause);
- break;
+ // Unable to delete by ROWID, so build a WHERE
+ // clause based on the keyfields.
+ BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
+ wxStrcat(pSqlStmt, whereClause);
+ break;
+ case DB_DEL_WHERE:
+ wxStrcat(pSqlStmt, pWhereClause);
+ break;
+ case DB_DEL_MATCHING:
+ BuildWhereClause(whereClause, DB_WHERE_MATCHING);
+ wxStrcat(pSqlStmt, whereClause);
+ break;
}
} // BuildDeleteStmt()
wxStrcat(pWhereClause, " = ");
switch(colDefs[i].SqlCtype)
{
- case SQL_C_CHAR:
- sprintf(colValue, "'%s'", (UCHAR FAR *) colDefs[i].PtrDataObj);
- break;
- case SQL_C_SSHORT:
- sprintf(colValue, "%hi", *((SWORD *) colDefs[i].PtrDataObj));
- break;
- case SQL_C_USHORT:
- sprintf(colValue, "%hu", *((UWORD *) colDefs[i].PtrDataObj));
- break;
- case SQL_C_SLONG:
- sprintf(colValue, "%li", *((SDWORD *) colDefs[i].PtrDataObj));
- break;
- case SQL_C_ULONG:
- sprintf(colValue, "%lu", *((UDWORD *) colDefs[i].PtrDataObj));
- break;
- case SQL_C_FLOAT:
- sprintf(colValue, "%.6f", *((SFLOAT *) colDefs[i].PtrDataObj));
- break;
- case SQL_C_DOUBLE:
- sprintf(colValue, "%.6f", *((SDOUBLE *) colDefs[i].PtrDataObj));
- break;
+ case SQL_C_CHAR:
+ sprintf(colValue, "'%s'", (UCHAR FAR *) colDefs[i].PtrDataObj);
+ break;
+ case SQL_C_SSHORT:
+ sprintf(colValue, "%hi", *((SWORD *) colDefs[i].PtrDataObj));
+ break;
+ case SQL_C_USHORT:
+ sprintf(colValue, "%hu", *((UWORD *) colDefs[i].PtrDataObj));
+ break;
+ case SQL_C_SLONG:
+ sprintf(colValue, "%li", *((SDWORD *) colDefs[i].PtrDataObj));
+ break;
+ case SQL_C_ULONG:
+ sprintf(colValue, "%lu", *((UDWORD *) colDefs[i].PtrDataObj));
+ break;
+ case SQL_C_FLOAT:
+ sprintf(colValue, "%.6f", *((SFLOAT *) colDefs[i].PtrDataObj));
+ break;
+ case SQL_C_DOUBLE:
+ sprintf(colValue, "%.6f", *((SDOUBLE *) colDefs[i].PtrDataObj));
+ break;
}
wxStrcat(pWhereClause, colValue);
}
{
switch(colDefs[colNo].SqlCtype)
{
- case SQL_C_CHAR:
- return(((UCHAR FAR *) colDefs[colNo].PtrDataObj)[0] == 0);
- case SQL_C_SSHORT:
- return(( *((SWORD *) colDefs[colNo].PtrDataObj)) == 0);
- case SQL_C_USHORT:
- return(( *((UWORD*) colDefs[colNo].PtrDataObj)) == 0);
- case SQL_C_SLONG:
- return(( *((SDWORD *) colDefs[colNo].PtrDataObj)) == 0);
- case SQL_C_ULONG:
- return(( *((UDWORD *) colDefs[colNo].PtrDataObj)) == 0);
- case SQL_C_FLOAT:
- return(( *((SFLOAT *) colDefs[colNo].PtrDataObj)) == 0);
- case SQL_C_DOUBLE:
- return((*((SDOUBLE *) colDefs[colNo].PtrDataObj)) == 0);
- case SQL_C_TIMESTAMP:
- TIMESTAMP_STRUCT *pDt;
- pDt = (TIMESTAMP_STRUCT *) colDefs[colNo].PtrDataObj;
- if (pDt->year == 0 && pDt->month == 0 && pDt->day == 0)
+ case SQL_C_CHAR:
+ return(((UCHAR FAR *) colDefs[colNo].PtrDataObj)[0] == 0);
+ case SQL_C_SSHORT:
+ return(( *((SWORD *) colDefs[colNo].PtrDataObj)) == 0);
+ case SQL_C_USHORT:
+ return(( *((UWORD*) colDefs[colNo].PtrDataObj)) == 0);
+ case SQL_C_SLONG:
+ return(( *((SDWORD *) colDefs[colNo].PtrDataObj)) == 0);
+ case SQL_C_ULONG:
+ return(( *((UDWORD *) colDefs[colNo].PtrDataObj)) == 0);
+ case SQL_C_FLOAT:
+ return(( *((SFLOAT *) colDefs[colNo].PtrDataObj)) == 0);
+ case SQL_C_DOUBLE:
+ return((*((SDOUBLE *) colDefs[colNo].PtrDataObj)) == 0);
+ case SQL_C_TIMESTAMP:
+ TIMESTAMP_STRUCT *pDt;
+ pDt = (TIMESTAMP_STRUCT *) colDefs[colNo].PtrDataObj;
+ if (pDt->year == 0 && pDt->month == 0 && pDt->day == 0)
+ return(TRUE);
+ else
+ return(FALSE);
+ default:
return(TRUE);
- else
- return(FALSE);
- default:
- return(TRUE);
}
} // wxDbTable::IsColNull()
{
switch(colDefs[i].SqlCtype)
{
- case SQL_C_CHAR:
- ((UCHAR FAR *) colDefs[i].PtrDataObj)[0] = 0;
- break;
- case SQL_C_SSHORT:
- *((SWORD *) colDefs[i].PtrDataObj) = 0;
- break;
- case SQL_C_USHORT:
- *((UWORD*) colDefs[i].PtrDataObj) = 0;
- break;
- case SQL_C_SLONG:
- *((SDWORD *) colDefs[i].PtrDataObj) = 0;
- break;
- case SQL_C_ULONG:
- *((UDWORD *) colDefs[i].PtrDataObj) = 0;
- break;
- case SQL_C_FLOAT:
- *((SFLOAT *) colDefs[i].PtrDataObj) = 0.0f;
- break;
- case SQL_C_DOUBLE:
- *((SDOUBLE *) colDefs[i].PtrDataObj) = 0.0f;
- break;
- case SQL_C_TIMESTAMP:
- TIMESTAMP_STRUCT *pDt;
- pDt = (TIMESTAMP_STRUCT *) colDefs[i].PtrDataObj;
- pDt->year = 0;
- pDt->month = 0;
- pDt->day = 0;
- pDt->hour = 0;
- pDt->minute = 0;
- pDt->second = 0;
- pDt->fraction = 0;
- break;
-
+ case SQL_C_CHAR:
+ ((UCHAR FAR *) colDefs[i].PtrDataObj)[0] = 0;
+ break;
+ case SQL_C_SSHORT:
+ *((SWORD *) colDefs[i].PtrDataObj) = 0;
+ break;
+ case SQL_C_USHORT:
+ *((UWORD*) colDefs[i].PtrDataObj) = 0;
+ break;
+ case SQL_C_SLONG:
+ *((SDWORD *) colDefs[i].PtrDataObj) = 0;
+ break;
+ case SQL_C_ULONG:
+ *((UDWORD *) colDefs[i].PtrDataObj) = 0;
+ break;
+ case SQL_C_FLOAT:
+ *((SFLOAT *) colDefs[i].PtrDataObj) = 0.0f;
+ break;
+ case SQL_C_DOUBLE:
+ *((SDOUBLE *) colDefs[i].PtrDataObj) = 0.0f;
+ break;
+ case SQL_C_TIMESTAMP:
+ TIMESTAMP_STRUCT *pDt;
+ pDt = (TIMESTAMP_STRUCT *) colDefs[i].PtrDataObj;
+ pDt->year = 0;
+ pDt->month = 0;
+ pDt->day = 0;
+ pDt->hour = 0;
+ pDt->minute = 0;
+ pDt->second = 0;
+ pDt->fraction = 0;
+ break;
}
}
/********** wxDbTable::SetColDefs() **********/
void wxDbTable::SetColDefs (int index, const char *fieldName, int dataType, void *pData,
- int cType, int size, bool keyField, bool upd,
- bool insAllow, bool derivedCol)
+ int cType, int size, bool keyField, bool upd,
+ bool insAllow, bool derivedCol)
{
if (!colDefs) // May happen if the database connection fails
return;
if (pColInfs)
{
ULONG index;
-
pColDataPtrs = new wxDbColDataPtr[numCols+1];
switch (pColInfs[index].dbDataType)
{
case DB_DATA_TYPE_VARCHAR:
- {
pColDataPtrs[index].PtrDataObj = new char[pColInfs[index].bufferLength+1];
pColDataPtrs[index].SzDataObj = pColInfs[index].columnSize;
pColDataPtrs[index].SqlCtype = SQL_C_CHAR;
break;
- }
case DB_DATA_TYPE_INTEGER:
- {
// Can be long or short
if (pColInfs[index].bufferLength == sizeof(long))
{
pColDataPtrs[index].SqlCtype = SQL_C_SSHORT;
}
break;
- }
case DB_DATA_TYPE_FLOAT:
- {
// Can be float or double
if (pColInfs[index].bufferLength == sizeof(float))
{
pColDataPtrs[index].SqlCtype = SQL_C_DOUBLE;
}
break;
- }
case DB_DATA_TYPE_DATE:
- {
pColDataPtrs[index].PtrDataObj = new TIMESTAMP_STRUCT;
pColDataPtrs[index].SzDataObj = sizeof(TIMESTAMP_STRUCT);
pColDataPtrs[index].SqlCtype = SQL_C_TIMESTAMP;
break;
- }
}
-
- SetColDefs (index,pColInfs[index].colName,pColInfs[index].dbDataType, pColDataPtrs[index].PtrDataObj, pColDataPtrs[index].SqlCtype, pColDataPtrs[index].SzDataObj);
+ SetColDefs (index,pColInfs[index].colName,pColInfs[index].dbDataType, pColDataPtrs[index].PtrDataObj, pColDataPtrs[index].SqlCtype, pColDataPtrs[index].SzDataObj);
}
}
+
return (pColDataPtrs);
+
} // wxDbTable::SetColDef()
/********** wxDbTable::Count(const char *) **********/
ULONG wxDbTable::Count(const char *args)
{
- ULONG l;
+ ULONG count;
wxString sqlStmt;
SDWORD cb;
}
// Obtain the result
- if (SQLGetData(*hstmtCount, 1, SQL_C_ULONG, &l, sizeof(l), &cb) != SQL_SUCCESS)
+ if (SQLGetData(*hstmtCount, 1, SQL_C_ULONG, &count, sizeof(count), &cb) != SQL_SUCCESS)
{
pDb->DispAllErrors(henv, hdbc, *hstmtCount);
return(0);
pDb->DispAllErrors(henv, hdbc, *hstmtCount);
// Return the record count
- return(l);
+ return(count);
} // wxDbTable::Count()
}
return newDoc;
}
- else
- return (wxDocument *) NULL;
+
+ return (wxDocument *) NULL;
}
wxView *wxDocManager::CreateView(wxDocument *doc, long flags)
wxString descrBuf = wxT("*.*");
#endif
- int FilterIndex = 0;
+ int FilterIndex = -1;
wxWindow* parent = wxFindSuitableParent();
0,
parent);
+ wxDocTemplate *theTemplate = (wxDocTemplate *)NULL;
if (!pathTmp.IsEmpty())
{
if (!wxFileExists(pathTmp))
path = pathTmp;
- // This is dodgy in that we're selecting the template on the
- // basis of the file extension, which may not be a standard
- // one. We really want to know exactly which template was
- // chosen by using a more advanced file selector.
- wxDocTemplate *theTemplate = FindTemplateForPath(path);
- if ( !theTemplate )
+ // first choose the template using the extension, if this fails (i.e.
+ // wxFileSelectorEx() didn't fill it), then use the path
+ if ( FilterIndex != -1 )
theTemplate = templates[FilterIndex];
-
- return theTemplate;
+ if ( !theTemplate )
+ theTemplate = FindTemplateForPath(path);
}
else
{
path = wxT("");
- return (wxDocTemplate *) NULL;
}
+
+ return theTemplate;
+
#if 0
// In all other windowing systems, until we have more advanced
// file selectors, we must select the document type (template) first, and
return fullname;
}
-
// ---------------------------------------------------------------------------
// wxLibrary (one instance per dynamic library)
// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// the config paths we use
-static const wxChar* FONTMAPPER_ROOT_PATH = wxT("wxWindows/FontMapper");
+static const wxChar* FONTMAPPER_ROOT_PATH = wxT("/wxWindows/FontMapper");
static const wxChar* FONTMAPPER_CHARSET_PATH = wxT("Charsets");
static const wxChar* FONTMAPPER_CHARSET_ALIAS_PATH = wxT("Aliases");
#if wxUSE_GUI
// if didn't find it there, try to reckognise it ourselves
if ( encoding == wxFONTENCODING_SYSTEM )
{
+ // discard the optional quotes
+ if ( !!cs )
+ {
+ if ( cs[0u] == _T('"') && cs.Last() == _T('"') )
+ {
+ cs = wxString(cs.c_str(), cs.length() - 1);
+ }
+ }
+
cs.MakeUpper();
if ( !cs || cs == wxT("US-ASCII") )
// now try the default mappings:
wxFontEncodingArray equiv = wxEncodingConverter::GetAllEquivalents(encoding);
size_t count = equiv.GetCount();
- for ( size_t i = (equiv[0] == encoding) ? 1 : 0; i < count; i++ )
+ if ( count )
{
- if ( TestAltEncoding(configEntry, equiv[i], info) )
- return TRUE;
+ for ( size_t i = (equiv[0] == encoding) ? 1 : 0; i < count; i++ )
+ {
+ if ( TestAltEncoding(configEntry, equiv[i], info) )
+ return TRUE;
+ }
}
return FALSE;
info.facename = facename;
return wxTestFontEncoding(info);
}
- else
- return FALSE;
+
+ return FALSE;
}
#endif // wxUSE_GUI
if ( !bar )
return FALSE;
+ wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id);
+ commandEvent.SetEventObject(this);
+
wxMenuItem *item = bar->FindItem(id);
if ( item && item->IsCheckable() )
{
item->Toggle();
- }
- wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id);
- commandEvent.SetInt(id);
- commandEvent.SetEventObject(this);
+ // use the new value
+ commandEvent.SetInt(item->IsChecked());
+ }
return GetEventHandler()->ProcessEvent(commandEvent);
}
GetAnchor(location),
wxDateTime(wxFileModificationTime(left)));
}
- else
- {
- if (s)
- delete s;
- return NULL;
- }
+
+ delete s;
+ return NULL;
}
int ncolors, bits, interl, transparent, disposal, i;
long size;
long delay;
- unsigned char type;
+ unsigned char type = 0;
unsigned char pal[768];
unsigned char buf[16];
GIFImage **ppimg, *pimg, *pprev;
wxNodeBase *wxHashTableBase::GetNode(long key, long value) const
{
- size_t slot = (size_t)abs(key % (long)m_hashSize);
+ size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
wxNodeBase *node;
if ( m_hashTable[slot] )
{
wxCHECK_RET( m_hashSize, _T("must call Create() first") );
- size_t slot = (size_t)abs(key % (long)m_hashSize);
+ size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
if ( !m_keys[slot] )
{
{
wxCHECK_MSG( m_hashSize, wxNOT_FOUND, _T("must call Create() first") );
- size_t slot = (size_t)abs(key % (long)m_hashSize);
+ size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
wxArrayLong *keys = m_keys[slot];
if ( keys )
{
wxCHECK_MSG( m_hashSize, wxNOT_FOUND, _T("must call Create() first") );
- size_t slot = (size_t)abs(key % (long)m_hashSize);
+ size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
wxArrayLong *keys = m_keys[slot];
if ( keys )
for (long i = 0; i < height; i++)
{
target_data = data + 3*width*(height-1-i);
- memcpy( target_data, source_data, 3*width );
+ memcpy( target_data, source_data, (size_t)3*width );
source_data += 3*width;
}
}
wxBufferedOutputStream bstream( stream );
return SaveFile(bstream, type);
}
- else
#endif // wxUSE_STREAMS
- return FALSE;
+
+ return FALSE;
}
bool wxImage::SaveFile( const wxString& filename, const wxString& mimetype )
wxBufferedOutputStream bstream( stream );
return SaveFile(bstream, mimetype);
}
- else
#endif // wxUSE_STREAMS
- return FALSE;
+
+ return FALSE;
}
bool wxImage::CanRead( const wxString &name )
my_src_ptr src = (my_src_ptr) cinfo->src;
if (src->pub.bytes_in_buffer > 0)
- src->stream->SeekI(-src->pub.bytes_in_buffer, wxFromCurrent);
+ src->stream->SeekI(-(long)src->pub.bytes_in_buffer, wxFromCurrent);
delete[] src->buffer;
}
longjmp(myerr->setjmp_buffer, 1);
}
-
+// temporarily disable the warning C4611 (interaction between '_setjmp' and
+// C++ object destruction is non-portable) - I don't see any dtors here
+#ifdef __VISUALC__
+ #pragma warning(disable:4611)
+#endif /* VC++ */
bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int WXUNUSED(index) )
{
return TRUE;
}
-
-
-
-
typedef struct {
struct jpeg_destination_mgr pub;
return TRUE;
}
+#ifdef __VISUALC__
+ #pragma warning(default:4611)
+#endif /* VC++ */
bool wxJPEGHandler::DoCanRead( wxInputStream& stream )
{
{
}
+// temporarily disable the warning C4611 (interaction between '_setjmp' and
+// C++ object destruction is non-portable) - I don't see any dtors here
+#ifdef __VISUALC__
+ #pragma warning(disable:4611)
+#endif /* VC++ */
+
bool wxPNGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int WXUNUSED(index) )
{
// VZ: as this function uses setjmp() the only fool proof error handling
return FALSE;
}
-
bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose )
{
{
return TRUE;
}
+#ifdef __VISUALC__
+ #pragma warning(default:4611)
+#endif /* VC++ */
+
bool wxPNGHandler::DoCanRead( wxInputStream& stream )
{
unsigned char hdr[4];
void wxSizerItem::SetDimension( wxPoint pos, wxSize size )
{
m_pos = pos;
-
+
if (m_flag & wxWEST)
{
pos.x += m_border;
while (node)
{
wxSizerItem *item = (wxSizerItem*)node->Data();
- if (item->GetWindow() == window)
- {
+ if (item->GetWindow() == window)
+ {
m_children.DeleteNode( node );
- return TRUE;
- }
+ return TRUE;
+ }
node = node->Next();
}
while (node)
{
wxSizerItem *item = (wxSizerItem*)node->Data();
- if (item->GetSizer() == sizer)
- {
+ if (item->GetSizer() == sizer)
+ {
m_children.DeleteNode( node );
- return TRUE;
- }
+ return TRUE;
+ }
node = node->Next();
}
}
wxSize wxSizer::GetMinSize()
-{
+{
wxSize ret( CalcMin() );
if (ret.x < m_minSize.x) ret.x = m_minSize.x;
if (ret.y < m_minSize.y) ret.y = m_minSize.y;
- return ret;
+ return ret;
}
void wxSizer::DoSetMinSize( int width, int height )
while (node)
{
wxSizerItem *item = (wxSizerItem*)node->Data();
- if (item->GetWindow() == window)
- {
+ if (item->GetWindow() == window)
+ {
item->SetInitSize( width, height );
- return TRUE;
- }
+ return TRUE;
+ }
node = node->Next();
}
while (node)
{
wxSizerItem *item = (wxSizerItem*)node->Data();
- if (item->GetSizer())
- {
+ if (item->GetSizer())
+ {
/* It's a sizer, so lets search recursively. */
if (item->GetSizer()->DoSetItemMinSize( window, width, height ))
{
/* A child sizer found the requested windw, exit. */
- return TRUE;
+ return TRUE;
}
- }
+ }
node = node->Next();
}
while (node)
{
wxSizerItem *item = (wxSizerItem*)node->Data();
- if (item->GetSizer() == sizer)
- {
+ if (item->GetSizer() == sizer)
+ {
item->GetSizer()->DoSetMinSize( width, height );
- return TRUE;
- }
+ return TRUE;
+ }
node = node->Next();
}
while (node)
{
wxSizerItem *item = (wxSizerItem*)node->Data();
- if (item->GetSizer())
- {
+ if (item->GetSizer())
+ {
/* It's a sizer, so lets search recursively. */
if (item->GetSizer()->DoSetItemMinSize( sizer, width, height ))
{
/* A child sizer found the requested windw, exit. */
- return TRUE;
+ return TRUE;
}
- }
+ }
node = node->Next();
}
}
else
{
- /* ... whereas the minimal size of spacers and windows in stored
+ /* ... whereas the minimal size of spacers and windows in stored
in the item */
item->SetInitSize( width, height );
}
wxSize sz( GetSize() );
wxPoint pt( GetPosition() );
-
- int w = (sz.x - (ncols - 1) * m_hgap) / ncols;
- int h = (sz.y - (nrows - 1) * m_vgap) / nrows;
+
+ int w = (sz.x - (ncols - 1) * m_hgap) / ncols;
+ int h = (sz.y - (nrows - 1) * m_vgap) / nrows;
int x = pt.x;
for (int c = 0; c < ncols; c++)
{
wxNode *node = m_children.Nth( i );
wxASSERT( node );
-
+
SetItemBounds( (wxSizerItem*) node->Data(), x, y, w, h);
}
y = y + h + m_vgap;
/* Find the max width and height for any component */
int w = 0;
int h = 0;
-
+
wxNode *node = m_children.First();
while (node)
{
wxSize sz( item->CalcMin() );
w = wxMax( w, sz.x );
h = wxMax( h, sz.y );
-
+
node = node->Next();
}
-
+
return wxSize(ncols * w + (ncols-1) * m_hgap,
nrows * h + (nrows-1) * m_vgap);
}
{
pt.x = x + (w - sz.x);
}
-
+
if (flag & wxALIGN_CENTER_VERTICAL)
{
pt.y = y + (h - sz.y) / 2;
pt.y = y + (h - sz.y);
}
}
-
+
item->SetDimension(pt, sz);
}
wxFlexGridSizer::wxFlexGridSizer( int rows, int cols, int vgap, int hgap )
: wxGridSizer( rows, cols, vgap, hgap )
-{
+{
m_rowHeights = (int*) NULL;
m_colWidths = (int*) NULL;
}
wxFlexGridSizer::wxFlexGridSizer( int cols, int vgap, int hgap )
- : wxGridSizer( cols, vgap, hgap )
-{
+ : wxGridSizer( cols, vgap, hgap )
+{
m_rowHeights = (int*) NULL;
m_colWidths = (int*) NULL;
}
-
+
wxFlexGridSizer::~wxFlexGridSizer()
{
if (m_rowHeights)
delete[] m_rowHeights;
if (m_colWidths)
delete[] m_colWidths;
-
+
if (m_children.GetCount() == 0)
return;
-
+
int nitems = m_children.GetCount();
int nrows = m_rows;
int ncols = m_cols;
m_rowHeights = new int[nrows];
m_colWidths = new int[ncols];
-
+
for (int col = 0; col < ncols; col++)
m_colWidths[ col ] = 0;
for (int row = 0; row < nrows; row++)
for (idx = 0; idx < m_growableRows.GetCount(); idx++)
m_rowHeights[ m_growableRows[idx] ] += delta;
}
-
+
if ((m_growableCols.GetCount() > 0) && (sz.x > minsz.x))
{
delta = (sz.x - minsz.x) / m_growableCols.GetCount();
for (idx = 0; idx < m_growableCols.GetCount(); idx++)
m_colWidths[ m_growableCols[idx] ] += delta;
}
-
+
sz = wxSize( pt.x + sz.x, pt.y + sz.y );
int x = pt.x;
{
wxNode *node = m_children.Nth( i );
wxASSERT( node );
-
+
int w = wxMax( 0, wxMin( m_colWidths[c], sz.x - x ) );
int h = wxMax( 0, wxMin( m_rowHeights[r], sz.y - y ) );
-
+
SetItemBounds( (wxSizerItem*) node->Data(), x, y, w, h);
}
y = y + m_rowHeights[r] + m_vgap;
ncols = (nitems + nrows-1) / nrows;
CreateArrays();
-
+
int col;
int row;
-
+
int i = 0;
wxNode *node = m_children.First();
while (node)
col = i % ncols;
m_rowHeights[ row ] = wxMax( sz.y, m_rowHeights[ row ] );
m_colWidths[ col ] = wxMax( sz.x, m_colWidths[ col ] );
-
+
node = node->Next();
i++;
}
-
+
int width = 0;
for (col = 0; col < ncols; col++)
width += m_colWidths[ col ];
-
+
int height = 0;
for (row = 0; row < nrows; row++)
height += m_rowHeights[ row ];
-
+
return wxSize( width + (ncols-1) * m_hgap,
height + (nrows-1) * m_vgap);
}
m_growableRows.Add( idx );
}
-void wxFlexGridSizer::RemoveGrowableRow( size_t idx )
+void wxFlexGridSizer::RemoveGrowableRow( size_t WXUNUSED(idx) )
{
}
m_growableCols.Add( idx );
}
-void wxFlexGridSizer::RemoveGrowableCol( size_t idx )
+void wxFlexGridSizer::RemoveGrowableCol( size_t WXUNUSED(idx) )
{
}
{
delta = (m_size.x - m_fixedWidth) / m_stretchable;
extra = (m_size.x - m_fixedWidth) % m_stretchable;
- }
- else
- {
+ }
+ else
+ {
delta = (m_size.y - m_fixedHeight) / m_stretchable;
extra = (m_size.y - m_fixedHeight) % m_stretchable;
- }
+ }
}
wxPoint pt( m_position );
{
wxSizerItem *item = (wxSizerItem*) node->Data();
- int weight = 1;
- if (item->GetOption())
- weight = item->GetOption();
-
- wxSize size( item->CalcMin() );
-
- if (m_orient == wxVERTICAL)
- {
- wxCoord height = size.y;
- if (item->GetOption())
- {
- height = (delta * weight) + extra;
- extra = 0; // only the first item will get the remainder as extra size
- }
-
- wxPoint child_pos( pt );
- wxSize child_size( wxSize( size.x, height) );
-
- if (item->GetFlag() & (wxEXPAND | wxSHAPED))
- child_size.x = m_size.x;
- else if (item->GetFlag() & wxALIGN_RIGHT)
- child_pos.x += m_size.x - size.x;
- else if (item->GetFlag() & (wxCENTER | wxALIGN_CENTER_HORIZONTAL))
- // XXX wxCENTER is added for backward compatibility;
- // wxALIGN_CENTER should be used in new code
- child_pos.x += (m_size.x - size.x) / 2;
-
- item->SetDimension( child_pos, child_size );
-
- pt.y += height;
- }
- else
- {
- wxCoord width = size.x;
- if (item->GetOption())
- {
- width = (delta * weight) + extra;
- extra = 0; // only the first item will get the remainder as extra size
- }
-
- wxPoint child_pos( pt );
- wxSize child_size( wxSize(width, size.y) );
-
- if (item->GetFlag() & (wxEXPAND | wxSHAPED))
- child_size.y = m_size.y;
- else if (item->GetFlag() & wxALIGN_BOTTOM)
- child_pos.y += m_size.y - size.y;
- else if (item->GetFlag() & (wxCENTER | wxALIGN_CENTER_VERTICAL))
- // XXX wxCENTER is added for backward compatibility;
- // wxALIGN_CENTER should be used in new code
- child_pos.y += (m_size.y - size.y) / 2;
-
- item->SetDimension( child_pos, child_size );
-
- pt.x += width;
- }
-
- node = node->Next();
+ int weight = 1;
+ if (item->GetOption())
+ weight = item->GetOption();
+
+ wxSize size( item->CalcMin() );
+
+ if (m_orient == wxVERTICAL)
+ {
+ wxCoord height = size.y;
+ if (item->GetOption())
+ {
+ height = (delta * weight) + extra;
+ extra = 0; // only the first item will get the remainder as extra size
+ }
+
+ wxPoint child_pos( pt );
+ wxSize child_size( wxSize( size.x, height) );
+
+ if (item->GetFlag() & (wxEXPAND | wxSHAPED))
+ child_size.x = m_size.x;
+ else if (item->GetFlag() & wxALIGN_RIGHT)
+ child_pos.x += m_size.x - size.x;
+ else if (item->GetFlag() & (wxCENTER | wxALIGN_CENTER_HORIZONTAL))
+ // XXX wxCENTER is added for backward compatibility;
+ // wxALIGN_CENTER should be used in new code
+ child_pos.x += (m_size.x - size.x) / 2;
+
+ item->SetDimension( child_pos, child_size );
+
+ pt.y += height;
+ }
+ else
+ {
+ wxCoord width = size.x;
+ if (item->GetOption())
+ {
+ width = (delta * weight) + extra;
+ extra = 0; // only the first item will get the remainder as extra size
+ }
+
+ wxPoint child_pos( pt );
+ wxSize child_size( wxSize(width, size.y) );
+
+ if (item->GetFlag() & (wxEXPAND | wxSHAPED))
+ child_size.y = m_size.y;
+ else if (item->GetFlag() & wxALIGN_BOTTOM)
+ child_pos.y += m_size.y - size.y;
+ else if (item->GetFlag() & (wxCENTER | wxALIGN_CENTER_VERTICAL))
+ // XXX wxCENTER is added for backward compatibility;
+ // wxALIGN_CENTER should be used in new code
+ child_pos.y += (m_size.y - size.y) / 2;
+
+ item->SetDimension( child_pos, child_size );
+
+ pt.x += width;
+ }
+
+ node = node->Next();
}
}
{
wxSizerItem *item = (wxSizerItem*) node->Data();
- int weight = 1;
- if (item->GetOption())
- weight = item->GetOption();
-
- wxSize size( item->CalcMin() );
-
- if (m_orient == wxHORIZONTAL)
- {
- m_minWidth += (size.x * weight);
- m_minHeight = wxMax( m_minHeight, size.y );
- }
- else
- {
- m_minHeight += (size.y * weight);
- m_minWidth = wxMax( m_minWidth, size.x );
- }
-
- if (item->GetOption())
- {
- m_stretchable += weight;
- }
- else
- {
- if (m_orient == wxVERTICAL)
- {
- m_fixedHeight += size.y;
- m_fixedWidth = wxMax( m_fixedWidth, size.x );
- }
- else
- {
- m_fixedWidth += size.x;
- m_fixedHeight = wxMax( m_fixedHeight, size.y );
- }
- }
-
- node = node->Next();
+ int weight = 1;
+ if (item->GetOption())
+ weight = item->GetOption();
+
+ wxSize size( item->CalcMin() );
+
+ if (m_orient == wxHORIZONTAL)
+ {
+ m_minWidth += (size.x * weight);
+ m_minHeight = wxMax( m_minHeight, size.y );
+ }
+ else
+ {
+ m_minHeight += (size.y * weight);
+ m_minWidth = wxMax( m_minWidth, size.x );
+ }
+
+ if (item->GetOption())
+ {
+ m_stretchable += weight;
+ }
+ else
+ {
+ if (m_orient == wxVERTICAL)
+ {
+ m_fixedHeight += size.y;
+ m_fixedWidth = wxMax( m_fixedWidth, size.x );
+ }
+ else
+ {
+ m_fixedWidth += size.x;
+ m_fixedHeight = wxMax( m_fixedHeight, size.y );
+ }
+ }
+
+ node = node->Next();
}
return wxSize( m_minWidth, m_minHeight );
// This will have to be done platform by platform
// as there is no way to guess the thickness of
// a wxStaticBox border.
-
+
int top_border = 15;
if (m_staticBox->GetLabel().IsEmpty()) top_border = 5;
int other_border = 5;
wxNotebookSizer::wxNotebookSizer( wxNotebook *nb )
{
wxASSERT_MSG( nb, wxT("wxNotebookSizer needs a notebook") );
-
+
m_notebook = nb;
}
// This will have to be done platform by platform
// as there is no way to guess the thickness of
// the wxNotebook tabs and border.
-
+
int borderX = 5;
int borderY = 5;
if ((m_notebook->HasFlag(wxNB_RIGHT)) ||
{
borderY += 40; // improvements later..
}
-
+
if (m_notebook->GetChildren().GetCount() == 0)
return wxSize(borderX + 10, borderY + 10);
while (node)
{
wxWindow *item = node->GetData();
- wxSizer *itemsizer = item->GetSizer();
-
- if (itemsizer)
- {
+ wxSizer *itemsizer = item->GetSizer();
+
+ if (itemsizer)
+ {
wxSize subsize( itemsizer->CalcMin() );
-
- if (subsize.x > maxX) maxX = subsize.x;
- if (subsize.y > maxY) maxY = subsize.y;
- }
- node = node->GetNext();
+ if (subsize.x > maxX) maxX = subsize.x;
+ if (subsize.y > maxY) maxY = subsize.y;
+ }
+
+ node = node->GetNext();
}
return wxSize( borderX + maxX, borderY + maxY );
int unzlocal_CheckCurrentFileCoherencyHeader (unz_s*, uInt*, uLong*, uInt*);
#endif
+/* disable warnings about K&R declarations until the end of file */
+#ifdef _MSC_VER
+#pragma warning(disable:4131)
+#endif /* VC++ */
+
/* ===========================================================================
Read a byte from a gz_stream; update next_in and avail_in. Return EOF
for end of file.
keyCode = WXK_F1 + n - 1;
}
else {
-#if 0 // this is not supported by GTK+, apparently
// several special cases
current.MakeUpper();
if ( current == wxT("DEL") ) {
- keyCode = VK_DELETE;
+ keyCode = WXK_DELETE;
}
+ else if ( current == wxT("DELETE") ) {
+ keyCode = WXK_DELETE;
+ }
+ else if ( current == wxT("INS") ) {
+ keyCode = WXK_INSERT;
+ }
+ else if ( current == wxT("INSERT") ) {
+ keyCode = WXK_INSERT;
+ }
+#if 0
else if ( current == wxT("PGUP") ) {
keyCode = VK_PRIOR;
}
else if ( current == wxT("PGDN") ) {
keyCode = VK_NEXT;
}
+#endif
else
-#endif // 0
{
wxLogDebug(wxT("Unrecognized accel key '%s', accel string ignored."),
current.c_str());
return wxYES;
case wxID_NO:
return wxNO;
- default:
case wxID_CANCEL:
return wxCANCEL;
}
+
+ wxFAIL_MSG( _T("unexpected return code from wxMessageDialog") );
+
+ return wxCANCEL;
}
#if wxUSE_TEXTDLG
// Created: Jan 22 1999
// RCS-ID:
// Copyright: (c) 1999 Kevin Smith
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
{
wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
if (m_pBool)
- {
- pControl->SetValue(*m_pBool);
- return TRUE;
- }
+ {
+ pControl->SetValue(*m_pBool);
+ return TRUE;
+ }
} else
#endif
#if wxUSE_RADIOBTN
if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
{
wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
- if (m_pBool)
- {
- pControl->SetValue(*m_pBool) ;
- return TRUE;
- }
+ if (m_pBool)
+ {
+ pControl->SetValue(*m_pBool) ;
+ return TRUE;
+ }
} else
#endif
if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
{
wxGauge* pControl = (wxGauge*) m_validatorWindow;
- if (m_pInt)
- {
- pControl->SetValue(*m_pInt);
- return TRUE;
- }
+ if (m_pInt)
+ {
+ pControl->SetValue(*m_pInt);
+ return TRUE;
+ }
} else
#endif
#if wxUSE_RADIOBOX
if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
{
wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
- if (m_pInt)
- {
- pControl->SetSelection(*m_pInt) ;
- return TRUE;
- }
+ if (m_pInt)
+ {
+ pControl->SetSelection(*m_pInt) ;
+ return TRUE;
+ }
} else
#endif
#if wxUSE_SCROLLBAR
if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
{
wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
- if (m_pInt)
- {
- pControl->SetThumbPosition(*m_pInt) ;
- return TRUE;
- }
+ if (m_pInt)
+ {
+ pControl->SetThumbPosition(*m_pInt) ;
+ return TRUE;
+ }
} else
#endif
#if wxUSE_SPINCTRL && !defined(__WIN16__) && !defined(__WXMOTIF__)
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
{
wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
- if (m_pInt)
- {
- pControl->SetValue(*m_pInt) ;
- return TRUE;
- }
+ if (m_pInt)
+ {
+ pControl->SetValue(*m_pInt) ;
+ return TRUE;
+ }
} else
#endif
#if wxUSE_SLIDER
wxSlider* pControl = (wxSlider*) m_validatorWindow;
if (m_pInt)
{
- pControl->SetValue(*m_pInt) ;
- return TRUE;
- }
+ pControl->SetValue(*m_pInt) ;
+ return TRUE;
+ }
} else
#endif
- // string controls
+ // string controls
if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
{
wxButton* pControl = (wxButton*) m_validatorWindow;
- if (m_pString)
- {
- pControl->SetLabel(*m_pString) ;
- return TRUE;
- }
+ if (m_pString)
+ {
+ pControl->SetLabel(*m_pString) ;
+ return TRUE;
+ }
} else
#if wxUSE_COMBOBOX
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
pControl->SetLabel(*m_pString) ;
return TRUE;
}
- } else
+ } else
if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
{
wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
return TRUE;
}
} else
-#if wxUSE_CHECKLISTBOX
-#ifndef __WIN16__
+#if wxUSE_CHECKLISTBOX && !defined(__WIN16__)
// array controls
// NOTE: wxCheckListBox isa wxListBox, so wxCheckListBox
// MUST come first:
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
{
wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
- if (m_pArrayInt)
+ if (m_pArrayInt)
{
// clear all selections
int i;
pControl->Check(m_pArrayInt->Item(u));
return TRUE;
}
- else
- return FALSE;
+ else
+ return FALSE;
} else
#endif
-#endif
#if wxUSE_LISTBOX
if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
{
wxListBox* pControl = (wxListBox*) m_validatorWindow;
- if (m_pArrayInt)
- {
- // clear all selections
- int i;
- for (i = 0 ; i < pControl->Number(); ++i)
- pControl->Deselect(i);
- // select each item in our array
- unsigned u;
- for (u = 0; u < m_pArrayInt->Count(); ++u)
- pControl->SetSelection(m_pArrayInt->Item(u));
- return TRUE;
- }
+ if (m_pArrayInt)
+ {
+ // clear all selections
+ int i;
+ for (i = 0 ; i < pControl->Number(); ++i)
+ pControl->Deselect(i);
+ // select each item in our array
+ unsigned u;
+ for (u = 0; u < m_pArrayInt->Count(); ++u)
+ pControl->SetSelection(m_pArrayInt->Item(u));
+ return TRUE;
+ }
} else
#endif
+ ; // to match the last 'else' above
// unrecognized control, or bad pointer
- return FALSE;
return FALSE;
}
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) )
{
wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
- if (m_pBool)
+ if (m_pBool)
{
*m_pBool = pControl->GetValue() ;
return TRUE;
if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
{
wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
- if (m_pBool)
+ if (m_pBool)
{
*m_pBool = pControl->GetValue() ;
return TRUE;
if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
{
wxGauge* pControl = (wxGauge*) m_validatorWindow;
- if (m_pInt)
+ if (m_pInt)
{
*m_pInt = pControl->GetValue() ;
return TRUE;
if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
{
wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
- if (m_pInt)
+ if (m_pInt)
{
*m_pInt = pControl->GetSelection() ;
return TRUE;
if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
{
wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
- if (m_pInt)
+ if (m_pInt)
{
*m_pInt = pControl->GetThumbPosition() ;
return TRUE;
if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
{
wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
- if (m_pInt)
+ if (m_pInt)
{
*m_pInt = pControl->GetValue() ;
return TRUE;
if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
{
wxButton* pControl = (wxButton*) m_validatorWindow;
- if (m_pString)
+ if (m_pString)
{
*m_pString = pControl->GetLabel() ;
return TRUE;
if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
{
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
- if (m_pString)
+ if (m_pInt)
{
- *m_pString = pControl->GetValue() ;
+ *m_pInt = pControl->GetSelection() ;
return TRUE;
}
else if (m_pString)
if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
{
wxChoice* pControl = (wxChoice*) m_validatorWindow;
- if (m_pInt)
+ if (m_pInt)
{
*m_pInt = pControl->GetSelection() ;
return TRUE;
if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
{
wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
- if (m_pString)
+ if (m_pString)
{
*m_pString = pControl->GetLabel() ;
return TRUE;
if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
{
wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
- if (m_pString)
+ if (m_pString)
{
*m_pString = pControl->GetValue() ;
return TRUE;
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
{
wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
- if (m_pArrayInt)
+ if (m_pArrayInt)
{
// clear our array
m_pArrayInt->Clear();
m_pArrayInt->Add(i);
return TRUE;
}
- else
- return FALSE;
+ else
+ return FALSE;
} else
#endif
#endif
if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
{
wxListBox* pControl = (wxListBox*) m_validatorWindow;
- if (m_pArrayInt)
+ if (m_pArrayInt)
{
// clear our array
m_pArrayInt->Clear();
/*
Called by constructors to initialize ALL data members
- Last change: JAC 21 Jul 100 5:00 pm
*/
void wxGenericValidator::Initialize()
{
int WXUNUSED(width), int WXUNUSED(height) )
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
+ wxString choice;
if ( dialog.ShowModal() == wxID_OK )
- return dialog.GetStringSelection();
- else
- return wxT("");
+ choice = dialog.GetStringSelection();
+
+ return choice;
}
// Overloaded for backward compatibility
int WXUNUSED(width), int WXUNUSED(height) )
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
+ int choice;
if ( dialog.ShowModal() == wxID_OK )
- return dialog.GetSelection();
+ choice = dialog.GetSelection();
else
- return -1;
+ choice = -1;
+
+ return choice;
}
// Overloaded for backward compatibility
int WXUNUSED(width), int WXUNUSED(height) )
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices, (char **)client_data);
+ void *data;
if ( dialog.ShowModal() == wxID_OK )
- return dialog.GetSelectionClientData();
+ data = dialog.GetSelectionClientData();
else
- return NULL;
+ data = NULL;
+
+ return data;
}
// Overloaded for backward compatibility
sprintf( buffer, "%f setlinewidth\n", XLOG2DEVREL(1000 * m_pen.GetWidth()) / 1000.0f );
#endif
for (int i = 0; i < 100; i++)
- if (buffer[i] == ',') buffer[i] = '.';
+ if (buffer[i] == ',') buffer[i] = '.';
fprintf( m_pstream, buffer );
}
double redPS = (double)(red) / 255.0;
double bluePS = (double)(blue) / 255.0;
double greenPS = (double)(green) / 255.0;
-
+
char buffer[100];
sprintf( buffer,
"%.8f %.8f %.8f setrgbcolor\n",
redPS, greenPS, bluePS );
for (int i = 0; i < 100; i++)
- if (buffer[i] == ',') buffer[i] = '.';
+ if (buffer[i] == ',') buffer[i] = '.';
fprintf( m_pstream, buffer );
m_currentRed = red;
"%.8f %.8f %.8f setrgbcolor\n",
redPS, greenPS, bluePS );
for (int i = 0; i < 100; i++)
- if (buffer[i] == ',') buffer[i] = '.';
+ if (buffer[i] == ',') buffer[i] = '.';
fprintf( m_pstream, buffer );
m_currentRed = red;
"%.8f %.8f %.8f setrgbcolor\n",
redPS, greenPS, bluePS );
for (int i = 0; i < 100; i++)
- if (buffer[i] == ',') buffer[i] = '.';
+ if (buffer[i] == ',') buffer[i] = '.';
fprintf( m_pstream, buffer );
m_currentRed = red;
m_underlineThickness,
XLOG2DEV(x + text_w), YLOG2DEV(uy) );
for (i = 0; i < 100; i++)
- if (buffer[i] == ',') buffer[i] = '.';
+ if (buffer[i] == ',') buffer[i] = '.';
fprintf( m_pstream, buffer );
}
"%.8f %.8f %.8f setrgbcolor\n",
redPS, greenPS, bluePS );
for (int i = 0; i < 100; i++)
- if (buffer[i] == ',') buffer[i] = '.';
+ if (buffer[i] == ',') buffer[i] = '.';
fprintf( m_pstream, buffer );
m_currentRed = red;
// FIXME only correct for 90 degrees
fprintf(m_pstream, "%d %d moveto\n",
- XLOG2DEV((wxCoord)(x + size)), YLOG2DEV(by) );
-
+ XLOG2DEV((wxCoord)(x + size)), YLOG2DEV((wxCoord)by) );
+
char buffer[100];
sprintf(buffer, "%.8f rotate\n", angle);
int i;
for (i = 0; i < 100; i++)
- if (buffer[i] == ',') buffer[i] = '.';
+ if (buffer[i] == ',') buffer[i] = '.';
fprintf(m_pstream, buffer);
/* I don't know how to write char to a stream, so I use a mini string */
}
fprintf( m_pstream, ") show\n" );
-
+
sprintf( buffer, "%.8f rotate\n", -angle );
for (i = 0; i < 100; i++)
- if (buffer[i] == ',') buffer[i] = '.';
+ if (buffer[i] == ',') buffer[i] = '.';
fprintf( m_pstream, buffer );
if (m_font.GetUnderlined())
m_underlineThickness,
XLOG2DEV(x + w), YLOG2DEV(uy) );
for (i = 0; i < 100; i++)
- if (buffer[i] == ',') buffer[i] = '.';
+ if (buffer[i] == ',') buffer[i] = '.';
fprintf( m_pstream, buffer );
}
for (int i = 0; i < 100; i++)
if (buffer[i] == ',') buffer[i] = '.';
fprintf( m_pstream, buffer );
-
+
fprintf( m_pstream, "%d %d translate\n", translate_x, translate_y );
}
// VS: dirty, but is there any better solution?
double *pt;
pt = (double*) &m_underlinePosition;
- *pt = YLOG2DEVREL(UnderlinePosition * fontToUse->GetPointSize()) / 1000.0f;
+ *pt = YLOG2DEVREL((wxCoord)(UnderlinePosition * fontToUse->GetPointSize())) / 1000.0f;
pt = (double*) &m_underlineThickness;
- *pt = YLOG2DEVREL(UnderlineThickness * fontToUse->GetPointSize()) / 1000.0f;
+ *pt = YLOG2DEVREL((wxCoord)(UnderlineThickness * fontToUse->GetPointSize())) / 1000.0f;
}
SetPrinterCommand(data.GetPrinterCommand());
SetPrintPreviewCommand(data.GetPreviewCommand());
SetPrinterOptions(data.GetPrinterOptions());
- SetPrinterTranslation(data.GetPrinterTranslateX(), data.GetPrinterTranslateY());
+ SetPrinterTranslation((wxCoord)data.GetPrinterTranslateX(),
+ (wxCoord)data.GetPrinterTranslateY());
SetPrinterScaling(data.GetPrinterScaleX(), data.GetPrinterScaleY());
SetPrinterOrientation(data.GetOrientation());
SetPrinterMode((int) data.GetPrintMode());
wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider();
if (attrProvider) {
attrProvider->UpdateAttrRows( pos, -((int)numRows) );
-// ifdef'd out following patch from Paul Gammans
-#if 0
+// ifdef'd out following patch from Paul Gammans
+#if 0
+ // No need to touch column attributes, unless we
// removed _all_ rows, in this case, we remove
// all column attributes.
// I hate to do this here, but the
if (attrProvider) {
attrProvider->UpdateAttrCols( pos, -((int)numCols) );
// ifdef'd out following patch from Paul Gammans
-#if 0
+#if 0
// No need to touch row attributes, unless we
// removed _all_ columns, in this case, we remove
// all row attributes.
HideCellEditControl();
DisableCellEditControl();
- if ( IsVisible( m_currentCellCoords, FALSE ) ) // zzz
+ if ( IsVisible( m_currentCellCoords, FALSE ) )
{
wxRect r;
r = BlockToDeviceRect(m_currentCellCoords, m_currentCellCoords);
{
if ( !IsVisible( m_currentCellCoords ) )
{
- m_cellEditCtrlEnabled = false;
+ m_cellEditCtrlEnabled = FALSE;
return;
}
else
{
// we want to work with logical coords
#if wxUSE_GENERIC_LIST_EXTENSIONS
- int x, y;
- m_owner->CalcUnscrolledPosition(event.GetX(), event.GetY(), &x, &y);
+ int x;
+ m_owner->CalcUnscrolledPosition(event.GetX(), 0, &x, NULL);
#else // !wxUSE_GENERIC_LIST_EXTENSIONS
int x = event.GetX();
- int y = event.GetY();
#endif // wxUSE_GENERIC_LIST_EXTENSIONS
+ int y = event.GetY();
if (m_isDragging)
{
long pos = start;
wxString tmp = str;
if (pos < 0) pos = 0;
- for (size_t i = pos; i < m_lines.GetCount(); i++)
+ for (size_t i = (size_t)pos; i < m_lines.GetCount(); i++)
{
wxListLineData *line = &m_lines[i];
wxString s = "";
{
long pos = start;
if (pos < 0) pos = 0;
- for (size_t i = pos; i < m_lines.GetCount(); i++)
+ for (size_t i = (size_t)pos; i < m_lines.GetCount(); i++)
{
wxListLineData *line = &m_lines[i];
wxListItem item;
m_widget = gtk_combo_new();
// make it more useable
- gtk_combo_set_use_arrows_always(GTK_COMBO(m_widget), TRUE);
+ gtk_combo_set_use_arrows_always( GTK_COMBO(m_widget), TRUE );
+
+ // and case-sensitive
+ gtk_combo_set_case_sensitive( GTK_COMBO(m_widget), TRUE );
+
GtkWidget *list = GTK_COMBO(m_widget)->list;
#include "cross.xbm"
#define num_hatches 6
+#define IS_15_PIX_HATCH(s) ((s)==wxCROSSDIAG_HATCH || (s)==wxHORIZONTAL_HATCH || (s)==wxVERTICAL_HATCH)
+#define IS_16_PIX_HATCH(s) ((s)!=wxCROSSDIAG_HATCH && (s)!=wxHORIZONTAL_HATCH && (s)!=wxVERTICAL_HATCH)
+
+
static GdkPixmap *hatches[num_hatches];
static GdkPixmap **hatch_bitmap = (GdkPixmap **) NULL;
gdk_draw_arc( m_window, m_textGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
} else
+ if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, ww, hh, start, end );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
} else
+ if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
gdk_draw_polygon( m_window, m_textGC, TRUE, gdkpoints, n );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
} else
+ if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+ gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+ gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
gdk_draw_rectangle( m_window, m_textGC, TRUE, xx, yy, ww, hh );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
- }
- else if (m_brush.GetStyle() == wxSTIPPLE)
+ } else
+ if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
gdk_draw_arc( m_window, m_textGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
- }
- else if (m_brush.GetStyle() == wxSTIPPLE)
+ } else
+ if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
if (m_pen.GetStyle() != wxTRANSPARENT)
{
- gdk_draw_line( m_window, m_penGC, xx+rr, yy, xx+ww-rr, yy );
- gdk_draw_line( m_window, m_penGC, xx+rr, yy+hh, xx+ww-rr, yy+hh );
- gdk_draw_line( m_window, m_penGC, xx, yy+rr, xx, yy+hh-rr );
- gdk_draw_line( m_window, m_penGC, xx+ww, yy+rr, xx+ww, yy+hh-rr );
+ gdk_draw_line( m_window, m_penGC, xx+rr+1, yy, xx+ww-rr, yy );
+ gdk_draw_line( m_window, m_penGC, xx+rr+1, yy+hh, xx+ww-rr, yy+hh );
+ gdk_draw_line( m_window, m_penGC, xx, yy+rr+1, xx, yy+hh-rr );
+ gdk_draw_line( m_window, m_penGC, xx+ww, yy+rr+1, xx+ww, yy+hh-rr );
gdk_draw_arc( m_window, m_penGC, FALSE, xx, yy, dd, dd, 90*64, 90*64 );
gdk_draw_arc( m_window, m_penGC, FALSE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
gdk_draw_arc( m_window, m_penGC, FALSE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
- }
- else if (m_brush.GetStyle() == wxSTIPPLE)
+ } else
+ if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, id );
event.SetEventObject( menu );
- event.SetInt(id );
+ if (item->IsCheckable())
+ event.SetInt( item->IsChecked() );
#if wxUSE_MENU_CALLBACK
if (menu->GetCallback())
// due to an apparent bug in GTK+, we have to use a static buffer here -
// otherwise GTK+ 1.2.2 manages to override the memory we pass to it
// somehow! (VZ)
- static char s_accel[32]; // must be big enough for <control><alt><shift>F12
- strncpy(s_accel, GetHotKey(*mitem).mb_str(), WXSIZEOF(s_accel));
+ static char s_accel[50]; // must be big enougg
+ wxString tmp( GetHotKey(*mitem) );
+ strncpy(s_accel, tmp.mb_str(), WXSIZEOF(s_accel));
entry.accelerator = s_accel;
#else // !wxUSE_ACCEL
entry.accelerator = (char*) NULL;
case WXK_F12:
hotkey << wxT('F') << code - WXK_F1 + 1;
break;
+
+ // GTK seems to use XStringToKeySym here
+ case WXK_NUMPAD_INSERT:
+ hotkey << wxT("KP_Insert" );
+ break;
+ case WXK_NUMPAD_DELETE:
+ hotkey << wxT("KP_Delete" );
+ break;
+ case WXK_INSERT:
+ hotkey << wxT("Insert" );
+ break;
+ case WXK_DELETE:
+ hotkey << wxT("Delete" );
+ break;
// if there are any other keys wxGetAccelFromString() may return,
// we should process them here
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
wxFAIL_MSG( wxT("wxStaticLine creation failed") );
- return FALSE;
+ return FALSE;
}
if ( IsVertical() )
{
m_widget = gtk_vseparator_new();
- if (size.x == -1)
- {
- wxSize new_size( size );
- new_size.x = 4;
- SetSize( new_size );
- }
+ if (size.x == -1)
+ {
+ wxSize new_size( size );
+ new_size.x = 4;
+ SetSize( new_size );
+ }
}
else
{
m_widget = gtk_hseparator_new();
- if (size.y == -1)
- {
- wxSize new_size( size );
- new_size.y = 4;
- SetSize( new_size );
- }
+ if (size.y == -1)
+ {
+ wxSize new_size( size );
+ new_size.y = 4;
+ SetSize( new_size );
+ }
}
m_parent->DoAddChild( this );
wxTextCtrl::wxTextCtrl()
{
m_modified = FALSE;
+ m_text =
+ m_vScrollbar = (GtkWidget *)NULL;
}
wxTextCtrl::wxTextCtrl( wxWindow *parent,
gint dy);
+/* unused */
+#if 0
static void gtk_pizza_expose_area (GtkPizza *pizza,
gint x,
gint y,
gint width,
gint height);
-/* unused */
-#if 0
static void gtk_pizza_adjustment_changed (GtkAdjustment *adjustment,
GtkPizza *pizza);
#endif
/* Callbacks */
+/* unused */
+#if 0
/* Send a synthetic expose event to the widget
*/
static void
gdk_window_unref (event.window);
}
}
+#endif /* unused */
/* This function is used to find events to process while scrolling
*/
m_widget = gtk_combo_new();
// make it more useable
- gtk_combo_set_use_arrows_always(GTK_COMBO(m_widget), TRUE);
+ gtk_combo_set_use_arrows_always( GTK_COMBO(m_widget), TRUE );
+
+ // and case-sensitive
+ gtk_combo_set_case_sensitive( GTK_COMBO(m_widget), TRUE );
+
GtkWidget *list = GTK_COMBO(m_widget)->list;
#include "cross.xbm"
#define num_hatches 6
+#define IS_15_PIX_HATCH(s) ((s)==wxCROSSDIAG_HATCH || (s)==wxHORIZONTAL_HATCH || (s)==wxVERTICAL_HATCH)
+#define IS_16_PIX_HATCH(s) ((s)!=wxCROSSDIAG_HATCH && (s)!=wxHORIZONTAL_HATCH && (s)!=wxVERTICAL_HATCH)
+
+
static GdkPixmap *hatches[num_hatches];
static GdkPixmap **hatch_bitmap = (GdkPixmap **) NULL;
gdk_draw_arc( m_window, m_textGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
} else
+ if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, ww, hh, start, end );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
} else
+ if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
gdk_draw_polygon( m_window, m_textGC, TRUE, gdkpoints, n );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
} else
+ if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+ gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+ gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
gdk_draw_rectangle( m_window, m_textGC, TRUE, xx, yy, ww, hh );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
- }
- else if (m_brush.GetStyle() == wxSTIPPLE)
+ } else
+ if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
gdk_draw_arc( m_window, m_textGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
- }
- else if (m_brush.GetStyle() == wxSTIPPLE)
+ } else
+ if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
+ gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
if (m_pen.GetStyle() != wxTRANSPARENT)
{
- gdk_draw_line( m_window, m_penGC, xx+rr, yy, xx+ww-rr, yy );
- gdk_draw_line( m_window, m_penGC, xx+rr, yy+hh, xx+ww-rr, yy+hh );
- gdk_draw_line( m_window, m_penGC, xx, yy+rr, xx, yy+hh-rr );
- gdk_draw_line( m_window, m_penGC, xx+ww, yy+rr, xx+ww, yy+hh-rr );
+ gdk_draw_line( m_window, m_penGC, xx+rr+1, yy, xx+ww-rr, yy );
+ gdk_draw_line( m_window, m_penGC, xx+rr+1, yy+hh, xx+ww-rr, yy+hh );
+ gdk_draw_line( m_window, m_penGC, xx, yy+rr+1, xx, yy+hh-rr );
+ gdk_draw_line( m_window, m_penGC, xx+ww, yy+rr+1, xx+ww, yy+hh-rr );
gdk_draw_arc( m_window, m_penGC, FALSE, xx, yy, dd, dd, 90*64, 90*64 );
gdk_draw_arc( m_window, m_penGC, FALSE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
gdk_draw_arc( m_window, m_penGC, FALSE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
- }
- else if (m_brush.GetStyle() == wxSTIPPLE)
+ } else
+ if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+ {
+ gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+ gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
+ gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+ } else
+ if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, id );
event.SetEventObject( menu );
- event.SetInt(id );
+ if (item->IsCheckable())
+ event.SetInt( item->IsChecked() );
#if wxUSE_MENU_CALLBACK
if (menu->GetCallback())
// due to an apparent bug in GTK+, we have to use a static buffer here -
// otherwise GTK+ 1.2.2 manages to override the memory we pass to it
// somehow! (VZ)
- static char s_accel[32]; // must be big enough for <control><alt><shift>F12
- strncpy(s_accel, GetHotKey(*mitem).mb_str(), WXSIZEOF(s_accel));
+ static char s_accel[50]; // must be big enougg
+ wxString tmp( GetHotKey(*mitem) );
+ strncpy(s_accel, tmp.mb_str(), WXSIZEOF(s_accel));
entry.accelerator = s_accel;
#else // !wxUSE_ACCEL
entry.accelerator = (char*) NULL;
case WXK_F12:
hotkey << wxT('F') << code - WXK_F1 + 1;
break;
+
+ // GTK seems to use XStringToKeySym here
+ case WXK_NUMPAD_INSERT:
+ hotkey << wxT("KP_Insert" );
+ break;
+ case WXK_NUMPAD_DELETE:
+ hotkey << wxT("KP_Delete" );
+ break;
+ case WXK_INSERT:
+ hotkey << wxT("Insert" );
+ break;
+ case WXK_DELETE:
+ hotkey << wxT("Delete" );
+ break;
// if there are any other keys wxGetAccelFromString() may return,
// we should process them here
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
wxFAIL_MSG( wxT("wxStaticLine creation failed") );
- return FALSE;
+ return FALSE;
}
if ( IsVertical() )
{
m_widget = gtk_vseparator_new();
- if (size.x == -1)
- {
- wxSize new_size( size );
- new_size.x = 4;
- SetSize( new_size );
- }
+ if (size.x == -1)
+ {
+ wxSize new_size( size );
+ new_size.x = 4;
+ SetSize( new_size );
+ }
}
else
{
m_widget = gtk_hseparator_new();
- if (size.y == -1)
- {
- wxSize new_size( size );
- new_size.y = 4;
- SetSize( new_size );
- }
+ if (size.y == -1)
+ {
+ wxSize new_size( size );
+ new_size.y = 4;
+ SetSize( new_size );
+ }
}
m_parent->DoAddChild( this );
wxTextCtrl::wxTextCtrl()
{
m_modified = FALSE;
+ m_text =
+ m_vScrollbar = (GtkWidget *)NULL;
}
wxTextCtrl::wxTextCtrl( wxWindow *parent,
gint dy);
+/* unused */
+#if 0
static void gtk_pizza_expose_area (GtkPizza *pizza,
gint x,
gint y,
gint width,
gint height);
-/* unused */
-#if 0
static void gtk_pizza_adjustment_changed (GtkAdjustment *adjustment,
GtkPizza *pizza);
#endif
/* Callbacks */
+/* unused */
+#if 0
/* Send a synthetic expose event to the widget
*/
static void
gdk_window_unref (event.window);
}
}
+#endif /* unused */
/* This function is used to find events to process while scrolling
*/
return s;
}
- else return doc;
+ return doc;
}
delete preview;
return FALSE;
}
-
- else {
- wxPreviewFrame *frame = new wxPreviewFrame(preview, m_Frame,
- m_Name + _(" Preview"),
- wxPoint(100, 100), wxSize(650, 500));
- frame -> Centre(wxBOTH);
- frame -> Initialize();
- frame -> Show(TRUE);
- return TRUE;
- }
+
+ wxPreviewFrame *frame = new wxPreviewFrame(preview, m_Frame,
+ m_Name + _(" Preview"),
+ wxPoint(100, 100), wxSize(650, 500));
+ frame -> Centre(wxBOTH);
+ frame -> Initialize();
+ frame -> Show(TRUE);
+ return TRUE;
}
{
return FALSE;
}
- else
- {
- (*m_PrintData) = printer.GetPrintDialogData().GetPrintData();
- return TRUE;
- }
+
+ (*m_PrintData) = printer.GetPrintDialogData().GetPrintData();
+ return TRUE;
}
fileDialog.SetFilterIndex(filterFind);
}
+ wxString filename;
if ( fileDialog.ShowModal() == wxID_OK )
{
- wxStrcpy(wxBuffer, (const wxChar *)fileDialog.GetPath());
- return wxBuffer;
+ filename = fileDialog.GetPath();
}
- else
- return wxGetEmptyString();
+
+ return filename;
}
int y)
{
- wxFileDialog fileDialog(parent, title ? title : wxT(""), defaultDir ? defaultDir : wxT(""),
- defaultFileName ? defaultFileName : wxT(""), filter ? filter : wxT(""), flags, wxPoint(x, y));
+ wxFileDialog fileDialog(parent,
+ title ? title : wxT(""),
+ defaultDir ? defaultDir : wxT(""),
+ defaultFileName ? defaultFileName : wxT(""),
+ filter ? filter : wxT(""),
+ flags, wxPoint(x, y));
+ wxString filename;
if ( fileDialog.ShowModal() == wxID_OK )
{
- *defaultFilterIndex = fileDialog.GetFilterIndex();
- wxStrcpy(wxBuffer, (const wxChar *)fileDialog.GetPath());
- return wxBuffer;
+ if ( defaultFilterIndex )
+ *defaultFilterIndex = fileDialog.GetFilterIndex();
+
+ filename = fileDialog.GetPath();
}
- else
- return wxGetEmptyString();
+
+ return filename;
}
wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// the default font size in points
+static const int wxDEFAULT_FONT_SIZE = 12;
+
// ----------------------------------------------------------------------------
// wxFontRefData - the internal description of the font
// ----------------------------------------------------------------------------
public:
wxFontRefData()
{
- Init(12, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE,
+ Init(wxDEFAULT_FONT_SIZE, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE,
"", wxFONTENCODING_DEFAULT);
}
wxFontEncoding encoding)
{
UnRef();
+
+ // wxDEFAULT is a valid value for the font size too so we must treat it
+ // specially here (otherwise the size would be 70 == wxDEFAULT value)
+ if ( pointSize == wxDEFAULT )
+ pointSize = wxDEFAULT_FONT_SIZE;
+
m_refData = new wxFontRefData(pointSize, family, style, weight,
underlined, faceName, encoding);
// could be the culprit. But without it, you can get a lot of flicker.
DWORD msflags = 0;
- if ((style & wxCAPTION) == wxCAPTION)
- msflags = WS_OVERLAPPED;
+ if ( style & wxCAPTION )
+ {
+ if ( style & wxFRAME_TOOL_WINDOW )
+ msflags |= WS_POPUPWINDOW;
+ else
+ msflags |= WS_OVERLAPPED;
+ }
else
- msflags = WS_POPUP;
+ {
+ msflags |= WS_POPUP;
+ }
if (style & wxMINIMIZE_BOX)
msflags |= WS_MINIMIZEBOX;
{
wxWindow *win = node->GetData();
+ // iconizing the frames with this style under Win95 shell puts them at
+ // the bottom of the screen (as the MDI children) instead of making
+ // them appear in the taskbar because they are, by virtue of this
+ // style, not managed by the taskbar - instead leave Windows take care
+ // of them
+#ifdef __WIN95__
+ if ( win->GetWindowStyle() & wxFRAME_TOOL_WINDOW )
+ continue;
+#endif // Win95
+
// the child MDI frames are a special case and should not be touched by
// the parent frame - instead, they are managed by the user
wxFrame *frame = wxDynamicCast(win, wxFrame);
if (!success)
{
free(socket);
- return NULL;
+ socket = NULL;
}
return socket;
// returns the mask if it's valid, otherwise the bitmap mask and, if it's not
// valid neither, a "solid" mask (no transparent zones at all)
-static wxBitmap GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask);
+static HBITMAP GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask);
// ============================================================================
// implementation
// 'bitmap' and 'mask'.
int wxImageList::Add(const wxBitmap& bitmap, const wxBitmap& mask)
{
- wxBitmap bmpMask = GetMaskForImage(bitmap, mask);
- HBITMAP hbmpMask = wxInvertMask(GetHbitmapOf(bmpMask));
+ HBITMAP hbmpMask = GetMaskForImage(bitmap, mask);
int index = ImageList_Add(GetHImageList(), GetHbitmapOf(bitmap), hbmpMask);
if ( index == -1 )
wxFAIL_MSG(_T("ImageList_Replace not implemented in TWIN32"));
return FALSE;
#else
- wxBitmap bmpMask = GetMaskForImage(bitmap, mask);
- HBITMAP hbmpMask = wxInvertMask(GetHbitmapOf(bmpMask));
+ HBITMAP hbmpMask = GetMaskForImage(bitmap, mask);
bool ok = ImageList_Replace(GetHImageList(), index,
GetHbitmapOf(bitmap), hbmpMask) != 0;
// helpers
// ----------------------------------------------------------------------------
-static wxBitmap GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask)
+static HBITMAP GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask)
{
- wxBitmap bmpMask;
+ HBITMAP hbmpMask;
+ wxBitmap *bmpMask = NULL;
if ( mask.Ok() )
{
- bmpMask = mask;
+ hbmpMask = GetHbitmapOf(mask);
}
else
{
wxMask *pMask = bitmap.GetMask();
if ( pMask )
{
- bmpMask.SetHBITMAP(pMask->GetMaskBitmap());
+ hbmpMask = (HBITMAP)pMask->GetMaskBitmap();
}
- }
+ else
+ {
+ // create a non transparent mask - apparently, this is needed under
+ // Win9x (it doesn't behave correctly if it's passed 0 mask)
+ bmpMask = new wxBitmap(bitmap.GetWidth(), bitmap.GetHeight(), 1);
- if ( !bmpMask.Ok() )
- {
- // create a non transparent mask - apparently, this is needed under
- // Win9x (it doesn't behave correctly if it's passed 0 mask)
- bmpMask.Create(bitmap.GetWidth(), bitmap.GetHeight(), 1);
-
- wxMemoryDC dcMem;
- dcMem.SelectObject(bmpMask);
- dcMem.Clear();
- dcMem.SelectObject(wxNullBitmap);
+ wxMemoryDC dcMem;
+ dcMem.SelectObject(*bmpMask);
+ dcMem.Clear();
+ dcMem.SelectObject(wxNullBitmap);
+
+ hbmpMask = GetHbitmapOf(*bmpMask);
+ }
}
- return bmpMask;
+ // windows mask convention is opposite to the wxWindows one
+ HBITMAP hbmpMaskInv = wxInvertMask(hbmpMask);
+ delete bmpMask;
+
+ return hbmpMaskInv;
}
#endif // Win95
findInfo.flags = LVFI_STRING;
if ( partial )
findInfo.flags |= LVFI_PARTIAL;
- findInfo.psz = WXSTRINGCAST str;
+ findInfo.psz = str;
- return ListView_FindItem(GetHwnd(), (int) start, & findInfo);
+ // ListView_FindItem() excludes the first item from search and to look
+ // through all the items you need to start from -1 which is unnatural and
+ // inconsitent with the generic version - so we adjust the index
+ return ListView_FindItem(GetHwnd(), (int) start - 1, &findInfo);
}
// Find an item whose data matches this data, starting from the item after 'start'
DUMMYOBJ=$D\dummy.obj
!endif
-# Please set these according to the settings in setup.h, so we can include
-# the appropriate libraries in wx.lib
-
-# This one overrides the others, to be consistent with the settings in setup.h
-MINIMAL_WXWINDOWS_SETUP=0
-
PERIPH_LIBS=
PERIPH_TARGET=
PERIPH_CLEAN_TARGET=
+# Set to 0 if not using GLCanvas (only affects DLL build)
+USE_GLCANVAS=1
+
# These are absolute paths, so that the compiler
# generates correct __FILE__ symbols for debugging.
# Otherwise you don't be able to double-click on a memory
extern wxWindowList wxModelessWindows; // from dialog.cpp
extern wxMenu *wxCurrentPopupMenu;
-extern const wxChar *wxMDIFrameClassName;
+extern const wxChar *wxMDIFrameClassName; // from app.cpp
extern const wxChar *wxMDIChildFrameClassName;
+extern const wxChar *wxMDIChildFrameClassNameNoRedraw;
+
extern wxWindow *wxWndHook; // from window.cpp
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
if (style & wxCLIP_CHILDREN)
msflags |= WS_CLIPCHILDREN;
- wxWindow::MSWCreate(m_windowId, parent, wxMDIFrameClassName, this, title, x, y, width, height,
- msflags);
+ if ( !wxWindow::MSWCreate(m_windowId,
+ parent,
+ wxMDIFrameClassName,
+ this,
+ title,
+ x, y, width, height,
+ msflags) )
+ {
+ return FALSE;
+ }
wxModelessWindows.Append(this);
MDICREATESTRUCT mcs;
- mcs.szClass = wxMDIChildFrameClassName;
+ mcs.szClass = style & wxNO_FULL_REPAINT_ON_RESIZE
+ ? wxMDIChildFrameClassNameNoRedraw
+ : wxMDIChildFrameClassName;
mcs.szTitle = title;
mcs.hOwner = wxGetInstance();
if (x > -1)
mcs.lParam = 0;
- DWORD Return = SendMessage(GetWinHwnd(parent->GetClientWindow()),
- WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
-
- //handle = (HWND)LOWORD(Return);
- // Must be the DWORRD for WIN32. And in 16 bits, HIWORD=0 (says Microsoft)
- m_hWnd = (WXHWND)Return;
+ m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
+ WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
wxWndHook = NULL;
wxAssociateWinWithHandle((HWND) GetHWND(), this);
return TRUE;
}
+ bool processed;
if (GetMenuBar() && GetMenuBar()->FindItem(id))
{
- ProcessCommand(id);
- return TRUE;
+ processed = ProcessCommand(id);
}
else
- return FALSE;
+ {
+ processed = FALSE;
+ }
- return TRUE;
+ return processed;
}
bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate),
wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED);
event.SetEventObject( this );
event.SetId( id );
- event.SetInt( id );
+
+ // VZ: previosuly, the command int was set to id too which was quite
+ // useless anyhow (as it could be retrieved using GetId()) and
+ // uncompatible with wxGTK, so now we use the command int instead
+ // to pass the checked status
+ event.SetInt(::GetMenuState(GetHmenu(), id, MF_BYCOMMAND) & MF_CHECKED);
+
ProcessCommand(event);
}
WXHMENU wxMenuBar::Create()
{
- if (m_hMenu != 0 )
+ if ( m_hMenu != 0 )
return m_hMenu;
- wxCHECK_MSG( !m_hMenu, TRUE, wxT("menubar already created") );
-
m_hMenu = (WXHMENU)::CreateMenu();
if ( !m_hMenu )
win->SubclassWin(hWnd);
win->AdoptAttributesFromHWND();
win->SetupColours();
-
- return win;
}
- else
- return NULL;
+
+ return win;
}
// Make sure the window style (etc.) reflects the HWND style (roughly)
{
return (WXIDISPATCH*) retVariant.GetVoidPtr();
}
- else
- {
- return (WXIDISPATCH*) NULL;
- }
}
- else
- return (WXIDISPATCH*) NULL;
+
+ return (WXIDISPATCH*) NULL;
}
// A way of initialising another wxAutomationObject with a dispatch object
/////////////////////////////////////////////////////////////////////////////
-// Name: radiobox.cpp
-// Purpose: wxRadioBox
+// Name: msw/radiobox.cpp
+// Purpose: wxRadioBox implementation
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// wxRadioBox
// ---------------------------------------------------------------------------
+// returns the number of rows
int wxRadioBox::GetNumVer() const
{
if ( m_windowStyle & wxRA_SPECIFY_ROWS )
}
}
+// returns the number of columns
int wxRadioBox::GetNumHor() const
{
if ( m_windowStyle & wxRA_SPECIFY_ROWS )
}
}
- wxASSERT_MSG( selectedButton != -1, wxT("click from alien button?") );
+ if ( selectedButton == -1 )
+ {
+ // just ignore it - due to a hack with WM_NCHITTEST handling in our
+ // wnd proc, we can receive dummy click messages when we click near
+ // the radiobox edge (this is ugly but Julian wouldn't let me get
+ // rid of this...)
+ return FALSE;
+ }
if ( selectedButton != m_selectedButton )
{
m_selectedButton = -1;
m_noItems = 0;
- m_majorDim = majorDim == 0 ? n : majorDim;
+ m_majorDim = majorDim == 0 ? n : majorDim;
m_noRowsOrCols = majorDim;
// common initialization
return wxGetWindowText(m_radioButtons[N]);
}
+// ----------------------------------------------------------------------------
+// size calculations
+// ----------------------------------------------------------------------------
+
+wxSize wxRadioBox::GetMaxButtonSize() const
+{
+ // calculate the max button size
+ int widthMax = 0,
+ heightMax = 0;
+ for ( int i = 0 ; i < m_noItems; i++ )
+ {
+ int width, height;
+ if ( m_radioWidth[i] < 0 )
+ {
+ GetTextExtent(wxGetWindowText(m_radioButtons[i]), &width, &height);
+
+ // adjust the size to take into account the radio box itself
+ // FIXME this is totally bogus!
+ width += RADIO_SIZE;
+ height *= 3;
+ height /= 2;
+ }
+ else
+ {
+ width = m_radioWidth[i];
+ height = m_radioHeight[i];
+ }
+
+ if ( widthMax < width )
+ widthMax = width;
+ if ( heightMax < height )
+ heightMax = height;
+ }
+
+ return wxSize(widthMax, heightMax);
+}
+
+wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
+{
+ // the radiobox should be big enough for its buttons
+ int cx1, cy1;
+ wxGetCharSize(m_hWnd, &cx1, &cy1, &GetFont());
+
+ int extraHeight = cy1;
+
+#if defined(CTL3D) && !CTL3D
+ // Requires a bigger group box in plain Windows
+ extraHeight *= 3;
+ extraHeight /= 2;
+#endif
+
+ int height = GetNumVer() * sizeBtn.y + cy1/2 + extraHeight;
+ int width = GetNumHor() * (sizeBtn.x + cx1) + cx1;
+
+ // and also wide enough for its label
+ int widthLabel;
+ GetTextExtent(GetTitle(), &widthLabel, NULL);
+ widthLabel += RADIO_SIZE; // FIXME this is bogus too
+ if ( widthLabel > width )
+ width = widthLabel;
+
+ return wxSize(width, height);
+}
+
+wxSize wxRadioBox::DoGetBestSize() const
+{
+ return GetTotalButtonSize(GetMaxButtonSize());
+}
+
// Restored old code.
void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int x_offset = xx;
#endif
- int current_width, cyf;
-
- int cx1,cy1;
+ int cx1, cy1;
wxGetCharSize(m_hWnd, &cx1, &cy1, & GetFont());
// Attempt to have a look coherent with other platforms: We compute the
// biggest toggle dim, then we align all items according this value.
- int maxWidth = -1;
- int maxHeight = -1;
+ wxSize maxSize = GetMaxButtonSize();
+ int maxWidth = maxSize.x,
+ maxHeight = maxSize.y;
- int i;
- for (i = 0 ; i < m_noItems; i++)
+ wxSize totSize = GetTotalButtonSize(maxSize);
+ int totWidth = totSize.x,
+ totHeight = totSize.y;
+
+ // only change our width/height if asked for
+ if ( width == -1 )
{
- int eachWidth;
- int eachHeight;
- if (m_radioWidth[i]<0)
- {
- // It's a labelled toggle
- GetTextExtent(wxGetWindowText(m_radioButtons[i]),
- ¤t_width, &cyf);
- eachWidth = (int)(current_width + RADIO_SIZE);
- eachHeight = (int)((3*cyf)/2);
- }
+ if ( sizeFlags & wxSIZE_AUTO_WIDTH )
+ width = totWidth;
else
- {
- eachWidth = m_radioWidth[i];
- eachHeight = m_radioHeight[i];
- }
-
- if (maxWidth<eachWidth)
- maxWidth = eachWidth;
- if (maxHeight<eachHeight)
- maxHeight = eachHeight;
+ width = widthOld;
}
- if (m_hWnd)
+ if ( height == -1 )
{
- int totWidth;
- int totHeight;
-
- int nbHor = GetNumHor(),
- nbVer = GetNumVer();
-
- // this formula works, but I don't know why.
- // Please, be sure what you do if you modify it!!
- if (m_radioWidth[0]<0)
- totHeight = (nbVer * maxHeight) + cy1/2;
+ if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
+ height = totHeight;
else
- totHeight = nbVer * (maxHeight+cy1/2);
- totWidth = nbHor * (maxWidth+cx1);
-
- int extraHeight = cy1;
-
-#if defined(CTL3D) && !CTL3D
- // Requires a bigger group box in plain Windows
- extraHeight *= 3;
- extraHeight /= 2;
-#endif
+ height = heightOld;
+ }
- // only change our width/height if asked for
- if ( width == -1 )
- {
- if ( sizeFlags & wxSIZE_AUTO_WIDTH )
- width = totWidth + cx1;
- else
- width = widthOld;
- }
+ ::MoveWindow(GetHwnd(), xx, yy, width, height, TRUE);
- if ( height == -1 )
- {
- if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
- height = totHeight + extraHeight;
- else
- height = heightOld;
- }
+ // Now position all the buttons: the current button will be put at
+ // wxPoint(x_offset, y_offset) and the new row/column will start at
+ // startX/startY. The size of all buttons will be the same wxSize(maxWidth,
+ // maxHeight) except for the buttons in the last column which should extend
+ // to the right border of radiobox and thus can be wider than this.
- ::MoveWindow(GetHwnd(), xx, yy, width, height, TRUE);
+ // Also, remember that wxRA_SPECIFY_COLS means that we arrange buttons in
+ // left to right order and m_majorDim is the number of columns while
+ // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and
+ // m_majorDim is the number of rows.
- x_offset += cx1;
- y_offset += cy1;
- }
+ x_offset += cx1;
+ y_offset += cy1;
#if defined(CTL3D) && (!CTL3D)
y_offset += (int)(cy1/2); // Fudge factor since buttons overlapped label
// JACS 2/12/93. CTL3D draws group label quite high.
#endif
+
int startX = x_offset;
int startY = y_offset;
- for ( i = 0 ; i < m_noItems; i++)
+ for ( int i = 0; i < m_noItems; i++ )
{
- // Bidimensional radio adjustment
- if (i&&((i%m_majorDim)==0)) // Why is this omitted for i = 0?
+ // the last button in the row may be wider than the other ones as the
+ // radiobox may be wider than the sum of the button widths (as it
+ // happens, for example, when the radiobox label is very long)
+ bool isLastInTheRow;
+ if ( m_windowStyle & wxRA_SPECIFY_COLS )
+ {
+ // item is the last in its row if it is a multiple of the number of
+ // columns or if it is just the last item
+ int n = i + 1;
+ isLastInTheRow = ((n % m_majorDim) == 0) || (n == m_noItems);
+ }
+ else // wxRA_SPECIFY_ROWS
{
- if (m_windowStyle & wxRA_VERTICAL)
+ // item is the last in the row if it is in the last columns
+ isLastInTheRow = i >= (m_noItems/m_majorDim)*m_majorDim;
+ }
+
+ // is this the start of new row/column?
+ if ( i && (i % m_majorDim == 0) )
+ {
+ if ( m_windowStyle & wxRA_SPECIFY_ROWS )
{
+ // start of new column
y_offset = startY;
x_offset += maxWidth + cx1;
}
- else
+ else // start of new row
{
x_offset = startX;
y_offset += maxHeight;
y_offset += cy1/2;
}
}
- int eachWidth;
- int eachHeight;
- if (m_radioWidth[i]<0)
+
+ int widthBtn;
+ if ( isLastInTheRow )
{
- // It's a labeled item
- GetTextExtent(wxGetWindowText(m_radioButtons[i]),
- ¤t_width, &cyf);
-
- // How do we find out radio button bitmap size!!
- // By adjusting them carefully, manually :-)
- eachWidth = (int)(current_width + RADIO_SIZE);
- eachHeight = (int)((3*cyf)/2);
+ // make the button go to the end of radio box
+ widthBtn = startX + width - x_offset - 2*cx1;
+ if ( widthBtn < maxWidth )
+ widthBtn = maxWidth;
}
else
{
- eachWidth = m_radioWidth[i];
- eachHeight = m_radioHeight[i];
+ // normal button, always of the same size
+ widthBtn = maxWidth;
}
// VZ: make all buttons of the same, maximal size - like this they
// shown (otherwise they are not when the mouse pointer is in the
// radiobox part not belonging to any radiobutton)
::MoveWindow((HWND)m_radioButtons[i],
- x_offset, y_offset, maxWidth, maxHeight,
+ x_offset, y_offset, widthBtn, maxHeight,
TRUE);
- if (m_windowStyle & wxRA_SPECIFY_ROWS)
+ // where do we put the next button?
+ if ( m_windowStyle & wxRA_SPECIFY_ROWS )
{
+ // below this one
y_offset += maxHeight;
if (m_radioWidth[0]>0)
y_offset += cy1/2;
}
else
- x_offset += maxWidth + cx1;
+ {
+ // to the right of this one
+ x_offset += widthBtn + cx1;
+ }
}
}
bool processed = TRUE;
+ bool horz = (radiobox->GetWindowStyle() & wxRA_SPECIFY_COLS) != 0;
+ int num = radiobox->Number(),
+ rows = radiobox->GetNumVer(),
+ cols = radiobox->GetNumHor();
+
int selOld = radiobox->GetSelection();
int selNew = selOld;
+ // wrapping will be handled below for the cases when we
+ // add/substract more than 1 but here otherwise as it's simpler
switch ( wParam )
{
case VK_UP:
- selNew--;
+ if ( horz )
+ selNew -= cols;
+ else
+ {
+ if ( selNew )
+ selNew--;
+ else
+ selNew = num - 1;
+ }
break;
case VK_LEFT:
- selNew -= radiobox->GetNumVer();
+ if ( horz )
+ {
+ if ( selNew )
+ selNew--;
+ else
+ selNew = num - 1;
+ }
+ else
+ selNew -= rows;
break;
case VK_DOWN:
- selNew++;
+ if ( horz )
+ selNew += cols;
+ else
+ {
+ if ( ++selNew == num )
+ selNew = 0;
+ }
break;
case VK_RIGHT:
- selNew += radiobox->GetNumVer();
+ if ( horz )
+ {
+ if ( ++selNew == num )
+ selNew = 0;
+ }
+ else
+ selNew += rows;
break;
default:
if ( processed )
{
// ensure that selNew is in range [0..num)
- int num = radiobox->Number();
- selNew += num;
- selNew %= num;
+ if ( selNew >= num )
+ {
+ selNew -= num;
+
+ int dim = horz ? cols : rows;
+ selNew += dim - 1;
+ selNew %= dim;
+ }
+ else if ( selNew < 0 )
+ {
+ selNew += num;
+
+ int dim = horz ? cols : rows;
+ if ( selNew % dim == 0 )
+ {
+ selNew -= dim - 1;
+ }
+ else
+ {
+ selNew++;
+ }
+ }
if ( selNew != selOld )
{
{
wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId);
event.SetEventObject( this );
+ event.SetInt( GetValue() );
ProcessCommand(event);
return TRUE;
}
default:
return 0;
}
- return 0;
}
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,2,0,0
- PRODUCTVERSION 2,2,0,0
- FILEFLAGSMASK 0x3fL
-#ifdef __WXDEBUG__
- FILEFLAGS 0x1L
+#include "wx/version.h"
+
+#ifdef _DEBUG
+ #define DLL_FLAGS 0x1L
+ #define DLL_SUFFIX "d"
#else
- FILEFLAGS 0x0L
+ #define DLL_FLAGS 0x0L
+ #define DLL_SUFFIX ""
#endif
+
+1 VERSIONINFO
+ FILEVERSION wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxBETA_NUMBER
+ PRODUCTVERSION wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxBETA_NUMBER
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS DLL_FLAGS
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
VALUE "Comments", "wxWindows cross-platform GUI framework\0"
VALUE "CompanyName", "wxWindows development team\0"
VALUE "FileDescription", "wxWindows for MSW\0"
- VALUE "FileVersion", "2, 2, 0, 0\0"
+ VALUE "FileVersion", "2.2.1\0"
VALUE "InternalName", "wxMSW\0"
- VALUE "LegalCopyright", "Copyright © 1993,2000 wxWindows development team\0"
+ VALUE "LegalCopyright", "Copyright © 1993, 2000 wxWindows development team\0"
VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "wx220.dll\0"
+ VALUE "OriginalFilename", "wxmsw221" DLL_SUFFIX ".dll\0"
VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "wxMSW\0"
- VALUE "ProductVersion", "2, 2, 0, 0\0"
+ VALUE "ProductName", "wxWindows\0"
+ VALUE "ProductVersion", "2.2.1\0"
VALUE "SpecialBuild", "\0"
END
END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
END
// cursor set, stop here
return TRUE;
}
- else
- {
- // pass up the window chain
- return FALSE;
- }
+
+ // pass up the window chain
+ return FALSE;
}
// ---------------------------------------------------------------------------
if (xmask)
{
wxMask *mask = new wxMask();
- mask->SetMaskBitmap((WXHBITMAP) wxInvertMask(xmask->bitmap));
+ mask->SetMaskBitmap((WXHBITMAP) wxInvertMask(xmask->bitmap,
+ bm.bmWidth, bm.bmHeight));
bitmap->SetMask(mask);
}
}
#endif
{
#ifndef NO_ZPIPE
- char *compressfile, buf[BUFSIZ];
+ char buf[BUFSIZ];
# ifdef STAT_ZFILE
+ char *compressfile;
struct stat status;
# endif
#endif
.emacs.desktop
build.local
+update.log
command, as well as to build.local for wxPython, (see below.)
-2. For either platform, you should be sure to set an environment
+2. For the win32 platform you should be sure to set an environment
variable named WXWIN to be the path to the top of the wxWindows
- tree.
+ source tree.
3. If you are working from a copy of the code retrieved from CVS, then
WXPSRCDIR = "~/MyStuff/wxPython-2.1.15/src"
+ If your wxPython sources are not under $WXWIN then you'll need to
+ adjust the remainder of these instructions accordingly.
+
4. At this point you may want to make an alias, symlink, script,
batch file, or whatever on the PATH that invokes
python %WXWIN%/wxPython/distrib/build.py %1 %2 %3 %4 %5 %6
-5. Change into the $(WXWIN)/utils/wxPython/src directory.
+5. Change into the $(WXWIN)/wxPython/src directory.
6. If you don't use SWIG, or don't have a new enough version
again.
-9. Change to the $WXWIN/utils/wxPython/demo directory.
+9. Change to the $WXWIN/wxPython/demo directory.
10. Try executing the demo program. For example:
To run it without requiring a console on win32, you can use the
pythonw.exe version of Python either from the command line or from
a shortcut.
-
----------------------------------------------------------------------
+New in 2.2.1
+------------
+
+Various tweaks, fixes, missing methods, etc.
+
+
+
New in 2.2.0
------------
demo item so you can learn how to use the classes yourself.</p>
<p><b>wxPython</b> is brought to you by <b>Robin Dunn</b> and<br>
-<b>Total Control Software</b>, Copyright (c) 1997-1999.</p>
+<b>Total Control Software</b>, Copyright (c) 1997-2000.</p>
<p>
<font size="-1">Please see <i>license.txt</i> for licensing information.</font>
# you can set cell attributes for the whole row (or column)
self.SetRowAttr(5, attr)
+ self.SetColLabelValue(0, "Custom")
+ self.SetColLabelValue(1, "column")
+ self.SetColLabelValue(2, "labels")
# test all the events
EVT_GRID_CELL_LEFT_CLICK(self, self.OnCellLeftClick)
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
self.cwd = os.getcwd()
+ self.curOverview = ""
if wxPlatform == '__WXMSW__':
self.icon = wxIcon('bitmaps/mondrian.ico', wxBITMAP_TYPE_ICO)
self.x, self.y = self.ConvertEventCoords(event)
def ConvertEventCoords(self, event):
- xView, yView = self.ViewStart()
+ xView, yView = self.GetViewStart()
xDelta, yDelta = self.GetScrollPixelsPerUnit()
return (event.GetX() + (xView * xDelta),
event.GetY() + (yView * yDelta))
logfile = 'c:\\temp\\autobuild.log'
WXDIR = os.environ['WXWIN']
-dllVer = '21_16'
-wxpVer = '2.1.16'
+dllVer = '22_0'
+wxpVer = '2.2.0'
dateSt = time.strftime("%Y%m%d", time.localtime(time.time()))
base = os.path.split(sys.argv[0])[0]
# This is really the wxPython version number, and will be placed in the
# Makefiles for use with the distribution related targets.
-major_version = '2.1'
-build_version = '16'
+major_version = '2.2'
+build_version = '0'
__version__ = major_version + '.' + build_version
%define pref /usr
-%define ver 2.1.16
-%define rpmver 1
+%define ver 2.2.0
+%define rpmver 0
Summary: Cross platform GUI toolkit for use with the Python language.
Name: wxPython
Document Type: WSE
item: Global
Version=6.01
- Title=wxPython 2.1 Installation
+ Title=wxPython 2.2 Installation
Flags=10010111
Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Japanese Font Name=MS Gothic
Patch Flags=0000000000001001
Patch Threshold=85
Patch Memory=4000
- EXE Filename=wxPython-2.1.16.exe
+ EXE Filename=wxPython-2.2.0.exe
FTP Cluster Size=20
Per-User Version ID=1
Dialogs Version=6
end
item: Set Variable
Variable=APPTITLE
- Value=wxPython 2.1
+ Value=wxPython 2.2
Flags=10000000
end
item: Set Variable
Variable=GROUP
- Value=wxPython 2.1
+ Value=wxPython 2.2
Flags=10000000
end
item: Set Variable
Flags=0000001010000011
end
item: Install File
- Source=c:\projects\wx\lib\wx21_16.dll
- Destination=%SYS%\wx21_16.dll
+ Source=c:\projects\wx\lib\wx22_0.dll
+ Destination=%SYS%\wx22_0.dll
Flags=0000001010010010
end
item: Install File
-ver = '2.1.16'
+ver = '2.2.0'
return list;
}
}
-
- //void AddFile(const wxString &filename);
+#ifdef __WXMSW__
+ void AddFile(const wxString &filename);
+#endif
};
public:
wxCommandEvent(int commandEventType = 0, int id = 0);
- bool Checked();
+ bool IsChecked();
+ %name(Checked)bool IsChecked();
long GetExtraLong();
int GetInt();
int GetSelection();
return _resultobj;
}
-#define wxCommandEvent_Checked(_swigobj) (_swigobj->Checked())
-static PyObject *_wrap_wxCommandEvent_Checked(PyObject *self, PyObject *args, PyObject *kwargs) {
+#define wxCommandEvent_IsChecked(_swigobj) (_swigobj->IsChecked())
+static PyObject *_wrap_wxCommandEvent_IsChecked(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxCommandEvent * _arg0;
char *_kwnames[] = { "self", NULL };
self = self;
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCommandEvent_Checked",_kwnames,&_argo0))
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCommandEvent_IsChecked",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCommandEvent_p")) {
- PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCommandEvent_Checked. Expected _wxCommandEvent_p.");
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCommandEvent_IsChecked. Expected _wxCommandEvent_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
- _result = (bool )wxCommandEvent_Checked(_arg0);
+ _result = (bool )wxCommandEvent_IsChecked(_arg0);
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("i",_result);
{ "wxCommandEvent_GetSelection", (PyCFunction) _wrap_wxCommandEvent_GetSelection, METH_VARARGS | METH_KEYWORDS },
{ "wxCommandEvent_GetInt", (PyCFunction) _wrap_wxCommandEvent_GetInt, METH_VARARGS | METH_KEYWORDS },
{ "wxCommandEvent_GetExtraLong", (PyCFunction) _wrap_wxCommandEvent_GetExtraLong, METH_VARARGS | METH_KEYWORDS },
- { "wxCommandEvent_Checked", (PyCFunction) _wrap_wxCommandEvent_Checked, METH_VARARGS | METH_KEYWORDS },
+ { "wxCommandEvent_Checked", (PyCFunction) _wrap_wxCommandEvent_IsChecked, METH_VARARGS | METH_KEYWORDS },
+ { "wxCommandEvent_IsChecked", (PyCFunction) _wrap_wxCommandEvent_IsChecked, METH_VARARGS | METH_KEYWORDS },
{ "new_wxCommandEvent", (PyCFunction) _wrap_new_wxCommandEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxCloseEvent_SetCanVeto", (PyCFunction) _wrap_wxCloseEvent_SetCanVeto, METH_VARARGS | METH_KEYWORDS },
{ "wxCloseEvent_GetVeto", (PyCFunction) _wrap_wxCloseEvent_GetVeto, METH_VARARGS | METH_KEYWORDS },
def __init__(self,this):
self.this = this
self.thisown = 0
+ def IsChecked(self, *_args, **_kwargs):
+ val = apply(eventsc.wxCommandEvent_IsChecked,(self,) + _args, _kwargs)
+ return val
def Checked(self, *_args, **_kwargs):
val = apply(eventsc.wxCommandEvent_Checked,(self,) + _args, _kwargs)
return val
{ "_wxPrintQuality","_EBool",0},
{ "_wxPrintQuality","_size_t",0},
{ "_class_wxCustomDataObject","_wxCustomDataObject",0},
+ { "_wxSpinCtrl","_class_wxSpinCtrl",0},
{ "_class_wxRegionIterator","_wxRegionIterator",0},
{ "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0},
{ "_class_wxMenuBar","_wxMenuBar",0},
{ "_wxPoint","_class_wxPoint",0},
{ "_class_wxButton","_wxButton",0},
{ "_wxRadioBox","_class_wxRadioBox",0},
+ { "_class_wxSpinCtrl","_wxSpinCtrl",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
{ "_wxWindowDC","_class_wxWindowDC",0},
static PyObject *_wrap_wxPageSetupDialogData_SetPaperId(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPageSetupDialogData * _arg0;
- wxPaperSize * _arg1;
+ wxPaperSize _arg1;
PyObject * _argo0 = 0;
- PyObject * _argo1 = 0;
char *_kwnames[] = { "self","id", NULL };
self = self;
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPageSetupDialogData_SetPaperId",_kwnames,&_argo0,&_argo1))
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxPageSetupDialogData_SetPaperId",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
return NULL;
}
}
- if (_argo1) {
- if (_argo1 == Py_None) { _arg1 = NULL; }
- else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPaperSize_p")) {
- PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPageSetupDialogData_SetPaperId. Expected _wxPaperSize_p.");
- return NULL;
- }
- }
{
wxPy_BEGIN_ALLOW_THREADS;
- wxPageSetupDialogData_SetPaperId(_arg0,*_arg1);
+ wxPageSetupDialogData_SetPaperId(_arg0,_arg1);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
{ "_wxPrintQuality","_EBool",0},
{ "_wxPrintQuality","_size_t",0},
{ "_class_wxCustomDataObject","_wxCustomDataObject",0},
+ { "_wxSpinCtrl","_class_wxSpinCtrl",0},
{ "_wxFontData","_class_wxFontData",0},
{ "_class_wxRegionIterator","_wxRegionIterator",0},
{ "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0},
{ "_wxPoint","_class_wxPoint",0},
{ "_class_wxButton","_wxButton",0},
{ "_wxRadioBox","_class_wxRadioBox",0},
+ { "_class_wxSpinCtrl","_wxSpinCtrl",0},
{ "_class_wxFontData","_wxFontData",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
return _resultobj;
}
+#define wxWindow_CentreOnScreen(_swigobj,_swigarg0) (_swigobj->CentreOnScreen(_swigarg0))
+static PyObject *_wrap_wxWindow_CentreOnScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxWindow * _arg0;
+ int _arg1 = (int ) wxBOTH;
+ PyObject * _argo0 = 0;
+ char *_kwnames[] = { "self","direction", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxWindow_CentreOnScreen",_kwnames,&_argo0,&_arg1))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_CentreOnScreen. Expected _wxWindow_p.");
+ return NULL;
+ }
+ }
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ wxWindow_CentreOnScreen(_arg0,_arg1);
+
+ wxPy_END_ALLOW_THREADS;
+} Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ return _resultobj;
+}
+
+#define wxWindow_CenterOnScreen(_swigobj,_swigarg0) (_swigobj->CenterOnScreen(_swigarg0))
+static PyObject *_wrap_wxWindow_CenterOnScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxWindow * _arg0;
+ int _arg1 = (int ) wxBOTH;
+ PyObject * _argo0 = 0;
+ char *_kwnames[] = { "self","direction", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxWindow_CenterOnScreen",_kwnames,&_argo0,&_arg1))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_CenterOnScreen. Expected _wxWindow_p.");
+ return NULL;
+ }
+ }
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ wxWindow_CenterOnScreen(_arg0,_arg1);
+
+ wxPy_END_ALLOW_THREADS;
+} Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ return _resultobj;
+}
+
#define wxWindow_ClientToScreenXY(_swigobj,_swigarg0,_swigarg1) (_swigobj->ClientToScreen(_swigarg0,_swigarg1))
static PyObject *_wrap_wxWindow_ClientToScreenXY(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
{ "wxWindow_Close", (PyCFunction) _wrap_wxWindow_Close, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_ClientToScreen", (PyCFunction) _wrap_wxWindow_ClientToScreen, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_ClientToScreenXY", (PyCFunction) _wrap_wxWindow_ClientToScreenXY, METH_VARARGS | METH_KEYWORDS },
+ { "wxWindow_CenterOnScreen", (PyCFunction) _wrap_wxWindow_CenterOnScreen, METH_VARARGS | METH_KEYWORDS },
+ { "wxWindow_CentreOnScreen", (PyCFunction) _wrap_wxWindow_CentreOnScreen, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_CenterOnParent", (PyCFunction) _wrap_wxWindow_CenterOnParent, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_CentreOnParent", (PyCFunction) _wrap_wxWindow_CentreOnParent, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_Centre", (PyCFunction) _wrap_wxWindow_Centre, METH_VARARGS | METH_KEYWORDS },
def CenterOnParent(self, *_args, **_kwargs):
val = apply(windowsc.wxWindow_CenterOnParent,(self,) + _args, _kwargs)
return val
+ def CentreOnScreen(self, *_args, **_kwargs):
+ val = apply(windowsc.wxWindow_CentreOnScreen,(self,) + _args, _kwargs)
+ return val
+ def CenterOnScreen(self, *_args, **_kwargs):
+ val = apply(windowsc.wxWindow_CenterOnScreen,(self,) + _args, _kwargs)
+ return val
def ClientToScreenXY(self, *_args, **_kwargs):
val = apply(windowsc.wxWindow_ClientToScreenXY,(self,) + _args, _kwargs)
return val
// TODO: This isn't handled by the standard event-table system...
//wxMDIClientWindow* OnCreateClient();
+
#ifdef __WXMSW__
+ wxMenu* GetWindowMenu();
+ void SetWindowMenu(wxMenu* menu);
void SetToolBar(wxToolBar* toolbar);
#endif
void Tile();
return _resultobj;
}
+#define wxFileDataObject_AddFile(_swigobj,_swigarg0) (_swigobj->AddFile(_swigarg0))
+static PyObject *_wrap_wxFileDataObject_AddFile(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxFileDataObject * _arg0;
+ wxString * _arg1;
+ PyObject * _argo0 = 0;
+ PyObject * _obj1 = 0;
+ char *_kwnames[] = { "self","filename", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxFileDataObject_AddFile",_kwnames,&_argo0,&_obj1))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFileDataObject_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFileDataObject_AddFile. Expected _wxFileDataObject_p.");
+ return NULL;
+ }
+ }
+{
+ if (!PyString_Check(_obj1)) {
+ PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
+ return NULL;
+ }
+ _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1));
+}
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ wxFileDataObject_AddFile(_arg0,*_arg1);
+
+ wxPy_END_ALLOW_THREADS;
+} Py_INCREF(Py_None);
+ _resultobj = Py_None;
+{
+ if (_obj1)
+ delete _arg1;
+}
+ return _resultobj;
+}
+
static void *SwigwxCustomDataObjectTowxDataObjectSimple(void *ptr) {
wxCustomDataObject *src;
wxDataObjectSimple *dest;
{ "wxCustomDataObject_SetData", (PyCFunction) _wrap_wxCustomDataObject_SetData, METH_VARARGS | METH_KEYWORDS },
{ "wxCustomDataObject_TakeData", (PyCFunction) _wrap_wxCustomDataObject_TakeData, METH_VARARGS | METH_KEYWORDS },
{ "new_wxCustomDataObject", (PyCFunction) _wrap_new_wxCustomDataObject, METH_VARARGS | METH_KEYWORDS },
+ { "wxFileDataObject_AddFile", (PyCFunction) _wrap_wxFileDataObject_AddFile, METH_VARARGS | METH_KEYWORDS },
{ "wxFileDataObject_GetFilenames", (PyCFunction) _wrap_wxFileDataObject_GetFilenames, METH_VARARGS | METH_KEYWORDS },
{ "new_wxFileDataObject", (PyCFunction) _wrap_new_wxFileDataObject, METH_VARARGS | METH_KEYWORDS },
{ "wxPyBitmapDataObject__setSelf", (PyCFunction) _wrap_wxPyBitmapDataObject__setSelf, METH_VARARGS | METH_KEYWORDS },
def GetFilenames(self, *_args, **_kwargs):
val = apply(clip_dndc.wxFileDataObject_GetFilenames,(self,) + _args, _kwargs)
return val
+ def AddFile(self, *_args, **_kwargs):
+ val = apply(clip_dndc.wxFileDataObject_AddFile,(self,) + _args, _kwargs)
+ return val
def __repr__(self):
return "<C wxFileDataObject instance at %s>" % (self.this,)
class wxFileDataObject(wxFileDataObjectPtr):
return _resultobj;
}
-#define wxCommandEvent_Checked(_swigobj) (_swigobj->Checked())
-static PyObject *_wrap_wxCommandEvent_Checked(PyObject *self, PyObject *args, PyObject *kwargs) {
+#define wxCommandEvent_IsChecked(_swigobj) (_swigobj->IsChecked())
+static PyObject *_wrap_wxCommandEvent_IsChecked(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxCommandEvent * _arg0;
char *_kwnames[] = { "self", NULL };
self = self;
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCommandEvent_Checked",_kwnames,&_argo0))
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCommandEvent_IsChecked",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCommandEvent_p")) {
- PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCommandEvent_Checked. Expected _wxCommandEvent_p.");
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCommandEvent_IsChecked. Expected _wxCommandEvent_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
- _result = (bool )wxCommandEvent_Checked(_arg0);
+ _result = (bool )wxCommandEvent_IsChecked(_arg0);
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("i",_result);
{ "wxCommandEvent_GetSelection", (PyCFunction) _wrap_wxCommandEvent_GetSelection, METH_VARARGS | METH_KEYWORDS },
{ "wxCommandEvent_GetInt", (PyCFunction) _wrap_wxCommandEvent_GetInt, METH_VARARGS | METH_KEYWORDS },
{ "wxCommandEvent_GetExtraLong", (PyCFunction) _wrap_wxCommandEvent_GetExtraLong, METH_VARARGS | METH_KEYWORDS },
- { "wxCommandEvent_Checked", (PyCFunction) _wrap_wxCommandEvent_Checked, METH_VARARGS | METH_KEYWORDS },
+ { "wxCommandEvent_Checked", (PyCFunction) _wrap_wxCommandEvent_IsChecked, METH_VARARGS | METH_KEYWORDS },
+ { "wxCommandEvent_IsChecked", (PyCFunction) _wrap_wxCommandEvent_IsChecked, METH_VARARGS | METH_KEYWORDS },
{ "new_wxCommandEvent", (PyCFunction) _wrap_new_wxCommandEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxCloseEvent_SetCanVeto", (PyCFunction) _wrap_wxCloseEvent_SetCanVeto, METH_VARARGS | METH_KEYWORDS },
{ "wxCloseEvent_GetVeto", (PyCFunction) _wrap_wxCloseEvent_GetVeto, METH_VARARGS | METH_KEYWORDS },
def __init__(self,this):
self.this = this
self.thisown = 0
+ def IsChecked(self, *_args, **_kwargs):
+ val = apply(eventsc.wxCommandEvent_IsChecked,(self,) + _args, _kwargs)
+ return val
def Checked(self, *_args, **_kwargs):
val = apply(eventsc.wxCommandEvent_Checked,(self,) + _args, _kwargs)
return val
return _resultobj;
}
+#define wxMDIParentFrame_GetWindowMenu(_swigobj) (_swigobj->GetWindowMenu())
+static PyObject *_wrap_wxMDIParentFrame_GetWindowMenu(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxMenu * _result;
+ wxMDIParentFrame * _arg0;
+ PyObject * _argo0 = 0;
+ char *_kwnames[] = { "self", NULL };
+ char _ptemp[128];
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMDIParentFrame_GetWindowMenu",_kwnames,&_argo0))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMDIParentFrame_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMDIParentFrame_GetWindowMenu. Expected _wxMDIParentFrame_p.");
+ return NULL;
+ }
+ }
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ _result = (wxMenu *)wxMDIParentFrame_GetWindowMenu(_arg0);
+
+ wxPy_END_ALLOW_THREADS;
+} if (_result) {
+ SWIG_MakePtr(_ptemp, (char *) _result,"_wxMenu_p");
+ _resultobj = Py_BuildValue("s",_ptemp);
+ } else {
+ Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ }
+ return _resultobj;
+}
+
+#define wxMDIParentFrame_SetWindowMenu(_swigobj,_swigarg0) (_swigobj->SetWindowMenu(_swigarg0))
+static PyObject *_wrap_wxMDIParentFrame_SetWindowMenu(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxMDIParentFrame * _arg0;
+ wxMenu * _arg1;
+ PyObject * _argo0 = 0;
+ PyObject * _argo1 = 0;
+ char *_kwnames[] = { "self","menu", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxMDIParentFrame_SetWindowMenu",_kwnames,&_argo0,&_argo1))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMDIParentFrame_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMDIParentFrame_SetWindowMenu. Expected _wxMDIParentFrame_p.");
+ return NULL;
+ }
+ }
+ if (_argo1) {
+ if (_argo1 == Py_None) { _arg1 = NULL; }
+ else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxMenu_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxMDIParentFrame_SetWindowMenu. Expected _wxMenu_p.");
+ return NULL;
+ }
+ }
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ wxMDIParentFrame_SetWindowMenu(_arg0,_arg1);
+
+ wxPy_END_ALLOW_THREADS;
+} Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ return _resultobj;
+}
+
#define wxMDIParentFrame_SetToolBar(_swigobj,_swigarg0) (_swigobj->SetToolBar(_swigarg0))
static PyObject *_wrap_wxMDIParentFrame_SetToolBar(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
{ "new_wxMDIChildFrame", (PyCFunction) _wrap_new_wxMDIChildFrame, METH_VARARGS | METH_KEYWORDS },
{ "wxMDIParentFrame_Tile", (PyCFunction) _wrap_wxMDIParentFrame_Tile, METH_VARARGS | METH_KEYWORDS },
{ "wxMDIParentFrame_SetToolBar", (PyCFunction) _wrap_wxMDIParentFrame_SetToolBar, METH_VARARGS | METH_KEYWORDS },
+ { "wxMDIParentFrame_SetWindowMenu", (PyCFunction) _wrap_wxMDIParentFrame_SetWindowMenu, METH_VARARGS | METH_KEYWORDS },
+ { "wxMDIParentFrame_GetWindowMenu", (PyCFunction) _wrap_wxMDIParentFrame_GetWindowMenu, METH_VARARGS | METH_KEYWORDS },
{ "wxMDIParentFrame_GetToolBar", (PyCFunction) _wrap_wxMDIParentFrame_GetToolBar, METH_VARARGS | METH_KEYWORDS },
{ "wxMDIParentFrame_GetClientWindow", (PyCFunction) _wrap_wxMDIParentFrame_GetClientWindow, METH_VARARGS | METH_KEYWORDS },
{ "wxMDIParentFrame_GetActiveChild", (PyCFunction) _wrap_wxMDIParentFrame_GetActiveChild, METH_VARARGS | METH_KEYWORDS },
val = apply(mdic.wxMDIParentFrame_GetToolBar,(self,) + _args, _kwargs)
if val: val = wxWindowPtr(val)
return val
+ def GetWindowMenu(self, *_args, **_kwargs):
+ val = apply(mdic.wxMDIParentFrame_GetWindowMenu,(self,) + _args, _kwargs)
+ if val: val = wxMenuPtr(val)
+ return val
+ def SetWindowMenu(self, *_args, **_kwargs):
+ val = apply(mdic.wxMDIParentFrame_SetWindowMenu,(self,) + _args, _kwargs)
+ return val
def SetToolBar(self, *_args, **_kwargs):
val = apply(mdic.wxMDIParentFrame_SetToolBar,(self,) + _args, _kwargs)
return val
static PyObject *_wrap_wxPageSetupDialogData_SetPaperId(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPageSetupDialogData * _arg0;
- wxPaperSize * _arg1;
+ wxPaperSize _arg1;
PyObject * _argo0 = 0;
- PyObject * _argo1 = 0;
char *_kwnames[] = { "self","id", NULL };
self = self;
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPageSetupDialogData_SetPaperId",_kwnames,&_argo0,&_argo1))
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxPageSetupDialogData_SetPaperId",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
return NULL;
}
}
- if (_argo1) {
- if (_argo1 == Py_None) { _arg1 = NULL; }
- else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPaperSize_p")) {
- PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPageSetupDialogData_SetPaperId. Expected _wxPaperSize_p.");
- return NULL;
- }
- }
{
wxPy_BEGIN_ALLOW_THREADS;
- wxPageSetupDialogData_SetPaperId(_arg0,*_arg1);
+ wxPageSetupDialogData_SetPaperId(_arg0,_arg1);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
return _resultobj;
}
+#define wxWindow_CentreOnScreen(_swigobj,_swigarg0) (_swigobj->CentreOnScreen(_swigarg0))
+static PyObject *_wrap_wxWindow_CentreOnScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxWindow * _arg0;
+ int _arg1 = (int ) wxBOTH;
+ PyObject * _argo0 = 0;
+ char *_kwnames[] = { "self","direction", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxWindow_CentreOnScreen",_kwnames,&_argo0,&_arg1))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_CentreOnScreen. Expected _wxWindow_p.");
+ return NULL;
+ }
+ }
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ wxWindow_CentreOnScreen(_arg0,_arg1);
+
+ wxPy_END_ALLOW_THREADS;
+} Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ return _resultobj;
+}
+
+#define wxWindow_CenterOnScreen(_swigobj,_swigarg0) (_swigobj->CenterOnScreen(_swigarg0))
+static PyObject *_wrap_wxWindow_CenterOnScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxWindow * _arg0;
+ int _arg1 = (int ) wxBOTH;
+ PyObject * _argo0 = 0;
+ char *_kwnames[] = { "self","direction", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxWindow_CenterOnScreen",_kwnames,&_argo0,&_arg1))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_CenterOnScreen. Expected _wxWindow_p.");
+ return NULL;
+ }
+ }
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ wxWindow_CenterOnScreen(_arg0,_arg1);
+
+ wxPy_END_ALLOW_THREADS;
+} Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ return _resultobj;
+}
+
#define wxWindow_ClientToScreenXY(_swigobj,_swigarg0,_swigarg1) (_swigobj->ClientToScreen(_swigarg0,_swigarg1))
static PyObject *_wrap_wxWindow_ClientToScreenXY(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
{ "wxWindow_Close", (PyCFunction) _wrap_wxWindow_Close, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_ClientToScreen", (PyCFunction) _wrap_wxWindow_ClientToScreen, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_ClientToScreenXY", (PyCFunction) _wrap_wxWindow_ClientToScreenXY, METH_VARARGS | METH_KEYWORDS },
+ { "wxWindow_CenterOnScreen", (PyCFunction) _wrap_wxWindow_CenterOnScreen, METH_VARARGS | METH_KEYWORDS },
+ { "wxWindow_CentreOnScreen", (PyCFunction) _wrap_wxWindow_CentreOnScreen, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_CenterOnParent", (PyCFunction) _wrap_wxWindow_CenterOnParent, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_CentreOnParent", (PyCFunction) _wrap_wxWindow_CentreOnParent, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_Centre", (PyCFunction) _wrap_wxWindow_Centre, METH_VARARGS | METH_KEYWORDS },
def CenterOnParent(self, *_args, **_kwargs):
val = apply(windowsc.wxWindow_CenterOnParent,(self,) + _args, _kwargs)
return val
+ def CentreOnScreen(self, *_args, **_kwargs):
+ val = apply(windowsc.wxWindow_CentreOnScreen,(self,) + _args, _kwargs)
+ return val
+ def CenterOnScreen(self, *_args, **_kwargs):
+ val = apply(windowsc.wxWindow_CenterOnScreen,(self,) + _args, _kwargs)
+ return val
def ClientToScreenXY(self, *_args, **_kwargs):
val = apply(windowsc.wxWindow_ClientToScreenXY,(self,) + _args, _kwargs)
return val
void SetMarginBottomRight(const wxPoint& pt);
void SetMinMarginTopLeft(const wxPoint& pt);
void SetMinMarginBottomRight(const wxPoint& pt);
- void SetPaperId(wxPaperSize& id);
+ void SetPaperId(wxPaperSize id);
void SetPaperSize(const wxSize& size);
void SetPrintData(const wxPrintData& printData);
};
void Centre(int direction = wxBOTH);
void CentreOnParent(int direction = wxBOTH );
void CenterOnParent(int direction = wxBOTH );
+ void CentreOnScreen(int direction = wxBOTH );
+ void CenterOnScreen(int direction = wxBOTH );
// (uses apply'ed INOUT typemap, see above)
%name(ClientToScreenXY)void ClientToScreen(int* x, int* y);
IDLE and PythonWin.
There is still much to be done to improve this class, such as line
-buffering/recall, autoindent, calltips, autocomplete, etc... But
-it's a good start.
+buffering/recall, autoindent, calltips, autocomplete, fixing the colourizer,
+etc... But it's a good start.
"""
# Event handlers
EVT_KEY_DOWN(self, self.OnKey)
EVT_STC_UPDATEUI(self, ID, self.OnUpdateUI)
- EVT_STC_STYLENEEDED(self, ID, self.OnStyle)
+ #EVT_STC_STYLENEEDED(self, ID, self.OnStyle)
def GetLocals(self): return self.locals
"""
p = self.props
- self.SetEdgeMode(wxSTC_EDGE_LINE)
- self.SetEdgeColumn(80)
+ #self.SetEdgeMode(wxSTC_EDGE_LINE)
+ #self.SetEdgeColumn(80)
# set the selection margin and window margin