Add public wxDocManager::GetAnyUsableView().
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 May 2013 23:59:43 +0000 (23:59 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 May 2013 23:59:43 +0000 (23:59 +0000)
commitde28042337df3f0ba9bfcd8f5b2c4d188f37d7dd
tree20ff0367c78046b7e84115cec3d2f9d352e8464d
parent9fe942190d37a761f3cf74d8ba72ae91612140ba
Add public wxDocManager::GetAnyUsableView().

This method tries to find the current view harder than GetCurrentView() and
always returns a non-NULL view if there are any open documents at all.

This is used by wxDocManager internally to find the view to apply the user
commands to and will also be needed in the upcoming changes outside of
wxDocManager, so just make this method public, as it seems that it could be
useful in user code too, especially if we could use some better fallback than
the first opened document (e.g. the last document the user interacted with
would be better).

This also clarifies the confusion between GetCurrentView() and GetActiveView(),
see #13296.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73925 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/docview.h
interface/wx/docview.h
src/common/docview.cpp