diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-03-20 07:15:49 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-03-20 07:15:49 +0000 |
commit | 517ef6fcb236805dd73bf4725e5ef2beb70baf8f (patch) | |
tree | 60d6fab8fe0393eee27f438dad60e834986c625e /dbaccess/source/ui | |
parent | a9558954413548163b5a09c1a7b9eb7e873372e6 (diff) |
#84865# some focus changes
Diffstat (limited to 'dbaccess/source/ui')
7 files changed, 43 insertions, 22 deletions
diff --git a/dbaccess/source/ui/inc/RelationDesignView.hxx b/dbaccess/source/ui/inc/RelationDesignView.hxx index ee4b3c342de1..da4b683e8c73 100644 --- a/dbaccess/source/ui/inc/RelationDesignView.hxx +++ b/dbaccess/source/ui/inc/RelationDesignView.hxx @@ -2,9 +2,9 @@ * * $RCSfile: RelationDesignView.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: oj $ $Date: 2001-02-28 10:08:00 $ + * last change: $Author: oj $ $Date: 2001-03-20 08:15:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -96,6 +96,9 @@ namespace dbaui /// late construction virtual void Construct(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel); virtual void initialize(); + + + virtual long PreNotify( NotifyEvent& rNEvt ); }; } #endif // DBAUI_RELATIONDESIGNVIEW_HXX diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 5ccb422fa58d..c372c69d756d 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -2,9 +2,9 @@ * * $RCSfile: JoinController.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: fs $ $Date: 2001-03-15 08:26:26 $ + * last change: $Author: oj $ $Date: 2001-03-20 08:13:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -362,7 +362,10 @@ void OJoinController::Execute(sal_uInt16 _nId) if(!m_pAddTabDlg) m_pAddTabDlg = static_cast<OJoinDesignView*>(m_pView)->getAddTableDialog(); if(m_pAddTabDlg->IsVisible()) + { m_pAddTabDlg->Show(!m_pAddTabDlg->IsVisible()); + m_pView->GrabFocus(); + } else if(static_cast<OJoinDesignView*>(m_pView)->getTableView()->IsAddAllowed()) m_pAddTabDlg->Show(!m_pAddTabDlg->IsVisible()); break; diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index a9499f1eb8e0..444dbfc5d579 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -2,9 +2,9 @@ * * $RCSfile: JoinTableView.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: oj $ $Date: 2001-03-01 15:45:02 $ + * last change: $Author: oj $ $Date: 2001-03-20 08:13:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1490,7 +1490,7 @@ long OJoinTableView::PreNotify(NotifyEvent& rNEvt) if (pSource->GetParent() == this) // it may be one of the tab wins pSearchFor = pSource; - else if (pSource->GetParent() && (pSource->GetParent() == this)) + else if (pSource->GetParent() && (pSource->GetParent()->GetParent() == this)) // it may be one of th list boxes of one of the tab wins pSearchFor = pSource->GetParent(); @@ -1513,20 +1513,20 @@ long OJoinTableView::PreNotify(NotifyEvent& rNEvt) if (!bHandled) return Window::PreNotify(rNEvt); - return 0; + return 1L; } //------------------------------------------------------------------------------ void OJoinTableView::GrabTabWinFocus() { - if (m_pLastFocusTabWin) + if (m_pLastFocusTabWin && m_pLastFocusTabWin->IsVisible()) { if (m_pLastFocusTabWin->GetListBox()) m_pLastFocusTabWin->GetListBox()->GrabFocus(); else m_pLastFocusTabWin->GrabFocus(); } - else if (m_aTableMap.size() && m_aTableMap.begin()->second) + else if (m_aTableMap.size() && m_aTableMap.begin()->second && m_aTableMap.begin()->second->IsVisible()) { OTableWindow* pFirstWin = m_aTableMap.begin()->second; if (pFirstWin->GetListBox()) diff --git a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx index 637858cf38df..e03bee2316ee 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx @@ -2,9 +2,9 @@ * * $RCSfile: QueryDesignFieldUndoAct.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: oj $ $Date: 2001-02-05 09:20:40 $ + * last change: $Author: oj $ $Date: 2001-03-20 08:13:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -103,7 +103,9 @@ namespace dbaui sal_Int32 m_nCellIndex; public: - OTabFieldCellModifiedUndoAct(OSelectionBrowseBox* pSelBrwBox) : OQueryDesignFieldUndoAct(pSelBrwBox, STR_QUERY_UNDO_MODIFY_CELL) { } + OTabFieldCellModifiedUndoAct(OSelectionBrowseBox* pSelBrwBox) + : OQueryDesignFieldUndoAct(pSelBrwBox, STR_QUERY_UNDO_MODIFY_CELL) + ,m_nCellIndex(-1){ } void SetCellContents(const String& str) { m_strNextCellContents = str; } void SetCellIndex(sal_Int32 nIndex) { m_nCellIndex = nIndex; } diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 5417252614f1..d8490c2040e7 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -2,9 +2,9 @@ * * $RCSfile: QueryDesignView.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: fs $ $Date: 2001-03-15 08:26:26 $ + * last change: $Author: oj $ $Date: 2001-03-20 08:13:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -423,11 +423,23 @@ long OQueryDesignView::PreNotify(NotifyEvent& rNEvt) } } break; + case EVENT_GETFOCUS: + { + // set focus if noone has the focus + if (m_pTableView && !m_pTableView->HasChildPathFocus() && + m_pSelectionBox && !m_pSelectionBox->HasChildPathFocus()) + { + m_pTableView->GrabTabWinFocus(); + bHandled = TRUE; + } + + } + break; } if (!bHandled) return OQueryView::PreNotify(rNEvt); - return 0; + return 1L; } // ----------------------------------------------------------------------------- sal_Bool OQueryDesignView::HasFields() diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index 528ea75e7536..75bc5acf9049 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: TableWindowListBox.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: fs $ $Date: 2001-03-07 09:47:29 $ + * last change: $Author: oj $ $Date: 2001-03-20 08:13:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -190,7 +190,7 @@ long OTableWindowListBox::PreNotify(NotifyEvent& rNEvt) if (!bHandled) return SvTreeListBox::PreNotify(rNEvt); - return 0; + return 1L; } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index acca9f53a52b..3e193c295e76 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -2,9 +2,9 @@ * * $RCSfile: querycontroller.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: fs $ $Date: 2001-03-15 08:26:26 $ + * last change: $Author: oj $ $Date: 2001-03-20 08:13:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -282,6 +282,7 @@ void OQueryController::disposing() FeatureState OQueryController::GetState(sal_uInt16 _nId) { FeatureState aReturn; + aReturn.bEnabled = sal_True; // (disabled automatically) // aReturn.bEnabled = m_xConnection.is(); // if(!m_xConnection.is()) // so what should otherwise happen @@ -320,7 +321,7 @@ FeatureState OQueryController::GetState(sal_uInt16 _nId) aReturn.aState = ::cppu::bool2any(m_bDesign); break; case ID_BROWSER_CLEAR_QUERY: - aReturn.bEnabled = m_bEditable && m_sStatement.getLength(); + aReturn.bEnabled = m_bEditable && (m_sStatement.getLength() || m_vTableData.size()); break; case ID_BROWSER_QUERY_VIEW_FUNCTIONS: case ID_BROWSER_QUERY_VIEW_TABLES: |