Vadim Zeitlin [Mon, 9 Jan 2012 18:48:42 +0000 (18:48 +0000)]
Add check for _T() to svn pre-commit hook.
_T() shouldn't be used in any new code so don't allow committing it.
We could have used "svnlook diff" instead of "svnlook cat" and check only for
_T() not being added but in practice there shouldn't be any difference and
using "cat" is simpler.
Vadim Zeitlin [Mon, 9 Jan 2012 18:48:34 +0000 (18:48 +0000)]
Resolve ambiguity between two wxAuiNotebook overloads.
wxAuiNotebook-specific InsertPage() and the version inherited from
wxBookCtrlBase were ambiguous if used with default values for their 2 last
arguments. Resolve this by removing defaults from the inherited version.
Vadim Zeitlin [Sun, 8 Jan 2012 14:52:51 +0000 (14:52 +0000)]
Don't generate drag events without valid item in wxGenericListCtrl.
Dragging the mouse from the empty area of the control must not generate any
drag events as there is nothing to drag there. Also, MSW version doesn't do
it.
So fix the generic version to avoid generating such invalid drag events too by
checking that we have a valid item before checking that we're dragging.
Vadim Zeitlin [Sun, 8 Jan 2012 14:52:47 +0000 (14:52 +0000)]
Add wxTopLevelWindow::SetRepresentedFilename().
This currently is only implemented under OS X and sets the proxy icon there
but could be implemented to do something useful under the other platforms too
in the future.
Vadim Zeitlin [Sat, 7 Jan 2012 15:09:54 +0000 (15:09 +0000)]
Improve column auto-sizing code in generic wxListCtrl.
Take the width of the header itself into account when setting width to
wxLIST_AUTOSIZE.
Also refactor the code to reuse the code used in wxLIST_AUTOSIZE_USEHEADER
case in SetColumnWidth() when inserting or updating the column width to this
value.
Vadim Zeitlin [Sat, 7 Jan 2012 15:09:51 +0000 (15:09 +0000)]
Add support for wxLIST_AUTOSIZE_USEHEADER to InsertColumn().
Use the fixed default width in InsertColumn() by default for compatibility but
allow more useful behaviour in it by supporting wxLIST_AUTOSIZE_USEHEADER as
well.
In the vast majority of cases, columns are just appended to the end and not
inserted at arbitrary positions in wxListCtrl so provide a convenient wrapper
to do this, especially as it's really trivial to do it now when it can be done
only once at wxListCtrlBase level.
Vadim Zeitlin [Sat, 7 Jan 2012 15:09:43 +0000 (15:09 +0000)]
Implement best size calculation for report mode wxListCtrl.
Use the column labels to determine the minimal width required by the control
to show them all in full.
Also declare all image list and column-related wxListCtrl methods in
wxListCtrlBase now as we need some of them in DoGetBestClientSize()
implementation.
Vadim Zeitlin [Thu, 5 Jan 2012 12:51:42 +0000 (12:51 +0000)]
Ensure that wxListEvent::m_itemIndex and m_item.m_itemId are in sync.
Unfortunately we have two ways to get the item affected by wxListEvent: via
its m_itemIndex (or GetIndex()) and m_item.m_itemId (or GetItem()). This can't
be changed for the usual backwards compatibility reasons but at least make
sure that both contain the same values in the events sent by the generic
version (MSW one already did it).
Vadim Zeitlin [Thu, 5 Jan 2012 12:51:40 +0000 (12:51 +0000)]
Don't fill wxListEvent::m_item when using virtual list control in wxMSW.
When using virtual list control the main program already has the items data so
it's completely useless to call GetItem() when preparing an event for it. It
is also inefficient to call GetItem() for potentially many items.
For both of these reasons the generic version already didn't fill the item
contents for virtual list controls events. Now modify wxMSW to not do it
neither.
Vadim Zeitlin [Thu, 5 Jan 2012 12:51:37 +0000 (12:51 +0000)]
Initialize wxListItem::m_itemId to -1, not 0.
Currently we have two redundant pieces of data in wxListEvent: m_itemIndex and
m_item.m_itemId. The former is initialized to -1 by default which makes sense
as it means "no item". But the latter was 0 by default which not only didn't
make sense but also made it inconsistent with m_itemIndex for the events which
really didn't have any associated item.
Vadim Zeitlin [Tue, 3 Jan 2012 00:40:27 +0000 (00:40 +0000)]
Document wxIMAGE_OPTION_CUR_HOTSPOT_[XY] in wxCursor ctor.
These options were already mentioned in wxCursor documentation but not
prominently enough, so mention them explicitly in the documentation of
wxCursor ctor from wxImage.
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.