summaryrefslogtreecommitdiff
path: root/basctl/source/dlged
diff options
context:
space:
mode:
authorThomas Benisch <tbe@openoffice.org>2002-04-24 14:02:12 +0000
committerThomas Benisch <tbe@openoffice.org>2002-04-24 14:02:12 +0000
commit10ac19e5a05ddef4bd0131e35224352fe99288cc (patch)
tree0faf64de78ecb60aa38a8b7cc6710f3e7b91821c /basctl/source/dlged
parent70e3bad60eebcfe704b21399c9c1cb129dc9d3b6 (diff)
#98585# ACC: Unable to create a new Basic Dialog with the keyboard
Diffstat (limited to 'basctl/source/dlged')
-rw-r--r--basctl/source/dlged/dlged.cxx47
1 files changed, 44 insertions, 3 deletions
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 6aa5e1b947f7..e315ca33747d 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dlged.cxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: tbe $ $Date: 2002-02-04 15:42:53 $
+ * last change: $Author: tbe $ $Date: 2002-04-24 15:02:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -271,10 +271,11 @@ void DlgEditor::SetWindow( Window* pWindow )
pWindow->SetMapMode( MapMode( MAP_100TH_MM ) );
pSdrPage->SetSize( pWindow->PixelToLogic( Size( 1280, 1024 ) ) );
- pSdrView = new DlgEdView( pSdrModel, pWindow );
+ pSdrView = new DlgEdView( pSdrModel, pWindow, this );
pSdrView->ShowPagePgNum( 0, Point() );
pSdrView->SetLayerVisible( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ), FALSE );
pSdrView->SetMoveSnapOnlyTopLeft( TRUE );
+ pSdrView->SetWorkArea( Rectangle( Point( 0, 0 ), pSdrPage->GetSize() ) );
pSdrView->SetGridCoarse( aGridSize );
pSdrView->SetSnapGrid( aGridSize );
@@ -344,6 +345,20 @@ void DlgEditor::DoScroll( ScrollBar* pActScroll )
//----------------------------------------------------------------------------
+void DlgEditor::UpdateScrollBars()
+{
+ MapMode aMap = pWindow->GetMapMode();
+ Point aOrg = aMap.GetOrigin();
+
+ if ( pHScroll )
+ pHScroll->SetThumbPos( -aOrg.X() );
+
+ if ( pVScroll )
+ pVScroll->SetThumbPos( -aOrg.Y() );
+}
+
+//----------------------------------------------------------------------------
+
void DlgEditor::SetDialog( uno::Reference< container::XNameContainer > xUnoControlDialogModel )
{
// set dialog model
@@ -578,6 +593,32 @@ USHORT DlgEditor::GetInsertObj() const
//----------------------------------------------------------------------------
+void DlgEditor::CreateDefaultObject()
+{
+ // create object by factory
+ SdrObject* pObj = SdrObjFactory::MakeNewObject( pSdrView->GetCurrentObjInventor(), pSdrView->GetCurrentObjIdentifier(), pSdrPage );
+
+ DlgEdObj* pDlgEdObj = PTR_CAST( DlgEdObj, pObj );
+ if ( pDlgEdObj )
+ {
+ // set position and size
+ Size aSize = pWindow->PixelToLogic( Size( 96, 24 ) );
+ Point aPoint = (pDlgEdForm->GetSnapRect()).Center();
+ aPoint.X() -= aSize.Width() / 2;
+ aPoint.Y() -= aSize.Height() / 2;
+ pDlgEdObj->SetSnapRect( Rectangle( aPoint, aSize ) );
+
+ // set default property values
+ pDlgEdObj->SetDefaults();
+
+ // insert object into drawing page
+ SdrPageView* pPageView = pSdrView->GetPageViewPvNum(0);
+ pSdrView->InsertObject( pDlgEdObj, *pPageView, 0 );
+ }
+}
+
+//----------------------------------------------------------------------------
+
void DlgEditor::Cut()
{
Copy();