wxFileOffset and ssize_t are not the same type under this platform so using
CPPUNIT_ASSERT_EQUAL() with the arguments of these types fails. Use ssize_t
instead of wxFileOffset to fix this.
Write correct number of bytes in wxFile::Write(wxString).
This function was broken for conversions using more than one byte per
character (e.g. UTF-16 or UTF-32) and also even for UTF-8 for strings
containing NUL bytes as it used strlen() to determine the number of bytes to
write out instead of using the really needed number.
Fix this by using the wxCharBuffer::length() method which always returns the
correct value.
Also add a wxFile unit test verifying that it can correctly read back a string
written using any of UTF-8, UTF-16 or UTF-32.
Unregister wake up pipe file fd in ~wxConsoleEventLoop.
We must unregister the wake up pipe file descriptor which we register with the
IO dispatcher in wxConsoleEventLoop ctor, otherwise doing it the next time
(i.e. if wxConsoleEventLoop is deleted and recreated) results in asserts, at
least when using wxSelectDispatcher and not wxEpollDispatcher (i.e. under any
non-Linux Unix system).
Bakefile for this program doesn't exist so its makefiles are out of date and
it doesn't build any more now, disable its build until the bakefile is checked
in.
Remove WX_DEBUG option from Unix wx presets, it's not needed any more.
It doesn't make sense to select debug or release build of wxWidgets any more
as they are now compatible under Unix. Under Windows the option is still
needed but it selects the build using debug (or not) version of the CRT rather
than the one built with __WXDEBUG__ defined.
Under Unix wxDEBUG_LEVEL can be set using configure --enable-debug=max option
but under Windows it needs to be changed in wx/msw/setup.h so add it to this
file with a comment explaining its meaning.
Also document this symbol with the other preprocessor constants.
Define wxDEBUG_LEVEL in both debug and release builds as 1.
By default include assertions and debug logging in both debug and release
builds but disable them in application release builds (when NDEBUG is
defined).
Also update (more accurately, replace) debugging overview.
The background colour for the HDC used for drawing the native controls wasn't
set correctly any more after changes of r61859 but we do need to call it or
the text in edit and similar controls is drawn using the default background
even if we return the correct brush which is used for erasing the control.
The change in the values returned by wxStandardPaths functions is important as
it's incompatible with 2.8 if the application defines a vendor name so must be
mentioned in docs/changes.txt.
Also update the documentation of the class itself and mention UseAppInfo() in
the overview.
wxPropertyGrid: added wxPG_NO_INTERNAL_BORDER, wxPG_EX_NO_TOOLBAR_DIVIDER
and wxPG_EX_TOOLBAR_SEPARATOR styles for finer control over borders.
Borders around property grid are now native for consistency.
Some strange VC6 compiler errors fixed, plus size assertion in
sample.
Jaakko Salli [Wed, 9 Sep 2009 16:41:23 +0000 (16:41 +0000)]
Various improvements to wxComboCtrl's text ctrl left margin setup: less #defines, better margin when SetCustomPaintWidth() has been called, fixed SetFont() behavior on wxMSW
Set correct foreground default in wxControl::DoMSWControlColor().
Instead of hard-coding GetSysColor(COLOR_WINDOWTEXT), use
GetForegroundColour() which will call GetDefaultAttributes() to retrieve the
default foreground appropriate for this control.
This also allows to make the code simpler by calling SetTextColor() only once.
Don't always override the default background colours.
The wxColour argument taken by wxControl::DoMSWControlColor() allows to
override the default colour, it shouldn't be used in MSWControlColor() as this
resulted in always using custom colours for the controls, even when the user
hadn't changed them. Fix this by not passing any valid colour to it in this
case and allowing it to deduce the correct colour to use on its own.
The default colours for this control are wxTextCtrl-like and not wxButton-like
(which is the default). Override GetDefaultAttributes() to indicate this and
to avoid returning a wrong background from wxControl::DoMSWControlColor() when
just a foreground is set.
Using 32bpp image lists (ILC_COLOR32) is required as we need to be able to put
32bpp bitmaps in them and results in better (albeit still broken, see #9050)
display when the display depth is < 32.
This change was tested under Windows 2000, 2003 and Vista in 8 (Win2k-only),
16 and 32bpp display depth modes.
Show the order in which different event handlers are called.
Update the event sample to define (as) many (as possible) event handlers for a
test button and log messages in all of the handlers to leave a trace of the
order in which they were executed.
Add a pointer to this feature of the event sample to the events overview.
Fix bug with parsing concatenated switches in wxCmdLineParser.
The constructs such as "-abcd" were not parsed correctly, i.e. the same as "-a
-b -c -d" because the code tried to parse a non-existent option "abcd" even if
it was supposed to not do this -- fix this.
Recognize the buddy text control as part of wxSpinCtrl.
This allows the code in wxWindowMSW::HandleCtlColor() to find the correct
control when handling the messages from the buddy control and hence setting
the colours for wxSpinCtrl works after this change.
Compilation fix after wxTextEntry::SetMargins() changes.
We need to include wx/gdicmn.h to define wxPoint which is now used in
wx/textentry.h, it is not necessarily already included and in fact compilation
was broken in PCH-less build.
Fix after changes of r61832: SDK checks should be done for Mac ports only as
they are useless under the other systems and break configure because sw_vers
is Mac-only and unsurprisingly using it results in errors under the other
systems:
/usr/local/src/wx/HEAD/configure: line 18215: sw_vers: command not found
checking if C compiler works with SDK/version options... configure: error: no.
Try a different SDK
Jaakko Salli [Sat, 5 Sep 2009 12:39:12 +0000 (12:39 +0000)]
wxTextEntry::SetMargins(), GetMargins() - implemented on wxMSW and wxGTK (GTK+ 2.10+); also added similar functions into wxComboCtrl, deprecated old indent-functions; wxPropertyGrid modified to use the new functionality
Kevin Ollivier [Sat, 5 Sep 2009 00:12:39 +0000 (00:12 +0000)]
If gcc-4.2+ is specified for compiling OS X Carbon or 10.4 compatilbility is specified, switch to gcc-4.0 to avoid configuration conflicts. Also, do not default to 10.4 compatibility when building OS X Cocoa so that we can get 64-bit builds on Snow Leopard by default.
Fix regression with logging messages during wxApp initialization.
Changes in r61450 broke logging of the messages for errors occurring during
wxApp initialization, such as the message about the failure to establish
connection to the X server. Instead of being shown on stderr, wxLogGui was
used resulting in a crash. Creating wxLogOutputBest in wxLog code before
wxTheApp creation was not enough as this error occurred after wxTheApp
creation -- but before it became usable.
Fix this by explicitly asking wxLog to instantiate a safe log target in
DoCommonPreInit() if the user hadn't set up his own yet and using it until the
GUI is fully initialized.
Tweak the default wxApp::GetAppDisplayName() logic.
Don't capitalize the app name if it had been explicitly set with SetAppName()
as this can result in unexpectedly wrong value. Do capitalize the program name
which is used as app name by default and don't store the program name in
m_appName to be able to distinguish between the two cases.
React to errors on socket correctly when using epoll().
Even though the socket is not registered for wxFDIO_EXCEPTION events,
wxEpollDispatcher will currently generate them anyhow so we shouldn't assert
if wxSocketImplUnix::OnExceptionWaiting() is called.
Instead, notify the socket about the connection loss if this happens.
Vadim Zeitlin [Sun, 30 Aug 2009 20:42:46 +0000 (20:42 +0000)]
Use correct font instead of DEFAULT_GUI_FONT.
DEFAULT_GUI_FONT is a misnomer, not only is it not a default (and never was)
but it shouldn't be used at all. Instead use lfMessageFont from the
NONCLIENTMETRICS structure as it seems to correspond to the font used by
the native controls under 2000, XP and Vista and respects Vista global DPI
setting unlike DEFAULT_GUI_FONT.
Vadim Zeitlin [Sun, 30 Aug 2009 17:25:42 +0000 (17:25 +0000)]
Fix buffer overflow in wxURLDataObject.
The code in CFSTR_SHELLURLDataObject::GetDataHere() was confused by
ANSI/Unicode and ended up overwriting output buffer because of it. Moreover,
this function was actually completely unnecessary as the base class version
did work correctly.
Vadim Zeitlin [Sun, 30 Aug 2009 17:25:28 +0000 (17:25 +0000)]
Fix off by one errors in wxURLDataObject.
wxTextDataObject::SetData() adds the terminating NUL automatically so there is
no need to add it to the length when calling it from wxURLDataObject::SetURL().
This change is necessary to fix the unit test in the upcoming fix for #11102.
Vadim Zeitlin [Sun, 30 Aug 2009 17:25:19 +0000 (17:25 +0000)]
Output the extracted number from wxString::ToXXX() even if it returns false.
After the changes in r50710 wxString numeric conversion functions didn't
update their output parameter any more if the conversion failed because not
entire string was converted. This was incompatible with the old behaviour
which some existing code did rely on, so restore it and now always return the
number which was extracted from the beginning of the string if we found
anything at all, even if the function returns false.
Add unit test for the correct behaviour and updated the documentation.
Vadim Zeitlin [Sun, 30 Aug 2009 17:25:02 +0000 (17:25 +0000)]
Use GetBestSize() rather than DoGetBestSize().
Call GetBestSize() from wxWindowMSW::DoSetSize() so that it works correctly
for the classes which only override DoGetBestClientSize() and not
DoGetBestSize() itself, such as wxStaticText.
Vadim Zeitlin [Sun, 30 Aug 2009 17:24:53 +0000 (17:24 +0000)]
Fix selection events generation in multi-select wxTreeCtrl.
Only deselect the items when the mouse is released if really necessary: add a
flag indicating when it is instead of trying to deduce it in the mouse up
handler.
Vadim Zeitlin [Sun, 30 Aug 2009 17:24:45 +0000 (17:24 +0000)]
Don't generate duplicated events for clicks on tree +/- buttons.
In multiple selection mode we process mouse events manually in wxTreeCtrl
itself and already take care of mouse clicks on the buttons there so don't
pass them on to the base class which would generate another event.
Vadim Zeitlin [Fri, 28 Aug 2009 10:44:25 +0000 (10:44 +0000)]
Compilation fix for wxUSE_PROTOCOL && !wxUSE_URL.
IMPLEMENT_CLASS(wxProtoInfo) wasn't compiled in in this build configuration
because it was in url.cpp instead of protocol.cpp and so was guarded by
wxUSE_URL and not wxUSE_PROTOCOL as it should have been.