diff options
-rw-r--r-- | dbaccess/source/ui/browser/brwview.cxx | 51 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/dbtreeview.cxx | 16 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/dbtreeview.hxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/brwview.hxx | 5 |
4 files changed, 67 insertions, 11 deletions
diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index 654511861930..623bb1bd243f 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -2,9 +2,9 @@ * * $RCSfile: brwview.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: oj $ $Date: 2001-01-09 15:52:33 $ + * last change: $Author: oj $ $Date: 2001-03-19 12:39:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,11 +86,18 @@ #ifndef _DBU_RESOURCE_HRC_ #include "dbu_resource.hrc" #endif +#ifndef _COM_SUN_STAR_FORM_XLOADABLE_HPP_ +#include <com/sun/star/form/XLoadable.hpp> +#endif +#ifndef _SBA_BWRCTRLR_HXX +#include "brwctrlr.hxx" +#endif using namespace dbaui; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::form; // using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; @@ -258,10 +265,46 @@ sal_uInt16 UnoDataBrowserView::ViewColumnCount() const void UnoDataBrowserView::GetFocus() { Window::GetFocus(); - if (m_pVclControl) - m_pVclControl->GrabFocus(); + if (m_pVclControl && m_xGrid.is()) + { + sal_Bool bGrabFocus = sal_True; + if(!m_pVclControl->HasChildPathFocus()) + { + Reference<XChild> xChild(m_xGrid->getModel(),UNO_QUERY); + Reference<XLoadable> xLoad; + if(xChild.is()) + xLoad = Reference<XLoadable>(xChild->getParent(),UNO_QUERY); + bGrabFocus = !(xLoad.is() && xLoad->isLoaded()); + if(!bGrabFocus) + m_pVclControl->GrabFocus(); + } + if(bGrabFocus && m_pTreeView) + m_pTreeView->GrabFocus(); + } + else if(m_pTreeView) + m_pTreeView->GrabFocus(); } // ------------------------------------------------------------------------- +long UnoDataBrowserView::PreNotify( NotifyEvent& rNEvt ) +{ + long nDone = 0L; + if(rNEvt.GetType() == EVENT_KEYINPUT) + { + const KeyEvent* pKeyEvt = rNEvt.GetKeyEvent(); + const KeyCode& rKeyCode = pKeyEvt->GetKeyCode(); + if(rKeyCode == KeyCode(KEY_E,TRUE,TRUE,FALSE)) + { + if(m_pTreeView && m_pVclControl->HasChildPathFocus()) + m_pTreeView->GrabFocus(); + else + m_pVclControl->GrabFocus(); + nDone = 1L; + } + } + return nDone ? nDone : Window::PreNotify(rNEvt); +} +// ----------------------------------------------------------------------------- + diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx index 7364b39b36a1..cec57bb91af3 100644 --- a/dbaccess/source/ui/browser/dbtreeview.cxx +++ b/dbaccess/source/ui/browser/dbtreeview.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dbtreeview.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: fs $ $Date: 2000-12-10 16:12:01 $ + * last change: $Author: oj $ $Date: 2001-03-19 12:39:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -167,8 +167,18 @@ void DBTreeView::setSelectHdl(const Link& _rHdl) { m_pTreeListBox->SetSelectHdl(_rHdl); } +// ----------------------------------------------------------------------------- +long DBTreeView::PreNotify( NotifyEvent& rNEvt ) +{ + long nDone = 0L; + if(rNEvt.GetType() == EVENT_GETFOCUS && m_pTreeListBox) + { + m_pTreeListBox->GrabFocus(); + nDone = 1L; + } + return nDone ? nDone : Window::PreNotify(rNEvt); +} -// ------------------------------------------------------------------------- // ......................................................................... } // namespace dbaui diff --git a/dbaccess/source/ui/browser/dbtreeview.hxx b/dbaccess/source/ui/browser/dbtreeview.hxx index 89beb27ac2e2..1fe0f456712c 100644 --- a/dbaccess/source/ui/browser/dbtreeview.hxx +++ b/dbaccess/source/ui/browser/dbtreeview.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dbtreeview.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: fs $ $Date: 2000-12-10 16:12:01 $ + * last change: $Author: oj $ $Date: 2001-03-19 12:39:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -109,6 +109,8 @@ namespace dbaui void setSelectHdl(const Link& _rHdl); DBTreeListBox* getListBox() const; + + virtual long PreNotify( NotifyEvent& rNEvt ); }; } diff --git a/dbaccess/source/ui/inc/brwview.hxx b/dbaccess/source/ui/inc/brwview.hxx index 6146ffa25b9a..9f9508dddc04 100644 --- a/dbaccess/source/ui/inc/brwview.hxx +++ b/dbaccess/source/ui/inc/brwview.hxx @@ -2,9 +2,9 @@ * * $RCSfile: brwview.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-01-09 16:03:40 $ + * last change: $Author: oj $ $Date: 2001-03-19 12:43:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -123,6 +123,7 @@ namespace dbaui void setSplitter(Splitter* _pSplitter); void setTreeView(DBTreeView* _pTreeView); + virtual long PreNotify( NotifyEvent& rNEvt ); protected: virtual void GetFocus(); virtual void resizeControl(Rectangle& rRect); |