1. wxBase compiles under BeOS
2. several bugs corrected in wxTextCtrl::Load/SaveFile (wxMSW) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5068 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
e17e2b7c1d
commit
b12915c104
230
configure.in
230
configure.in
@ -429,6 +429,8 @@ dnl ------------------------------------------------------------------------
|
||||
dnl assume Unix
|
||||
USE_UNIX=1
|
||||
USE_WIN32=0
|
||||
USE_BEOS=0
|
||||
|
||||
USE_LINUX=
|
||||
USE_SGI=
|
||||
USE_HPUX=
|
||||
@ -471,6 +473,10 @@ DEFAULT_DEFAULT_wxUSE_MOTIF=0
|
||||
DEFAULT_DEFAULT_wxUSE_MSW=0
|
||||
DEFAULT_DEFAULT_wxUSE_WINE=0
|
||||
|
||||
dnl to support a new system, you need to add its canonical name (as determined
|
||||
dnl by config.sub or specified by the configure command line) to this "case"
|
||||
dnl and also define the shared library flags below - search for
|
||||
dnl SHARED_LIB_SETUP to find the exact place
|
||||
case "${host}" in
|
||||
*-hp-hpux* )
|
||||
USE_HPUX=1
|
||||
@ -568,15 +574,27 @@ case "${host}" in
|
||||
AC_DEFINE(__EMX__)
|
||||
;;
|
||||
|
||||
*-*-beos* )
|
||||
dnl leave USE_UNIX on - BeOS is sufficiently Unix-like for this
|
||||
USE_BEOS=1
|
||||
AC_DEFINE(__BEOS__)
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_ERROR(unknown system type ${host}.)
|
||||
esac
|
||||
|
||||
if test "$USE_UNIX" = 1 ; then
|
||||
wxUSE_UNIX=yes
|
||||
AC_DEFINE(__UNIX__)
|
||||
SRC_SUBDIRS="$SRC_SUBDIRS unix"
|
||||
INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS unix"
|
||||
wxUSE_UNIX=yes
|
||||
AC_DEFINE(__UNIX__)
|
||||
|
||||
SRC_SUBDIRS="$SRC_SUBDIRS unix"
|
||||
INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS unix"
|
||||
fi
|
||||
|
||||
if test "$USE_BEOS" = 1; then
|
||||
SRC_SUBDIRS="$SRC_SUBDIRS be"
|
||||
INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS be"
|
||||
fi
|
||||
|
||||
dnl Linux: test for libc5/glibc2: glibc2 has gettext() included
|
||||
@ -862,79 +880,7 @@ dnl ---------------------------------------------------------------------------
|
||||
|
||||
WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI)
|
||||
|
||||
dnl disable everything GUI related then
|
||||
if test "$wxUSE_GUI" = "no"; then
|
||||
DEFAULT_wxUSE_ZLIB=no
|
||||
DEFAULT_wxUSE_LIBPNG=no
|
||||
DEFAULT_wxUSE_LIBJPEG=no
|
||||
DEFAULT_wxUSE_LIBTIFF=no
|
||||
DEFAULT_wxUSE_SOCKETS=no
|
||||
DEFAULT_wxUSE_JOYSTICK=no
|
||||
DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=no
|
||||
DEFAULT_wxUSE_NORMALIZED_PS_FONTS=no
|
||||
DEFAULT_wxUSE_POSTSCRIPT=no
|
||||
DEFAULT_wxUSE_X_RESOURCES=no
|
||||
DEFAULT_wxUSE_CLIPBOARD=no
|
||||
DEFAULT_wxUSE_TOOLTIPS=no
|
||||
DEFAULT_wxUSE_DRAG_AND_DROP=no
|
||||
DEFAULT_wxUSE_SPLINES=no
|
||||
DEFAULT_wxUSE_MDI_ARCHITECTURE=no
|
||||
DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no
|
||||
DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no
|
||||
DEFAULT_wxUSE_PROLOGIO=no
|
||||
DEFAULT_wxUSE_RESOURCES=no
|
||||
DEFAULT_wxUSE_CONSTRAINTS=no
|
||||
DEFAULT_wxUSE_IPC=no
|
||||
DEFAULT_wxUSE_HELP=no
|
||||
DEFAULT_wxUSE_WXTREE=no
|
||||
DEFAULT_wxUSE_METAFILE=no
|
||||
DEFAULT_wxUSE_COMMONDLGS=no
|
||||
DEFAULT_wxUSE_DIRDLG=no
|
||||
DEFAULT_wxUSE_TEXTDLG=no
|
||||
DEFAULT_wxUSE_STARTUP_TIPS=no
|
||||
DEFAULT_wxUSE_PROGRESSDLG=no
|
||||
DEFAULT_wxUSE_MINIFRAME=no
|
||||
DEFAULT_wxUSE_HTML=no
|
||||
DEFAULT_wxUSE_FS_INET=no
|
||||
DEFAULT_wxUSE_FS_ZIP=no
|
||||
DEFAULT_wxUSE_BUSYINFO=no
|
||||
DEFAULT_wxUSE_ZIPSTREAM=no
|
||||
DEFAULT_wxUSE_VALIDATORS=no
|
||||
DEFAULT_wxUSE_ACCEL=no
|
||||
DEFAULT_wxUSE_CARET=no
|
||||
DEFAULT_wxUSE_BMPBUTTON=no
|
||||
DEFAULT_wxUSE_CHECKBOX=no
|
||||
DEFAULT_wxUSE_CHECKLST=no
|
||||
DEFAULT_wxUSE_CHOICE=no
|
||||
DEFAULT_wxUSE_COMBOBOX=no
|
||||
DEFAULT_wxUSE_GAUGE=no
|
||||
DEFAULT_wxUSE_GRID=no
|
||||
DEFAULT_wxUSE_NEW_GRID=no
|
||||
DEFAULT_wxUSE_IMAGLIST=no
|
||||
DEFAULT_wxUSE_LISTBOX=no
|
||||
DEFAULT_wxUSE_LISTCTRL=no
|
||||
DEFAULT_wxUSE_NOTEBOOK=no
|
||||
DEFAULT_wxUSE_RADIOBOX=no
|
||||
DEFAULT_wxUSE_RADIOBTN=no
|
||||
DEFAULT_wxUSE_SASH=no
|
||||
DEFAULT_wxUSE_SCROLLBAR=no
|
||||
DEFAULT_wxUSE_SLIDER=no
|
||||
DEFAULT_wxUSE_SPINBTN=no
|
||||
DEFAULT_wxUSE_SPINCTRL=no
|
||||
DEFAULT_wxUSE_SPLITTER=no
|
||||
DEFAULT_wxUSE_STATBMP=no
|
||||
DEFAULT_wxUSE_STATBOX=no
|
||||
DEFAULT_wxUSE_STATLINE=no
|
||||
DEFAULT_wxUSE_STATUSBAR=no
|
||||
DEFAULT_wxUSE_TABDIALOG=no
|
||||
DEFAULT_wxUSE_TOOLBAR=no
|
||||
DEFAULT_wxUSE_TOOLBAR_NATIVE=no
|
||||
DEFAULT_wxUSE_TOOLBAR_SIMPLE=no
|
||||
DEFAULT_wxUSE_TREECTRL=no
|
||||
DEFAULT_wxUSE_GIF=no
|
||||
DEFAULT_wxUSE_PCX=no
|
||||
DEFAULT_wxUSE_PNM=no
|
||||
fi
|
||||
if test "$wxUSE_GUI" = "yes"; then
|
||||
|
||||
AC_ARG_WITH(gtk, [ --with-gtk use GTK+], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1])
|
||||
AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
|
||||
@ -947,12 +893,16 @@ AC_ARG_WITH(gtk-prefix, [ --with-gtk-prefix=PFX Prefix where GTK is instal
|
||||
AC_ARG_WITH(gtk-exec-prefix, [ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed],
|
||||
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
|
||||
|
||||
WX_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (www.letters.com/dmalloc)], wxUSE_DMALLOC)
|
||||
WX_ARG_WITH(zlib, [ --with-zlib use zlib for LZW compression], wxUSE_ZLIB)
|
||||
WX_ARG_WITH(libpng, [ --with-libpng use libpng (PNG image format)], wxUSE_LIBPNG)
|
||||
WX_ARG_WITH(libjpeg, [ --with-libjpeg use libjpeg (JPEG file format)], wxUSE_LIBJPEG)
|
||||
WX_ARG_WITH(libtiff, [ --with-libtiff use libtiff (TIFF file format)], wxUSE_LIBTIFF)
|
||||
WX_ARG_WITH(opengl, [ --with-opengl use OpenGL (or Mesa)], wxUSE_OPENGL)
|
||||
|
||||
fi
|
||||
dnl for GUI only
|
||||
|
||||
WX_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (www.letters.com/dmalloc)], wxUSE_DMALLOC)
|
||||
WX_ARG_WITH(zlib, [ --with-zlib use zlib for LZW compression], wxUSE_ZLIB)
|
||||
WX_ARG_WITH(odbc, [ --with-odbc use the IODBC and wxODBC classes], wxUSE_ODBC)
|
||||
|
||||
dnl ====================
|
||||
@ -992,7 +942,14 @@ dnl ---------------------------------------------------------------------------
|
||||
|
||||
WX_ARG_ENABLE(intl, [ --enable-intl use internationalization system], wxUSE_INTL)
|
||||
WX_ARG_ENABLE(config, [ --enable-config use wxConfig (and derived) classes], wxUSE_CONFIG)
|
||||
|
||||
dnl can't use sockets without GUI so far
|
||||
if test "$wxUSE_GUI" = "yes"; then
|
||||
WX_ARG_ENABLE(sockets, [ --enable-sockets use socket/network classes], wxUSE_SOCKETS)
|
||||
else
|
||||
wxUSE_SOCKETS=no
|
||||
fi
|
||||
|
||||
WX_ARG_ENABLE(dialupman, [ --enable-dialupman use dialup network classes], wxUSE_DIALUP_MANAGER)
|
||||
WX_ARG_ENABLE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC)
|
||||
WX_ARG_ENABLE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], wxUSE_APPLE_IEEE)
|
||||
@ -1021,6 +978,8 @@ dnl ---------------------------------------------------------------------------
|
||||
WX_ARG_ENABLE(threads, [ --enable-threads use threads], wxUSE_THREADS)
|
||||
WX_ARG_ENABLE(serial, [ --enable-serial use class serialization], wxUSE_SERIAL)
|
||||
|
||||
if test "$wxUSE_GUI" = "yes"; then
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl "big" GUI options
|
||||
dnl ---------------------------------------------------------------------------
|
||||
@ -1191,6 +1150,9 @@ WX_ARG_ENABLE(gif, [ --enable-gif use gif images (GIF file f
|
||||
WX_ARG_ENABLE(pcx, [ --enable-pcx use pcx images (PCX file format)], wxUSE_PCX)
|
||||
WX_ARG_ENABLE(pnm, [ --enable-pnm use pnm images (PNM file format)], wxUSE_PNM)
|
||||
|
||||
fi
|
||||
dnl for GUI only
|
||||
|
||||
dnl cache the options values before (may be) aborting below
|
||||
WX_ARG_CACHE_FLUSH
|
||||
|
||||
@ -1201,6 +1163,10 @@ AC_MSG_CHECKING(for toolkit)
|
||||
|
||||
if test "$wxUSE_GUI" = "yes"; then
|
||||
|
||||
if test "$USE_BEOS" = 1; then
|
||||
AC_MSG_ERROR([BeOS GUI is not supported yet, use --disable-gui])
|
||||
fi
|
||||
|
||||
if test "$TOOLKIT_GIVEN" = 1; then
|
||||
dnl convert "yes" to 1 and "no" to 0
|
||||
for toolkit in `echo $ALL_TOOLKITS`; do
|
||||
@ -1753,6 +1719,8 @@ WX_ALL=
|
||||
WX_ALL_INSTALLED=
|
||||
BURNT_LIBRARY_NAME=
|
||||
|
||||
dnl --- the marker for quick search, leave it here: SHARED_LIB_SETUP ---
|
||||
|
||||
if test "$wxUSE_SHARED" = "yes"; then
|
||||
case "${host}" in
|
||||
*-hp-hpux* )
|
||||
@ -1766,12 +1734,14 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
WX_LIBRARY_NAME_SHARED="libwx_${TOOLKIT_DIR}.sl"
|
||||
WX_ALL=${WX_LIBRARY_NAME_SHARED}
|
||||
;;
|
||||
|
||||
dnl in fact, these settings are for any platform using gcc
|
||||
*-*-linux* )
|
||||
SHARED_LD="${CC} -shared -o"
|
||||
PIC_FLAG="-fPIC"
|
||||
WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS"
|
||||
WX_ALL="CREATE_LINKS"
|
||||
dnl BURNT_LIBRARY_NAME="-Wl,-soname -Wl,${WX_LIBRARY_NAME_SHARED}"
|
||||
dnl BURNT_LIBRARY_NAME="-Wl,-soname -Wl,${WX_LIBRARY_NAME_SHARED}"
|
||||
;;
|
||||
*-*-irix5* | *-*-irix6* )
|
||||
if test "$GCC" = yes ; then
|
||||
@ -1833,13 +1803,21 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
|
||||
WX_ALL="${WX_LIBRARY_NAME_STATIC}"
|
||||
;;
|
||||
*-*-mingw32* )
|
||||
*-*-mingw32* )
|
||||
dnl only static for now
|
||||
WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
|
||||
WX_ALL="${WX_LIBRARY_NAME_STATIC}"
|
||||
;;
|
||||
*-pc-os2_emx )
|
||||
;;
|
||||
*-*-beos* )
|
||||
dnl can't use gcc under BeOS for shared library creation because it
|
||||
dnl complains about missing 'main'
|
||||
SHARED_LD="${LD} -shared -o"
|
||||
PIC_FLAG="-fPIC"
|
||||
WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS"
|
||||
WX_ALL="CREATE_LINKS"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR(unknown system type ${host}.)
|
||||
esac
|
||||
@ -1893,6 +1871,26 @@ dnl ---------------------------------------------------------------------------
|
||||
dnl Checks for structures
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
dnl does passwd struct has the pw_gecos field?
|
||||
AC_CACHE_CHECK([for pw_gecos in struct passwd], wx_cv_struct_pw_gecos,
|
||||
[
|
||||
AC_TRY_COMPILE([#include <pwd.h>],
|
||||
[
|
||||
char *p;
|
||||
struct passwd *pw;
|
||||
p = pw->pw_gecos;
|
||||
],
|
||||
[
|
||||
wx_cv_struct_pw_gecos=yes
|
||||
AC_DEFINE(HAVE_PW_GECOS)
|
||||
],
|
||||
[
|
||||
wx_cv_struct_pw_gecos=no
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Checks for compiler characteristics
|
||||
dnl ---------------------------------------------------------------------------
|
||||
@ -1996,17 +1994,33 @@ AC_CHECK_FUNCS(vfork)
|
||||
dnl check for timegm() used by datetime.cpp
|
||||
AC_CHECK_FUNCS(timegm)
|
||||
|
||||
POSIX4_LINK=
|
||||
AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP), [
|
||||
AC_CHECK_LIB(posix4, nanosleep, [
|
||||
AC_DEFINE(HAVE_NANOSLEEP)
|
||||
POSIX4_LINK="-lposix4"
|
||||
], [
|
||||
AC_CHECK_FUNCS(usleep,
|
||||
AC_DEFINE(HAVE_USLEEP),
|
||||
AC_MSG_WARN([wxSleep() function will not work]))
|
||||
])
|
||||
])
|
||||
HAVE_SOME_SLEEP_FUNC=0
|
||||
if test "$USE_BEOS" = 1; then
|
||||
dnl BeOS has its own (wonder where did they get it from) sleep() function
|
||||
dnl in unistd.h
|
||||
AC_DEFINE(HAVE_SLEEP)
|
||||
HAVE_SOME_SLEEP_FUNC=1
|
||||
fi
|
||||
|
||||
if test "$HAVE_SOME_SLEEP_FUNC" != 1; then
|
||||
dnl try nanosleep() in libc and libposix4, if this fails - usleep()
|
||||
POSIX4_LINK=
|
||||
AC_CHECK_FUNCS(nanosleep,
|
||||
AC_DEFINE(HAVE_NANOSLEEP),
|
||||
[
|
||||
AC_CHECK_LIB(posix4, nanosleep,
|
||||
[
|
||||
AC_DEFINE(HAVE_NANOSLEEP)
|
||||
POSIX4_LINK="-lposix4"
|
||||
],
|
||||
[
|
||||
AC_CHECK_FUNCS(usleep)
|
||||
AC_MSG_WARN([wxSleep() function will not work])
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
fi
|
||||
|
||||
dnl check for uname (POSIX) and gethostname (BSD)
|
||||
AC_CHECK_FUNCS(uname gethostname, break)
|
||||
@ -2069,6 +2083,9 @@ if test "$wxUSE_THREADS" = "yes" ; then
|
||||
if test "$wxUSE_WINE" = 1 ; then
|
||||
AC_MSG_WARN([Threads are not supported under WINE])
|
||||
wxUSE_THREADS="no"
|
||||
elif test "$USE_BEOS" = 1; then
|
||||
AC_MSG_WARN([BeOS threads are not yet supported])
|
||||
wxUSE_THREADS="no"
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -2177,7 +2194,7 @@ if test "$wxUSE_THREADS" = "yes"; then
|
||||
|
||||
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
|
||||
else
|
||||
dnl on some systems, _REENTRANT should bedefined if we want to use any _r()
|
||||
dnl on some systems, _REENTRANT should be defined if we want to use any _r()
|
||||
dnl functions - add tests for other functions here as well
|
||||
if test "$ac_cv_func_strtok_r" = "yes"; then
|
||||
AC_MSG_CHECKING(if -D_REENTRANT is needed)
|
||||
@ -2428,10 +2445,6 @@ if test "$wxUSE_STREAMS" = "yes" ; then
|
||||
AC_DEFINE(wxUSE_STREAMS)
|
||||
fi
|
||||
|
||||
if test "$wxUSE_SERIAL" = "yes" ; then
|
||||
AC_DEFINE(wxUSE_SERIAL)
|
||||
fi
|
||||
|
||||
dnl ------------------------------------------------------------------------
|
||||
dnl time/date functions
|
||||
dnl ------------------------------------------------------------------------
|
||||
@ -2650,18 +2663,20 @@ if test "$wxUSE_DYNLIB_CLASS" = "yes"; then
|
||||
if test "$HAVE_DL_FUNCS" = 0; then
|
||||
if test "$HAVE_SHL_FUNCS" = 0; then
|
||||
if test "$USE_UNIX" = 1; then
|
||||
AC_MSG_WARN("--with-dynlib and --with-odbc will be disabled due to missing shared library support")
|
||||
wxUSE_ODBC=no
|
||||
AC_MSG_WARN([Missing dynamic loading support, several features will be disabled])
|
||||
wxUSE_DYNLIB_CLASS=no
|
||||
else
|
||||
AC_MSG_WARN("Cannot check dynlib requirements on non-Unix platforms. dynlib remains enabled.")
|
||||
AC_MSG_WARN([Assuming wxLibrary class works on this platform])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$wxUSE_DYNLIB_CLASS" = "yes" ; then
|
||||
AC_DEFINE(wxUSE_DYNLIB_CLASS)
|
||||
AC_DEFINE(wxUSE_DYNLIB_CLASS)
|
||||
else
|
||||
wxUSE_ODBC=no
|
||||
wxUSE_SERIAL=no
|
||||
fi
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
@ -2680,6 +2695,14 @@ if test "$wxUSE_wxUSE_EXPERIMENTAL_PRINTF" = "yes"; then
|
||||
AC_DEFINE(wxUSE_EXPERIMENTAL_PRINTF)
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------
|
||||
dnl serialization support
|
||||
dnl ----------------------------------------------------------------
|
||||
|
||||
if test "$wxUSE_SERIAL" = "yes" ; then
|
||||
AC_DEFINE(wxUSE_SERIAL)
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------
|
||||
dnl iODBC support
|
||||
dnl ----------------------------------------------------------------
|
||||
@ -3099,8 +3122,12 @@ if test "$wxUSE_GUI" = "yes"; then
|
||||
dnl mfc, nativdlg, oleauto, ownerdrw, proplist
|
||||
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS bombs controls dialogs drawing dynamic \
|
||||
font forty fractal image minimal richedit wxpoem"
|
||||
|
||||
dnl this is needed to be able to find AFM files
|
||||
EXTRADEFS="-DwxINSTALL_PREFIX=\"$prefix\""
|
||||
else
|
||||
SAMPLES_SUBDIRS=""
|
||||
EXTRADEFS=
|
||||
fi
|
||||
|
||||
dnl for convenience, sort the samples in alphabetical order
|
||||
@ -3168,6 +3195,7 @@ AC_SUBST(USER_SUBDIRS)
|
||||
dnl additional libraries and linker settings
|
||||
AC_SUBST(LDFLAGS)
|
||||
AC_SUBST(EXTRA_LIBS)
|
||||
AC_SUBST(EXTRADEFS)
|
||||
AC_SUBST(LIBS)
|
||||
AC_SUBST(LD_LIBS)
|
||||
|
||||
|
@ -7,6 +7,7 @@ next release (2.1.12 or 2.2?)
|
||||
wxBase:
|
||||
|
||||
- it is now possible to build wxBase under Win32 (using VC++ only so far)
|
||||
and BeOS (without thread support yet)
|
||||
|
||||
- wxThread class modified to support both detached and joinable threads, also
|
||||
added new GetCPUCount() and SetConcurrency() functions (useful under Solaris
|
||||
@ -40,6 +41,7 @@ wxMSW:
|
||||
- implemented setting colours for push buttons
|
||||
- wxTreeCtrl::IsVisible() bug fixed (thanks to Gary Chessun)
|
||||
- tooltips work with wxRadioBox
|
||||
- loading/saving big (> 32K) files in wxTextCtrl works
|
||||
- returning FALSE from OnPrintPage() aborts printing
|
||||
|
||||
wxGTK:
|
||||
|
@ -16,21 +16,16 @@
|
||||
#pragma interface "defs.h"
|
||||
#endif
|
||||
|
||||
|
||||
// needed to handle strings with xgettext:
|
||||
#ifndef gettext_noop
|
||||
# define gettext_noop(x) x
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// compiler and OS identification
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// OS
|
||||
// OS: first test for generic Unix defines, then for particular flavours and
|
||||
// finally for Unix-like systems
|
||||
#if defined(__unix) || defined(__unix__) || defined(____SVR4____) || \
|
||||
defined(__LINUX__) || defined(__sgi ) || \
|
||||
defined(__LINUX__) || defined(__sgi) || \
|
||||
defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) || \
|
||||
defined(__EMX__) || defined( __VMS )
|
||||
defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
|
||||
|
||||
#define __UNIX_LIKE__
|
||||
|
||||
@ -224,7 +219,7 @@
|
||||
#define __HPUX__
|
||||
#endif // HP-UX
|
||||
|
||||
// if we're on a Unixsystem but didn't use configure (so that setup.h didn't
|
||||
// if we're on a Unix system but didn't use configure (so that setup.h didn't
|
||||
// define __UNIX__), do define __UNIX__ now
|
||||
#if !defined(__UNIX__) && defined(__UNIX_LIKE__)
|
||||
#define __UNIX__
|
||||
@ -497,32 +492,32 @@ typedef void (*wxFunction) (wxObject&, wxEvent&);
|
||||
// Not all platforms are currently available or supported
|
||||
enum
|
||||
{
|
||||
wxUNKNOWN_PLATFORM,
|
||||
wxCURSES, // Text-only CURSES
|
||||
wxXVIEW_X, // Sun's XView OpenLOOK toolkit
|
||||
wxMOTIF_X, // OSF Motif 1.x.x
|
||||
wxCOSE_X, // OSF Common Desktop Environment
|
||||
wxNEXTSTEP, // NeXTStep
|
||||
wxMACINTOSH, // Apple System 7 and 8
|
||||
wxBEOS, // BeOS
|
||||
wxGTK, // GTK on X
|
||||
wxGTK_WIN32, // GTK on Win32
|
||||
wxGTK_OS2, // GTK on OS/2
|
||||
wxGTK_BEOS, // GTK on BeOS
|
||||
wxQT, // Qt
|
||||
wxGEOS, // GEOS
|
||||
wxOS2_PM, // OS/2 Workplace
|
||||
wxWINDOWS, // Windows or WfW
|
||||
wxPENWINDOWS, // Windows for Pen Computing
|
||||
wxWINDOWS_NT, // Windows NT
|
||||
wxWIN32S, // Windows 32S API
|
||||
wxWIN95, // Windows 95
|
||||
wxWIN386, // Watcom 32-bit supervisor modus
|
||||
wxMGL_UNIX, // MGL with direct hardware access
|
||||
wxMGL_X, // MGL on X
|
||||
wxMGL_WIN32, // MGL on Win32
|
||||
wxMGL_OS2, // MGL on OS/2
|
||||
wxWINDOWS_OS2 // Native OS/2 PM
|
||||
wxUNKNOWN_PLATFORM,
|
||||
wxCURSES, // Text-only CURSES
|
||||
wxXVIEW_X, // Sun's XView OpenLOOK toolkit
|
||||
wxMOTIF_X, // OSF Motif 1.x.x
|
||||
wxCOSE_X, // OSF Common Desktop Environment
|
||||
wxNEXTSTEP, // NeXTStep
|
||||
wxMACINTOSH, // Apple System 7 and 8
|
||||
wxBEOS, // BeOS
|
||||
wxGTK, // GTK on X
|
||||
wxGTK_WIN32, // GTK on Win32
|
||||
wxGTK_OS2, // GTK on OS/2
|
||||
wxGTK_BEOS, // GTK on BeOS
|
||||
wxQT, // Qt
|
||||
wxGEOS, // GEOS
|
||||
wxOS2_PM, // OS/2 Workplace
|
||||
wxWINDOWS, // Windows or WfW
|
||||
wxPENWINDOWS, // Windows for Pen Computing
|
||||
wxWINDOWS_NT, // Windows NT
|
||||
wxWIN32S, // Windows 32S API
|
||||
wxWIN95, // Windows 95
|
||||
wxWIN386, // Watcom 32-bit supervisor modus
|
||||
wxMGL_UNIX, // MGL with direct hardware access
|
||||
wxMGL_X, // MGL on X
|
||||
wxMGL_WIN32, // MGL on Win32
|
||||
wxMGL_OS2, // MGL on OS/2
|
||||
wxWINDOWS_OS2 // Native OS/2 PM
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -32,12 +32,12 @@
|
||||
// gettext() style macro (notice that xgettext should be invoked with "-k_"
|
||||
// option to extract the strings inside _() from the sources)
|
||||
#ifndef WXINTL_NO_GETTEXT_MACRO
|
||||
#define _(str) wxGetTranslation(wxT(str))
|
||||
#define _(str) wxGetTranslation(_T(str))
|
||||
#endif
|
||||
|
||||
// another one which just marks the strings for extraction, but doesn't
|
||||
// perform the translation (use -kwxTRANSLATE with xgettext!)
|
||||
#define wxTRANSLATE(str) wxT(str)
|
||||
#define wxTRANSLATE(str) _T(str)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// forward decls
|
||||
@ -145,13 +145,23 @@ inline const wxMB2WXbuf wxGetTranslation(const wxChar *sz)
|
||||
|
||||
#else // !wxUSE_INTL
|
||||
|
||||
#ifndef WXINTL_NO_GETTEXT_MACRO
|
||||
// the macros should still be defined - otherwise compilation would fail
|
||||
|
||||
#if !defined(WXINTL_NO_GETTEXT_MACRO) && !defined(_)
|
||||
#define _(str) (str)
|
||||
#endif
|
||||
|
||||
#define wxTRANSLATE(str) _T(str)
|
||||
|
||||
inline const wxChar *wxGetTranslation(const wxChar *sz) { return sz; }
|
||||
|
||||
#endif // wxUSE_INTL/!wxUSE_INTL
|
||||
|
||||
// define this one just in case it occurs somewhere (instead of preferred
|
||||
// wxTRANSLATE) too
|
||||
#if !defined(WXINTL_NO_GETTEXT_MACRO) && !defined(gettext_noop)
|
||||
#define gettext_noop(str) _T(str)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_INTLH__
|
||||
|
7
regen
7
regen
@ -1,4 +1,4 @@
|
||||
#!/bin/ksh
|
||||
#!/bin/sh
|
||||
#
|
||||
# regenerates the file given as command line argument by running config.status
|
||||
# (the file is supposed to be generated by configure script)
|
||||
@ -12,7 +12,8 @@ if test "x$1" = "x"; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export CONFIG_FILES=$1
|
||||
export CONFIG_HEADERS=
|
||||
CONFIG_FILES=$1
|
||||
CONFIG_HEADERS=
|
||||
export CONFIG_FILES CONFIG_HEADERS
|
||||
./config.status
|
||||
exit $?
|
||||
|
@ -122,8 +122,9 @@
|
||||
#define R_OK 4
|
||||
#endif
|
||||
|
||||
// there is no distinction between text and binary files under Unix
|
||||
#ifdef __UNIX__
|
||||
// there is no distinction between text and binary files under Unix, so define
|
||||
// O_BINARY as 0 if the system headers don't do it already
|
||||
#if defined(__UNIX__) && !defined(O_BINARY)
|
||||
#define O_BINARY (0)
|
||||
#endif //__UNIX__
|
||||
|
||||
|
@ -28,7 +28,9 @@
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/string.h"
|
||||
#include "wx/icon.h"
|
||||
#if wxUSE_GUI
|
||||
#include "wx/icon.h"
|
||||
#endif
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
// Doesn't compile in WIN16 mode
|
||||
@ -55,6 +57,9 @@
|
||||
// other standard headers
|
||||
#include <ctype.h>
|
||||
|
||||
// in case we're compiling in non-GUI mode
|
||||
class WXDLLEXPORT wxIcon;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -298,7 +298,6 @@ wxObject *wxCreateDynamicObject(const wxChar *name)
|
||||
|
||||
#include "wx/serbase.h"
|
||||
#include "wx/dynlib.h"
|
||||
#include "wx/msgdlg.h"
|
||||
|
||||
wxObject* wxCreateStoredObject( wxInputStream &stream )
|
||||
{
|
||||
|
@ -70,14 +70,6 @@
|
||||
#include <clib.h>
|
||||
#endif
|
||||
|
||||
// Pattern matching code. (FIXME)
|
||||
// Yes, this path is deliberate (for Borland compilation)
|
||||
#ifdef wx_mac /* MATTHEW: [5] Mac doesn't like paths with "/" */
|
||||
#include "glob.inc"
|
||||
#else
|
||||
#include "../common/glob.inc"
|
||||
#endif
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include "windows.h"
|
||||
#endif
|
||||
|
@ -20,7 +20,7 @@ TOOLKITDIR = @TOOLKIT_DIR@
|
||||
WXLIB = @WX_LIBRARY_NAME_STATIC@
|
||||
WXSHLIB = @WX_LIBRARY_NAME_SHARED@
|
||||
|
||||
EXTRADEFS = -D"wxINSTALL_PREFIX=\"@prefix@\""
|
||||
EXTRADEFS = @EXTRADEFS@
|
||||
|
||||
########################### VERSION #################################
|
||||
|
||||
@ -59,10 +59,10 @@ SHARED_LD = @SHARED_LD@
|
||||
########################### Flags #################################
|
||||
|
||||
#
|
||||
# @CPPFLAGS@ (gnu standard) is not C++ flags, but flags for the "cpp"
|
||||
# CPPFLAGS (gnu standard) is not C++ flags, but flags for the "cpp"
|
||||
# preprocessor. Unfortunately whoever wrote this now uses CPPFLAGS for
|
||||
# C++ like CFLAGS for C. :-(
|
||||
# We *must* include @CPPFLAGS@ in both of these, to make sure that all
|
||||
# We *must* include CPPFLAGS in both of these, to make sure that all
|
||||
# header files get found. (KB)
|
||||
|
||||
CFLAGS = @TOOLKIT_DEF@ @WXDEBUG_DEFINE@ @CFLAGS@ @CPPFLAGS@ $(EXTRADEFS)
|
||||
|
@ -151,12 +151,6 @@ HBRUSH wxDisableButtonBrush = (HBRUSH) 0;
|
||||
|
||||
LRESULT WXDLLEXPORT APIENTRY wxWndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
#if wxUSE_RICHEDIT
|
||||
// the handle to richedit DLL and the version of the DLL loaded
|
||||
static HINSTANCE gs_hRichEdit = (HINSTANCE)NULL;
|
||||
static int gs_verRichEdit = -1;
|
||||
#endif
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
@ -524,11 +518,6 @@ void wxApp::CleanUp()
|
||||
|
||||
wxSetKeyboardHook(FALSE);
|
||||
|
||||
#if wxUSE_RICHEDIT
|
||||
if (gs_hRichEdit != (HINSTANCE) NULL)
|
||||
FreeLibrary(gs_hRichEdit);
|
||||
#endif
|
||||
|
||||
#if wxUSE_PENWINDOWS
|
||||
wxCleanUpPenWin();
|
||||
#endif
|
||||
@ -1111,52 +1100,6 @@ void wxApp::OnQueryEndSession(wxCloseEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
#if wxUSE_RICHEDIT
|
||||
|
||||
/* static */
|
||||
bool wxApp::InitRichEdit(int version)
|
||||
{
|
||||
wxCHECK_MSG( version >= 1 && version <= 3, FALSE,
|
||||
_T("incorrect richedit control version requested") );
|
||||
|
||||
if ( version <= gs_verRichEdit )
|
||||
{
|
||||
// we've already got this or better
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ( gs_hRichEdit )
|
||||
{
|
||||
::FreeLibrary(gs_hRichEdit);
|
||||
}
|
||||
|
||||
// always try load riched20.dll first - like this we won't have to reload
|
||||
// it later if we're first asked for RE 1 and then for RE 2 or 3
|
||||
wxString dllname = _T("riched20.dll");
|
||||
gs_hRichEdit = ::LoadLibrary(dllname);
|
||||
if ( !gs_hRichEdit && (version == 1) )
|
||||
{
|
||||
// fall back to RE 1
|
||||
dllname = _T("riched32.dll");
|
||||
gs_hRichEdit = ::LoadLibrary(dllname);
|
||||
}
|
||||
|
||||
if ( !gs_hRichEdit )
|
||||
{
|
||||
wxLogSysError(_("Could not load Rich Edit DLL '%s'"), dllname.c_str());
|
||||
|
||||
gs_verRichEdit = -1;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gs_verRichEdit = version;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif // wxUSE_RICHEDIT
|
||||
|
||||
/* static */
|
||||
int wxApp::GetComCtl32Version()
|
||||
{
|
||||
|
@ -58,12 +58,45 @@
|
||||
# include <fstream>
|
||||
#endif
|
||||
|
||||
// Why oh why did someone remove the tail of this line? Bizarre.
|
||||
// It's needed for GNUWIN32 b20, at least.
|
||||
#if wxUSE_RICHEDIT && (!defined(__GNUWIN32__) || defined(wxUSE_NORLANDER_HEADERS))
|
||||
#include <richedit.h>
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_RICHEDIT
|
||||
|
||||
// this module initializes RichEdit DLL if needed
|
||||
class wxRichEditModule : public wxModule
|
||||
{
|
||||
public:
|
||||
virtual bool OnInit();
|
||||
virtual void OnExit();
|
||||
|
||||
// get the version currently loaded, -1 if none
|
||||
static int GetLoadedVersion() { return ms_verRichEdit; }
|
||||
|
||||
// load the richedit DLL of at least of required version
|
||||
static bool Load(int version = 1);
|
||||
|
||||
private:
|
||||
// the handle to richedit DLL and the version of the DLL loaded
|
||||
static HINSTANCE ms_hRichEdit;
|
||||
|
||||
// the DLL version loaded or -1 if none
|
||||
static int ms_verRichEdit;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxRichEditModule)
|
||||
};
|
||||
|
||||
HINSTANCE wxRichEditModule::ms_hRichEdit = (HINSTANCE)NULL;
|
||||
int wxRichEditModule::ms_verRichEdit = -1;
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxRichEditModule, wxModule)
|
||||
|
||||
#endif // wxUSE_RICHEDIT
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event tables and other macros
|
||||
@ -166,7 +199,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
m_lDlgCode |= DLGC_WANTTAB;
|
||||
|
||||
// do create the control - either an EDIT or RICHEDIT
|
||||
const wxChar *windowClass = wxT("EDIT");
|
||||
wxString windowClass = wxT("EDIT");
|
||||
|
||||
#if wxUSE_RICHEDIT
|
||||
if ( m_windowStyle & wxTE_RICH )
|
||||
@ -178,10 +211,11 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
{
|
||||
// first try to load the RichEdit DLL (will do nothing if already
|
||||
// done)
|
||||
if ( !wxTheApp->InitRichEdit() )
|
||||
if ( !wxRichEditModule::Load() )
|
||||
{
|
||||
wxLogError(_("Impossible to create a rich edit control, "
|
||||
"using simple text control instead."));
|
||||
"using simple text control instead. Please "
|
||||
"reinstall riched32.dll"));
|
||||
|
||||
s_errorGiven = TRUE;
|
||||
}
|
||||
@ -195,12 +229,31 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
{
|
||||
msStyle |= ES_AUTOVSCROLL;
|
||||
m_isRich = TRUE;
|
||||
windowClass = wxT("RICHEDIT");
|
||||
|
||||
int ver = wxRichEditModule::GetLoadedVersion();
|
||||
if ( ver == 1 )
|
||||
{
|
||||
windowClass = wxT("RICHEDIT");
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef RICHEDIT_CLASS
|
||||
wxString RICHEDIT_CLASS;
|
||||
RICHEDIT_CLASS.Printf(_T("RichEdit%d0"), ver);
|
||||
#ifdef wxUSE_UNICODE
|
||||
RICHEDIT_CLASS += _T('W');
|
||||
#else // ANSI
|
||||
RICHEDIT_CLASS += _T('A');
|
||||
#endif // Unicode/ANSI
|
||||
#endif // !RICHEDIT_CLASS
|
||||
|
||||
windowClass = RICHEDIT_CLASS;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
m_isRich = FALSE;
|
||||
#endif
|
||||
#endif // wxUSE_RICHEDIT
|
||||
|
||||
bool want3D;
|
||||
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
|
||||
@ -311,15 +364,56 @@ void wxTextCtrl::SetupColours()
|
||||
|
||||
wxString wxTextCtrl::GetValue() const
|
||||
{
|
||||
return wxGetWindowText(GetHWND());
|
||||
// we can't use wxGetWindowText() (i.e. WM_GETTEXT internally) for
|
||||
// retrieving more than 64Kb under Win9x
|
||||
#if wxUSE_RICHEDIT
|
||||
if ( m_isRich )
|
||||
{
|
||||
wxString str;
|
||||
|
||||
int len = GetWindowTextLength(GetHwnd()) + 1;
|
||||
wxChar *p = str.GetWriteBuf(len);
|
||||
|
||||
TEXTRANGE textRange;
|
||||
textRange.chrg.cpMin = 0;
|
||||
textRange.chrg.cpMax = -1;
|
||||
textRange.lpstrText = p;
|
||||
|
||||
(void)SendMessage(GetHwnd(), EM_GETTEXTRANGE, 0, (LPARAM)&textRange);
|
||||
|
||||
// believe it or not, but EM_GETTEXTRANGE uses just CR ('\r') for the
|
||||
// newlines which is neither Unix nor Windows style (Win95 with
|
||||
// riched20.dll shows this behaviour) - convert it to something
|
||||
// reasonable
|
||||
for ( ; *p; p++ )
|
||||
{
|
||||
if ( *p == _T('\r') )
|
||||
*p = _T('\n');
|
||||
}
|
||||
|
||||
str.UngetWriteBuf();
|
||||
|
||||
return str;
|
||||
}
|
||||
#endif // wxUSE_RICHEDIT
|
||||
|
||||
// WM_GETTEXT uses standard DOS CR+LF (\r\n) convention - convert to the
|
||||
// same one as above for consitency
|
||||
wxString str = wxGetWindowText(GetHWND());
|
||||
|
||||
return wxTextFile::Translate(str, wxTextFileType_Unix);
|
||||
}
|
||||
|
||||
void wxTextCtrl::SetValue(const wxString& value)
|
||||
{
|
||||
wxString valueDos = wxTextFile::Translate(value, wxTextFileType_Dos);
|
||||
|
||||
if ( valueDos != GetValue() )
|
||||
// if the text is long enough, it's faster to just set it instead of first
|
||||
// comparing it with the old one (chances are that it will be different
|
||||
// anyhow, this comparison is there to avoid flicker for small single-line
|
||||
// edit controls mostly)
|
||||
if ( (value.length() > 0x400) || (value != GetValue()) )
|
||||
{
|
||||
wxString valueDos = wxTextFile::Translate(value, wxTextFileType_Dos);
|
||||
|
||||
SetWindowText(GetHwnd(), valueDos);
|
||||
|
||||
AdjustSpaceLimit();
|
||||
@ -839,14 +933,14 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
|
||||
}
|
||||
break;
|
||||
|
||||
case EN_ERRSPACE:
|
||||
case EN_MAXTEXT:
|
||||
// the text size limit has been hit - increase it
|
||||
AdjustSpaceLimit();
|
||||
break;
|
||||
|
||||
// the other notification messages are not processed
|
||||
case EN_UPDATE:
|
||||
case EN_MAXTEXT:
|
||||
case EN_ERRSPACE:
|
||||
case EN_HSCROLL:
|
||||
case EN_VSCROLL:
|
||||
default:
|
||||
@ -867,15 +961,25 @@ void wxTextCtrl::AdjustSpaceLimit()
|
||||
limit = len + 0x8000; // 32Kb
|
||||
|
||||
#if wxUSE_RICHEDIT
|
||||
if ( m_isRich || limit > 0xffff )
|
||||
#else
|
||||
if ( limit > 0xffff )
|
||||
#endif
|
||||
::SendMessage(GetHwnd(), EM_LIMITTEXT, 0, limit);
|
||||
if ( m_isRich )
|
||||
{
|
||||
// as a nice side effect, this also allows passing limit > 64Kb
|
||||
::SendMessage(GetHwnd(), EM_EXLIMITTEXT, 0, limit);
|
||||
}
|
||||
else
|
||||
#endif // wxUSE_RICHEDIT
|
||||
{
|
||||
if ( limit > 0xffff )
|
||||
{
|
||||
// this will set it to a platform-dependent maximum (much more
|
||||
// than 64Kb under NT)
|
||||
limit = 0;
|
||||
}
|
||||
|
||||
::SendMessage(GetHwnd(), EM_LIMITTEXT, limit, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // !Win16
|
||||
}
|
||||
|
||||
bool wxTextCtrl::AcceptsFocus() const
|
||||
@ -955,3 +1059,68 @@ void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event)
|
||||
event.Enable( CanRedo() );
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRichEditModule
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_RICHEDIT
|
||||
|
||||
bool wxRichEditModule::OnInit()
|
||||
{
|
||||
// don't do anything - we will load it when needed
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxRichEditModule::OnExit()
|
||||
{
|
||||
if ( ms_hRichEdit )
|
||||
{
|
||||
FreeLibrary(ms_hRichEdit);
|
||||
}
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool wxRichEditModule::Load(int version)
|
||||
{
|
||||
wxCHECK_MSG( version >= 1 && version <= 3, FALSE,
|
||||
_T("incorrect richedit control version requested") );
|
||||
|
||||
if ( version <= ms_verRichEdit )
|
||||
{
|
||||
// we've already got this or better
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ( ms_hRichEdit )
|
||||
{
|
||||
::FreeLibrary(ms_hRichEdit);
|
||||
}
|
||||
|
||||
// always try load riched20.dll first - like this we won't have to reload
|
||||
// it later if we're first asked for RE 1 and then for RE 2 or 3
|
||||
wxString dllname = _T("riched20.dll");
|
||||
ms_hRichEdit = ::LoadLibrary(dllname);
|
||||
ms_verRichEdit = 2; // no way to tell if it's 2 or 3, assume 2
|
||||
|
||||
if ( !ms_hRichEdit && (version == 1) )
|
||||
{
|
||||
// fall back to RE 1
|
||||
dllname = _T("riched32.dll");
|
||||
ms_hRichEdit = ::LoadLibrary(dllname);
|
||||
ms_verRichEdit = 1;
|
||||
}
|
||||
|
||||
if ( !ms_hRichEdit )
|
||||
{
|
||||
wxLogSysError(_("Could not load Rich Edit DLL '%s'"), dllname.c_str());
|
||||
|
||||
ms_verRichEdit = -1;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif // wxUSE_RICHEDIT
|
||||
|
||||
|
@ -41,9 +41,7 @@
|
||||
#include <fcntl.h> // for O_WRONLY and friends
|
||||
#include <time.h> // nanosleep() and/or usleep()
|
||||
#include <ctype.h> // isspace()
|
||||
|
||||
// JACS: needed for FD_SETSIZE
|
||||
#include <sys/time.h>
|
||||
#include <sys/time.h> // needed for FD_SETSIZE
|
||||
|
||||
#ifdef HAVE_UNAME
|
||||
#include <sys/utsname.h> // for uname()
|
||||
@ -97,14 +95,14 @@ void wxSleep(int nSecs)
|
||||
|
||||
void wxUsleep(unsigned long milliseconds)
|
||||
{
|
||||
#ifdef HAVE_NANOSLEEP
|
||||
#if defined(HAVE_NANOSLEEP)
|
||||
timespec tmReq;
|
||||
tmReq.tv_sec = milliseconds / 1000;
|
||||
tmReq.tv_nsec = (milliseconds % 1000) * 1000 * 1000;
|
||||
|
||||
// we're not interested in remaining time nor in return value
|
||||
(void)nanosleep(&tmReq, (timespec *)NULL);
|
||||
#elif defined( HAVE_USLEEP )
|
||||
#elif defined(HAVE_USLEEP)
|
||||
// uncomment this if you feel brave or if you are sure that your version
|
||||
// of Solaris has a safe usleep() function but please notice that usleep()
|
||||
// is known to lead to crashes in MT programs in Solaris 2.[67] and is not
|
||||
@ -114,6 +112,9 @@ void wxUsleep(unsigned long milliseconds)
|
||||
#endif // Sun
|
||||
|
||||
usleep(milliseconds * 1000); // usleep(3) wants microseconds
|
||||
#elif defined(HAVE_SLEEP)
|
||||
// under BeOS sleep() takes seconds (what about other platforms, if any?)
|
||||
sleep(milliseconds * 1000);
|
||||
#else // !sleep function
|
||||
#error "usleep() or nanosleep() function required for wxUsleep"
|
||||
#endif // sleep function
|
||||
@ -566,18 +567,19 @@ bool wxGetUserId(wxChar *buf, int sz)
|
||||
bool wxGetUserName(wxChar *buf, int sz)
|
||||
{
|
||||
struct passwd *who;
|
||||
char *comma;
|
||||
|
||||
*buf = wxT('\0');
|
||||
if ((who = getpwuid (getuid ())) != NULL) {
|
||||
#ifndef __VMS__
|
||||
comma = strchr(who->pw_gecos, ',');
|
||||
if ((who = getpwuid (getuid ())) != NULL)
|
||||
{
|
||||
// pw_gecos field in struct passwd is not standard
|
||||
#if HAVE_PW_GECOS
|
||||
char *comma = strchr(who->pw_gecos, ',');
|
||||
if (comma)
|
||||
*comma = '\0'; // cut off non-name comment fields
|
||||
wxStrncpy (buf, wxConvertMB2WX(who->pw_gecos), sz - 1);
|
||||
#else
|
||||
#else // !HAVE_PW_GECOS
|
||||
wxStrncpy (buf, wxConvertMB2WX(who->pw_name), sz - 1);
|
||||
#endif
|
||||
#endif // HAVE_PW_GECOS/!HAVE_PW_GECOS
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user