Work around wxDateTime::ParseFormat() problem in generic wxDateTimePickerCtrl.
Due to a bug in wxDateTime::ParseFormat(), calling it with wxString::c_str()
currently just crashes, so don't do this in generic wxDateTimePickerCtrl code.
The real fix is, of course, to correct the bug in wxDateTime itself but for
now this at least prevents the crash when executing the test suite. And using
c_str() here is unnecessary anyhow.
Enable wxComboBox::SetString() test in the widgets sample.
It was disabled because it wasn't implemented for wxGTK at some time in the
past -- but it is implemented now, so there is no reason to not allow testing
it.
Václav Slavík [Sun, 29 Apr 2012 09:36:44 +0000 (09:36 +0000)]
Don't use ancient -no-cpp-precomp flag on OS X.
See http://trac.wxwidgets.org/ticket/14029 for a discussion of the
problems it causes when using non-Apple compiler. Even for Apple's GCC,
it does nothing these days and we no longer support OS X 10.3, so
there's no point in continuing to use it.
Make wxGTK code returning correct focus in popup menu presence more robust.
Replace the changes of r69938 with an alternative and simpler solution:
instead of playing games with gs_pendingFocus, which could break down if its
old value became invalid while the menu was shown as happened if one of the
menu commands resulted in this window being destroyed, just take the currently
shown popup menu into account in DoFindFocus() itself.
This should be safer as there is no danger of any dangling pointers here and
is also simpler and more obviously correct.
Add missing "flags" argument to wxNotificationMessage ctor in wxMSW.
It was impossible to specify the flags when creating wxNotificationMessage in
wxMSW, cotrary to the other ports and the documentation.
Fix this by adding the missing argument to the ctor and simply passing it to
the base class one, we don't have to do anything else as the existing code
already calls GetFlags() later so it should respect these flags without any
more changes.
Fix crash in wxFileConfig when deleting last entry of the root group.
This resulted in keeping a dangling pointer to the group line in
wxFileConfigGroup and any attempt to use it after this resulted in a crash.
Fix this by explicitly resetting the last line in this case.
Make it possible to forward declare wx{Choice,Tool,Tree}bookEvent again.
Don't use typedef for these classes as it makes it impossible to
forward-declare them, just use #define instead as we already do for
wxListbookEvent and wxNotebookEvent. This allows forward declaration and is
also more consistent.
The native GTK implementation is not used in wxUniv/GTK, so don't exclude the
generic one as well.
Notice that the same should be done for wxMSW and wxOSX too but we currently
seem to use the native version even in wxUniv there. It would be better to
consistently use the generic version in all wxUniv ports.
Don't change wxTextEntry value if it didn't really change.
This is not only unnecessary but also can result in a kind of infinite loop
when wxTextEntry::SetValue() is called from wxEVT_IDLE handler as really
modifying the text results in another wxEVT_IDLE being generated and another
call to SetValue() and so on while not doing it in the first place completely
works around the problem and is also more efficient.
Run some wxTextCtrl unit test cases for single and multi-line controls.
Some of the tests that were previously ran for single or multi-line controls
only actually apply to both of them, so run them for both kinds of control to
test that both of them work correctly.
No changes, just refactor wxTextCtrl unit test case.
Allow running the same tests for both single and multi-line controls easily.
No real changes yet though, the tests are still ran for the controls with the
same styles as before for now.
Don't block in wxEventLoopManual::Dispatch() if loop was exited.
If Exit() was called from a handler for one of the pending events we could
reenter Dispatch() and block there indefinitely if no other events were coming
and this was exactly what happened in wxFileSystemWatcher unit test,
preventing it from ever running to completion under Unix.
Fix this by checking m_shouldExit after executing the pending handlers and
before calling Dispatch().
This pretty-printer works by calling the C++ wxFileName::GetFullPath()
directly instead of interpreting the object data from gdb because this is much
simpler to do, so it can only be used when debugging live programs. If this is
a serious restriction, it would need to be changed to use gdb data access only
later.
Don't use too big width for wxHtmlHelpWindow navigation panel.
The width of the navigation panel in wxHtmlHelpWindow could become arbitrarily
high if long items used. Avoid this by using a reasonably large but not too
big minimal width instead of determining it automatically from the items width.
Prevent the default wxWindow-level wxEVT_ERASE_BACKGROUND handler from being
used in wxUniv for wxHtmlWindow. This is unnecessary as it has its own handler
anyhow and also doesn't work for some reason as erasing wxMemoryDC by drawing
a solid rectangle over it seems to be broken in at least wxX11.
Work around this problem by erasing the background in wxHtmlWindow itself if
no user-defined (as opposed to any, including one defined in wxWindow itself)
handler for this event exists.
Handle kCGImageAlphaNoneSkipFirst correctly in wxOSX wxBitmap code.
The code tested twice for kCGImageAlphaNoneSkipLast which was clearly wrong.
The original intention was probably to check for both it and
kCGImageAlphaNoneSkipFirst, so fix it to this now.
Document that wxDCClipper currently resets clipping region.
Unlike other similar classes, this one doesn't restore the previous clipping
region but just resets it because there is no way to get the current clipping
region from wxDC now. At least document this limitation until it can be fixed.
Fixed floating image layout when typing in subsequent paragraph
Now makes use of max size for images and keeps the image size reasonable
Added original image size so can usually avoid reloading image when recomputing
cached bitmap size
Takes into account bottom of the last floating image so scrollbars are
set correctly
Original image size is shown in disabled size controls
Paul Cornett [Tue, 24 Apr 2012 05:38:12 +0000 (05:38 +0000)]
Remove code to find topmost X window in SetTransparent().
The purpose of this code is unknown, but it may be intended to make WM
decorations transparent. But it causes a crash when docking an AUI panel.
And in my testing the decorations are transparent even without this code.
Fixes #4841
Don't set focus to hidden window in wxSetFocusToChild().
The window that had focus previously could be hidden now, but its parent could
be hidden as well so it's not enough to set focus to it but we need to loop
until we find a visible ancestor.
Stefan Csomor [Tue, 17 Apr 2012 16:57:12 +0000 (16:57 +0000)]
avoiding potential mismatch between true and expected state of wxGraphicsContext because it might have been changed through its direct API meanwhile, fixes #14226
Fix type mismatch in wxLogTrace() call in wxSocket.
Cast socket handle to a 32 bit value as we use it with "%d" (or "%u" now as it
makes more sense) format specifier to avoid problems with type mismatches
under Win64.
Add wxFSInputStream providing stream interface to wxFileSystem.
This class allows using virtual wxFSFiles with any wx functions taking
streams. E.g. it makes it possible to load images and animations from
wxFileSystem.
This stream allows to wrap another stream. This is a useful base class for
adapter classes providing stream interface on top of something else, like the
upcoming wxFSInputStream.
This function can be used to obtain language/locale-independent representation
of an accelerator. This is particularly useful for storing it in configuration
files.
Call wxThread::OnExit() from wxThread::Exit() in wxMSW too.
Exit() is documented to call OnExit() and the pthreads version of wxThread did
behave as documented, so make wxMSW follow it as well and explicitly call
OnExit() before exiting the thread.
No real changes, just add extra brackets to wxGTK_CONV() macro.
These brackets are probably not really necessary but add them just in case
they can help with parsing some strange expressions and for consistency with
the other wxGTK_CONV_XXX() macros.
This file doesn't seem to be needed and the open() declaration in it actually
results in errors when using the latest gccxml from cvs under Windows, so just
get rid of it entirely.
Set the menu itself as event object for EVT_MENU_{OPEN,CLOSED} in wxMSW.
Make wxMSW consistent with the other ports and set the menu itself, not the
window it is attached to, as the event object for the menu open/close events.
Reuse wxMenu::SendEvent() from wxFrameBase::ProcessCommand().
Not only this avoids code duplication but it also fixes wrong code in
wxFrameBase version as it set the event object incorrectly to the frame itself
instead of setting it to the menu.
Added event object check to the menu events unit test.
Add a very simple unit test checking for menu events.
Just verify that an event with the expected id was generated. The test will be
extended later to test for other event fields such as its source object,
see #1595.
Use wxFrame::FindItemInMenuBar() in ProcessCommand().
Don't duplicate FindItemInMenuBar() code in ProcessCommand() and, more
importantly, use the overridden version of FindItemInMenuBar() in MDI parent
frame in wxMSW to allow using ids corresponding to the active child frame menu
items.
Don't change the icon when editing wxDataViewIconText cells in generic version.
wxDataViewIconTextRenderer changed the icon to that of the last item drawn by
it when editing a cell. Fix this by getting the original icon directly from
the model instead of from the last item.
Hide combobox popup when it is hidden itself in wxMSW.
It was possible to hide the main part of a combobox control but keep its popup
shown and this notably happened in wxGrid when TAB was pressed while a
wxChoice cell editor was dropped down.
Avoid this Cheshire combobox syndrome by explicitly dismissing the popup when
a combobox is hidden.
Fix handling of the main window of composite controls in wxMSW wxToolTip.
The main window itself should be added using DoAddHWND() and not
AddOtherWindow() as it is not, precisely, "other". This fixes removing and
updating it twice unnecessarily.
No real changes, just use clearer names for wxMSW wxToolTip methods.
Rename wxToolTip::DoAddOtherWindow() to DoAddHWND() as it should be used for
adding any window associated with the tooltip, either the main or an auxiliary
one. And rename wxToolTip::Add() to AddOtherWindow() because it shouldn't be
used for the main window.
Really fix source coordinates handling in wxDC::Blit() in wxMSW.
It turns out that the changes r71028 were unnecessary (and actually harmful)
in most cases, they're only needed when a DIB is used as a source DC. So move
the manual coordinates adjustments to the branch of code using StretchDIBits()
and don't do it anywhere else.
Also don't list this as an incompatible change as wxMSW actually already
worked as the other ports in the majority of cases and list it as a simple bug
fix instead.
Fix wxRadioButtons without explicit wxRB_GROUP styles in wxGTK.
If two radio buttons are created consecutively, they should be part of the
same radio group, even if wxRB_GROUP hadn't been explicitly used for the first
of them.
Do this is for consistency with wxMSW and also because the alternative
behaviour doesn't make much sense.
Also stop iterating too far backwards when searching for the group to be used
for a new radio button and add comments explaining what's going on here.
Remove obsolete header used only with CodeWarrior MetroWerks compiler.
This compiler doesn't exist for modern OS X systems, no need to have the
headers used only with it as they just clatter the include directory and
confuse various tools parsing wx headers.