Vadim Zeitlin [Thu, 29 Dec 2011 22:05:46 +0000 (22:05 +0000)]
Disable VC8+ deprecation warnings for standard functions at bakefile level.
We already define the symbols needed to disable the warnings in wx/defs.h but
this isn't enough for third party code not including it, so define them in the
project settings directly.
Vadim Zeitlin [Thu, 29 Dec 2011 22:05:31 +0000 (22:05 +0000)]
Don't send idle events to the windows about to be destroyed.
This is useless and can apparently result in some problems as of r25877 and
r25877 (from 8 years ago) added explicit checks preventing processing such
events in wxToolBar and wxMenu. Instead, simply don't generate these events in
the first place and also remove the now unnecessary checks for them.
Vadim Zeitlin [Thu, 29 Dec 2011 22:05:27 +0000 (22:05 +0000)]
Better fix for wxSpinCtrlGeneric enabling/disabling bug in wxMSW.
To really ensure that the window containing the components of wxSpinCtrlGeneric
is never enabled under MSW (as we want to avoid this to ensure that any input
always goes to its children and not the window itself, see #12045), override
DoEnable() and not Enable(). This takes care of the case when the control gets
implicitly disabled because its parent is.
Vadim Zeitlin [Thu, 29 Dec 2011 22:05:23 +0000 (22:05 +0000)]
Store row/column selection more appropriately in wxGrid.
Use wxGridSelection::m_rowSelection and m_colSelection for storing the
selected rows/columns respectively instead of storing them in m_blockXXX
arrays. This makes more sense and allows to easily implement the proper
handling of Ctrl-clicking in the row or column selection modes.
Stefan Neis [Thu, 29 Dec 2011 14:42:13 +0000 (14:42 +0000)]
Do not put semicolons after the definition of an inline function.
Even though most compilers just ignore this, it's just wrong and if you
do get warnings about header files, they can become quite overwhelming.
Forward port of r70163.
Vadim Zeitlin [Wed, 28 Dec 2011 17:47:21 +0000 (17:47 +0000)]
Restore wxEVT_MENU_CLOSE generation under Windows 95 after r70151.
WM_UNINITMENUPOPUP is "only" available since Windows 98/2000 so restore the
old code using WM_EXITMENULOOP as fall back, just to avoid any regressions for
people who might still be using these systems.
Vadim Zeitlin [Wed, 28 Dec 2011 13:51:29 +0000 (13:51 +0000)]
Add standard art providers at the bottom of the art providers stack.
This ensures that any user-defined art providers will be in front of them,
even when they are added at module-initialization time i.e. possibly before
the standard ones.
Vadim Zeitlin [Wed, 28 Dec 2011 13:51:13 +0000 (13:51 +0000)]
Use memmove() instead of memcpy() in wxString::AssignCopy().
This at least allows the code like "s = s.c_str()" to work correctly when
using our own wxString implementation, even it doesn't fix all
self-assignment-related bugs (again, when using our own implementation only,
there is no bug when using std::basic_string as underlying implementation).
Vadim Zeitlin [Tue, 27 Dec 2011 01:21:43 +0000 (01:21 +0000)]
Fix warning about non-virtual dtor in wxDataViewCtrlInternal.
This class doesn't need a virtual dtor but g++ warned about its absence
because it unnecessarily defined a virtual method. Just make this method
non-virtual to avoid the warning.
Vadim Zeitlin [Mon, 26 Dec 2011 12:57:49 +0000 (12:57 +0000)]
Increase the tolerance in wxStopWatch unit test.
Sleeping can take more time than expected when running on the build slaves,
probably because the machine is heavily loaded. Increase the tolerance to
prevent this from resulting in test failures.
Vadim Zeitlin [Sun, 25 Dec 2011 13:28:01 +0000 (13:28 +0000)]
Always link with expat in monolithic build.
Fix linking errors when using wxXML in sttaic monolithic build: in this case
we must link with expat but it was listed too early, before wxWidgets
libraries using it, in the bakefile-generated makefiles.
Now add it to the end of the linker command line too by including -lexpat in
EXTRALIBS_FOR_BASE which are appended to the linker arguments.
Notice that now -lexpat is linked twice because it is still added by
<wx-lib>xml</wx-lib> in bakefiles, even in monolithic build, but I don't know
how to avoid it and it is harmless anyhow.
Vadim Zeitlin [Sat, 24 Dec 2011 18:30:52 +0000 (18:30 +0000)]
Really fix the use of deprecated methods in wxGrid test.
The changes of r70111 were wrong, the unit test for wxGrid really did intend
to test the deprecated methods so restore them -- but only in
WXWIN_COMPATIBILITY_2_8 case.
Vadim Zeitlin [Sat, 24 Dec 2011 18:19:26 +0000 (18:19 +0000)]
Implement wxNotebook::CalcSizeFromPage() for wxGTK.
The implementation is far from perfect as it relies on hard-coded margins but
is better than nothing as it allows wxNotebook best size determination and
SetPageSize() method to work correctly.
Vadim Zeitlin [Sat, 24 Dec 2011 17:58:32 +0000 (17:58 +0000)]
Don't use deprecated methods in wxGrid test.
Don't use the methods defined only when building 2.8-compatible mode to let
the tests compile even with WXWIN_COMPATIBILITY_2_8 off. This only worked
before because of the wrong tests in grid.h but broke after the fixes of
r70098.
Vadim Zeitlin [Sat, 24 Dec 2011 15:43:12 +0000 (15:43 +0000)]
Use the correct function type cast in EVT_WEBKIT_NEW_WINDOW.
Use wxWebKitNewWindowEventHandler to perform a proper static_cast<>, which
detects incorrect casts during compilation, instead of
wxWebKitNewWindowEventFunction which was just doing an unsafe C-style cast.
Vadim Zeitlin [Thu, 22 Dec 2011 14:47:54 +0000 (14:47 +0000)]
Dramatically optimise inserting many items in wxGenericListCtrl.
During each item insertion SetItem() was called and this resulted in a call to
GetItemRect() which, in turn, re-laid out all items in the control meaning
that the relatively expensive wxListMainWindow::RecalculatePositions() was
called N times when inserting N items.
Reduce this to just a single call by not refreshing the item in SetItem() if
everything is going to be redrawn soon anyhow.
This decreases the time needed to insert a couple of thousands of items in
icon view from several minutes to less than a second.
Vadim Zeitlin [Thu, 22 Dec 2011 13:35:01 +0000 (13:35 +0000)]
Add wxLogFormatter to allow easier wxLog output customization.
Delegate the log string creation to wxLogFormatter. This allows defining a
custom object of a class derived from it to customize the log output instead
of having to override DoLogRecord() in wxLog itself.
Vadim Zeitlin [Wed, 21 Dec 2011 13:56:50 +0000 (13:56 +0000)]
Correct generic wxListCtrl display of items with icons in list mode.
The changes of r70066 improved the layout for icon and small icon modes but
broke it for the list mode if items had icons because the item width should
account for the icon as well in this case. Simply disable the code added in
this revision when in list mode, we don't need to do anything then anyhow as
the layout already worked correctly for it.
Vadim Zeitlin [Wed, 21 Dec 2011 13:56:47 +0000 (13:56 +0000)]
Guard against a possible crash in wxListCtrl::DeleteColumn().
We could crash when deleting a column after switching to report view from icon
view. As deleting a column works just fine under MSW in this case, make it
work in the generic version as well.
Vadim Zeitlin [Wed, 21 Dec 2011 13:07:18 +0000 (13:07 +0000)]
Document wxListCtrl::InReportView() and IsVirtual().
These functions are more convenient than directly testing for styles and are
already used outside wxWidgets do make them officially part of the public API.
Vadim Zeitlin [Tue, 20 Dec 2011 21:27:14 +0000 (21:27 +0000)]
Provide native implementation of wx{Date,Time}PickerCtrl for wxOSX/Cocoa.
Use NSDatePicker to implement both of these controls. Almost all of
wxDatePickerCtrl styles are not supported in the native version but the basic
functionality does work and looks much better than the generic version (which
is still available as wxDatePickerCtrlGeneric if needed) under Mac.
Vadim Zeitlin [Tue, 20 Dec 2011 21:27:09 +0000 (21:27 +0000)]
Added helpers for translating between wxDateTime and NSDate.
These functions will be used in the upcoming native implementations of
wxDatePickerCtrl and wxTimePickerCtrl but could also be reused elsewhere in
wxOSX/Cocoa, notably in wxDataViewCtrl where strange ad hoc code is currently
used.
Vadim Zeitlin [Tue, 20 Dec 2011 13:27:59 +0000 (13:27 +0000)]
Add support for webview library to MSW bakefile presets.
The webview library wasn't linked in correctly when using MSW bakefile
presets. Fix this by adding the corresponding <sys-lib> for it (this needs to
be done for MSW only, under Unix it's handled by wx-config).
Vadim Zeitlin [Mon, 19 Dec 2011 12:54:32 +0000 (12:54 +0000)]
Don't use dummy "inline" in wxDEPRECATED_CONSTRUCTOR definition.
Apparently we need this bogus "inline" for g++ < 3.4 but there is no reason to
use it for the other compilers and this results in linking errors with e.g.
MSVC, so remove it.
Fixed min and max label values not being swapped when using wxSL_INVERSE in a horizontal MSW slider.
Changed wxSlider::GetLabelsSize to let the widthMin and widthMax values contain the width of what the minimum (always on the left/top) and maximum (always on the right/bottom) _label_ will contain. This is not the same as the minimum and maximum _value_ in case of using wxSL_INVERSE.
Also don't swap the position of the min/max labels in a horizontal slider with wxSL_INVERSE (just how the labels already stay in place in a vertical slider, regardless of wxSL_INVERSE usage), nor their width.
Vadim Zeitlin [Sun, 18 Dec 2011 14:38:47 +0000 (14:38 +0000)]
Add a reminder to update version.bkl to inc_release script.
While docs/tech/tn0011.txt does document this, it's still too simple to forget
to update version.bkl, as my experience shows, so add a reminder to the script
itself too.
Vadim Zeitlin [Sun, 18 Dec 2011 12:27:04 +0000 (12:27 +0000)]
No changes, just use wxScopedPtr instead of explicit "delete".
Use wxScopedPtr in wxGenericFileDirButton to ensure that the dialog created by
it is always destroyed, even if an exception is thrown while showing the
dialog or while processing the event we generate after showing it.
Vadim Zeitlin [Sat, 17 Dec 2011 23:04:50 +0000 (23:04 +0000)]
Don't activate MSW dialogs when setting their initial size.
As the dialog is not shown yet at this moment, activating it didn't work
correctly and the dialog didn't get the focus when it was shown later.
Fix this by preventing ::SetWindowPos() from activating it, which it does by
default.
Vadim Zeitlin [Fri, 16 Dec 2011 19:57:17 +0000 (19:57 +0000)]
Don't use wxTE_DONTWRAP style in Lines() wxTextCtrl unit case.
The last check in this test couldn't pass under MSW as it relied on the (long)
line of text being wrapped but the style used for the control prevented this
from happening. Not sure how could it have ever worked before but in any case
removing wxTE_DONTWRAP does make the test pass.
Vadim Zeitlin [Fri, 16 Dec 2011 19:47:58 +0000 (19:47 +0000)]
Keep the item being updated selected in wxMSW wxChoice::SetString().
Changing the text of the selected wxChoice (or wxComboBox, as it derives from
it in wxMSW) item made it unselected. Fix this by explicitly restoring the
selection to the item if needed.
Vadim Zeitlin [Fri, 16 Dec 2011 19:47:55 +0000 (19:47 +0000)]
Corrected test for region validity in wxMSW wxRegion::DoOffset().
Checking M_REGION is not enough as the region can be invalid (meaning
m_refData dereferenced inside M_REGION is NULL itself) and not just not
initialized, so it resulted in crashes and not just the expected assert
failure when wxRegion::Offset() was called for an invalid region.