Fix vararg function in wxXml unit test broken by recent changes.
The changes in r67345 changed CheckXml() vararg function to take a reference
as the first argument but this doesn't work with va_start(), so revert to
using a pointer here.
This fixes the current unit test failures in the XML tests.
Correctly restore the old locale in wxXLocale functions.
In non-wxHAS_XLOCALE_SUPPORT case we didn't restore the original locale
correctly in wxStrtoxxx_l() functions as the return value of wxSetlocale() was
incorrectly assumed to be the old locale instead of the new one.
Fix this and also replace the macros used by the old code with a small helper
class, this simplifies the code and is less ugly.
Finally add a unit test which failed before these changes when the program ran
in any non-C locale but passes now.
Fix incorrect use of setlocale() in wxLocale::IsAvailable().
The return value of setlocale() was used incorrectly in this code: it
represents the newly set locale and not the previously active one so we didn't
actually restore the original locale before.
Fix the code and check that we do actually restore the locale in a new unit
test for it.
Fix VarArgTestCase compilation when type traits are unavailable.
When type traits are unavailable we can't check whether a type can be passed
to a vararg function but we still need to pass a copyable object to
wxString::Format() for the code to compile, even if we just want to check that
it will fail with the assert at run-time.
Changed licence references to "wxWindows licence".
Use "wxWindows licence" and not "wxWidgets licence" and also use British spelling for licence. Updated new occurrences in recently added files and a couple of previously (r64940) missed ones.
ImageTestCase::DibPadding was always failing due to differences in pixel data between the decoded GIF and encoded ICO image. Instead of comparing image content just check if the saving of the ICO succeeds (prior to r67296 it would crash).
Paul Cornett [Sun, 3 Apr 2011 05:19:59 +0000 (05:19 +0000)]
For wxGTK2, link with X11 explicitly, since we use many X11 functions directly.
Some linkers, notably newer Linux ones, don't implicitly link against dependent libs
Fixes #13100
Disable wxUSE_STD_CONTAINERS by default for MSVC6.
This compiler can't compile its own standard headers with the default options
as it overflows an internal heap. Disable the use of standard containers by
default for it to avoid this problem and indicate that /Zm option must be used
to avoid this.
Remove the weird wxSVG_DEBUG which could apparently be used to trace the code
execution by triggering asserts in all functions. This is really not the right
way to implement tracing and seems pretty useless, just remove it.
Jaakko Salli [Thu, 31 Mar 2011 17:22:51 +0000 (17:22 +0000)]
Added wxComboPopup::DestroyPopup(), which responsibility is to call Destroy() for the popup control and also delete the combo popup object itself. The default implementation should be able to handle common cases.
Vadim Zeitlin [Thu, 31 Mar 2011 09:38:03 +0000 (09:38 +0000)]
Implement wxGraphicsContext::GetSize() for Cairo.
As the implementation of this method is basically the same for all ports move
it to the base class itself instead of requiring the derived classes to
implement it. Now the derived classes need to fill in m_width and m_height
members instead.
Do fill them when creating wxGraphicsContext in Cairo version.
Vadim Zeitlin [Thu, 31 Mar 2011 09:37:59 +0000 (09:37 +0000)]
Tentative compilation fix for wxMSW with MinGW after STL changes.
Include wx/stack.h, which includes the standard <stack> header, before
<windows.h> as the latter redefines min and max as macros conflicting with the
standard headers.
Vadim Zeitlin [Thu, 31 Mar 2011 09:28:41 +0000 (09:28 +0000)]
Fix alpha handling in CSS syntax in wxColour in non-"C" locale.
Use locale-independent functions to parse and generate the floating point
alpha representation in CSS syntax for colours to make it work in locales
which don't use period as decimal separator.
Vadim Zeitlin [Thu, 31 Mar 2011 09:28:38 +0000 (09:28 +0000)]
Fix HMENU to wxMenu translation in wxMSW code.
We didn't find the menus corresponding to the submenu handles. This resulted
in incorrect processing of EVT_UPDATE_UI events for the submenus and probably
other problems.
Fix this by searching for the HMENU recursively in all menus.
Vadim Zeitlin [Thu, 31 Mar 2011 09:28:34 +0000 (09:28 +0000)]
Document unexpected wxWindowDisabler taskbar UI in wxMSW.
It may be unexpected that the application can still be closed from the taskbar
even if its main window is disabled. Mention this in the documentation and
indicate how to prevent this from happening if required.
Vadim Zeitlin [Wed, 30 Mar 2011 14:16:25 +0000 (14:16 +0000)]
Remove REMOVE_UNUSED_ARG option from setup.h files.
This identifier wasn't used anywhere as WXUNUSED() is always defined as
nothing for all compilers since quite some time.
Also moved wxUSE_IOSTREAMH together with the other wxUSE_STD_XXX options and
removed the "compiler (mis)features" section which became empty after doing
this.
Vadim Zeitlin [Wed, 30 Mar 2011 14:16:19 +0000 (14:16 +0000)]
Add support for elements preceding the document node in wxXML.
This is mainly useful for parsing and generating processing instructions but
can be used for any kind of elements, e.g. also comments, occurring before the
document node in XML documents.
Update the internally stored position of a floating AUI frame even if the user
is dragging it too fast to update its position on screen. This prevents the
frame from snapping back to the initial position when movement is over.
Vadim Zeitlin [Wed, 30 Mar 2011 14:16:04 +0000 (14:16 +0000)]
Add wxUSE_STD_CONTAINERS and turn it on by default.
Previously, wxUSE_STL enabled both implicit conversion of wxString to
std::[w]string and use of standard containers for the implementation of their
wx equivalents. Split up the two roles now by allowing to enable the use of
the standard containers independently of (backwards incompatible) implicit
conversion in wxString and actually enable wxUSE_STD_CONTAINERS by default.
Jaakko Salli [Sun, 27 Mar 2011 18:30:56 +0000 (18:30 +0000)]
Instead of just deleting m_popupInterface, call Destroy() of its wxWindow-based popup control obtained via GetControl() member function. Also still delete m_popupInterface if there was no popup control, or if it was implemented as a separate class (versus being multiple-inherited along side wxComboPopup, as has been the common practice).
Václav Slavík [Sun, 27 Mar 2011 17:23:43 +0000 (17:23 +0000)]
Always use gtk2-compat.h definitions.
We support building against newer GTK+ version and using an older
one at runtime, so we must provide our implementations of these
functions even if GTK_CHECK_VERSION would indicate the function is
already available in GTK+.
Václav Slavík [Fri, 25 Mar 2011 11:00:56 +0000 (11:00 +0000)]
Revert r67137.
GTK_DISABLE_SINGLE_INCLUDES causes trouble with other included
libraries (libgnomeprint this time) too. This check for trivially fixed
problems is not worth the continuing trouble.
Vadim Zeitlin [Thu, 24 Mar 2011 16:08:11 +0000 (16:08 +0000)]
Set m_inheritBgCol flag in wxPanel with a background bitmap.
This ensures that the panel background is used by its transparent children
under wxMSW even when the panel itself is inside a wxNotebook with themed
background: making InheritsBackgroundColour() return true prevents the
notebook from overriding our background.
Fixed buffer overflow when saving certain images in the Windows icon format.
When an image did not have a width with a multiple of 4 the calculations for the number of padding bytes (to get a scan line DWORD aligned) would be wrong. This caused a buffer overrun when saving the 1 bits per pixel mask.
Václav Slavík [Wed, 23 Mar 2011 13:57:52 +0000 (13:57 +0000)]
Only react to clicks on the checkbox in wxDataViewToggleRenderer.
Previously, left click anywhere in the cell toggled the checkbox.
This was unexpected when the cursor was far from the checkbox
in a wide column. With this change, one has to be over the
checkbox to toggle it.
Vadim Zeitlin [Wed, 23 Mar 2011 10:37:38 +0000 (10:37 +0000)]
Prevent event generation in wxGtkCalendarCtrl::SetDate().
Block not only gtk_day_selected_callback() but also gtk_month_changed_callback()
as we don't want wxEVT_CALENDAR_PAGE_CHANGED generated neither when calling
SetDate().
This fixes partial resetting of the just set value in wxDatePickerCtrl as
calling SetDate() there resulted in the date being reset from inside it and
the behaviour of the control was clearly wrong as could be seen in the widgets
sample.
Václav Slavík [Tue, 22 Mar 2011 19:13:28 +0000 (19:13 +0000)]
Fix <object_ref> processing to respect overridden attributes.
r60494 accidentally broke this, by adding faster code path for
child-less <object_ref>s. Unfortunately, this made it ignore
<object_ref>s without children, but with attributes overrides.
Vadim Zeitlin [Tue, 22 Mar 2011 17:15:56 +0000 (17:15 +0000)]
Add wxUSE_THREADS checks around wxMSW functions dealing with threads.
This removes the code unneeded in wxUSE_THREADS==0 build and also fixes
compilation of wxGUIAppTraits::WaitForThread() which didn't compile any more
with wxUSE_THREADS==0 since r67185.
Vadim Zeitlin [Tue, 22 Mar 2011 17:15:49 +0000 (17:15 +0000)]
Don't consider fully opaque bitmaps as having alpha in wxMSW.
Remove the alpha channel from the DIB we create not only if all of its pixels
are fully transparent but also if they are all fully opaque. This prevents us
from erroneously creating bitmaps with alpha channel when none is needed nor
expected.
Vadim Zeitlin [Tue, 22 Mar 2011 17:15:38 +0000 (17:15 +0000)]
Post size events to the event handler and not window itself.
Post the artificial wxSizeEvent to the window event handler and not window
itself in SendSizeEvent() as otherwise any event handlers wouldn't see this
event at all.
Vadim Zeitlin [Tue, 22 Mar 2011 17:15:34 +0000 (17:15 +0000)]
Use disabled version of normal bitmap for disabled one in wxMSW::wxButton.
Initialize the disabled button bitmap with a greyed out version of the normal
one instead of using the same normal bitmap for it. This is more consistent
with the other ports and makes more sense.
Vadim Zeitlin [Tue, 22 Mar 2011 15:07:20 +0000 (15:07 +0000)]
Correctly align background brush when erasing owner drawn bitmaps in wxMSW.
Add a hack to work around the problem with background alignment when drawing
the owner-drawn buttons in wxMSW. This fixes the alignment for any custom
brushes used for background painting but doesn't help with user-defined
EVT_ERASE_BACKGROUND handlers which still don't work well with the owner-drawn
buttons. Unfortunately DrawThemeParentBackground() remains a mystery and I
couldn't understand why not only doesn't it position the DC correctly on its
own but also ignores any attempts to do it manually.
This also doesn't help with the stubbornly remaining one pixel non-transparent
border around non-owner-drawn buttons which I just can't get rid of.
Applied patch by snowleopard2 fixing a bunch of typos such as misspellings and double words in the documentation. Combined the patch with some local queued typos waiting to be committed as well as adding new typo fixes inspired by the patch.
Function names with American spelling were not changed nor was third-party code touched. The only code changes involve some changes in strings that are translated ("Can not" -> "Cannot").