diff options
author | Thomas Benisch <tbe@openoffice.org> | 2001-03-23 15:13:46 +0000 |
---|---|---|
committer | Thomas Benisch <tbe@openoffice.org> | 2001-03-23 15:13:46 +0000 |
commit | d6d355d11df9b9d000e9b126aecf99b3209c2ec1 (patch) | |
tree | d6c7ba9ece24c76aa57a6cf4e2a68cdd806a3ff0 /basctl/source/dlged/dlgedpage.cxx | |
parent | 4324a64ad957790114510f79a95664b7f2490f5a (diff) |
removed StarBASIC and code cleanup
Diffstat (limited to 'basctl/source/dlged/dlgedpage.cxx')
-rw-r--r-- | basctl/source/dlged/dlgedpage.cxx | 359 |
1 files changed, 14 insertions, 345 deletions
diff --git a/basctl/source/dlged/dlgedpage.cxx b/basctl/source/dlged/dlgedpage.cxx index 5c8ee3e75426..714ce535f27c 100644 --- a/basctl/source/dlged/dlgedpage.cxx +++ b/basctl/source/dlged/dlgedpage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dlgedpage.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: tbe $ $Date: 2001-02-26 10:48:07 $ + * last change: $Author: tbe $ $Date: 2001-03-23 16:13:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,376 +59,45 @@ * ************************************************************************/ -#ifndef _SV_HELP_HXX //autogen -#include <vcl/help.hxx> -#endif -#ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> -#endif -#ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> -#endif -#ifndef _SB_SBSTAR_HXX -#include <basic/sbstar.hxx> -#endif -#ifndef _WRKWIN_HXX -#include <vcl/wrkwin.hxx> -#endif -#ifndef _SFXAPP_HXX -#include <sfx2/app.hxx> -#endif -#ifndef _SFXVIEW_HXX -#include <sfx2/childwin.hxx> -#endif -#ifndef _SFXVIEWFRM_HXX -#include <sfx2/viewfrm.hxx> -#endif - -#ifndef _SHL_HXX -#include <tools/shl.hxx> -#endif -#ifndef _SVDIO_HXX -#include <svx/svdio.hxx> -#endif - -#include <vcl/color.hxx> - -#ifndef _SVDVIEW_HXX //autogen -#include <svx/svdview.hxx> -#endif - -#pragma hdrstop - -#include <svx/svdobj.hxx> - -#include <svx/svxids.hrc> - -#ifndef _BASCTL_DLGED_HXX -#include "dlged.hxx" -#endif #ifndef _BASCTL_DLGEDPAGE_HXX #include "dlgedpage.hxx" #endif -#ifndef _SVDORECT_HXX -#include <svx/svdorect.hxx> +#ifndef _BASCTL_DLGEDMOD_HXX +#include "dlgedmod.hxx" #endif -TYPEINIT1( DlgPage, SdrPage ); +TYPEINIT1( DlgEdPage, SdrPage ); //---------------------------------------------------------------------------- -DlgPage::DlgPage( DlgEdModel& rModel, StarBASIC* pBas, FASTBOOL bMasterPage ) : - SdrPage( rModel, bMasterPage ), - pBasic(pBas) +DlgEdPage::DlgEdPage( DlgEdModel& rModel, FASTBOOL bMasterPage ) : + SdrPage( rModel, bMasterPage ) { - if( pBasic ) - pBasic->AddRef(); - //pPool = rModel.pVCItemPool; // GetVCItemPool() wuerde ggf. einen erzeugen } //---------------------------------------------------------------------------- -DlgPage::~DlgPage() +DlgEdPage::DlgEdPage( const DlgEdPage& rPage ) + : SdrPage( rPage ) { - //if( pBasic && pSbxForm && pSbxForm->Type() == TYPE( VCSbxForm ) ) - // pBasic->Remove( pSbxForm ); - - Clear(); - - //if( pVCManager ) - // delete pVCManager; - - if( pBasic ) - pBasic->ReleaseRef(); - -} - -//---------------------------------------------------------------------------- - -void DlgPage::SetName( const String& rName ) -{ - aPageName = rName; - //if( pSbxForm ) - // pSbxForm->SetName( aPageName ); + pDlgEdForm = rPage.pDlgEdForm; } //---------------------------------------------------------------------------- -void DlgPage::SetBasic( StarBASIC* pBas ) +DlgEdPage::~DlgEdPage() { - if( pBas == pBasic ) - return; - - StarBASIC* pOldBasic = pBasic; - pBasic = pBas; - - if( pBasic ) - pBasic->AddRef(); - /* - if( pSbxForm ) - { - if( pOldBasic ) - pOldBasic->Remove( pSbxForm ); - if( pBasic ) - pBasic->Insert( pSbxForm ); - } - */ - if( pOldBasic ) - pOldBasic->ReleaseRef(); -} - -//---------------------------------------------------------------------------- - -BOOL DlgPage::RequestHelp( Window* pWindow, SdrView* pView, - const HelpEvent& rEvt ) -{ - if( !pView->IsAction() ) - { - Point aPos = rEvt.GetMousePosPixel(); - aPos = pWindow->ScreenToOutputPixel( aPos ); - aPos = pWindow->PixelToLogic( aPos ); - - SdrObject* pObj; - SdrPageView* pPV; - if( pView->PickObj( aPos, 0, pObj, pPV ) ) - { - /* - // Ein Object getroffen - if( pObj->IsA( TYPE( VCSbxDrawObject ) ) ) - { - SfxItemSet* pItemSet = ((VCSbxDrawObject*)pObj)->GetItemSet(); - String aHelpText = ((SfxStringItem&)pItemSet->Get( VCATTR_HELPTEXT )).GetValue(); - if( !aHelpText.Len() ) - { - // keonnen wir eine URL anzeigen? - VCSbxDrawObject* pControl = (VCSbxDrawObject*)pObj; - if( pControl->GetControl()->IsA(TYPE(VCSbxURLButton))) - { - VCURLButton* pBtn = (VCURLButton*)(pControl->GetControl()->GetVCControl()); - aHelpText = pBtn->GetURL(); - INetURLObject aUrl( aHelpText ); - aHelpText = aUrl.GetURLNoPass(); - } - } - if( aHelpText.Len()) - { - // Hilfe anzeigen - Rectangle aItemRect = pObj->GetBoundRect(); - aItemRect = pWindow->LogicToPixel( aItemRect ); - Point aPt = pWindow->OutputToScreenPixel( aItemRect.TopLeft() ); - aItemRect.Left() = aPt.X(); - aItemRect.Top() = aPt.Y(); - aPt = pWindow->OutputToScreenPixel( aItemRect.BottomRight() ); - aItemRect.Right() = aPt.X(); - aItemRect.Bottom() = aPt.Y(); - if( rEvt.GetMode() == HELPMODE_BALLOON ) - Help::ShowBalloon( pWindow, aItemRect.Center(), aItemRect, aHelpText); - else - Help::ShowQuickHelp( pWindow, aItemRect, aHelpText ); - - - } - return TRUE; - } - */ - } - } - return FALSE; -} - -//---------------------------------------------------------------------------- - -void DlgPage::RequestBasic() -{ -} - -//---------------------------------------------------------------------------- - -void DlgPage::WriteData( SvStream& rOut ) const -{ - - /* - CharSet eOldCharSet = rOut.GetStreamCharSet( ); - rOut.SetStreamCharSet( RTL_TEXTENCODING_MS_1252 ); - - if( pSbxForm ) - { - SdrDownCompat aCompat( rOut, STREAM_WRITE); - rOut << (UINT16)1; - UINT32 nMyVer = 0x13081961; - rOut << nMyVer; - rOut << *pSbxForm; - } - else - { - SdrDownCompat aCompat( rOut, STREAM_WRITE); - rOut << (UINT16)0; - } - - SdrPage::WriteData( rOut ); - - SdrDownCompat aCompat( rOut, STREAM_WRITE); - rOut.WriteByteString( GetName() ); - - // Magic-Number schreiben, da Carsten vergessen hat, - // eine (erhoehbare!) Versionsnummer einzubauen - rOut << (ULONG)0x11051967; - rOut << (ULONG)0x19670511; - - USHORT nVer = 1; - rOut << nVer; // Versionsnummer innerhalb meines Blockes - { - SdrDownCompat aCompat( rOut, STREAM_WRITE); - // VCForms speichern - ULONG nFormCount = 0; - if( pVCManager ) - { - nFormCount = pVCManager->FormCount(); - rOut << nFormCount; - for( ULONG nCurForm=0; nCurForm < nFormCount; nCurForm++ ) - { - rOut << *(pVCManager->GetFormByPos(nCurForm)); - } - } - else - rOut << nFormCount; - } - rOut.SetStreamCharSet( eOldCharSet ); - */ -} - -//---------------------------------------------------------------------------- - -void DlgPage::ReadData( const SdrIOHeader& rHead, SvStream& rIn ) -{ - /* - // macht JOE jetzt - CharSet eOldCharSet = rIn.GetStreamCharSet( ); - rIn.SetStreamCharSet( RTL_TEXTENCODING_MS_1252 ); - - { - SdrDownCompat aCompat( rIn, STREAM_READ ); - UINT16 n; - rIn >> n; - if( n ) - { - GetSbxForm(); - - UINT32 nMyVer; - rIn >> nMyVer; - if( nMyVer == 0x13081961 ) - rIn >> *pSbxForm; - } - } - - // Joe liest jetzt auch die Dok-Controls ein! - SdrPage::ReadData( rHead, rIn ); - - { - SdrDownCompat aCompat( rIn, STREAM_READ ); - String aName; - rIn.ReadByteString( aName ); - SetName( aName ); - - ULONG nMagic1=0, nMagic2=0; - ULONG nFPos = rIn.Tell(); - // Magic-Number lesen - rIn >> nMagic1; rIn >> nMagic2; - if( nMagic1 == 0x11051967 && nMagic2 == 0x19670511 ) - { - // es ist noch was da - USHORT nVer; - rIn >> nVer; // Versionsnummer innerhalb meines Blockes - { - SdrDownCompat aCompat( rIn, STREAM_READ); - // VCForms laden - ULONG nFormCount; - rIn >> nFormCount; - if( nFormCount ) - { - // diese Dummy-Referenz sorgt dafuer, dass ein - // VCManager angelegt wird, falls noch keiner da ist - VCSbxFormRef aDummyRef = DlgPage::GetSbxForm(); - DBG_ASSERT(pVCManager,"No VCManager!"); - for( ULONG nCurForm=0; nCurForm < nFormCount; nCurForm++ ) - { - VCForm* pForm = new VCForm; - rIn >> *pForm; - pVCManager->InsertForm( pForm ); - } - } - } - } - else - rIn.Seek( nFPos ); - - // Ueber alle Controls gehen und die Dinger in ihre Forms einfuegen. - // Das kann ich nicht im VCSbxDrawObject::ReadData machen, weil - // die Forms dann noch nicht geladen sind! - if( pVCManager ) - { - ULONG nCtrlCount = pVCManager->GetChildCount(); - for( ULONG nCur=0; nCur < nCtrlCount; nCur++ ) - { - VCControl* pVCControl = pVCManager->GetChildByPos(nCur); - String aFormName( pVCControl->GetFormName() ); - if( aFormName.Len() ) - { - // in eine neue Form packen, diese ggf. erzeugen - VCForm* pForm = pVCManager->GetFormByName( aFormName ); - DBG_ASSERT(pForm,"No Form!"); - pVCControl->SetVCForm( pForm ); - } - } - } - } - rIn.SetStreamCharSet( eOldCharSet ); - */ -} - -//---------------------------------------------------------------------------- - -void DlgPage::SetModel(SdrModel* pNewModel) -{ - DBG_ASSERT(pNewModel,"DlgPage::SetModel: pNewModel==0"); - SdrModel* pOldModel = GetModel(); - SdrPage::SetModel( pNewModel ); - /* - if( pOldModel != pNewModel ) - { - VCItemPool* pNewPool = ((VCDrawModel*)pNewModel)->GetVCItemPool(); - if( pVCManager ) - { - ULONG nCount = pVCManager->GetChildCount(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) - { - VCControl* pCtrl = pVCManager->GetChildByPos( nCur ); - pCtrl->SetPool( pNewPool ); - } - } - if( pSbxForm && pSbxForm->Type() == TYPE(VCSbxForm) ) - pSbxForm->SetPool( pNewPool, FALSE ); - } - */ -} - -//---------------------------------------------------------------------------- - -SdrPage* DlgPage::Clone() const -{ - return new DlgPage( *this ); + Clear(); } //---------------------------------------------------------------------------- -DlgPage::DlgPage( const DlgPage& rPage ) - : SdrPage( rPage ), - pBasic(0) +SdrPage* DlgEdPage::Clone() const { - //pPool = ((DlgEdModel*)GetModel())->pVCItemPool; // GetVCItemPool() wuerde ggf. einen erzeugen + return new DlgEdPage( *this ); } //---------------------------------------------------------------------------- |