summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/gridwin3.cxx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2003-04-08 15:32:45 +0000
committerRüdiger Timm <rt@openoffice.org>2003-04-08 15:32:45 +0000
commited6d48dd248968d940f6377e0f6b27fc01126cfb (patch)
tree99f619612fe7667d73b25681567694d7542812ee /sc/source/ui/view/gridwin3.cxx
parent706ffe0754c52a0f3790a90b9d183b69e593f2d6 (diff)
INTEGRATION: CWS calc06 (1.5.102); FILE MERGED
2003/03/18 19:10:11 nn 1.5.102.1: #108137# keyboard-compatible state for position/size in status bar
Diffstat (limited to 'sc/source/ui/view/gridwin3.cxx')
-rw-r--r--sc/source/ui/view/gridwin3.cxx48
1 files changed, 27 insertions, 21 deletions
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index aca1611a7545..82f2e41096de 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: gridwin3.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: nn $ $Date: 2002-04-25 15:20:15 $
+ * last change: $Author: rt $ $Date: 2003-04-08 16:32:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -198,16 +198,20 @@ BOOL ScGridWindow::DrawKeyInput(const KeyEvent& rKEvt)
BOOL bOldMarked = pDrView->HasMarkedObj();
if (pDraw->KeyInput( rKEvt ))
{
+ BOOL bLeaveDraw = FALSE;
BOOL bUsed = TRUE;
BOOL bNewMarked = pDrView->HasMarkedObj();
if ( !pViewData->GetView()->IsDrawSelMode() )
if ( !bNewMarked )
{
pViewData->GetViewShell()->SetDrawShell( FALSE );
+ bLeaveDraw = TRUE;
if ( !bOldMarked &&
rKEvt.GetKeyCode().GetCode() == KEY_DELETE )
bUsed = FALSE; // nichts geloescht
}
+ if (!bLeaveDraw)
+ UpdateStatusPosSize(); // #108137# for moving/resizing etc. by keyboard
return bUsed;
}
}
@@ -444,44 +448,46 @@ void ScGridWindow::UpdateStatusPosSize()
{
ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
if (!pDrView)
- return; // sollte dann gar nicht gerufen werden
-
- Point aPos = PixelToLogic(aCurMousePos);
- pDrView->GetPageViewPvNum(0)->LogicToPagePos(aPos);
+ return; // shouldn't be called in that case
SfxItemSet aSet(pViewData->GetViewShell()->GetPool(), SID_ATTR_POSITION, SID_ATTR_SIZE);
- // Position- und Groesse-Items
- if ( pDrView->IsAction() )
+ // Fill items for position and size:
+ // #108137# show action rectangle during action,
+ // position and size of selected object(s) if something is selected,
+ // mouse position otherwise
+
+ BOOL bActionItem = FALSE;
+ if ( pDrView->IsAction() ) // action rectangle
{
Rectangle aRect;
pDrView->TakeActionRect( aRect );
-
- if ( aRect.IsEmpty() )
- aSet.Put( SfxPointItem(SID_ATTR_POSITION, aPos) );
- else
+ if ( !aRect.IsEmpty() )
{
pDrView->GetPageViewPvNum(0)->LogicToPagePos(aRect);
aSet.Put( SfxPointItem( SID_ATTR_POSITION, aRect.TopLeft() ) );
aSet.Put( SvxSizeItem( SID_ATTR_SIZE,
- Size( aRect.Right() - aRect.Left(),
- aRect.Bottom() - aRect.Top() ) ) );
+ Size( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() ) ) );
+ bActionItem = TRUE;
}
}
- else
+ if ( !bActionItem )
{
- aSet.Put( SfxPointItem(SID_ATTR_POSITION, aPos) );
-
- if ( pDrView->HasMarkedObj() )
+ if ( pDrView->HasMarkedObj() ) // selected objects
{
Rectangle aRect = pDrView->GetAllMarkedRect();
pDrView->GetPageViewPvNum(0)->LogicToPagePos(aRect);
+ aSet.Put( SfxPointItem( SID_ATTR_POSITION, aRect.TopLeft() ) );
aSet.Put( SvxSizeItem( SID_ATTR_SIZE,
- Size( aRect.Right() - aRect.Left(),
- aRect.Bottom() - aRect.Top()) ) );
+ Size( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() ) ) );
}
- else
+ else // mouse position
+ {
+ Point aPos = PixelToLogic(aCurMousePos);
+ pDrView->GetPageViewPvNum(0)->LogicToPagePos(aPos);
+ aSet.Put( SfxPointItem( SID_ATTR_POSITION, aPos ) );
aSet.Put( SvxSizeItem( SID_ATTR_SIZE, Size( 0, 0 ) ) );
+ }
}
pViewData->GetBindings().SetState(aSet);