Vadim Zeitlin [Sun, 26 Aug 2012 16:35:02 +0000 (16:35 +0000)]
Avoid crashes when creating initially hidden MDI child under Unity.
Ignore "hide" signals for the menus without associated shown window. Ubuntu
Unity sends them and we crashed because of a recursive assert in the
corresponding signal handler before.
Now the code doesn't crash any more but the menus still don't behave correctly
when the last MDI child is destroyed.
Václav Slavík [Sat, 25 Aug 2012 11:14:44 +0000 (11:14 +0000)]
Make sure wchar_t CRT functions work on OS X.
In OS X and iOS, wchar_t CRT functions convert to char* and fail under
some locales. The safest fix is to set LC_CTYPE to UTF-8 to ensure that
they can handle any input.
Note that this must be done for any app, Cocoa or console, whether or
not it uses wxLocale.
See http://stackoverflow.com/questions/11713745/why-does-the-printf-family-of-functions-care-about-locale
Vadim Zeitlin [Wed, 15 Aug 2012 23:34:31 +0000 (23:34 +0000)]
Fix AUI appearance when a maximized pane becomes floating.
The other panes were not previously restored, resulting in bad appearance and
behaviour. Do restore them now before making the previous maximized pane
floating.
Vadim Zeitlin [Wed, 15 Aug 2012 23:34:18 +0000 (23:34 +0000)]
Honour window min and max sizes in wxWindow::GetBestSize().
The best size of the window should be at least as large as its min size and
less than its max size. This allows to override the windows own best size
determination with an explicit SetMinSize() or SetMaxSize() call.
Vadim Zeitlin [Wed, 15 Aug 2012 23:34:10 +0000 (23:34 +0000)]
Don't generate events from wxSpinCtrl::SetRange() in wxMSW.
Other ports don't send wxEVT_COMMAND_SPINCTRL_UPDATED from SetRange() even if
the value changed because it was adjusted to fit into the new range and this
makes sense as this change is not due to a user action, so don't send this
event under wxMSW neither.
Vadim Zeitlin [Wed, 15 Aug 2012 11:34:46 +0000 (11:34 +0000)]
Restore the use of wxListCtrl in report view in wxListbook.
This reverts r71965 for wxMSW as the list mode there doesn't work correctly if
there are sufficiently many items: the native control insists on laying them
out in multiple columns which is inappropriate for wxListbook, so use report
mode for horizontal wxListbooks. Do use the list mode in the vertical case as
we do want to have multiple columns -- and not rows -- then.
Vadim Zeitlin [Wed, 15 Aug 2012 11:34:43 +0000 (11:34 +0000)]
Fixes for forwarding events to parent in wxGenericListCtrl.
Set the event object and the event ID correctly, i.e. to the values
corresponding to the main wxListCtrl itself, when forwarding mouse and
keyboard events from wxListMainWindow to wxListCtrl.
Vadim Zeitlin [Sat, 11 Aug 2012 23:09:33 +0000 (23:09 +0000)]
Update the icon of a parent item without children in wxDataViewCtrl.
Ensure that a parent item that doesn't have any children any more isn't left
with a "-" expander icon, it can't be collapsed any more but only expanded
again (possibly adding children under it dynamically). This results in better
behaviour in e.g. the last page of the dataview sample where the container
item remained with a "+" icon even after its both children were deleted.
Vadim Zeitlin [Sat, 11 Aug 2012 23:09:29 +0000 (23:09 +0000)]
Really delete the item in wxDataViewTreeStore::DeleteItem().
For some incomprehensible reason only child branches were ever deleted from
the list of parents children in DeleteItem(), not simple tree items. This
meant that reexpanding a node after deleting all its children showed the
previously "deleted" children again.
Václav Slavík [Thu, 9 Aug 2012 15:52:15 +0000 (15:52 +0000)]
Show progress of printing in wxMSW.
Add the number of the page being printed as well as the total to the
wxMSW printing progress window. Improved the layout and fixed some i18n
issues in the process.
Václav Slavík [Thu, 9 Aug 2012 15:52:08 +0000 (15:52 +0000)]
Return wxPrintAbortDialog from CreateAbortWindow().
Instead of returning a generic wxWindow*, return the type actually used.
It was part of the public header already, but not used in any publicly
visible way.
Václav Slavík [Thu, 9 Aug 2012 15:52:04 +0000 (15:52 +0000)]
Create wxPrintAbortDialog more sensibly.
Instead of having an empty constructor and filling the dialog with
controls from outside, do the work in the constructor.
This changes the meaning of ctor's 'title' argument, but this class'
terrible API made it unusable for direct use anyway, so it doesn't seem
to be harmful.
Václav Slavík [Tue, 7 Aug 2012 10:12:09 +0000 (10:12 +0000)]
Make the modal print preview window behave like a modal dialog.
It's unexpected for a modal dialog window to show up in the taskbar as
app's another window. It also shouldn't be possible to minimize a modal
window, because it's very confusing when a window is unresponsive
without a clear reason, because the modal child is hidden in the
taskbar.
Set wxFRAME_NO_TASKBAR and remove wxMINIMIZE_BOX to fix this. Do it only
for wxPreviewFrame_AppModal.
Václav Slavík [Mon, 6 Aug 2012 12:28:58 +0000 (12:28 +0000)]
Don't crash in wxBitmap::AllocExclusive().
Just use the usual pattern, instead of abusing existing m_refData. In
addition to being cleaner and easier to follow, it also has the benefit
of not crashing when cloning ref data into an UnRef()ed bitmap from
AllocExclusive().
Vadim Zeitlin [Mon, 6 Aug 2012 11:06:45 +0000 (11:06 +0000)]
A better fix for wxHash{Map,Set} with g++ 4.7.
This reverts r70556, i.e. removes the scope operators added by it to all
WX_DECLARE_HASH_{MAP,SET} macros, and implements a workaround for the problem
due to the use of empty base class optimization in g++ 4.7 standard library
implementations inside the macros themselves by prepending the hasher and
comparator classes with explicit "struct".
Vadim Zeitlin [Sun, 5 Aug 2012 22:44:26 +0000 (22:44 +0000)]
Fix uniconizing hidden top level windows in wxMSW.
wxTLW wasn't properly restored if Iconize(false) was called while the window
was hidden.
Fix this by adding yet another special case to wxTopLevelWindowMSW::Show().
This makes it even less comprehensible than before but there doesn't seem to
be any obvious way to simplify this code without totally changing it.
Vadim Zeitlin [Sun, 5 Aug 2012 22:44:21 +0000 (22:44 +0000)]
Fix the checkbox cell size in generic wxDataViewToggleRenderer.
r62940 fixed an appearance problem with the checkboxes in wxDataViewCtrl but
introduced another one: as the checkbox was now always drawn in the entire
cell rectangle, the cell alignment was not taken into account any more.
Fix this by only increasing the checkbox rectangle up to the required minimal
size but not any more.
Vadim Zeitlin [Sun, 5 Aug 2012 22:44:18 +0000 (22:44 +0000)]
Add webview library in MSVC-specific setup.h.
wxNO_WEBVIEW_LIB was documented but not implemented: webview library was never
linked in implicitly at all. Fix this by adding the missing #pragma to
msvc/wx/setup.h.
Robin Dunn [Thu, 2 Aug 2012 20:25:16 +0000 (20:25 +0000)]
Enable the wxMediaCtrl backend for wxOSX-cocoa in the build and fix some bugs that were causing it to not send the EVT_MEDIA_LOADED events and to not have a valid best size set. Closes #13065
Paul Cornett [Thu, 2 Aug 2012 16:25:14 +0000 (16:25 +0000)]
Fix wxGCDC::Clear() for Cairo, and possibly MSW.
Maximum positive coordinate Cairo can handle is 2^23 - 1.
Also convert coordinates to logical so it works right with modified origin or scale.
See #14529
Fix comparisons of char and wchar_t with wxUniChar[Ref].
Comparisons didn't work correctly in the other direction as they were not
reversed as needed. Fix this by adding wxDEFINE_COMPARISON_REV() macro which
defines comparisons in terms of the reverse operations and use it for both
wxUniChar and wxUniCharRef.
Default user-locale-dependent LCID may be inappropriate for some situations,
notably Microsoft Excel uses localized formula names for non-English LCIDs.
So add a way to change the LCID to use at wxAutomationObject level while
preserving the old behaviour by default.
The text data should use CR LF EOLs under Windows but the data inside the
program typically has only LF EOLs, so translate between them automatically in
wxTextDataObject.
No real changes, just use accessors in wxTextDataObject.
Use {Set,Get}Text() instead of using m_text directly in wxTextDataObject as
these virtual methods overridable and should be called in case the class
doesn't actually use m_text for its storage at all.
Fix bug in wxNumberFormatter::ToString() for negative numbers.
Don't include the possible leading sign in the span of digits to be grouped as
this gave nonsensical strings such as "-,123" when adding thousands separators
to "123".
Warn if key presses occur when the input window doesn't have focus as the
usual key events are not generated then which could be understood as a bug in
the sample instead of the correct result.
Generate clipboard events for wxComboBox in wxGTK too.
These events were only generated for wxTextCtrl but should be sent for
non-readonly wxComboBox too, so refactor the code to allow its reuse from
wxComboBox.
Also add EVT_TEXT_PASTE handlers for both controls to the widgets sample for
testing.
Revert HasModifiers() change in behaviour, add HasAnyModifiers().
In 2.8 wxKeyEvent::HasModifiers() returned false if (only) Shift was pressed
as it tested for Control and Alt only but when it was moved to wxKeyboardState
in r55745 it started checking for all modifiers as this made more sense now
that it was used by wxMouseEvent. However it broke existing code using it,
including in wxWidgets itself (in wxTreeCtrl), so revert it now and add
HasAnyModifiers() that does check for all modifiers, including Shift.
Add a wxGTK-specific function to set wxNotificationMessage icon name.
It's trivial to use a stock icon with the given name in wxGTK with libnotify,
so provide a way to do it. However this is not as simple as that in other
implementations (notably Windows), so make it private to this port for now.
In the future we should try to support arbitrary wxIcons as well as extend
wxIconLocation to support FreeDesktop stock icon names.