Vadim Zeitlin [Wed, 11 Jan 2012 13:42:06 +0000 (13:42 +0000)]
Only declare wxDialog::SetWindowStyleFlag() when wxUSE_DIALOG_SIZEGRIP.
This method was only defined when wxUSE_DIALOG_SIZEGRIP==1 so avoid declaring
it when wxUSE_DIALOG_SIZEGRIP==0 to fix compilation in this case (i.e. under
Windows CE).
Vadim Zeitlin [Tue, 10 Jan 2012 23:11:39 +0000 (23:11 +0000)]
Fix UI in generic wxListCtrl when pressing cursor arrows while editing.
Pressing Up/Down keys while editing an item changed the selection but left the
in-place editing control on the previously selected item which was just wrong.
Ignore these keys to avoid it.
Notice that there is an underlying bug somewhere in wxGTK because we shouldn't
be getting these events in the first place while the in-place editing text
control has focus but it doesn't seem easy to fix so work around it here.
Fixed clicking on MSW slider not changing value with small ranges.
If the range was 9 or less the SetPageSize call would pass a page size of 0, resulting in the value not being changed when clicking on the slider area (outside the thumb). Fix this by at least passing a page size of 1 to SetPageSize.
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).