diff options
author | Ocke Janssen <oj@openoffice.org> | 2002-02-11 12:02:08 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2002-02-11 12:02:08 +0000 |
commit | 5c49431dec80a83b03533b66f6be62a8d8b11038 (patch) | |
tree | bc9bba9ab4fdda995ab47322a67e25a8af716a7c | |
parent | a615af5c4bdb3c4f68e68b77babcb85ec20a78e2 (diff) |
#90580# enable F6 key for components
-rw-r--r-- | dbaccess/source/ui/dlg/adtabdlg.cxx | 13 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/JoinDesignView.cxx | 14 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/JoinTableView.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/QueryDesignView.cxx | 62 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/QueryViewSwitch.cxx | 21 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/querycontainerwindow.cxx | 58 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableDesignView.cxx | 6 |
7 files changed, 119 insertions, 61 deletions
diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index 47ed949925d7..679bcd456aee 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: adtabdlg.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: oj $ $Date: 2001-08-24 06:39:26 $ + * last change: $Author: oj $ $Date: 2002-02-11 13:02:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -200,17 +200,12 @@ void OAddTableDlg::AddTable() //------------------------------------------------------------------------------ IMPL_LINK( OAddTableDlg, AddClickHdl, Button*, pButton ) { - if (IsAddAllowed()) - AddTable(); - - if (!IsAddAllowed()) - Close(); - + TableListDoubleClickHdl(NULL); return 0; } //------------------------------------------------------------------------------ -IMPL_LINK( OAddTableDlg, TableListDoubleClickHdl, ListBox *, pListBox ) +IMPL_LINK( OAddTableDlg, TableListDoubleClickHdl, ListBox *, EMPTY_ARG ) { if (IsAddAllowed()) AddTable(); diff --git a/dbaccess/source/ui/querydesign/JoinDesignView.cxx b/dbaccess/source/ui/querydesign/JoinDesignView.cxx index 2c297456152a..70ee391300ef 100644 --- a/dbaccess/source/ui/querydesign/JoinDesignView.cxx +++ b/dbaccess/source/ui/querydesign/JoinDesignView.cxx @@ -2,9 +2,9 @@ * * $RCSfile: JoinDesignView.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: oj $ $Date: 2001-10-26 07:57:11 $ + * last change: $Author: oj $ $Date: 2002-02-11 12:52:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -124,6 +124,7 @@ #ifndef DBAUI_JOINTABLEVIEW_HXX #include "JoinTableView.hxx" #endif +// #include <com/sun/star/util/URL.hdl> using namespace ::dbaui; using namespace ::com::sun::star::uno; @@ -132,9 +133,10 @@ using namespace ::com::sun::star::i18n; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; +using namespace ::com::sun::star::util; OJoinDesignView::OJoinDesignView(Window* _pParent, OJoinController* _pController,const Reference< XMultiServiceFactory >& _rFactory) - :ODataView(_pParent,_rFactory) + :ODataView(_pParent,_pController,_rFactory) ,m_pController(_pController) ,m_pTableView(NULL) ,m_pAddTabDlg(NULL) @@ -212,9 +214,3 @@ void OJoinDesignView::KeyInput( const KeyEvent& rEvt ) m_pTableView->KeyInput( rEvt ); } // ----------------------------------------------------------------------------- - - - - - - diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index e2b0eb84e394..5da52bd3c002 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.27 $ + * $Revision: 1.28 $ * - * last change: $Author: oj $ $Date: 2002-02-08 09:09:36 $ + * last change: $Author: oj $ $Date: 2002-02-11 12:53:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1658,7 +1658,7 @@ void OJoinTableView::childCountChanged(sal_Int32 _nOldCount) pController->InvalidateFeature(ID_BROWSER_ADDTABLE); pController->InvalidateFeature(ID_RELATION_ADD_RELATION); if ( m_pAccessible ) - m_pAccessible->notifyAccesibleEvent(3/* AccessibleEventId::ACCESSIBLE_CHILD_EVENT */,makeAny(_nOldCount),makeAny(GetTabWinCount() + getTableConnections()->size())); + m_pAccessible->notifyAccessibleEvent(3/* AccessibleEventId::ACCESSIBLE_CHILD_EVENT */,makeAny(_nOldCount),makeAny(GetTabWinCount() + getTableConnections()->size())); } // ----------------------------------------------------------------------------- void OJoinTableView::addConnection(OTableConnection* _pConnection) diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 32f42b504591..149814493980 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.40 $ + * $Revision: 1.41 $ * - * last change: $Author: oj $ $Date: 2002-02-06 08:08:30 $ + * last change: $Author: oj $ $Date: 2002-02-11 12:55:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2204,6 +2204,7 @@ OQueryDesignView::OQueryDesignView( OQueryContainerWindow* _pParent, :OQueryView(_pParent,_pController,_rFactory) ,m_aSplitter( this ) ,m_eChildFocus(NONE) + ,m_bInKeyEvent(sal_False) { try { @@ -2493,37 +2494,30 @@ long OQueryDesignView::PreNotify(NotifyEvent& rNEvt) switch (rNEvt.GetType()) { case EVENT_KEYINPUT: - { - const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent(); - const KeyCode& rCode = pKeyEvent->GetKeyCode(); - if (rCode.IsMod1() || rCode.IsMod2()) - break; - if (rCode.GetCode() != KEY_F6) - break; - - if (m_pTableView && m_pTableView->HasChildPathFocus()) { - if (m_pSelectionBox) + const KeyCode& rCode = rNEvt.GetKeyEvent()->GetKeyCode(); + if (!rCode.IsMod1() && !rCode.IsMod2() && rCode.GetCode() == KEY_F6) { - m_pSelectionBox->GrabFocus(); - bHandled = TRUE; - } - } - else if (m_pSelectionBox && m_pSelectionBox->HasChildPathFocus()) - { - if (m_pTableView) - { - m_pTableView->GrabTabWinFocus(); - bHandled = TRUE; + if ( m_pSelectionBox && m_pTableView && m_pTableView->HasChildPathFocus() && !rCode.IsShift() ) + { + m_pSelectionBox->GrabFocus(); + m_eChildFocus = SELECTION; + bHandled = sal_True; + } + else if ( m_pTableView && m_pSelectionBox && m_pSelectionBox->HasChildPathFocus() && rCode.IsShift() ) + { + m_pTableView->GrabTabWinFocus(); + m_eChildFocus = TABLEVIEW; + bHandled = sal_True; + } + else + m_bInKeyEvent = sal_True; } } - } - break; + break; } - if (!bHandled) - return OQueryView::PreNotify(rNEvt); - return 1L; + return bHandled ? 1L : OQueryView::PreNotify(rNEvt); } //------------------------------------------------------------------------------ @@ -2754,6 +2748,20 @@ OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(OTableFieldDescRef pE // ----------------------------------------------------------------------------- void OQueryDesignView::GetFocus() { + // if true then we come from a PreNotify with KeyEvent F6 + if ( m_bInKeyEvent ) + { + switch( m_eChildFocus ) + { + case TABLEVIEW: + m_pSelectionBox->GrabFocus(); + break; + default: + m_pTableView->GrabTabWinFocus(); + } + m_bInKeyEvent = sal_False; + } + // set focus if no one has the focus if (m_pTableView && !m_pTableView->HasChildPathFocus() && m_pSelectionBox && !m_pSelectionBox->HasChildPathFocus()) diff --git a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx index d8db175949aa..60a330beca7d 100644 --- a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx +++ b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx @@ -2,9 +2,9 @@ * * $RCSfile: QueryViewSwitch.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: oj $ $Date: 2002-02-06 11:35:20 $ + * last change: $Author: oj $ $Date: 2002-02-11 12:56:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -179,6 +179,23 @@ void OQueryViewSwitch::GetFocus() m_pDesignView->GetFocus(); } // ----------------------------------------------------------------------------- +void OQueryViewSwitch::GrabFocus() +{ + if ( m_pTextView && m_pTextView->IsVisible() ) + m_pTextView->GrabFocus(); + else if ( m_pDesignView && m_pDesignView->IsVisible() ) + m_pDesignView->GrabFocus(); +} +// ----------------------------------------------------------------------------- +Window* OQueryViewSwitch::getActive() const +{ + Window* pRet = m_pDesignView; + if ( m_pTextView && m_pTextView->IsVisible() ) + pRet = m_pTextView; + + return pRet; +} +// ----------------------------------------------------------------------------- void OQueryViewSwitch::setStatement(const ::rtl::OUString& _rsStatement) { if(m_pTextView->IsVisible()) diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index 74bf5988104c..ffef427757f8 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -2,9 +2,9 @@ * * $RCSfile: querycontainerwindow.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-09-20 12:56:16 $ + * last change: $Author: oj $ $Date: 2002-02-11 12:58:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -101,7 +101,7 @@ namespace dbaui //===================================================================== DBG_NAME(OQueryContainerWindow) OQueryContainerWindow::OQueryContainerWindow(Window* pParent, OQueryController* _pController,const Reference< XMultiServiceFactory >& _rFactory) - :ODataView(pParent, _rFactory) + :ODataView(pParent,_pController, _rFactory) ,m_pBeamerSeparator( NULL ) ,m_pBeamer(NULL) ,m_pViewSwitch(NULL) @@ -224,13 +224,50 @@ namespace dbaui // ----------------------------------------------------------------------------- long OQueryContainerWindow::PreNotify( NotifyEvent& rNEvt ) { - if(rNEvt.GetType() == EVENT_GETFOCUS && m_pViewSwitch) + BOOL bHandled = FALSE; + switch (rNEvt.GetType()) { - m_pViewSwitch->getDesignView()->getController()->InvalidateFeature(SID_CUT); - m_pViewSwitch->getDesignView()->getController()->InvalidateFeature(SID_COPY); - m_pViewSwitch->getDesignView()->getController()->InvalidateFeature(SID_PASTE); + case EVENT_KEYINPUT: + { + const KeyCode& rCode = rNEvt.GetKeyEvent()->GetKeyCode(); + if ( m_pViewSwitch + && !rCode.IsMod1() + && !rCode.IsMod2() + && rCode.GetCode() == KEY_F6) + { + Window* pLeft = m_pViewSwitch->getActive(); + // if ( !rCode.IsShift() ) + { + if ( m_pBeamer && pLeft && pLeft->HasChildPathFocus() ) + { + m_pBeamer->GrabFocus(); + bHandled = sal_True; + } + else if ( m_pBeamer && pLeft && m_pBeamer->HasChildPathFocus() ) + { + pLeft->GrabFocus(); + bHandled = sal_True; + } + else if ( pLeft ) + { + pLeft->GrabFocus(); + bHandled = sal_True; + } + } + } + } + + break; + case EVENT_GETFOCUS: + if ( m_pViewSwitch ) + { + OJoinController* pController = m_pViewSwitch->getDesignView()->getController(); + pController->InvalidateFeature(SID_CUT); + pController->InvalidateFeature(SID_COPY); + pController->InvalidateFeature(SID_PASTE); + } } - return ODataView::PreNotify(rNEvt); + return bHandled ? 1L : ODataView::PreNotify(rNEvt); } // ----------------------------------------------------------------------------- void OQueryContainerWindow::showPreview(const Reference<XFrame>& _xFrame) @@ -273,6 +310,8 @@ namespace dbaui Resize(); } } + // ----------------------------------------------------------------------------- + //......................................................................... } // namespace dbaui @@ -281,6 +320,9 @@ namespace dbaui /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.3 2001/09/20 12:56:16 oj + * #92232# fixes for BIGINT type and new property HELPTEXT + * * Revision 1.2 2001/09/07 10:05:58 fs * #65293# syntax * diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx index 50f6bbd78f46..5fdac4b2a9c5 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx @@ -2,9 +2,9 @@ * * $RCSfile: TableDesignView.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: oj $ $Date: 2001-10-19 12:46:24 $ + * last change: $Author: oj $ $Date: 2002-02-11 13:01:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -250,7 +250,7 @@ OTableDesignView::OTableDesignView( Window* pParent, const Reference< XMultiServiceFactory >& _rxOrb, OTableController* _pController ) : - ODataView( pParent ,_rxOrb ) + ODataView( pParent ,_pController,_rxOrb ) ,m_pController(_pController) ,m_eChildFocus(NONE) { |