Allow creating wxSingleInstanceChecker with default name.
This makes it easier to use in common cases: there is no need to come up with
a unique name for the checker any more as sufficiently unique combination of
wxApp::GetAppName() and wxGetUserId() is used if no name was explicitly given.
This is done by calling the new CreateDefault() on demand from
IsAnotherRunning() instead of simply creating the checker with the default
name in the default ctor for compatibility (you had to call Create() after
using the default ctor before and it can only be called once) and because
wxTheApp might not exist yet when wxSingleInstanceChecker is created.
Change wxBoxSizer::AddSpacer() to only add space in sizer direction.
It used to add a spacer with the given size in both directions but this was
counter-intuitive and wasn't expected even by the original author of this code
so change it to behave more reasonably.
The change in r61922 which was supposed to do it somehow forgot the fix itself
and added only a comment explaining why it was needed. Really do name the
struct now.
Add virtual dtor to header renderer classes to avoid g++ warnings.
g++ warns about class with virtual functions having non-virtual dtor so make
the dtor of wxGridCornerHeaderRenderer virtual even if it's not really needed.
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.