Vadim Zeitlin [Thu, 30 Aug 2012 20:24:12 +0000 (20:24 +0000)]
Remove wxOSX implementation of wxSpinCtrl and use the generic one.
wxOSX doesn't provide a native spinner+text control so it used a generic
implementation of wxSpinCtrl but a different one to the version found in
src/generic/spinctlg.cpp.
Just use the real generic version instead, it doesn't make sense to have two
different versions of the same generic control.
Vadim Zeitlin [Thu, 30 Aug 2012 20:23:49 +0000 (20:23 +0000)]
Refactor text to/from double conversion in wxSpinCtrlGenericBase.
The code always used ToDouble() and Format("%g") which was a bit strange for
integer-valued wxSpinCtrl. Move the conversions to their own virtual functions
for clarity, perhaps correctness and, especially, flexibility as they will be
overridden in wxSpinCtrl soon.
Also move wxSpinCtrlGenericBase::m_format to wxSpinCtrlDouble as the base
class really doesn't need it at all.
Vadim Zeitlin [Thu, 30 Aug 2012 20:23:03 +0000 (20:23 +0000)]
Fix position carried in wxSpin{Button,Ctrl} events for 32 bit values in wxMSW.
Don't use WM_VSCROLL message parameter as the position because it's a 16 bit
value and is not enough for the spin controls using 32 bit range. Just use the
current value available from the control itself instead.
This fixes assert failures in the spin page of the widgets sample when
changing the value of a control when it is > SHRT_MAX.
Vadim Zeitlin [Thu, 30 Aug 2012 20:22:40 +0000 (20:22 +0000)]
Use wxSOCKET_WAITALL in wxHTTP to ensure that all data is sent.
POST-ing sufficiently big amounts of data in wxHTTP didn't work because it
couldn't be sent all at once to the server. Use wxSOCKET_WAITALL to ensure
that we do send all of the data.
Vadim Zeitlin [Thu, 30 Aug 2012 20:22:17 +0000 (20:22 +0000)]
Fix bugs in parsing wxLongLong values starting with zeroes.
wxCRT_StrtoullBase(), used by wxString::To[U]LongLong(), didn't handle leading
zeroes nor leading 0x correctly: it never auto-detected base 8; didn't ignore
the leading 0 even if base 8 was specified explicitly; didn't recognize "0X"
prefix at all (only "0x").
Fix all these bugs and add test cases for parsing numbers in other bases to
the unit tests.
Vadim Zeitlin [Thu, 30 Aug 2012 20:21:54 +0000 (20:21 +0000)]
Added wxSimplebook class: a wxBookCtrl without controller.
This new control allows the program to show one of the several pages without
allowing the user to change them (or even see that there are several of them)
himself.
This class is fully inline, so it doesn't add anything to the library and
hence doesn't need neither wxUSE_SIMPLEBOOK nor the corresponding configure
option.
Vadim Zeitlin [Thu, 30 Aug 2012 20:21:29 +0000 (20:21 +0000)]
Virtualize showing/hiding the pages in wxBookCtrlBase.
No real changes, just make it possible to change how the pages are hidden and
shown in the derived classes. This is not used by any of them yet, but will be
used by wxSimplebook soon.
Vadim Zeitlin [Thu, 30 Aug 2012 20:19:57 +0000 (20:19 +0000)]
Use wmain() if supported by the compiler/CRT instead of main().
This avoids a needless conversion from (originally Unicode) command line to
ANSI by the CRT and conversion back by wxWidgets and, especially, ensures that
there is no data loss if the Unicode command line arguments can't be converted
into the current charset.
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.