wxDocManager gets the only view if none other specified as the current view;
added ProcessEvent so views get their events processed properly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -839,6 +839,30 @@ void wxDocManager::OnRedo(wxCommandEvent& WXUNUSED(event))
|
||||
doc->GetCommandProcessor()->Redo();
|
||||
}
|
||||
|
||||
wxView *wxDocManager::GetCurrentView(void) const
|
||||
{
|
||||
if (m_currentView)
|
||||
return m_currentView;
|
||||
if (m_docs.Number() == 1)
|
||||
{
|
||||
wxDocument* doc = (wxDocument*) m_docs.First()->Data();
|
||||
return doc->GetFirstView();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Extend event processing to search the view's event table
|
||||
bool wxDocManager::ProcessEvent(wxEvent& event)
|
||||
{
|
||||
wxView* view = GetCurrentView();
|
||||
if (view)
|
||||
{
|
||||
if (view->ProcessEvent(event))
|
||||
return TRUE;
|
||||
}
|
||||
return wxEvtHandler::ProcessEvent(event);
|
||||
}
|
||||
|
||||
wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
|
||||
{
|
||||
wxDocTemplate **templates = new wxDocTemplate *[m_templates.Number()];
|
||||
|
Reference in New Issue
Block a user