Tag: cws_src680_oj14 User: oj Date: 2007-05-21 10:04:45+0000 Log: #i77120# notify as system window
File Changes: Directory: /dba/reportdesign/source/ui/report/ ============================================== File [changed]: dlgedfunc.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/dlgedfunc.cxx?r1=1.1.2.2&r2=1.1.2.3 Delta lines: +186 -15 ---------------------- --- dlgedfunc.cxx 2007-05-11 09:23:51+0000 1.1.2.2 +++ dlgedfunc.cxx 2007-05-21 10:04:42+0000 1.1.2.3 @@ -4,9 +4,9 @@ * * $RCSfile: dlgedfunc.cxx,v $ * - * $Revision: 1.1.2.2 $ + * $Revision: 1.1.2.3 $ * - * last change: $Author: oj $ $Date: 2007/05/11 09:23:51 $ + * last change: $Author: oj $ $Date: 2007/05/21 10:04:42 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -40,6 +40,14 @@ #ifndef _SVDVIEW_HXX //autogen #include <svx/svdview.hxx> #endif +#include <svx/svdpagv.hxx> +#include <svx/outlobj.hxx> +#include <vcl/svapp.hxx> +#include <svx/unolingu.hxx> +#include <com/sun/star/linguistic2/XSpellChecker1.hpp> +#include <svx/svdetc.hxx> +#include <svx/editstat.hxx> +#include <svx/svdoutl.hxx> #include <svx/svddrgmt.hxx> #ifndef _SVDOASHP_HXX #include <svx/svdoashp.hxx> @@ -194,13 +202,14 @@ return TRUE; } //------------------------------------------------------------------------------ -sal_Bool DlgEdFunc::handleKeyCode(const KeyCode& _rCode) +sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) { BOOL bReturn = FALSE; OSectionView* pView = pParent->getView(); - USHORT nCode = _rCode.GetCode(); + const KeyCode& rCode = _rEvent.GetKeyCode(); + USHORT nCode = rCode.GetCode(); switch ( nCode ) { @@ -226,14 +235,14 @@ break; case KEY_TAB: { - if ( !_rCode.IsMod1() && !_rCode.IsMod2() ) + if ( !rCode.IsMod1() && !rCode.IsMod2() ) { // mark next object - if ( !pView->MarkNextObj( !_rCode.IsShift() ) ) + if ( !pView->MarkNextObj( !rCode.IsShift() ) ) { // if no next object, mark first/last pView->UnmarkAllObj(); - pView->MarkNextObj( !_rCode.IsShift() ); + pView->MarkNextObj( !rCode.IsShift() ); } if ( pView->AreObjectsMarked() ) @@ -241,11 +250,11 @@ bReturn = TRUE; } - else if ( _rCode.IsMod1() ) + else if ( rCode.IsMod1() ) { // selected handle const SdrHdlList& rHdlList = pView->GetHdlList(); - ((SdrHdlList&)rHdlList).TravelFocusHdl( !_rCode.IsShift() ); + ((SdrHdlList&)rHdlList).TravelFocusHdl( !rCode.IsShift() ); // guarantee visibility of focused handle SdrHdl* pHdl = rHdlList.GetFocusHdl(); @@ -277,9 +286,9 @@ else if ( nCode == KEY_RIGHT ) nX = 1; - if ( pView->AreObjectsMarked() && !_rCode.IsMod1() ) + if ( pView->AreObjectsMarked() && !rCode.IsMod1() ) { - if ( _rCode.IsMod2() ) + if ( rCode.IsMod2() ) { // move in 1 pixel distance const Size aPixelSize = pParent? pParent->PixelToLogic( Size( 1, 1 ) ) : Size( DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE ); @@ -427,6 +436,7 @@ break; default: { + bReturn = pView->KeyInput(_rEvent, pParent); } break; } @@ -695,7 +705,7 @@ const USHORT nDrgLog = USHORT ( pParent->PixelToLogic(Size(3,0)).Width() ); const USHORT nHitLog = USHORT ( pParent->PixelToLogic(Size(3,0)).Width() ); - if ( rMEvt.IsLeft() && rMEvt.GetClicks() == 1 ) + if ( rMEvt.IsLeft() ) { #ifdef MAC pParent->GrabFocus(); @@ -705,9 +715,21 @@ // hit selected object? if ( (pHdl!=NULL || pView->IsMarkedHit(m_aMDPos, nHitLog)) ) { + if ( rMEvt.GetClicks() == 1 ) + { pParent->getViewsWindow()->unmarkAllObjects(pView); pView->BegDragObj(m_aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog); } + // TODO character in shapes + //else + //{ + // SdrViewEvent aVEvt; + // pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); + // if ( aVEvt.pRootObj && aVEvt.pRootObj->ISA(SdrTextObj) ) + // SetInEditMode(static_cast<SdrTextObj *>(aVEvt.pRootObj),rMEvt, FALSE); + //} + + } else { SdrViewEvent aVEvt; @@ -736,7 +758,10 @@ if( !rMEvt.IsShift() ) pView->UnmarkAll(); + if ( rMEvt.GetClicks() == 1 ) pView->BegMarkObj( m_aMDPos ); + else + pView->SdrBeginTextEdit( aVEvt.pRootObj,pView->GetSdrPageView(),pParent,sal_False ); } } } @@ -762,6 +787,9 @@ bMarkAction = FALSE; + if ( pView && pView->IsAction() ) + pView->EndAction(); + pParent->SetPointer( pView->GetPreferedPointer( aPnt, pParent, nHitLog ) ); pParent->ReleaseMouse(); @@ -794,6 +822,149 @@ return TRUE; } +// ----------------------------------------------------------------------------- +//void DlgEdFuncSelect::SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, BOOL bQuickDrag) +//{ +// OSectionView* pView = pParent->getView(); +// pView->SetActualWin( pParent); +// +// SdrPageView* pPV = pView->GetSdrPageView(); +// if( _pTextObj && _pTextObj->GetPage() == pPV->GetPage() ) +// { +// pView->SetCurrentObj(OBJ_TEXT); +// pView->SetEditMode(SDREDITMODE_EDIT); +// +// BOOL bEmptyOutliner = FALSE; +// +// if (!_pTextObj->GetOutlinerParaObject() && pView->GetTextEditOutliner()) +// { +// ::SdrOutliner* pOutl = pView->GetTextEditOutliner(); +// ULONG nParaAnz = pOutl->GetParagraphCount(); +// Paragraph* p1stPara = pOutl->GetParagraph( 0 ); +// +// if (nParaAnz==1 && p1stPara) +// { +// // Bei nur einem Pararaph +// if (pOutl->GetText(p1stPara).Len() == 0) +// { +// bEmptyOutliner = TRUE; +// } +// } +// } +// +// if (_pTextObj != pView->GetTextEditObject() || bEmptyOutliner) +// { +// UINT32 nInv = _pTextObj->GetObjInventor(); +// UINT16 nSdrObjKind = _pTextObj->GetObjIdentifier(); +// +// if (nInv == SdrInventor && _pTextObj->HasTextEdit() && +// (nSdrObjKind == OBJ_TEXT || +// nSdrObjKind == OBJ_TITLETEXT || +// nSdrObjKind == OBJ_OUTLINETEXT || +// (_pTextObj->ISA(SdrTextObj) && !_pTextObj->IsEmptyPresObj()))) +// { +// // Neuen Outliner machen (gehoert der SdrObjEditView) +// SdrModel* pModel = _pTextObj->GetModel(); +// SdrOutliner* pOutl = SdrMakeOutliner( OUTLINERMODE_OUTLINEOBJECT, pModel ); +// pOutl->SetMinDepth(0); +// pOutl->SetStyleSheetPool((SfxStyleSheetPool*) pModel->GetStyleSheetPool()); +// //pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl)); +// ULONG nCntrl = pOutl->GetControlWord(); +// nCntrl |= EE_CNTRL_ALLOWBIGOBJS; +// nCntrl |= EE_CNTRL_URLSFXEXECUTE; +// nCntrl |= EE_CNTRL_MARKFIELDS; +// nCntrl |= EE_CNTRL_AUTOCORRECT; +// +// nCntrl &= ~EE_CNTRL_ULSPACESUMMATION; +// //if ( pModel->IsSummationOfParagraphs() ) +// // nCntrl |= EE_CNTRL_ULSPACESUMMATION; +// +// //SetSpellOptions( nCntrl ); +// +// pOutl->SetControlWord(nCntrl); +// +// uno::Reference< linguistic2::XSpellChecker1 > xSpellChecker( LinguMgr::GetSpellChecker() ); +// if ( xSpellChecker.is() ) +// pOutl->SetSpeller( xSpellChecker ); +// +// uno::Reference< linguistic2::XHyphenator > xHyphenator( LinguMgr::GetHyphenator() ); +// if( xHyphenator.is() ) +// pOutl->SetHyphenator( xHyphenator ); +// +// pOutl->SetDefaultLanguage( Application::GetSettings().GetLanguage() ); +// +// // in einem Gliederungstext darf nicht auf die 0-te +// // Ebene ausgerueckt werden +// if (_pTextObj->GetObjInventor() == SdrInventor && +// _pTextObj->GetObjIdentifier() == OBJ_OUTLINETEXT) +// { +// pOutl->SetMinDepth(1); +// } +// +// if (bEmptyOutliner) +// { +// pView->SdrEndTextEdit(sal_True); +// } +// +// if( _pTextObj ) +// { +// OutlinerParaObject* pOPO = _pTextObj->GetOutlinerParaObject(); +// if( ( pOPO && pOPO->IsVertical() ) /*|| +// nSlotId == SID_ATTR_CHAR_VERTICAL || +// nSlotId == SID_TEXT_FITTOSIZE_VERTICAL */) +// pOutl->SetVertical( TRUE ); +// +// +// if (pView->SdrBeginTextEdit(_pTextObj, pPV, pParent, sal_True, pOutl) && _pTextObj->GetObjInventor() == SdrInventor) +// { +// //bFirstObjCreated = TRUE; +// //DeleteDefaultText(); +// +// OutlinerView* pOLV = pView->GetTextEditOutlinerView(); +// +// nSdrObjKind = _pTextObj->GetObjIdentifier(); +// +// SdrViewEvent aVEvt; +// SdrHitKind eHit = pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); +// +// if (eHit == SDRHIT_TEXTEDIT) +// { +// // Text getroffen +// if (nSdrObjKind == OBJ_TEXT || +// nSdrObjKind == OBJ_TITLETEXT || +// nSdrObjKind == OBJ_OUTLINETEXT || +// //nSlotId == SID_TEXTEDIT || +// !bQuickDrag) +// { +// pOLV->MouseButtonDown(rMEvt); +// pOLV->MouseMove(rMEvt); +// pOLV->MouseButtonUp(rMEvt); +// } +// +// if ( bQuickDrag && _pTextObj->GetOutlinerParaObject()) +// { +// pOLV->MouseButtonDown(rMEvt); +// } +// } +// else +// { +// // #98198# Move cursor to end of text +// ESelection aNewSelection(EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND); +// pOLV->SetSelection(aNewSelection); +// } +// } +// else +// { +// //RestoreDefaultText(); +// } +// } +// } +// } +// } +// else +// _pTextObj = NULL; +//} + //---------------------------------------------------------------------------- } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
