diff options
Diffstat (limited to 'basctl/source')
52 files changed, 22085 insertions, 0 deletions
diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx new file mode 100644 index 000000000..96a65ad7a --- /dev/null +++ b/basctl/source/basicide/basdoc.cxx @@ -0,0 +1,181 @@ +/************************************************************************* + * + * $RCSfile: basdoc.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <ide_pch.hxx> + +#pragma hdrstop + +#define GLOBALOVERFLOW2 + +#include <sfx2/docfac.hxx> + +#ifndef _SV_STATUS_HXX //autogen +#include <vcl/status.hxx> +#endif + +#include <basdoc.hxx> +#include <basidesh.hrc> + +#define BasicDocShell +#include <baside.hxx> + + +SFX_IMPL_SIMPLE_OBJECTFACTORY( BasicDocShell, SFXOBJECTSHELL_STD_SPECIAL | SFXOBJECTSHELL_DONTREPLACE, side3 ) +{ + Factory().SetExplorerImageId( IMG_SFX_EXP_MACROLIB ); + Factory().RegisterHelpFile( String( RTL_CONSTASCII_USTRINGPARAM( "sbasic" ) ) ); +} + + +SFX_IMPL_INTERFACE( BasicDocShell, SfxObjectShell, IDEResId( 0 ) ) +{ + SFX_STATUSBAR_REGISTRATION( SID_BASICIDE_STATUSBAR ); +// SFX_CHILDWINDOW_REGISTRATION( SID_SHOW_BROWSER ); +} + + + +BasicDocShell::BasicDocShell( SfxObjectCreateMode eMode ) : SfxObjectShell( eMode ) +{ + pPrinter = 0; + SetPool( &SFX_APP()->GetPool() ); +} + + + + +__EXPORT BasicDocShell::~BasicDocShell() +{ + delete pPrinter; +} + + + + +void __EXPORT BasicDocShell::Execute( SfxRequest& rReq ) +{ +} + + + + +void __EXPORT BasicDocShell::GetState(SfxItemSet &rSet) +{ +} + + + + +SfxPrinter* BasicDocShell::GetPrinter( BOOL bCreate ) +{ + if ( !pPrinter && bCreate ) + pPrinter = new SfxPrinter( new SfxItemSet( GetPool(), SID_PRINTER_NOTFOUND_WARN , SID_PRINTER_NOTFOUND_WARN ) ); + + return pPrinter; +} + + + + +void BasicDocShell::SetPrinter( SfxPrinter* pPr ) +{ + if ( pPr != pPrinter ) + { + delete pPrinter; + pPrinter = pPr; + } +} + + +void BasicDocShell::FillStatusBar( StatusBar& rStatusBar ) +{ + String aTmp; + + // Titel + aTmp.Fill( 30, 'X' ); + rStatusBar.InsertItem( SID_BASICIDE_STAT_TITLE, + rStatusBar.GetTextWidth( aTmp ), SIB_AUTOSIZE | SIB_LEFT); + + // Modify + rStatusBar.InsertItem( SID_DOC_MODIFIED, + rStatusBar.GetTextWidth( '*' ) ); + + // Position + aTmp.Erase(); + aTmp.Fill( 15, 'X' ); + rStatusBar.InsertItem( SID_BASICIDE_STAT_POS, + rStatusBar.GetTextWidth( aTmp ), SIB_LEFT); + + // Insert/Overwrite + rStatusBar.InsertItem( SID_ATTR_INSERT, + rStatusBar.GetTextWidth( String( RTL_CONSTASCII_USTRINGPARAM( "XXXXX" /* "EINFG" */ ) ) ) ); + + // Uhrzeit + aTmp.Fill( 20, 'X' ); + rStatusBar.InsertItem( SID_ATTR_SIZE, + rStatusBar.GetTextWidth( aTmp ), SIB_AUTOSIZE | SIB_LEFT | SIB_USERDRAW ); + +// return pStatusBar; + +} + + diff --git a/basctl/source/basicide/basdoc.hxx b/basctl/source/basicide/basdoc.hxx new file mode 100644 index 000000000..85dfd5ee2 --- /dev/null +++ b/basctl/source/basicide/basdoc.hxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * $RCSfile: basdoc.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _BASDOC_HXX +#define _BASDOC_HXX + +#include <svx/ifaceids.hxx> +#include <iderid.hxx> + +#ifndef _SFX_OBJSH_HXX //autogen +#include <sfx2/objsh.hxx> +#endif + + +class SfxPrinter; + +class BasicDocShell: public SfxObjectShell +{ + SfxPrinter* pPrinter; + +protected: + virtual void FillStatusBar( StatusBar& rBar); + + +public: + SFX_DECL_SIMPLE_OBJECTFACTORY( BasicDocShell ); + SFX_DECL_INTERFACE( SVX_INTERFACE_BASIDE_DOCSH ); + BasicDocShell( SfxObjectCreateMode eMode = SFX_CREATE_MODE_STANDARD ); + ~BasicDocShell(); + + void Execute( SfxRequest& rReq ); + void GetState( SfxItemSet& rSet ); + + SfxPrinter* GetPrinter( BOOL bCreate ); + void SetPrinter( SfxPrinter* pPrinter ); +}; + +#endif // _BASDOC_HXX diff --git a/basctl/source/basicide/basicbox.cxx b/basctl/source/basicide/basicbox.cxx new file mode 100644 index 000000000..47aa6eb5f --- /dev/null +++ b/basctl/source/basicide/basicbox.cxx @@ -0,0 +1,326 @@ +/************************************************************************* + * + * $RCSfile: basicbox.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <ide_pch.hxx> + +#pragma hdrstop + +#include <basidesh.hrc> +#define _SVSTDARR_STRINGS +#include <svtools/svstdarr.hxx> +#include <basobj.hxx> + +#include <basicbox.hxx> +#include <iderid.hxx> +#include <bastypes.hxx> + +SFX_IMPL_TOOLBOX_CONTROL( LibBoxControl, SfxStringItem ); + +LibBoxControl::LibBoxControl( USHORT nId, ToolBox& rTbx, SfxBindings& rBind ) + : SfxToolBoxControl( nId, rTbx, rBind ) +{ +} + + + +LibBoxControl::~LibBoxControl() +{ +} + + + +void LibBoxControl::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState ) +{ + BasicLibBox* pBox = (BasicLibBox*) GetToolBox().GetItemWindow( GetId() ); + + DBG_ASSERT( pBox, "Box not found" ); + if ( !pBox ) + return; + + if ( eState != SFX_ITEM_AVAILABLE ) + pBox->Disable(); + else + { + pBox->Enable(); + + if ( pState->ISA(SfxStringItem) ) + pBox->Update( (const SfxStringItem*)pState ); + else + pBox->Update( NULL ); + } +} + + + +Window* LibBoxControl::CreateItemWindow( Window *pParent ) +{ + return new BasicLibBox( pParent ); +} + + + + + +BasicLibBox::BasicLibBox( Window* pParent ) : + ListBox( pParent, WinBits( WB_BORDER | WB_DROPDOWN ) ) +{ + FillBox(); + bIgnoreSelect = TRUE; // Select von 0 noch nicht weiterleiten + bFillBox = TRUE; + SelectEntryPos( 0 ); + aCurText = GetEntry( 0 ); + SetSizePixel( Size( 165, 200 ) ); + bIgnoreSelect = FALSE; + StartListening( *SFX_APP(), TRUE /* Nur einmal anmelden */ ); +} + + + +__EXPORT BasicLibBox::~BasicLibBox() +{ +} + +void __EXPORT BasicLibBox::Update( const SfxStringItem* pItem ) +{ + // Immer auf dem laufenden sein... +// if ( !pItem || !pItem->GetValue().Len() ) + FillBox(); + + if ( pItem ) + { + aCurText = pItem->GetValue(); + if ( aCurText.Len() == 0 ) + aCurText = String( IDEResId( RID_STR_ALL ) ); + } + + if ( GetSelectEntry() != aCurText ) + SelectEntry( aCurText ); +} + +void __EXPORT BasicLibBox::ReleaseFocus() +{ + SfxViewShell* pCurSh = SfxViewShell::Current(); + DBG_ASSERT( pCurSh, "Current ViewShell not found!" ); + + if ( pCurSh ) + { + Window* pShellWin = pCurSh->GetWindow(); + if ( !pShellWin ) // sonst werde ich ihn nicht los + pShellWin = Application::GetDefModalDialogParent(); + + pShellWin->GrabFocus(); + } +} + + + +void __EXPORT BasicLibBox::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&, + const SfxHint& rHint, const TypeId& ) +{ + if ( rHint.IsA( TYPE( SfxEventHint ) ) ) + { + if ( ( ((SfxEventHint&)rHint).GetEventId() == SFX_EVENT_CREATEDOC ) || + ( ((SfxEventHint&)rHint).GetEventId() == SFX_EVENT_OPENDOC ) ) + { + FillBox(); // IDE reagiert selbst, wenn == aktuelle Lib + } + else if ( ((SfxEventHint&)rHint).GetEventId() == SFX_EVENT_SAVEASDOC ) + { + // Wenn das aktuell angezeigte Doc umbenannt wird... + // Funktioniert nicht, da ich den alten Namen nicht bekomme +// String aCurLib( GetLibFromMgrAndLib( aCurText ) ); +// String aCurMgr( GetMgrFromMgrAndLib( aCurText ) ); +// String aCurDoc = SfxObjectShell::Current()->GetTitle(); +// if ( aCurMgr == aCurDoc ) +// { +// FillBox( FALSE ); +// aCurText = CreateMgrAndLibStr( aCurDoc, aCurLib ); +// bIgnoreSelect = TRUE; +// SelectEntry( aCurText ); +// InfoBox( 0, aCurText ).Execute(); +// bIgnoreSelect = FALSE; +// } +// else + FillBox( TRUE ); + + } + else if ( ((SfxEventHint&)rHint).GetEventId() == SFX_EVENT_CLOSEDOC ) + { + if ( SFX_APP()->IsInBasicCall() ) // Nicht wenn Office beendet + FillBox(); + } + } +} + + + +void BasicLibBox::FillBox( BOOL bSelect ) +{ + SetUpdateMode( FALSE ); + bIgnoreSelect = TRUE; + + aCurText = GetSelectEntry(); + USHORT nCurPos = GetSelectEntryPos(); + + SelectEntryPos( 0 ); + Clear(); + + SvStrings* pStrings = BasicIDE::CreateBasicLibBoxEntries(); + for ( USHORT n = 0; n < pStrings->Count(); n++ ) + { + String* pStr = pStrings->GetObject( n ); + InsertEntry( *pStr, LISTBOX_APPEND ); + } + pStrings->DeleteAndDestroy( 0, pStrings->Count() ); + delete pStrings; + + SetUpdateMode( TRUE ); + + if ( bSelect ) + { + SelectEntry( aCurText ); + if ( !GetSelectEntryCount() ) + { + SelectEntryPos( GetEntryCount() ); // gibst es nicht => leer? + aCurText = GetSelectEntry(); + } + } + bIgnoreSelect = FALSE; +} + +long BasicLibBox::PreNotify( NotifyEvent& rNEvt ) +{ + long nDone = 0; + if( rNEvt.GetType() == EVENT_KEYINPUT ) + { + KeyEvent aKeyEvt = *rNEvt.GetKeyEvent(); + USHORT nKeyCode = aKeyEvt.GetKeyCode().GetCode(); + switch( nKeyCode ) + { + case KEY_RETURN: + { + NotifyIDE(); + nDone = 1; + } + break; + + case KEY_ESCAPE: + { + SelectEntry( aCurText ); + ReleaseFocus(); + nDone = 1; + } + break; + } + } + else if( rNEvt.GetType() == EVENT_GETFOCUS ) + { + if ( bFillBox ) + { + FillBox(); + bFillBox = FALSE; + } + } + else if( rNEvt.GetType() == EVENT_LOSEFOCUS ) + { + if ( !HasChildPathFocus( TRUE ) ) + { + bIgnoreSelect = TRUE; + bFillBox = TRUE; + } + } + + return nDone ? nDone : ListBox::PreNotify( rNEvt ); +} + +void __EXPORT BasicLibBox::Select() +{ + if ( !IsTravelSelect() ) + { + if ( !bIgnoreSelect ) + NotifyIDE(); + else + SelectEntry( aCurText ); // Seit 306... (Select nach Escape) + } +} + + + +void BasicLibBox::NotifyIDE() +{ + String aLib; + if ( GetSelectEntryPos() ) + aLib = GetSelectEntry(); + + SfxStringItem aLibName( SID_BASICIDE_ARG_LIBNAME, aLib ); + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_LIBSELECTED, + SFX_CALLMODE_SYNCHRON, &aLibName, 0L ); + } + ReleaseFocus(); +} + + + diff --git a/basctl/source/basicide/basicbox.hxx b/basctl/source/basicide/basicbox.hxx new file mode 100644 index 000000000..02fead667 --- /dev/null +++ b/basctl/source/basicide/basicbox.hxx @@ -0,0 +1,124 @@ +/************************************************************************* + * + * $RCSfile: basicbox.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +// +#ifndef _BASICBOX_HXX +#define _BASICBOX_HXX + +#ifndef _SFXSTRITEM_HXX //autogen +#include <svtools/stritem.hxx> +#endif +#ifndef _SVHEADER_HXX +#include <svheader.hxx> +#endif + +#ifndef _SFXTBXCTRL_HXX //autogen +#include <sfx2/tbxctrl.hxx> +#endif + +#ifndef _SV_LSTBOX_HXX //autogen +#include <vcl/lstbox.hxx> +#endif + + +class LibBoxControl: public SfxToolBoxControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + + LibBoxControl( USHORT nId, ToolBox& rTbx, SfxBindings& rBind ); + ~LibBoxControl(); + + virtual void StateChanged( USHORT nSID, SfxItemState eState, + const SfxPoolItem* pState ); + virtual Window* CreateItemWindow( Window *pParent ); +}; + +// + +class BasicLibBox : public ListBox, public SfxListener +{ +private: + String aCurText; + BOOL bIgnoreSelect; + BOOL bFillBox; + + void ReleaseFocus(); + +protected: + virtual void Select(); + virtual long PreNotify( NotifyEvent& rNEvt ); + + virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ); + + +public: + BasicLibBox( Window* pParent ); + ~BasicLibBox(); + + void FillBox( BOOL bSelect = TRUE ); + void Update( const SfxStringItem* pItem ); + void NotifyIDE(); +}; + + +#endif // _BASICBOX_HXX + diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx new file mode 100644 index 000000000..3ce28a23e --- /dev/null +++ b/basctl/source/basicide/baside2.cxx @@ -0,0 +1,1460 @@ +/************************************************************************* + * + * $RCSfile: baside2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <ide_pch.hxx> + +#pragma hdrstop + +#include <svtools/texteng.hxx> +#include <svtools/textview.hxx> +#include <svtools/xtextedt.hxx> + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#ifndef _IODLG_HXX //autogen +#include <sfx2/iodlg.hxx> +#endif + +#ifndef _SFXDOCFILE_HXX //autogen +#include <sfx2/docfile.hxx> +#endif +#include <basic/basrdll.hxx> + + +#include <baside2.hrc> +#include <baside2.hxx> +#include <objdlg.hxx> +#include <iderdll.hxx> +#include <iderdll2.hxx> + +#include <basobj.hxx> + +#include <svx/srchdlg.hxx> + +#include <vcl/sound.hxx> + +#ifndef _TXTCMP_HXX //autogen +#include <svtools/txtcmp.hxx> +#endif + + +//#ifdef OS2 +//#define INCL_DOSPROCESS +//#include <sysdep.hxx> +//#endif + +#define SPLIT_MARGIN 5 +#define SPLIT_HEIGHT 2 + +#define LMARGPRN 1700 +#define RMARGPRN 900 +#define TMARGPRN 2000 +#define BMARGPRN 1000 +#define BORDERPRN 300 + +#define APPWAIT_START 100 + +#define VALIDWINDOW 0x1234 + +#if defined(MAC) +#define FILTERMASK_ALL "****" +#elif defined(OW) || defined(MTF) +#define FILTERMASK_ALL "*" +#elif defined(PM2) +#define FILTERMASK_ALL "" +#else +#define FILTERMASK_ALL "*.*" +#endif + + +DBG_NAME( ModulWindow ); + +TYPEINIT1( ModulWindow , IDEBaseWindow ); + +void lcl_PrintHeader( Printer* pPrinter, USHORT nPages, USHORT nCurPage, const String& rTitle ) +{ + short nLeftMargin = LMARGPRN; + Size aSz = pPrinter->GetOutputSize(); + short nBorder = BORDERPRN; + + const Color aOldLineColor( pPrinter->GetLineColor() ); + const Color aOldFillColor( pPrinter->GetFillColor() ); + const Font aOldFont( pPrinter->GetFont() ); + + pPrinter->SetLineColor( Color( COL_BLACK ) ); + pPrinter->SetFillColor(); + + Font aFont( aOldFont ); + aFont.SetWeight( WEIGHT_BOLD ); + aFont.SetAlign( ALIGN_BOTTOM ); + pPrinter->SetFont( aFont ); + + long nFontHeight = pPrinter->GetTextHeight(); + + // 1.Border => Strich, 2+3 Border = Freiraum. + long nYTop = TMARGPRN-3*nBorder-nFontHeight; + + long nXLeft = nLeftMargin-nBorder; + long nXRight = aSz.Width()-RMARGPRN+nBorder; + + pPrinter->DrawRect( Rectangle( + Point( nXLeft, nYTop ), + Size( nXRight-nXLeft, aSz.Height() - nYTop - BMARGPRN + nBorder ) ) ); + + + long nY = TMARGPRN-2*nBorder; + Point aPos( nLeftMargin, nY ); + pPrinter->DrawText( aPos, rTitle ); + if ( nPages != 1 ) + { + aFont.SetWeight( WEIGHT_NORMAL ); + pPrinter->SetFont( aFont ); + String aPageStr( RTL_CONSTASCII_USTRINGPARAM( " [" ) ); + aPageStr += String( IDEResId( RID_STR_PAGE ) ); + aPageStr += ' '; + aPageStr += String::CreateFromInt32( nCurPage ); + aPageStr += ']'; + aPos.X() += pPrinter->GetTextWidth( rTitle ); + pPrinter->DrawText( aPos, aPageStr ); + } + + + nY = TMARGPRN-nBorder; + + pPrinter->DrawLine( Point( nXLeft, nY ), Point( nXRight, nY ) ); + + pPrinter->SetFont( aOldFont ); + pPrinter->SetFillColor( aOldFillColor ); + pPrinter->SetLineColor( aOldLineColor ); +} + +void lcl_ConvertTabsToSpaces( String& rLine ) +{ + if ( rLine.Len() ) + { + USHORT nPos = 0; + USHORT nMax = rLine.Len(); + while ( nPos < nMax ) + { + if ( rLine.GetChar( nPos ) == '\t' ) + { + // Nicht 4 Blanks, sondern an 4er TabPos: + String aBlanker; + aBlanker.Fill( ( 4 - ( nPos % 4 ) ), ' ' ); + rLine.Erase( nPos, 1 ); + rLine.Insert( aBlanker, nPos ); + nMax = rLine.Len(); + } + nPos++; // Nicht optimal, falls Tab, aber auch nicht verkehrt... + } + } +} + + +ModulWindow::ModulWindow( ModulWindowLayout* pParent, StarBASIC* pBas, SbModule* pModule ) : + IDEBaseWindow( pParent, pBas ), + aXEditorWindow( this ) +{ + DBG_CTOR( ModulWindow, 0 ); + nValid = VALIDWINDOW; + pLayout = pParent; + aXEditorWindow.Show(); + + DBG_ASSERT( pModule, "Es muss ein Modul uebergeben werden!" ); + xModule = pModule; + SetBackground(); +} + +__EXPORT ModulWindow::~ModulWindow() +{ + DBG_DTOR( ModulWindow, 0 ); + nValid = 0; + + StarBASIC::Stop(); +} + + +void __EXPORT ModulWindow::GetFocus() +{ + if ( nValid != VALIDWINDOW ) + return; + DBG_CHKTHIS( ModulWindow, 0 ); + aXEditorWindow.GetEdtWindow().GrabFocus(); + // Basisklasse nicht rufen, weil Focus jetzt woanders... +} + +void ModulWindow::DoInit() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + // Wird beim Umschalten der Fenster gerufen... + if ( GetVScrollBar() ) + GetVScrollBar()->Hide(); + GetHScrollBar()->Show(); +// GetEditorWindow().SetScrollBarRanges(); + GetEditorWindow().InitScrollBars(); +// GetEditorWindow().GrabFocus(); +} + + +void __EXPORT ModulWindow::Paint( const Rectangle& ) +{ + DBG_CHKTHIS( ModulWindow, 0 ); +#ifdef DEBUG +// SetFillInBrush( Brush( Color( COL_GREEN ) ) ); +// Size aSz = GetOutputSize(); +// DrawRect( Rectangle( Point( 0, 0 ), aSz ) ); +#endif +} + +void __EXPORT ModulWindow::Resize() +{ + aXEditorWindow.SetPosSizePixel( Point( 0, 0 ), + Size( GetOutputSizePixel() ) ); +} + + +// "Import" von baside4.cxx +void CreateEngineForBasic( StarBASIC* pBasic ); + +void ModulWindow::CheckCompileBasic() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + + // Zur Laufzeit wird niemals compiliert! + BOOL bRunning = StarBASIC::IsRunning(); + BOOL bModified = ( !xModule->IsCompiled() || + ( GetEditEngine() && GetEditEngine()->IsModified() ) ); + + if ( !bRunning && bModified ) + { + BOOL bDone = FALSE; + Application::EnterWait(); + + if( bModified ) + { + AssertValidEditEngine(); + GetEditorWindow().SetSourceInBasic( FALSE ); + } + + BOOL bWasModified = GetBasic()->IsModified(); + + bDone = GetBasic()->Compile( xModule ); + if ( !bWasModified ) + GetBasic()->SetModified( FALSE ); + + if ( bDone ) + { + GetBreakPoints().SetBreakPointsInBasic( xModule ); + } + + Application::LeaveWait(); + +// BasicIDE::MarkDocShellModified( GetBasic() ); + + aStatus.bError = !bDone; + aStatus.bIsRunning = FALSE; + } +} + +BOOL ModulWindow::BasicExecute() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + CheckCompileBasic(); + + if ( !aStatus.bError && xModule->IsCompiled() ) + { + if ( GetBreakPoints().Count() ) + aStatus.nBasicFlags = aStatus.nBasicFlags | SbDEBUG_BREAK; + + if ( !aStatus.bIsRunning ) + { + DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + AddStatus( BASWIN_RUNNINGBASIC ); + USHORT nStart, nEnd, nCurMethodStart; + SbMethod* pMethod = 0; + // erstes Macro, sonst blind "Main" (ExtSearch?) + for ( USHORT nMacro = 0; nMacro < xModule->GetMethods()->Count(); nMacro++ ) + { + SbMethod* pM = (SbMethod*)xModule->GetMethods()->Get( nMacro ); + DBG_ASSERT( pM, "Method?" ); + pM->GetLineRange( nStart, nEnd ); + if ( !pMethod || ( nStart < nCurMethodStart ) ) + { + pMethod = pM; + nCurMethodStart = nStart; + } + } + if ( !pMethod ) + pMethod = (SbMethod*)xModule->Find( String( RTL_CONSTASCII_USTRINGPARAM( "Main" ) ), SbxCLASS_METHOD ); + + if ( pMethod ) + { + pMethod->SetDebugFlags( aStatus.nBasicFlags ); + BasicDLL::SetDebugMode( TRUE ); + BasicIDE::RunMethod( pMethod ); + BasicDLL::SetDebugMode( FALSE ); + // Falls waehrend Interactive=FALSE abgebrochen + BasicDLL::EnableBreak( TRUE ); + } + ClearStatus( BASWIN_RUNNINGBASIC ); + } + else + aStatus.bIsRunning = FALSE; // Abbruch von Reschedule() + } + + BOOL bDone = !aStatus.bError; + + return bDone; +} + +BOOL ModulWindow::CompileBasic() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + CheckCompileBasic(); + return xModule->IsCompiled(); +} + +BOOL ModulWindow::BasicRun() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + + aStatus.nBasicFlags = 0; + BOOL bDone = BasicExecute(); + return bDone; +} + +BOOL ModulWindow::BasicStepOver() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + aStatus.nBasicFlags = SbDEBUG_STEPINTO | SbDEBUG_STEPOVER; + BOOL bDone = BasicExecute(); + return bDone; +} + + +BOOL ModulWindow::BasicStepInto() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + + aStatus.nBasicFlags = SbDEBUG_STEPINTO; + BOOL bDone = BasicExecute(); + return bDone; +} + +BOOL ModulWindow::BasicStepOut() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + + aStatus.nBasicFlags = SbDEBUG_STEPOUT; + BOOL bDone = BasicExecute(); + return bDone; +} + + + +void ModulWindow::BasicStop() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + + GetBasic()->Stop(); + aStatus.bIsRunning = FALSE; +} + +BOOL ModulWindow::LoadBasic() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + BOOL bDone = FALSE; + + SfxFileDialog aFileDialogBox( this, WinBits( WB_OPEN | WB_3DLOOK ) ); + if ( aCurPath.Len() ) + aFileDialogBox.SetPath( aCurPath ); + aFileDialogBox.SetText( String( IDEResId( RID_STR_OPEN ) ) ); + aFileDialogBox.AddFilter( String( RTL_CONSTASCII_USTRINGPARAM( "BASIC" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.bas" ) ) ); + aFileDialogBox.AddFilter( String( RTL_CONSTASCII_USTRINGPARAM( "StarScript" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.sjs" ) ) ); + aFileDialogBox.AddFilter( String( IDEResId( RID_STR_FILTER_ALLFILES ) ), String( RTL_CONSTASCII_USTRINGPARAM( FILTERMASK_ALL ) ) ); + aFileDialogBox.SetCurFilter( String( RTL_CONSTASCII_USTRINGPARAM( "BASIC" ) ) ); + + if ( aFileDialogBox.Execute() ) + { + aCurPath = aFileDialogBox.GetPath(); + SfxMedium aMedium( aCurPath, STREAM_READ | STREAM_SHARE_DENYWRITE | STREAM_NOCREATE, TRUE ); + SvStream* pStream = aMedium.GetInStream(); + if ( pStream ) + { + AssertValidEditEngine(); + ULONG nLines = CalcLineCount( *pStream ); + // nLines*4: ReadText/Formatting/Highlighting/Formatting + GetEditorWindow().CreateProgress( String( IDEResId( RID_STR_GENERATESOURCE ) ), nLines*4 ); + GetEditEngine()->SetUpdateMode( FALSE ); + GetEditView()->Read( *pStream ); + GetEditEngine()->SetUpdateMode( TRUE ); + GetEditorWindow().Update(); // Es wurde bei UpdateMode = TRUE nur Invalidiert + GetEditorWindow().ForceSyntaxTimeout(); + GetEditorWindow().DestroyProgress(); + ULONG nError = aMedium.GetError(); + if ( nError ) + ErrorHandler::HandleError( nError ); + else + bDone = TRUE; + } + else + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_COULDNTREAD ) ) ).Execute(); + } + return bDone; +} + + + +BOOL ModulWindow::SaveBasicSource() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + BOOL bDone = FALSE; + SfxFileDialog aFileDialogBox( this, WinBits( WB_SAVEAS | WB_3DLOOK ) ); + if ( aCurPath.Len() ) + aFileDialogBox.SetPath( aCurPath ); + aFileDialogBox.SetText( String( IDEResId( RID_STR_SAVE ) ) ); + + aFileDialogBox.AddFilter( String( RTL_CONSTASCII_USTRINGPARAM( "BASIC" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.bas" ) ) ); + aFileDialogBox.AddFilter( String( RTL_CONSTASCII_USTRINGPARAM( "StarScript" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.sjs" ) ) ); + aFileDialogBox.AddFilter( String( IDEResId( RID_STR_FILTER_ALLFILES ) ), String( RTL_CONSTASCII_USTRINGPARAM( FILTERMASK_ALL ) ) ); + + aFileDialogBox.SetDefaultExt( String( RTL_CONSTASCII_USTRINGPARAM( "bas" ) ) ); + aFileDialogBox.SetCurFilter( String( RTL_CONSTASCII_USTRINGPARAM( "BASIC" ) ) ); + + if ( aFileDialogBox.Execute() ) + { + aCurPath = aFileDialogBox.GetPath(); + SfxMedium aMedium( aCurPath, STREAM_WRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, TRUE, FALSE ); + SvStream* pStream = aMedium.GetOutStream(); + if ( pStream ) + { + Application::EnterWait(); + AssertValidEditEngine(); + GetEditEngine()->Write( *pStream ); + aMedium.Commit(); + Application::LeaveWait(); + ULONG nError = aMedium.GetError(); + if ( nError ) + ErrorHandler::HandleError( nError ); + else + bDone = TRUE; + } + else + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_COULDNTWRITE) ) ).Execute(); + } + + return bDone; +} + + +BOOL ModulWindow::ToggleBreakPoint( ULONG nLine ) +{ + DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + CheckCompileBasic(); + if ( aStatus.bError ) + { + Sound::Beep(); + return FALSE; + } + + BOOL bNewBreakPoint = FALSE; + BreakPoint* pBrk = GetBreakPoints().FindBreakPoint( nLine ); + if ( pBrk ) // entfernen + { + xModule->ClearBP( (USHORT)nLine ); + delete GetBreakPoints().Remove( pBrk ); + } + else // einen erzeugen + { + if ( xModule->SetBP( (USHORT)nLine) ) + { + GetBreakPoints().InsertSorted( new BreakPoint( nLine ) ); + bNewBreakPoint = TRUE; + if ( StarBASIC::IsRunning() ) + { + for ( USHORT nMethod = 0; nMethod < xModule->GetMethods()->Count(); nMethod++ ) + { + SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( nMethod ); + DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); + pMethod->SetDebugFlags( pMethod->GetDebugFlags() | SbDEBUG_BREAK ); + } + } + } + + if ( !bNewBreakPoint ) + Sound::Beep(); + } + + return bNewBreakPoint; +} + +void ModulWindow::UpdateBreakPoint( const BreakPoint& rBrk ) +{ + DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + + CheckCompileBasic(); + + rtl::OUString aModName; + if ( rBrk.bEnabled ) + xModule->SetBP( (USHORT)rBrk.nLine ); + else + xModule->ClearBP( (USHORT)rBrk.nLine ); +} + + +BOOL ModulWindow::BasicToggleBreakPoint() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + AssertValidEditEngine(); + + TextSelection aSel = GetEditView()->GetSelection(); + aSel.GetStart().GetPara()++; // Basic-Zeilen beginnen bei 1! + aSel.GetEnd().GetPara()++; + + BOOL bNewBreakPoint = FALSE; + + for ( ULONG nLine = aSel.GetStart().GetPara(); nLine <= aSel.GetEnd().GetPara(); nLine++ ) + { + if ( ToggleBreakPoint( nLine ) ) + bNewBreakPoint = TRUE; + } + + aXEditorWindow.GetBrkWindow().Invalidate(); + return bNewBreakPoint; +} + +IMPL_LINK( ModulWindow, BasicErrorHdl, StarBASIC *, pBasic ) +{ + DBG_CHKTHIS( ModulWindow, 0 ); + GoOnTop(); + + // ReturnWert: BOOL + // FALSE: Abbrechen + // TRUE: Weiter.... + String aErrorText( pBasic->GetErrorText() ); + USHORT nErrorLine = pBasic->GetLine() - 1; + USHORT nErrCol1 = pBasic->GetCol1(); + USHORT nErrCol2 = pBasic->GetCol2(); + if ( nErrCol2 != 0xFFFF ) + nErrCol2++; + + AssertValidEditEngine(); + GetEditView()->SetSelection( TextSelection( TextPaM( nErrorLine, nErrCol1 ), TextPaM( nErrorLine, nErrCol2 ) ) ); + + String aErrorTextPrefix; + if( pBasic->IsCompilerError() ) + { + aErrorTextPrefix = String( IDEResId( RID_STR_COMPILEERROR ) ); + } + else + { + aErrorTextPrefix = String( IDEResId( RID_STR_RUNTIMEERROR ) ); + aErrorTextPrefix += StarBASIC::GetVBErrorCode( pBasic->GetErrorCode() ); + aErrorTextPrefix += ' '; + pLayout->GetStackWindow().UpdateCalls(); + } + // Wenn anderes Basic, dan sollte die IDE versuchen, da richtige + // Modul anzuzeigen... + BOOL bMarkError = ( pBasic == GetBasic() ) ? TRUE : FALSE; + if ( bMarkError ) + aXEditorWindow.GetBrkWindow().SetMarkerPos( nErrorLine, TRUE ); +// ErrorBox( this, WB_OK | WB_DEF_OK, String( aErrorTextPrefix + aErrorText ) ).Execute(); +// ErrorHandler::HandleError( pBasic->GetErrorCode() ); + BasicIDE::HandleBasicError(); + if ( bMarkError ) + aXEditorWindow.GetBrkWindow().SetMarkerPos( MARKER_NOMARKER ); + return FALSE; +} + +long __EXPORT ModulWindow::BasicBreakHdl( StarBASIC* pBasic ) +{ + DBG_CHKTHIS( ModulWindow, 0 ); + // Ein GoOnTop aktiviert da Fenster, das veraendert aber den Context fuer + // das Programm! +// GoOnTop(); + + // ReturnWert: USHORT => siehe SB-Debug-Flags + USHORT nErrorLine = pBasic->GetLine(); + + // Gibt es hier einen BreakPoint? + BreakPoint* pBrk = GetBreakPoints().FindBreakPoint( nErrorLine ); + if ( pBrk && pBrk->nStopAfter ) + { + pBrk->nStopAfter--; + if ( pBrk->nStopAfter && GetBasic()->IsBreak() ) + return aStatus.nBasicFlags; // weiterlaufen... + } + + nErrorLine--; // EditEngine begint bei 0, Basic bei 1 + // Alleine schon damit gescrollt wird... + AssertValidEditEngine(); + GetEditView()->SetSelection( TextSelection( TextPaM( nErrorLine, 0 ), TextPaM( nErrorLine, 0 ) ) ); + aXEditorWindow.GetBrkWindow().SetMarkerPos( nErrorLine ); + + pLayout->GetWatchWindow().UpdateWatches(); + pLayout->GetStackWindow().UpdateCalls(); + + aStatus.bIsInReschedule = TRUE; + aStatus.bIsRunning = TRUE; + + AddStatus( BASWIN_INRESCHEDULE ); + + if( BasicIDE::GetBasicDialogCount() ) + { + Application::GetDefModalDialogParent()->EnableInput( TRUE, TRUE ); + } + + BasicIDE::InvalidateDebuggerSlots(); + + while( aStatus.bIsRunning ) + Application::Yield(); + + if( BasicIDE::GetBasicDialogCount() ) + { + Application::GetDefModalDialogParent()->EnableInput( FALSE, TRUE ); + } + + aStatus.bIsInReschedule = FALSE; + aXEditorWindow.GetBrkWindow().SetMarkerPos( MARKER_NOMARKER ); + + ClearStatus( BASWIN_INRESCHEDULE ); + + return aStatus.nBasicFlags; +} + +void ModulWindow::BasicAddWatch() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + String aWatchStr; + BOOL bInserted = FALSE; + AssertValidEditEngine(); + BOOL bAdd = TRUE; + if ( !GetEditView()->HasSelection() ) + { +// bAdd = GetEditView()->SelectCurrentWord(); + TextPaM aWordStart; + String aWord = GetEditEngine()->GetWord( GetEditView()->GetSelection().GetEnd(), &aWordStart ); + if ( aWord.Len() ) + { + TextSelection aSel( aWordStart ); + aSel.GetEnd().GetIndex() += aWord.Len(); + GetEditView()->SetSelection( aSel ); + bAdd = TRUE; + } + } + if ( bAdd ) + { + TextSelection aSel = GetEditView()->GetSelection(); + if ( aSel.GetStart().GetPara() == aSel.GetEnd().GetPara() ) + { + aWatchStr = GetEditView()->GetSelected(); + pLayout->GetWatchWindow().AddWatch( aWatchStr ); + pLayout->GetWatchWindow().UpdateWatches(); + bInserted = TRUE; + } + } + + if ( !bInserted ) + Sound::Beep(); +} + + + +void ModulWindow::BasicRemoveWatch() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + BOOL bRemoved = pLayout->GetWatchWindow().RemoveSelectedWatch(); + + if ( !bRemoved ) + Sound::Beep(); +} + + +void ModulWindow::EditMacro( const String& rMacroName ) +{ + DBG_CHKTHIS( ModulWindow, 0 ); + DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + CheckCompileBasic(); + + if ( !aStatus.bError ) + { + USHORT nStart, nEnd; + SbMethod* pMethod = (SbMethod*)xModule->Find( rMacroName, SbxCLASS_METHOD ); + if ( pMethod ) + { + pMethod->GetLineRange( nStart, nEnd ); + if ( nStart ) + { + // Basic beginnt bei 1 + nStart--; + nEnd--; + } + TextSelection aSel( TextPaM( nStart, 0 ), TextPaM( nStart, 0 ) ); + AssertValidEditEngine(); + TextView * pView = GetEditView(); + // ggf. hinscrollen, so dass erste Zeile oben... + long nVisHeight = GetOutputSizePixel().Height(); + if ( (long)pView->GetTextEngine()->GetTextHeight() > nVisHeight ) + { + long nMaxY = pView->GetTextEngine()->GetTextHeight() - nVisHeight; + long nOldStartY = pView->GetStartDocPos().Y(); + long nNewStartY = nStart * pView->GetTextEngine()->GetCharHeight(); + nNewStartY = Min( nNewStartY, nMaxY ); + pView->Scroll( 0, -(nNewStartY-nOldStartY) ); + pView->ShowCursor( FALSE, TRUE ); + GetEditVScrollBar().SetThumbPos( pView->GetStartDocPos().Y() ); + } + pView->SetSelection( aSel ); + pView->ShowCursor(); + pView->GetWindow()->GrabFocus(); + } + } +} + + +void __EXPORT ModulWindow::StoreData() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + // StoreData wird gerufen, wenn der BasicManager zerstoert oder + // dieses Fenster beendet wird. + // => Keine Unterbrechungen erwuenscht! + // Und bei SAVE, wenn AppBasic... + GetEditorWindow().SetSourceInBasic( TRUE ); + // Nicht das Modify loeschen, sonst wird das Basic nicht gespeichert + // Es wird beim Speichern sowieso geloescht. +// xModule->SetModified( FALSE ); +} + +BOOL __EXPORT ModulWindow::CanClose() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + if ( GetEditEngine() && GetEditEngine()->IsModified() ) + { + ULONG nLen = GetEditEngine()->GetTextLen(); + if ( nLen > 0xFFFb ) // Maximale String-Laenge + { + String aError( CreateQualifiedName() ); + aError += String( RTL_CONSTASCII_USTRINGPARAM( ":\n" ) ); + aError += String( IDEResId( RID_STR_SOURCETOBIG ) ); + ErrorBox( this, WB_OK | WB_DEF_OK, aError ).Execute(); + return FALSE; + } + } + return TRUE; +} + + +BOOL __EXPORT ModulWindow::AllowUndo() +{ + return GetEditorWindow().CanModify(); +} + + +void __EXPORT ModulWindow::UpdateData() +{ + DBG_CHKTHIS( ModulWindow, 0 ); + DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + // UpdateData wird gerufen, wenn sich der Source von aussen + // geaendert hat. + // => Keine Unterbrechungen erwuenscht! + if ( GetEditView() ) + { + TextSelection aSel = GetEditView()->GetSelection(); + GetEditEngine()->SetText( xModule->GetSource() ); + GetEditView()->SetSelection( aSel ); + GetEditEngine()->SetModified( FALSE ); + BasicIDE::MarkDocShellModified( GetBasic() ); + } +} + + +void __EXPORT ModulWindow::PrintData( Printer* pPrinter ) +{ + DBG_CHKTHIS( ModulWindow, 0 ); + + AssertValidEditEngine(); + + MapMode eOldMapMode( pPrinter->GetMapMode() ); + Font aOldFont( pPrinter->GetFont() ); + +// Font aFont( GetEditEngine()->CreateFontFromItemSet( GetEditEngine()->GetEmptyItemSet() ) ); + Font aFont( GetEditEngine()->GetFont() ); + aFont.SetAlign( ALIGN_BOTTOM ); + aFont.SetTransparent( TRUE ); + aFont.SetSize( Size( 0, 360 ) ); + pPrinter->SetFont( aFont ); + pPrinter->SetMapMode( MAP_100TH_MM ); + + String aTitle( CreateQualifiedName() ); + + USHORT nLineHeight = (USHORT) pPrinter->GetTextHeight(); // etwas mehr. + USHORT nParaSpace = 10; + + Size aPaperSz = pPrinter->GetOutputSize(); + aPaperSz.Width() -= (LMARGPRN+RMARGPRN); + aPaperSz.Height() -= (TMARGPRN+BMARGPRN); + + // nLinepPage stimmt nicht, wenn Zeilen umgebrochen werden muessen... + USHORT nLinespPage = (USHORT) (aPaperSz.Height()/nLineHeight); + USHORT nCharspLine = (USHORT) (aPaperSz.Width() / pPrinter->GetTextWidth( 'X' ) ); + ULONG nParas = GetEditEngine()->GetParagraphCount(); + + USHORT nPages = (USHORT) (nParas/nLinespPage+1 ); + USHORT nCurPage = 1; + USHORT nCurLine = 0; + + pPrinter->StartJob( aTitle ); + pPrinter->StartPage(); + // Header drucken... + lcl_PrintHeader( pPrinter, nPages, nCurPage, aTitle ); + Point aPos( LMARGPRN, TMARGPRN ); + for ( ULONG nPara = 0; nPara < nParas; nPara++ ) + { + String aLine( GetEditEngine()->GetText( nPara ) ); + lcl_ConvertTabsToSpaces( aLine ); + USHORT nLines = aLine.Len()/nCharspLine+1; + for ( USHORT nLine = 0; nLine < nLines; nLine++ ) + { + String aTmpLine( aLine, nLine*nCharspLine, nCharspLine ); + aPos.Y() += nLineHeight; + if ( aPos.Y() > ( aPaperSz.Height()+TMARGPRN ) ) + { + nCurPage++; + pPrinter->EndPage(); + pPrinter->StartPage(); + lcl_PrintHeader( pPrinter, nPages, nCurPage, aTitle ); + aPos = Point( LMARGPRN, TMARGPRN+nLineHeight ); + } + pPrinter->DrawText( aPos, aTmpLine ); + } + aPos.Y() += nParaSpace; + } + pPrinter->EndPage(); + pPrinter->EndJob(); + + pPrinter->SetFont( aOldFont ); + pPrinter->SetMapMode( eOldMapMode ); +} + + +void __EXPORT ModulWindow::ExecuteCommand( SfxRequest& rReq ) +{ + DBG_CHKTHIS( ModulWindow, 0 ); + AssertValidEditEngine(); + USHORT nSlot = rReq.GetSlot(); + switch ( nSlot ) + { + case SID_BASICRUN: + { + BasicRun(); + } + break; + case SID_BASICCOMPILE: + { + CompileBasic(); + } + break; + case SID_BASICSTEPOVER: + { + BasicStepOver(); + } + break; + case SID_BASICSTEPINTO: + { + BasicStepInto(); + } + break; + case SID_BASICSTEPOUT: + { + BasicStepOut(); + } + break; + case SID_BASICLOAD: + { + LoadBasic(); + } + break; + case SID_BASICSAVEAS: + { + SaveBasicSource(); + } + break; + case SID_BASICIDE_MATCHGROUP: + { + if ( !GetEditView()->MatchGroup() ) + Sound::Beep(); + } + break; + case SID_BASICIDE_TOGGLEBRKPNT: + { + BasicToggleBreakPoint(); + } + break; + case SID_BASICIDE_ADDWATCH: + { + BasicAddWatch(); + } + break; + case SID_BASICIDE_REMOVEWATCH: + { + BasicRemoveWatch(); + } + break; + case SID_CUT: + { + GetEditView()->Cut(); + BasicIDE::GetBindings().Invalidate( SID_DOC_MODIFIED ); + } + break; + case SID_COPY: + { + GetEditView()->Copy(); + } + break; + case SID_PASTE: + { + GetEditView()->Paste(); + BasicIDE::GetBindings().Invalidate( SID_DOC_MODIFIED ); + } + break; + case SID_BASICIDE_BRKPNTSCHANGED: + { + GetBreakPointWindow().Invalidate(); + } + break; + } +} + + + +void __EXPORT ModulWindow::GetState( SfxItemSet &rSet ) +{ + DBG_CHKTHIS( ModulWindow, 0 ); + SfxWhichIter aIter(rSet); + for ( USHORT nWh = aIter.FirstWhich(); 0 != nWh; nWh = aIter.NextWhich() ) + { + switch ( nWh ) + { + // allgemeine Items: + case SID_CUT: + case SID_COPY: + { +// if ( !GetEditView() || !GetEditView()->HasSelection() ) +// rSet.DisableItem( nWh ); + } + break; + case SID_PASTE: + case SID_DELETE: + { + ; + } + break; + case SID_BASICIDE_STAT_POS: + { + TextView* pView = GetEditView(); + if ( pView ) + { + TextSelection aSel = pView->GetSelection(); + String aPos( IDEResId( RID_STR_LINE ) ); + aPos += ' '; + aPos += String::CreateFromInt32( aSel.GetEnd().GetPara()+1 ); + aPos += String( RTL_CONSTASCII_USTRINGPARAM( ", " ) ); + aPos += String( IDEResId( RID_STR_COLUMN ) ); + aPos += ' '; + aPos += String::CreateFromInt32( aSel.GetEnd().GetIndex()+1 ); + SfxStringItem aItem( SID_BASICIDE_STAT_POS, aPos ); + rSet.Put( aItem ); + } + } + break; + case SID_ATTR_INSERT: + { + TextView* pView = GetEditView(); + if ( pView ) + { +// USHORT nId = pView->IsInsertMode() ? RID_STR_INSERTMODE : RID_STR_OVERWRITEMODE; +// SfxStringItem aItem( SID_ATTR_INSERT, String( IDEResId( nId ) ) ); + SfxBoolItem aItem( SID_ATTR_INSERT, pView->IsInsertMode() ); + rSet.Put( aItem ); + } + } + break; + } + } +} + + +void __EXPORT ModulWindow::DoScroll( ScrollBar* pCurScrollBar ) +{ + DBG_CHKTHIS( ModulWindow, 0 ); + if ( ( pCurScrollBar == GetHScrollBar() ) && GetEditView() ) + { + // Nicht mit dem Wert Scrollen, sondern lieber die Thumb-Pos fuer die + // VisArea verwenden: + long nDiff = GetEditView()->GetStartDocPos().X() - pCurScrollBar->GetThumbPos(); + GetEditView()->Scroll( nDiff, 0 ); + GetEditView()->ShowCursor( FALSE, TRUE ); + pCurScrollBar->SetThumbPos( GetEditView()->GetStartDocPos().X() ); + + } +} + + + +void ModulWindow::RenameModule( const String& rNewName ) +{ + DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + xModule->SetName( rNewName ); +} + + + +BOOL __EXPORT ModulWindow::IsModified() +{ + return GetEditEngine() ? GetEditEngine()->IsModified() : FALSE; +} + + + +void __EXPORT ModulWindow::GoOnTop() +{ + IDE_DLL()->GetShell()->GetViewFrame()->ToTop(); +} + +String ModulWindow::GetModuleName() +{ + String aModuleName; + if ( xModule.Is() ) + aModuleName = xModule->GetName(); + return aModuleName; +} + + + +String __EXPORT ModulWindow::GetTitle() +{ + return GetModuleName(); +} + + + +void ModulWindow::FrameWindowMoved() +{ +// if ( GetEditEngine() && GetEditEngine()->IsInSelectionMode() ) +// GetEditEngine()->StopSelectionMode(); +} + + + +void ModulWindow::ShowCursor( BOOL bOn ) +{ + if ( GetEditEngine() ) + { + TextView* pView = GetEditEngine()->GetActiveView(); + if ( pView ) + { + if ( bOn ) + pView->ShowCursor(); + else + pView->HideCursor(); + } + } +} + + +Window* __EXPORT ModulWindow::GetLayoutWindow() +{ + return pLayout; +} + +void ModulWindow::AssertValidEditEngine() +{ + if ( !GetEditEngine() ) + GetEditorWindow().CreateEditEngine(); +} + +void ModulWindow::Deactivating() +{ + if ( GetEditView() ) + GetEditView()->EraseVirtualDevice(); +} + +USHORT ModulWindow::StartSearchAndReplace( const SvxSearchItem& rSearchItem, BOOL bFromStart ) + +{ + // Mann koennte fuer das blinde Alle-Ersetzen auch auf + // Syntaxhighlighting/Formatierung verzichten... + AssertValidEditEngine(); + ExtTextView* pView = GetEditView(); + TextSelection aSel; + if ( bFromStart ) + { + aSel = pView->GetSelection(); + if ( !rSearchItem.GetBackward() ) + pView->SetSelection( TextSelection() ); + else + pView->SetSelection( TextSelection( TextPaM( 0xFFFFFFFF, 0xFFFF ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) ); + } + + SearchParam aSearchParam( rSearchItem.GetSearchString(), + SearchParam::SRCH_NORMAL, rSearchItem.GetExact(), + rSearchItem.GetWordOnly(), rSearchItem.GetSelection() ); + if ( rSearchItem.GetRegExp() ) + aSearchParam.SetSrchType( SearchParam::SRCH_REGEXP ); + else if ( rSearchItem.IsLevenshtein() ) + { + aSearchParam.SetSrchType( SearchParam::SRCH_LEVDIST ); + aSearchParam.SetSrchRelaxed( rSearchItem.IsLEVRelaxed() ? TRUE : FALSE ); + aSearchParam.SetLEVOther( rSearchItem.GetLEVOther() ); + aSearchParam.SetLEVShorter( rSearchItem.GetLEVShorter() ); + aSearchParam.SetLEVLonger( rSearchItem.GetLEVLonger() ); + } + BOOL bForward = !rSearchItem.GetBackward(); + USHORT nFound = 0; + if ( ( rSearchItem.GetCommand() == SVX_SEARCHCMD_FIND ) || + ( rSearchItem.GetCommand() == SVX_SEARCHCMD_FIND_ALL ) ) + { + nFound = pView->Search( aSearchParam, bForward ); + } + else if ( ( rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE ) || + ( rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL ) ) + { + aSearchParam.SetReplaceStr( rSearchItem.GetReplaceString() ); + BOOL bAll = rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL; + nFound = pView->Replace( aSearchParam, bAll, bForward ); + } + + if ( bFromStart && !nFound ) + pView->SetSelection( aSel ); + + return nFound; +} + +SfxUndoManager* __EXPORT ModulWindow::GetUndoManager() +{ + if ( GetEditEngine() ) + return &GetEditEngine()->GetUndoManager(); + return NULL; +} + +USHORT __EXPORT ModulWindow::GetSearchOptions() +{ + return SEARCH_OPTIONS_SEARCH | SEARCH_OPTIONS_REPLACE | + SEARCH_OPTIONS_REPLACE_ALL | SEARCH_OPTIONS_WHOLE_WORDS | + SEARCH_OPTIONS_BACKWARDS | SEARCH_OPTIONS_REG_EXP | + SEARCH_OPTIONS_EXACT | SEARCH_OPTIONS_SELECTION | SEARCH_OPTIONS_SIMILARITY; +} + +void __EXPORT ModulWindow::BasicStarted() +{ + aStatus.bIsRunning = TRUE; + if ( GetBreakPoints().Count() ) + { + GetBreakPoints().SetBreakPointsInBasic( xModule ); + for ( USHORT nMethod = 0; nMethod < xModule->GetMethods()->Count(); nMethod++ ) + { + SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( nMethod ); + DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); + pMethod->SetDebugFlags( pMethod->GetDebugFlags() | SbDEBUG_BREAK ); + } + } +} + +void __EXPORT ModulWindow::BasicStopped() +{ + aStatus.bIsRunning = FALSE; + GetBreakPointWindow().SetMarkerPos( MARKER_NOMARKER ); +} + +String ModulWindow::CreateSbxDescription() +{ + String aDescription = IDEBaseWindow::CreateSbxDescription(); + aDescription += ';'; + aDescription += GetModule()->GetName(); + return aDescription; +} + +void ModulWindow::SetReadOnly( BOOL b ) +{ + if ( GetEditView() ) + GetEditView()->SetReadOnly( b ); +} + +ModulWindowLayout::ModulWindowLayout( Window* pParent ) : + Window( pParent, WB_CLIPCHILDREN ), + aWatchWindow( this ), + aStackWindow( this ), + aVSplitter( this, WinBits( WB_VSCROLL ) ), + aHSplitter( this, WinBits( WB_HSCROLL ) ), + aImages( IDEResId( RID_IMGLST_LAYOUT ) ) +{ + pModulWindow = 0; + bVSplitted = FALSE; + bHSplitted = FALSE; + + aVSplitter.SetSplitHdl( LINK( this, ModulWindowLayout, SplitHdl ) ); + aHSplitter.SetSplitHdl( LINK( this, ModulWindowLayout, SplitHdl ) ); + aVSplitter.Show(); + aHSplitter.Show(); + + aWatchWindow.Show(); + aStackWindow.Show(); + + aSyntaxColors[0] = Color( COL_BLACK ); // TT_UNKNOWN, + aSyntaxColors[1] = Color( COL_GREEN ); // TT_IDENTIFIER, + aSyntaxColors[2] = Color( COL_BLACK ); // TT_WHITESPACE, + aSyntaxColors[3] = Color( COL_LIGHTRED ); // TT_NUMBER, + aSyntaxColors[4] = Color( COL_LIGHTRED ); // TT_STRING, + aSyntaxColors[5] = Color( COL_BLACK ); // TT_EOL, + aSyntaxColors[6] = Color( COL_GRAY ); // TT_COMMENT, + aSyntaxColors[7] = Color( COL_RED ); // TT_ERROR, + aSyntaxColors[8] = Color( COL_BLUE ); // TT_OPERATOR, + aSyntaxColors[9] = Color( COL_BLUE ); // TT_KEYWORD + + Font aFont( GetFont() ); + Size aSz( aFont.GetSize() ); + aSz.Height() *= 3; + aSz.Height() /= 2; + aFont.SetSize( aSz ); + aFont.SetWeight( WEIGHT_BOLD ); + SetFont( aFont ); +} + +ModulWindowLayout::~ModulWindowLayout() +{ +} + +void __EXPORT ModulWindowLayout::Resize() +{ + // ScrollBars, etc. passiert in BasicIDEShell:Adjust... + ArrangeWindows(); +// Invalidate(); +} + +void __EXPORT ModulWindowLayout::Paint( const Rectangle& rRect ) +{ + DrawText( Point(), String( IDEResId( RID_STR_NOMODULE ) ) ); +} + + +void ModulWindowLayout::ArrangeWindows() +{ + Size aSz = GetOutputSizePixel(); + + // prueffen, ob der Splitter in einem gueltigen Bereich liegt... + long nMinPos = SPLIT_MARGIN; + long nMaxPos = aSz.Height() - SPLIT_MARGIN; + + long nVSplitPos = aVSplitter.GetSplitPosPixel(); + long nHSplitPos = aHSplitter.GetSplitPosPixel(); + if ( !bVSplitted ) + { + // Wenn noch nie gesplitted wurde, Verhaeltniss = 3 : 4 + nVSplitPos = aSz.Height() * 3 / 4; + aVSplitter.SetSplitPosPixel( nVSplitPos ); + } + if ( !bHSplitted ) + { + // Wenn noch nie gesplitted wurde, Verhaeltniss = 2 : 3 + nHSplitPos = aSz.Width() * 2 / 3; + aHSplitter.SetSplitPosPixel( nHSplitPos ); + } + if ( ( nVSplitPos < nMinPos ) || ( nVSplitPos > nMaxPos ) ) + nVSplitPos = ( nVSplitPos < nMinPos ) ? 0 : ( aSz.Height() - SPLIT_HEIGHT ); + + Size aXEWSz; + aXEWSz.Width() = aSz.Width(); + aXEWSz.Height() = nVSplitPos + 1; + if ( pModulWindow ) + { + DBG_CHKOBJ( pModulWindow, ModulWindow, 0 ); + pModulWindow->SetPosSizePixel( Point( 0, 0 ), aXEWSz ); + } + + aVSplitter.SetDragRectPixel( Rectangle( Point( 0, 0 ), Size( aSz.Width(), aSz.Height() ) ) ); + aVSplitter.SetPosPixel( Point( 0, nVSplitPos ) ); + aVSplitter.SetSizePixel( Size( aSz.Width(), SPLIT_HEIGHT ) ); + + aHSplitter.SetDragRectPixel( Rectangle( Point( 0, nVSplitPos+SPLIT_HEIGHT ), Size( aSz.Width(), aSz.Height() - nVSplitPos - SPLIT_HEIGHT ) ) ); + aHSplitter.SetPosPixel( Point( nHSplitPos, nVSplitPos ) ); + aHSplitter.SetSizePixel( Size( SPLIT_HEIGHT, aSz.Height() - nVSplitPos ) ); + + Size aWWSz; + Point aWWPos( 0, nVSplitPos+SPLIT_HEIGHT ); + aWWSz.Width() = nHSplitPos; + aWWSz.Height() = aSz.Height() - aWWPos.Y(); + if ( !aWatchWindow.IsFloatingMode() ) + aWatchWindow.SetPosSizePixel( aWWPos, aWWSz ); + + Size aSWSz; + Point aSWPos( nHSplitPos+SPLIT_HEIGHT, nVSplitPos+SPLIT_HEIGHT ); + aSWSz.Width() = aSz.Width() - aSWPos.X(); + aSWSz.Height() = aSz.Height() - aSWPos.Y(); + if ( !aStackWindow.IsFloatingMode() ) + aStackWindow.SetPosSizePixel( aSWPos, aSWSz ); + +#ifndef VCL +#ifndef UNX + if ( aStackWindow.IsFloatingMode() && aWatchWindow.IsFloatingMode() ) + aHSplitter.Hide(); + else + aHSplitter.Show(); +#else + // Irgendwas liegt im argen. Das Stacking der windows kommt manchmal + // durcheinander. + if ( aStackWindow.IsFloatingMode() && aWatchWindow.IsFloatingMode() ) + aHSplitter.Hide(); + else + { + aHSplitter.Show(); + aHSplitter.ToTop(); + } + aVSplitter.ToTop(); + Invalidate(); +#endif +#else + if ( aStackWindow.IsFloatingMode() && aWatchWindow.IsFloatingMode() ) + aHSplitter.Hide(); + else + aHSplitter.Show(); +#endif + + long nHDoubleClickSplitPosX = aSz.Width()-aHSplitter.GetSizePixel().Width(); + if ( aHSplitter.GetSplitPosPixel() < nHDoubleClickSplitPosX ) + aHSplitter.SetLastSplitPosPixel( nHDoubleClickSplitPosX ); + + + long nHDoubleClickSplitPosY = aSz.Height()-aVSplitter.GetSizePixel().Height(); + if ( aVSplitter.GetSplitPosPixel() < nHDoubleClickSplitPosY ) + aVSplitter.SetLastSplitPosPixel( nHDoubleClickSplitPosY ); +} + +IMPL_LINK( ModulWindowLayout, SplitHdl, Splitter *, pSplitter ) +{ + if ( pSplitter == &aVSplitter ) + bVSplitted = TRUE; + else + bHSplitted = TRUE; + + ArrangeWindows(); + return 0; +} + +BOOL ModulWindowLayout::IsToBeDocked( DockingWindow* pDockingWindow, const Point& rPos, Rectangle& rRect ) +{ + // prueffen, ob als Dock oder als Child: + // TRUE: Floating + // FALSE: Child + Point aPosInMe = ScreenToOutputPixel( rPos ); + Size aSz = GetOutputSizePixel(); + if ( ( aPosInMe.X() > 0 ) && ( aPosInMe.X() < aSz.Width() ) && + ( aPosInMe.Y() > 0 ) && ( aPosInMe.Y() < aSz.Height() ) ) + { + long nVSplitPos = aVSplitter.GetSplitPosPixel(); + long nHSplitPos = aHSplitter.GetSplitPosPixel(); + if ( pDockingWindow == &aWatchWindow ) + { + if ( ( aPosInMe.Y() > nVSplitPos ) && ( aPosInMe.X() < nHSplitPos ) ) + { + rRect.SetSize( Size( nHSplitPos, aSz.Height() - nVSplitPos ) ); + rRect.SetPos( OutputToScreenPixel( Point( 0, nVSplitPos ) ) ); + return TRUE; + } + } + if ( pDockingWindow == &aStackWindow ) + { + if ( ( aPosInMe.Y() > nVSplitPos ) && ( aPosInMe.X() > nHSplitPos ) ) + { + rRect.SetSize( Size( aSz.Width() - nHSplitPos, aSz.Height() - nVSplitPos ) ); + rRect.SetPos( OutputToScreenPixel( Point( nHSplitPos, nVSplitPos ) ) ); + return TRUE; + } + } + } + return FALSE; +} + +void ModulWindowLayout::DockaWindow( DockingWindow* pDockingWindow ) +{ + if ( pDockingWindow == &aWatchWindow ) + { + // evtl. Sonderbehandlung... + ArrangeWindows(); + } + else if ( pDockingWindow == &aStackWindow ) + { + // evtl. Sonderbehandlung... + ArrangeWindows(); + } +#ifndef PRODUCT + else + DBG_ERROR( "Wer will sich denn hier andocken ?" ); +#endif +} + +void ModulWindowLayout::SetModulWindow( ModulWindow* pModWin ) +{ + pModulWindow = pModWin; + ArrangeWindows(); +} + diff --git a/basctl/source/basicide/baside2.hrc b/basctl/source/basicide/baside2.hrc new file mode 100644 index 000000000..f0ef7f157 --- /dev/null +++ b/basctl/source/basicide/baside2.hrc @@ -0,0 +1,93 @@ +/************************************************************************* + * + * $RCSfile: baside2.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _BASIDE2_HRC +#define _BASIDE2_HRC + +#include <basidesh.hrc> + +// Diese Dateien enthaelt nur die lokalen ID's. + +// RID_POPUP_BRKPROPS +#define RID_BRKPROPS 1 +#define RID_ACTIV 2 + +// RID_POPUP_BRKDLG +#define RID_BRKDLG 1 + + +// BasicTreeListBox +#define IMGID_APPICON ( SID_BASICIDE_IMAGESTART + 1 ) +#define IMGID_LIB ( SID_BASICIDE_IMAGESTART + 2 ) +#define IMGID_MODULE ( SID_BASICIDE_IMAGESTART + 3 ) +#define IMGID_MACRO ( SID_BASICIDE_IMAGESTART + 4 ) +#define IMGID_OBJECT ( SID_BASICIDE_IMAGESTART + 5 ) +#define IMGID_SUBOBJ ( SID_BASICIDE_IMAGESTART + 6 ) +#define IMGID_PROP ( SID_BASICIDE_IMAGESTART + 7 ) +#define IMGID_DOCUMENT ( SID_BASICIDE_IMAGESTART + 8 ) +#define IMGID_LIBNOTLOADED ( SID_BASICIDE_IMAGESTART + 9 ) + +// ModulWindowLayout +#define IMGID_BRKENABLED ( SID_BASICIDE_IMAGESTART + 20 ) +#define IMGID_BRKDISABLED ( SID_BASICIDE_IMAGESTART + 21 ) +#define IMGID_STEPMARKER ( SID_BASICIDE_IMAGESTART + 22 ) +#define IMGID_ERRORMARKER ( SID_BASICIDE_IMAGESTART + 23 ) + +#endif // _BASIDE2_HRC diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx new file mode 100644 index 000000000..e9267cd1d --- /dev/null +++ b/basctl/source/basicide/baside2.hxx @@ -0,0 +1,503 @@ +/************************************************************************* + * + * $RCSfile: baside2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _BASIDE2_HXX +#define _BASIDE2_HXX + +#ifndef _SVHEADER_HXX +#include <svheader.hxx> +#endif + +#include <bastypes.hxx> +#include <bastype3.hxx> +#include <basidesh.hxx> + +#include <basic/hilight.hxx> + +class ExtTextEngine; +class ExtTextView; +class SvxSearchItem; + +#ifndef _SFXSTBMGR_HXX //autogen +#include <sfx2/stbmgr.hxx> +#endif + +#ifndef _SVTREEBOX_HXX //autogen +#include <svtools/svtreebx.hxx> +#endif + +#ifndef _SV_BUTTON_HXX //autogen +#include <vcl/button.hxx> +#endif + +#ifndef _SB_SBMOD_HXX //autogen +#include <basic/sbmod.hxx> +#endif + +#ifndef _SV_SPLIT_HXX //autogen +#include <vcl/split.hxx> +#endif + +#include <sfx2/progress.hxx> + + +DBG_NAMEEX( ModulWindow ); + +#define MARKER_NOMARKER 0xFFFF + + + +class ProgressInfo : public SfxProgress +{ +private: + ULONG nCurState; + +public: + + inline ProgressInfo( SfxObjectShell* pObjSh, const String& rText, ULONG nRange ); + +// inline void StartProgress( const String& rName, ULONG nStates ); +// inline void EndProgress(); + inline void StepProgress(); +}; + +inline ProgressInfo::ProgressInfo( SfxObjectShell* pObjSh, const String& rText, ULONG nRange ) + : SfxProgress( pObjSh, rText, nRange ) +{ + nCurState = 0; +} + +// inline void ProgressInfo::StartProgress( const String& rName, ULONG nStates ) +// { +// nCurState = 0; +// if ( pStbMgr ) +// pStbMgr->StartProgressMode( rName, nStates ); +// } + +// inline void ProgressInfo::EndProgress() +// { +// if ( pStbMgr ) +// pStbMgr->EndProgressMode(); +//} + +inline void ProgressInfo::StepProgress() +{ + SetState( ++nCurState ); +} + +class EditorWindow : public Window, public SfxListener +{ +private: + ExtTextView* pEditView; + ExtTextEngine* pEditEngine; + + long nCurTextWidth; + + SyntaxHighlighter aHighlighter; + Timer aSyntaxIdleTimer; + Table aSyntaxLineTable; + DECL_LINK( SyntaxTimerHdl, Timer * ); + ProgressInfo* pProgress; + ModulWindow* pModulWindow; + + Timer aHelpAgentTimer; + DECL_LINK( HelpAgentTimerHdl, Timer * ); + + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + void ImpDoHighlight( ULONG nLineOff ); + BOOL bHighlightning; + BOOL bDoSyntaxHighlight; + BOOL bDelayHighlight; + +protected: + virtual void Paint( const Rectangle& ); + virtual void Resize(); + virtual void KeyInput( const KeyEvent& rKeyEvt ); + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + virtual void Command( const CommandEvent& rCEvt ); + virtual BOOL Drop( const DropEvent& rEvt ); + virtual BOOL QueryDrop( DropEvent& rEvt ); + virtual void LoseFocus(); + virtual void RequestHelp( const HelpEvent& rHEvt ); + + void DoSyntaxHighlight( ULONG nPara ); + void ToggleHighlightMode(); + String GetWordAtCursor(); + BOOL ImpCanModify(); + +public: + EditorWindow( Window* pParent ); + ~EditorWindow(); + + ExtTextEngine* GetEditEngine() const { return (ExtTextEngine*)pEditEngine; } + ExtTextView* GetEditView() const { return pEditView; } + ProgressInfo* GetProgress() const { return pProgress; } + + void CreateProgress( const String& rText, ULONG nRange ); + void DestroyProgress(); + + void ParagraphInsertedDeleted( ULONG nNewPara, BOOL bInserted ); + void DoDelayedSyntaxHighlight( ULONG nPara ); + + void CreateEditEngine(); + void SetScrollBarRanges(); + void InitScrollBars(); + void SetModulWindow( ModulWindow* pWin ) + { pModulWindow = pWin; } + + void ForceSyntaxTimeout(); + BOOL SetSourceInBasic( BOOL bQuiet = TRUE ); + + BOOL CanModify() { return ImpCanModify(); } +}; + + +class BreakPointWindow : public Window +{ +private: + long nCurYOffset; + USHORT nMarkerPos; + BreakPointList aBreakPointList; + ModulWindow* pModulWindow; + BOOL bErrorMarker; + +protected: + virtual void Paint( const Rectangle& ); + virtual void Resize(); + BreakPoint* FindBreakPoint( const Point& rMousePos ); + void ShowMarker( BOOL bShow ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void Command( const CommandEvent& rCEvt ); + + BOOL SyncYOffset(); + +public: + BreakPointWindow( Window* pParent ); + ~BreakPointWindow(); + + void SetModulWindow( ModulWindow* pWin ) + { pModulWindow = pWin; } + + void SetMarkerPos( USHORT nLine, BOOL bErrorMarker = FALSE ); + +// virtual void MouseMove( const MouseEvent& rMEvt ); +// virtual void MouseButtonUp( const MouseEvent& rMEvt ); +// virtual BOOL Drop( const DropEvent& rEvt ); +// virtual BOOL QueryDrop( const DropEvent& rEvt ); + + void Scroll( long nHorzScroll, long nVertScroll ); + long& GetCurYOffset() { return nCurYOffset; } + BreakPointList& GetBreakPoints() { return aBreakPointList; } +}; + + +class WatchTreeListBox : public SvTreeListBox +{ + String aEditingRes; + +protected: + virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& rSel ); + virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ); + + BOOL ImplBasicEntryEdited( SvLBoxEntry* pEntry, const String& rVName, const String& rResult ); + +// virtual DragDropMode NotifyBeginDrag( SvLBoxEntry* ); +// virtual BOOL NotifyQueryDrop( SvLBoxEntry* ); + +// virtual BOOL NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, +// SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ); +// virtual BOOL NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, +// SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ); +// BOOL NotifyCopyingMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, +// SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos, BOOL bMove ); + +public: + WatchTreeListBox( Window* pParent, WinBits nWinBits ); + ~WatchTreeListBox(); + + void UpdateWatches(); +}; + + + +class WatchWindow : public BasicDockingWindow +{ +private: + WatchTreeListBox aTreeListBox; + + String aWatchStr; + ExtendedEdit aXEdit; + ImageButton aRemoveWatchButton; + +protected: + virtual void Resize(); + virtual void Paint( const Rectangle& rRect ); + + DECL_LINK( ButtonHdl, ImageButton * ); + DECL_LINK( TreeListHdl, SvTreeListBox * ); + DECL_LINK( EditAccHdl, Accelerator * ); + +public: + WatchWindow( Window* pParent ); + ~WatchWindow(); + + void AddWatch( const String& rVName ); + BOOL RemoveSelectedWatch(); + void UpdateWatches(); + + WatchTreeListBox& GetWatchTreeListBox() { return aTreeListBox; } +}; + + +class StackWindow : public BasicDockingWindow +{ +private: + SvTreeListBox aTreeListBox; + ImageButton aGotoCallButton; + String aStackStr; + +protected: + virtual void Resize(); + virtual void Paint( const Rectangle& rRect ); + DECL_LINK( ButtonHdl, ImageButton * ); + +public: + StackWindow( Window* pParent ); + ~StackWindow(); + + void UpdateCalls(); +}; + + +class ComplexEditorWindow : public Window +{ +private: + BreakPointWindow aBrkWindow; + EditorWindow aEdtWindow; + ScrollBar aEWVScrollBar; + +protected: + virtual void Resize(); + virtual void Paint( const Rectangle& rRect ); + DECL_LINK( ScrollHdl, ScrollBar * ); + +public: + ComplexEditorWindow( ModulWindow* pParent ); + + BreakPointWindow& GetBrkWindow() { return aBrkWindow; } + EditorWindow& GetEdtWindow() { return aEdtWindow; } + ScrollBar& GetEWVScrollBar() { return aEWVScrollBar; } +}; + + +#define SYNTAX_COLOR_MAX 5 + +class ModulWindow: public IDEBaseWindow +{ + friend class BasicIDEShell; + +private: + + short nValid; + ComplexEditorWindow aXEditorWindow; + BasicStatus aStatus; + SbModuleRef xModule; + ModulWindowLayout* pLayout; + String aCurPath; + + DECL_LINK( BasicErrorHdl, StarBASIC * ); + long BasicBreakHdl( StarBASIC* pBasic ); + + void CheckCompileBasic(); + BOOL BasicExecute(); + + void GoOnTop(); + void AssertValidEditEngine(); + +protected: + virtual void Resize(); + virtual void GetFocus(); + virtual void Paint( const Rectangle& ); + virtual void Deactivating(); + virtual void DoInit(); + virtual void DoScroll( ScrollBar* pCurScrollBar ); + +public: + TYPEINFO(); + ModulWindow( ModulWindowLayout* pParent, StarBASIC* pBasic, SbModule* pModule ); + ~ModulWindow(); + + virtual void ExecuteCommand( SfxRequest& rReq ); + virtual void GetState( SfxItemSet& ); + virtual void StoreData(); + virtual void UpdateData(); + virtual BOOL CanClose(); + virtual void PrintData( Printer* pPrinter ); + virtual String GetTitle(); + virtual String CreateSbxDescription(); + virtual BOOL AllowUndo(); + virtual void SetReadOnly( BOOL bReadOnly ); + + + SbModule* GetModule() { return xModule; } + String GetModuleName(); + + BOOL CompileBasic(); + BOOL BasicRun(); + BOOL BasicStepOver(); + BOOL BasicStepInto(); + BOOL BasicStepOut(); + void BasicStop(); + BOOL BasicToggleBreakPoint(); + void UpdateBreakPoint( const BreakPoint& rBrk ); + void BasicAddWatch(); + void BasicRemoveWatch(); + + BOOL LoadBasic(); + BOOL SaveBasicSource(); + + void EditMacro( const String& rMacroName ); + +// void InsertFromObjectCatalog( ObjectCatalog* pObjDlg ); + + BOOL ToggleBreakPoint( ULONG nLine ); + void RenameModule( const String& rNewName ); + + BasicStatus& GetBasicStatus() { return aStatus; } + + virtual BOOL IsModified(); + + void FrameWindowMoved(); + void ShowCursor( BOOL bOn ); + + virtual USHORT GetSearchOptions(); + USHORT StartSearchAndReplace( const SvxSearchItem& rSearchItem, BOOL bFromStart = FALSE ); + + virtual Window* GetLayoutWindow(); + + EditorWindow& GetEditorWindow() { return aXEditorWindow.GetEdtWindow(); } + BreakPointWindow& GetBreakPointWindow() { return aXEditorWindow.GetBrkWindow(); } + ScrollBar& GetEditVScrollBar() { return aXEditorWindow.GetEWVScrollBar(); } + ExtTextEngine* GetEditEngine() { return GetEditorWindow().GetEditEngine(); } + ExtTextView* GetEditView() { return GetEditorWindow().GetEditView(); } + BreakPointList& GetBreakPoints() { return GetBreakPointWindow().GetBreakPoints(); } + ModulWindowLayout* GetLayout() const { return pLayout; } + + virtual void BasicStarted(); + virtual void BasicStopped(); + + virtual SfxUndoManager* GetUndoManager(); +}; + +class ModulWindowLayout: public Window +{ +private: + + Splitter aVSplitter; + Splitter aHSplitter; + + WatchWindow aWatchWindow; + StackWindow aStackWindow; + + DECL_LINK( SplitHdl, Splitter * ); + BOOL bVSplitted; + BOOL bHSplitted; + + void ArrangeWindows(); + + ModulWindow* pModulWindow; + +// BOOL bDoSyntaxHighlight; + Color aSyntaxColors[10]; + + ImageList aImages; + +protected: + virtual void Resize(); + virtual void Paint( const Rectangle& rRect ); + +public: + ModulWindowLayout( Window* pParent ); + ~ModulWindowLayout(); + + void DockaWindow( DockingWindow* pDockingWin ); + BOOL IsToBeDocked( DockingWindow* pDockingWin, const Point& rPos, Rectangle& rRect ); + + void SetModulWindow( ModulWindow* pModWin ); + ModulWindow* GetModulWindow() const { return pModulWindow; } + + WatchWindow& GetWatchWindow() { return aWatchWindow; } + StackWindow& GetStackWindow() { return aStackWindow; } + + Color* GetSyntaxColors() { return aSyntaxColors; } + + Image GetImage( USHORT nId ) { return aImages.GetImage( nId ); } + +// BOOL DoHighlight() const { return bDoSyntaxHighlight; } +// void SetHighlightMode( BOOL bHighlight ) +// { bDoSyntaxHighlight = bHighlight; } +}; + +#endif // _BASIDE2_HXX diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx new file mode 100644 index 000000000..39ed1abb0 --- /dev/null +++ b/basctl/source/basicide/baside2b.cxx @@ -0,0 +1,1917 @@ +/************************************************************************* + * + * $RCSfile: baside2b.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <svtools/svarray.hxx> +#define _BASIC_TEXTPORTIONS +#include <basic/sbdef.hxx> +#include <ide_pch.hxx> + +#pragma hdrstop + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#include <vcl/sound.hxx> +#include <svtools/xtextedt.hxx> +#include <svtools/txtattr.hxx> + +#include <baside2.hrc> +#include <baside2.hxx> +#include <brkdlg.hxx> +#include <objdlg.hxx> +#include <basobj.hxx> +#include <iderdll.hxx> +#include <iderdll2.hxx> + +#include <vcl/system.hxx> + +#ifndef _SFX_HELP_HXX //autogen +#include <sfx2/sfxhelp.hxx> +#endif + + +long nVirtToolBoxHeight; // wird im WatchWindow init., im Stackwindow verw. + +#define SCROLL_LINE 12 +#define SCROLL_PAGE 60 + +#define DWBORDER 3 + +static const char cSuffixes[] = "%&!#@$"; + +MapUnit eEditMapUnit = MAP_100TH_MM; + + +void lcl_GetValues( String& rWatchStr, SbxDimArray* pArray, + short* pIdx, USHORT nCurrentDim ) +{ + USHORT nDims = pArray->GetDims(); + short nMin, nMax; + pArray->GetDim( nCurrentDim, nMin, nMax ); + for ( USHORT n = nMin; n <= nMax; n++ ) + { +// pIdx[nDims-nCurrentDim] = n; + pIdx[nCurrentDim-1] = n; +// if ( nCurrentDim > 1 ) + if ( nCurrentDim < nDims ) + rWatchStr += String( RTL_CONSTASCII_USTRINGPARAM( "[ " ) ); + +// if ( nCurrentDim > 1 ) + if ( nCurrentDim < nDims ) +// lcl_GetValues( rWatchStr, pArray, pIdx, nCurrentDim-1 ); + lcl_GetValues( rWatchStr, pArray, pIdx, nCurrentDim+1 ); + else + { + SbxBase* pElem = pArray->Get( pIdx ); + if ( pElem ) + rWatchStr += ((SbxVariable*)pElem)->GetString(); + if ( n < nMax ) + rWatchStr += String( RTL_CONSTASCII_USTRINGPARAM( "; " ) ); + } +// if ( nCurrentDim > 1 ) + if ( nCurrentDim < nDims ) + rWatchStr += String( RTL_CONSTASCII_USTRINGPARAM( " ]" ) ); + } +} + + +SbxBase* lcl_FindElement( SbxDimArray* pArray, const String& rIndex, BOOL& rbValidIndex ) +{ + rbValidIndex = FALSE; + SbxBase* pElem = 0; + + USHORT nTokens = rIndex.GetTokenCount( ',' ); + USHORT nDims = pArray->GetDims(); + if ( nDims == nTokens ) + { + short* pIdx = new short[ nDims ]; + for ( USHORT n = nDims; n; ) + pIdx[--n] = 0; + + rbValidIndex = TRUE; + for ( USHORT nDim = nTokens; nDim; nDim--,rbValidIndex ) + { + String aTmpIndex( rIndex.GetToken( nDims-nDim, ',' ) ); + aTmpIndex.EraseLeadingChars(); + aTmpIndex.EraseTrailingChars(); + short nIndex = 0x7FFF; + + if ( ByteString( aTmpIndex, RTL_TEXTENCODING_UTF8 ).IsNumericAscii() ) + nIndex = (USHORT) aTmpIndex.ToInt32(); + else + { + SbxBase* pIndexSBX = StarBASIC::FindSBXInCurrentScope( aTmpIndex ); + if ( pIndexSBX && pIndexSBX->ISA( SbxVariable ) && !pIndexSBX->ISA( SbxMethod ) ) + { + SbxVariable* pIndexVar = (SbxVariable*)pIndexSBX; + SbxDataType eType = pIndexVar->GetType(); + if ( ( (BYTE)eType != (BYTE)SbxOBJECT ) + && !( eType & SbxARRAY ) ) + { + nIndex = (USHORT) pIndexVar->GetString().ToInt32(); + } + } + } + + short nMin, nMax; + pArray->GetDim( nDim, nMin, nMax ); + if ( ( nIndex >= nMin ) && ( nIndex <= nMax ) ) + pIdx[nDims-nDim] = nIndex; + else + rbValidIndex = FALSE; // Und Abbruch... + } + + if ( rbValidIndex ) + pElem = pArray->Get( pIdx ); + } + + return pElem; +} + +void lcl_FormatArrayString( String& rResult ) +{ + USHORT nLastSep = 0xFFFF; + + // Format eines mehrdimensionalen Arrays: + // Beliebig tief geschachtelt. + // {[ [ 1;2 ][ 3;4 ] ] [ 5;6 ][ 7;8 ] ] ]} + + // Geschw. Klammern nur dann entfernen, wenn sie genau am Anfang und Ende + // stehen, falls es einfach nur char's in einem String sind. + if ( ( rResult.Len() > 1 ) && ( rResult.GetChar( 0 ) == '{' ) && ( rResult.GetChar( rResult.Len() - 1 ) == '}') ) + { + rResult.Erase( 0, 1 ); + rResult.Erase( rResult.Len()-1, 1 ); + rResult.EraseLeadingChars(); + rResult.EraseTrailingChars(); + } + + // Jetzt die Klammern abarbeiten: + // Vor einer '[' muss ein Separator gewesen sein (oder Start) + // String stammen. + // Nach einer ']' muss ein Blank oder ein ']' oder ein '[' stehen. + USHORT nIndex = 0; + USHORT nLevel = 0; + char cLastSep = ' '; + BOOL bLastWasSep = TRUE; + while ( nIndex < rResult.Len() ) + { + switch ( rResult.GetChar( nIndex ) ) + { + case '[': + { + if ( bLastWasSep ) + { + rResult.Erase( nIndex, 1 ); + while ( ( nIndex < rResult.Len() ) && ( rResult.GetChar( nIndex ) == ' ' ) ) + rResult.Erase( nIndex, 1 ); + nLevel++; + cLastSep = '['; + bLastWasSep = TRUE; + } + else + nIndex++; + } + break; + case ']': + { + USHORT nNext = nIndex+1; + if ( nLevel && + ( ( nNext == rResult.Len() ) || ( rResult.GetChar( nNext ) == ' ' ) + || ( rResult.GetChar( nNext ) == '[' ) || ( rResult.GetChar( nNext ) == ']' ) ) ) + { + rResult.Erase( nIndex, 1 ); + while ( ( nIndex < rResult.Len() ) && ( rResult.GetChar( nIndex ) == ' ' ) ) + rResult.Erase( nIndex, 1 ); + nLevel--; + // vor einer ']' steht keine ';': + if ( cLastSep == '[' ) + rResult.Insert( ';', nIndex++ ); + cLastSep = ']'; + bLastWasSep = TRUE; + } + else + nIndex++; + } + break; + default: + { + nIndex++; + bLastWasSep = FALSE; + } + } + } +// if ( rResult.Len() && rResult[(USHORT)(rResult.Len()-1)] == ';' ) +// rResult.Erase( rResult.Len()-1 ); +} + +void lcl_DrawIDEWindowFrame( DockingWindow* pWin ) +{ + if ( !pWin->IsFloatingMode() ) + { + Size aSz = pWin->GetOutputSizePixel(); + long nY = nVirtToolBoxHeight - 1; + const Color aOldLineColor( pWin->GetLineColor() ); + pWin->SetLineColor( Color( COL_WHITE ) ); + // oben eine weisse.. + pWin->DrawLine( Point( 0, 0 ), Point( aSz.Width(), 0 ) ); + // unten eine schwarze... + pWin->SetLineColor( Color( COL_BLACK ) ); + pWin->DrawLine( Point( 0, aSz.Height() - 1 ), Point( aSz.Width(), aSz.Height() - 1 ) ); + pWin->SetLineColor( aOldLineColor ); + } +} + +void lcl_SeparateNameAndIndex( const String& rVName, String& rVar, String& rIndex ) +{ + rVar = rVName; + rIndex.Erase(); + USHORT nIndexStart = rVar.Search( '(' ); + if ( nIndexStart != STRING_NOTFOUND ) + { + USHORT nIndexEnd = rVar.Search( ')', nIndexStart ); + if ( nIndexStart != STRING_NOTFOUND ) + { + rIndex = rVar.Copy( nIndexStart+1, nIndexEnd-nIndexStart-1 ); + rVar.Erase( nIndexStart ); + rVar.EraseTrailingChars(); + rIndex.EraseLeadingChars(); + rIndex.EraseTrailingChars(); + } + } + + if ( rVar.Len() ) + { + USHORT nLastChar = rVar.Len()-1; + if ( strchr( cSuffixes, rVar.GetChar( nLastChar ) ) ) + rVar.Erase( nLastChar, 1 ); + } + if ( rIndex.Len() ) + { + USHORT nLastChar = rIndex.Len()-1; + if ( strchr( cSuffixes, rIndex.GetChar( nLastChar ) ) ) + rIndex.Erase( nLastChar, 1 ); + } +} + + +EditorWindow::EditorWindow( Window* pParent ) : + Window( pParent, WB_BORDER ) +{ + bDoSyntaxHighlight = TRUE; + bDelayHighlight = TRUE; + pModulWindow = 0; + pEditView = 0; + pEditEngine = 0; + bHighlightning = FALSE; + pProgress = 0; + nCurTextWidth = 0; + SetBackground( Wallpaper( COL_WHITE ) ); + EnableDrop(); + SetPointer( Pointer( POINTER_TEXT ) ); +} + + + +__EXPORT EditorWindow::~EditorWindow() +{ + aSyntaxIdleTimer.Stop(); + aHelpAgentTimer.Stop(); + + if ( pEditEngine ) + { + EndListening( *pEditEngine ); + pEditEngine->RemoveView( pEditView ); +// pEditEngine->SetViewWin( 0 ); + delete pEditView; + delete pEditEngine; + } +} + +String EditorWindow::GetWordAtCursor() +{ +// ESelection aESel( pEditView->GetSelection() ); + // Nicht den Selektierten Bereich, sondern an der CursorPosition, + // falls Teil eines Worts markiert. + String aWord( pEditView->GetTextEngine()->GetWord( pEditView->GetSelection().GetEnd() ) ); + // Kann leer sein, wenn komplettes Word markiert, da Cursor dahinter. + if ( !aWord.Len() && pEditView->HasSelection() ) + aWord = pEditView->GetTextEngine()->GetWord( pEditView->GetSelection().GetStart() ); + return aWord ; +} + +void __EXPORT EditorWindow::RequestHelp( const HelpEvent& rHEvt ) +{ + // Sollte eigentlich mal aktiviert werden... + if ( pEditEngine ) + { + if ( rHEvt.GetMode() & HELPMODE_CONTEXT ) + { + String aKeyword = GetWordAtCursor(); + SfxHelp::ShowHelp( aKeyword, TRUE ); + } + else if ( rHEvt.GetMode() & HELPMODE_QUICK ) + { + String aHelpText; + Point aTopLeft; + if ( StarBASIC::IsRunning() ) + { + Point aWindowPos = rHEvt.GetMousePosPixel(); + aWindowPos = ScreenToOutputPixel( aWindowPos ); + Point aDocPos = GetEditView()->GetDocPos( aWindowPos ); + TextPaM aCursor = GetEditView()->GetTextEngine()->GetPaM( aDocPos, FALSE ); + TextPaM aStartOfWord; + String aWord = GetEditView()->GetTextEngine()->GetWord( aCursor, &aStartOfWord ); + if ( aWord.Len() && !ByteString( aWord, RTL_TEXTENCODING_UTF8 ).IsNumericAscii() ) + { + USHORT nLastChar =aWord.Len()-1; + if ( strchr( cSuffixes, aWord.GetChar( nLastChar ) ) ) + aWord.Erase( nLastChar, 1 ); + SbxBase* pSBX = StarBASIC::FindSBXInCurrentScope( aWord ); + if ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) ) + { + SbxVariable* pVar = (SbxVariable*)pSBX; + SbxDataType eType = pVar->GetType(); + if ( (BYTE)eType == (BYTE)SbxOBJECT ) + // Kann zu Absturz, z.B. bei Selections-Objekt fuehren + // Type == Object heisst nicht, dass pVar == Object! + ; // aHelpText = ((SbxObject*)pVar)->GetClassName(); + else if ( eType & SbxARRAY ) + ; // aHelpText = "{...}"; + else if ( (BYTE)eType != (BYTE)SbxEMPTY ) + { + aHelpText = pVar->GetName(); + if ( !aHelpText.Len() ) // Bei Uebergabeparametern wird der Name nicht kopiert + aHelpText = aWord; + aHelpText += '='; + aHelpText += pVar->GetString(); + } + } + if ( aHelpText.Len() ) + { + aTopLeft = GetEditView()->GetTextEngine()->PaMtoEditCursor( aStartOfWord ).BottomLeft(); + aTopLeft = GetEditView()->GetWindowPos( aTopLeft ); + aTopLeft.X() += 5; + aTopLeft.Y() += 5; + aTopLeft = OutputToScreenPixel( aTopLeft ); + } + } + } + Help::ShowQuickHelp( this, Rectangle( aTopLeft, Size( 1, 1 ) ), aHelpText, QUICKHELP_TOP|QUICKHELP_LEFT); + } + } + else + Window::RequestHelp( rHEvt ); +} + + +void __EXPORT EditorWindow::Resize() +{ + // ScrollBars, etc. passiert in Adjust... + if ( pEditView ) + { + long nVisY = pEditView->GetStartDocPos().Y(); +// pEditView->SetOutputArea( Rectangle( Point( 0, 0 ), GetOutputSize() ) ); + pEditView->ShowCursor(); + Size aOutSz( GetOutputSizePixel() ); + long nMaxVisAreaStart = pEditView->GetTextEngine()->GetTextHeight() - aOutSz.Height(); + if ( nMaxVisAreaStart < 0 ) + nMaxVisAreaStart = 0; + if ( pEditView->GetStartDocPos().Y() > nMaxVisAreaStart ) + { + Point aStartDocPos( pEditView->GetStartDocPos() ); + aStartDocPos.Y() = nMaxVisAreaStart; + pEditView->SetStartDocPos( aStartDocPos ); + pEditView->ShowCursor(); + pModulWindow->GetBreakPointWindow().GetCurYOffset() = aStartDocPos.Y(); + } + InitScrollBars(); + if ( nVisY != pEditView->GetStartDocPos().Y() ) + Invalidate(); + } +} + + + +void __EXPORT EditorWindow::MouseMove( const MouseEvent &rEvt ) +{ + if ( pEditView ) + pEditView->MouseMove( rEvt ); +} + + + +void __EXPORT EditorWindow::MouseButtonUp( const MouseEvent &rEvt ) +{ + if ( pEditView ) + { + pEditView->MouseButtonUp( rEvt ); + BasicIDE::GetBindings().Invalidate( SID_BASICIDE_STAT_POS ); + } +} + +void __EXPORT EditorWindow::MouseButtonDown( const MouseEvent &rEvt ) +{ + GrabFocus(); + if ( pEditView ) + { + pEditView->MouseButtonDown( rEvt ); + if ( SFX_APP()->GetHelpPI() ) + aHelpAgentTimer.Start(); + } +} + +void __EXPORT EditorWindow::Command( const CommandEvent& rCEvt ) +{ + if ( pEditView ) + { + pEditView->Command( rCEvt ); + if ( ( rCEvt.GetCommand() == COMMAND_WHEEL ) || + ( rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL ) || + ( rCEvt.GetCommand() == COMMAND_AUTOSCROLL ) ) + { + HandleScrollCommand( rCEvt, pModulWindow->GetHScrollBar(), &pModulWindow->GetEditVScrollBar() ); + } + } +} + +BOOL __EXPORT EditorWindow::Drop( const DropEvent& rEvt ) +{ + BOOL bDone = FALSE; + if ( pEditView && ImpCanModify() ) + { + bDone = pEditView->Drop( rEvt ); + if ( bDone ) + { + SfxBindings& rBindings = BasicIDE::GetBindings(); + rBindings.Invalidate( SID_BASICIDE_STAT_POS ); + rBindings.Invalidate( SID_SAVEDOC ); + rBindings.Invalidate( SID_DOC_MODIFIED ); + } + } + return bDone; +} + +BOOL __EXPORT EditorWindow::QueryDrop( DropEvent& rEvt ) +{ + if ( pEditView ) + return pEditView->QueryDrop( rEvt ); + return FALSE; +} + + +BOOL EditorWindow::ImpCanModify() +{ + BOOL bCanModify = TRUE; + if ( StarBASIC::IsRunning() ) + { + // Wenn im Trace-Mode, entweder Trace abbrechen oder + // Eingabe verweigern + // Im Notify bei Basic::Stoped die Markierungen in den Modulen + // entfernen! + if ( QueryBox( 0, WB_OK_CANCEL, String( IDEResId( RID_STR_WILLSTOPPRG ) ) ).Execute() == RET_OK ) + { + pModulWindow->GetBasicStatus().bIsRunning = FALSE; + BasicIDE::StopBasic(); + } + else + bCanModify = FALSE; + } + return bCanModify; +} + +void __EXPORT EditorWindow::KeyInput( const KeyEvent& rKEvt ) +{ + if ( !pEditView ) // Passiert unter W95 bei letzte Version, Ctrl-Tab + return; + +#ifdef DEBUG + Range aRange = pModulWindow->GetHScrollBar()->GetRange(); + long nVisSz = pModulWindow->GetHScrollBar()->GetVisibleSize(); + long nPapSz = pModulWindow->GetHScrollBar()->GetPageSize(); + long nLinSz = pModulWindow->GetHScrollBar()->GetLineSize(); + long nThumb = pModulWindow->GetHScrollBar()->GetThumbPos(); +#endif + BOOL bDone = FALSE; + BOOL bWasModified = pEditEngine->IsModified(); + if ( !TextEngine::DoesKeyChangeText( rKEvt ) || ImpCanModify() ) + { + if ( ( rKEvt.GetKeyCode().GetCode() == KEY_A) && rKEvt.GetKeyCode().IsMod1() ) + pEditView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) ); + else if ( ( rKEvt.GetKeyCode().GetCode() == KEY_Y ) && rKEvt.GetKeyCode().IsMod1() ) + bDone = TRUE; // CTRL-Y schlucken, damit kein Vorlagenkatalog + else + { + if ( ( rKEvt.GetKeyCode().GetCode() == KEY_TAB ) && !rKEvt.GetKeyCode().IsMod1() && !rKEvt.GetKeyCode().IsMod2() ) + { + TextSelection aSel( pEditView->GetSelection() ); + if ( aSel.GetStart().GetPara() != aSel.GetEnd().GetPara() ) + { + bDelayHighlight = FALSE; + if ( !rKEvt.GetKeyCode().IsShift() ) + pEditView->IndentBlock(); + else + pEditView->UnindentBlock(); + bDelayHighlight = TRUE; + bDone = TRUE; + } + } + if ( !bDone ) + bDone = pEditView->KeyInput( rKEvt ); + } + } +#ifndef PRODUCT + if( !bDone ) + { + if ( ( rKEvt.GetKeyCode().GetCode() == KEY_H ) && + rKEvt.GetKeyCode().IsMod1() && rKEvt.GetKeyCode().IsMod2() ) + { + ToggleHighlightMode(); + } + } +#endif + if ( !bDone ) + { + if ( !SfxViewShell::Current()->KeyInput( rKEvt ) ) + Window::KeyInput( rKEvt ); + } + else + { + SfxBindings& rBindings = BasicIDE::GetBindings(); + rBindings.Invalidate( SID_BASICIDE_STAT_POS ); + if ( rKEvt.GetKeyCode().GetGroup() == KEYGROUP_CURSOR ) + rBindings.Update( SID_BASICIDE_STAT_POS ); + if ( !bWasModified && pEditEngine->IsModified() ) + { + rBindings.Invalidate( SID_SAVEDOC ); + rBindings.Invalidate( SID_DOC_MODIFIED ); + } + if( rKEvt.GetKeyCode().GetCode() == KEY_INSERT ) + rBindings.Invalidate( SID_ATTR_INSERT ); + if ( SFX_APP()->GetHelpPI() ) + aHelpAgentTimer.Start(); + } +} + +void __EXPORT EditorWindow::Paint( const Rectangle& rRect ) +{ + if ( !pEditEngine ) // spaetestens jetzt brauche ich sie... + CreateEditEngine(); + + pEditView->Paint( rRect ); +} + +void __EXPORT EditorWindow::LoseFocus() +{ + SetSourceInBasic(); + Window::LoseFocus(); +} + +BOOL EditorWindow::SetSourceInBasic( BOOL bQuiet ) +{ + BOOL bChanged = FALSE; + if ( pEditEngine && pEditEngine->IsModified() ) + { + ULONG nLen = pEditEngine->GetTextLen(); + if ( nLen > 0xFFFb ) // Maximale String-Laenge + { + if ( !bQuiet ) + { + String aError( pModulWindow->CreateQualifiedName() ); + aError += String( RTL_CONSTASCII_USTRINGPARAM( ":\n" ) ); + aError += String( IDEResId( RID_STR_SOURCETOBIG ) ); + ErrorBox( this, WB_OK | WB_DEF_OK, aError ).Execute(); + } + } + else if ( !StarBASIC::IsRunning() ) // Nicht zur Laufzeit! + { + String aSource( pEditEngine->GetText() ); + DBG_ASSERT( pModulWindow->GetModule(), "Kein Modul?!" ); + pModulWindow->GetModule()->SetSource( aSource ); + pEditEngine->SetModified( FALSE ); + BasicIDE::MarkDocShellModified( pModulWindow->GetBasic() ); + bChanged = TRUE; + } + } + return bChanged; +} + + +void EditorWindow::CreateEditEngine() +{ + if ( pEditEngine ) + return; + +#ifdef DEBUG + BOOL bModified = pModulWindow->GetModule()->IsModified(); +#endif + + pEditEngine = new ExtTextEngine; + pEditView = new ExtTextView( pEditEngine, this ); + pEditView->SetAutoIndentMode( TRUE ); + pEditEngine->SetUpdateMode( FALSE ); + pEditEngine->InsertView( pEditView ); + + Font aFont( System::GetStandardFont( STDFONT_FIXED ) ); + aFont.SetTransparent( FALSE ); + Size aFontSize( 0, 10 ); // Points + + aFont.SetSize( aFontSize ); + SetPointFont( aFont ); + aFont = GetFont(); + + pModulWindow->GetBreakPointWindow().SetFont( aFont ); + pEditEngine->SetFont( aFont ); + + aSyntaxIdleTimer.SetTimeout( 200 ); + aSyntaxIdleTimer.SetTimeoutHdl( LINK( this, EditorWindow, SyntaxTimerHdl ) ); + + aHelpAgentTimer.SetTimeout( 2000 ); + aHelpAgentTimer.SetTimeoutHdl( LINK( this, EditorWindow, HelpAgentTimerHdl ) ); + + aHighlighter.initialize( HIGHLIGHT_BASIC ); + + bDoSyntaxHighlight = FALSE; // Bei grossen Texten zu langsam... + String aSource( pModulWindow->GetModule()->GetSource() ); + aSource.ConvertLineEnd( LINEEND_LF ); + USHORT nLines = aSource.GetTokenCount( LINE_SEP ); + + // nLines*4: SetText+Formatting+DoHighlight+Formatting + // 1 Formatting koennte eingespart werden, aber dann wartet man + // bei einem langen Sourcecode noch laenger auf den Text... + pProgress = new ProgressInfo( IDE_DLL()->GetShell()->GetViewFrame()->GetObjectShell(), String( IDEResId( RID_STR_GENERATESOURCE ) ), nLines*4 ); + pEditEngine->SetText( aSource ); + + pEditView->SetStartDocPos( Point( 0, 0 ) ); + pEditView->SetSelection( TextSelection() ); + pModulWindow->GetBreakPointWindow().GetCurYOffset() = 0; + pEditEngine->SetUpdateMode( TRUE ); + Update(); // Es wurde bei UpdateMode = TRUE nur Invalidiert + + // Die anderen Fenster auch, damit keine halben Sachen auf dem Bildschirm! + pModulWindow->GetLayout()->GetWatchWindow().Update(); + pModulWindow->GetLayout()->GetStackWindow().Update(); + pModulWindow->GetBreakPointWindow().Update(); + + pEditView->ShowCursor( TRUE, TRUE ); + + StartListening( *pEditEngine ); + + // Das Syntax-Highlightning legt ein rel. groesse VDev an. + aSyntaxIdleTimer.Stop(); + bDoSyntaxHighlight = TRUE; + + + for ( USHORT nLine = 0; nLine < nLines; nLine++ ) + aSyntaxLineTable.Insert( nLine, (void*)(USHORT)1 ); + ForceSyntaxTimeout(); + + DELETEZ( pProgress ); + + pEditView->EraseVirtualDevice(); + pEditEngine->SetModified( FALSE ); + pEditEngine->EnableUndo( TRUE ); + + InitScrollBars(); + + BasicIDE::GetBindings().Invalidate( SID_BASICIDE_STAT_POS ); + + DBG_ASSERT( pModulWindow->GetBreakPointWindow().GetCurYOffset() == 0, "CreateEditEngine: Brechpunkte verschoben?" ); + + BasicManager* pBasMgr = BasicIDE::FindBasicManager( pModulWindow->GetBasic() ); + SfxObjectShell* pShell = BasicIDE::FindDocShell( pBasMgr ); + if ( pShell && pShell->IsReadOnly() ) + pEditView->SetReadOnly( TRUE ); +} + +void EditorWindow::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) +{ + if ( rHint.ISA( TextHint ) ) + { + const TextHint& rTextHint = (const TextHint&)rHint; + if( rTextHint.GetId() == TEXT_HINT_VIEWSCROLLED ) + { + if ( pModulWindow->GetHScrollBar() ) + pModulWindow->GetHScrollBar()->SetThumbPos( pEditView->GetStartDocPos().X() ); + pModulWindow->GetEditVScrollBar().SetThumbPos( pEditView->GetStartDocPos().Y() ); + pModulWindow->GetBreakPointWindow().Scroll( 0, pModulWindow->GetBreakPointWindow().GetCurYOffset() - pEditView->GetStartDocPos().Y() ); + } + else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED ) + { + if ( pEditView->GetStartDocPos().Y() ) + { + long nOutHeight = GetOutputSizePixel().Height(); + long nTextHeight = pEditEngine->GetTextHeight(); + if ( nTextHeight < nOutHeight ) + pEditView->Scroll( 0, pEditView->GetStartDocPos().Y() ); + } + + SetScrollBarRanges(); + } + else if( rTextHint.GetId() == TEXT_HINT_TEXTFORMATTED ) + { + if ( pModulWindow->GetHScrollBar() ) + { + ULONG nWidth = pEditEngine->CalcTextWidth(); + if ( (long)nWidth != nCurTextWidth ) + { + nCurTextWidth = nWidth; + pModulWindow->GetHScrollBar()->SetRange( Range( 0, (long)nCurTextWidth) ); + pModulWindow->GetHScrollBar()->SetThumbPos( pEditView->GetStartDocPos().X() ); + } + } + } + else if( rTextHint.GetId() == TEXT_HINT_PARAINSERTED ) + { + ParagraphInsertedDeleted( rTextHint.GetValue(), TRUE ); + } + else if( rTextHint.GetId() == TEXT_HINT_PARAREMOVED ) + { + ParagraphInsertedDeleted( rTextHint.GetValue(), FALSE ); + } + else if( rTextHint.GetId() == TEXT_HINT_FORMATPARA ) + { + DoDelayedSyntaxHighlight( rTextHint.GetValue() ); + } + } +} + + +void EditorWindow::SetScrollBarRanges() +{ + // Extra-Methode, nicht InitScrollBars, da auch fuer EditEngine-Events. + if ( !pEditEngine ) + return; + + if ( pModulWindow->GetHScrollBar() ) + pModulWindow->GetHScrollBar()->SetRange( Range( 0, nCurTextWidth ) ); + + pModulWindow->GetEditVScrollBar().SetRange( Range( 0, pEditEngine->GetTextHeight() ) ); +} + +void EditorWindow::InitScrollBars() +{ + if ( !pEditEngine ) + return; + + SetScrollBarRanges(); + Size aOutSz( GetOutputSizePixel() ); + pModulWindow->GetEditVScrollBar().SetVisibleSize( aOutSz.Height() ); + pModulWindow->GetEditVScrollBar().SetPageSize( aOutSz.Height() * 8 / 10 ); + pModulWindow->GetEditVScrollBar().SetLineSize( GetTextHeight() ); + pModulWindow->GetEditVScrollBar().SetThumbPos( pEditView->GetStartDocPos().Y() ); + pModulWindow->GetEditVScrollBar().Show(); + + if ( pModulWindow->GetHScrollBar() ) + { + pModulWindow->GetHScrollBar()->SetVisibleSize( aOutSz.Width() ); + pModulWindow->GetHScrollBar()->SetPageSize( aOutSz.Width() * 8 / 10 ); + pModulWindow->GetHScrollBar()->SetLineSize( GetTextWidth( 'x' ) ); + pModulWindow->GetHScrollBar()->SetThumbPos( pEditView->GetStartDocPos().X() ); + pModulWindow->GetHScrollBar()->Show(); + } +} + +void EditorWindow::ImpDoHighlight( ULONG nLine ) +{ + String aLine( pEditEngine->GetText( nLine ) ); + Range aChanges = aHighlighter.notifyChange( nLine, 0, &aLine, 1 ); + if ( aChanges.Len() ) + { + for ( long n = aChanges.Min() + 1; n <= aChanges.Max(); n++ ) + aSyntaxLineTable.Insert( n, (void*)(ULONG)1 ); + aSyntaxIdleTimer.Start(); + } + + BOOL bWasModified = pEditEngine->IsModified(); + + HighlightPortions aPortions; + aHighlighter.getHighlightPortions( nLine, aLine, aPortions ); + USHORT nCount = aPortions.Count(); + for ( USHORT i = 0; i < nCount; i++ ) + { + HighlightPortion& r = aPortions[i]; + USHORT nCol = r.tokenType; + const Color& rColor = ((ModulWindowLayout*)pModulWindow->GetLayoutWindow())->GetSyntaxColors()[nCol]; + pEditEngine->SetAttrib( TextAttribFontColor( rColor ), nLine, r.nBegin, r.nEnd ); + } + + // Das Highlighten soll kein Modify setzen + pEditEngine->SetModified( bWasModified ); +} + +void EditorWindow::DoSyntaxHighlight( ULONG nPara ) +{ + // Durch das DelayedSyntaxHighlight kann es passieren, + // dass die Zeile nicht mehr existiert! + if ( nPara < pEditEngine->GetParagraphCount() ) + { + // leider weis ich nicht, ob genau diese Zeile Modified() ... + if ( pProgress ) + pProgress->StepProgress(); + pEditEngine->RemoveAttribs( nPara ); + ImpDoHighlight( nPara ); + } +} + +void EditorWindow::DoDelayedSyntaxHighlight( ULONG nPara ) +{ + // Zeile wird nur in 'Liste' aufgenommen, im TimerHdl abgearbeitet. + // => Nicht Absaetze manipulieren, waehrend EditEngine formatiert. + if ( pProgress ) + pProgress->StepProgress(); + + if ( !bHighlightning && bDoSyntaxHighlight ) + { + if ( bDelayHighlight ) + { + aSyntaxLineTable.Insert( nPara, (void*)(ULONG)1 ); + aSyntaxIdleTimer.Start(); + } + else + DoSyntaxHighlight( nPara ); + } +} + +IMPL_LINK( EditorWindow, HelpAgentTimerHdl, Timer *, EMPTYARG ) +{ + SfxHelpPI* pHelpAgent = SFX_APP()->GetHelpPI(); + if ( pHelpAgent) + { + pHelpAgent->LoadTopic( GetWordAtCursor() ); + } + return 0; +} + +IMPL_LINK( EditorWindow, SyntaxTimerHdl, Timer *, EMPTYARG ) +{ + DBG_ASSERT( pEditView, "Noch keine View, aber Syntax-Highlight ?!" ); + + BOOL bWasModified = pEditEngine->IsModified(); + pEditEngine->SetUpdateMode( FALSE ); + + bHighlightning = TRUE; + USHORT nLine; + void* p = aSyntaxLineTable.First(); + while ( p ) + { + nLine = (USHORT)aSyntaxLineTable.GetCurKey(); + DoSyntaxHighlight( nLine ); + p = aSyntaxLineTable.Next(); + } + if ( aSyntaxLineTable.Count() > 3 ) // Ohne VDev + { + pEditEngine->SetUpdateMode( TRUE ); + pEditView->ShowCursor( TRUE, TRUE ); + } + else + pEditEngine->SetUpdateMode( TRUE ); // ! Mit VDev +// pEditView->ForceUpdate(); + + pEditEngine->SetModified( bWasModified ); + + aSyntaxLineTable.Clear(); + // SyntaxTimerHdl wird gerufen, wenn Text-Aenderung + // => gute Gelegenheit, Textbreite zu ermitteln! + long nPrevTextWidth = nCurTextWidth; + nCurTextWidth = pEditEngine->CalcTextWidth(); + if ( nCurTextWidth != nPrevTextWidth ) + SetScrollBarRanges(); + bHighlightning = FALSE; + + + return 0; +} + +void EditorWindow::ParagraphInsertedDeleted( ULONG nPara, BOOL bInserted ) +{ + if ( pProgress ) + pProgress->StepProgress(); + + if ( !bInserted && ( nPara == TEXT_PARA_ALL ) ) + { + pModulWindow->GetBreakPoints().Reset(); + pModulWindow->GetBreakPointWindow().Invalidate(); + aHighlighter.initialize( HIGHLIGHT_BASIC ); + } + else + { + // Brechpunkte Aktualisieren... + // keine Sonderbehandlung fuer EditEngine-CTOR ( Erste-Zeile-Problem ), + // da in diesem Moment noch keine BreakPoints. + // +1: Basic-Zeilen beginnen bei 1! + pModulWindow->GetBreakPoints().AdjustBreakPoints( (USHORT)nPara+1, bInserted ); + + // Im BreakPointWindow invalidieren... + long nLineHeight = GetTextHeight(); + Size aSz = pModulWindow->GetBreakPointWindow().GetOutputSize(); + Rectangle aInvRec( Point( 0, 0 ), aSz ); + long nY = nPara*nLineHeight - pModulWindow->GetBreakPointWindow().GetCurYOffset(); + aInvRec.Top() = nY; + pModulWindow->GetBreakPointWindow().Invalidate( aInvRec ); + + String aDummy; + aHighlighter.notifyChange( nPara, bInserted ? 1 : (-1), &aDummy, 1 ); + } +} + +void EditorWindow::ToggleHighlightMode() +{ + bDoSyntaxHighlight = !bDoSyntaxHighlight; + if ( !pEditEngine ) + return; + + + if ( bDoSyntaxHighlight ) + { + for ( ULONG i = 0; i < pEditEngine->GetParagraphCount(); i++ ) + DoDelayedSyntaxHighlight( i ); + } + else + { + aSyntaxIdleTimer.Stop(); + pEditEngine->SetUpdateMode( FALSE ); + for ( ULONG i = 0; i < pEditEngine->GetParagraphCount(); i++ ) + pEditEngine->RemoveAttribs( i ); + +// pEditEngine->QuickFormatDoc(); + pEditEngine->SetUpdateMode( TRUE ); + pEditView->ShowCursor(TRUE, TRUE ); + } +} + + +void EditorWindow::CreateProgress( const String& rText, ULONG nRange ) +{ + DBG_ASSERT( !pProgress, "ProgressInfo existiert schon" ); + pProgress = new ProgressInfo( ProgressInfo( IDE_DLL()->GetShell()->GetViewFrame()->GetObjectShell(), rText, nRange ) ); +} + +void EditorWindow::DestroyProgress() +{ + DELETEZ( pProgress ); +} + +void EditorWindow::ForceSyntaxTimeout() +{ + aSyntaxIdleTimer.Stop(); + ((Link&)aSyntaxIdleTimer.GetTimeoutHdl()).Call( &aSyntaxIdleTimer ); +} + + + +BreakPointWindow::BreakPointWindow( Window* pParent ) : + Window( pParent, WB_BORDER ) +{ + pModulWindow = 0; + nCurYOffset = 0; + SetLineColor( Color( COL_BLACK ) ); + SetBackground( Wallpaper( COL_WHITE ) ); + nMarkerPos = MARKER_NOMARKER; + + // nCurYOffset merken und nicht von EditEngine holen. + // Falls in EditEngine autom. gescrollt wurde, wuesste ich sonst nicht, + // wo ich gerade stehe. +} + + + +__EXPORT BreakPointWindow::~BreakPointWindow() +{ + aBreakPointList.Reset(); +} + + + +void __EXPORT BreakPointWindow::Resize() +{ +/// Invalidate(); +} + + + +void __EXPORT BreakPointWindow::Paint( const Rectangle& ) +{ + if ( SyncYOffset() ) + return; + + Size aOutSz( GetOutputSize() ); + long nLineHeight = GetTextHeight(); + + Image aBrk1( ((ModulWindowLayout*)pModulWindow->GetLayoutWindow())->GetImage( IMGID_BRKENABLED ) ); + Image aBrk0( ((ModulWindowLayout*)pModulWindow->GetLayoutWindow())->GetImage( IMGID_BRKDISABLED ) ); + Size aBmpSz( aBrk1.GetSizePixel() ); + aBmpSz = PixelToLogic( aBmpSz ); + Point aBmpOff( 0, 0 ); + aBmpOff.X() = ( aOutSz.Width() - aBmpSz.Width() ) / 2; + aBmpOff.Y() = ( nLineHeight - aBmpSz.Height() ) / 2; + + BreakPoint* pBrk = GetBreakPoints().First(); + while ( pBrk ) + { + ULONG nLine = pBrk->nLine-1; + ULONG nY = nLine*nLineHeight - nCurYOffset; + DrawImage( Point( 0, nY ) + aBmpOff, pBrk->bEnabled ? aBrk1 : aBrk0 ); + pBrk = GetBreakPoints().Next(); + } + ShowMarker( TRUE ); +} + + + +void BreakPointWindow::Scroll( long nHorzScroll, long nVertScroll ) +{ + nCurYOffset -= nVertScroll; + Window::Scroll( nHorzScroll, nVertScroll ); +} + + + +void BreakPointWindow::SetMarkerPos( USHORT nLine, BOOL bError ) +{ + if ( SyncYOffset() ) + Update(); + + ShowMarker( FALSE ); // Alten wegzeichen... + nMarkerPos = nLine; + bErrorMarker = bError; + ShowMarker( TRUE ); // Neuen zeichnen... +} + +void BreakPointWindow::ShowMarker( BOOL bShow ) +{ + if ( nMarkerPos == MARKER_NOMARKER ) + return; + + Size aOutSz( GetOutputSize() ); + long nLineHeight = GetTextHeight(); + + Image aMarker; + if ( bErrorMarker ) + aMarker = ((ModulWindowLayout*)pModulWindow->GetLayoutWindow())->GetImage( IMGID_ERRORMARKER ); + else + aMarker = ((ModulWindowLayout*)pModulWindow->GetLayoutWindow())->GetImage( IMGID_STEPMARKER ); + + Size aMarkerSz( aMarker.GetSizePixel() ); + aMarkerSz = PixelToLogic( aMarkerSz ); + Point aMarkerOff( 0, 0 ); + aMarkerOff.X() = ( aOutSz.Width() - aMarkerSz.Width() ) / 2; + aMarkerOff.Y() = ( nLineHeight - aMarkerSz.Height() ) / 2; + + ULONG nY = nMarkerPos*nLineHeight - nCurYOffset; + Point aPos( 0, nY ); + aPos += aMarkerOff; + if ( bShow ) + DrawImage( aPos, aMarker ); + else + Invalidate( Rectangle( aPos, aMarkerSz ) ); +} + + + + +BreakPoint* BreakPointWindow::FindBreakPoint( const Point& rMousePos ) +{ + long nLineHeight = GetTextHeight(); + long nYPos = rMousePos.Y() + nCurYOffset; +// Image aBrk( ((ModulWindowLayout*)pModulWindow->GetLayoutWindow())->GetImage( IMGID_BRKENABLED ) ); +// Size aBmpSz( aBrk.GetSizePixel() ); +// aBmpSz = PixelToLogic( aBmpSz ); + + BreakPoint* pBrk = GetBreakPoints().First(); + while ( pBrk ) + { + ULONG nLine = pBrk->nLine-1; + long nY = nLine*nLineHeight; + if ( ( nYPos > nY ) && ( nYPos < ( nY + nLineHeight ) ) ) + return pBrk; + pBrk = GetBreakPoints().Next(); + } + return 0; +} + +void __EXPORT BreakPointWindow::MouseButtonDown( const MouseEvent& rMEvt ) +{ + if ( rMEvt.GetClicks() == 2 ) + { + Point aMousePos( PixelToLogic( rMEvt.GetPosPixel() ) ); + long nLineHeight = GetTextHeight(); + long nYPos = aMousePos.Y() + nCurYOffset; + long nLine = nYPos / nLineHeight + 1; + pModulWindow->ToggleBreakPoint( (ULONG)nLine ); + // vielleicht mal etwas genauer... + Invalidate(); + } +} + + + +void __EXPORT BreakPointWindow::Command( const CommandEvent& rCEvt ) +{ + if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) + { + Point aPos( rCEvt.IsMouseEvent() ? rCEvt.GetMousePosPixel() : Point(1,1) ); + Point aEventPos( PixelToLogic( aPos ) ); + BreakPoint* pBrk = rCEvt.IsMouseEvent() ? FindBreakPoint( aEventPos ) : 0; + if ( pBrk ) + { + // prueffen, ob Brechpunkt enabled.... + PopupMenu aBrkPropMenu( IDEResId( RID_POPUP_BRKPROPS ) ); + aBrkPropMenu.CheckItem( RID_ACTIV, pBrk->bEnabled ); + switch ( aBrkPropMenu.Execute( this, aPos ) ) + { + case RID_ACTIV: + { + pBrk->bEnabled = pBrk->bEnabled ? FALSE : TRUE; + pModulWindow->UpdateBreakPoint( *pBrk ); + Invalidate(); + } + break; + case RID_BRKPROPS: + { + BreakPointDialog aBrkDlg( this, GetBreakPoints() ); + aBrkDlg.SetCurrentBreakPoint( *pBrk ); + aBrkDlg.Execute(); + Invalidate(); + } + break; + } + } + else + { + PopupMenu aBrkListMenu( IDEResId( RID_POPUP_BRKDLG ) ); + switch ( aBrkListMenu.Execute( this, aPos ) ) + { + case RID_BRKDLG: + { + BreakPointDialog aBrkDlg( this, GetBreakPoints() ); + aBrkDlg.Execute(); + Invalidate(); + } + break; + } + } + } +} + +BOOL BreakPointWindow::SyncYOffset() +{ + TextView* pView = pModulWindow->GetEditView(); + if ( pView ) + { + long nViewYOffset = pView->GetStartDocPos().Y(); + if ( nCurYOffset != nViewYOffset ) + { + nCurYOffset = nViewYOffset; + Invalidate(); + return TRUE; + } + } + return FALSE; +} + + +/* + + +void __EXPORT BreakPointWindow::MouseMove( const MouseEvent &rEvt ) +{ +} + + + +void __EXPORT BreakPointWindow::MouseButtonUp( const MouseEvent &rEvt ) +{ +} + + + + +BOOL __EXPORT BreakPointWindow::Drop( const DropEvent& rEvt ) +{ +} + + + +BOOL __EXPORT BreakPointWindow::QueryDrop( const DropEvent& rEvt ) +{ +} +*/ + + + +WatchWindow::WatchWindow( Window* pParent ) : + BasicDockingWindow( pParent ), + aTreeListBox( this, WB_BORDER | WB_3DLOOK | WB_HASBUTTONS | WB_HASLINES | WB_HSCROLL ), + aXEdit( this, IDEResId( RID_EDT_WATCHEDIT ) ), + aWatchStr( IDEResId( RID_STR_REMOVEWATCH ) ), + aRemoveWatchButton( this, IDEResId( RID_IMGBTN_REMOVEWATCH ) ) +{ + nVirtToolBoxHeight = aXEdit.GetSizePixel().Height() + 7; + + aTreeListBox.EnableInplaceEditing( TRUE ); + aTreeListBox.SetSelectHdl( LINK( this, WatchWindow, TreeListHdl ) ); + aTreeListBox.SetPosPixel( Point( DWBORDER, nVirtToolBoxHeight ) ); + aTreeListBox.SetHighlightRange(); + + aRemoveWatchButton.Disable(); + + aTreeListBox.Show(); + + long nTextLen = GetTextWidth( aWatchStr ) + DWBORDER; + aXEdit.SetPosPixel( Point( nTextLen, 3 ) ); + aXEdit.SetAccHdl( LINK( this, WatchWindow, EditAccHdl ) ); + aXEdit.GetAccelerator().InsertItem( 1, KeyCode( KEY_RETURN ) ); + aXEdit.GetAccelerator().InsertItem( 2, KeyCode( KEY_ESCAPE ) ); + aXEdit.Show(); + + aRemoveWatchButton.SetClickHdl( LINK( this, WatchWindow, ButtonHdl ) ); + aRemoveWatchButton.SetPosPixel( Point( nTextLen + aXEdit.GetSizePixel().Width() + 4, 2 ) ); + Size aSz( aRemoveWatchButton.GetImage().GetSizePixel() ); + aSz.Width() += 6; + aSz.Height() += 6; + aRemoveWatchButton.SetSizePixel( aSz ); + aRemoveWatchButton.Show(); + + SetText( String( IDEResId( RID_STR_WATCHNAME ) ) ); +#ifndef VCL +#ifdef UNX + aFont=GetFont(); + aFont.SetTransparent(TRUE); + SetFont(aFont); +#endif +#endif +} + + + +__EXPORT WatchWindow::~WatchWindow() +{ +} + + + +void __EXPORT WatchWindow::Paint( const Rectangle& ) +{ + DrawText( Point( DWBORDER, 7 ), aWatchStr ); + lcl_DrawIDEWindowFrame( this ); +} + + + +void __EXPORT WatchWindow::Resize() +{ + Size aSz = GetOutputSizePixel(); + Size aBoxSz( aSz.Width() - 2*DWBORDER, aSz.Height() - nVirtToolBoxHeight - DWBORDER ); + + if ( aBoxSz.Width() < 4 ) // < 4, weil noch Border... + aBoxSz.Width() = 0; + if ( aBoxSz.Height() < 4 ) + aBoxSz.Height() = 0; + + aTreeListBox.SetSizePixel( aBoxSz ); + + Invalidate(); //Wegen DrawLine im Paint... +} + + + +void WatchWindow::AddWatch( const String& rVName ) +{ + // TRUE/FALSE: ChildsOnDemand => Fuer properties + SvLBoxEntry* pNewEntry = aTreeListBox.InsertEntry( rVName, 0, FALSE, LIST_APPEND ); + // Den Variablen-Namen ranhaengen, da der Text des Entries + // immer um den Wert der Wariablen ergaenzt wird. + pNewEntry->SetUserData( new String( rVName ) ); + aTreeListBox.Select( pNewEntry, TRUE ); + aTreeListBox.MakeVisible( pNewEntry ); + aRemoveWatchButton.Enable(); +} + + + +BOOL WatchWindow::RemoveSelectedWatch() +{ + SvLBoxEntry* pEntry = aTreeListBox.GetCurEntry(); + if ( pEntry ) + { + aTreeListBox.GetModel()->Remove( pEntry ); + pEntry = aTreeListBox.GetCurEntry(); + if ( pEntry ) + aXEdit.SetText( *((String*)pEntry->GetUserData()) ); + else + aXEdit.SetText( String() ); + if ( !aTreeListBox.GetEntryCount() ) + aRemoveWatchButton.Disable(); + return TRUE; + } + else + return FALSE; +} + + +IMPL_LINK_INLINE_START( WatchWindow, ButtonHdl, ImageButton *, pButton ) +{ + if ( pButton == &aRemoveWatchButton ) + { + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_REMOVEWATCH ); + } + } + return 0; +} +IMPL_LINK_INLINE_END( WatchWindow, ButtonHdl, ImageButton *, pButton ) + + + +IMPL_LINK_INLINE_START( WatchWindow, TreeListHdl, SvTreeListBox *, EMPTYARG ) +{ + SvLBoxEntry* pCurEntry = aTreeListBox.GetCurEntry(); + if ( pCurEntry && pCurEntry->GetUserData() ) + aXEdit.SetText( *((String*)pCurEntry->GetUserData()) ); + + return 0; +} +IMPL_LINK_INLINE_END( WatchWindow, TreeListHdl, SvTreeListBox *, EMPTYARG ) + + + +IMPL_LINK( WatchWindow, EditAccHdl, Accelerator *, pAcc ) +{ + switch ( pAcc->GetCurKeyCode().GetCode() ) + { + case KEY_RETURN: + { + String aCurText( aXEdit.GetText() ); + if ( aCurText.Len() ) + { + AddWatch( aCurText ); + aXEdit.SetSelection( Selection( 0, 0xFFFF ) ); + UpdateWatches(); + } + else + Sound::Beep(); + } + break; + case KEY_ESCAPE: + { + aXEdit.SetText( String() ); + } + break; + } + + return 0; +} + +void WatchWindow::UpdateWatches() +{ + aTreeListBox.UpdateWatches(); +} + + +StackWindow::StackWindow( Window* pParent ) : + BasicDockingWindow( pParent ), + aGotoCallButton( this, IDEResId( RID_IMGBTN_GOTOCALL ) ), + aTreeListBox( this, WB_BORDER | WB_3DLOOK | WB_HSCROLL ), + aStackStr( IDEResId( RID_STR_STACK ) ) +{ + + aTreeListBox.SetPosPixel( Point( DWBORDER, nVirtToolBoxHeight ) ); + aTreeListBox.SetHighlightRange(); + aTreeListBox.Show(); + + SetText( String( IDEResId( RID_STR_STACKNAME ) ) ); + + aGotoCallButton.SetClickHdl( LINK( this, StackWindow, ButtonHdl ) ); + aGotoCallButton.SetPosPixel( Point( DWBORDER, 2 ) ); + Size aSz( aGotoCallButton.GetImage().GetSizePixel() ); + aSz.Width() += 6; + aSz.Height() += 6; + aGotoCallButton.SetSizePixel( aSz ); +// aGotoCallButton.Show(); // wird vom Basic noch nicht unterstuetzt! + aGotoCallButton.Hide(); +#ifndef VCL +#ifdef UNX + aFont=GetFont(); + aFont.SetTransparent(TRUE); + SetFont(aFont); +#endif +#endif +} + + + +__EXPORT StackWindow::~StackWindow() +{ +} + + + +void __EXPORT StackWindow::Paint( const Rectangle& ) +{ + DrawText( Point( DWBORDER, 7 ), aStackStr ); + lcl_DrawIDEWindowFrame( this ); +} + + + +void __EXPORT StackWindow::Resize() +{ + Size aSz = GetOutputSizePixel(); + Size aBoxSz( aSz.Width() - 2*DWBORDER, aSz.Height() - nVirtToolBoxHeight - DWBORDER ); + + if ( aBoxSz.Width() < 4 ) // < 4, weil noch Border... + aBoxSz.Width() = 0; + if ( aBoxSz.Height() < 4 ) + aBoxSz.Height() = 0; + + aTreeListBox.SetSizePixel( aBoxSz ); + + Invalidate(); //Wegen DrawLine im Paint... +} + + + +IMPL_LINK_INLINE_START( StackWindow, ButtonHdl, ImageButton *, pButton ) +{ + if ( pButton == &aGotoCallButton ) + { + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_GOTOCALL ); + } + } + return 0; +} +IMPL_LINK_INLINE_END( StackWindow, ButtonHdl, ImageButton *, pButton ) + + + +void __EXPORT StackWindow::UpdateCalls() +{ + aTreeListBox.SetUpdateMode( FALSE ); + aTreeListBox.Clear(); + USHORT nScope = 0; + String aCaller; + + SbxError eOld = SbxBase::GetError(); + + SbMethod* pMethod = StarBASIC::GetActiveMethod( nScope ); + while ( pMethod ) + { + String aEntry( String::CreateFromInt32(nScope )); + if ( aEntry.Len() < 2 ) + aEntry.Insert( ' ', 0 ); + aEntry += String( RTL_CONSTASCII_USTRINGPARAM( ": " ) ); + aEntry += pMethod->GetName(); + SbxArray* pParams = pMethod->GetParameters(); + SbxInfo* pInfo = pMethod->GetInfo(); + if ( pParams ) + { + aEntry += '('; + // 0 ist der Name der Sub... + for ( USHORT nParam = 1; nParam < pParams->Count(); nParam++ ) + { + SbxVariable* pVar = pParams->Get( nParam ); + DBG_ASSERT( pVar, "Parameter?!" ); + if ( pVar->GetName().Len() ) + aEntry += pVar->GetName(); + else if ( pInfo ) + { + const SbxParamInfo* pParam = pInfo->GetParam( nParam ); + if ( pParam ) + aEntry += pParam->aName; + } + aEntry += '='; + if( pVar->GetType() & SbxARRAY ) + aEntry += String( RTL_CONSTASCII_USTRINGPARAM( "..." ) ); + else + aEntry += pVar->GetString(); + if ( nParam < ( pParams->Count() - 1 ) ) + aEntry += String( RTL_CONSTASCII_USTRINGPARAM( ", " ) ); + } + aEntry += ')'; + } + aTreeListBox.InsertEntry( aEntry, 0, FALSE, LIST_APPEND ); + nScope++; + pMethod = StarBASIC::GetActiveMethod( nScope ); + } + + SbxBase::ResetError(); + if( eOld != SbxERR_OK ) + SbxBase::SetError( eOld ); + + aTreeListBox.SetUpdateMode( TRUE ); +} + + + + +ComplexEditorWindow::ComplexEditorWindow( ModulWindow* pParent ) : + Window( pParent, WB_3DLOOK | WB_CLIPCHILDREN ), + aEWVScrollBar( this, WB_VSCROLL | WB_DRAG ), + aBrkWindow( this ), + aEdtWindow( this ) +{ + aEdtWindow.SetModulWindow( pParent ); + aBrkWindow.SetModulWindow( pParent ); + aEdtWindow.Show(); + aBrkWindow.Show(); + + aEWVScrollBar.SetLineSize( SCROLL_LINE ); + aEWVScrollBar.SetPageSize( SCROLL_PAGE ); + aEWVScrollBar.SetScrollHdl( LINK( this, ComplexEditorWindow, ScrollHdl ) ); + aEWVScrollBar.Show(); +} + + + +void __EXPORT ComplexEditorWindow::Resize() +{ + Size aOutSz = GetOutputSizePixel(); + Size aSz( aOutSz ); + aSz.Width() -= 2*DWBORDER; + aSz.Height() -= 2*DWBORDER; + long nBrkWidth = 20; + long nSBWidth = aEWVScrollBar.GetSizePixel().Width(); + + Size aBrkSz( Size( nBrkWidth, aSz.Height() ) ); + aBrkWindow.SetPosSizePixel( Point( DWBORDER, DWBORDER ), aBrkSz ); + +#ifndef VCL +#ifdef UNX + Size aEWSz( Size( aSz.Width() - nBrkWidth - nSBWidth, aSz.Height() ) ); + aEdtWindow.SetPosSizePixel( Point( DWBORDER+aBrkSz.Width(), DWBORDER ), aEWSz ); +#else + Size aEWSz( Size( aSz.Width() - nBrkWidth - nSBWidth + 2, aSz.Height() ) ); + aEdtWindow.SetPosSizePixel( Point( DWBORDER+aBrkSz.Width()-1, DWBORDER ), aEWSz ); +#endif +#else + Size aEWSz( Size( aSz.Width() - nBrkWidth - nSBWidth + 2, aSz.Height() ) ); + aEdtWindow.SetPosSizePixel( Point( DWBORDER+aBrkSz.Width()-1, DWBORDER ), aEWSz ); +#endif + + aEWVScrollBar.SetPosSizePixel( Point( aOutSz.Width()-DWBORDER-nSBWidth, DWBORDER ), Size( nSBWidth, aSz.Height() ) ); + + // Macht das EditorWindow, ausserdem hier falsch, da Pixel +// aEWVScrollBar.SetPageSize( aEWSz.Height() * 8 / 10 ); +// aEWVScrollBar.SetVisibleSize( aSz.Height() ); +// Invalidate(); +} + + + +void __EXPORT ComplexEditorWindow::Paint( const Rectangle& rRect ) +{ +#ifdef WIN + Point aPos( aEWVScrollBar.GetPosPixel() ); + Size aSz( aEWVScrollBar.GetSizePixel() ); + const Color aOldLineColor( GetLineColor() ); + SetLineColor( Color( COL_GRAY ) ); + DrawLine( Point( aPos.X(), aPos.Y() - 1 ), Point( aPos.X() + aSz.Width(), aPos.Y() - 1 ) ); + SetLineColor( Color( COL_WHITE ) ); + DrawLine( Point( aPos.X() + aSz.Width(), aPos.Y() - 1 ), Point( aPos.X() + aSz.Width(), aPos.Y() + aSz.Height() ) ); + DrawLine( Point( aPos.X(), aPos.Y() + aSz.Height() ), Point( aPos.X() + aSz.Width(), aPos.Y() + aSz.Height() ) ); + SetLineColor( aOldLineColor ); +#endif +} + + +IMPL_LINK( ComplexEditorWindow, ScrollHdl, ScrollBar *, pCurScrollBar ) +{ + if ( aEdtWindow.GetEditView() ) + { + DBG_ASSERT( pCurScrollBar == &aEWVScrollBar, "Wer scrollt hier ?" ); + long nDiff = aEdtWindow.GetEditView()->GetStartDocPos().Y() - pCurScrollBar->GetThumbPos(); + aEdtWindow.GetEditView()->Scroll( 0, nDiff ); + aBrkWindow.Scroll( 0, nDiff ); + aEdtWindow.GetEditView()->ShowCursor( FALSE, TRUE ); + pCurScrollBar->SetThumbPos( aEdtWindow.GetEditView()->GetStartDocPos().Y() ); + } + + return 0; +} + + + +WatchTreeListBox::WatchTreeListBox( Window* pParent, WinBits nWinBits ) + : SvTreeListBox( pParent, nWinBits ) +{ +} + +WatchTreeListBox::~WatchTreeListBox() +{ + // User-Daten zerstoeren... + SvLBoxEntry* pEntry = First(); + while ( pEntry ) + { + delete (String*)pEntry->GetUserData(); + pEntry = Next( pEntry ); + } +} + +BOOL __EXPORT WatchTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection& rSel ) +{ + BOOL bEdit = FALSE; + if ( StarBASIC::IsRunning() && StarBASIC::GetActiveMethod() && !SbxBase::IsError() ) + { + String aEntryText( GetEntryText( pEntry ) ); + USHORT nPos = aEntryText.Search( '=' ); + if ( nPos != STRING_NOTFOUND ) + aEditingRes = aEntryText.Copy( nPos+1); + else + aEditingRes.Erase(); + aEditingRes.EraseLeadingChars(); + aEditingRes.EraseTrailingChars(); + + bEdit = TRUE; + } + + if ( !bEdit ) + Sound::Beep(); + + return bEdit; +} + +BOOL __EXPORT WatchTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ) +{ + USHORT nPos = rNewText.Search( '=' ); + String aVName, aResult; + aVName = rNewText.Copy( 0, nPos ); + if ( nPos != STRING_NOTFOUND ) + aResult = rNewText.Copy( nPos+1); + aVName.EraseLeadingChars(); + aVName.EraseTrailingChars(); + aResult.EraseLeadingChars(); + aResult.EraseTrailingChars(); + + BOOL bVarModified = ( aVName != *((String*)pEntry->GetUserData()) ) ? TRUE : FALSE; + BOOL bResModified = ( aResult != aEditingRes ) ? TRUE : FALSE; + + BOOL bError = FALSE; + + if ( !aVName.Len() ) + bError = TRUE; + + if ( bVarModified && !bError ) + { + delete (String*)pEntry->GetUserData(); + pEntry->SetUserData( new String( aVName ) ); + } + + if ( aVName.Len() && strchr( cSuffixes, aVName.GetChar( aVName.Len() - 1 ) ) ) + { + aVName.Erase( aVName.Len()-1, 1 ); + if ( !aVName.Len() ) + bError = TRUE; + } + + BOOL bRet = FALSE; + + if ( bError ) + Sound::Beep(); + else if ( bResModified ) + { + bRet = ImplBasicEntryEdited( pEntry, aVName, aResult ); + } + + return bRet; +} + +BOOL WatchTreeListBox::ImplBasicEntryEdited( SvLBoxEntry* pEntry, const String& rVName, const String& rResult ) +{ + BOOL bError = FALSE; + String aResult( rResult ); + String aVar, aIndex; + lcl_SeparateNameAndIndex( rVName, aVar, aIndex ); + SbxBase* pToBeChanged = 0; + SbxBase* pSBX = StarBASIC::FindSBXInCurrentScope( aVar ); + if ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) ) + { + SbxVariable* pVar = (SbxVariable*)pSBX; + SbxDataType eType = pVar->GetType(); + if ( (BYTE)eType == (BYTE)SbxOBJECT ) + bError = TRUE; + else if ( eType & SbxARRAY ) + { + SbxBase* pBase = pVar->GetObject(); + if ( pBase && pBase->ISA( SbxDimArray ) ) + { + SbxDimArray* pArray = (SbxDimArray*)pBase; + if ( !aIndex.Len() ) + { + // Das Array auf das Format XX;XX;XX formatieren lassen, + // wenn TokenCount == Array-Groesse, Werte reinplaetten. + lcl_FormatArrayString( aResult ); + USHORT nVars = pArray->Count(); + if ( aResult.GetTokenCount() == (nVars+1) ) + { + for ( USHORT nVar = 0; nVar < nVars; nVar++,bError ) + { + SbxBase* pElem = pArray->SbxArray::Get( nVar ); + if ( pElem && pElem->ISA( SbxVariable ) ) + { + String aVar = aResult.GetToken( nVar, ';' ); + // Falls die Variablen als String geputtet werden + // addieren sich sonst die Zwischenraeume... + aVar.EraseLeadingChars(); + aVar.EraseTrailingChars(); + ((SbxVariable*)pElem)->PutStringExt( aVar ); + } + else + bError = TRUE; + } + } + else + bError = TRUE; + } + else + { + BOOL bValidIndex; + pToBeChanged = lcl_FindElement( pArray, aIndex, bValidIndex ); + if ( pToBeChanged ) + lcl_FormatArrayString( aResult ); + else + bError = TRUE; + } + } + else + bError = TRUE; + } + else + pToBeChanged = pSBX; + } + + if ( pToBeChanged ) + { + if ( pToBeChanged->ISA( SbxVariable ) ) + { + // Wenn der Typ variabel ist, macht die Konvertierung des SBX nichts, + // bei festem Typ wird der String konvertiert. + ((SbxVariable*)pToBeChanged)->PutStringExt( aResult ); + } + else + bError = TRUE; + } + + // Wenn jemand z.B. einen zu grossen Wert fuer ein Int eingegeben hat, + // folgt beim naechsten Step() ein Runtime-Error. + if ( SbxBase::IsError() ) + { + bError = TRUE; + SbxBase::ResetError(); + } + + if ( bError ) + Sound::Beep(); + + UpdateWatches(); + + // Der Text soll niemals 1-zu-1 uebernommen werden, weil dann das + // UpdateWatches verlorengeht. + return FALSE; +} + + +void WatchTreeListBox::UpdateWatches() +{ + SbMethod* pCurMethod = StarBASIC::GetActiveMethod(); + SbModule* pModule = pCurMethod ? pCurMethod->GetModule() : 0; + + SbxError eOld = SbxBase::GetError(); + + SvLBoxEntry* pEntry = First(); + while ( pEntry ) + { + String aVName( *( (String*)pEntry->GetUserData() ) ); + DBG_ASSERT( aVName.Len(), "Var? - Darf nicht leer sein!" ); + String aWatchStr( aVName ); + aWatchStr += String( RTL_CONSTASCII_USTRINGPARAM( " = " ) ); + if ( pCurMethod ) + { + String aVar, aIndex; + lcl_SeparateNameAndIndex( aVName, aVar, aIndex ); + SbxBase* pSBX = StarBASIC::FindSBXInCurrentScope( aVar ); + if ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) ) + { + SbxVariable* pVar = (SbxVariable*)pSBX; + // Sonderbehandlung fuer Arrays: + SbxDataType eType = pVar->GetType(); + if ( (BYTE)eType == (BYTE)SbxOBJECT ) + aWatchStr += String( RTL_CONSTASCII_USTRINGPARAM( "<?>" ) ); + else if ( eType & SbxARRAY ) + { + // Mehrdimensionale Arrays beruecksichtigen! + SbxBase* pBase = pVar->GetObject(); + if ( pBase && pBase->ISA( SbxDimArray ) ) + { + SbxDimArray* pArray = (SbxDimArray*)pBase; + aWatchStr += '{'; + USHORT nDims = pArray->GetDims(); + if ( !aIndex.Len() ) + { + short* pIdx = new short[ nDims ]; + for ( USHORT n = nDims; n; ) + pIdx[--n] = 0; + // hoechste Dimension festhalen. +// lcl_GetValues( aWatchStr, pArray, pIdx, nDims ); + lcl_GetValues( aWatchStr, pArray, pIdx, 1 ); + delete pIdx; + } + else + { + BOOL bValidIndex; + SbxBase* pElem = lcl_FindElement( pArray, aIndex, bValidIndex ); + if ( pElem ) + aWatchStr += ((SbxVariable*)pElem)->GetString(); + else if ( !bValidIndex ) + aWatchStr += String( RTL_CONSTASCII_USTRINGPARAM( "<Invalid index>" ) ); + } + aWatchStr += '}'; + } + else + aWatchStr += String( RTL_CONSTASCII_USTRINGPARAM( "<?>" ) ); + } + else + aWatchStr += pVar->GetString(); + } + else + aWatchStr += String( RTL_CONSTASCII_USTRINGPARAM( "<Out of Scope>" ) ); + } + SetEntryText( pEntry, aWatchStr ); + + pEntry = Next( pEntry ); + } + + SbxBase::ResetError(); + if( eOld != SbxERR_OK ) + SbxBase::SetError( eOld ); + +} + diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx new file mode 100644 index 000000000..66b187bb1 --- /dev/null +++ b/basctl/source/basicide/baside3.cxx @@ -0,0 +1,609 @@ +/************************************************************************* + * + * $RCSfile: baside3.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +//svdraw.hxx +//#define _SVDRAW_HXX *** +#define _SDR_NOITEMS +#define _SDR_NOTOUCH +#define _SDR_NOTRANSFORM +#define _SDR_NOOBJECTS +//#define _SDR_NOVIEWS *** +#define _SDR_NOVIEWMARKER +#define _SDR_NODRAGMETHODS +//#define _SDR_NOUNDO *** +#define _SDR_NOXOUTDEV + +#include <ide_pch.hxx> + +#pragma hdrstop + +#include <basidesh.hrc> +#include <baside3.hxx> +#include <vced.hxx> +#include <vcbrw.hxx> +#include <basobj.hxx> +#include <iderdll.hxx> +#include <basidesh.hxx> +#include <idetemp.hxx> +#include <helpid.hrc> + +TYPEINIT1( DialogWindow, IDEBaseWindow ); + +DialogWindow::DialogWindow( Window* pParent, VCSbxDialogRef aDialog, + StarBASIC* pBas ) : + IDEBaseWindow( pParent, pBas ), + pUndoMgr(NULL) +{ + // Bitte kein Show() ! + if( aDialog.Is() ) + pDialog = aDialog; + else + { + pDialog = new VCSbxDialog; + pDialog->SetName( String( RTL_CONSTASCII_USTRINGPARAM( "Dialog" ) ) ); + GetBasic()->Insert( pDialog ); + } + + InitSettings( TRUE, TRUE, TRUE ); + pEditor = new VCDlgEditor( GetBasic() ); + pEditor->SetWindow( this ); + pEditor->SetVCSbxForm( pDialog ); + + // Undo einrichten + pUndoMgr = new SfxUndoManager; + + Link aDummyLink; + aOldNotifyUndoActionHdl = pEditor->GetModel()->GetNotifyUndoActionHdl(); + pEditor->GetModel()->SetNotifyUndoActionHdl( + LINK(this, DialogWindow, NotifyUndoActionHdl)); + + SetHelpId( HID_BASICIDE_DIALOGWINDOW ); +} + +DialogWindow::DialogWindow( DialogWindow* pOrgWin ) : + IDEBaseWindow( pOrgWin->GetParent(), pOrgWin->GetBasic() ) +{ + DBG_ERROR( "Dieser CTOR ist nicht erlaubt!" ); +} + + + +DialogWindow::~DialogWindow() +{ + delete pEditor; + delete pUndoMgr; +} + +void DialogWindow::LoseFocus() +{ + if( pEditor->IsModified() ) + { + BasicIDE::MarkDocShellModified( pEditor->GetBasic() ); + pEditor->ClearModifyFlag(); + pDialog->SetModified( TRUE ); + } + Window::LoseFocus(); +} + + + +void DialogWindow::Paint( const Rectangle& rRect ) +{ + pEditor->Paint( rRect ); +} + + + +void DialogWindow::Resize() +{ + pEditor->SetScrollBars( GetHScrollBar(), GetVScrollBar() ); +} + + + +void DialogWindow::MouseButtonDown( const MouseEvent& rMEvt ) +{ + pEditor->MouseButtonDown( rMEvt ); +} + + + +void DialogWindow::MouseButtonUp( const MouseEvent& rMEvt ) +{ + pEditor->MouseButtonUp( rMEvt ); + SfxBindings& rBindings = BasicIDE::GetBindings(); + if( (pEditor->GetMode() == VCDLGED_INSERT) && !pEditor->IsCreateOK() ) + { + pEditor->SetMode( VCDLGED_SELECT ); + rBindings.Invalidate( SID_CHOOSE_CONTROLS ); + } + rBindings.Invalidate( SID_DOC_MODIFIED ); + rBindings.Invalidate( SID_SAVEDOC ); +} + + + +void DialogWindow::MouseMove( const MouseEvent& rMEvt ) +{ + pEditor->MouseMove( rMEvt ); +} + + + +void DialogWindow::KeyInput( const KeyEvent& rKEvt ) +{ + if( rKEvt.GetKeyCode() == KEY_BACKSPACE ) + { + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BACKSPACE ); + } + } + else + { + if( !pEditor->KeyInput( rKEvt ) ) + { + if( !SfxViewShell::Current()->KeyInput( rKEvt ) ) + Window::KeyInput( rKEvt ); + } + } +} + +void DialogWindow::Command( const CommandEvent& rCEvt ) +{ + if ( ( rCEvt.GetCommand() == COMMAND_WHEEL ) || + ( rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL ) || + ( rCEvt.GetCommand() == COMMAND_AUTOSCROLL ) ) + { + HandleScrollCommand( rCEvt, GetHScrollBar(), GetVScrollBar() ); + } + else + IDEBaseWindow::Command( rCEvt ); +} + + + + +IMPL_LINK( DialogWindow, NotifyUndoActionHdl, SfxUndoAction *, pUndoAction ) +{ + if (pUndoAction) + { + pUndoMgr->AddUndoAction( pUndoAction ); + BasicIDE::GetBindings().Invalidate( SID_UNDO ); + } + + return 0; +} + + + +void __EXPORT DialogWindow::DoInit() +{ + GetHScrollBar()->Show(); + GetVScrollBar()->Show(); + pEditor->SetScrollBars( GetHScrollBar(), GetVScrollBar() ); +} + + + +void __EXPORT DialogWindow::DoScroll( ScrollBar* pCurScrollBar ) +{ + pEditor->DoScroll( pCurScrollBar ); +} + + + + +void DialogWindow::SetDialogName( const String& rName ) +{ + pDialog->SetName( rName ); +} + + + +String DialogWindow::GetDialogName() +{ + return pDialog->GetName(); +} + + + +void __EXPORT DialogWindow::GetState( SfxItemSet& rSet ) +{ + SfxWhichIter aIter(rSet); + for ( USHORT nWh = aIter.FirstWhich(); 0 != nWh; nWh = aIter.NextWhich() ) + { + switch ( nWh ) + { + case SID_PASTE: + break; + case SID_CUT: + case SID_COPY: + case SID_DELETE: + case SID_BACKSPACE: + { + // Object selektiert? + } + break; + case SID_REDO: + { + if ( !pUndoMgr->GetUndoActionCount() ) + rSet.DisableItem( nWh ); + } + break; + + // Nur Dialogfenster: + case SID_DIALOG_TESTMODE: + { + // ist die IDE noch aktiv? + if( IDE_DLL()->GetShell()->GetFrame() ) + { + rSet.Put( SfxBoolItem( SID_DIALOG_TESTMODE, + (pEditor->GetMode() == VCDLGED_TEST) ? TRUE : FALSE) ); + } + else + rSet.Put( SfxBoolItem( SID_DIALOG_TESTMODE,FALSE )); + } + break; + + case SID_CHOOSE_CONTROLS: + { + SfxAllEnumItem aItem( SID_CHOOSE_CONTROLS ); + if( GetEditor()->GetMode() == VCDLGED_SELECT ) + aItem.SetValue( SVX_SNAP_SELECT ); + else + { + USHORT nObj; + switch( pEditor->GetInsertObj() ) + { + case OBJ_DLG_CHECKBOX: nObj = SVX_SNAP_CHECKBOX; break; + case OBJ_DLG_RADIOBUTTON: nObj = SVX_SNAP_RADIOBUTTON; break; + case OBJ_DLG_PUSHBUTTON: nObj = SVX_SNAP_PUSHBUTTON; break; + case OBJ_DLG_SPINBUTTON: nObj = SVX_SNAP_SPINBUTTON; break; + case OBJ_DLG_FIXEDTEXT: nObj = SVX_SNAP_FIXEDTEXT; break; + case OBJ_DLG_GROUPBOX: nObj = SVX_SNAP_GROUPBOX; break; + case OBJ_DLG_EDIT: nObj = SVX_SNAP_EDIT; break; + case OBJ_DLG_LISTBOX: nObj = SVX_SNAP_LISTBOX; break; + case OBJ_DLG_COMBOBOX: nObj = SVX_SNAP_COMBOBOX; break; + case OBJ_DLG_HSCROLLBAR: nObj = SVX_SNAP_HSCROLLBAR; break; + case OBJ_DLG_VSCROLLBAR: nObj = SVX_SNAP_VSCROLLBAR; break; + case OBJ_DLG_PREVIEW: nObj = SVX_SNAP_PREVIEW; break; + case OBJ_DLG_URLBUTTON: nObj = SVX_SNAP_URLBUTTON; break; + default: nObj = 0; + } +#ifdef DBG_UTIL + if( !nObj ) + { + DBG_WARNING( "SID_CHOOSE_CONTROLS: Unbekannt!" ); + } +#endif + aItem.SetValue( nObj ); + } + + rSet.Put( aItem ); + } + break; + } + } +} + + + +void __EXPORT DialogWindow::ExecuteCommand( SfxRequest& rReq ) +{ + switch ( rReq.GetSlot() ) + { + case SID_CUT: + GetEditor()->Cut(); + BasicIDE::GetBindings().Invalidate( SID_DOC_MODIFIED ); + break; + case SID_DELETE: +#ifdef MAC + case SID_BACKSPACE: +#endif + GetEditor()->Delete(); + BasicIDE::GetBindings().Invalidate( SID_DOC_MODIFIED ); + break; + case SID_COPY: + GetEditor()->Copy(); + break; + case SID_PASTE: + GetEditor()->Paste(); + BasicIDE::GetBindings().Invalidate( SID_DOC_MODIFIED ); + break; + case SID_CHOOSE_CONTROLS: + { + const SfxItemSet* pArgs = rReq.GetArgs(); + DBG_ASSERT( pArgs, "Nix Args" ); + + const SfxAllEnumItem& rItem = (SfxAllEnumItem&)pArgs->Get( SID_CHOOSE_CONTROLS ); + switch( rItem.GetValue() ) + { + case SVX_SNAP_PUSHBUTTON: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_PUSHBUTTON ); + } + break; + case SVX_SNAP_RADIOBUTTON: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_RADIOBUTTON ); + } + break; + case SVX_SNAP_CHECKBOX: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_CHECKBOX); + } + break; + case SVX_SNAP_SPINBUTTON: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_SPINBUTTON ); + } + break; + case SVX_SNAP_FIXEDTEXT: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_FIXEDTEXT ); + } + break; + case SVX_SNAP_GROUPBOX: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_GROUPBOX ); + } + break; + case SVX_SNAP_LISTBOX: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_LISTBOX ); + } + break; + case SVX_SNAP_COMBOBOX: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_COMBOBOX ); + } + break; + case SVX_SNAP_EDIT: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_EDIT ); + } + break; + case SVX_SNAP_HSCROLLBAR: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_HSCROLLBAR ); + } + break; + case SVX_SNAP_VSCROLLBAR: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_VSCROLLBAR ); + } + break; + case SVX_SNAP_PREVIEW: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_PREVIEW ); + } + break; + case SVX_SNAP_URLBUTTON: + { + GetEditor()->SetMode( VCDLGED_INSERT ); + GetEditor()->SetInsertObj( OBJ_DLG_URLBUTTON ); + } + break; + case SVX_SNAP_SELECT: + { + GetEditor()->SetMode( VCDLGED_SELECT ); + } + break; + } + BasicIDE::GetBindings().Invalidate( SID_DOC_MODIFIED ); + #ifdef DEBUG + BOOL bModified = IsModified(); + #endif + + } + break; + + case SID_DIALOG_TESTMODE: + { + VCDlgMode eOldMode = GetEditor()->GetMode(); + GetEditor()->SetMode( VCDLGED_TEST ); + GetEditor()->SetMode( eOldMode ); + rReq.Done(); + BasicIDE::GetBindings().Invalidate( SID_DIALOG_TESTMODE ); + return; + } + break; + } + + rReq.Done(); +} + + + +void DialogWindow::RenameDialog( const String& rNewName ) +{ + pDialog->SetName( rNewName ); + BasicIDE::GetBindings().Invalidate( SID_DOC_MODIFIED ); +} + + + + +void DialogWindow::DisableBrowser() +{ + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxChildWindow* pChildWin = pCurFrame ? pCurFrame->GetChildWindow(SID_SHOW_BROWSER) : NULL; + if( pChildWin ) + ((VCBrowser*)(pChildWin->GetWindow()))->Update( 0 ); +} + + + + +void DialogWindow::UpdateBrowser() +{ + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxChildWindow* pChildWin = pCurFrame ? pCurFrame->GetChildWindow(SID_SHOW_BROWSER) : NULL; + if( pChildWin ) + ((VCBrowser*)(pChildWin->GetWindow()))->Update(GetEditor()->GetView()); +} + + + + +SdrView* DialogWindow::GetView() const +{ + return GetEditor()->GetView(); +} + + + +BOOL __EXPORT DialogWindow::IsModified() +{ + // So auf jedenfall nicht verkehrt... + return pDialog->IsModified() || pEditor->IsModified(); +} + + + +SfxUndoManager* __EXPORT DialogWindow::GetUndoManager() +{ + return pUndoMgr; +} + +String DialogWindow::GetTitle() +{ + return GetDialogName(); +} + +void DialogWindow::StoreData() +{ + // Die Daten befinden sich schon im Basic... +// pDialog->SetModified( FALSE ); // dann wird das Modify vom Basic geloescht +#if 1 + if( pEditor->IsModified() ) + BasicIDE::MarkDocShellModified( pEditor->GetBasic() ); + pDialog->ResetFlag( SBX_MODIFIED ); + pEditor->ClearModifyFlag(); +#else + if( pEditor->IsModified() ) + pDialog->SetModified( TRUE ); + else + pDialog->ResetFlag( SBX_MODIFIED ); + pEditor->ClearModifyFlag(); +#endif + +} + +void DialogWindow::Deactivating() +{ + if( pEditor->IsModified() ) + BasicIDE::MarkDocShellModified( pEditor->GetBasic() ); +} + +void DialogWindow::PrintData( Printer* pPrinter ) +{ + pEditor->PrintData( pPrinter, CreateQualifiedName() ); +} + +void DialogWindow::DataChanged( const DataChangedEvent& rDCEvt ) +{ + if( (rDCEvt.GetType()==DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) + { + InitSettings( TRUE, TRUE, TRUE ); + Invalidate(); + } + else + IDEBaseWindow::DataChanged( rDCEvt ); +} + +void DialogWindow::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground) +{ + const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); + if( bFont ) + { + Font aFont; + aFont = rStyleSettings.GetFieldFont(); + SetPointFont( aFont ); + } + + if( bForeground || bFont ) + { + SetTextColor( rStyleSettings.GetFieldTextColor() ); + SetTextFillColor(); + } + + if( bBackground ) + SetBackground( rStyleSettings.GetFieldColor() ); +} diff --git a/basctl/source/basicide/baside4.cxx b/basctl/source/basicide/baside4.cxx new file mode 100644 index 000000000..8ad446e08 --- /dev/null +++ b/basctl/source/basicide/baside4.cxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * $RCSfile: baside4.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx new file mode 100644 index 000000000..9ed7266fd --- /dev/null +++ b/basctl/source/basicide/basides1.cxx @@ -0,0 +1,1179 @@ +/************************************************************************* + * + * $RCSfile: basides1.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#define GLOBALOVERFLOW2 + +#pragma hdrstop + + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#define _SVSTDARR_STRINGS +#include <svtools/svstdarr.hxx> +#include <ide_pch.hxx> +#pragma hdrstop + +#define __PRIVATE 1 + +// #define _SVX_NOIDERESIDS + +#define SI_NOCONTROL +#define SI_NOSBXCONTROLS +#define SI_NOITEMS +#define SI_NODRW +#define _VCTRLS_HXX + +#include <basidesh.hrc> +#include <basidesh.hxx> +#include <baside2.hxx> +#include <baside3.hxx> +#include <basobj.hxx> +#include <iderdll.hxx> +#include <iderdll2.hxx> +#include <vcsbx.hxx> +#include <sbxitem.hxx> +#include <vcl/rcid.h> +#include <helpid.hrc> + +#ifndef _SFX_MINFITEM_HXX //autogen +#include <sfx2/minfitem.hxx> +#endif + + +class SvxSearchItem; + +// Egal was, einfach ans aktuelle Fenster: +void __EXPORT BasicIDEShell::ExecuteCurrent( SfxRequest& rReq ) +{ + if ( !pCurWin ) + return; + + switch ( rReq.GetSlot() ) + { + case SID_BASICIDE_HIDECURPAGE: + { + pCurWin->StoreData(); + RemoveWindow( pCurWin, FALSE ); + } + break; + case SID_BASICIDE_DELETECURRENT: + { + StarBASIC* pBasic = pCurWin->GetBasic(); + DBG_ASSERT( pBasic, "Aktuellen Fenster ohne Basic ?!" ); + if ( pCurWin->ISA( ModulWindow ) ) + { + SbModule* pModule = ((ModulWindow*)pCurWin)->GetModule(); + DBG_ASSERT( pModule, "DELETECURRENT: Modul nicht gefunden!" ); + if ( QueryDelModule( pModule->GetName(), pCurWin ) ) + { + pBasic->GetModules()->Remove( pModule ); + RemoveWindow( pCurWin, TRUE ); + BasicIDE::MarkDocShellModified( pBasic ); + + } + } + else + { + SbxObject* pDlg = ((DialogWindow*)pCurWin)->GetDialog(); + DBG_ASSERT( pDlg, "DELETECURRENT: Dialog nicht gefunden!" ); + if ( QueryDelDialog( pDlg->GetName(), pCurWin ) ) + { + pBasic->GetObjects()->Remove( pDlg ); + RemoveWindow( pCurWin, TRUE ); + BasicIDE::MarkDocShellModified( pBasic ); + } + } + } + break; + case SID_BASICIDE_RENAMECURRENT: + { + pTabBar->StartEditMode( pTabBar->GetCurPageId() ); + } + break; + case FID_SEARCH_NOW: + { + if ( pCurWin->ISA( ModulWindow ) ) + { + DBG_ASSERT( rReq.GetArgs(), "arguments expected" ); + const SfxItemSet* pArgs = rReq.GetArgs(); + // Leider kenne ich die ID nicht: + USHORT nWhich = pArgs->GetWhichByPos( 0 ); + DBG_ASSERT( nWhich, "Wich fuer SearchItem ?" ); + const SfxPoolItem& rItem = pArgs->Get( nWhich ); + DBG_ASSERT( rItem.ISA( SvxSearchItem ), "Kein Searchitem!" ); + if ( rItem.ISA( SvxSearchItem ) ) + { + // Item wegen der Einstellungen merken... + IDE_DLL()->GetExtraData()->SetSearchItem( (const SvxSearchItem&)rItem ); + USHORT nFound = 0; + BOOL bCanceled = FALSE; + if ( ((const SvxSearchItem&)rItem).GetCommand() == SVX_SEARCHCMD_REPLACE_ALL ) + { + USHORT nActModWindows = 0; + IDEBaseWindow* pWin = aIDEWindowTable.First(); + while ( pWin ) + { + if ( !pWin->IsSuspended() && pWin->IsA( TYPE( ModulWindow ) ) ) + nActModWindows++; + pWin = aIDEWindowTable.Next(); + } + + if ( ( nActModWindows <= 1 ) || ( !((const SvxSearchItem&)rItem).GetSelection() && QueryBox( pCurWin, WB_YES_NO|WB_DEF_YES, String( IDEResId( RID_STR_SEARCHALLMODULES ) ) ).Execute() == RET_YES ) ) + { + pWin = aIDEWindowTable.First(); + while ( pWin ) + { + if ( !pWin->IsSuspended() && pWin->IsA( TYPE( ModulWindow ) ) ) + nFound += ((ModulWindow*)pWin)->StartSearchAndReplace( (const SvxSearchItem&)rItem ); + pWin = aIDEWindowTable.Next(); + } + } + else + nFound = ((ModulWindow*)pCurWin)->StartSearchAndReplace( (const SvxSearchItem&)rItem ); + + IDEResId nId( RID_STR_SEARCHREPLACES ); + String aReplStr( nId ); + aReplStr.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "XX" ) ), nFound ); + InfoBox( pCurWin, aReplStr ).Execute(); + } + else + { + nFound = ((ModulWindow*)pCurWin)->StartSearchAndReplace( (const SvxSearchItem&)rItem ); + if ( !nFound && !((const SvxSearchItem&)rItem).GetSelection() ) + { + // Andere Module durchsuchen... + BOOL bChangeCurWindow = FALSE; + aIDEWindowTable.Seek( pCurWin ); + // Erstmal beim naechsten Anfangen, ggf. spaeter von vorne + IDEBaseWindow* pWin = aIDEWindowTable.Next(); + BOOL bSearchedFromStart = FALSE; + while ( !nFound && !bCanceled && ( pWin || !bSearchedFromStart ) ) + { + if ( !pWin ) + { + QueryBox aQuery( pCurWin, WB_YES_NO|WB_DEF_YES, String( IDEResId( RID_STR_SEARCHFROMSTART ) ) ); + if ( aQuery.Execute() == RET_YES ) + { + pWin = aIDEWindowTable.First(); + bSearchedFromStart = TRUE; + } + else + bCanceled = TRUE; + } + + if ( pWin && !pWin->IsSuspended() && pWin->IsA( TYPE( ModulWindow ) ) ) + { + if ( pWin != pCurWin ) + { + // Groesse einstellen, damit die View + // gleich richtig justiert werden kann. + if ( pCurWin ) + pWin->SetSizePixel( pCurWin->GetSizePixel() ); + nFound = ((ModulWindow*)pWin)->StartSearchAndReplace( (const SvxSearchItem&)rItem, TRUE ); + } + if ( nFound ) + { + bChangeCurWindow = TRUE; + break; + } + } + if ( pWin && ( pWin != pCurWin ) ) + pWin = aIDEWindowTable.Next(); + else + pWin = 0; // Dann sind wir durch... + } + if ( !nFound && bSearchedFromStart ) // Aktuelles von vorne... + nFound = ((ModulWindow*)pCurWin)->StartSearchAndReplace( (const SvxSearchItem&)rItem, TRUE ); + if ( bChangeCurWindow ) + SetCurWindow( pWin, TRUE ); + } + if ( !nFound && !bCanceled ) + InfoBox( pCurWin, String( IDEResId( RID_STR_SEARCHNOTFOUND ) ) ).Execute(); + } + + rReq.Done(); + } + } + } + break; + case SID_UNDO: + case SID_REDO: + { + if ( GetUndoManager() && pCurWin->AllowUndo() ) + { + GetViewFrame()->ExecuteSlot( rReq ); + } + } + break; + default: + { + pCurWin->ExecuteCommand( rReq ); + } + } +} + +// Egal, wer oben, Einfluss auf die Shell: +void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq ) +{ + USHORT nSlot = rReq.GetSlot(); + switch ( nSlot ) + { + case SID_BASICSTOP: + { + // Evtl. nicht einfach anhalten, falls auf Brechpunkt! + if ( pCurWin && pCurWin->IsA( TYPE( ModulWindow ) ) ) + ((ModulWindow*)pCurWin)->BasicStop(); + BasicIDE::StopBasic(); + } + break; + + case SID_SAVEDOC: + { + if ( pCurWin ) + { + // Daten ins BASIC zurueckschreiben + StoreAllWindowData(); + + // Doc-Basic? + SfxApplication* pSfxApp = SFX_APP(); + BasicManager* pAppBasMgr = pSfxApp->GetBasicManager(); + BasicManager *pBasMgr = BasicIDE::FindBasicManager( pCurWin->GetBasic() ); + if ( pBasMgr != pAppBasMgr ) + { + // Doc-Basic suchen + BOOL bFound = FALSE; + for ( SfxObjectShell *pDocSh = SfxObjectShell::GetFirst(); + !bFound && pDocSh; + pDocSh = SfxObjectShell::GetNext(*pDocSh) ) + { + if ( pDocSh->GetBasicManager() == pBasMgr ) + { + // auch das Doc speichern + pDocSh->ExecuteSlot( rReq ); + bFound = TRUE; + } + } + DBG_ASSERT( bFound, "unknown basic" ); + } + + SfxBindings &rBindings = BasicIDE::GetBindings(); + rBindings.Invalidate( SID_DOC_MODIFIED ); + rBindings.Invalidate( SID_SAVEDOC ); + } + } + break; + case SID_BASICIDE_MODULEDLG: + { + BasicIDE::Organize(); + } + break; + case SID_BASICIDE_CHOOSEMACRO: + { + BasicIDE::ChooseMacro(); + } + break; + case SID_BASICIDE_CREATEMACRO: + case SID_BASICIDE_EDITMACRO: + { + DBG_ASSERT( rReq.GetArgs(), "arguments expected" ); + const SfxMacroInfoItem& rInfo = (const SfxMacroInfoItem&)rReq.GetArgs()->Get(SID_BASICIDE_ARG_MACROINFO ); + BasicManager* pBasMgr = (BasicManager*)rInfo.GetBasicManager(); + DBG_ASSERT( pBasMgr, "Nichts selektiert im Basic-Baum ?" ); + StartListening( *pBasMgr, TRUE /* Nur einmal anmelden */ ); + StarBASIC* pBasic = pBasMgr->GetLib( rInfo.GetLib() ); + if ( !pBasic ) + { + // LoadOnDemand + USHORT nLib = pBasMgr->GetLibId( rInfo.GetLib() ); + pBasMgr->LoadLib( nLib ); + pBasic = pBasMgr->GetLib( nLib ); + } + if ( !pBasic ) + pBasic = pBasMgr->GetLib( 0 ); + DBG_ASSERT( pBasic, "Kein Basic!" ); + // Evtl pCurBasic umschalten: + if ( pCurBasic && ( pBasic != pCurBasic ) ) + SetCurBasic( pBasic ); + if ( rReq.GetSlot() == SID_BASICIDE_CREATEMACRO ) + { + SbModule* pModule = pBasic->FindModule( rInfo.GetModule() ); + if ( !pModule ) + { + if ( rInfo.GetModule().Len() || !pBasic->GetModules()->Count() ) + pModule = BasicIDE::CreateModule( pBasic, rInfo.GetModule() ); + else + pModule = (SbModule*) pBasic->GetModules()->Get(0); + } + DBG_ASSERT( pModule, "Kein Modul!" ); + if ( !pModule->GetMethods()->Find( rInfo.GetMethod(), SbxCLASS_METHOD ) ) + BasicIDE::CreateMacro( pModule, rInfo.GetMethod() ); + } + BasicIDE::Appear(); + ModulWindow* pWin = FindBasWin( pBasic, rInfo.GetModule(), TRUE ); + DBG_ASSERT( pWin, "Edit/Create Macro: Fenster wurde nicht erzeugt/gefunden!" ); + SetCurWindow( pWin, TRUE ); + pWin->EditMacro( rInfo.GetMethod() ); + } + break; + case SID_BASICIDE_OBJCAT: + { + ShowObjectDialog( TRUE, TRUE ); + } + break; + case SID_BASICIDE_LIBSELECTOR: + { + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // ! Pruefen, ob diese Routine ueberhaupt gebraucht wird ! + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + // String fuer aktuelle einstellung: + String aQName; + if ( pCurBasic ) + { + BasicManager* pBasMgr = BasicIDE::FindBasicManager( pCurBasic ); + if ( pBasMgr ) + aQName = CreateMgrAndLibStr( BasicIDE::FindTitle( pBasMgr ), pCurBasic->GetName() ); + } + + PopupMenu aPopup; + SvStrings* pStrings = BasicIDE::CreateBasicLibBoxEntries(); + for ( USHORT n = 0; n < pStrings->Count(); n++ ) + { + String* pStr = pStrings->GetObject( n ); + aPopup.InsertItem( n+1, *pStr ); // +1, damit keine 0 + if ( *pStr == aQName ) + aPopup.CheckItem( n+1, TRUE ); + } + if ( !pCurBasic ) + aPopup.CheckItem( 1, TRUE ); + + // (pb -> mt) we need a window here + Window& rWin = GetViewFrame()->GetWindow(); + USHORT nId = aPopup.Execute( &rWin, rWin.GetPointerPosPixel() ); + if ( nId ) + { + USHORT i = nId-1; + String aLib; + if ( i ) // sonst 'Alle', also leer + aLib = *pStrings->GetObject( i ); + SfxStringItem aLibName( SID_BASICIDE_ARG_LIBNAME, aLib ); + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_LIBSELECTED, + SFX_CALLMODE_SYNCHRON, &aLibName, 0L ); + } + } + pStrings->DeleteAndDestroy( 0, pStrings->Count() ); + delete pStrings; + } + break; + case SID_BASICIDE_NAMECHANGEDONTAB: + { + DBG_ASSERT( rReq.GetArgs(), "arguments expected" ); + const SfxUInt16Item &rTabId = (const SfxUInt16Item&)rReq.GetArgs()->Get(SID_BASICIDE_ARG_TABID ); + const SfxStringItem &rModName = (const SfxStringItem&)rReq.GetArgs()->Get(SID_BASICIDE_ARG_MODULENAME ); + IDEBaseWindow* pWin = aIDEWindowTable.Get( rTabId.GetValue() ); + DBG_ASSERT( pWin, "Window nicht im Liste, aber in TabBar ?" ); + + // Focus wieder auf "Arbeitsflaeche" + pWin->GrabFocus(); + + if ( pWin->IsA( TYPE( ModulWindow ) ) ) + { + ModulWindow* pEditWin = (ModulWindow*)pWin; + pEditWin->RenameModule( rModName.GetValue() ); + } + else + { + DialogWindow* pViewWin = (DialogWindow*)pWin; + pViewWin->RenameDialog( rModName.GetValue() ); + } + BasicIDE::MarkDocShellModified( pWin->GetBasic() ); + } + break; + case SID_BASICIDE_STOREMODULESOURCE: + case SID_BASICIDE_UPDATEMODULESOURCE: + { + DBG_ASSERT( rReq.GetArgs(), "arguments expected" ); + const SfxMacroInfoItem& rInfo = (const SfxMacroInfoItem&)rReq.GetArgs()->Get(SID_BASICIDE_ARG_MACROINFO ); + BasicManager* pBasMgr = (BasicManager*)rInfo.GetBasicManager(); + DBG_ASSERT( pBasMgr, "Store source: Kein BasMgr?" ); + StarBASIC* pBasic = pBasMgr->GetLib( rInfo.GetLib() ); + DBG_ASSERT( pBasic, "Lib im BasicManager nicht gefunden!" ); + ModulWindow* pWin = FindBasWin( pBasic, rInfo.GetModule(), FALSE, TRUE ); + if ( pWin ) + { + if ( rReq.GetSlot() == SID_BASICIDE_STOREMODULESOURCE ) + pWin->StoreData(); + else + pWin->UpdateData(); + } + } + break; + case SID_BASICIDE_STOREALLMODULESOURCES: + case SID_BASICIDE_UPDATEALLMODULESOURCES: + { + IDEBaseWindow* pWin = aIDEWindowTable.First(); + while ( pWin ) + { + if ( !pWin->IsSuspended() && pWin->IsA( TYPE( ModulWindow ) ) ) + { + if ( rReq.GetSlot() == SID_BASICIDE_STOREALLMODULESOURCES ) + pWin->StoreData(); + else + pWin->UpdateData(); + } + pWin = aIDEWindowTable.Next(); + } + } + break; + case SID_BASICIDE_LIBSELECTED: + case SID_BASICIDE_LIBREMOVED: + case SID_BASICIDE_LIBLOADED: + { + DBG_ASSERT( rReq.GetArgs(), "arguments expected" ); + const SfxStringItem &rLibName = (const SfxStringItem&)rReq.GetArgs()->Get(SID_BASICIDE_ARG_LIBNAME ); + String aBasMgrAndLib( rLibName.GetValue() ); + + StarBASIC* pLib = 0; + BasicManager* pMgr = 0; + if ( aBasMgrAndLib.Len() ) + { + String aBasMgr( GetMgrFromMgrAndLib( aBasMgrAndLib ) ); + String aLib( GetLibFromMgrAndLib( aBasMgrAndLib ) ); + + pMgr = BasicIDE::FindBasicManager( aBasMgr ); + if ( !pMgr ) // Doc schon weg... + return; + pLib = pMgr->GetLib( aLib ); + if ( !pLib && ( nSlot == SID_BASICIDE_LIBSELECTED ) ) + { + // LoadOnDemand + USHORT nLib = pMgr->GetLibId( aLib ); + pMgr->LoadLib( nLib ); + pLib = pMgr->GetLib( nLib ); + if ( !pLib ) + { + ErrorBox( pCurWin, WB_OK|WB_DEF_OK, String( IDEResId( RID_STR_ERROROPENLIB ) ) ).Execute(); + // Hat leider keine Auswirkung, weil alter Wert => Kein StateChanged... + BasicIDE::GetBindings().Invalidate( SID_BASICIDE_LIBSELECTOR ); + return; + } + } + } + if ( nSlot == SID_BASICIDE_LIBSELECTED ) + { + // Keine Abfrage, ob pCurBasic == pLib, + // falls welche ausgeblendet waren. + BOOL bSet = TRUE; + if ( pLib ) + { + USHORT nLib = pMgr->GetLibId( pLib ); + if ( pMgr->HasPassword( nLib ) && + !pMgr->IsPasswordVerified( nLib ) ) + { + bSet = QueryPassword( pMgr, nLib ); + } + } + if ( bSet ) + SetCurBasic( pLib ); + else // alten Wert einstellen... + BasicIDE::GetBindings().Invalidate( SID_BASICIDE_LIBSELECTOR, TRUE, FALSE ); + } + else if ( nSlot == SID_BASICIDE_LIBREMOVED ) + { + if ( !pCurBasic || ( pLib == pCurBasic ) ) + { + RemoveWindows( pLib, TRUE ); + if ( pCurBasic == pLib ) + { + pCurBasic = 0; + // Kein UpdateWindows! + BasicIDE::GetBindings().Invalidate( SID_BASICIDE_LIBSELECTOR ); + } + } + } + else // Loaded... + UpdateWindows(); + } + break; + case SID_BASICIDE_NEWMODULE: + { + StarBASIC* pBasic = pCurBasic; + if ( !pBasic ) + pBasic = SFX_APP()->GetBasicManager()->GetLib( 0 ); + ModulWindow* pWin = CreateBasWin( pBasic, String() ); + DBG_ASSERT( pWin, "New Module: Konnte Fenster nicht erzeugen!" ); + SetCurWindow( pWin, TRUE ); + } + break; + case SID_BASICIDE_NEWDIALOG: + { + StarBASIC* pBasic = pCurBasic; + if ( !pBasic ) + pBasic = SFX_APP()->GetBasicManager()->GetLib( 0 ); + DialogWindow* pWin = CreateDlgWin( pBasic, String() ); + DBG_ASSERT( pWin, "New Module: Konnte Fenster nicht erzeugen!" ); + SetCurWindow( pWin, TRUE ); + } + break; + case SID_BASICIDE_SBXRENAMED: + { + DBG_ASSERT( rReq.GetArgs(), "arguments expected" ); + const SbxItem& rSbxItem = (const SbxItem&)rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX ); + SbxObject* pSbxObject = (SbxObject*)rSbxItem.GetSbx(); + IDEBaseWindow* pWin = FindWindow( pSbxObject, FALSE ); + if ( pWin ) + { + // TabWriter updaten + USHORT nId = (USHORT)aIDEWindowTable.GetKey( pWin ); + DBG_ASSERT( nId, "Kein Eintrag in der Tabbar!" ); + if ( nId ) + pTabBar->SetPageText( nId, pSbxObject->GetName() ); + if( pWin->IsA( TYPE( DialogWindow ) ) ) + ((DialogWindow*)pWin)->UpdateBrowser(); + } + } + break; + case SID_BASICIDE_SBXINSERTED: + { + DBG_ASSERT( rReq.GetArgs(), "arguments expected" ); + const SbxItem& rSbxItem = (const SbxItem&)rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX ); + SbxObject* pSbxObject = (SbxObject*)rSbxItem.GetSbx(); + StarBASIC* pBasic = BasicIDE::FindBasic( pSbxObject ); + DBG_ASSERT( pBasic, "Basic fuer das Object nicht gefunden!" ); + if ( !pCurBasic || ( pBasic == pCurBasic ) ) + { + IDEBaseWindow* pWin = 0; + if ( pSbxObject->ISA( SbModule ) ) + pWin = FindBasWin( pBasic, pSbxObject->GetName(), TRUE ); + else if ( pSbxObject->GetSbxId() == SBXID_DIALOG ) + pWin = FindDlgWin( pBasic, pSbxObject->GetName(), TRUE ); + } + } + break; + case SID_BASICIDE_SBXDELETED: + { + DBG_ASSERT( rReq.GetArgs(), "arguments expected" ); + const SbxItem& rSbxItem = (const SbxItem&)rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX ); + SbxObject* pSbxObject = (SbxObject*)rSbxItem.GetSbx(); + IDEBaseWindow* pWin = FindWindow( pSbxObject, TRUE ); + if ( pWin ) + RemoveWindow( pWin, TRUE ); + } + break; + case SID_BASICIDE_SHOWSBX: + { + DBG_ASSERT( rReq.GetArgs(), "arguments expected" ); + const SbxItem& rSbxItem = (const SbxItem&)rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX ); + SbxVariable* pSbx = (SbxVariable*)rSbxItem.GetSbx(); + StarBASIC* pBasic = BasicIDE::FindBasic( pSbx ); + DBG_ASSERT( pBasic, "Basic nicht gefunden!" ); + if ( pCurBasic && ( pCurBasic != pBasic ) ) + SetCurBasic( pBasic ); + IDEBaseWindow* pWin = 0; + if ( pSbx->GetSbxId() == SBXID_DIALOG ) + pWin = FindDlgWin( pBasic, pSbx->GetName(), TRUE ); + else if ( pSbx->ISA( SbModule ) ) + pWin = FindBasWin( pBasic, pSbx->GetName(), TRUE ); + else if ( pSbx->ISA( SbMethod ) ) + { + pWin = FindBasWin( pBasic, pSbx->GetParent()->GetName(), TRUE ); + ((ModulWindow*)pWin)->EditMacro( pSbx->GetName() ); + } + DBG_ASSERT( pWin, "Fenster wurde nicht erzeugt!" ); + SetCurWindow( pWin, TRUE ); + } + break; + } +} + +void __EXPORT BasicIDEShell::GetState(SfxItemSet &rSet) +{ + SfxWhichIter aIter(rSet); + for ( USHORT nWh = aIter.FirstWhich(); 0 != nWh; nWh = aIter.NextWhich() ) + { + switch ( nWh ) + { + case SID_DOCINFO: + { + rSet.DisableItem( nWh ); + } + break; + case SID_SAVEDOC: + { +/* + BasicManager* pAppBasMgr = SFX_APP()->GetBasicManager(); + // Wenn nicht modifiert, sowieso disablen... + if ( pCurWin && ( pCurWin->IsModified() ) && + ( BasicIDE::FindBasicManager( pCurWin->GetBasic() ) == pAppBasMgr ) ) + { + break; // Also enabled + } + if ( !pAppBasMgr->IsModified() ) + rSet.DisableItem( nWh ); + // ansonsten disablen, wenn ein anderes Basic dargestellt wird. + else if ( pCurBasic && ( BasicIDE::FindBasicManager( pCurBasic ) != pAppBasMgr ) ) + rSet.DisableItem( nWh ); + else if ( !pCurBasic && pCurWin ) + { + StarBASIC* pBasic = pCurWin->GetBasic(); + BasicManager* pMgr = BasicIDE::FindBasicManager( pBasic ); + if ( pMgr != pAppBasMgr ) + rSet.DisableItem( nWh ); + } +*/ + + BasicManager* pMgr = pCurWin ? BasicIDE::FindBasicManager( pCurWin->GetBasic() ) : 0; + if ( !pCurWin || !pMgr || + ( !pCurWin->IsModified() && !pMgr->IsModified() ) ) + { + rSet.DisableItem( nWh ); + } + } + break; + case SID_NEWWINDOW: + case SID_SAVEASDOC: + { + rSet.DisableItem( nWh ); + } + break; + case SID_BASICIDE_MODULEDLG: + { + if ( StarBASIC::IsRunning() ) + rSet.DisableItem( nWh ); + } + break; + case SID_BASICIDE_CHOOSEMACRO: + case SID_BASICIDE_OBJCAT: + case SID_BASICIDE_SHOWSBX: + case SID_BASICIDE_CREATEMACRO: + case SID_BASICIDE_EDITMACRO: + case SID_BASICIDE_NAMECHANGEDONTAB: + { + ; + } + break; + + case SID_BASICIDE_ADDWATCH: + case SID_BASICIDE_REMOVEWATCH: + case SID_BASICLOAD: + case SID_BASICSAVEAS: + case SID_BASICIDE_MATCHGROUP: + { + if ( !pCurWin || !pCurWin->IsA( TYPE( ModulWindow ) ) ) + rSet.DisableItem( nWh ); + else if ( ( nWh == SID_BASICLOAD ) && StarBASIC::IsRunning() ) + rSet.DisableItem( nWh ); + } + break; + case SID_BASICRUN: + case SID_BASICSTEPINTO: + case SID_BASICSTEPOVER: + case SID_BASICSTEPOUT: + case SID_BASICIDE_TOGGLEBRKPNT: + { + if ( !pCurWin || !pCurWin->IsA( TYPE( ModulWindow ) ) ) + rSet.DisableItem( nWh ); + else if ( StarBASIC::IsRunning() && !((ModulWindow*)pCurWin)->GetBasicStatus().bIsInReschedule ) + rSet.DisableItem( nWh ); + } + break; + case SID_BASICCOMPILE: + { + if ( !pCurWin || !pCurWin->IsA( TYPE( ModulWindow ) ) || StarBASIC::IsRunning() ) + rSet.DisableItem( nWh ); + } + break; + case SID_BASICSTOP: + { + // Stop immermoeglich, wenn irgendein Basic lauft... + if ( !StarBASIC::IsRunning() ) + rSet.DisableItem( nWh ); + } + break; + case SID_CHOOSE_CONTROLS: + case SID_DIALOG_TESTMODE: + { + if( !pCurWin || !pCurWin->IsA( TYPE( DialogWindow ) ) ) + rSet.DisableItem( nWh ); + } + break; + case SID_SHOW_FORMS: + case SID_SHOW_HIDDEN: + { + rSet.DisableItem( nWh ); + } + break; + case SID_SEARCH_OPTIONS: + { + USHORT nOptions = 0; + if( pCurWin ) + nOptions = pCurWin->GetSearchOptions(); + rSet.Put( SfxUInt16Item( SID_SEARCH_OPTIONS, nOptions ) ); + } + break; + case SID_BASICIDE_LIBSELECTOR: + { + String aQName; + if ( pCurBasic ) + { + BasicManager* pBasMgr = BasicIDE::FindBasicManager( pCurBasic ); + if ( pBasMgr ) // 0 bei CloseDoc! + aQName = CreateMgrAndLibStr( BasicIDE::FindTitle( pBasMgr ), pCurBasic->GetName() ); + } + SfxStringItem aItem( SID_BASICIDE_LIBSELECTOR, aQName ); + rSet.Put( aItem ); + } + break; + case SID_SEARCH_ITEM: + { + String aSelected = GetSelectionText( TRUE ); + SvxSearchItem& rItem = IDE_DLL()->GetExtraData()->GetSearchItem(); + rItem.SetSearchString( aSelected ); + rSet.Put( rItem ); + } + break; + case SID_BASICIDE_STAT_DATE: + { + String aDate; + aDate = String( RTL_CONSTASCII_USTRINGPARAM( "Datum?!" ) ); + SfxStringItem aItem( SID_BASICIDE_STAT_DATE, aDate ); + rSet.Put( aItem ); + } + break; + case SID_DOC_MODIFIED: + { + String aModifiedMarker; + BasicManager* pBasMgr = pCurWin ? BasicIDE::FindBasicManager( pCurWin->GetBasic() ) : 0; + if ( pCurWin && ( pCurWin->IsModified() || ( pBasMgr && pBasMgr->IsModified() ) ) ) + { + aModifiedMarker = '*'; + } + SfxStringItem aItem( SID_DOC_MODIFIED, aModifiedMarker ); + rSet.Put( aItem ); + } + break; + case SID_BASICIDE_STAT_TITLE: + { + if ( pCurWin ) + { +/* + String aTitle; + StarBASIC* pBasic = pCurWin->GetBasic(); + BasicManager* pBasMgr = BasicIDE::FindBasicManager( pBasic ); + DBG_ASSERT( pBasMgr, "BasMgr?!" ); + aTitle += BasicIDE::FindTitle( pBasMgr ); + aTitle += '.'; + aTitle += pBasic->GetName(); + String aExtraTitle = pCurWin->GetTitle(); + if ( aExtraTitle.Len() ) + { + aTitle += '.'; + aTitle += aExtraTitle; + } +*/ + String aTitle = pCurWin->CreateQualifiedName(); + SfxStringItem aItem( SID_BASICIDE_STAT_TITLE, aTitle ); + rSet.Put( aItem ); + } + } + break; + // Werden vom Controller ausgewertet: + case SID_ATTR_SIZE: + case SID_ATTR_INSERT: + break; + case SID_UNDO: + case SID_REDO: + { + if( GetUndoManager() ) // sonst rekursives GetState + GetViewFrame()->GetSlotState( nWh, NULL, &rSet ); + } + break; + } + } + if ( pCurWin ) + pCurWin->GetState( rSet ); +} + +void BasicIDEShell::SetCurWindow( IDEBaseWindow* pNewWin, BOOL bUpdateTabBar, BOOL bRememberAsCurrent ) +{ + // Es muss ein EditWindow am Sfx gesetzt sein, sonst kommt kein + // Resize, also stehen die Controls auf den Wiese... + // Sieht dann sowieso besser aus, wenn das Modul-Layout angezeigt wird... + if ( !pNewWin && ( GetWindow() != pModulLayout ) ) + { + pModulLayout->Show(); + AdjustPosSizePixel( Point( 0, 0 ), GetViewFrame()->GetWindow().GetOutputSizePixel() ); + SetWindow( pModulLayout ); + EnableScrollbars( FALSE ); + aVScrollBar.Hide(); + } + + if ( pNewWin != pCurWin ) + { + IDEBaseWindow* pPrevCurWin = pCurWin; + pCurWin = pNewWin; + if ( pPrevCurWin ) + { + pPrevCurWin->Hide(); + pPrevCurWin->Deactivating(); +// pPrevCurWin->GetLayoutWindow()->Hide(); + if( pPrevCurWin->IsA( TYPE( DialogWindow ) ) ) + { + ((DialogWindow*)pPrevCurWin)->DisableBrowser(); + } + else + { + pModulLayout->SetModulWindow( NULL ); + } + } + if ( pCurWin ) + { + AdjustPosSizePixel( Point( 0, 0 ), GetViewFrame()->GetWindow().GetOutputSizePixel() ); + if( pCurWin->IsA( TYPE( ModulWindow ) ) ) + { + GetViewFrame()->GetWindow().SetHelpId( HID_BASICIDE_MODULWINDOW ); + pModulLayout->SetModulWindow( (ModulWindow*)pCurWin ); + pModulLayout->Show(); + + if ( bRememberAsCurrent ) + { + StarBASIC* pLib = ((ModulWindow*)pCurWin)->GetBasic(); + LibInfo* pLibInf = IDE_DLL()->GetExtraData()->GetLibInfos().GetInfo( pLib, TRUE ); + pLibInf->aCurrentModule = ((ModulWindow*)pCurWin)->GetModule()->GetName(); + } + } + else + { + pModulLayout->Hide(); + GetViewFrame()->GetWindow().SetHelpId( HID_BASICIDE_DIALOGWINDOW ); + } + if ( GetViewFrame()->GetWindow().IsVisible() ) // sonst macht es spaeter der SFX + pCurWin->Show(); + + pCurWin->Init(); + + if ( !IDE_DLL()->GetExtraData()->ShellInCriticalSection() ) + { + Window* pFrameWindow = &GetViewFrame()->GetWindow(); + Window* pFocusWindow = Application::GetFocusWindow(); + while ( pFocusWindow && ( pFocusWindow != pFrameWindow ) ) + pFocusWindow = pFocusWindow->GetParent(); + if ( pFocusWindow ) // Focus in BasicIDE + pNewWin->GrabFocus(); + } + if( pCurWin->IsA( TYPE( DialogWindow ) ) ) + ((DialogWindow*)pCurWin)->UpdateBrowser(); + } + if ( bUpdateTabBar ) + { + ULONG nKey = aIDEWindowTable.GetKey( pCurWin ); + if ( pCurWin && ( pTabBar->GetPagePos( (USHORT)nKey ) == TAB_PAGE_NOTFOUND ) ) + pTabBar->InsertPage( (USHORT)nKey, pCurWin->GetTitle() ); // wurde neu eingeblendet + pTabBar->SetCurPageId( (USHORT)nKey ); + } + if ( pCurWin && pCurWin->IsSuspended() ) // Wenn das Fenster im Fehlerfall angezeigt wird... + pCurWin->SetStatus( pCurWin->GetStatus() & ~BASWIN_SUSPENDED ); + if ( pCurWin ) + { + SetWindow( pCurWin ); + } + else + { + SetWindow( pModulLayout ); + GetViewFrame()->GetWindow().SetHelpId( HID_BASICIDE_MODULWINDOW ); + } + SetUndoManager( pCurWin ? pCurWin->GetUndoManager() : 0 ); + InvalidateBasicIDESlots(); + SetMDITitle(); + EnableScrollbars( pCurWin ? TRUE : FALSE ); + + } +} + +IDEBaseWindow* BasicIDEShell::FindWindow( const SbxObject* pObj, BOOL bFindSuspended ) +{ + IDEBaseWindow* pWin = aIDEWindowTable.First(); + while ( pWin ) + { + if ( !pWin->IsSuspended() || bFindSuspended ) + { + if ( !pObj ) // irgendein nicht suspendiertes + return pWin; + else if ( pWin->IsA( TYPE( ModulWindow ) ) ) + { + if ( ((ModulWindow*)pWin)->GetModule() == pObj ) + return pWin; + } + else + { + if ( ((DialogWindow*)pWin)->GetDialog() == pObj ) + return pWin; + } + } + pWin = aIDEWindowTable.Next(); + } + return 0; +} + +long BasicIDEShell::CallBasicErrorHdl( StarBASIC* pBasic ) +{ + long nRet = 0; + ModulWindow* pModWin = ShowActiveModuleWindow( pBasic ); + if ( pModWin ) + nRet = pModWin->BasicErrorHdl( pBasic ); + return nRet; +} + +long BasicIDEShell::CallBasicBreakHdl( StarBASIC* pBasic ) +{ + long nRet = 0; + ModulWindow* pModWin = ShowActiveModuleWindow( pBasic ); + if ( pModWin ) + { + BOOL bAppWindowDisabled, bDispatcherLocked; + USHORT nWaitCount; + SfxUInt16Item *pSWActionCount, *pSWLockViewCount; + BasicIDE::BasicStopped( &bAppWindowDisabled, &bDispatcherLocked, + &nWaitCount, &pSWActionCount, &pSWLockViewCount ); + + nRet = pModWin->BasicBreakHdl( pBasic ); + + if ( StarBASIC::IsRunning() ) // Falls abgebrochen... + { + if ( bAppWindowDisabled ) + Application::GetDefModalDialogParent()->Enable( FALSE ); + if ( bDispatcherLocked ) + SFX_APP()->LockDispatcher( TRUE ); + + for ( USHORT n = 0; n < nWaitCount; n++ ) + Application::EnterWait(); + } + } + return nRet; +} + +ModulWindow* BasicIDEShell::ShowActiveModuleWindow( StarBASIC* pBasic ) +{ + if ( pCurBasic && ( pBasic != pCurBasic ) ) + SetCurBasic( 0, FALSE ); + + SbModule* pActiveModule = StarBASIC::GetActiveModule(); + DBG_ASSERT( pActiveModule, "Kein aktives Modul im ErrorHdl?!" ); + if ( pActiveModule ) + { + SbxObject* pParent = pActiveModule->GetParent(); + DBG_ASSERT( pParent && pParent->ISA( StarBASIC ), "Kein BASIC!" ); + ModulWindow* pWin = FindBasWin( (StarBASIC*)pParent, pActiveModule->GetName(), TRUE ); + DBG_ASSERT( pWin, "Error/Step-Hdl: Fenster wurde nicht erzeugt/gefunden!" ); + SetCurWindow( pWin, TRUE ); + BasicManager* pBasicMgr = BasicIDE::FindBasicManager( pBasic ); + if ( pBasicMgr ) + StartListening( *pBasicMgr, TRUE /* Nur einmal anmelden */ ); + return pWin; + } + return 0; +} + +void __EXPORT BasicIDEShell::AdjustPosSizePixel( const Point &rPos, const Size &rSize ) +{ + // Nicht wenn minimiert, weil dann bei Restore der Text verschoben ist. + if ( GetViewFrame()->GetWindow().GetOutputSizePixel().Height() == 0 ) + return; + + Size aSz( rSize ); +// long nScrollbarWidthPixel = aVScrollBar.GetSizePixel().Width(); + Size aScrollBarBoxSz( aScrollBarBox.GetSizePixel() ); + aSz.Height() -= aScrollBarBoxSz.Height(); +#ifndef VCL +#ifdef MAC + aSz.Height()++; +#endif +#endif + Size aOutSz( aSz ); + aSz.Width() -= aScrollBarBoxSz.Width(); + aScrollBarBox.SetPosPixel( Point( rSize.Width() - aScrollBarBoxSz.Width(), rSize.Height() - aScrollBarBoxSz.Height() ) ); + aVScrollBar.SetPosSizePixel( Point( rPos.X()+aSz.Width(), rPos.Y() ), Size( aScrollBarBoxSz.Width(), aSz.Height() ) ); + if ( bTabBarSplitted ) + { + // SplitSize ist beim Resize 0 ! + long nSplitPos = pTabBar->GetSizePixel().Width(); + if ( nSplitPos > aSz.Width() ) + nSplitPos = aSz.Width(); + pTabBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( nSplitPos, aScrollBarBoxSz.Height() ) ); + long nScrlStart = rPos.X() + nSplitPos; + aHScrollBar.SetPosSizePixel( Point( nScrlStart, rPos.Y()+aSz.Height() ), Size( aSz.Width() - nScrlStart + 1, aScrollBarBoxSz.Height() ) ); + aHScrollBar.Update(); + } + else + { + aHScrollBar.SetPosSizePixel( Point( rPos.X()+ aSz.Width()/2 - 1, rPos.Y()+aSz.Height() ), Size( aSz.Width()/2 + 2, aScrollBarBoxSz.Height() ) ); + pTabBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( aSz.Width()/2, aScrollBarBoxSz.Height() ) ); + } + + Window* pEdtWin = pCurWin ? pCurWin->GetLayoutWindow() : pModulLayout; + if ( pEdtWin ) + { + if( pCurWin && pCurWin->IsA( TYPE( DialogWindow ) ) ) + pEdtWin->SetPosSizePixel( rPos, aSz ); // Ohne ScrollBar + else + pEdtWin->SetPosSizePixel( rPos, aOutSz ); + } +} + +void __EXPORT BasicIDEShell::Activate( BOOL bMDI ) +{ + if ( bMDI ) + { + if( pCurWin && pCurWin->IsA( TYPE( DialogWindow ) ) ) + ((DialogWindow*)pCurWin)->UpdateBrowser(); + + // Accelerator hauptsaechlich aus kompatibilitaetsgruenden in + // ExtraData statt in ViewShell + Accelerator* pAccel = IDE_DLL()->GetExtraData()->GetAccelerator(); + DBG_ASSERT( pAccel, "Accel?!" ); + pAccel->SetSelectHdl( LINK( this, BasicIDEShell, AccelSelectHdl ) ); + Application::InsertAccel( pAccel ); + + ShowObjectDialog( TRUE, FALSE ); + } +} + +void __EXPORT BasicIDEShell::Deactivate( BOOL bMDI ) +{ + // bMDI TRUE heisst, dass ein anderes MDI aktiviert wurde, bei einem + // Deactivate durch eine MessageBox ist bMDI FALSE + if ( bMDI ) + { + if( pCurWin && pCurWin->IsA( TYPE( DialogWindow ) ) ) + { + DialogWindow* pXDlgWin = (DialogWindow*)pCurWin; + pXDlgWin->DisableBrowser(); + if( pXDlgWin->IsModified() ) + BasicIDE::MarkDocShellModified( pXDlgWin->GetBasic() ); + } + + // CanClose pruefen, damit auch beim deaktivieren der BasicIDE geprueft wird, + // ob in einem Modul der Sourcecode zu gross ist... + for ( ULONG nWin = 0; nWin < aIDEWindowTable.Count(); nWin++ ) + { + IDEBaseWindow* pWin = aIDEWindowTable.GetObject( nWin ); + if ( /* !pWin->IsSuspended() && */ !pWin->CanClose() ) + { + if ( pCurBasic && ( pWin->GetBasic() != pCurBasic ) ) + SetCurBasic( 0, FALSE ); + SetCurWindow( pWin, TRUE ); + break; + } + } + + Accelerator* pAccel = IDE_DLL()->GetExtraData()->GetAccelerator(); + DBG_ASSERT( pAccel, "Accel?!" ); + pAccel->SetSelectHdl( Link() ); + Application::RemoveAccel( pAccel ); + + ShowObjectDialog( FALSE, FALSE ); + } +} + + +IMPL_LINK( BasicIDEShell, AccelSelectHdl, Accelerator*, pAccel ) +{ + BOOL bDone = TRUE; + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( !pDispatcher ) + return FALSE; + switch ( pAccel->GetCurKeyCode().GetCode() ) + { + case KEY_F5: + if ( pAccel->GetCurKeyCode().IsShift() || pAccel->GetCurKeyCode().IsMod2() ) + pDispatcher->Execute( SID_BASICSTOP, SFX_CALLMODE_SYNCHRON ); + if ( !pAccel->GetCurKeyCode().IsMod2() ) + { + // Muss asynchron sein, damit ggf. STOP wirken kan (Reschedule). + pDispatcher->Execute( SID_BASICRUN, SFX_CALLMODE_ASYNCHRON ); + } + break; + case KEY_F7: + pDispatcher->Execute( SID_BASICIDE_ADDWATCH, SFX_CALLMODE_SYNCHRON ); + break; + case KEY_F8: + if ( pAccel->GetCurKeyCode().IsShift() ) + pDispatcher->Execute( SID_BASICSTEPOVER, SFX_CALLMODE_SYNCHRON ); + else + pDispatcher->Execute( SID_BASICSTEPINTO, SFX_CALLMODE_SYNCHRON ); + break; + case KEY_F9: + pDispatcher->Execute( SID_BASICIDE_TOGGLEBRKPNT, SFX_CALLMODE_SYNCHRON ); + break; + default: bDone = FALSE; + } + return bDone; +} + diff --git a/basctl/source/basicide/basides2.cxx b/basctl/source/basicide/basides2.cxx new file mode 100644 index 000000000..ab6a389b3 --- /dev/null +++ b/basctl/source/basicide/basides2.cxx @@ -0,0 +1,307 @@ +/************************************************************************* + * + * $RCSfile: basides2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#define SI_NOCONTROL +#define SI_NOSBXCONTROLS + +#include <ide_pch.hxx> + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif + +#pragma hdrstop +#define __PRIVATE 1 + +#include <vcl/rcid.h> +#include <vcl/sound.hxx> +#include <basidesh.hxx> +#include <baside2.hxx> +#include <basdoc.hxx> +#include <basobj.hxx> +#include <svtools/texteng.hxx> +#include <svtools/textview.hxx> +#include <svtools/xtextedt.hxx> +#include <sfx2/sfxdefs.hxx> + +IMPL_LINK_INLINE_START( BasicIDEShell, ObjectDialogCancelHdl, ObjectCatalog *, EMPTYARG ) +{ + ShowObjectDialog( FALSE, TRUE ); + return 0; +} +IMPL_LINK_INLINE_END( BasicIDEShell, ObjectDialogCancelHdl, ObjectCatalog *, EMPTYARG ) + +/* +IMPL_LINK( BasicIDEShell, ObjectDialogInsertHdl, ObjectCatalog *, pObjCat ) +{ + if ( !pCurWin ) + return 0; + + if ( pCurWin->IsA( TYPE( ModulWindow ) ) ) + { + ModulWindow* pEditWin = (ModulWindow*)pCurWin; + pEditWin->InsertFromObjectCatalog( pObjCat ); + } + else + Sound::Beep(); + + return 0; +} +*/ + +USHORT __EXPORT BasicIDEShell::Print( SfxProgress &rProgress, PrintDialog *pPrintDialog ) +{ + if ( pCurWin ) + { + SfxPrinter* pPrinter = GetPrinter( TRUE ); + if ( pPrinter ) + { + SfxViewShell::Print( rProgress, pPrintDialog ); + pCurWin->PrintData( pPrinter ); + } + } + return 0; +} + +BOOL BasicIDEShell::HasSelection( BOOL /* bText */ ) const +{ + BOOL bSel = FALSE; + if ( pCurWin && pCurWin->ISA( ModulWindow ) ) + { + TextView* pEditView = ((ModulWindow*)pCurWin)->GetEditView(); + if ( pEditView && pEditView->HasSelection() ) + bSel = TRUE; + } + return bSel; +} + +String BasicIDEShell::GetSelectionText( BOOL bWholeWord ) +{ + String aText; + if ( pCurWin && pCurWin->ISA( ModulWindow ) ) + { + TextView* pEditView = ((ModulWindow*)pCurWin)->GetEditView(); + if ( pEditView ) + { + if ( bWholeWord && !pEditView->HasSelection() ) + { + // String aStrCurrentDelimiters = pEngine->GetWordDelimiters(); + // pEngine->SetWordDelimiters( " .,;\"'" ); + aText = pEditView->GetTextEngine()->GetWord( pEditView->GetSelection().GetEnd() ); + // pEngine->SetWordDelimiters( aStrCurrentDelimiters ); + } + else + { + TextSelection aSel = pEditView->GetSelection(); + if ( !bWholeWord || ( aSel.GetStart().GetPara() == aSel.GetEnd().GetPara() ) ) + aText = pEditView->GetSelected(); + } + } + } + return aText; +} + +SfxPrinter* __EXPORT BasicIDEShell::GetPrinter( BOOL bCreate ) +{ + if ( pCurWin ) // && pCurWin->ISA( ModulWindow ) ) + { + BasicDocShell* pDocShell = (BasicDocShell*)GetViewFrame()->GetObjectShell(); + DBG_ASSERT( pDocShell, "DocShell ?!" ); + return pDocShell->GetPrinter( bCreate ); + } + return 0; +} + +USHORT __EXPORT BasicIDEShell::SetPrinter( SfxPrinter *pNewPrinter, USHORT nDiffFlags ) +{ + BasicDocShell* pDocShell = (BasicDocShell*)GetViewFrame()->GetObjectShell(); + DBG_ASSERT( pDocShell, "DocShell ?!" ); + pDocShell->SetPrinter( pNewPrinter ); + return 0; +} + +void BasicIDEShell::SetMDITitle() +{ + String aTitle = BasicIDE::GetStdTitle(); + if ( pCurWin ) + { + StarBASIC* pLib = pCurWin->GetBasic(); + DBG_ASSERT( pLib, "Lib?!" ); + BasicManager* pBasMgr = BasicIDE::FindBasicManager( pLib ); + if ( pBasMgr ) + { + aTitle += String( RTL_CONSTASCII_USTRINGPARAM( " - " ) ); + aTitle += BasicIDE::FindTitle( pBasMgr, SFX_TITLE_FILENAME ); + aTitle += '.'; + aTitle += pLib->GetName(); + } + } + // Wenn DocShell::SetTitle, erfolgt beim Schliessen Abfrage, ob Speichern! + GetViewFrame()->GetObjectShell()->SetTitle( aTitle ); + GetViewFrame()->GetObjectShell()->SetModified( FALSE ); +} + +void BasicIDEShell::DestroyModulWindowLayout() +{ + delete pModulLayout; + pModulLayout = 0; +} + + +void BasicIDEShell::UpdateModulWindowLayout() +{ + if ( pModulLayout ) + { + pModulLayout->GetStackWindow().UpdateCalls(); + pModulLayout->GetWatchWindow().UpdateWatches(); + } +} + +void BasicIDEShell::CreateModulWindowLayout() +{ + pModulLayout = new ModulWindowLayout( &GetViewFrame()->GetWindow() ); +} + +ModulWindow* BasicIDEShell::CreateBasWin( StarBASIC* pBasic, String aModName ) +{ + bCreatingWindow = TRUE; + ULONG nKey = 0; + ModulWindow* pWin = 0; + + SbModule* pModule = pBasic->FindModule( aModName ); + if ( !pModule ) + pModule = BasicIDE::CreateModule( pBasic, aModName, TRUE ); + else // Vielleicht gibt es ein suspendiertes? + pWin = FindBasWin( pBasic, aModName, FALSE, TRUE ); + + if ( !pWin ) + { + pWin = new ModulWindow( pModulLayout, pBasic, pModule ); + nKey = InsertWindowInTable( pWin ); + } + else + { + pWin->SetStatus( pWin->GetStatus() & ~BASWIN_SUSPENDED ); + IDEBaseWindow* pTmp = aIDEWindowTable.First(); + while ( pTmp && !nKey ) + { + if ( pTmp == pWin ) + nKey = aIDEWindowTable.GetCurKey(); + pTmp = aIDEWindowTable.Next(); + } + DBG_ASSERT( nKey, "CreateBasWin: Kein Key- Fenster nicht gefunden!" ); + } + pTabBar->InsertPage( (USHORT)nKey, pModule->GetName() ); + pWin->GrabScrollBars( &aHScrollBar, &aVScrollBar ); + if ( !pCurWin ) + SetCurWindow( pWin, FALSE, FALSE ); + + bCreatingWindow = FALSE; + return pWin; +} + +ModulWindow* BasicIDEShell::FindBasWin( StarBASIC* pBasic, const String& rModName, BOOL bCreateIfNotExist, BOOL bFindSuspended ) +{ + ModulWindow* pModWin = 0; + IDEBaseWindow* pWin = aIDEWindowTable.First(); + while ( pWin && !pModWin ) + { + if ( ( !pWin->IsSuspended() || bFindSuspended ) && pWin->IsA( TYPE( ModulWindow ) ) ) + { + String aMod( ((ModulWindow*)pWin)->GetModuleName() ); + if ( !pBasic ) // nur irgendeins finden... + pModWin = (ModulWindow*)pWin; + else if ( ( pWin->GetBasic() == pBasic ) && + ( ( rModName.Len() == 0 ) || ( aMod == rModName ) ) ) + { + pModWin = (ModulWindow*)pWin; + } + } + pWin = aIDEWindowTable.Next(); + } + if ( !pModWin && bCreateIfNotExist ) + pModWin = CreateBasWin( pBasic, rModName ); + + return pModWin; +} + +void __EXPORT BasicIDEShell::Move() +{ + if ( pCurWin && pCurWin->ISA( ModulWindow ) ) + ((ModulWindow*)pCurWin)->FrameWindowMoved(); +} + +void __EXPORT BasicIDEShell::ShowCursor( FASTBOOL bOn ) +{ + if ( pCurWin && pCurWin->ISA( ModulWindow ) ) + ((ModulWindow*)pCurWin)->ShowCursor( (BOOL)bOn ); +} + +// Nur wenn Basicfenster oben: +void __EXPORT BasicIDEShell::ExecuteBasic( SfxRequest& rReq ) +{ + if ( !pCurWin || !pCurWin->IsA( TYPE( ModulWindow ) ) ) + return; + + pCurWin->ExecuteCommand( rReq ); + CheckWindows(); +} + diff --git a/basctl/source/basicide/basides3.cxx b/basctl/source/basicide/basides3.cxx new file mode 100644 index 000000000..0a090bcae --- /dev/null +++ b/basctl/source/basicide/basides3.cxx @@ -0,0 +1,161 @@ +/************************************************************************* + * + * $RCSfile: basides3.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#define SI_NOCONTROL +#define SI_NOSBXCONTROLS + +#include <basidesh.hrc> +#include <ide_pch.hxx> + +#pragma hdrstop + +#define __PRIVATE 1 + +#include <basidesh.hxx> +#include <baside3.hxx> +#include <basobj.hxx> + +DialogWindow* BasicIDEShell::CreateDlgWin( StarBASIC* pBasic, String aDlgName, SbxObject* pDlg ) +{ + bCreatingWindow = TRUE; + + ULONG nKey = 0; + DialogWindow* pWin = 0; + if ( !pDlg ) + { + pDlg = BasicIDE::FindDialog( pBasic, aDlgName ); + if ( !pDlg ) + pDlg = BasicIDE::CreateDialog( pBasic, aDlgName ); + DBG_ASSERT( pDlg, "Es wurde kein Dialog erzeugt!" ); + } + else // Vielleicht gibt es ein suspendiertes? + pWin = FindDlgWin( pBasic, aDlgName, FALSE, TRUE ); + + + VCSbxDialogRef xNewDlg = (VCSbxDialog*)pDlg; + + if ( !pWin ) + { + pWin = new DialogWindow( &GetViewFrame()->GetWindow(), xNewDlg, pBasic ); + nKey = InsertWindowInTable( pWin ); + } + else + { + pWin->SetStatus( pWin->GetStatus() & ~BASWIN_SUSPENDED ); + IDEBaseWindow* pTmp = aIDEWindowTable.First(); + while ( pTmp && !nKey ) + { + if ( pTmp == pWin ) + nKey = aIDEWindowTable.GetCurKey(); + pTmp = aIDEWindowTable.Next(); + } + DBG_ASSERT( nKey, "CreateDlgWin: Kein Key - Fenster nicht gefunden!" ); + } + pWin->GrabScrollBars( &aHScrollBar, &aVScrollBar ); + pTabBar->InsertPage( (USHORT)nKey, xNewDlg->GetName() ); + if ( !pCurWin ) + SetCurWindow( pWin, FALSE, FALSE ); + + bCreatingWindow = FALSE; + return pWin; +} + +DialogWindow* BasicIDEShell::FindDlgWin( StarBASIC* pBasic, const String& rDlgName, BOOL bCreateIfNotExist, BOOL bFindSuspended ) +{ + DialogWindow* pDlgWin = 0; + IDEBaseWindow* pWin = aIDEWindowTable.First(); + while ( pWin && !pDlgWin ) + { + if ( ( !pWin->IsSuspended() || bFindSuspended ) && pWin->IsA( TYPE( DialogWindow ) ) ) + { + String aDlgStr( ((DialogWindow*)pWin)->GetDialogName() ); + if ( !pBasic ) // nur irgendeins finden... + pDlgWin = (DialogWindow*)pWin; + else if ( ( pWin->GetBasic() == pBasic ) && + ( ( rDlgName.Len() == 0 ) || ( aDlgStr == rDlgName ) ) ) + pDlgWin = (DialogWindow*)pWin; + } + pWin = aIDEWindowTable.Next(); + } + if ( !pDlgWin && bCreateIfNotExist ) + pDlgWin = CreateDlgWin( pBasic, rDlgName ); + + return pDlgWin; +} + +SdrView* BasicIDEShell::GetCurDlgView() +{ + if ( !pCurWin || !pCurWin->IsA( TYPE( DialogWindow ) ) ) + return NULL; + + DialogWindow* pWin = (DialogWindow*)pCurWin; + return pWin->GetView(); +} + +// Nur wenn Dialogfenster oben: +void __EXPORT BasicIDEShell::ExecuteDialog( SfxRequest& rReq ) +{ + if ( !pCurWin || !pCurWin->IsA( TYPE( DialogWindow ) ) ) + return; + + pCurWin->ExecuteCommand( rReq ); +} + diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx new file mode 100644 index 000000000..990b62d66 --- /dev/null +++ b/basctl/source/basicide/basidesh.cxx @@ -0,0 +1,848 @@ +/************************************************************************* + * + * $RCSfile: basidesh.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +// CLOOKS: +//#define _MENUBTN_HXX +#define _SPIN_HXX +#define _PRVWIN_HXX +//#define _FIELD_HXX *** +//#define _TAB_HXX *** +#define _DIALOGS_HXX +#define _SVRTF_HXX +#define _ISETBRW_HXX +#define _VCTRLS_HXX +#define SI_NOCONTROL +#define SI_NOSBXCONTROLS + +#define ITEMID_SIZE 0 + +// Falls ohne PCH's: +#include <ide_pch.hxx> + +#pragma hdrstop + +#define __PRIVATE 1 + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#ifndef _SFXHINT_HXX //autogen +#include <svtools/hint.hxx> +#endif +#include <basidesh.hrc> +#include <basidesh.hxx> +#include <basdoc.hxx> +#include <basobj.hxx> +#include <bastypes.hxx> +#include <basicbox.hxx> +#include <objdlg.hxx> +#include <sbxitem.hxx> +#include <tbxctl.hxx> +#include <iderdll2.hxx> + +#define BasicIDEShell +#define SFX_TYPEMAP +#include <idetemp.hxx> +#include <baside.hxx> +#include <iderdll.hxx> +#include <svx/pszctrl.hxx> +#include <svx/insctrl.hxx> + +TYPEINIT1( BasicIDEShell, SfxViewShell ); + +SFX_IMPL_VIEWFACTORY( BasicIDEShell, SVX_INTERFACE_BASIDE_VIEWSH ) +{ + SFX_VIEW_REGISTRATION( BasicDocShell ); +} + + +// SFX_IMPL_INTERFACE( BasicIDEShell, SfxViewShell, IDEResId( RID_STR_IDENAME ) ) +// { +// } + +// MI: Prinzipiel IDL, aber ich lieber doch nicht? +// SFX_IMPL_ /*IDL_*/ INTERFACE( BasicIDEShell, SfxViewShell, IDEResId( RID_STR_IDENAME ) ) +SFX_IMPL_INTERFACE( BasicIDEShell, SfxViewShell, IDEResId( RID_STR_IDENAME ) ) +{ + SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_MACRO | SFX_VISIBILITY_STANDARD + | SFX_VISIBILITY_FULLSCREEN | SFX_VISIBILITY_CLIENT, IDEResId( RID_BASICIDE_OBJECTBAR ) ); + SFX_CHILDWINDOW_REGISTRATION( SID_SEARCH_DLG ); + SFX_CHILDWINDOW_REGISTRATION( SID_SHOW_BROWSER ); +} + + + +#define IDE_VIEWSHELL_FLAGS SFX_VIEW_MAXIMIZE_FIRST|SFX_VIEW_CAN_PRINT|SFX_VIEW_NO_NEWWINDOW + +BasicIDEShell::BasicIDEShell( SfxViewFrame *pFrame, Window * ): + SfxViewShell( pFrame, IDE_VIEWSHELL_FLAGS ), + aHScrollBar( &GetViewFrame()->GetWindow(), WinBits( WB_HSCROLL | WB_DRAG ) ), + aVScrollBar( &GetViewFrame()->GetWindow(), WinBits( WB_VSCROLL | WB_DRAG ) ), + aScrollBarBox( &GetViewFrame()->GetWindow(), WinBits( WB_SIZEABLE ) ) +{ + Init(); +} + + +BasicIDEShell::BasicIDEShell( SfxViewFrame *pFrame, const BasicIDEShell & rView): + SfxViewShell( pFrame, IDE_VIEWSHELL_FLAGS ), + aHScrollBar( &GetViewFrame()->GetWindow(), WinBits( WB_HSCROLL | WB_DRAG ) ), + aVScrollBar( &GetViewFrame()->GetWindow(), WinBits( WB_VSCROLL | WB_DRAG ) ), + aScrollBarBox( &GetViewFrame()->GetWindow(), WinBits( WB_SIZEABLE ) ) +{ + DBG_ERROR( "Zweite Ansicht auf Debugger nicht moeglich!" ); +} + + + +BasicIDEShell::BasicIDEShell( SfxViewFrame* pFrame, SfxViewShell* /* pOldShell */ ) : + SfxViewShell( pFrame, IDE_VIEWSHELL_FLAGS ), + aHScrollBar( &GetViewFrame()->GetWindow(), WinBits( WB_HSCROLL | WB_DRAG ) ), + aVScrollBar( &GetViewFrame()->GetWindow(), WinBits( WB_VSCROLL | WB_DRAG ) ), + aScrollBarBox( &GetViewFrame()->GetWindow(), WinBits( WB_SIZEABLE ) ) +{ + Init(); +} + + + +void BasicIDEShell::Init() +{ + //TbxControls::RegisterControl( SID_CHOOSE_CONTROLS ); + SvxPosSizeStatusBarControl::RegisterControl(); + SvxInsertStatusBarControl::RegisterControl(); + + IDE_DLL()->GetExtraData()->ShellInCriticalSection() = TRUE; + + SetName( String( RTL_CONSTASCII_USTRINGPARAM( "BasicIDE" ) ) ); + SetHelpId( SVX_INTERFACE_BASIDE_VIEWSH ); + + SFX_APP()->EnterBasicCall(); + + LibBoxControl::RegisterControl( SID_BASICIDE_LIBSELECTOR ); + + CreateModulWindowLayout(); + + StartListening( *SFX_APP(), TRUE /* Nur einmal anmelden */ ); + + GetViewFrame()->GetWindow().SetBackground(); + + pCurWin = 0; + pCurBasic = 0; + pObjectCatalog = 0; + bCreatingWindow = FALSE; + + // MT 08/00: BasicToolBar not longer in other ViewShells. +// SFX_APP()->GetAppDispatcher().Push(*this); + + pTabBar = new BasicIDETabBar( &GetViewFrame()->GetWindow() ); + pTabBar->SetSplitHdl( LINK( this, BasicIDEShell, TabBarSplitHdl ) ); + bTabBarSplitted = FALSE; + + IDEBaseWindow* pTmpWin = 0; + nCurKey = 100; + InitScrollBars(); + InitTabBar(); + + // Nicht 0, wird sonst beim naechsten Request nicht auf das entspr. Basic gesetzt. + SetCurBasic( SFX_APP()->GetBasicManager()->GetStdLib(), FALSE ); + UpdateWindows(); + + IDE_DLL()->pShell = this; + IDE_DLL()->GetExtraData()->ShellInCriticalSection() = FALSE; +} + +__EXPORT BasicIDEShell::~BasicIDEShell() +{ + IDE_DLL()->pShell = NULL; + + // Damit bei einem Basic-Fehler beim Speichern die Shell nicht sofort + // wieder hoch kommt: + IDE_DLL()->GetExtraData()->ShellInCriticalSection() = TRUE; + + SetWindow( 0 ); + SetCurWindow( 0 ); + + // Alle Fenster zerstoeren: + IDEBaseWindow* pWin = aIDEWindowTable.First(); + while ( pWin ) + { + // Kein Store, passiert bereits, wenn die BasicManager zerstoert werden. + delete pWin; + pWin = aIDEWindowTable.Next(); + } + + aIDEWindowTable.Clear(); + delete pTabBar; + delete pObjectCatalog; + DestroyModulWindowLayout(); + // MI: Das gab einen GPF im SDT beim Schliessen da dann der ViewFrame die + // ObjSh loslaesst. Es wusste auch keiner mehr wozu das gut war. + // GetViewFrame()->GetObjectShell()->Broadcast( SfxSimpleHint( SFX_HINT_DYING ) ); + + SFX_APP()->LeaveBasicCall(); + IDE_DLL()->GetExtraData()->ShellInCriticalSection() = FALSE; +} + +sal_Bool BasicIDEShell::HasBasic() const +{ + return FALSE; +} + +void BasicIDEShell::StoreAllWindowData( BOOL bPersistent ) +{ + for ( ULONG nWin = 0; nWin < aIDEWindowTable.Count(); nWin++ ) + { + IDEBaseWindow* pWin = aIDEWindowTable.GetObject( nWin ); + DBG_ASSERT( pWin, "PrepareClose: NULL-Pointer in Table?" ); + if ( !pWin->IsSuspended() ) + pWin->StoreData(); + } + + if ( bPersistent && SFX_APP()->GetBasicManager()->IsModified() ) + { + SFX_APP()->SaveBasicManager(); + + SfxBindings& rBindings = BasicIDE::GetBindings(); + rBindings.Invalidate( SID_SAVEDOC ); + rBindings.Update( SID_SAVEDOC ); + } +} + + +USHORT __EXPORT BasicIDEShell::PrepareClose( BOOL bUI, BOOL bForBrowsing ) +{ + // da es nach Drucken etc. (DocInfo) modifiziert ist, hier resetten + GetViewFrame()->GetObjectShell()->SetModified(FALSE); + + if ( StarBASIC::IsRunning() ) + { + String aErrorStr( IDEResId( RID_STR_CANNOTCLOSE ) ); + Window *pParent = &GetViewFrame()->GetWindow(); + InfoBox( pParent, aErrorStr ).Execute(); + return FALSE; + } + else + { + // Hier unguenstig, wird zweimal gerufen... +// StoreAllWindowData(); + + BOOL bCanClose = TRUE; + for ( ULONG nWin = 0; bCanClose && ( nWin < aIDEWindowTable.Count() ); nWin++ ) + { + IDEBaseWindow* pWin = aIDEWindowTable.GetObject( nWin ); + if ( /* !pWin->IsSuspended() && */ !pWin->CanClose() ) + { + if ( pCurBasic && ( pWin->GetBasic() != pCurBasic ) ) + SetCurBasic( 0, FALSE ); + SetCurWindow( pWin, TRUE ); + bCanClose = FALSE; + } + } + + if ( bCanClose ) + StoreAllWindowData( FALSE ); // Nicht auf Platte schreiben, das passiert am Ende automatisch + + return bCanClose; + } +} + +void BasicIDEShell::InitScrollBars() +{ + aVScrollBar.SetLineSize( 300 ); + aVScrollBar.SetPageSize( 2000 ); + aHScrollBar.SetLineSize( 300 ); + aHScrollBar.SetPageSize( 2000 ); + aHScrollBar.Enable(); + aVScrollBar.Enable(); + aVScrollBar.Show(); + aHScrollBar.Show(); + aScrollBarBox.Show(); +} + + + +void BasicIDEShell::InitTabBar() +{ + pTabBar->Enable(); + pTabBar->Show(); + pTabBar->SetSelectHdl( LINK( this, BasicIDEShell, TabBarHdl ) ); +} + + +Size __EXPORT BasicIDEShell::GetOptimalSizePixel() const +{ + return Size( 400, 300 ); +} + + + +void __EXPORT BasicIDEShell::OuterResizePixel( const Point &rPos, const Size &rSize ) +{ + // Adjust fliegt irgendwann raus... + AdjustPosSizePixel( rPos, rSize ); +} + + +IMPL_LINK_INLINE_START( BasicIDEShell, TabBarSplitHdl, TabBar *, pTBar ) +{ + bTabBarSplitted = TRUE; + ArrangeTabBar(); + + return 0; +} +IMPL_LINK_INLINE_END( BasicIDEShell, TabBarSplitHdl, TabBar *, pTBar ) + + + +IMPL_LINK( BasicIDEShell, TabBarHdl, TabBar *, pCurTabBar ) +{ + USHORT nCurId = pCurTabBar->GetCurPageId(); + IDEBaseWindow* pWin = aIDEWindowTable.Get( nCurId ); + DBG_ASSERT( pWin, "Eintrag in TabBar passt zu keinem Fenster!" ); + SetCurWindow( pWin ); + + return 0; +} + + + +void BasicIDEShell::ArrangeTabBar() +{ + Size aSz( GetViewFrame()->GetWindow().GetOutputSizePixel() ); + long nBoxPos = aScrollBarBox.GetPosPixel().X() - 1; + long nPos = pTabBar->GetSplitSize(); + if ( nPos <= nBoxPos ) + { + Point aPnt( pTabBar->GetPosPixel() ); + long nH = aHScrollBar.GetSizePixel().Height(); + pTabBar->SetPosSizePixel( aPnt, Size( nPos, nH ) ); + long nScrlStart = aPnt.X() + nPos; + aHScrollBar.SetPosSizePixel( Point( nScrlStart, aPnt.Y() ), Size( nBoxPos - nScrlStart + 2, nH ) ); + aHScrollBar.Update(); + } +} + + + +SfxUndoManager* BasicIDEShell::GetUndoManager() +{ + SfxUndoManager* pMgr = NULL; + if( pCurWin ) + pMgr = pCurWin->GetUndoManager(); + + return pMgr; +} + + + +void BasicIDEShell::ShowObjectDialog( BOOL bShow, BOOL bCreateOrDestroy ) +{ + if ( bShow ) + { + if ( !pObjectCatalog && bCreateOrDestroy ) + { + pObjectCatalog = new ObjectCatalog( &GetViewFrame()->GetWindow() ); + // Position wird in BasicIDEData gemerkt und vom Dlg eingestellt + pObjectCatalog->SetCancelHdl( LINK( this, BasicIDEShell, ObjectDialogCancelHdl ) ); + } + + // Die allerletzten Aenderungen... + if ( pCurWin ) + pCurWin->StoreData(); + + if ( pObjectCatalog ) + { + pObjectCatalog->UpdateEntries(); + pObjectCatalog->Show(); + } + } + else if ( pObjectCatalog ) + { + pObjectCatalog->Hide(); + if ( bCreateOrDestroy ) + { + // Wegen OS/2-Focus-Problem pObjectCatalog vorm delete auf NULL + ObjectCatalog* pTemp = pObjectCatalog; + pObjectCatalog = 0; + delete pTemp; + } + } +} + + + +void __EXPORT BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&, + const SfxHint& rHint, const TypeId& ) +{ + if ( rHint.IsA( TYPE( SfxEventHint ) ) ) + { + if ( ( ((SfxEventHint&)rHint).GetEventId() == SFX_EVENT_CREATEDOC ) || + ( ((SfxEventHint&)rHint).GetEventId() == SFX_EVENT_OPENDOC ) ) + { + UpdateWindows(); + } + } + if ( rHint.IsA( TYPE( SfxSimpleHint ) ) ) + { + if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DOCCHANGED ) + { + // Wird z.Z. nur gerufen bei "Letzte Version" + // Doc bleibt erhalten, BasicManager wird zerstoert. + // Die Fenster wurden durch das BasicManager-Dying zerstoert, + // muessen evtl. wieder angezeigt werden. + UpdateWindows(); + } + else if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_MODECHANGED ) + { + // ReadOnly toggled... + if ( rBC.IsA( TYPE( SfxObjectShell ) ) ) + { + SfxObjectShell* pShell = (SfxObjectShell*)&rBC; + BasicManager* pBasMgr = pShell->GetBasicManager(); + for ( ULONG nWin = aIDEWindowTable.Count(); nWin; ) + { + IDEBaseWindow* pWin = aIDEWindowTable.GetObject( --nWin ); + BasicManager* pM = BasicIDE::FindBasicManager( pWin->GetBasic() ); + if ( pM == pBasMgr ) + pWin->SetReadOnly( pShell->IsReadOnly() ); + } + } + + } + else if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_TITLECHANGED ) + { + BasicIDE::GetBindings().Invalidate( SID_BASICIDE_LIBSELECTOR, TRUE, FALSE ); + SetMDITitle(); + } + else if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING ) + { + // Alle Fenster suchen, die auf einem Basic des Managers arbeiten, + // Daten sichern, Fenster zerstoeren + if ( rBC.IsA( TYPE( BasicManager ) ) ) + { + BOOL bSetCurWindow = FALSE; + BOOL bSetCurBasic = FALSE; + BasicManager* pBasMgr = (BasicManager* )&rBC; + USHORT nLibs = pBasMgr->GetLibCount(); + // Alle Fenster, die ein Object dieser Lib anzeigen, schliessen + for ( USHORT nLib = 0; nLib < nLibs; nLib++ ) + { + StarBASIC* pLib = pBasMgr->GetLib( nLib ); + if ( !pLib ) + continue; + + // Damit wird leider das ganze Basic angehalten, wenn + // ein vom Basic unbeteiligtes Doc geschlossen wird. + // Da das laufende Basic hoffentlich Referenzen auf die + // benoetigten Libs haelt, sollte es auch nicht noetig sein +// if ( pLib->IsRunning() ) +// pLib->Stop(); + for ( ULONG nWin = aIDEWindowTable.Count(); nWin; ) + { + IDEBaseWindow* pWin = aIDEWindowTable.GetObject( --nWin ); + if ( pWin->GetBasic() == pLib ) + { + if ( pWin->GetStatus() & (BASWIN_RUNNINGBASIC|BASWIN_INRESCHEDULE) ) + { + pWin->AddStatus( BASWIN_TOBEKILLED ); + pWin->Hide(); + StarBASIC::Stop(); + // Es kommt kein Notify... + pWin->BasicStopped(); + } + else + { + pWin->StoreData(); + if ( pWin == pCurWin ) + bSetCurWindow = TRUE; + RemoveWindow( pWin, TRUE, FALSE ); + } + } + } + if ( pLib == pCurBasic ) + bSetCurBasic = TRUE; + } + if ( bSetCurBasic ) + SetCurBasic( SFX_APP()->GetBasic(), TRUE ); + else if ( bSetCurWindow ) + { + IDEBaseWindow* pWin = FindWindow( 0 ); + SetCurWindow( pWin, TRUE ); + } + } + else if ( rBC.IsA( TYPE( StarBASIC ) ) ) + { + StarBASIC* pLib = (StarBASIC* )&rBC; + IDE_DLL()->GetExtraData()->GetLibInfos().DestroyInfo( pLib ); + } + EndListening( rBC, TRUE /* Alle abmelden */ ); + } + if ( rHint.IsA( TYPE( SbxHint ) ) ) + { + SbxHint& rSbxHint = (SbxHint&)rHint; + ULONG nHintId = rSbxHint.GetId(); + if ( ( nHintId == SBX_HINT_BASICSTART ) || + ( nHintId == SBX_HINT_BASICSTOP ) ) + { + SfxBindings& rBindings = BasicIDE::GetBindings(); + rBindings.Invalidate( SID_BASICRUN ); + rBindings.Update( SID_BASICRUN ); + rBindings.Invalidate( SID_BASICCOMPILE ); + rBindings.Update( SID_BASICCOMPILE ); + rBindings.Invalidate( SID_BASICSTEPOVER ); + rBindings.Update( SID_BASICSTEPOVER ); + rBindings.Invalidate( SID_BASICSTEPINTO ); + rBindings.Update( SID_BASICSTEPINTO ); + rBindings.Invalidate( SID_BASICSTEPOUT ); + rBindings.Update( SID_BASICSTEPOUT ); + rBindings.Invalidate( SID_BASICSTOP ); + rBindings.Update( SID_BASICSTOP ); + rBindings.Invalidate( SID_BASICIDE_TOGGLEBRKPNT ); + rBindings.Update( SID_BASICIDE_TOGGLEBRKPNT ); + rBindings.Invalidate( SID_BASICIDE_MODULEDLG ); + rBindings.Update( SID_BASICIDE_MODULEDLG ); + rBindings.Invalidate( SID_BASICLOAD ); + rBindings.Update( SID_BASICLOAD ); + + if ( nHintId == SBX_HINT_BASICSTOP ) + { + // Nicht nur bei Error/Break oder explizitem anhalten, + // falls durch einen Programmierfehler das Update abgeschaltet ist. + BasicIDE::BasicStopped(); + UpdateModulWindowLayout(); // Leer machen... + } + + IDEBaseWindow* pWin = aIDEWindowTable.First(); + while ( pWin ) + { + if ( nHintId == SBX_HINT_BASICSTART ) + pWin->BasicStarted(); + else + pWin->BasicStopped(); + pWin = aIDEWindowTable.Next(); + } + } + } + } +} + + + +void BasicIDEShell::CheckWindows() +{ + BOOL bSetCurWindow = FALSE; + for ( ULONG nWin = 0; nWin < aIDEWindowTable.Count(); nWin++ ) + { + IDEBaseWindow* pWin = aIDEWindowTable.GetObject( nWin ); + if ( pWin->GetStatus() & BASWIN_TOBEKILLED ) + { + pWin->StoreData(); + if ( pWin == pCurWin ) + bSetCurWindow = TRUE; + RemoveWindow( pWin, TRUE, FALSE ); + nWin--; + } + } + if ( bSetCurWindow ) + SetCurWindow( FindWindow( 0 ), TRUE ); +} + + + +void BasicIDEShell::RemoveWindows( StarBASIC* pBasic, BOOL bDestroy ) +{ + BOOL bChangeCurWindow = pCurWin ? FALSE : TRUE; + for ( ULONG nWin = 0; nWin < aIDEWindowTable.Count(); nWin++ ) + { + IDEBaseWindow* pWin = aIDEWindowTable.GetObject( nWin ); + if ( pWin->GetBasic() == pBasic ) + { + if ( pWin == pCurWin ) + bChangeCurWindow = TRUE; + pWin->StoreData(); + RemoveWindow( pWin, bDestroy, FALSE ); + nWin--; + } + } + if ( bChangeCurWindow ) + SetCurWindow( FindWindow( 0 ), TRUE ); +} + + + +void BasicIDEShell::UpdateWindows() +{ + // Alle Fenster, die nicht angezeigt werden duerfen, entfernen + BOOL bChangeCurWindow = pCurWin ? FALSE : TRUE; + if ( pCurBasic ) + { + for ( ULONG nWin = 0; nWin < aIDEWindowTable.Count(); nWin++ ) + { + IDEBaseWindow* pWin = aIDEWindowTable.GetObject( nWin ); + if ( pWin->GetBasic() != pCurBasic ) + { + if ( pWin == pCurWin ) + bChangeCurWindow = TRUE; + pWin->StoreData(); + // Die Abfrage auf RUNNING verhindert den Absturz, wenn in Reschedule. + // Fenster bleibt erstmal stehen, spaeter sowieso mal umstellen, + // dass Fenster nur als Hidden markiert werden und nicht + // geloescht. + if ( !(pWin->GetStatus() & ( BASWIN_TOBEKILLED | BASWIN_RUNNINGBASIC | BASWIN_SUSPENDED ) ) ) + { + RemoveWindow( pWin, FALSE, FALSE ); + nWin--; + } + } + } + } + + if ( bCreatingWindow ) + return; + + SbModule* pNextActiveModule = NULL; + + // Alle anzuzeigenden Fenster anzeigen + BasicManager* pBasicMgr = SFX_APP()->GetBasicManager(); + SfxObjectShell* pDocShell = 0; + while ( pBasicMgr ) + { + // Nur, wenn es ein dazugehoeriges Fenster gibt, damit nicht die + // Gecachten Docs, die nicht sichtbar sind ( Remot-Dokumente ) + if ( !pDocShell || ( ( pBasicMgr != SFX_APP()->GetBasicManager() ) + && ( SfxViewFrame::GetFirst( pDocShell ) ) ) ) + { + StartListening( *pBasicMgr, TRUE /* Nur einmal anmelden */ ); + if ( pDocShell ) + StartListening( *pDocShell, TRUE ); + + USHORT nLibs = pBasicMgr->GetLibCount(); + for ( USHORT nLib = 0; nLib < nLibs; nLib++ ) + { + if ( !pBasicMgr->HasPassword( nLib ) || + pBasicMgr->IsPasswordVerified( nLib ) ) + { + StarBASIC* pLib = pBasicMgr->GetLib( nLib ); + if ( pLib && ( !pCurBasic || ( pLib == pCurBasic ) ) ) + { + ImplStartListening( pLib ); + + LibInfo* pLibInf = IDE_DLL()->GetExtraData()->GetLibInfos().GetInfo( pLib ); + + for ( USHORT nMod = 0; nMod < pLib->GetModules()->Count(); nMod++ ) + { + SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod ); + if ( !FindBasWin( pLib, pMod->GetName(), FALSE ) ) + CreateBasWin( pLib, pMod->GetName() ); + if ( pLibInf && !pNextActiveModule && + ( pMod->GetName() == pLibInf->aCurrentModule ) ) + { + pNextActiveModule = pMod; + } + } + + // Und ein BasigDialog-Fenster... + pLib->GetAll( SbxCLASS_OBJECT ); + for ( USHORT nObj = 0; nObj < pLib->GetObjects()->Count(); nObj++ ) + { + SbxVariable* pVar = pLib->GetObjects()->Get( nObj ); + if ( pVar->ISA( SbxObject ) && ( ((SbxObject*)pVar)->GetSbxId() == GetDialogSbxId() ) ) + { + SbxObject* pObj = (SbxObject*)pVar; + if ( !FindDlgWin( pLib, pObj->GetName(), FALSE ) ) + CreateDlgWin( pLib, pObj->GetName(), pObj ); + } + } + } + } + } + } + + if ( pDocShell ) + pDocShell = SfxObjectShell::GetNext( *pDocShell ); + else + pDocShell = SfxObjectShell::GetFirst(); + + pBasicMgr = ( pDocShell ? pDocShell->GetBasicManager() : 0 ); + } + + if ( bChangeCurWindow ) + SetCurWindow( FindWindow( pNextActiveModule ), TRUE ); +} + +void BasicIDEShell::RemoveWindow( IDEBaseWindow* pWindow, BOOL bDestroy, BOOL bAllowChangeCurWindow ) +{ + DBG_ASSERT( pWindow, "Kann keinen NULL-Pointer loeschen!" ); + ULONG nKey = aIDEWindowTable.GetKey( pWindow ); + pTabBar->RemovePage( (USHORT)nKey ); + aIDEWindowTable.Remove( nKey ); + if ( pWindow == pCurWin ) + { + if ( bAllowChangeCurWindow ) + SetCurWindow( FindWindow( 0 ), TRUE ); + else + SetCurWindow( NULL, FALSE ); + } + if ( bDestroy ) + { + if ( !( pWindow->GetStatus() & BASWIN_INRESCHEDULE ) ) + { + delete pWindow; + } + else + { + pWindow->AddStatus( BASWIN_TOBEKILLED ); + pWindow->Hide(); + StarBASIC::Stop(); + // Es kommt kein Notify... + pWindow->BasicStopped(); + aIDEWindowTable.Insert( nKey, pWindow ); // wieder einhaegen + } + } + else + { + pWindow->Hide(); + pWindow->AddStatus( BASWIN_SUSPENDED ); + pWindow->Deactivating(); + aIDEWindowTable.Insert( nKey, pWindow ); // wieder einhaegen + } + +} + + + +USHORT BasicIDEShell::InsertWindowInTable( IDEBaseWindow* pNewWin ) +{ + // Eigentlich prueffen, + nCurKey++; + aIDEWindowTable.Insert( nCurKey, pNewWin ); + return nCurKey; +} + + + +void BasicIDEShell::InvalidateBasicIDESlots() +{ + // Nur die, die eine optische Auswirkung haben... + SfxBindings& rBindings = BasicIDE::GetBindings(); + rBindings.Invalidate( SID_UNDO ); + rBindings.Invalidate( SID_REDO ); + rBindings.Invalidate( SID_SAVEDOC ); + rBindings.Invalidate( SID_BASICIDE_CHOOSEMACRO ); + rBindings.Invalidate( SID_BASICIDE_MODULEDLG ); + rBindings.Invalidate( SID_BASICIDE_OBJCAT ); + rBindings.Invalidate( SID_BASICSTOP ); + rBindings.Invalidate( SID_BASICRUN ); + rBindings.Invalidate( SID_BASICCOMPILE ); + rBindings.Invalidate( SID_BASICLOAD ); + rBindings.Invalidate( SID_BASICSAVEAS ); + rBindings.Invalidate( SID_BASICIDE_MATCHGROUP ); + rBindings.Invalidate( SID_BASICSTEPINTO ); + rBindings.Invalidate( SID_BASICSTEPOVER ); + rBindings.Invalidate( SID_BASICSTEPOUT ); + rBindings.Invalidate( SID_BASICIDE_TOGGLEBRKPNT ); + rBindings.Invalidate( SID_BASICIDE_ADDWATCH ); + rBindings.Invalidate( SID_BASICIDE_REMOVEWATCH ); + rBindings.Invalidate( SID_CHOOSE_CONTROLS ); + rBindings.Invalidate( SID_PRINTDOC ); + rBindings.Invalidate( SID_PRINTDOCDIRECT ); + rBindings.Invalidate( SID_SETUPPRINTER ); + rBindings.Invalidate( SID_DIALOG_TESTMODE ); + + rBindings.Invalidate( SID_DOC_MODIFIED ); + rBindings.Invalidate( SID_BASICIDE_STAT_TITLE ); + rBindings.Invalidate( SID_BASICIDE_STAT_POS ); + rBindings.Invalidate( SID_ATTR_INSERT ); + rBindings.Invalidate( SID_ATTR_SIZE ); +} + +void BasicIDEShell::EnableScrollbars( BOOL bEnable ) +{ + if ( bEnable ) + { + aHScrollBar.Enable(); + aVScrollBar.Enable(); + } + else + { + aHScrollBar.Disable(); + aVScrollBar.Disable(); + } +} + +void BasicIDEShell::SetCurBasic( StarBASIC* pBasic, BOOL bUpdateWindows ) +{ + pCurBasic = pBasic; + if ( bUpdateWindows ) + UpdateWindows(); + + pTabBar->SetCurrentLib( pBasic ); + + BasicIDE::GetBindings().Invalidate( SID_BASICIDE_LIBSELECTOR ); +} + +void BasicIDEShell::ImplStartListening( StarBASIC* pBasic ) +{ + StartListening( pBasic->GetBroadcaster(), TRUE /* Nur einmal anmelden */ ); +} + + diff --git a/basctl/source/basicide/basidesh.src b/basctl/source/basicide/basidesh.src new file mode 100644 index 000000000..3b0b86893 --- /dev/null +++ b/basctl/source/basicide/basidesh.src @@ -0,0 +1,2646 @@ +/************************************************************************* + * + * $RCSfile: basidesh.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <baside2.hrc> +#include <helpid.hrc> +String RID_STR_IDENAME +{ + Text = "BasicIDE" ; +}; +String RID_STR_FILTER_ALLFILES +{ + TEXT = "<Alle>" ; + TEXT [ ENGLISH ] = "<All>" ; + TEXT [ norwegian ] = "<Alle>" ; + TEXT [ italian ] = "<tutto>" ; + TEXT [ portuguese_brazilian ] = "<Tudo>" ; + TEXT [ portuguese ] = "<Todos>" ; + TEXT [ finnish ] = "<All>" ; + TEXT [ danish ] = "<Alle>" ; + TEXT [ french ] = "<Tous>" ; + TEXT [ swedish ] = "<Alla>" ; + TEXT [ dutch ] = "<Alles>" ; + TEXT [ spanish ] = "<Todos>" ; + TEXT [ english_us ] = "<All>" ; + TEXT[ chinese_simplified ] = "<ȫ>"; + TEXT[ russian ] = "<>"; + TEXT[ polish ] = "<Wszystkie>"; + TEXT[ japanese ] = "<ׂ>"; + TEXT[ chinese_traditional ] = "<>"; + TEXT[ arabic ] = "<>"; + TEXT[ dutch ] = "<Alles>"; + TEXT[ chinese_simplified ] = "<ȫ>"; + TEXT[ greek ] = "<>"; + TEXT[ korean ] = "<ü>"; + TEXT[ turkish ] = "<Tm>"; +}; +String RID_STR_NOMODULE +{ + Text = "< Kein Modul >" ; + Text [ English ] = "< No module >" ; + Text [ english_us ] = "< No module >" ; + Text [ portuguese_brazilian ] = "< Kein Modul >" ; + Text [ swedish ] = "< Ingen Modul >" ; + Text [ danish ] = "< Intet modul >" ; + Text [ italian ] = "<nessun modulo >" ; + Text [ spanish ] = "< ningn mdulo >" ; + Text [ french ] = "< Aucun module >" ; + Text [ dutch ] = "< Geen module >" ; + Text [ portuguese ] = "< Nenhum mdulo >" ; + Text[ chinese_simplified ] = "< ģ >"; + Text[ russian ] = "< >"; + Text[ polish ] = "< Bez moduu >"; + Text[ japanese ] = "<ӼޭقȂ>"; + Text[ chinese_traditional ] = "< LҶ >"; + Text[ arabic ] = "< >"; + Text[ dutch ] = "< Geen module >"; + Text[ chinese_simplified ] = "< ģ >"; + Text[ greek ] = "< >"; + Text[ korean ] = "< >"; + Text[ turkish ] = "< Modl yok >"; +}; +String RID_STR_WRONGPASSWORD +{ + /* ### ACHTUNG: Neuer Text in Resource? Fehlerhaftes Pawort. : Fehlerhaftes Pawort. */ + Text = "Fehlerhaftes Passwort." ; + Text [ English ] = "Password doesn't match." ; + Text [ norwegian ] = "Passord passer ikke." ; + Text [ italian ] = "La password non corrisponde." ; + Text [ portuguese_brazilian ] = "A senha no combina." ; + Text [ portuguese ] = "Senha incorrecta." ; + Text [ finnish ] = "Salasana ei kelpaa." ; + Text [ danish ] = "Forkert adgangskode." ; + Text [ french ] = "Mot de passe incorrect." ; + Text [ swedish ] = "Felaktigt lsenord." ; + Text [ dutch ] = "Wachtwoord is niet correct." ; + Text [ spanish ] = "Contrasea errnea." ; + Text [ english_us ] = "Incorrect Password." ; + Text[ chinese_simplified ] = "Ч"; + Text[ russian ] = " ."; + Text[ polish ] = "Nieprawidowe haso."; + Text[ japanese ] = "Ȃ߽ܰށB"; + Text[ chinese_traditional ] = "KXLġC"; + Text[ arabic ] = " ."; + Text[ dutch ] = "Wachtwoord is niet correct."; + Text[ chinese_simplified ] = "Ч"; + Text[ greek ] = " ."; + Text[ korean ] = "ȣ Ʋϴ."; + Text[ turkish ] = "Yanl ifre"; +}; +String RID_STR_OPEN +{ + Text = "Laden" ; + Text [ ENGLISH ] = "Load" ; + Text [ norwegian ] = "Load" ; + Text [ italian ] = "Carica" ; + Text [ portuguese_brazilian ] = "Carregar" ; + Text [ portuguese ] = "Carregar" ; + Text [ finnish ] = "Lataa" ; + Text [ danish ] = "Indls" ; + Text [ french ] = "Charger" ; + Text [ swedish ] = "Ladda" ; + Text [ dutch ] = "Laden" ; + Text [ spanish ] = "Cargar" ; + Text [ english_us ] = "Load" ; + Text[ chinese_simplified ] = "װ"; + Text[ russian ] = ""; + Text[ polish ] = "Zaaduj"; + Text[ japanese ] = "ǂݍ"; + Text[ chinese_traditional ] = "˸"; + Text[ arabic ] = ""; + Text[ dutch ] = "Laden"; + Text[ chinese_simplified ] = "װ"; + Text[ greek ] = ""; + Text[ korean ] = "ε"; + Text[ turkish ] = "Ykle"; +}; +String RID_STR_SAVE +{ + Text = "Speichern" ; + Text [ ENGLISH ] = "Save" ; + Text [ norwegian ] = "Save" ; + Text [ italian ] = "Salva" ; + Text [ portuguese_brazilian ] = "Gravar" ; + Text [ portuguese ] = "Guardar" ; + Text [ finnish ] = "Tallennus" ; + Text [ danish ] = "Gem" ; + Text [ french ] = "Enregistrer" ; + Text [ swedish ] = "Spara" ; + Text [ dutch ] = "Opslaan" ; + Text [ spanish ] = "Guardar" ; + Text [ english_us ] = "Save" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Zapisz"; + Text[ japanese ] = "ۑ"; + Text[ chinese_traditional ] = "xsɮ"; + Text[ arabic ] = ""; + Text[ dutch ] = "Opslaan"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Kaydet"; +}; +String RID_STR_SOURCETOBIG +{ + /* ### ACHTUNG: Neuer Text in Resource? Der Quelltext ist zu gro und kann weder gespeichert noch compiliert werden.\nLschen Sie einige Kommentare oder bertragen Sie einige Methoden in ein anderes Modul. : Der Quelltext ist zu gro und kann weder gespeichert noch compiliert werden.\nLschen Sie einige Kommentare oder bertragen Sie einige Methoden in ein anderes Modul. */ + Text = "Der Quelltext ist zu gro und kann weder gespeichert noch compiliert werden.\nLschen Sie einige Kommentare oder bertragen Sie einige Methoden in ein anderes Modul." ; + Text [ English ] = "The source is to big and cannot be compiled or stored.\nDelete some comments or move some methods to an other module" ; + Text [ english_us ] = "The source text is too large and can be neither compiled nor saved.\nDelete some of the comments or transfer some methods into another module." ; + Text [ swedish ] = "Klltexten r fr stor och kan varken sparas eller kompileras.\nRadera ngra kommentarer eller verfr ngra metoder till en annan modul." ; + Text [ danish ] = "Kildeteksten er for stor og kan hverken gemmes eller kompileres.\nSlet nogle kommentarer eller overfr nogle metoder til et andet modul." ; + Text [ italian ] = "Il testo sorgente troppo grande e non pu essere n compilato n salvato\nCancellare alcuni commenti o trasferire alcuni metodi in un altro modulo." ; + Text [ spanish ] = "El texto fuente es demasiado grande por lo que no se puede guardar o compilar.\nElimine algunos comentarios o transfiera algunos mtodos a otro mdulo." ; + Text [ french ] = "Le texte source a trop de volume et ne peut ni tre sauvegard ni tre compil.\nVeuillez supprimer quelque commentaires ou transfrer quelques mthodes dans un autre module." ; + Text [ dutch ] = "De brontekst is te lang en kan niet opgeslagen of gecompileerd worden.\\Wis enkele commentaren of verplaats enkele methodes naar een andere module." ; + Text [ portuguese_brazilian ] = "Der Quelltext ist zu gro und kann weder gespeichert noch compiliert werden.\nLschen Sie einige Kommentare oder bertragen Sie einige Methoden in ein anderes Modul." ; + Text [ portuguese ] = "O texto-fonte demasiado longo e no pode ser guardado nem compilado.\nElimine alguns comentrios ou transfira alguns mtodos para outro mdulo." ; + Text[ chinese_simplified ] = "Դı̫̺ͱ롣\nɾһЩע߽תƵһģ֮С"; + Text[ russian ] = " , .\n ."; + Text[ polish ] = "Tekst rdowy jest za duy i nie moe zosta zapisany ani skompilowany.\nUsu kilka komentarzy lub przenie kilka metod do innego moduu."; + Text[ japanese ] = "̂ŕۑ邱Ƃ߲ق邱Ƃł܂B\n̺č폜邩̕@𑼂Ӽޭقɓ]ĉB"; + Text[ chinese_traditional ] = "lɤӤjMLkxssĶC\nбzR@Ǫ`ѩΪ̱NXӤkಾ@ӨLҶC"; + Text[ arabic ] = " .\n ʡ ."; + Text[ dutch ] = "De brontekst is te lang en kan niet opgeslagen of gecompileerd worden.\\Wis enkele commentaren of verplaats enkele methodes naar een andere module."; + Text[ chinese_simplified ] = "Դı̫̺ͱ롣\nɾһЩע߽תƵһģ֮С"; + Text[ greek ] = " \n . ."; + Text[ korean ] = "ҽ ؽƮ ʹ Ŀ 嵵 ϵ Ұմϴ. \n ϰų 带 ٸ űʽÿ."; + Text[ turkish ] = "Kaynak metin uzunluu nedeniyle kaydedilemiyor ve derlenemiyor.\nBaz aklamalar silin ya da baz yntemleri baka bir modle aktarn."; +}; +String RID_STR_ERROROPENSTORAGE +{ + /* ### ACHTUNG: Neuer Text in Resource? Fehler beim ffnen der Datei : Fehler beim ffnen der Datei */ + Text = "Fehler beim ffnen der Datei" ; + Text [ English ] = "Error open file" ; + Text [ english_us ] = "Error opening file" ; + Text [ italian ] = "Errore nell'apertura del file" ; + Text [ spanish ] = "Error al abrir el archivo" ; + Text [ french ] = "Erreur lors de l'ouverture du fichier" ; + Text [ dutch ] = "Fout bij het openen van het bestand." ; + Text [ swedish ] = "Fel vid ppnande av fil" ; + Text [ danish ] = "Fejl ved bning af fil" ; + Text [ portuguese_brazilian ] = "Fehler beim ffnen der Datei" ; + Text [ portuguese ] = "Erro ao abrir o ficheiro." ; + Text[ chinese_simplified ] = "ļʱ"; + Text[ russian ] = " "; + Text[ polish ] = "Bd przy otwieraniu pliku"; + Text[ japanese ] = "̧قJۂɴװ܂B"; + Text[ chinese_traditional ] = "}ɮɵoͿ~C"; + Text[ arabic ] = " "; + Text[ dutch ] = "Fout bij het openen van het bestand."; + Text[ chinese_simplified ] = "ļʱ"; + Text[ greek ] = " "; + Text[ korean ] = " "; + Text[ turkish ] = "Dosyay ama srasnda hata"; +}; +String RID_STR_ERROROPENLIB +{ + Text = "Fehler beim Laden der Bibliothek" ; + Text [ English ] = "Fehler beim Laden der Bibliothek" ; + Text [ english_us ] = "Error loading library" ; + Text [ portuguese_brazilian ] = "Fehler beim Laden der Bibliothek" ; + Text [ swedish ] = "Fel vid laddning av bibliotek" ; + Text [ danish ] = "Fejl under indlsning af biblioteket" ; + Text [ italian ] = "Errore nel caricare la library" ; + Text [ spanish ] = "Error al cargar la biblioteca" ; + Text [ french ] = "Erreur lors du chargem. de bibliothque." ; + Text [ dutch ] = "Fout bij het laden van de bibliotheek" ; + Text [ portuguese ] = "Erro ao carregar a biblioteca." ; + Text[ chinese_simplified ] = "װؿʱ"; + Text[ russian ] = " "; + Text[ polish ] = "Bd przy adowaniu biblioteki"; + Text[ japanese ] = "ײ̓ǂݍݒɴװ܂B"; + Text[ chinese_traditional ] = "b˸{wɵoͿ~C"; + Text[ arabic ] = " "; + Text[ dutch ] = "Fout bij het laden van de bibliotheek"; + Text[ chinese_simplified ] = "װؿʱ"; + Text[ greek ] = " "; + Text[ korean ] = "̺귯 ε忡 "; + Text[ turkish ] = "Kitapl ykleme srasnda hata"; +}; +String RID_STR_NOLIBINSTORAGE +{ + /* ### ACHTUNG: Neuer Text in Resource? Die Datei enthlt keine BASIC-Bibliotheken : Die Datei enthlt keine BASIC-Bibliotheken */ + Text = "Die Datei enthlt keine BASIC-Bibliotheken" ; + Text [ English ] = "The document doesn't contain any BASIC libaries" ; + Text [ english_us ] = "The file doesn't contain any BASIC libraries" ; + Text [ italian ] = "Il file non contiene biblioteche Basic" ; + Text [ spanish ] = "El archivo no contiene bibliotecas BASIC" ; + Text [ french ] = "Le fichier ne contient pas de bibliothque BASIC" ; + Text [ dutch ] = "Het bestand bevat geen BASIC-bibliotheken" ; + Text [ swedish ] = "Filen innehller inga BASIC-bibliotek" ; + Text [ danish ] = "Filen indeholder ingen BASIC-biblioteker" ; + Text [ portuguese_brazilian ] = "Die Datei enthlt keine Basic-Bibliotheken" ; + Text [ portuguese ] = "O ficheiro no contm bibliotecas BASIC." ; + Text[ chinese_simplified ] = "ļû BASIC-⡣"; + Text[ russian ] = " BASIC"; + Text[ polish ] = "Plik nie zawiera bibliotek BASIC"; + Text[ japanese ] = "̧ق̒BASICײ͂܂B"; + Text[ chinese_traditional ] = "oɮרS BASIC-{wC"; + Text[ arabic ] = ".BASIC "; + Text[ dutch ] = "Het bestand bevat geen BASIC-bibliotheken"; + Text[ chinese_simplified ] = "ļû BASIC-⡣"; + Text[ greek ] = " BASIC"; + Text[ korean ] = " ƹ BASIC ̺귯 ϰ ʽϴ"; + Text[ turkish ] = "Dosya BASIC kitaplklar iermiyor"; +}; +String RID_STR_BADSBXNAME +{ + /* ### ACHTUNG: Neuer Text in Resource? Ungltiger Bezeichner : Ungltiger Bezeichner */ + Text = "Ungltiger Bezeichner" ; + Text [ English ] = "Invalid Name" ; + Text [ norwegian ] = "Invalid Name" ; + Text [ italian ] = "Nome non valido" ; + Text [ portuguese_brazilian ] = "Invalid Name" ; + Text [ portuguese ] = "Nome incorrecto" ; + Text [ french ] = "Nom incorrect" ; + Text [ dutch ] = "Ongeldige aanduiding" ; + Text [ spanish ] = "Nombre no vlido" ; + Text [ danish ] = "Ugyldigt navn" ; + Text [ swedish ] = "Ogiltigt namn" ; + Text [ finnish ] = "Invalid Name" ; + Text [ english_us ] = "Invalid Name" ; + Text[ chinese_simplified ] = "Ч"; + Text[ russian ] = " "; + Text[ polish ] = "Nieprawidowa nazwa"; + Text[ japanese ] = "OsKł"; + Text[ chinese_traditional ] = "WٵL"; + Text[ arabic ] = " "; + Text[ dutch ] = "Ongeldige aanduiding"; + Text[ chinese_simplified ] = "Ч"; + Text[ greek ] = " "; + Text[ korean ] = "ȿ ̸"; + Text[ turkish ] = "Geersiz ad"; +}; +String RID_STR_LIBNAMETOLONG +{ + Text = "Der Name einer Bibliothek darf maximal 30 Zeichen lang sein."; + Text [ English ] = "The name of a library can only be 30 characters long." ; + Text[ english_us ] = "A library name cannot be longer than 30 characters."; + Text[ portuguese ] = "O nome da biblioteca s pode ter o mximo de 30 caracteres."; + Text[ russian ] = " 30 ."; + Text[ greek ] = " 30 ."; + Text[ dutch ] = "De naam van een bibliotheek mag maximaal 30 tekens lang zijn."; + Text[ french ] = "Le nom d'une bibliothque peut contenir au maximum 30 caractres."; + Text[ spanish ] = "El nombre de la biblioteca no debe contener ms de 30 caracteres."; + Text[ italian ] = "Il nome della libreria pu avere una lunghezza massima di 30 caratteri."; + Text[ danish ] = "Et biblioteks navn m hjst indeholde 30 tegn."; + Text[ swedish ] = "Namnet p ett bibliotek fr maximalt innehlla 30 tecken."; + Text[ polish ] = "Nazwa biblioteki moe si skada z maksymalnie 30 znakw."; + Text[ portuguese_brazilian ] = "The name of a library can only be 30 characters long."; + Text[ japanese ] = "ײ͍ؖō30܂łłB"; + Text[ korean ] = "̺귯 ̸ ̴ 30ڸ ʰ ϴ."; + Text[ chinese_simplified ] = "ֻ30ַɡ"; + Text[ chinese_traditional ] = "{wWٳ̪oWL30ӦrC"; + Text[ arabic ] = " 30 ."; + Text[ turkish ] = "Kitaplk ad en fazla 30 karakter uzunluunda olmal."; +}; +String RID_STR_SBXNAMEALLREADYUSED +{ + Text = "Name bereits vergeben" ; + Text [ English ] = "Name allready used" ; + Text [ norwegian ] = "Name allready used" ; + Text [ italian ] = "Nome gi in uso" ; + Text [ portuguese_brazilian ] = "Name allready used" ; + Text [ portuguese ] = "Nome j existe." ; + Text [ french ] = "Ce nom existe dj" ; + Text [ dutch ] = "Naam bestaat reeds" ; + Text [ spanish ] = "El nombre ya existe" ; + Text [ danish ] = "Dette navn findes allerede" ; + Text [ swedish ] = "Namnet finns redan" ; + Text [ finnish ] = "Name allready used" ; + Text [ english_us ] = "Name already exists" ; + Text[ chinese_simplified ] = "Ѿˡ"; + Text[ russian ] = " "; + Text[ polish ] = "Nazwa ju istnieje"; + Text[ japanese ] = "̖O͂łɎgĂ܂B"; + Text[ chinese_traditional ] = "W٤wgQFC"; + Text[ arabic ] = " "; + Text[ dutch ] = "Naam bestaat reeds"; + Text[ chinese_simplified ] = "Ѿˡ"; + Text[ greek ] = " "; + Text[ korean ] = "̸ ̹ "; + Text[ turkish ] = "Bu ad mevcut durumda"; +}; +String RID_STR_SBXNAMEALLREADYUSED2 +{ + Text = "Objekt mit dem Namen existiert schon" ; + Text [ English ] = "Object with same name allready exists" ; + Text [ norwegian ] = "Object with same name allready exist" ; + Text [ italian ] = "Esiste gi un oggetto con lo stesso nome" ; + Text [ portuguese_brazilian ] = "Object with same name allready exist" ; + Text [ portuguese ] = "J existe objecto com o mesmo nome." ; + Text [ french ] = "Un objet ayant le mme nom existe dj" ; + Text [ dutch ] = "Er bestaat reeds een object met deze naam." ; + Text [ spanish ] = "Ya existe un objeto con el mismo nombre" ; + Text [ danish ] = "Der findes allerede et objekt med dette navn" ; + Text [ swedish ] = "Objekt med detta namn existerar redan" ; + Text [ finnish ] = "Object with same name allready exist" ; + Text [ english_us ] = "Object with same name already exists" ; + Text[ chinese_simplified ] = "Ѿڡ"; + Text[ russian ] = " "; + Text[ polish ] = "Obiekt z t nazw ju istnieje"; + Text[ japanese ] = "̵ުĂłɂ܂B"; + Text[ chinese_traditional ] = "wgsbC"; + Text[ arabic ] = " "; + Text[ dutch ] = "Er bestaat reeds een object met deze naam."; + Text[ chinese_simplified ] = "Ѿڡ"; + Text[ greek ] = " "; + Text[ korean ] = " ̸ ü ̹ "; + Text[ turkish ] = "Bu ad tayan bir nesne mevcut"; +}; +String RID_STR_FILEEXISTS +{ + /* ### ACHTUNG: Neuer Text in Resource? Die Datei 'XX' existiert schon : Die Datei ''XX'' existiert schon */ + Text = "Die Datei 'XX' existiert schon" ; + Text [ English ] = "The file 'XX' allready exists" ; + Text [ english_us ] = "The file 'XX' already exists" ; + Text [ portuguese_brazilian ] = "Die Datei ''XX'' existiert schon" ; + Text [ swedish ] = "Filen 'XX' existerar redan" ; + Text [ danish ] = "Filen ''XX'' eksisterer allerede" ; + Text [ italian ] = "Il file 'XX' esiste gi" ; + Text [ spanish ] = "El archivo 'XX' ya existe" ; + Text [ french ] = "Le fichier 'XX' existe dj." ; + Text [ dutch ] = "Bestand ''XX' bestaat reeds" ; + Text [ portuguese ] = "O ficheiro ''XX'' j existe." ; + Text[ chinese_simplified ] = "ļ 'XX' Ѿڡ"; + Text[ russian ] = " 'XX' "; + Text[ polish ] = "Plik 'XX' ju istnieje"; + Text[ japanese ] = "̧'XX'͂łɑ݂Ă܂B"; + Text[ chinese_traditional ] = "ɮ 'XX' wgsbC"; + Text[ arabic ] = " 'XX' "; + Text[ dutch ] = "Bestand ''XX' bestaat reeds"; + Text[ chinese_simplified ] = "ļ 'XX' Ѿڡ"; + Text[ greek ] = " 'XX' "; + Text[ korean ] = "'XX' ̹ մϴ"; + Text[ turkish ] = "Dosya 'XX' mevcut durumda"; +}; +String RID_STR_COMPILEERROR +{ + /* ### ACHTUNG: Neuer Text in Resource? bersetzungs-Fehler: : bersetzungs-Fehler: */ + Text = "bersetzungs-Fehler: " ; + Text [ ENGLISH ] = "Compile-Error: " ; + Text [ norwegian ] = "Compile-Error: " ; + Text [ italian ] = "Errore di compilazione: " ; + Text [ portuguese_brazilian ] = "Erro-Compilao: " ; + Text [ portuguese ] = "Erro de compilao: " ; + Text [ finnish ] = "Knnsaikanen virhe: " ; + Text [ danish ] = "Kompileringsfejl:" ; + Text [ french ] = "Erreur de compilation : " ; + Text [ swedish ] = "Kompileringsfel: " ; + Text [ dutch ] = "Vertaalfout: " ; + Text [ spanish ] = "Error de compilacin: " ; + Text [ english_us ] = "Compile Error: " ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = " : "; + Text[ polish ] = "Bd kompilacji: "; + Text[ japanese ] = "߲ٴװ: "; + Text[ chinese_traditional ] = "sĶ~:"; + Text[ arabic ] = ": "; + Text[ dutch ] = "Vertaalfout: "; + Text[ chinese_simplified ] = ""; + Text[ greek ] = " : "; + Text[ korean ] = " : "; + Text[ turkish ] = "Derleme hatas "; +}; +String RID_STR_RUNTIMEERROR +{ + Text = "Laufzeit-Fehler: #" ; + Text [ ENGLISH ] = "Runtime-Error: #" ; + Text [ norwegian ] = "Runtime-Error: #" ; + Text [ italian ] = "Errore di Runtime: #" ; + Text [ portuguese_brazilian ] = "Erro-Execuo: #" ; + Text [ portuguese ] = "Erro de execuo: #" ; + Text [ finnish ] = "Ajonaikainen virhe: #" ; + Text [ danish ] = "Runtimefejl: #" ; + Text [ french ] = "Runtime error : #" ; + Text [ swedish ] = "Runtime error: #" ; + Text [ dutch ] = "Uitvoeringsfout: #" ; + Text [ spanish ] = "Error en tiempo de ejecucin: #" ; + Text [ english_us ] = "Runtime Error: #" ; + Text[ chinese_simplified ] = "ʱ-: #"; + Text[ russian ] = " : #"; + Text[ polish ] = "Bd czasu przebiegu: #"; + Text[ japanese ] = " װ: #"; + Text[ chinese_traditional ] = "Bɶ-~: #"; + Text[ arabic ] = "# : "; + Text[ dutch ] = "Uitvoeringsfout: #"; + Text[ chinese_simplified ] = "ʱ-: #"; + Text[ greek ] = " : #"; + Text[ korean ] = "ð . #"; + Text[ turkish ] = "Yrtm sresi hatas: #"; +}; +String RID_STR_SEARCHNOTFOUND +{ + Text = "Suchbegriff nicht gefunden" ; + Text [ ENGLISH ] = "Search pattern not found" ; + Text [ norwegian ] = "Search pattern not found" ; + Text [ italian ] = "Termine non trovato" ; + Text [ portuguese_brazilian ] = "Search pattern not found" ; + Text [ portuguese ] = "Impossvel encontrar expresso procurada." ; + Text [ finnish ] = "Hakumallia ei lydy" ; + Text [ danish ] = "Sgningen gav intet resultat" ; + Text [ french ] = "lment recherch introuvable" ; + Text [ swedish ] = "Skord hittades inte" ; + Text [ dutch ] = "Het gezochte item is niet gevonden" ; + Text [ spanish ] = "No se encontr la expresin buscada" ; + Text [ english_us ] = "Search key not found" ; + Text[ chinese_simplified ] = "ûҵҪѰ"; + Text[ russian ] = " "; + Text[ polish ] = "Szukane haso nie zostao znalezione"; + Text[ japanese ] = "ڂ܂"; + Text[ chinese_traditional ] = "SnM䪺e"; + Text[ arabic ] = " ."; + Text[ dutch ] = "Het gezochte item is niet gevonden"; + Text[ chinese_simplified ] = "ûҵҪѰ"; + Text[ greek ] = " "; + Text[ korean ] = "˻ ã "; + Text[ turkish ] = "Aranan terim bulunamad"; +}; +String RID_STR_SEARCHFROMSTART +{ + /* ### ACHTUNG: Neuer Text in Resource? Es wurde bis zum letzten Modul gesucht. Mchten Sie die Suche beim ersten Modul fortsetzen? : Es wurde bis zum letzten Modul gesucht. Mchten Sie die Suche beim ersten Modul fortsetzen? */ + Text = "Es wurde bis zum letzten Modul gesucht. Mchten Sie die Suche beim ersten Modul fortsetzen?" ; + Text [ ENGLISH ] = "Es wurde bis zum letzten Modul gesucht. Mchten Sie die Suche beim ersten Modul fortsetzen?" ; + Text [ english_us ] = "Search to last module complete. Continue at first module?" ; + Text [ italian ] = "La ricerca giunta alla fine dell'ultimo modulo. Continuare con il primo modulo?" ; + Text [ spanish ] = "Se busc hasta el ltimo mdulo. Desea continuar la bsqueda en el primer mdulo?" ; + Text [ french ] = "La recherche a t poursuivie jusqu'au dernier module. Dsirez-vous continuer la recherche avec le premier module ?" ; + Text [ dutch ] = "Er werd tot aan de laatste module gezocht. Wilt u doorgaan?" ; + Text [ swedish ] = "Skning genomfrd till sista modulen. Skall skningen fortstta i frsta modulen?" ; + Text [ danish ] = "Der blev sgt til sidste modul. Vil du fortstte sgningen ved frste modul?" ; + Text [ portuguese_brazilian ] = "Es wurde bis zum letzten Modul gesucht. Mchten Sie die Suche beim ersten Modul fortsetzen?" ; + Text [ portuguese ] = "Procura at ao ltimo mdulo. Deseja continuar a procura a partir do primeiro mdulo?" ; + Text[ chinese_simplified ] = "ѾѰһģ顣Ҫӵһģ鿪ʼѰ"; + Text[ russian ] = " . ?"; + Text[ polish ] = "Przeszukane do ostatniego moduu. Czy chcesz kontynuowa wyszukiwanie przy pierwszym module?"; + Text[ japanese ] = "ŌӼޭق܂Ō܂B߂Ӽޭقɖ߂Č𑱂܂B"; + Text[ chinese_traditional ] = "wgM̫ܳ@ӼҶCznqĤ@ӼҶ}lMS"; + Text[ arabic ] = " . ."; + Text[ dutch ] = "Er werd tot aan de laatste module gezocht. Wilt u doorgaan?"; + Text[ chinese_simplified ] = "ѾѰһģ顣Ҫӵһģ鿪ʼѰ"; + Text[ greek ] = " . ;"; + Text[ korean ] = " ãҽϴ. ó ã⸦ Ͻðڽϱ?"; + Text[ turkish ] = "Son modle kadar arama tamamland? Aramaya ilk modlden devam etmek istiyor musunuz?"; +}; +String RID_STR_SEARCHREPLACES +{ + Text = "Suchbegriff XXmal ersetzt" ; + Text [ ENGLISH ] = "Search pattern replaced XX times" ; + Text [ norwegian ] = "Search pattern replaced XX times" ; + Text [ italian ] = "Termine sostituito XX volte" ; + Text [ portuguese_brazilian ] = "Search pattern replaced XX times" ; + Text [ portuguese ] = "Expresso procurada substituda XX vezes" ; + Text [ finnish ] = "Hakumalli on korvattu XX kertaa" ; + Text [ danish ] = "Sgeord erstattet XX gange" ; + Text [ french ] = "L'lment recherch a t remplac XX fois" ; + Text [ swedish ] = "Skord ersatt XX gnger" ; + Text [ dutch ] = "Het gezochte item is XX keer vervangen" ; + Text [ spanish ] = "Expresin buscada reemplazada XX veces" ; + Text [ english_us ] = "Search key replaced XX times" ; + Text[ chinese_simplified ] = "Ѱ XX "; + Text[ russian ] = " XX"; + Text[ polish ] = "Szukane haso zastpiono XXrazy"; + Text[ japanese ] = "ڂXXxu܂"; + Text[ chinese_traditional ] = "NM䤺e XX "; + Text[ arabic ] = " "; + Text[ dutch ] = "Het gezochte item is XX keer vervangen"; + Text[ chinese_simplified ] = "Ѱ XX "; + Text[ greek ] = " XX "; + Text[ korean ] = "˻ XX ٲ"; + Text[ turkish ] = "Aranan terim XX kez deitirildi"; +}; +String RID_STR_COULDNTREAD +{ + Text = "Die Datei konnte nicht gelesen werden" ; + Text [ ENGLISH ] = "The document cannot be red" ; + Text [ dutch ] = "Het bestand kon niet worden gelezen." ; + Text [ english_us ] = "The file could not be read" ; + Text [ italian ] = "Non stato possibile leggere il file" ; + Text [ spanish ] = "No se pudo leer el archivo" ; + Text [ french ] = "Impossible de lire le fichier" ; + Text [ swedish ] = "Filen kunde inte lsas" ; + Text [ danish ] = "Det var ikke muligt at lse filen" ; + Text [ portuguese_brazilian ] = "Die Datei konnte nicht gelesen werden" ; + Text [ portuguese ] = "Foi impossvel ler o ficheiro." ; + Text[ chinese_simplified ] = "ȡļ"; + Text[ russian ] = " "; + Text[ polish ] = "Pliku nie mona byo odczyta"; + Text[ japanese ] = "̧قǂݎ܂B"; + Text[ chinese_traditional ] = "LkŪɮסC"; + Text[ arabic ] = " "; + Text[ dutch ] = "Het bestand kon niet worden gelezen."; + Text[ chinese_simplified ] = "ȡļ"; + Text[ greek ] = " "; + Text[ korean ] = " ߽ϴ"; + Text[ turkish ] = "Dosya okunamad"; +}; +String RID_STR_COULDNTWRITE +{ + Text = "Die Datei konnte nicht gespeichert werden" ; + Text [ ENGLISH ] = "The document cannot be written" ; + Text [ english_us ] = "The file could not be saved" ; + Text [ italian ] = "Non stato possibile salvare il file" ; + Text [ spanish ] = "No se pudo guardar el archivo" ; + Text [ french ] = "Impossible de sauvegarder le fichier" ; + Text [ dutch ] = "Het bestand kon niet worden opgeslagen." ; + Text [ swedish ] = "Filen kunde inte sparas" ; + Text [ danish ] = "Det var ikke muligt at gemme filen" ; + Text [ portuguese_brazilian ] = "Die Datei konnte nicht gespeichert werden" ; + Text [ portuguese ] = "Foi impossvel guardar o ficheiro." ; + Text[ chinese_simplified ] = "ļ"; + Text[ russian ] = " "; + Text[ polish ] = "Pliku nie mona byo zapisa"; + Text[ japanese ] = "̧قۑł܂B"; + Text[ chinese_traditional ] = "LkxsɮסC"; + Text[ arabic ] = " "; + Text[ dutch ] = "Het bestand kon niet worden opgeslagen."; + Text[ chinese_simplified ] = "ļ"; + Text[ greek ] = " "; + Text[ korean ] = " ߽ϴ"; + Text[ turkish ] = "Dosya kaydedilemedi"; +}; +String RID_STR_CANNOTCHANGENAMESTDLIB +{ + /* ### ACHTUNG: Neuer Text in Resource? Der Name der Standard-Bibliothek kann nicht gendert werden : Der Name der Standard-Bibliothek kann nicht gendert werden */ + Text = "Der Name der Standard-Bibliothek kann nicht gendert werden" ; + Text [ ENGLISH ] = "Cannot change name from standard libary" ; + Text [ dutch ] = "De naam van de standaardbibliotheek kan niet veranderd worden." ; + Text [ english_us ] = "The name of a standard library cannot be changed." ; + Text [ italian ] = "Il nome della library standard non pu essere modificato" ; + Text [ spanish ] = "No se puede modificar el nombre de la biblioteca estndar" ; + Text [ french ] = "Impossible de modifier le nom de la bibliothque par dfaut." ; + Text [ swedish ] = "Standardbibliotekets namn kan inte ndras" ; + Text [ danish ] = "Standardmappens navn kan ikke ndres" ; + Text [ portuguese_brazilian ] = "Der Name der Standard-Bibliothek kann nicht gendert werden" ; + Text [ portuguese ] = "O nome da biblioteca-padro no pode ser alterado." ; + Text[ chinese_simplified ] = "ı-ơ"; + Text[ russian ] = " "; + Text[ polish ] = "Nazwa biblioteki standardowej nie moe zosta zmieniona"; + Text[ japanese ] = "Wײ͕ؖύXo܂B"; + Text[ chinese_traditional ] = "Lkܧзǵ{wW١C"; + Text[ arabic ] = " "; + Text[ dutch ] = "De naam van de standaardbibliotheek kan niet veranderd worden."; + Text[ chinese_simplified ] = "ı-ơ"; + Text[ greek ] = " ."; + Text[ korean ] = "⺻ ̺귯 ̸ ٲ ϴ."; + Text[ turkish ] = "Standart kitapln ad deitirilemez."; +}; +String RID_STR_CANNOTCHANGENAMEREFLIB +{ + /* ### ACHTUNG: Neuer Text in Resource? Der Name einer referenzierten Bibliothek kann nicht gendert werden : Der Name einer referenzierten Bibliothek kann nicht gendert werden */ + Text = "Der Name einer referenzierten Bibliothek kann nicht gendert werden" ; + Text [ ENGLISH ] = "Cannot change name from referenced libary" ; + Text [ dutch ] = "De naam van een bibliotheek met een verwijzing kan niet worden veranderd." ; + Text [ english_us ] = "The name of a referenced library cannot be changed." ; + Text [ italian ] = "Il nome di una library alla quale si fa riferimento non pu essere cambiato" ; + Text [ spanish ] = "No se puede modificar el nombre de una biblioteca referenciada" ; + Text [ french ] = "Impossible de modifier le nom d'une bibliothque de rfrence" ; + Text [ swedish ] = "Namnet p ett referensbibliotek kan ndras" ; + Text [ danish ] = "Et referencebiblioteks navn kan ikke ndres" ; + Text [ portuguese_brazilian ] = "Der Name einer referenzierten Bibliothek kann nicht gendert werden" ; + Text [ portuguese ] = "No se pode alterar o nome de uma biblioteca de referncia." ; + Text[ chinese_simplified ] = "ÿơ"; + Text[ russian ] = " ."; + Text[ polish ] = "Nazwa biblioteki, do ktrej si odwoano, nie istnieje."; + Text[ japanese ] = "QƐײ͕ؖύXo܂B"; + Text[ chinese_traditional ] = "Lkܧѷӵ{wW١C"; + Text[ arabic ] = ". "; + Text[ dutch ] = "De naam van een bibliotheek met een verwijzing kan niet worden veranderd."; + Text[ chinese_simplified ] = "ÿơ"; + Text[ greek ] = " "; + Text[ korean ] = " ̺귯 ̸ ٲ ϴ."; + Text[ turkish ] = "Referans alnan bir kitapln ad deitirilemez."; +}; +String RID_STR_CANNOTUNLOADSTDLIB +{ + Text = "Die Standard-Bibliothek kann nicht deaktiviert werden" ; + Text [ ENGLISH ] = "The standard libary cannot be deactivated" ; + Text [ english_us ] = "The standard library cannot be deactivated" ; + Text [ italian ] = "La library standard non pu essere disattivata" ; + Text [ spanish ] = "No se puede desactivar la biblioteca estndar" ; + Text [ french ] = "Impossible de dsactiver la bibliothque par dfaut." ; + Text [ dutch ] = "De standaardbibliotheek kan niet worden gedeactiveerd." ; + Text [ swedish ] = "Standardbiblioteket kan inte deaktiveras" ; + Text [ danish ] = "Standardmappen kan ikke deaktiveres" ; + Text [ portuguese_brazilian ] = "Die Standard-Bibliothek kann nicht deaktiviert werden" ; + Text [ portuguese ] = "A biblioteca-padro no pode ser desactivada." ; + Text[ chinese_simplified ] = "ʧ"; + Text[ russian ] = " "; + Text[ polish ] = "Standardowej biblioteki nie mona byo zdeaktywowa."; + Text[ japanese ] = "Wײèނɏo܂"; + Text[ chinese_traditional ] = "Lkзǵ{w"; + Text[ arabic ] = " "; + Text[ dutch ] = "De standaardbibliotheek kan niet worden gedeactiveerd."; + Text[ chinese_simplified ] = "ʧ"; + Text[ greek ] = " "; + Text[ korean ] = "⺻ ̺귯 ߴܽų ϴ."; + Text[ turkish ] = "Standart kitapln etkinlii kaldrlmaz."; +}; +String RID_STR_GENERATESOURCE +{ + Text = "Erzeuge Quelltext" ; + Text [ ENGLISH ] = "Generating source" ; + Text [ english_us ] = "Generating source" ; + Text [ italian ] = "Creazione del testo sorgente" ; + Text [ spanish ] = "Creando un texto fuente" ; + Text [ french ] = "Cre texte source" ; + Text [ dutch ] = "Brontekst maken" ; + Text [ swedish ] = "Skapa klltext" ; + Text [ danish ] = "Opret kildetekst" ; + Text [ portuguese_brazilian ] = "Erzeuge Quelltext" ; + Text [ portuguese ] = "A criar texto-fonte" ; + Text[ chinese_simplified ] = "Դı"; + Text[ russian ] = " "; + Text[ polish ] = "Utwrz tekst rdowy"; + Text[ japanese ] = "̍쐬"; + Text[ chinese_traditional ] = "ͦl"; + Text[ arabic ] = " "; + Text[ dutch ] = "Brontekst maken"; + Text[ chinese_simplified ] = "Դı"; + Text[ greek ] = " "; + Text[ korean ] = "ҽ "; + Text[ turkish ] = "Kaynak kod oluturuluyor"; +}; +String RID_STR_FILENAME +{ + Text = "Dateiname: " ; + Text [ ENGLISH ] = "File name: " ; + Text [ dutch ] = "Bestandsnaam: " ; + Text [ english_us ] = "File name:" ; + Text [ italian ] = "Nome file: " ; + Text [ spanish ] = "Nom. del archivo: " ; + Text [ french ] = "Nom de fichier : " ; + Text [ swedish ] = "Filnamn: " ; + Text [ danish ] = "Filnavn:" ; + Text [ portuguese_brazilian ] = "Dateiname: " ; + Text [ portuguese ] = "Nome do ficheiro: " ; + Text[ chinese_simplified ] = "ļ"; + Text[ russian ] = " : "; + Text[ polish ] = "Nazwa pliku: "; + Text[ japanese ] = "̧ٖ:"; + Text[ chinese_traditional ] = "ɮצW:"; + Text[ arabic ] = ": "; + Text[ dutch ] = "Bestandsnaam: "; + Text[ chinese_simplified ] = "ļ"; + Text[ greek ] = " : "; + Text[ korean ] = "ϸ: "; + Text[ turkish ] = "Dosya ad: "; +}; +String RID_STR_APPENDLIBS +{ + /* ### ACHTUNG: Neuer Text in Resource? Bibliotheken hinzufgen : Bibliotheken hinzufgen */ + Text = "Bibliotheken hinzufgen" ; + Text [ ENGLISH ] = "Append libaries" ; + Text [ english_us ] = "Append Libraries" ; + Text [ italian ] = "Aggiungi biblioteche" ; + Text [ spanish ] = "Aadir bibliotecas" ; + Text [ french ] = "Ajouter des bibliothques" ; + Text [ dutch ] = "Bibliotheken toevoegen" ; + Text [ swedish ] = "Lgg till bibliotek" ; + Text [ danish ] = "Tilfj biblioteker" ; + Text [ portuguese_brazilian ] = "Bibliotheken hinzufgen" ; + Text [ portuguese ] = "Inserir bibliotecas" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = " "; + Text[ polish ] = "Dodaj biblioteki"; + Text[ japanese ] = "ײ̒lj"; + Text[ chinese_traditional ] = "sW{w"; + Text[ arabic ] = " "; + Text[ dutch ] = "Bibliotheken toevoegen"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = " "; + Text[ korean ] = "̺귯 ߰"; + Text[ turkish ] = "Kitaplk ekle"; +}; +String RID_STR_QUERYDELMACRO +{ + /* ### ACHTUNG: Neuer Text in Resource? Mchten Sie das Makro XX lschen ? : Mchten Sie das Makro XX lschen ? */ + Text = "Mchten Sie das Makro XX lschen ?" ; + Text [ ENGLISH ] = "Do you want to delete the macro XX ?" ; + Text [ english_us ] = "Do you want to delete the macro XX ?" ; + Text [ italian ] = "Eliminare la macro XX ?" ; + Text [ spanish ] = "Desea eliminar la macro XX?" ; + Text [ french ] = "Voulez-vous supprimer la macro XX ?" ; + Text [ dutch ] = "Wilt u de macro XX wissen?" ; + Text [ swedish ] = "Vill Du radera makro XX ?" ; + Text [ danish ] = "Vil du slette makroen XX ?" ; + Text [ portuguese_brazilian ] = "Mchten Sie das Makro XX lschen ?" ; + Text [ portuguese ] = "Deseja eliminar a macro XX ?" ; + Text[ chinese_simplified ] = "Ҫɾ XX "; + Text[ russian ] = " XX ?"; + Text[ polish ] = "Chcesz usun makro XX?"; + Text[ japanese ] = "ϸXX폜܂?"; + Text[ chinese_traditional ] = "znR XX S"; + Text[ arabic ] = " XX "; + Text[ dutch ] = "Wilt u de macro XX wissen?"; + Text[ chinese_simplified ] = "Ҫɾ XX "; + Text[ greek ] = " ;"; + Text[ korean ] = "ũXX Ͻðڽϱ?"; + Text[ turkish ] = "XX makrosunu silmek istiyor musunuz?"; +}; +String RID_STR_QUERYDELDIALOG +{ + /* ### ACHTUNG: Neuer Text in Resource? Mchten Sie den Dialog XX lschen ? : Mchten Sie den Dialog XX lschen ? */ + Text = "Mchten Sie den Dialog XX lschen ?" ; + Text [ ENGLISH ] = "Do you want to delete the dialog XX ?" ; + Text [ dutch ] = "Wilt u de dialoog XX wissen?" ; + Text [ english_us ] = "Do you want to delete the dialog XX ?" ; + Text [ italian ] = "Cancellare il dialogo XX" ; + Text [ spanish ] = "Desea eliminar el dilogo XX?" ; + Text [ french ] = "Supprimer la bote de dialogue XX ?" ; + Text [ swedish ] = "Vill Du radera dialogen XX?" ; + Text [ danish ] = "Vil du slette dialogen XX ?" ; + Text [ portuguese_brazilian ] = "Mchten Sie den Dialog XX lschen ?" ; + Text [ portuguese ] = "Deseja eliminar o dilogo XX ?" ; + Text[ chinese_simplified ] = "ҪɾԻ XX "; + Text[ russian ] = " XX ?"; + Text[ polish ] = "Chcesz usun dialog XX?"; + Text[ japanese ] = "۸XX폜܂?"; + Text[ chinese_traditional ] = "znR XX S"; + Text[ arabic ] = " XX "; + Text[ dutch ] = "Wilt u de dialoog XX wissen?"; + Text[ chinese_simplified ] = "ҪɾԻ XX "; + Text[ greek ] = " ;"; + Text[ korean ] = "ȭXX Ͻðڽϱ?"; + Text[ turkish ] = "XX diyalounu silmek istiyor musunuz?"; +}; +String RID_STR_QUERYDELLIB +{ + /* ### ACHTUNG: Neuer Text in Resource? Mchten Sie die Bibliothek XX lschen ? : Mchten Sie die Bibliothek XX lschen ? */ + Text = "Mchten Sie die Bibliothek XX lschen ?" ; + Text [ ENGLISH ] = "Do you want to delete the libary XX" ; + Text [ english_us ] = "Do you want to delete the library XX ?" ; + Text [ italian ] = "Eliminare la library XX ?" ; + Text [ spanish ] = "Desea eliminar la biblioteca XX?" ; + Text [ french ] = "Voulez-vous supprimer la bibliothque XX ?" ; + Text [ dutch ] = "Wilt u de bibliotheek XX wissen?" ; + Text [ swedish ] = "Vill Du radera biblioteket XX ?" ; + Text [ danish ] = "Vil du slette biblioteket XX ?" ; + Text [ portuguese_brazilian ] = "Mchten Sie die Bibliothek XX lschen ?" ; + Text [ portuguese ] = "Deseja eliminar a biblioteca XX ?" ; + Text[ chinese_simplified ] = "Ҫɾ XX "; + Text[ russian ] = " XX ?"; + Text[ polish ] = "Chcesz usun bibliotek XX?"; + Text[ japanese ] = "ײXX폜܂?"; + Text[ chinese_traditional ] = "znR{w XX S"; + Text[ arabic ] = " XX "; + Text[ dutch ] = "Wilt u de bibliotheek XX wissen?"; + Text[ chinese_simplified ] = "Ҫɾ XX "; + Text[ greek ] = " ;"; + Text[ korean ] = "̺귯XX Ͻðڽϱ ?"; + Text[ turkish ] = "XX kitapln silmek istiyor musunuz?"; +}; +String RID_STR_QUERYDELLIBREF +{ + /* ### ACHTUNG: Neuer Text in Resource? Mchten Sie die Referenz auf die Bibliothek XX lschen ? : Mchten Sie die Referenz auf die Bibliothek XX lschen ? */ + Text = "Mchten Sie die Referenz auf die Bibliothek XX lschen ?" ; + Text [ ENGLISH ] = "Do you want to delete the reference to the libary XX ?" ; + Text [ english_us ] = "Do you want to delete the reference to the library XX ?" ; + Text [ italian ] = "Cancellare il riferimento alla library XX ?" ; + Text [ spanish ] = "Desea eliminar la referencia a la biblioteca XX?" ; + Text [ french ] = "Voulez-vous supprimer la rfrence la bibliothque XX ?" ; + Text [ dutch ] = "Wilt u de verwijzing naar de bibliotheek XX wissen?" ; + Text [ swedish ] = "Vill Du radera referensen till biblioteket XX ?" ; + Text [ danish ] = "Vil du slette referencen til biblioteket XX ?" ; + Text [ portuguese_brazilian ] = "Mchten Sie die Referenz auf die Bibliothek XX lschen ?" ; + Text [ portuguese ] = "Deseja eliminar a referncia biblioteca XX ?" ; + Text[ chinese_simplified ] = "Ҫɾ XX ã"; + Text[ russian ] = " XX ?"; + Text[ polish ] = "Czy chcesz usun odwoanie do bibliotekiXX?"; + Text[ japanese ] = "ײXX̎QƐ폜܂?"; + Text[ chinese_traditional ] = "znR{w XX ѷӡS"; + Text[ arabic ] = " XX "; + Text[ dutch ] = "Wilt u de verwijzing naar de bibliotheek XX wissen?"; + Text[ chinese_simplified ] = "Ҫɾ XX ã"; + Text[ greek ] = " ;"; + Text[ korean ] = "̺귯XX ִ Ͻðڽϱ?"; + Text[ turkish ] = "XX kitaplna ilikin referans silmek istiyor musunuz?"; +}; +String RID_STR_QUERYDELMODULE +{ + /* ### ACHTUNG: Neuer Text in Resource? Mchten Sie das Modul XX lschen ? : Mchten Sie das Modul XX lschen ? */ + Text = "Mchten Sie das Modul XX lschen ?" ; + Text [ ENGLISH ] = "Do you want to delete the module XX ?" ; + Text [ english_us ] = "Do you want to delete the module XX ?" ; + Text [ italian ] = "Cancellare il modulo XX ?" ; + Text [ spanish ] = "Desea eliminar el mdulo XX?" ; + Text [ french ] = "Voulez-vous supprimer le module XX ?" ; + Text [ dutch ] = "Wilt u de module XX wissen?" ; + Text [ swedish ] = "Vill Du radera modulen XX ?" ; + Text [ danish ] = "Vil du slette modulet XX ?" ; + Text [ portuguese_brazilian ] = "Mchten Sie das Modul XX lschen ?" ; + Text [ portuguese ] = "Deseja eliminar o mdulo XX ?" ; + Text[ chinese_simplified ] = "Ҫɾģ XX "; + Text[ russian ] = " XX ?"; + Text[ polish ] = "Chcesz usun modu XX?"; + Text[ japanese ] = "ӼޭXX폜܂?"; + Text[ chinese_traditional ] = "znRҶ XX S"; + Text[ arabic ] = " XX "; + Text[ dutch ] = "Wilt u de module XX wissen?"; + Text[ chinese_simplified ] = "Ҫɾģ XX "; + Text[ greek ] = " XX ;"; + Text[ korean ] = "XX Ͻðڽϱ ?"; + Text[ turkish ] = "XX modln silmek istiyor musunuz?"; +}; +String RID_STR_OBJNOTFOUND +{ + Text = "Objekt oder Methode nicht gefunden" ; + Text [ ENGLISH ] = "Object or method not found" ; + Text [ dutch ] = "Object of methode niet gevonden." ; + Text [ english_us ] = "Object or method not found" ; + Text [ italian ] = "Oggetto o metodo non trovato" ; + Text [ spanish ] = "No se ha encontrado el objeto o mtodo" ; + Text [ french ] = "Objet ou mthode introuvables" ; + Text [ swedish ] = "Objekt eller metod hittades inte" ; + Text [ danish ] = "Objekt eller metode blev ikke fundet" ; + Text [ portuguese_brazilian ] = "Objekt oder Methode nicht gefunden" ; + Text [ portuguese ] = "Impossvel encontrar objecto ou mtodo." ; + Text[ chinese_simplified ] = "ûҵ"; + Text[ russian ] = " "; + Text[ polish ] = "Obiektu lub metody nie znaleziono"; + Text[ japanese ] = "ުĂ܂͕@܂B"; + Text[ chinese_traditional ] = "S쪫ΤkC"; + Text[ arabic ] = " "; + Text[ dutch ] = "Object of methode niet gevonden."; + Text[ chinese_simplified ] = "ûҵ"; + Text[ greek ] = " "; + Text[ korean ] = "ü ż带 ã "; + Text[ turkish ] = "Nesne ya da yntem bulunamad"; +}; +String RID_STR_BASIC +{ + Text = "BASIC" ; + Text [ ENGLISH ] = "BASIC" ; + Text [ dutch ] = "BASIC" ; + Text [ english_us ] = "BASIC" ; + Text [ italian ] = "BASIC" ; + Text [ spanish ] = "BASIC" ; + Text [ french ] = "BASIC" ; + Text [ swedish ] = "BASIC" ; + Text [ danish ] = "BASIC" ; + Text [ portuguese_brazilian ] = "BASIC" ; + Text [ portuguese ] = "BASIC" ; + Text[ chinese_simplified ] = "BASIC"; + Text[ russian ] = "BASIC"; + Text[ polish ] = "BASIC"; + Text[ japanese ] = "BASIC"; + Text[ chinese_traditional ] = "BASIC"; + Text[ arabic ] = "BASIC"; + Text[ dutch ] = "BASIC"; + Text[ chinese_simplified ] = "BASIC"; + Text[ greek ] = "BASIC"; + Text[ korean ] = "BASIC"; + Text[ turkish ] = "BASIC"; +}; +String RID_STR_LINE +{ + // Abkuerzung fuer 'Zeile' + Text = "Zl" ; + Text [ ENGLISH ] = "Ln" ; + Text [ english_us ] = "Ln" ; + Text [ italian ] = "Ln" ; + Text [ spanish ] = "Li" ; + Text [ french ] = "Li" ; + Text [ dutch ] = "Rg" ; + Text [ swedish ] = "Ln" ; + Text [ danish ] = "Rk" ; + Text [ portuguese_brazilian ] = "Zl" ; + Text [ portuguese ] = "Li" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Wiersz"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ dutch ] = "Rg"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Sa."; +}; +String RID_STR_COLUMN +{ + // Abkuerzung fuer 'Spalte' + Text = "Sp" ; + Text [ ENGLISH ] = "Col" ; + Text [ dutch ] = "Kolom" ; + Text [ english_us ] = "Col" ; + Text [ italian ] = "Col" ; + Text [ spanish ] = "Col" ; + Text [ french ] = "Col" ; + Text [ swedish ] = "Kol" ; + Text [ danish ] = "Kol" ; + Text [ portuguese_brazilian ] = "Sp" ; + Text [ portuguese ] = "Col" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Kol"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ dutch ] = "Kolom"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "S."; +}; +String RID_STR_DOC +{ + Text = "Dokument" ; + Text [ ENGLISH ] = "Document" ; + Text [ english_us ] = "Document" ; + Text [ italian ] = "Documento" ; + Text [ spanish ] = "Documento" ; + Text [ french ] = "Document" ; + Text [ dutch ] = "Document" ; + Text [ swedish ] = "Dokument" ; + Text [ danish ] = "Dokument" ; + Text [ portuguese_brazilian ] = "Dokument" ; + Text [ portuguese ] = "Documento" ; + Text[ chinese_simplified ] = "ĵ"; + Text[ russian ] = ""; + Text[ polish ] = "Dokument"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ dutch ] = "Document"; + Text[ chinese_simplified ] = "ĵ"; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Belge"; +}; +Bitmap RID_BMP_BRKPNT0 +{ + FILE = "basbrk0.bmp" ; +}; +Bitmap RID_BMP_BRKPNT1 +{ + FILE = "basbrk.bmp" ; +}; +String RID_BASICIDE_OBJECTBAR +{ + Text = "Makro-Leiste" ; + Text [ ENGLISH ] = "Macro-Bar" ; + Text [ norwegian ] = "Macro-Bar" ; + Text [ italian ] = "Barra delle macro" ; + Text [ portuguese_brazilian ] = "Barra-Macro" ; + Text [ portuguese ] = "Barra de macros" ; + Text [ finnish ] = "Makrorivi" ; + Text [ danish ] = "Makrolinje" ; + Text [ french ] = "Barre de macros" ; + Text [ swedish ] = "Makrolist" ; + Text [ dutch ] = "Macrobalk" ; + Text [ spanish ] = "Barra de macro" ; + Text [ english_us ] = "Macro Bar" ; + Text[ chinese_simplified ] = "-"; + Text[ russian ] = " Makro"; + Text[ polish ] = "Pasek makro"; + Text[ japanese ] = "ϸ ް"; + Text[ chinese_traditional ] = "C"; + Text[ arabic ] = " "; + Text[ dutch ] = "Macrobalk"; + Text[ chinese_simplified ] = "-"; + Text[ greek ] = " "; + Text[ korean ] = "ũ "; + Text[ turkish ] = "Makro ubuu"; +}; +String RID_STR_CANNOTCLOSE +{ + /* ### ACHTUNG: Neuer Text in Resource? Das Fenster kann nicht geschlossen werden,\nwhrend das BASIC-Programm luft. : Das Fenster kann nicht geschlossen werden,\nwhrend das BASIC-Programm luft. */ + Text = "Das Fenster kann nicht geschlossen werden,\nwhrend das BASIC-Programm luft." ; + Text [ ENGLISH ] = "The window can't be closed while BASIC is running" ; + Text [ norwegian ] = "The window can't be closed while BASIC is running" ; + Text [ italian ] = "La finestra non pu essere chiusa mentre\n il programma BASIC in esecuzione." ; + Text [ portuguese_brazilian ] = "A janela no pode ser fechada enquanto o BASIC estiver rodando" ; + Text [ portuguese ] = "A janela no pode ser fechada enquanto o \nBASIC estiver a ser executado." ; + Text [ finnish ] = "Ikkunaa ei voi sulkea, kun BASIC on kynniss" ; + Text [ danish ] = "Vinduet kan ikke lukkes \nmens du krer BASIC." ; + Text [ french ] = "Impossible de fermer la fentre lorsque BASIC est en cours d'excution." ; + Text [ swedish ] = "Fnstret kan inte stngas\nnr BASIC-programmet krs." ; + Text [ dutch ] = "Het venster kan niet worden gesloten \ntijdens het uitvoeren van het BASIC-programma." ; + Text [ spanish ] = "No se puede cerrar la ventana\nmientras se ejecuta el programa BASIC." ; + Text [ english_us ] = "The window can't be closed while BASIC is running." ; + Text[ chinese_simplified ] = " BASIC ʱ\nرӴ"; + Text[ russian ] = " ,\n BASIC ."; + Text[ polish ] = "Okna nie mona byo zamkn,\npodczas trwania programu BASIC."; + Text[ japanese ] = "BASIC۸т̍쓮ɳ邱Ƃ͂ł܂B"; + Text[ chinese_traditional ] = "b BASIC {B\nLkC"; + Text[ arabic ] = " ɡ\n BASIC ."; + Text[ dutch ] = "Het venster kan niet worden gesloten \ntijdens het uitvoeren van het BASIC-programma."; + Text[ chinese_simplified ] = " BASIC ʱ\nرӴ"; + Text[ greek ] = " \n BASIC."; + Text[ korean ] = "BASIC α Ǵ â ϴ."; + Text[ turkish ] = "BASIC program alrken\npencere kapatlamaz."; +}; +String RID_STR_REPLACESTDLIB +{ + Text = "Die Standard-Bibliothek kann nicht ersetzt werden." ; + Text [ ENGLISH ] = "The standard libary can't be replaced." ; + Text [ english_us ] = "The standard library cannot be replaced." ; + Text [ italian ] = "Non possibile sostituire la library standard." ; + Text [ spanish ] = "No se puede substituir la biblioteca estndar." ; + Text [ french ] = "Impossible de remplacer la bibliothque par dfaut." ; + Text [ dutch ] = "De standaardbibliotheek kan niet worden vervangen." ; + Text [ swedish ] = "Standardbiblioteket kan inte ersttas." ; + Text [ danish ] = "Standardmappen kan ikke erstattes." ; + Text [ portuguese_brazilian ] = "Die Standard-Bibliothek kann nicht ersetzt werden." ; + Text [ portuguese ] = "A biblioteca-padro no pode ser substituda." ; + Text[ chinese_simplified ] = "-⡣"; + Text[ russian ] = " ."; + Text[ polish ] = "Standardowej biblioteki nie mona byo zastpi."; + Text[ japanese ] = "Wײ͒uł܂B"; + Text[ chinese_traditional ] = "LkNзǵ{wC"; + Text[ arabic ] = ". "; + Text[ dutch ] = "De standaardbibliotheek kan niet worden vervangen."; + Text[ chinese_simplified ] = "-⡣"; + Text[ greek ] = " "; + Text[ korean ] = "⺻ ̺귯 ٲ ϴ."; + Text[ turkish ] = "Standart kitaplk deitirilemez."; +}; +String RID_STR_REFNOTPOSSIBLE +{ + /* ### ACHTUNG: Neuer Text in Resource? Referenz auf 'XX' nicht mglich. : Referenz auf ''XX'' nicht mglich. */ + /* ### ACHTUNG: Neuer Text in Resource? Referenz auf 'XX' nicht mglich. : Referenz auf 'XX' nicht mglich. */ + Text = "Referenz auf 'XX' nicht mglich." ; + Text [ ENGLISH ] = "Reference to 'XX' not possible." ; + Text [ dutch ] = "Verwijzing naar ' XX' niet mogelijk." ; + Text [ english_us ] = "Reference to 'XX' not possible." ; + Text [ italian ] = "Riferimento a 'XX' non possibile." ; + Text [ spanish ] = "No es posible la referencia a 'XX' ." ; + Text [ french ] = "Rfrence 'XX' impossible." ; + Text [ swedish ] = "Referens till 'XX' inte mjlig." ; + Text [ danish ] = "Reference til 'XX' er ikke mulig." ; + Text [ portuguese_brazilian ] = "Referenz auf 'XX' nicht mglich." ; + Text [ portuguese ] = "A referncia a 'XX' impossvel." ; + Text[ chinese_simplified ] = " 'XX' "; + Text[ russian ] = " 'XX' ."; + Text[ polish ] = "Odwoanie do 'XX' jest niemoliwe."; + Text[ japanese ] = "'XX'̎QƂ͂ł܂B"; + Text[ chinese_traditional ] = "Lkѷ 'XX' C"; + Text[ arabic ] = ". 'XX' "; + Text[ dutch ] = "Verwijzing naar ' XX' niet mogelijk."; + Text[ chinese_simplified ] = " 'XX' "; + Text[ greek ] = " 'XX' ."; + Text[ korean ] = "'XX' Ұ"; + Text[ turkish ] = "'XX' referans alnamaz."; +}; +String RID_STR_WATCHNAME +{ + Text = "Beobachter" ; + Text [ ENGLISH ] = "Watches" ; + Text [ norwegian ] = "Watches" ; + Text [ italian ] = "Controllo" ; + Text [ portuguese_brazilian ] = "Vis es" ; + Text [ portuguese ] = "Observador" ; + Text [ finnish ] = "Vahdit" ; + Text [ danish ] = "Observatr" ; + Text [ french ] = "Espion" ; + Text [ swedish ] = "Bevakning" ; + Text [ dutch ] = "Waarnemer" ; + Text [ spanish ] = "Observador" ; + Text [ english_us ] = "Watch" ; + Text[ chinese_simplified ] = "鿴"; + Text[ russian ] = " :"; + Text[ polish ] = "Czujka"; + Text[ japanese ] = "ްް"; + Text[ chinese_traditional ] = "˵"; + Text[ arabic ] = ""; + Text[ dutch ] = "Waarnemer"; + Text[ chinese_simplified ] = "鿴"; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "zleyici"; +}; +String RID_STR_STACKNAME +{ + Text = "Kommandostapel" ; + Text [ ENGLISH ] = "Stack" ; + Text [ norwegian ] = "Stack" ; + Text [ italian ] = "Stack" ; + Text [ portuguese_brazilian ] = "Pilha" ; + Text [ portuguese ] = "Empilhar" ; + Text [ finnish ] = "Pino" ; + Text [ danish ] = "Kommandostak" ; + Text [ french ] = "Pile" ; + Text [ swedish ] = "Anropsstack" ; + Text [ dutch ] = "Commandostapel" ; + Text [ spanish ] = "Pila de comandos" ; + Text [ english_us ] = "Call Stack" ; + Text[ chinese_simplified ] = "жѵ"; + Text[ russian ] = " "; + Text[ polish ] = "Stos wywoa"; + Text[ japanese ] = "̌Ăяo"; + Text[ chinese_traditional ] = "Is|"; + Text[ arabic ] = " "; + Text[ dutch ] = "Commandostapel"; + Text[ chinese_simplified ] = "жѵ"; + Text[ greek ] = " "; + Text[ korean ] = " "; + Text[ turkish ] = "Komut yn"; +}; +String RID_STR_INITIDE +{ + Text = "Initialisierung BASIC" ; + Text [ ENGLISH ] = "Init BASIC" ; + Text [ norwegian ] = "Init BASIC" ; + Text [ italian ] = "Inizializza BASIC" ; + Text [ portuguese_brazilian ] = "Iniciar BASIC" ; + Text [ portuguese ] = "Iniciar BASIC" ; + Text [ finnish ] = "Alusta BASIC" ; + Text [ danish ] = "BASIC initialisiering" ; + Text [ french ] = "Initialiser BASIC" ; + Text [ swedish ] = "Initiering BASIC" ; + Text [ dutch ] = "BASIC initialiseren" ; + Text [ spanish ] = "Iniciar BASIC" ; + Text [ english_us ] = "BASIC Initialization" ; + Text[ chinese_simplified ] = "ʼ BASIC"; + Text[ russian ] = " BASIC"; + Text[ polish ] = "Inicjalizacja BASIC"; + Text[ japanese ] = "BASIC̏"; + Text[ chinese_traditional ] = "l BASIC"; + Text[ arabic ] = "BASIC "; + Text[ dutch ] = "BASIC initialiseren"; + Text[ chinese_simplified ] = "ʼ BASIC"; + Text[ greek ] = " BASIC"; + Text[ korean ] = "BASIC ʱ"; + Text[ turkish ] = "BASIC balatlyor"; +}; +String RID_STR_STDMODULENAME +{ + Text = "Modul" ; + Text [ ENGLISH ] = "Module" ; + Text [ norwegian ] = "Module" ; + Text [ italian ] = "Modulo" ; + Text [ portuguese_brazilian ] = "Mdulo" ; + Text [ portuguese ] = "Mdulo" ; + Text [ finnish ] = "Moduuli" ; + Text [ danish ] = "Modul" ; + Text [ french ] = "Module" ; + Text [ swedish ] = "Modul" ; + Text [ dutch ] = "Module" ; + Text [ spanish ] = "Mdulo" ; + Text [ english_us ] = "Module" ; + Text[ chinese_simplified ] = "ģ"; + Text[ russian ] = ""; + Text[ polish ] = "Modu"; + Text[ japanese ] = "Ӽޭ"; + Text[ chinese_traditional ] = "Ҷ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Module"; + Text[ chinese_simplified ] = "ģ"; + Text[ greek ] = " "; + Text[ korean ] = ""; + Text[ turkish ] = "Modl"; +}; +String RID_STR_STDDIALOGNAME +{ + Text = "Dialog" ; + Text [ ENGLISH ] = "Dialog" ; + Text [ norwegian ] = "Dialog" ; + Text [ italian ] = "Dialogo" ; + Text [ portuguese_brazilian ] = "Dilogo" ; + Text [ portuguese ] = "Dilogo" ; + Text [ finnish ] = "Valintaikkuna" ; + Text [ danish ] = "Dialog" ; + Text [ french ] = "Dialogue" ; + Text [ swedish ] = "Dialog" ; + Text [ dutch ] = "Dialoog" ; + Text [ spanish ] = "Dilogo" ; + Text [ english_us ] = "Dialog" ; + Text[ chinese_simplified ] = "Ի"; + Text[ russian ] = ""; + Text[ polish ] = "Dialog"; + Text[ japanese ] = "۸"; + Text[ chinese_traditional ] = "ܤ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Dialoog"; + Text[ chinese_simplified ] = "Ի"; + Text[ greek ] = ""; + Text[ korean ] = "ȭ"; + Text[ turkish ] = "Diyalog"; +}; +String RID_STR_STDLIBNAME +{ + Text = "Bibliothek" ; + Text [ ENGLISH ] = "Libary" ; + Text [ norwegian ] = "Libary" ; + Text [ italian ] = "Library" ; + Text [ portuguese_brazilian ] = "Library" ; + Text [ portuguese ] = "Biblioteca" ; + Text [ french ] = "Bibliothque" ; + Text [ dutch ] = "Bibliotheek" ; + Text [ spanish ] = "Biblioteca" ; + Text [ danish ] = "Bibliotek" ; + Text [ swedish ] = "Bibliotek" ; + Text [ finnish ] = "Libary" ; + Text [ english_us ] = "Library" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Biblioteka"; + Text[ japanese ] = "ײ"; + Text[ chinese_traditional ] = "{w"; + Text[ arabic ] = ""; + Text[ dutch ] = "Bibliotheek"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "̺귯"; + Text[ turkish ] = "Kitaplk"; +}; +String RID_STR_NEWLIB +{ + Text = "Neue Bibliothek" ; + Text [ English ] = "New libary" ; + Text [ portuguese ] = "Nova biblioteca" ; + Text [ english_us ] = "New Library" ; + Text [ portuguese_brazilian ] = "Neue Bibliothek" ; + Text [ swedish ] = "Nytt bibliotek" ; + Text [ danish ] = "Nyt bibliotek" ; + Text [ italian ] = "Nuova library" ; + Text [ spanish ] = "Nueva biblioteca" ; + Text [ french ] = "Nouvelle bibliothque" ; + Text [ dutch ] = "Nieuwe bibliotheek" ; + Text[ chinese_simplified ] = "¿"; + Text[ russian ] = " "; + Text[ polish ] = "Nowa biblioteka"; + Text[ japanese ] = "Vײ"; + Text[ chinese_traditional ] = "s{w"; + Text[ arabic ] = " "; + Text[ dutch ] = "Nieuwe bibliotheek"; + Text[ chinese_simplified ] = "¿"; + Text[ greek ] = " "; + Text[ korean ] = " ̺귯"; + Text[ turkish ] = "Yeni kitaplk"; +}; +String RID_STR_NEWMOD +{ + Text = "Neues Modul" ; + Text [ English ] = "New module" ; + Text [ english_us ] = "New Module" ; + Text [ portuguese_brazilian ] = "Neues Modul" ; + Text [ swedish ] = "Ny modul" ; + Text [ danish ] = "Nyt modul" ; + Text [ italian ] = "Nuovo modulo" ; + Text [ spanish ] = "Nuevo mdulo" ; + Text [ french ] = "Nouveau module" ; + Text [ dutch ] = "Nieuwe module" ; + Text [ portuguese ] = "Novo mdulo" ; + Text[ chinese_simplified ] = "ģ"; + Text[ russian ] = " "; + Text[ polish ] = "Nowy modu"; + Text[ japanese ] = "VӼޭ"; + Text[ chinese_traditional ] = "sҶ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Nieuwe module"; + Text[ chinese_simplified ] = "ģ"; + Text[ greek ] = " "; + Text[ korean ] = " "; + Text[ turkish ] = "Yeni modl"; +}; +String RID_STR_NEWDLG +{ + Text = "Neuer Dialog" ; + Text [ English ] = "New dialog" ; + Text [ english_us ] = "New Dialog" ; + Text [ portuguese_brazilian ] = "Neuer Dialog" ; + Text [ swedish ] = "Ny dialog" ; + Text [ danish ] = "Ny dialog" ; + Text [ italian ] = "Nuovo dialogo" ; + Text [ spanish ] = "Nuevo dilogo" ; + Text [ french ] = "Nouvelle bote de dialogue" ; + Text [ dutch ] = "Nieuwe dialoog" ; + Text [ portuguese ] = "Novo dilogo" ; + Text[ chinese_simplified ] = "¶Ի"; + Text[ russian ] = " "; + Text[ polish ] = "Nowy dialog"; + Text[ japanese ] = "V۸"; + Text[ chinese_traditional ] = "s"; + Text[ arabic ] = " "; + Text[ dutch ] = "Nieuwe dialoog"; + Text[ chinese_simplified ] = "¶Ի"; + Text[ greek ] = " "; + Text[ korean ] = " ȭ"; + Text[ turkish ] = "Yeni diyalog"; +}; +String RID_STR_ALL +{ + Text = "Alle" ; + Text [ ENGLISH ] = "All" ; + Text [ norwegian ] = "All" ; + Text [ italian ] = "Tutto" ; + Text [ portuguese_brazilian ] = "Tudo" ; + Text [ portuguese ] = "Tudo" ; + Text [ finnish ] = "Kaikki" ; + Text [ danish ] = "Alle" ; + Text [ french ] = "Tout" ; + Text [ swedish ] = "Alla" ; + Text [ dutch ] = "Alles" ; + Text [ spanish ] = "Todo" ; + Text [ english_us ] = "All" ; + Text[ chinese_simplified ] = "ȫ"; + Text[ russian ] = ""; + Text[ polish ] = "Wszystkie"; + Text[ japanese ] = "ׂ"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ dutch ] = "Alles"; + Text[ chinese_simplified ] = "ȫ"; + Text[ greek ] = ""; + Text[ korean ] = "ü"; + Text[ turkish ] = "Tm"; +}; +String RID_STR_PAGE +{ + Text = "Seite" ; + Text [ ENGLISH ] = "Page" ; + Text [ norwegian ] = "Page" ; + Text [ italian ] = "Pagina" ; + Text [ portuguese_brazilian ] = "Pgina" ; + Text [ portuguese ] = "Pgina" ; + Text [ english_us ] = "Page" ; + Text [ finnish ] = "Sivu" ; + Text [ danish ] = "Side" ; + Text [ french ] = "Page" ; + Text [ swedish ] = "Sida" ; + Text [ dutch ] = "Pagina" ; + Text [ spanish ] = "Pgina" ; + Text[ chinese_simplified ] = "ҳ"; + Text[ russian ] = ""; + Text[ polish ] = "Strona"; + Text[ japanese ] = "߰"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ dutch ] = "Pagina"; + Text[ chinese_simplified ] = "ҳ"; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Sayfa"; +}; +String RID_STR_MACRONAMEREQ +{ + /* ### ACHTUNG: Neuer Text in Resource? Es mu ein Name angegeben werden. : Es mu ein Name angegeben werden. */ + Text = "Es muss ein Name angegeben werden." ; + Text [ ENGLISH ] = "Macro name required." ; + Text [ dutch ] = "Er moet een naam worden ingevuld." ; + Text [ english_us ] = "A name must be entered." ; + Text [ italian ] = " necessario digitare un nome." ; + Text [ spanish ] = "Se debe introducir un nombre." ; + Text [ french ] = "Vous devez indiquer un nom." ; + Text [ swedish ] = "Ett namn mste anges." ; + Text [ danish ] = "Der skal angives et navn" ; + Text [ portuguese_brazilian ] = "Es mu ein Name angegeben werden." ; + Text [ portuguese ] = " necessrio especificar um nome." ; + Text[ chinese_simplified ] = "һơ"; + Text[ russian ] = " ."; + Text[ polish ] = "Trzeba poda nazw."; + Text[ japanese ] = "O̓͂KvłB"; + Text[ chinese_traditional ] = "J@ӦW١C"; + Text[ arabic ] = ". "; + Text[ dutch ] = "Er moet een naam worden ingevuld."; + Text[ chinese_simplified ] = "һơ"; + Text[ greek ] = " ."; + Text[ korean ] = "̸ Էؾ մϴ."; + Text[ turkish ] = "Bir ad girilmesi gerekir."; +}; +String RID_STR_WILLSTOPPRG +{ + /* ### ACHTUNG: Neuer Text in Resource? Sie mssen nach dieser nderung Ihr Programm neu starten.\nForfahren? : Sie mssen nach dieser nderung Ihr Programm neu starten.\nForfahren? */ + Text = "Sie mssen nach dieser nderung Ihr Programm neu starten.\nForfahren?" ; + Text [ ENGLISH ] = "You'll have to restart after this edit.\nProceed anyway?" ; + Text [ dutch ] = "U moet uw programma na deze wijziging opnieuw opstarten.\nDoorgaan?" ; + Text [ english_us ] = "You will have to restart the program after this edit.\nProceed?" ; + Text [ italian ] = "Dopo questa modifica necessario riavviare il programma.\nProseguire?" ; + Text [ spanish ] = "Tendr que volver a iniciar el programa despus de estas modificaciones.\nContinuar?" ; + Text [ french ] = "Aprs cette modification, vous devrez relancer le programme.\nPoursuivre ?" ; + Text [ swedish ] = "Du mste starta om Ditt program efter den hr ndringen.\nFortstta nd?" ; + Text [ danish ] = "Det er ndvendigt at genstarte programmet efter denne ndring .\nVil du fortstte alligevel?" ; + Text [ portuguese_brazilian ] = "Sie mssen nach dieser nderung Ihr Programm neu starten.\nForfahren?" ; + Text [ portuguese ] = "Ter que reiniciar o programa depois desta modificao.\nContinuar?" ; + Text[ chinese_simplified ] = "ڳĺ\nҪ"; + Text[ russian ] = " .\n?"; + Text[ polish ] = "Po tej zmianie musisz ponownie uruchomi program.\nKontynuowa?"; + Text[ japanese ] = "̕ύX̌۸тċNȂȂ܂B\n܂H"; + Text[ chinese_traditional ] = "ܧ{zsҰʳoӵ{C\nn~S"; + Text[ arabic ] = " ѡ .\n ɿ"; + Text[ dutch ] = "U moet uw programma na deze wijziging opnieuw opstarten.\nDoorgaan?"; + Text[ chinese_simplified ] = "ڳĺ\nҪ"; + Text[ greek ] = " .\n;"; + Text[ korean ] = "̰ Ŀ α ؾ մϴ.\nϽðڽϱ?"; + Text[ turkish ] = "Bu deiiklikten sonra program yeniden balatmanz gerekir.\nDevam etmek istiyor musunuz?"; +}; +String RID_STR_SEARCHALLMODULES +{ + Text = "Soll der Text in allen aktiven Modulen ersetzt werden?" ; + Text [ ENGLISH ] = "Soll der Text in allen aktiven Modulen ersetzt werden?" ; + Text [ english_us ] = "Do you want to replace the text in all active modules?" ; + Text [ italian ] = "Sostituire il testo in tutti i moduli attivi ?" ; + Text [ spanish ] = "Desea substituir el texto en todos los mdulos activos?" ; + Text [ french ] = "Dsirez-vous remplacer le texte dans tous les modules actifs ?" ; + Text [ dutch ] = "Wilt u de tekst in alle actieve modules vervangen?" ; + Text [ swedish ] = "Skall texten ersttas i alla aktiva moduler?" ; + Text [ danish ] = "Skal teksten erstattes i alle aktive moduler?" ; + Text [ portuguese_brazilian ] = "Soll der Text in allen aktiven Modulen ersetzt werden?" ; + Text [ portuguese ] = "Deseja substituir o texto em todos os mdulos activos?" ; + Text[ chinese_simplified ] = "Ҫмģڵ֣"; + Text[ russian ] = " ?"; + Text[ polish ] = "Czy zastpi ten tekst we wszystkich aktywnych moduach?"; + Text[ japanese ] = "÷ĂׂĂ̱èނӼޭقɒu܂?"; + Text[ chinese_traditional ] = "znNbҦEҶS"; + Text[ arabic ] = " ɿ"; + Text[ dutch ] = "Wilt u de tekst in alle actieve modules vervangen?"; + Text[ chinese_simplified ] = "Ҫмģڵ֣"; + Text[ greek ] = " ;"; + Text[ korean ] = " ؽƮ ٲٽðڽϱ?"; + Text[ turkish ] = "Bu metin tm etkin modllerde deitirilsin mi?"; +}; +Edit RID_EDT_WATCHEDIT +{ + Border = TRUE ; + SvLook = TRUE ; + Size = MAP_APPFONT ( 80 , 12 ) ; +}; +ImageButton RID_IMGBTN_REMOVEWATCH +{ + HelpId = HID_BASICIDE_REMOVEWATCH ; + SmallStyle = TRUE ; + ButtonImage = Image + { + ImageBitmap = Bitmap { File = "baswatr.bmp" ; }; + MaskColor = Color { Red = 0xC000 ; Green = 0xC000 ; Blue = 0xC000 ; }; + }; + QuickHelpText = "Beobachter entfernen" ; + QuickHelpText [ ENGLISH ] = "Remove watch" ; + QuickHelpText [ english_us ] = "Remove Watch" ; + QuickHelpText [ italian ] = "Rimuovi controllo" ; + QuickHelpText [ spanish ] = "Elimina observador" ; + QuickHelpText [ french ] = "Supprimer l'espion" ; + QuickHelpText [ dutch ] = "Bewaker verwijderen" ; + QuickHelpText [ danish ] = "Fjern observatr" ; + QuickHelpText [ portuguese_brazilian ] = "Beobachter entfernen" ; + QuickHelpText [ portuguese ] = "Elimina Observador" ; + QuickHelpText [ swedish ] = "Ta bort bevakare" ; + QuickHelpText[ russian ] = " "; + QuickHelpText[ polish ] = "Usu czujk"; + QuickHelpText[ japanese ] = "ްނ̍폜"; + QuickHelpText[ chinese_simplified ] = "鿴"; + QuickHelpText[ chinese_traditional ] = "J˵"; + QuickHelpText[ arabic ] = " "; + QuickHelpText[ dutch ] = "Bewaker verwijderen"; + QuickHelpText[ chinese_simplified ] = "鿴"; + QuickHelpText[ greek ] = " "; + QuickHelpText[ korean ] = "Remove Watch"; +}; +ImageButton RID_IMGBTN_GOTOCALL +{ + HelpId = HID_BASICIDE_GOTOALL ; + SmallStyle = TRUE ; + ButtonImage = Image { ImageBitmap = Bitmap { File = "basgocl.bmp" ; }; } ; +}; +String RID_STR_REMOVEWATCH +{ + Text = "Beobachter: " ; + Text [ ENGLISH ] = "Watch: " ; + Text [ norwegian ] = "Watch: " ; + Text [ italian ] = "Controllo: " ; + Text [ portuguese_brazilian ] = "Vis o: " ; + Text [ portuguese ] = "Observador: " ; + Text [ finnish ] = "Vahti: " ; + Text [ danish ] = "Observatr:" ; + Text [ french ] = "Tmoin : " ; + Text [ swedish ] = "Bevakning: " ; + Text [ dutch ] = "Waarnemer: " ; + Text [ spanish ] = "Observador:" ; + Text [ english_us ] = "Watch:" ; + Text[ chinese_simplified ] = "鿴"; + Text[ russian ] = " : "; + Text[ polish ] = "Czujka: "; + Text[ japanese ] = "ް:"; + Text[ chinese_traditional ] = "˵:"; + Text[ arabic ] = ": "; + Text[ dutch ] = "Waarnemer: "; + Text[ chinese_simplified ] = "鿴"; + Text[ greek ] = ": "; + Text[ korean ] = ": "; + Text[ turkish ] = "zleyici: "; +}; +String RID_STR_STACK +{ + Text = "Aufrufe: " ; + Text [ ENGLISH ] = "Calls: " ; + Text [ english_us ] = "Calls:" ; + Text [ italian ] = "Chiamate: " ; + Text [ spanish ] = "Llamadas:" ; + Text [ french ] = "Appels : " ; + Text [ dutch ] = "Oproepen: " ; + Text [ swedish ] = "Anrop: " ; + Text [ danish ] = "Opkald:" ; + Text [ portuguese_brazilian ] = "Aufrufe: " ; + Text [ portuguese ] = "Chamadas: " ; + Text[ chinese_simplified ] = "У"; + Text[ russian ] = ": "; + Text[ polish ] = "Wywoania: "; + Text[ japanese ] = "Ăяo:"; + Text[ chinese_traditional ] = "Is:"; + Text[ arabic ] = ":"; + Text[ dutch ] = "Oproepen: "; + Text[ chinese_simplified ] = "У"; + Text[ greek ] = ": "; + Text[ korean ] = "ȣ: "; + Text[ turkish ] = "arlar: "; +}; +/* +String RID_STR_INSERTMODE +{ + TEXT = "EINFG" ; + TEXT [ English ] = "INS" ; + TEXT [ norwegian ] = "SETT INN" ; + TEXT [ italian ] = "INS" ; + TEXT [ portuguese_brazilian ] = "INS" ; + TEXT [ portuguese ] = "INS" ; + TEXT [ finnish ] = "LIS" ; + TEXT [ danish ] = "INS" ; + TEXT [ french ] = "INS" ; + TEXT [ swedish ] = "INS" ; + TEXT [ dutch ] = "INS" ; + TEXT [ spanish ] = "INS" ; + TEXT [ english_us ] = "INS" ; +}; + +String RID_STR_OVERWRITEMODE +{ + Text = "BER" ; + Text [ English ] = "OVR" ; + Text [ norwegian ] = "+++OVR" ; + Text [ italian ] = "SSC" ; + Text [ portuguese_brazilian ] = "OVR" ; + Text [ portuguese ] = "OVR" ; + Text [ finnish ] = "KORV" ; + Text [ danish ] = "OVR" ; + Text [ french ] = "ECR" ; + Text [ swedish ] = "VER" ; + Text [ dutch ] = "OVR" ; + Text [ spanish ] = "SOB" ; + Text [ english_us ] = "OVR" ; +}; + +*/ +ImageList RID_DEFAULTIMAGELIST_SC +{ + ImageBitmap = Bitmap { FILE = "sc_ide.bmp" ; }; + MaskColor = Color { Red = 0xC000 ; Green = 0xC000 ; Blue = 0xC000 ; }; + IdList = + { + SID_BASICLOAD ; + SID_BASICSAVEAS ; + SID_BASICCOMPILE ; + SID_BASICRUN ; + SID_BASICSTEPINTO ; + SID_BASICSTEPOVER ; + SID_BASICSTEPOUT ; + SID_BASICSTOP ; + SID_BASICIDE_TOGGLEBRKPNT ; + SID_BASICIDE_ADDWATCH ; + SID_BASICIDE_MODULEDLG ; + SID_BASICIDE_OBJCAT ; + SID_UNDO ; + SID_REDO ; + SID_CHOOSE_CONTROLS ; + SID_INSERT_PUSHBUTTON ; + SID_INSERT_CHECKBOX ; + SID_INSERT_RADIOBUTTON ; + SID_INSERT_FIXEDTEXT ; + SID_INSERT_EDIT ; + SID_INSERT_GROUPBOX ; + SID_INSERT_LISTBOX ; + SID_INSERT_COMBOBOX ; + SID_SHOW_BROWSER ; + SID_DIALOG_TESTMODE ; + SID_INSERT_SPINBUTTON ; + SID_INSERT_HSCROLLBAR ; + SID_INSERT_VSCROLLBAR ; + SID_OBJECT_SELECT ; + SID_BASICIDE_MATCHGROUP ; + SID_INSERT_PREVIEW ; + SID_BASICIDE_CHOOSEMACRO ; + SID_INSERT_URLBUTTON ; + SID_SHOW_HIDDEN ; + SID_SHOW_FORMS ; + }; +}; +ImageList RID_DEFAULTIMAGELIST_LC +{ + ImageBitmap = Bitmap { FILE = "lc_ide.bmp" ; }; + MaskColor = Color { Red = 0xC000 ; Green = 0xC000 ; Blue = 0xC000 ; }; + IdList = + { + SID_BASICLOAD ; + SID_BASICSAVEAS ; + SID_BASICCOMPILE ; + SID_BASICRUN ; + SID_BASICSTEPINTO ; + SID_BASICSTEPOVER ; + SID_BASICSTEPOUT ; + SID_BASICSTOP ; + SID_BASICIDE_TOGGLEBRKPNT ; + SID_BASICIDE_ADDWATCH ; + SID_BASICIDE_MODULEDLG ; + SID_BASICIDE_OBJCAT ; + SID_UNDO ; + SID_REDO ; + SID_CHOOSE_CONTROLS ; + SID_INSERT_PUSHBUTTON ; + SID_INSERT_CHECKBOX ; + SID_INSERT_RADIOBUTTON ; + SID_INSERT_FIXEDTEXT ; + SID_INSERT_EDIT ; + SID_INSERT_GROUPBOX ; + SID_INSERT_LISTBOX ; + SID_INSERT_COMBOBOX ; + SID_SHOW_BROWSER ; + SID_DIALOG_TESTMODE ; + SID_INSERT_SPINBUTTON ; + SID_INSERT_HSCROLLBAR ; + SID_INSERT_VSCROLLBAR ; + SID_OBJECT_SELECT ; + SID_BASICIDE_MATCHGROUP ; + SID_INSERT_PREVIEW ; + SID_BASICIDE_CHOOSEMACRO ; + SID_INSERT_URLBUTTON ; + SID_SHOW_HIDDEN ; + SID_SHOW_FORMS ; + }; +}; +ToolBox RID_BASICIDE_OBJECTBAR +{ + HelpId = HID_BASICIDE_TOOLBOX ; + LineSpacing = TRUE ; + Dockable = TRUE ; + Moveable = TRUE ; + Sizeable = TRUE ; + Zoomable = TRUE ; + Scroll = TRUE ; + HideWhenDeactivate = TRUE ; + Border = TRUE ; + SVLook = TRUE ; + Align = BOXALIGN_TOP ; + Scroll = TRUE ; + Customize = TRUE ; + Text = "BASIC" ; + Text [ ENGLISH ] = "BASIC" ; + Text [ norwegian ] = "BASIC" ; + Text [ italian ] = "BASIC" ; + Text [ portuguese_brazilian ] = "BASIC" ; + Text [ portuguese ] = "BASIC" ; + Text [ finnish ] = "BASIC" ; + Text [ danish ] = "BASIC" ; + Text [ french ] = "BASIC" ; + Text [ swedish ] = "BASIC" ; + Text [ dutch ] = "BASIC" ; + Text [ spanish ] = "BASIC" ; + Text [ english_us ] = "BASIC" ; + ItemList = + { + ToolBoxItem + { + Identifier = SID_BASICIDE_LIBSELECTOR ; + Text = "Bibliothek" ; + Text [ ENGLISH ] = "Libary" ; + Text [ norwegian ] = "Libary" ; + Text [ italian ] = "LIbrary" ; + Text [ portuguese_brazilian ] = "Library" ; + Text [ portuguese ] = "Biblioteca" ; + Text [ finnish ] = "Libary" ; + Text [ danish ] = "Bibliotek" ; + Text [ french ] = "Bibliothque" ; + Text [ swedish ] = "Bibliotek" ; + Text [ dutch ] = "Bibliotheek" ; + Text [ spanish ] = "Biblioteca" ; + Text [ english_us ] = "Library" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Biblioteka"; + Text[ japanese ] = "ײ"; + Text[ chinese_traditional ] = "{w"; + Text[ arabic ] = ""; + Text[ dutch ] = "Bibliotheek"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "̺귯"; + Text[ turkish ] = "Kitaplk"; + }; + ToolBoxItem + { + Type = TOOLBOXITEM_SEPARATOR ; + }; + ToolBoxItem + { + Identifier = SID_BASICCOMPILE ; + /* ### ACHTUNG: Neuer Text in Resource? bersetzen : bersetzen */ + Text = "bersetzen" ; + Text [ ENGLISH ] = "Compile" ; + Text [ norwegian ] = "Compile" ; + Text [ italian ] = "Compila" ; + Text [ portuguese_brazilian ] = "Compilar" ; + Text [ portuguese ] = "Compilar" ; + Text [ finnish ] = "Knn" ; + Text [ danish ] = "Kompiler" ; + Text [ french ] = "Compiler" ; + Text [ swedish ] = "verstta" ; + Text [ dutch ] = "Vertalen" ; + Text [ spanish ] = "Compilar" ; + Text [ english_us ] = "Compile" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Kompiluj"; + Text[ japanese ] = "߲قs"; + Text[ chinese_traditional ] = "sĶ"; + Text[ arabic ] = ""; + Text[ dutch ] = "Vertalen"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Derle"; + }; + ToolBoxItem + { + Identifier = SID_BASICRUN ; + /* ### ACHTUNG: Neuer Text in Resource? Ausfhren : Ausfhren */ + Text = "Ausfhren" ; + Text [ ENGLISH ] = "Run" ; + Text [ norwegian ] = "Run" ; + Text [ italian ] = "Esegui" ; + Text [ portuguese_brazilian ] = "Executar" ; + Text [ portuguese ] = "Executar" ; + Text [ finnish ] = "Suorita" ; + Text [ danish ] = "Kr" ; + Text [ french ] = "Excuter" ; + Text [ swedish ] = "Kr" ; + Text [ dutch ] = "Starten" ; + Text [ spanish ] = "Ejecutar" ; + Text [ english_us ] = "Run" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Wykonaj"; + Text[ japanese ] = "s"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ dutch ] = "Starten"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Yrt"; + }; + ToolBoxItem + { + Identifier = SID_BASICSTOP ; + Text = "Anhalten" ; + Text [ ENGLISH ] = "Stop" ; + Text [ norwegian ] = "Stopp" ; + Text [ italian ] = "Arresta" ; + Text [ portuguese_brazilian ] = "Parar" ; + Text [ portuguese ] = "Parar" ; + Text [ finnish ] = "Pysyt" ; + Text [ danish ] = "Stop" ; + Text [ french ] = "Arrter" ; + Text [ swedish ] = "Stoppa" ; + Text [ dutch ] = "Stoppen" ; + Text [ spanish ] = "Detener" ; + Text [ english_us ] = "Stop" ; + Text[ chinese_simplified ] = "ֹͣ"; + Text[ russian ] = ""; + Text[ polish ] = "Zatrzymaj"; + Text[ japanese ] = "~"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ dutch ] = "Stoppen"; + Text[ chinese_simplified ] = "ֹͣ"; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Durdur"; + }; + ToolBoxItem + { + Type = TOOLBOXITEM_SEPARATOR ; + }; + ToolBoxItem + { + Identifier = SID_BASICSTEPOVER ; + Text = "Prozedurschritt" ; + Text [ ENGLISH ] = "Step over" ; + Text [ dutch ] = "Procedurestap" ; + Text [ english_us ] = "Procedure Step" ; + Text [ italian ] = "Passo di procedura" ; + Text [ spanish ] = "Paso a paso" ; + Text [ french ] = "tape de procdure" ; + Text [ swedish ] = "Procedursteg" ; + Text [ danish ] = "Proceduretrin" ; + Text [ portuguese ] = "Procedimento passo a passo" ; + Text [ portuguese_brazilian ] = "Prozedurschritt" ; + Text[ chinese_simplified ] = "̵"; + Text[ russian ] = " "; + Text[ polish ] = "Krok w procedurze"; + Text[ japanese ] = "菇"; + Text[ chinese_traditional ] = "{dzB"; + Text[ arabic ] = " "; + Text[ dutch ] = "Procedurestap"; + Text[ chinese_simplified ] = "̵"; + Text[ greek ] = " "; + Text[ korean ] = "ν ܰ"; + Text[ turkish ] = "Yordam adm"; + }; + ToolBoxItem + { + Identifier = SID_BASICSTEPINTO ; + Text = "Einzelschritt" ; + Text [ ENGLISH ] = "Step into" ; + Text [ dutch ] = "Stap voor stap" ; + Text [ english_us ] = "Single Step" ; + Text [ italian ] = "Passo singolo" ; + Text [ spanish ] = "Paso nico" ; + Text [ french ] = "tape par tape" ; + Text [ swedish ] = "Enkelsteg" ; + Text [ danish ] = "Enkelt trin" ; + Text [ portuguese ] = "Passo nico" ; + Text [ portuguese_brazilian ] = "Einzelschritt" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = " "; + Text[ polish ] = "Pojedynczy krok"; + Text[ japanese ] = "ݸ ï"; + Text[ chinese_traditional ] = "B"; + Text[ arabic ] = " "; + Text[ dutch ] = "Stap voor stap"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = " "; + Text[ korean ] = " ܰ"; + Text[ turkish ] = "Tek adm"; + }; + ToolBoxItem + { + Identifier = SID_BASICSTEPOUT ; + /* ### ACHTUNG: Neuer Text in Resource? Rcksprung : Rcksprung */ + Text = "Rcksprung" ; + Text [ ENGLISH ] = "Step out" ; + Text [ dutch ] = "Terugspringen" ; + Text [ english_us ] = "Step Back" ; + Text [ italian ] = "Salto indietro" ; + Text [ spanish ] = "Salto atrs" ; + Text [ french ] = "Saut en arrire" ; + Text [ swedish ] = "Hoppa tillbaka" ; + Text [ danish ] = "Spring tilbage" ; + Text [ portuguese ] = "Para trs" ; + Text [ portuguese_brazilian ] = "Rcksprung" ; + Text[ chinese_simplified ] = "һ"; + Text[ russian ] = " "; + Text[ polish ] = "Krok wstecz"; + Text[ japanese ] = "ï ޯ"; + Text[ chinese_traditional ] = "^@B"; + Text[ arabic ] = " "; + Text[ dutch ] = "Terugspringen"; + Text[ chinese_simplified ] = "һ"; + Text[ greek ] = " "; + Text[ korean ] = "ڷ پѱ"; + Text[ turkish ] = "Geri adm"; + }; + ToolBoxItem + { + Identifier = SID_BASICIDE_TOGGLEBRKPNT ; + Text = "Haltepunkt" ; + Text [ ENGLISH ] = "Breakpoint" ; + Text [ norwegian ] = "Breakpoint" ; + Text [ italian ] = "Punto di interruzione" ; + Text [ portuguese_brazilian ] = "Ponto de interrupo" ; + Text [ portuguese ] = "Ponto de ruptura" ; + Text [ finnish ] = "Keskeytyskohta" ; + Text [ danish ] = "Pausepunkt" ; + Text [ french ] = "Point d'arrt" ; + Text [ swedish ] = "Brytpunkt" ; + Text [ dutch ] = "Stoppunt" ; + Text [ spanish ] = "Punto de ruptura" ; + Text [ english_us ] = "Breakpoint" ; + Text[ chinese_simplified ] = "жϵ"; + Text[ russian ] = " "; + Text[ polish ] = "Punkt przerwania"; + Text[ japanese ] = "ڰ߲"; + Text[ chinese_traditional ] = "_I"; + Text[ arabic ] = " "; + Text[ dutch ] = "Stoppunt"; + Text[ chinese_simplified ] = "жϵ"; + Text[ greek ] = " "; + Text[ korean ] = "ߴ"; + Text[ turkish ] = "Kesme noktas"; + }; + ToolBoxItem + { + Identifier = SID_BASICIDE_ADDWATCH ; + Text = "Beobachter anzeigen" ; + Text [ ENGLISH ] = "Add watch" ; + Text [ dutch ] = "Bewaker weergeven" ; + Text [ english_us ] = "Add Watch" ; + Text [ italian ] = "Mostra controllo" ; + Text [ spanish ] = "Mostrar observador" ; + Text [ french ] = "Afficher l'espion" ; + Text [ swedish ] = "Visa bevakaren" ; + Text [ danish ] = "Vis observatr" ; + Text [ portuguese ] = "Mostrar Observador" ; + Text [ portuguese_brazilian ] = "Beobachter anzeigen" ; + Text[ chinese_simplified ] = "ʾ鿴"; + Text[ russian ] = " "; + Text[ polish ] = "Dodaj czujk"; + Text[ japanese ] = "ްް̕\\"; + Text[ chinese_traditional ] = "˵"; + Text[ arabic ] = " "; + Text[ dutch ] = "Bewaker weergeven"; + Text[ chinese_simplified ] = "ʾ鿴"; + Text[ greek ] = " "; + Text[ korean ] = " ߰"; + Text[ turkish ] = "zleyici ekle"; + }; + ToolBoxItem + { + Type = TOOLBOXITEM_SEPARATOR ; + }; + ToolBoxItem + { + Identifier = SID_BASICIDE_OBJCAT ; + Text = "Objektkatalog" ; + Text [ ENGLISH ] = "Objectcatalog" ; + Text [ norwegian ] = "Objectcatalog" ; + Text [ italian ] = "Catalogo oggetti" ; + Text [ portuguese_brazilian ] = "Catlogo de objetos" ; + Text [ portuguese ] = "Catlogo de objectos" ; + Text [ finnish ] = "Objektiluettelo" ; + Text [ danish ] = "Objektkatalog" ; + Text [ french ] = "Catalogue d'objets" ; + Text [ swedish ] = "Objektkatalog" ; + Text [ dutch ] = "Objectcatalogus" ; + Text [ spanish ] = "Catlogo de objetos" ; + Text [ english_us ] = "Object Catalog" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = " "; + Text[ polish ] = "Katalog obiektw"; + Text[ japanese ] = "ު ۸"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = " "; + Text[ dutch ] = "Objectcatalogus"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = " "; + Text[ korean ] = "ü īŻα"; + Text[ turkish ] = "Nesne katalou"; + }; + ToolBoxItem + { + Identifier = SID_BASICIDE_CHOOSEMACRO ; + Text = "Makros" ; + Text [ ENGLISH ] = "Macros" ; + Text [ norwegian ] = "Makroer" ; + Text [ italian ] = "Macro" ; + Text [ portuguese_brazilian ] = "Macros" ; + Text [ portuguese ] = "Macros" ; + Text [ finnish ] = "Makrot" ; + Text [ danish ] = "Makroer" ; + Text [ french ] = "Macros" ; + Text [ swedish ] = "Makron" ; + Text [ dutch ] = "Macro's" ; + Text [ spanish ] = "Macros" ; + Text [ english_us ] = "Macros" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Makra"; + Text[ japanese ] = "ϸ"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = " "; + Text[ dutch ] = "Macro's"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "ũ"; + Text[ turkish ] = "Makrolar"; + }; + ToolBoxItem + { + Identifier = SID_BASICIDE_MODULEDLG ; + Text = "Module" ; + Text [ ENGLISH ] = "Modules" ; + Text [ norwegian ] = "Moduler" ; + Text [ italian ] = "Moduli" ; + Text [ portuguese_brazilian ] = "Mdulos" ; + Text [ portuguese ] = "Mdulos" ; + Text [ finnish ] = "Moduulit" ; + Text [ danish ] = "Moduler" ; + Text [ french ] = "Modules" ; + Text [ swedish ] = "Moduler" ; + Text [ dutch ] = "Module" ; + Text [ spanish ] = "Mdulos" ; + Text [ english_us ] = "Modules" ; + Text[ chinese_simplified ] = "ģ"; + Text[ russian ] = ""; + Text[ polish ] = "Moduy"; + Text[ japanese ] = "Ӽޭ"; + Text[ chinese_traditional ] = "Ҷ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Module"; + Text[ chinese_simplified ] = "ģ"; + Text[ greek ] = " "; + Text[ korean ] = ""; + Text[ turkish ] = "Modller"; + }; + ToolBoxItem + { + Type = TOOLBOXITEM_SEPARATOR ; + }; + ToolBoxItem + { + Identifier = SID_BASICIDE_MATCHGROUP ; + Text = "Klammer suchen" ; + Text [ ENGLISH ] = "Match Bracket" ; + Text [ norwegian ] = "Match Bracket" ; + Text [ italian ] = "Abbina parentesi" ; + Text [ portuguese_brazilian ] = "Match Bracket" ; + Text [ portuguese ] = "Localizar parnteses" ; + Text [ finnish ] = "Match Bracket" ; + Text [ danish ] = "Sg parentes" ; + Text [ french ] = "Rechercher les parenthses" ; + Text [ swedish ] = "Sk parentes" ; + Text [ dutch ] = "Haakjes zoeken" ; + Text [ spanish ] = "Buscar parntesis" ; + Text [ english_us ] = "Find parentheses" ; + Text[ chinese_simplified ] = "Ѱ"; + Text[ russian ] = " "; + Text[ polish ] = "Szukaj nawiasw"; + Text[ japanese ] = "̌"; + Text[ chinese_traditional ] = "MA"; + Text[ arabic ] = " "; + Text[ dutch ] = "Haakjes zoeken"; + Text[ chinese_simplified ] = "Ѱ"; + Text[ greek ] = " "; + Text[ korean ] = "ȣ ã"; + Text[ turkish ] = "Ayralar bul"; + }; + ToolBoxItem + { + Identifier = SID_CHOOSE_CONTROLS ; + Text = "Kontrollfelder" ; + Text [ ENGLISH ] = "Controls" ; + Text [ norwegian ] = "Kontroller" ; + Text [ italian ] = "Campi di controllo" ; + Text [ portuguese_brazilian ] = "Controles" ; + Text [ portuguese ] = "Campos de controlo" ; + Text [ finnish ] = "Ohjausobjektit" ; + Text [ danish ] = "Kontrolelementer" ; + Text [ french ] = "Elments de contrle" ; + Text [ swedish ] = "Kontrollflt" ; + Text [ dutch ] = "Controlevelden" ; + Text [ spanish ] = "Campos de control" ; + Text [ english_us ] = "Controls" ; + Text[ chinese_simplified ] = "ֶ"; + Text[ russian ] = " "; + Text[ polish ] = "Pola kontrolne"; + Text[ japanese ] = "۰ ̨"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = " "; + Text[ dutch ] = "Controlevelden"; + Text[ chinese_simplified ] = "ֶ"; + Text[ greek ] = " "; + Text[ korean ] = "Ʈ"; + Text[ turkish ] = "Komut alanlar"; + }; + ToolBoxItem + { + Type = TOOLBOXITEM_SEPARATOR ; + }; + ToolBoxItem + { + Identifier = SID_BASICLOAD ; + /* ### ACHTUNG: Neuer Text in Resource? Quelltext einfgen : Quelltext einfgen */ + Text = "Quelltext einfgen" ; + Text [ ENGLISH ] = "Insert source" ; + Text [ dutch ] = "Brontekst invoegen" ; + Text [ english_us ] = "Insert Source Text" ; + Text [ italian ] = "Inserisci testo sorgente" ; + Text [ spanish ] = "Insertar texto fuente" ; + Text [ french ] = "Insrer le texte source" ; + Text [ swedish ] = "Infoga klltext" ; + Text [ danish ] = "Indst kildetekst" ; + Text [ portuguese ] = "Inserir texto fonte" ; + Text [ portuguese_brazilian ] = "Quelltext einfgen" ; + Text[ chinese_simplified ] = "Դı"; + Text[ russian ] = " "; + Text[ polish ] = "Wstaw tekst rdowy"; + Text[ japanese ] = "÷Ă̑}"; + Text[ chinese_traditional ] = "Jl"; + Text[ arabic ] = " "; + Text[ dutch ] = "Brontekst invoegen"; + Text[ chinese_simplified ] = "Դı"; + Text[ greek ] = " "; + Text[ korean ] = "ҽ ؽƮ "; + Text[ turkish ] = "Kaynak metin ekle"; + }; + ToolBoxItem + { + Identifier = SID_BASICSAVEAS ; + Text = "Quelltext speichern unter..." ; + Text [ ENGLISH ] = "Save source as..." ; + Text [ norwegian ] = "Save source as..." ; + Text [ italian ] = "Salva origine con nome..." ; + Text [ portuguese_brazilian ] = "Gravar origem como..." ; + Text [ portuguese ] = "Guardar texto-fonte como..." ; + Text [ finnish ] = "Tallenna lhde nimell..." ; + Text [ danish ] = "Gem kildetekst som..." ; + Text [ french ] = "Enregistrer le texte source sous..." ; + Text [ swedish ] = "Spara klltext som..." ; + Text [ dutch ] = "Brontekst opslaan als..." ; + Text [ spanish ] = "Guardar texto fuente como..." ; + Text [ english_us ] = "Save Source As..." ; + Text[ greek ] = " ..."; + Text[ dutch ] = "Brontekst opslaan als..."; + Text[ russian ] = " ..."; + Text[ polish ] = "Zapisz tekst rdowy jako..."; + Text[ japanese ] = "ɖOĕۑ..."; + Text[ korean ] = "ҽ ٸ ̸ ..."; + Text[ chinese_simplified ] = "ԴıΪ..."; + Text[ chinese_traditional ] = "tsl..."; + Text[ arabic ] = " ..."; + Text[ turkish ] = "Kaynak metni farkl kaydet..."; + }; + }; + Text[ chinese_simplified ] = "BASIC"; + Text[ russian ] = "BASIC"; + Text[ polish ] = "BASIC"; + Text[ japanese ] = "BASIC"; + Text[ chinese_traditional ] = "BASIC"; + Text[ arabic ] = "BASIC"; + Text[ dutch ] = "BASIC"; + Text[ chinese_simplified ] = "BASIC"; + Text[ greek ] = "BASIC"; + Text[ korean ] = "BASIC"; + Text[ turkish ] = "BASIC"; +}; + +Menu RID_POPUP_BRKPROPS +{ + Text = "Eigenschaften" ; + Text [ ENGLISH ] = "Properties" ; + Text [ norwegian ] = "Egenskaper" ; + Text [ italian ] = "Propriet" ; + Text [ portuguese_brazilian ] = "Propriedades" ; + Text [ portuguese ] = "Propriedades" ; + Text [ finnish ] = "Ominaisuudet" ; + Text [ danish ] = "Egenskaber" ; + Text [ french ] = "Proprits" ; + Text [ swedish ] = "Egenskaper" ; + Text [ dutch ] = "Eigenschappen" ; + Text [ spanish ] = "Propiedades" ; + Text [ english_us ] = "Properties" ; + DefaultItemId = RID_BRKPROPS ; + ItemList = + { + MenuItem + { + Identifier = RID_ACTIV ; + HelpId = HID_BASICIDE_ACTIV ; + Text = "Aktiv" ; + Text [ ENGLISH ] = "Active" ; + Text [ norwegian ] = "Active" ; + Text [ italian ] = "Attivo" ; + Text [ portuguese_brazilian ] = "Ativo" ; + Text [ portuguese ] = "Activo" ; + Text [ finnish ] = "Aktiivinen" ; + Text [ danish ] = "Aktiv" ; + Text [ french ] = "Actif" ; + Text [ swedish ] = "Aktiv" ; + Text [ dutch ] = "Actief" ; + Text [ spanish ] = "Activo" ; + Text [ english_us ] = "Active" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Aktywny"; + Text[ japanese ] = "è"; + Text[ chinese_traditional ] = "E"; + Text[ arabic ] = ""; + Text[ dutch ] = "Actief"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "Ȱ"; + Text[ turkish ] = "Etkin"; + }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + Identifier = RID_BRKPROPS ; + HelpId = HID_BASICIDE_BRKPROPS ; + Text = "Eigenschaften..." ; + Text [ ENGLISH ] = "Properties..." ; + Text [ norwegian ] = "Properties..." ; + Text [ italian ] = "Propriet..." ; + Text [ portuguese_brazilian ] = "Propriedades..." ; + Text [ portuguese ] = "Propriedades..." ; + Text [ finnish ] = "Ominaisuudet..." ; + Text [ danish ] = "Egenskaber..." ; + Text [ french ] = "Proprits..." ; + Text [ swedish ] = "Egenskaper..." ; + Text [ dutch ] = "Eigenschappen..." ; + Text [ spanish ] = "Propiedades..." ; + Text [ english_us ] = "Propert~ies..." ; + /* ### ACHTUNG: Neuer Text in Resource? Einstellungen fr den Haltepunkt : Einstellungen fr den Haltepunkt */ + Text[ chinese_simplified ] = "(~I)..."; + Text[ russian ] = "..."; + Text[ polish ] = "Waciwoci..."; + Text[ japanese ] = "è(~I)..."; + Text[ chinese_traditional ] = "ݩ(~I)..."; + Text[ arabic ] = "..."; + Text[ dutch ] = "Eigenschappen..."; + Text[ chinese_simplified ] = "(~I)..."; + Text[ greek ] = "..."; + Text[ korean ] = "(~I)..."; + Text[ turkish ] = "zellikler..."; + }; + }; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Waciwoci"; + Text[ japanese ] = "è"; + Text[ chinese_traditional ] = "ݩ"; + Text[ arabic ] = ""; + Text[ dutch ] = "Eigenschappen"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "zellikler"; +}; +Menu RID_POPUP_BRKDLG +{ + Text = "Haltepunkte" ; + Text [ ENGLISH ] = "Breakpoints" ; + Text [ norwegian ] = "Breakpoints" ; + Text [ italian ] = "Punti di interruzione" ; + Text [ portuguese_brazilian ] = "Pontos de interrupo" ; + Text [ portuguese ] = "Pontos de interrupo" ; + Text [ finnish ] = "Keskeytyskohdat" ; + Text [ danish ] = "Pausepunkter" ; + Text [ french ] = "Points d'arrt" ; + Text [ swedish ] = "Brytpunkter" ; + Text [ dutch ] = "Stoppunten" ; + Text [ spanish ] = "Puntos de ruptura" ; + Text [ english_us ] = "Breakpoints" ; + ItemList = + { + MenuItem + { + Identifier = RID_BRKDLG ; + HelpId = HID_BASICIDE_BRKDLG ; + Text = "Haltepunkte..." ; + Text [ ENGLISH ] = "Breakpoints..." ; + Text [ norwegian ] = "Breakpoints..." ; + Text [ italian ] = "Punti di interruzione..." ; + Text [ portuguese_brazilian ] = "Pontos de interrupo..." ; + Text [ portuguese ] = "Pontos de interrupo..." ; + Text [ finnish ] = "Keskeytyskohdat..." ; + Text [ danish ] = "Pausepunkter..." ; + Text [ french ] = "Points d'arrt..." ; + Text [ swedish ] = "Brytpunkter..." ; + Text [ dutch ] = "Stoppunten..." ; + Text [ spanish ] = "Puntos de ruptura..." ; + Text [ english_us ] = "Breakpoints..." ; + /* ### ACHTUNG: Neuer Text in Resource? Dialog fr die Haltepunkte : Dialog fr die Haltepunkte */ + Text[ chinese_simplified ] = "жϵ..."; + Text[ russian ] = " ..."; + Text[ polish ] = "Punkty przerwania..."; + Text[ japanese ] = "ڰ߲..."; + Text[ chinese_traditional ] = "_I..."; + Text[ arabic ] = "... "; + Text[ dutch ] = "Stoppunten..."; + Text[ chinese_simplified ] = "жϵ..."; + Text[ greek ] = " ..."; + Text[ korean ] = "ߴ..."; + Text[ turkish ] = "Kesme noktalar..."; + }; + }; + Text[ chinese_simplified ] = "жϵ"; + Text[ russian ] = " "; + Text[ polish ] = "Punkty przerwania"; + Text[ japanese ] = "ڰ߲"; + Text[ chinese_traditional ] = "_I"; + Text[ arabic ] = " "; + Text[ dutch ] = "Stoppunten"; + Text[ chinese_simplified ] = "жϵ"; + Text[ greek ] = " "; + Text[ korean ] = "ߴ"; + Text[ turkish ] = "Kesme noktalar"; +}; +Menu RID_POPUP_TABBAR +{ + DefaultItemId = SID_BASICIDE_HIDECURPAGE ; + ItemList = + { + MenuItem + { + /* ### ACHTUNG: Neuer Text in Resource? Einfgen : Einfgen */ + Text = "Einfgen" ; + Text [ ENGLISH ] = "Insert" ; + Text [ norwegian ] = "Sett inn" ; + Text [ italian ] = "Inserisci" ; + Text [ portuguese_brazilian ] = "Inserir" ; + Text [ portuguese ] = "Inserir" ; + Text [ finnish ] = "Lis" ; + Text [ danish ] = "Indst" ; + Text [ french ] = "Insrer" ; + Text [ swedish ] = "Infoga" ; + Text [ dutch ] = "Invoegen" ; + Text [ spanish ] = "Insertar" ; + Text [ english_us ] = "Insert" ; + Submenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = SID_BASICIDE_NEWMODULE ; + HelpId = SID_BASICIDE_NEWMODULE ; + Text = "BASIC-Modul" ; + Text [ ENGLISH ] = "BASIC module" ; + Text [ english_us ] = "BASIC Module" ; + Text [ portuguese_brazilian ] = "Mdulo" ; + Text [ swedish ] = "BASIC-modul" ; + Text [ danish ] = "BASIC-modul" ; + Text [ italian ] = "Modulo BASIC" ; + Text [ spanish ] = "Mdulo BASIC" ; + Text [ french ] = "Module BASIC" ; + Text [ dutch ] = "BASIC-module" ; + Text [ portuguese ] = "Mdulo BASIC" ; + Text[ chinese_simplified ] = "BASIC ģ"; + Text[ russian ] = " BASIC"; + Text[ polish ] = "Modu BASIC"; + Text[ japanese ] = "BASICӼޭ"; + Text[ chinese_traditional ] = "BASIC Ҷ"; + Text[ arabic ] = " BASIC "; + Text[ dutch ] = "BASIC-module"; + Text[ chinese_simplified ] = "BASIC ģ"; + Text[ greek ] = " BASIC"; + Text[ korean ] = "BASIC "; + Text[ turkish ] = "BASIC modl"; + }; + MenuItem + { + Identifier = SID_BASICIDE_NEWDIALOG ; + HelpId = SID_BASICIDE_NEWDIALOG ; + Text = "BASIC-Dialog" ; + Text [ ENGLISH ] = "BASIC dialog" ; + Text [ english_us ] = "BASIC Dialog" ; + Text [ portuguese_brazilian ] = "Dilogo" ; + Text [ swedish ] = "BASIC-dialog" ; + Text [ danish ] = "BASIC-dialog" ; + Text [ italian ] = "Dialogo BASIC" ; + Text [ spanish ] = "Dilogo BASIC" ; + Text [ french ] = "Bote de dialogue BASIC" ; + Text [ dutch ] = "BASIC-dialoog" ; + Text [ portuguese ] = "Dilogo BASIC" ; + Text[ chinese_simplified ] = "BASIC Ի"; + Text[ russian ] = " BASIC"; + Text[ polish ] = "Dialog BASIC"; + Text[ japanese ] = "BASIC۸"; + Text[ chinese_traditional ] = "BASIC ܤ"; + Text[ arabic ] = " BASIC "; + Text[ dutch ] = "BASIC-dialoog"; + Text[ chinese_simplified ] = "BASIC Ի"; + Text[ greek ] = " BASIC"; + Text[ korean ] = "BASIC ȭ"; + Text[ turkish ] = "BASIC diyalou"; + }; + }; + }; + /* ### ACHTUNG: Neuer Text in Resource? Modul oder Dialog einfgen : Modul oder Dialog einfgen */ + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Wstaw"; + Text[ japanese ] = "}"; + Text[ chinese_traditional ] = "J"; + Text[ arabic ] = ""; + Text[ dutch ] = "Invoegen"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Ekle"; + }; + MenuItem + { + Identifier = SID_BASICIDE_DELETECURRENT ; + HelpId = SID_BASICIDE_DELETECURRENT ; + /* ### ACHTUNG: Neuer Text in Resource? Lschen : Lschen */ + Text = "Lschen" ; + Text [ ENGLISH ] = "Delete" ; + Text [ norwegian ] = "Slett" ; + Text [ italian ] = "Cancella" ; + Text [ portuguese_brazilian ] = "Apagar" ; + Text [ portuguese ] = "Eliminar" ; + Text [ finnish ] = "Poista" ; + Text [ danish ] = "Slet" ; + Text [ french ] = "Supprimer" ; + Text [ swedish ] = "Radera" ; + Text [ dutch ] = "Wissen" ; + Text [ spanish ] = "Eliminar" ; + Text [ english_us ] = "Delete" ; + /* ### ACHTUNG: Neuer Text in Resource? Modul oder Dialog lschen : Modul oder Dialog lschen */ + Text[ chinese_simplified ] = "ɾ"; + Text[ russian ] = ""; + Text[ polish ] = "Usu"; + Text[ japanese ] = "폜"; + Text[ chinese_traditional ] = "R"; + Text[ arabic ] = ""; + Text[ dutch ] = "Wissen"; + Text[ chinese_simplified ] = "ɾ"; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Sil"; + }; + MenuItem + { + Identifier = SID_BASICIDE_RENAMECURRENT ; + HelpId = SID_BASICIDE_RENAMECURRENT ; + Text = "Umbenennen" ; + Text [ ENGLISH ] = "Rename" ; + Text [ norwegian ] = "Gi nytt navn til" ; + Text [ italian ] = "Rinomina" ; + Text [ portuguese_brazilian ] = "Renomear" ; + Text [ portuguese ] = "Mudar nome" ; + Text [ finnish ] = "Nime" ; + Text [ danish ] = "Omdb" ; + Text [ french ] = "Renommer" ; + Text [ swedish ] = "Byt namn" ; + Text [ dutch ] = "Naam wijzigen" ; + Text [ spanish ] = "Cambiar nombre" ; + Text [ english_us ] = "Rename" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Zmie nazw"; + Text[ japanese ] = "O̕ύX"; + Text[ chinese_traditional ] = "sRW"; + Text[ arabic ] = " "; + Text[ dutch ] = "Naam wijzigen"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "̸ "; + Text[ turkish ] = "Yeniden adlandr"; + }; + MenuItem + { + Identifier = SID_BASICIDE_HIDECURPAGE ; + HelpId = SID_BASICIDE_HIDECURPAGE ; + Text = "Ausblenden" ; + Text [ ENGLISH ] = "Hide" ; + Text [ norwegian ] = "Hide" ; + Text [ italian ] = "Nascondi" ; + Text [ portuguese_brazilian ] = "Ocultar" ; + Text [ portuguese ] = "Ocultar" ; + Text [ finnish ] = "Piilota" ; + Text [ danish ] = "Skjul" ; + Text [ french ] = "Masquer" ; + Text [ swedish ] = "Dlj" ; + Text [ dutch ] = "Verbergen" ; + Text [ spanish ] = "Ocultar" ; + Text [ english_us ] = "Hide" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Ukryj"; + Text[ japanese ] = "\\"; + Text[ chinese_traditional ] = "J"; + Text[ arabic ] = ""; + Text[ dutch ] = "Verbergen"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Gizle"; + }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + Identifier = SID_BASICIDE_MODULEDLG ; + HelpId = SID_BASICIDE_MODULEDLG ; + Text = "Module..." ; + Text [ ENGLISH ] = "Modules..." ; + Text [ norwegian ] = "Modules..." ; + Text [ italian ] = "Moduli..." ; + Text [ portuguese_brazilian ] = "Mdulos..." ; + Text [ portuguese ] = "Mdulos..." ; + Text [ finnish ] = "Moduulit..." ; + Text [ danish ] = "Moduler..." ; + Text [ french ] = "Modules..." ; + Text [ swedish ] = "Moduler..." ; + Text [ dutch ] = "Modules..." ; + Text [ spanish ] = "Mdulos..." ; + Text [ english_us ] = "Modules..." ; + Text[ chinese_simplified ] = "ģ..."; + Text[ russian ] = "..."; + Text[ polish ] = "Moduy..."; + Text[ japanese ] = "Ӽޭ..."; + Text[ chinese_traditional ] = "Ҷ..."; + Text[ arabic ] = "... "; + Text[ dutch ] = "Modules..."; + Text[ chinese_simplified ] = "ģ..."; + Text[ greek ] = " ..."; + Text[ korean ] = "..."; + Text[ turkish ] = "Modller..."; + }; + }; +}; +ImageList RID_IMGLST_OBJECTS +{ + ImageBitmap = Bitmap { FILE = "images.bmp" ; }; + MaskColor = Color { Red = 0xFFFF ; Green = 0xFFFF ; Blue = 0xFFFF ; }; + IdList = + { + IMGID_APPICON ; + IMGID_LIB ; + IMGID_MODULE ; + IMGID_MACRO ; + IMGID_OBJECT ; + IMGID_SUBOBJ ; + IMGID_PROP ; + IMGID_DOCUMENT ; + IMGID_LIBNOTLOADED ; + }; +}; +ImageList RID_IMGLST_LAYOUT +{ + ImageBitmap = Bitmap { FILE = "images2.bmp" ; }; + MaskColor = Color { Red = 0xFFFF ; Green = 0xFFFF ; Blue = 0xFFFF ; }; + IdList = + { + IMGID_BRKENABLED ; + IMGID_BRKDISABLED ; + IMGID_STEPMARKER ; + IMGID_ERRORMARKER ; + }; +}; +Image RID_IMG_MARKER +{ + ImageBitmap = Bitmap { File = "basstep.bmp" ; }; + MaskColor = Color { Red = 0xFFFF ; Green = 0xFFFF ; Blue = 0xFFFF ; }; +}; +Image RID_IMG_LOCKED +{ + ImageBitmap = Bitmap { File = "locked.bmp" ; }; + MaskColor = Color { Red = 0xFFFF ; Green = 0xFFFF ; Blue = 0xFFFF ; }; +}; diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx new file mode 100644 index 000000000..ec9cca4ea --- /dev/null +++ b/basctl/source/basicide/basobj2.cxx @@ -0,0 +1,201 @@ +/************************************************************************* + * + * $RCSfile: basobj2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <ide_pch.hxx> + +#pragma hdrstop + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#include <basobj.hxx> +#include <iderdll.hxx> +#include <iderdll2.hxx> +#include <iderid.hxx> +#include <macrodlg.hxx> +#include <moduldlg.hxx> +#include <basidesh.hxx> + +SfxMacro* BasicIDE::CreateMacro() +{ + DBG_ERROR( "BasicIDE::CreateMacro() - war eigentlich nur fuer Macro-Recording!" ); + IDE_DLL()->GetExtraData()->ChoosingMacro() = TRUE; + SFX_APP()->EnterBasicCall(); + Window* pParent = Application::GetDefDialogParent(); + SfxMacro* pMacro = 0; + MacroChooser* pChooser = new MacroChooser( pParent, TRUE ); + Window* pOldModalDialogParent = Application::GetDefDialogParent(); + Application::SetDefDialogParent( pChooser ); +// pChooser->SetMode( MACROCHOOSER_RECORDING ); + short nRetValue = pChooser->Execute(); + + Application::SetDefDialogParent( pOldModalDialogParent ); + delete pChooser; + + SFX_APP()->LeaveBasicCall(); + IDE_DLL()->GetExtraData()->ChoosingMacro() = FALSE; + + return pMacro; +} + +SbMethod* BasicIDE::ChooseMacro( BOOL bExecute, BOOL bChooseOnly ) +{ + IDE_DLL()->GetExtraData()->ChoosingMacro() = TRUE; + SFX_APP()->EnterBasicCall(); + + SbMethod* pMethod = NULL; + + Window* pParent = Application::GetDefDialogParent(); + + MacroChooser* pChooser = new MacroChooser( pParent, TRUE ); + if ( bChooseOnly || !SFX_APP()->HasFeature( SFX_FEATURE_BASIC_IDE ) ) + pChooser->SetMode( MACROCHOOSER_CHOOSEONLY ); + + short nRetValue = pChooser->Execute(); + + IDE_DLL()->GetExtraData()->ChoosingMacro() = FALSE; + + switch ( nRetValue ) + { + case MACRO_OK_RUN: + { + pMethod = pChooser->GetMacro(); + if ( pMethod && bExecute ) + { + pMethod->AddRef(); // festhalten, bis Event abgearbeitet. + Application::PostUserEvent( LINK( IDE_DLL()->GetExtraData(), BasicIDEData, ExecuteMacroEvent ), pMethod ); + } + } + break; + } + + delete pChooser; + + SFX_APP()->LeaveBasicCall(); + + return pMethod; +} + +SbMethod* BasicIDE::ChooseMacro( BOOL bExecute, BOOL bChooseOnly, const String& rPreferredMacroDesciption ) +{ + if ( rPreferredMacroDesciption.Len() ) + IDE_DLL()->GetExtraData()->GetLastMacro() = rPreferredMacroDesciption; + return BasicIDE::ChooseMacro( bExecute, bChooseOnly ); +} + +void BasicIDE::Organize() +{ + Window* pParent = Application::GetDefDialogParent(); + OrganizeDialog* pDlg = new OrganizeDialog( pParent ); + if ( IDE_DLL()->GetShell() ) + { + IDEBaseWindow* pWin = IDE_DLL()->GetShell()->GetCurWindow(); + if ( pWin ) + pDlg->SetCurrentModule( pWin->CreateSbxDescription() ); + } + pDlg->Execute(); + delete pDlg; +} + + + +BOOL BasicIDE::IsValidSbxName( const String& rName ) +{ + for ( USHORT nChar = 0; nChar < rName.Len(); nChar++ ) + { + BOOL bValid = ( ( rName.GetChar(nChar) >= 'A' && rName.GetChar(nChar) <= 'Z' ) || + ( rName.GetChar(nChar) >= 'a' && rName.GetChar(nChar) <= 'z' ) || + ( rName.GetChar(nChar) >= '0' && rName.GetChar(nChar) <= '9' && nChar ) || + ( rName.GetChar(nChar) == '_' ) ); + if ( !bValid ) + return FALSE; + } + return TRUE; +} + + + +SbMethod* BasicIDE::FindMacro( SbModule* pModule, const String& rMacroName ) +{ + return (SbMethod*)pModule->GetMethods()->Find( rMacroName, SbxCLASS_METHOD ); +} + +SbModule* BasicIDE::FindModule( StarBASIC* pBasic, const String& rModName ) +{ + return pBasic->FindModule( rModName ); +} + +USHORT BasicIDE::GetBasicDialogCount() +{ + return IDE_DLL()->GetExtraData()->GetBasicDialogCount(); +} + +void BasicIDE::IncBasicDialogCount() +{ + IDE_DLL()->GetExtraData()->IncBasicDialogCount(); +} + +void BasicIDE::DecBasicDialogCount() +{ + DBG_ASSERT( GetBasicDialogCount(), "DecBasicDialogCount() - Count allready 0!" ); + IDE_DLL()->GetExtraData()->DecBasicDialogCount(); +} diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx new file mode 100644 index 000000000..dc9664070 --- /dev/null +++ b/basctl/source/basicide/basobj3.cxx @@ -0,0 +1,531 @@ +/************************************************************************* + * + * $RCSfile: basobj3.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <ide_pch.hxx> + +#pragma hdrstop + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#define _SVSTDARR_STRINGS +#include <svtools/svstdarr.hxx> +#include <iderdll.hxx> +#include <iderid.hxx> +#include <basobj.hxx> +#include <basidesh.hxx> +#include <basidesh.hrc> +#include <objdlg.hxx> +#include <bastypes.hxx> + +#include <baside2.hxx> + + +// In bastype3.cxx: +USHORT GetDialogSbxId(); + +#define LINE_SEP 0x0A + +SbMethod* BasicIDE::CreateMacro( SbModule* pModule, const String& rMacroName ) +{ + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_STOREALLMODULESOURCES ); + } + + if ( pModule->GetMethods()->Find( rMacroName, SbxCLASS_METHOD ) ) + return 0; + + String aMacroName( rMacroName ); + if ( aMacroName.Len() == 0 ) + { + if ( !pModule->GetMethods()->Count() ) + aMacroName = String( RTL_CONSTASCII_USTRINGPARAM( "Main" ) ); + else + { + BOOL bValid = FALSE; + String aStdMacroText( IDEResId( RID_STR_STDMACRONAME ) ); + USHORT nMacro = 1; + while ( !bValid ) + { + aMacroName = aStdMacroText; + aMacroName += String::CreateFromInt32( nMacro ); + // Pruefen, ob vorhanden... + bValid = pModule->GetMethods()->Find( aMacroName, SbxCLASS_METHOD ) ? FALSE : TRUE; + nMacro++; + } + } + } + + String aSource( pModule->GetSource() ); + aSource.ConvertLineEnd( LINEEND_LF ); + + // Nicht zu viele Leerzeilen erzeugen... + if ( aSource.Len() > 2 ) + { + if ( aSource.GetChar( aSource.Len() - 1 ) != LINE_SEP ) + aSource += String( RTL_CONSTASCII_USTRINGPARAM( "\n\n" ) ); + else if ( aSource.GetChar( aSource.Len() - 2 ) != LINE_SEP ) + aSource += String( RTL_CONSTASCII_USTRINGPARAM( "\n" ) ); + else if ( aSource.GetChar( aSource.Len() - 3 ) == LINE_SEP ) + aSource.Erase( (USHORT)(aSource.Len()-1), 1 ); + } + + String aSubStr; + aSubStr = String( RTL_CONSTASCII_USTRINGPARAM( "Sub " ) ); + aSubStr += aMacroName; + aSubStr += String( RTL_CONSTASCII_USTRINGPARAM( "\n\nEnd Sub" ) ); + + aSource += aSubStr; + pModule->SetSource( aSource ); +// SbxObject* pObject = pModule->GetParent(); +// DBG_ASSERT( pObject->ISA( StarBASIC ), "Kein Basic! (GetParent)" ); +// ((StarBASIC*)pObject)->Compile( pModule ); + SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Find( aMacroName, SbxCLASS_METHOD ); + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_UPDATEALLMODULESOURCES ); + } + SbxObject* pParent = pModule->GetParent(); + if ( pParent && pParent->ISA( StarBASIC ) ) + BasicIDE::MarkDocShellModified( (StarBASIC*)pParent ); + return pMethod; +} + +String BasicIDE::CreateDialogName( StarBASIC* pBasic, const String& rDlgName ) +{ + String aDlgName( rDlgName ); + if ( aDlgName.Len() == 0 ) + { + String aDlgStdName( IDEResId( RID_STR_STDDIALOGNAME ) ); + BOOL bValid = FALSE; + USHORT i = 1; + while ( !bValid ) + { + aDlgName = aDlgStdName; + aDlgName += String::CreateFromInt32( i ); + if ( !BasicIDE::FindDialog( pBasic, aDlgName ) ) + bValid = TRUE; + + i++; + } + } + return aDlgName; +} + +SbxObject* BasicIDE::CreateDialog( StarBASIC* pBasic, const String& rDlgName ) +{ + String aDlgName = CreateDialogName( pBasic, rDlgName ); + SbxObject* pDlg = pBasic->MakeObject( aDlgName, String( RTL_CONSTASCII_USTRINGPARAM( "Dialog" ) ) ); + BasicIDE::MarkDocShellModified( pBasic ); + + return pDlg; +} + +String BasicIDE::CreateModuleName( StarBASIC* pBasic, const String& rModName ) +{ + String aModName( rModName ); + if ( aModName.Len() == 0 ) + { + // Namen generieren... + String aModStdName( IDEResId( RID_STR_STDMODULENAME ) ); + BOOL bValid = FALSE; + USHORT i = 1; + while ( !bValid ) + { + aModName = aModStdName; + aModName += String::CreateFromInt32( i ); + if ( !pBasic->FindModule( aModName ) ) + bValid = TRUE; + + i++; + } + } + return aModName; +} + +SbModule* BasicIDE::CreateModule( StarBASIC* pBasic, const String& rModName, BOOL bCreateMain ) +{ + if ( pBasic->FindModule( rModName ) ) + return 0; + + String aModName = CreateModuleName( pBasic, rModName ); + + String aSource( String( RTL_CONSTASCII_USTRINGPARAM( "REM ***** BASIC *****\n\n" ) ) ); + if ( bCreateMain ) + aSource += String( RTL_CONSTASCII_USTRINGPARAM( "Sub Main\n\nEnd Sub" ) ); + + SbModule* pModule; + pModule = pBasic->MakeModule( aModName, aSource ); + + DBG_ASSERT( pModule, "Modul?!" ); + BasicIDE::MarkDocShellModified( pBasic ); + return pModule; +} + + + +SbxObject* BasicIDE::FindDialog( StarBASIC* pBasic, const String& rDlgName ) +{ + pBasic->GetAll( SbxCLASS_OBJECT ); + + USHORT nObjs = pBasic->GetObjects()->Count(); + for ( USHORT nObject = 0; nObject < nObjs; nObject++ ) + { + SbxVariable* pVar = pBasic->GetObjects()->Get( nObject ); + if ( ( pVar->GetSbxId() == GetDialogSbxId() ) && ( pVar->GetName() == rDlgName ) ) + return (SbxObject*)pVar; + } + + return 0; +} + + + +StarBASIC* BasicIDE::FindBasic( const SbxVariable* pVar ) +{ + const SbxVariable* pSbx = pVar; + while ( pSbx && !pSbx->ISA( StarBASIC ) ) + pSbx = pSbx->GetParent(); + + DBG_ASSERT( !pSbx || pSbx->ISA( StarBASIC ), "Find Basic: Kein Basic!" ); + return (StarBASIC*)pSbx; +} + + + +BasicManager* BasicIDE::FindBasicManager( StarBASIC* pLib ) +{ + BasicManager* pBasicMgr = SFX_APP()->GetBasicManager(); + SfxObjectShell* pDocShell = 0; + while ( pBasicMgr ) + { + USHORT nLibs = pBasicMgr->GetLibCount(); + for ( USHORT nLib = 0; nLib < nLibs; nLib++ ) + { + StarBASIC* pL = pBasicMgr->GetLib( nLib ); + if ( pL == pLib ) + return pBasicMgr; + } + + if ( pDocShell ) + pDocShell = SfxObjectShell::GetNext( *pDocShell ); + else + pDocShell = SfxObjectShell::GetFirst(); + + pBasicMgr = ( pDocShell ? pDocShell->GetBasicManager() : 0 ); + } + return 0; +} + +BasicManager* BasicIDE::FindBasicManager( const String& aBasMgr ) +{ + BasicManager* pBasicMgr = SFX_APP()->GetBasicManager(); + SfxObjectShell* pDocShell = 0; + while ( pBasicMgr ) + { + String aMgr; + if (pDocShell) + aMgr = pDocShell->GetTitle( SFX_TITLE_FILENAME ); + else + aMgr = Application::GetAppName(); + + if ( aMgr == aBasMgr ) + return pBasicMgr; + + if ( pDocShell ) + pDocShell = SfxObjectShell::GetNext( *pDocShell ); + else + pDocShell = SfxObjectShell::GetFirst(); + + pBasicMgr = ( pDocShell ? pDocShell->GetBasicManager() : 0 ); + } + return 0; +} + +String BasicIDE::FindTitle( BasicManager* pBasicManager, USHORT nSFXTitleType ) +{ + BasicManager* pBasicMgr = SFX_APP()->GetBasicManager(); + SfxObjectShell* pDocShell = 0; + String aTitle; + while ( pBasicMgr ) + { + if ( pBasicMgr == pBasicManager ) + { + if (pDocShell) + aTitle = pDocShell->GetTitle( nSFXTitleType ); + else + aTitle = Application::GetAppName(); + return aTitle; + } + + if ( pDocShell ) + pDocShell = SfxObjectShell::GetNext( *pDocShell ); + else + pDocShell = SfxObjectShell::GetFirst(); + + pBasicMgr = ( pDocShell ? pDocShell->GetBasicManager() : 0 ); + } + return aTitle; +} + +SfxObjectShell* BasicIDE::FindDocShell( BasicManager* pBasMgr ) +{ + SfxObjectShell* pDocShell = SfxObjectShell::GetFirst(); + while ( pDocShell ) + { + if ( ( pDocShell->GetBasicManager() != SFX_APP()->GetBasicManager() ) && + ( pDocShell->GetBasicManager() == pBasMgr ) ) + { + return pDocShell; + } + pDocShell = SfxObjectShell::GetNext( *pDocShell ); + } + return 0; +} + +void BasicIDE::MarkDocShellModified( StarBASIC* pBasic ) +{ + // BasicManager suchen, der zur Lib passt... + BasicManager* pBasMgr = BasicIDE::FindBasicManager( pBasic ); + // Koennte z.B. nach CloseDoc schon weg sein... + if ( pBasMgr ) + { + SfxObjectShell* pShell = BasicIDE::FindDocShell( pBasMgr ); + // Muss ja nicht aus einem Document kommen... + if ( pShell ) + { + pShell->SetModified(); + SfxBindings& rBindings = BasicIDE::GetBindings(); + rBindings.Invalidate( SID_SAVEDOC ); + rBindings.Update( SID_SAVEDOC ); + + } + } + + // Objectcatalog updaten... + BasicIDEShell* pShell = IDE_DLL()->GetShell(); + ObjectCatalog* pObjCatalog = pShell ? pShell->GetObjectCatalog() : 0; + if ( pObjCatalog ) + pObjCatalog->UpdateEntries(); +} + +void BasicIDE::RunMethod( SbMethod* pMethod ) +{ + SbxValues aRes; + aRes.eType = SbxVOID; + pMethod->Get( aRes ); +} + +void BasicIDE::StopBasic() +{ + StarBASIC::Stop(); + BasicIDEShell* pShell = IDE_DLL()->GetShell(); + if ( pShell ) + { + IDEWindowTable& rWindows = pShell->GetIDEWindowTable(); + IDEBaseWindow* pWin = rWindows.First(); + while ( pWin ) + { + // BasicStopped von Hand rufen, da das Stop-Notify ggf. sonst nicht + // durchkommen kann. + pWin->BasicStopped(); + pWin = rWindows.Next(); + } + } + BasicIDE::BasicStopped(); +} + +void BasicIDE::BasicStopped( BOOL* pbAppWindowDisabled, + BOOL* pbDispatcherLocked, USHORT* pnWaitCount, + SfxUInt16Item** ppSWActionCount, SfxUInt16Item** ppSWLockViewCount ) +{ + // Nach einem Error oder dem expliziten abbrechen des Basics muessen + // ggf. einige Locks entfernt werden... + + if ( pbAppWindowDisabled ) + *pbAppWindowDisabled = FALSE; + if ( pbDispatcherLocked ) + *pbDispatcherLocked = FALSE; + if ( pnWaitCount ) + *pnWaitCount = 0; + if ( ppSWActionCount ) + *ppSWActionCount = 0; + if ( ppSWLockViewCount ) + *ppSWLockViewCount = 0; + + // AppWait ? + USHORT nWait = 0; + while ( Application::IsWait() ) + { + Application::LeaveWait(); + nWait++; + } + if ( pnWaitCount ) + *pnWaitCount = nWait; + + // Interactive = FALSE ? + if ( SFX_APP()->IsDispatcherLocked() ) + { + SFX_APP()->LockDispatcher( FALSE ); + if ( pbDispatcherLocked ) + *pbDispatcherLocked = TRUE; + } + Window* pDefParent = Application::GetDefDialogParent(); + if ( !pDefParent->IsEnabled() ) + { + // Aber nicht wenn sich noch ein Dialog im Testmodus befindet! +// if ( pDefParent == Application::GetAppWindow() ) + { +// Application::GetAppWindow()->Enable( TRUE ); + pDefParent->Enable( TRUE ); + if ( pbAppWindowDisabled ) + *pbAppWindowDisabled = TRUE; + } + } + +} + +void BasicIDE::InvalidateDebuggerSlots() +{ + SfxBindings& rBindings = BasicIDE::GetBindings(); + rBindings.Invalidate( SID_BASICSTOP ); + rBindings.Update( SID_BASICSTOP ); + rBindings.Invalidate( SID_BASICRUN ); + rBindings.Update( SID_BASICRUN ); + rBindings.Invalidate( SID_BASICCOMPILE ); + rBindings.Update( SID_BASICCOMPILE ); + rBindings.Invalidate( SID_BASICSTEPOVER ); + rBindings.Update( SID_BASICSTEPOVER ); + rBindings.Invalidate( SID_BASICSTEPINTO ); + rBindings.Update( SID_BASICSTEPINTO ); + rBindings.Invalidate( SID_BASICSTEPOUT ); + rBindings.Update( SID_BASICSTEPOUT ); + rBindings.Invalidate( SID_BASICIDE_TOGGLEBRKPNT ); + rBindings.Update( SID_BASICIDE_TOGGLEBRKPNT ); + rBindings.Invalidate( SID_BASICIDE_STAT_POS ); + rBindings.Update( SID_BASICIDE_STAT_POS ); +} + +void BasicIDE::HandleBasicError() +{ + ErrorHandler::HandleError( StarBASIC::GetErrorCode() ); +} + +SvStrings* BasicIDE::CreateBasicLibBoxEntries() +{ + SvStrings* pStrings = new SvStrings; + pStrings->Insert( new String( IDEResId( RID_STR_ALL ) ), 0 ); + + BasicManager* pBasicMgr = SFX_APP()->GetBasicManager(); + SfxObjectShell* pDocShell = 0; + while ( pBasicMgr ) + { + // Nur, wenn es ein dazugehoeriges Fenster gibt, damit nicht die + // Gecachten Docs, die nicht sichtbar sind ( Remot-Dokumente ) + if ( !pDocShell || ( ( pBasicMgr != SFX_APP()->GetBasicManager() ) + && ( SfxViewFrame::GetFirst( pDocShell ) ) ) ) + { + String aBasMgr; + if (pDocShell) + aBasMgr = pDocShell->GetTitle( SFX_TITLE_FILENAME ); + else + aBasMgr = Application::GetAppName(); + + USHORT nLibs = pBasicMgr->GetLibCount(); + for ( USHORT nLib = 0; nLib < nLibs; nLib++ ) + { + // Auch nicht geladene Libs anbieten... + String aLibName = pBasicMgr->GetLibName( nLib ); + String* pEntry = new String( CreateMgrAndLibStr( aBasMgr, aLibName ) ); + pStrings->Insert( pEntry, pStrings->Count() ); + } + } + + if ( pDocShell ) + pDocShell = SfxObjectShell::GetNext( *pDocShell ); + else + pDocShell = SfxObjectShell::GetFirst(); + + pBasicMgr = ( pDocShell ? pDocShell->GetBasicManager() : 0 ); + } + return pStrings; +} + +SfxBindings& BasicIDE::GetBindings() +{ + BasicIDEDLL* pIDEDLL = IDE_DLL(); + if ( pIDEDLL && pIDEDLL->GetShell() ) + { + // #63960# fuer BasicIDE die Bindings der APP + // 07/00 Now the APP Dispatcher is 'dead', SFX changes... +// return SFX_APP()->GetAppBindings(); + return pIDEDLL->GetShell()->GetFrame()->GetBindings(); + } + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + return pCurFrame->GetBindings(); +} + diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx new file mode 100644 index 000000000..0b9a9321c --- /dev/null +++ b/basctl/source/basicide/bastype2.cxx @@ -0,0 +1,355 @@ +/************************************************************************* + * + * $RCSfile: bastype2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <ide_pch.hxx> + +#pragma hdrstop + +#include <basidesh.hrc> +#include <bastypes.hxx> +#include <bastype2.hxx> +#include <basobj.hxx> +#include <baside2.hrc> +#include <iderid.hxx> + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif + + + +BasicTreeListBox::BasicTreeListBox( Window* pParent, const ResId& rRes ) : + SvTreeListBox( pParent, IDEResId( rRes.GetId() ) ), + aImages( IDEResId( RID_IMGLST_OBJECTS ) ) +{ + SetSelectionMode( SINGLE_SELECTION ); + nMode = 0xFF; // Alles +} + + + +BasicTreeListBox::~BasicTreeListBox() +{ + // UserDaten zerstoeren + SvLBoxEntry* pEntry = First(); + while ( pEntry ) + { + delete (BasicEntry*)pEntry->GetUserData(); + pEntry = Next( pEntry ); + } +} + +void BasicTreeListBox::ScanBasic( BasicManager* pBasMgr, const String& rName ) +{ + DBG_ASSERT( pBasMgr, "Wir scannen einen NULL-Pointer... (warum kein BasicManager?!)" ); + + // eigentlich prueffen, ob Basic bereits im Baum ?! + SetUpdateMode( FALSE ); + + // Erste Ebene: Welcher BasicManager ( App, Doc, ... ) + // 30.1.96: ScanBasic kann mehrfach zum Updateten aufgerufen werden + // => pruefen, ob Eintrag schon vorhanden. + SvLBoxEntry* pBasicManagerRootEntry = FindEntry( 0, rName, OBJTYPE_BASICMANAGER ); + if ( !pBasicManagerRootEntry ) + { + Image aImage( aImages.GetImage( ( pBasMgr == SFX_APP()->GetBasicManager() ) ? IMGID_APPICON : IMGID_DOCUMENT ) ); + pBasicManagerRootEntry = InsertEntry( rName, aImage, aImage, 0, FALSE, LIST_APPEND ); + pBasicManagerRootEntry->SetUserData( new BasicManagerEntry( pBasMgr ) ); + } + + // Zweite Ebene: Libs ( Standard, ... ) + USHORT nLibs = pBasMgr->GetLibCount(); + for ( USHORT nLib = 0; nLib < nLibs; nLib++ ) + { + StarBASIC* pLib = pBasMgr->GetLib( nLib ); + String aLibName = pBasMgr->GetLibName( nLib ); + + // Jetzt LoadOnDemand... +// if ( !pLib ) // Nicht geladen... +// continue; + + SvLBoxEntry* pLibRootEntry = FindEntry( pBasicManagerRootEntry, aLibName, OBJTYPE_LIB ); + if ( !pLibRootEntry ) + { + Image aImage( aImages.GetImage( pLib ? IMGID_LIB : IMGID_LIBNOTLOADED ) ); + pLibRootEntry = InsertEntry( aLibName, aImage, aImage, + pBasicManagerRootEntry, pLib ? FALSE : TRUE , LIST_APPEND ); + pLibRootEntry->SetUserData( new BasicEntry( OBJTYPE_LIB ) ); + } + + if ( pLib ) + ImpCreateLibSubEntries( pLibRootEntry, pLib ); + } + + SetUpdateMode( TRUE ); +} + +void BasicTreeListBox::ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, StarBASIC* pLib ) +{ + // Erst die Module... + if ( pLib && ( nMode & BROWSEMODE_MODULES ) ) + { + for ( USHORT nMod = 0; nMod < pLib->GetModules()->Count(); nMod++ ) + { + SbModule* pModule = (SbModule*)pLib->GetModules()->Get( nMod ); + DBG_ASSERT( pModule, "Modul nicht erhalten!" ); + String aName( pModule->GetName() ); + SvLBoxEntry* pModuleEntry = FindEntry( pLibRootEntry, aName, OBJTYPE_MODULE ); + if ( !pModuleEntry ) + { + USHORT nImgId = IMGID_MODULE; + Image aImage( aImages.GetImage( nImgId ) ); + pModuleEntry = InsertEntry( aName, aImage, aImage, pLibRootEntry, FALSE, LIST_APPEND ); + pModuleEntry->SetUserData( new BasicEntry( OBJTYPE_MODULE ) ); + } + + if ( nMode & BROWSEMODE_SUBS ) + { + Image aImage( aImages.GetImage( IMGID_MACRO ) ); + for ( USHORT nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) + { + SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); + DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); + SvLBoxEntry* pEntry = FindEntry( pModuleEntry, pMethod->GetName(), OBJTYPE_METHOD ); + if ( !pEntry ) + { + pEntry = InsertEntry( pMethod->GetName(), aImage, aImage, pModuleEntry, FALSE, LIST_APPEND ); + pEntry->SetUserData( new BasicEntry( OBJTYPE_METHOD ) ); + } + } + } + } + } + + // ...und dann die lebenden Objecte. + if ( pLib && ( nMode & BROWSEMODE_OBJS ) ) + { + pLib->GetAll( SbxCLASS_OBJECT ); + for ( USHORT nObject = 0; nObject < pLib->GetObjects()->Count(); nObject++ ) + { + SbxVariable* pVar = pLib->GetObjects()->Get( nObject ); +#ifndef BASICDEBUG + if ( pVar->GetSbxId() == GetDialogSbxId() ) +#endif + { + // Dialoge erhalten ChildsOnDemand und koennen + // jederzeit weiter aufgeklappt werden... + SvLBoxEntry* pEntry = FindEntry( pLibRootEntry, pVar->GetName(), OBJTYPE_OBJECT ); + if ( !pEntry ) + { + pEntry = InsertEntry( pVar->GetName(), aImages.GetImage( IMGID_OBJECT ), aImages.GetImage( IMGID_OBJECT ), pLibRootEntry, TRUE, LIST_APPEND ); + pEntry->SetUserData( new BasicEntry( OBJTYPE_OBJECT ) ); + } + } + } + } + +} + +void BasicTreeListBox::UpdateEntries() +{ + String aCurEntry = CreateEntryDescription( *this, FirstSelected() ); + + // Erstmal die vorhandenen Eintraege auf existens pruefen: + SvLBoxEntry* pLastValid = 0; + SvLBoxEntry* pEntry = First(); + while ( pEntry ) + { + BOOL bFound = FindVariable( pEntry ) ? TRUE : FALSE; + if ( !bFound && !GetModel()->GetDepth( pEntry ) ) + { + // Vielleicht ist es ein BasicManager? + bFound = BasicIDE::FindBasicManager( GetEntryText( pEntry ) ) ? TRUE : FALSE; + } + + if ( bFound ) + pLastValid = pEntry; + else + { + delete (BasicEntry*)pEntry->GetUserData(); + GetModel()->Remove( pEntry ); + } + pEntry = pLastValid ? Next( pLastValid ) : First(); + } + + // Jetzt ueber die Basics rennen und in die Zweige eintragen + ScanAllBasics(); + + SvLBoxEntry* pNewCurrent = FindMostMatchingEntry( *this, aCurEntry ); + if ( pNewCurrent ) + Select( pNewCurrent, TRUE ); +} + +void BasicTreeListBox::ScanSbxObject( SbxObject* pObj, SvLBoxEntry* pObjEntry ) +{ + // die Methoden des Objects... + if ( nMode & BROWSEMODE_SUBS ) + { + for ( USHORT nMethod = 0; nMethod < pObj->GetMethods()->Count(); nMethod++ ) + { + SbMethod* pMethod= (SbMethod*) pObj->GetMethods()->Get( nMethod ); + DBG_ASSERT( pMethod , "Methode nicht gefunden! (NULL)" ); + SvLBoxEntry* pEntry = InsertEntry( pMethod->GetName(), aImages.GetImage( IMGID_MACRO ), aImages.GetImage( IMGID_MACRO ), pObjEntry, FALSE, LIST_APPEND ); + pEntry->SetUserData( new BasicEntry( OBJTYPE_METHODINOBJ ) ); + } + } + + // die Properties des Objects... + if ( nMode & BROWSEMODE_PROPS ) + { + pObj->GetAll( SbxCLASS_PROPERTY ); + for ( USHORT nProp = 0; nProp < pObj->GetProperties()->Count(); nProp++ ) + { + SbxVariable* pVar = pObj->GetProperties()->Get( nProp ); + DBG_ASSERT( pVar, "Property nicht gefunden! (NULL)" ); + SvLBoxEntry* pEntry = InsertEntry( pVar->GetName(), aImages.GetImage( IMGID_PROP ), aImages.GetImage( IMGID_PROP ), pObjEntry, FALSE, LIST_APPEND ); + pEntry->SetUserData( new BasicEntry( OBJTYPE_PROPERTY ) ); + } + } + + // die Subobjecte + if ( nMode & BROWSEMODE_SUBOBJS ) + { + pObj->GetAll( SbxCLASS_OBJECT ); + for ( USHORT nObject = 0; nObject < pObj->GetObjects()->Count(); nObject++ ) + { + SbxVariable* pVar = pObj->GetObjects()->Get( nObject ); + if ( pVar->GetClass() == SbxCLASS_OBJECT ) + { + // SubObjecte erhalten ChildsOnDemand und koennen + // jederzeit weiter aufgeklappt werden... + SvLBoxEntry* pEntry = InsertEntry( pVar->GetName(), aImages.GetImage( IMGID_SUBOBJ ), aImages.GetImage( IMGID_SUBOBJ ), pObjEntry, TRUE, LIST_APPEND ); + pEntry->SetUserData( new BasicEntry( OBJTYPE_SUBOBJ ) ); + } + } + } +} + + +SvLBoxEntry* __EXPORT BasicTreeListBox::CloneEntry( SvLBoxEntry* pSource ) +{ + SvLBoxEntry* pNew = SvTreeListBox::CloneEntry( pSource ); + BasicEntry* pUser = (BasicEntry*)pSource->GetUserData(); + + DBG_ASSERT( pUser, "User-Daten?!" ); + DBG_ASSERT( pUser->GetType() != OBJTYPE_BASICMANAGER, "BasMgr-Daten?!" ); + + BasicEntry* pNewUser = new BasicEntry( *pUser ); + pNew->SetUserData( pNewUser ); + return pNew; +} + +SvLBoxEntry* BasicTreeListBox::FindEntry( SvLBoxEntry* pParent, const String& rText, BYTE nType ) +{ + ULONG nRootPos = 0; + SvLBoxEntry* pEntry = pParent ? FirstChild( pParent ) : GetEntry( nRootPos ); + while ( pEntry ) + { + BasicEntry* pBasicEntry = (BasicEntry*)pEntry->GetUserData(); + DBG_ASSERT( pBasicEntry, "FindEntry: Kein BasicEntry ?!" ); + if ( ( pBasicEntry->GetType() == nType ) && ( GetEntryText( pEntry ) == rText ) ) + return pEntry; + + pEntry = pParent ? NextSibling( pEntry ) : GetEntry( ++nRootPos ); + } + return 0; +} + +long BasicTreeListBox::ExpandingHdl() +{ + // Expanding oder Collaps? + BOOL bOK = TRUE; + if ( GetModel()->GetDepth( GetHdlEntry() ) == 1 ) + { + String aLib, aDummy1, aDummy2; + BasicManager* pBasicManager = GetSelectedSbx( aLib, aDummy1, aDummy2 ); + if ( aLib.Len() && !aDummy1.Len() && !aDummy2.Len() ) + { + // Beim expandieren einer Lib pruefen, ob Passwortschutz! + USHORT nLib = pBasicManager->GetLibId( aLib ); + if ( pBasicManager->HasPassword( nLib ) && + !pBasicManager->IsPasswordVerified( nLib ) ) + { + bOK = QueryPassword( pBasicManager, nLib ); + } + } + } + return bOK; +} + +BOOL BasicTreeListBox::IsEntryProtected( SvLBoxEntry* pEntry ) +{ + BOOL bProtected = FALSE; + if ( pEntry && ( GetModel()->GetDepth( pEntry ) == 1 ) ) + { + String aLib, aDummy1, aDummy2, aDummy3; + BasicManager* pBasicManager = GetSbx( pEntry, aLib, aDummy1, aDummy2, aDummy3 ); + USHORT nLib = pBasicManager->GetLibId( aLib ); + if ( pBasicManager->HasPassword( nLib ) && + !pBasicManager->IsPasswordVerified( nLib ) ) + { + bProtected = TRUE; + } + } + return bProtected; +} + diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx new file mode 100644 index 000000000..00ddad9dc --- /dev/null +++ b/basctl/source/basicide/bastype2.hxx @@ -0,0 +1,181 @@ +/************************************************************************* + * + * $RCSfile: bastype2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _BASTYPE2_HXX +#define _BASTYPE2_HXX + +#define _SVICNVW_HXX +#ifndef _SVTREEBOX_HXX //autogen +#include <svtools/svtreebx.hxx> +#endif +#ifndef _SB_SBSTAR_HXX //autogen +#include <basic/sbstar.hxx> +#endif + +#define OBJTYPE_BASICMANAGER 1L +#define OBJTYPE_LIB 2L +#define OBJTYPE_MODULE 3L +#define OBJTYPE_METHOD 4L +#define OBJTYPE_METHODINOBJ 5L +#define OBJTYPE_OBJECT 6L +#define OBJTYPE_SUBOBJ 7L +#define OBJTYPE_PROPERTY 8L + +#define BROWSEMODE_MODULES 0x01 +#define BROWSEMODE_SUBS 0x02 +#define BROWSEMODE_OBJS 0x04 +#define BROWSEMODE_PROPS 0x08 +#define BROWSEMODE_SUBOBJS 0x10 + +class BasicManager; +class SbMethod; +class SbxObject; +class SbModule; +class SvLBoxEntry; +class SbxVariable; + +USHORT GetDialogSbxId(); + +class BasicTreeListBox : public SvTreeListBox +{ +private: + USHORT nMode; + ImageList aImages; + + void ScanSbxObject( SbxObject* pObj, SvLBoxEntry* pObjEntry ); + +protected: + void ExpandTree( SvLBoxEntry* pRootEntry ); + virtual void RequestingChilds( SvLBoxEntry* pParent ); + virtual void ExpandedHdl(); + virtual SvLBoxEntry* CloneEntry( SvLBoxEntry* pSource ); + SvLBoxEntry* FindEntry( SvLBoxEntry* pParent, const String& rText, BYTE nType ); + virtual long ExpandingHdl(); + + void ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, StarBASIC* pLib ); + +public: + BasicTreeListBox( Window* pParent, const ResId& rRes ); + ~BasicTreeListBox(); + + void ScanBasic( BasicManager* pBasMgr, const String& rName ); + void ScanAllBasics(); + void UpdateEntries(); + + void ExpandAllTrees(); + + BYTE GetSelectedType(); + BasicManager* GetSelectedSbx( String& rLib, String& rModOrObj, String& rSubOrProp ); + BasicManager* GetSelectedSbx( String& rLib, String& rModOrObj, String& rSubOrPropOrSObj, String& rPropOrSubInSObj ); + BasicManager* GetSbx( SvLBoxEntry* pEntry, String& rLib, String& rModOrObj, String& rSubOrPropOrSObj, String& rPropOrSubInSObj ); + BOOL IsEntryProtected( SvLBoxEntry* pEntry ); + + void SetMode( USHORT nM ) { nMode = nM; } + USHORT GetMode() const { return nMode; } + + Image GetImage( USHORT nId ) { return aImages.GetImage( nId ); } + + SbMethod* FindMethod( SvLBoxEntry* pEntry ); + SbxObject* FindObject( SvLBoxEntry* pEntry ); + SbModule* FindModule( SvLBoxEntry* pEntry ); + SbxVariable* FindVariable( SvLBoxEntry* pEntry ); + SvLBoxEntry* FindLibEntry( StarBASIC* pLib ); +}; + +/**************************************** + Zuordnung von Typen und Pointern in BasicEntrys: + + OBJTYPE_BASICMANAGER BasicManagerEntry + OBJTYPE_MODULE BasicEntry + OBJTYPE_OBJECT BasicEntry + OBJTYPE_METHOD BasicEntry + OBJTYPE_METHODINOBJ BasicEntry + OBJTYPE_SUBOBJ BasicEntry + OBJTYPE_PROPERTY BasicEntry + OBJTYPE_LIB BasicEntry + +******************************************/ + +class BasicEntry +{ +private: + BYTE nType; + +public: + BasicEntry( BYTE nT ) { nType = nT; } + BasicEntry( const BasicEntry& r ) { nType = r.nType; } + virtual ~BasicEntry(); + + BYTE GetType() const { return nType; } +}; + +class BasicManagerEntry : public BasicEntry +{ +private: + BasicManager* pBasMgr; + +public: + BasicManagerEntry( BasicManager* pMgr ); + virtual ~BasicManagerEntry(); + + BasicManager* GetBasicManager() const { return pBasMgr; } +}; + +#endif // _BASTYPE2_HXX diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx new file mode 100644 index 000000000..b8c4cbfb6 --- /dev/null +++ b/basctl/source/basicide/bastype3.cxx @@ -0,0 +1,502 @@ +/************************************************************************* + * + * $RCSfile: bastype3.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <ide_pch.hxx> + +#pragma hdrstop +#define _SI_NOSBXCONTROLS +#include <vcsbx.hxx> +#include <svtools/sbx.hxx> +#include <sidll.hxx> +#include <bastype2.hxx> +#include <baside2.hrc> +#include <iderid.hxx> +#include <bastypes.hxx> + +SV_DECL_VARARR( EntryArray, SvLBoxEntry*, 4, 4 ); + +SV_IMPL_VARARR( EntryArray, SvLBoxEntry*); + +USHORT GetDialogSbxId() +{ + // damit nicht ueberall si.hxx includet werden muss! + return SBXID_DIALOG; +} + + + +void __EXPORT BasicTreeListBox::RequestingChilds( SvLBoxEntry* pEntry ) +{ + BasicEntry* pUser = (BasicEntry*)pEntry->GetUserData(); + if ( ( pUser->GetType() == OBJTYPE_SUBOBJ ) || + ( pUser->GetType() == OBJTYPE_OBJECT ) ) + { + SbxObject* pObj = FindObject( pEntry ); + DBG_ASSERT( pObj, "RequestingChilds: Kein gueltiges Objekt"); + if ( pObj ) + ScanSbxObject( pObj, pEntry ); + } + else if ( pUser->GetType() == OBJTYPE_LIB ) + { + String aLibName = GetEntryText( pEntry ); + SvLBoxEntry* pParent = GetParent( pEntry ); + pUser = (BasicEntry*)pParent->GetUserData(); + DBG_ASSERT( pUser->GetType() == OBJTYPE_BASICMANAGER, "BasicManager?" ); + BasicManager* pBasMgr = ((BasicManagerEntry*)pUser)->GetBasicManager(); + USHORT nLib = pBasMgr->GetLibId( aLibName ); + + BOOL bOK = TRUE; + if ( pBasMgr->HasPassword( nLib ) && + !pBasMgr->IsPasswordVerified( nLib ) ) + { + bOK = QueryPassword( pBasMgr, nLib ); + } + if ( bOK ) + { + if ( !pBasMgr->IsLibLoaded( nLib ) ) + pBasMgr->LoadLib( nLib ); + + StarBASIC* pLib = pBasMgr->GetLib( nLib ); + if ( pLib ) + { + ImpCreateLibSubEntries( pEntry, pLib ); + + // Das Image austauschen... + Image aImage( aImages.GetImage( IMGID_LIB ) ); + SetExpandedEntryBmp( pEntry, aImage ); + SetCollapsedEntryBmp( pEntry, aImage ); + } + else + { + // Lib konnte nicht geladen werden... + ErrorBox( this, WB_OK|WB_DEF_OK, String( IDEResId( RID_STR_ERROROPENLIB ) ) ).Execute(); + } + } + } + else + DBG_ERROR( "RequestingChilds: Was?" ); +} + + + +void __EXPORT BasicTreeListBox::ExpandedHdl() +{ + SvLBoxEntry* pEntry = GetHdlEntry(); + DBG_ASSERT( pEntry, "Was wurde zugeklappt?" ); + // Die OnDemand erzeugten Childs loeschen, + // SubChilds werden automatisch geloescht. + if ( !IsExpanded( pEntry ) && pEntry->HasChildsOnDemand() ) + { + SvLBoxEntry* pChild = FirstChild( pEntry ); + while ( pChild ) + { + GetModel()->Remove( pChild ); // Ruft auch den DTOR + pChild = FirstChild( pEntry ); + } + } +} + + + +void BasicTreeListBox::ScanAllBasics() +{ + ScanBasic( SFX_APP()->GetBasicManager(), Application::GetAppName() ); + SfxObjectShell* pDocShell = SfxObjectShell::GetFirst(); + while ( pDocShell ) + { + // Nur, wenn es ein dazugehoeriges Fenster gibt, damit nicht die + // Gecachten Docs, die nicht sichtbar sind ( Remot-Dokumente ) + BasicManager* pBasMgr = pDocShell->GetBasicManager(); + if ( ( pBasMgr != SFX_APP()->GetBasicManager() ) && ( SfxViewFrame::GetFirst( pDocShell ) ) ) + ScanBasic( pBasMgr, pDocShell->GetTitle( SFX_TITLE_FILENAME ) ); + pDocShell = SfxObjectShell::GetNext( *pDocShell ); + } +} + +/* +void BasicTreeListBox::ExpandTree( BasicManager* pBasMgr ) +{ + ULONG nRootPos = 0; + SvLBoxEntry* pRootEntry = GetEntry( nRootPos ); + // Falsch: + while ( pRootEntry && (((BasicEntry*)pRootEntry->GetUserData())->GetType() != OBJTYPE_BASICMANAGER ) ) + pRootEntry = GetEntry( ++nRootPos ); + + if ( pRootEntry ) + ExpandTree( pRootEntry ); +} +*/ + + + +void BasicTreeListBox::ExpandTree( SvLBoxEntry* pRootEntry ) +{ + DBG_ASSERT( pRootEntry, "Keine Wurzel ?" ); + + Expand( pRootEntry ); + + SvLBoxEntry* pLibEntry = FirstChild( pRootEntry ); + while ( pLibEntry ) + { + // Nur die mit Childs, sonst waere ChildsOnDemand ueberfluessig + if ( !IsEntryProtected( pLibEntry ) && GetChildCount( pLibEntry ) ) + { + Expand( pLibEntry ); + + // Im ObjectDlg nicht alles expandieren... + if ( !( nMode & BROWSEMODE_PROPS ) ) + { + SvLBoxEntry* pModOrObjEntry = FirstChild( pLibEntry ); + while ( pModOrObjEntry ) + { + Expand( pModOrObjEntry ); + pModOrObjEntry = NextSibling( pModOrObjEntry ); + } + } + } + pLibEntry = NextSibling( pLibEntry ); + } +} + + + +void BasicTreeListBox::ExpandAllTrees() +{ + ULONG nRootPos = 0; + SvLBoxEntry* pRootEntry = GetEntry( nRootPos ); + while ( pRootEntry ) + { + ExpandTree( pRootEntry ); + pRootEntry = GetEntry( ++nRootPos ); + } +} + + + +BYTE BasicTreeListBox::GetSelectedType() +{ + SvLBoxEntry* pEntry = GetCurEntry(); + + if ( !pEntry ) + return 0; + + USHORT nDepth = GetModel()->GetDepth( pEntry ); + if ( nDepth == 0 ) + return OBJTYPE_BASICMANAGER; + else if ( nDepth == 1 ) + return OBJTYPE_LIB; + + return ((BasicEntry*)pEntry->GetUserData())->GetType(); +} + + + +BasicManager* BasicTreeListBox::GetSelectedSbx( String& rLib, String& rModOrObj, String& rSubOrPropOrSObj ) +{ + // Methode kann eigentlich weg, wenn nicht mehr in den Apps !!! + // Die sollten dann auch direkt mit FindMethod() arbeiten! + String aTmpStr; + return GetSelectedSbx( rLib, rModOrObj, rSubOrPropOrSObj, aTmpStr ); +} + + + + +BasicManager* BasicTreeListBox::GetSelectedSbx( String& rLib, String& rModOrObj, String& rSubOrPropOrSObj, String& rPropOrSubInSObj ) +{ + SvLBoxEntry* pCurEntry = GetCurEntry(); + return GetSbx( pCurEntry, rLib, rModOrObj, rSubOrPropOrSObj, rPropOrSubInSObj ); +} + + + +BasicManager* BasicTreeListBox::GetSbx( SvLBoxEntry* pEntry, String& rLib, String& rModOrObj, String& rSubOrPropOrSObj, String& rPropOrSubInSObj ) +{ + rLib.Erase(); + rModOrObj.Erase(); + rSubOrPropOrSObj.Erase(); + rPropOrSubInSObj.Erase(); + BasicManager* pBasMgr = 0; + + while ( pEntry ) + { + USHORT nDepth = GetModel()->GetDepth( pEntry ); + switch ( nDepth ) + { + case 4: rPropOrSubInSObj = GetEntryText( pEntry ); + break; + case 3: rSubOrPropOrSObj = GetEntryText( pEntry ); + break; + case 2: rModOrObj = GetEntryText( pEntry ); + break; + case 1: rLib = GetEntryText( pEntry ); + break; + case 0: pBasMgr = ((BasicManagerEntry*)pEntry->GetUserData())->GetBasicManager(); + break; + } + pEntry = GetParent( pEntry ); + } + return pBasMgr; +} + + + + +SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry ) +{ + if ( !pEntry ) + return 0; + + String aLib, aModOrObj, aSubOrPropOrSObj, aPropOrSubInSObj; + BasicManager* pBasMgr = 0; + EntryArray aEntries; + + while ( pEntry ) + { + USHORT nDepth = GetModel()->GetDepth( pEntry ); + switch ( nDepth ) + { + case 4: + case 3: + case 2: + case 1: { + aEntries.C40_INSERT( SvLBoxEntry, pEntry, 0 ); + break; + } + case 0: pBasMgr = ((BasicManagerEntry*)pEntry->GetUserData())->GetBasicManager(); + break; + } + pEntry = GetParent( pEntry ); + } + + DBG_ASSERT( pBasMgr, "Fuer den Eintrag keinen BasicManager gefunden!" ); + SbxVariable* pVar = 0; + if ( pBasMgr && aEntries.Count() ) + { + for ( USHORT n = 0; n < aEntries.Count(); n++ ) + { + SvLBoxEntry* pLE = aEntries[n]; + DBG_ASSERT( pLE, "Entrie im Array nicht gefunden" ); + BasicEntry* pBE = (BasicEntry*)pLE->GetUserData(); + DBG_ASSERT( pBE, "Keine Daten im Eintrag gefunden!" ); + String aName( GetEntryText( pLE ) ); + + switch ( pBE->GetType() ) + { + case OBJTYPE_LIB: + { + pVar = pBasMgr->GetLib( aName ); + } + break; + case OBJTYPE_MODULE: + { + DBG_ASSERT( pVar && pVar->IsA( TYPE(StarBASIC) ), "FindVariable: Ungueltiges Basic" ); + pVar = ((StarBASIC*)pVar)->FindModule( aName ); + } + break; + case OBJTYPE_METHOD: + case OBJTYPE_METHODINOBJ: + { + DBG_ASSERT( pVar && ( (pVar->IsA( TYPE(SbModule) )) || (pVar->IsA( TYPE(SbxObject) )) ), "FindVariable: Ungueltiges Modul/Objekt" ); + pVar = ((SbxObject*)pVar)->GetMethods()->Find( aName, SbxCLASS_METHOD ); + } + break; + case OBJTYPE_OBJECT: + case OBJTYPE_SUBOBJ: + { + DBG_ASSERT( pVar && pVar->IsA( TYPE(SbxObject) ), "FindVariable: Ungueltiges Objekt" ); + pVar = ((SbxObject*)pVar)->GetObjects()->Find( aName, SbxCLASS_OBJECT ); + } + break; + case OBJTYPE_PROPERTY: + { + DBG_ASSERT( pVar && pVar->IsA( TYPE(SbxObject) ), "FindVariable: Ungueltiges Objekt(Property)" ); + pVar = ((SbxObject*)pVar)->GetProperties()->Find( aName, SbxCLASS_PROPERTY ); + } + break; + default: DBG_ERROR( "FindVariable: Unbekannter Typ!" ); + pVar = 0; + } + if ( !pVar ) + break; + } + } + + return pVar; +} + + + +SbxObject* BasicTreeListBox::FindObject( SvLBoxEntry* pEntry ) +{ + SbxVariable* pVar = FindVariable( pEntry ); + if ( pVar && pVar->IsA( TYPE(SbxObject) ) ) + return (SbxObject*)pVar; + return 0; +} + + + +SbMethod* BasicTreeListBox::FindMethod( SvLBoxEntry* pEntry ) +{ + SbxVariable* pVar = FindVariable( pEntry ); + if ( pVar && pVar->IsA( TYPE(SbMethod) ) ) + return (SbMethod*)pVar; + return 0; +} + + + +SbModule* BasicTreeListBox::FindModule( SvLBoxEntry* pEntry ) +{ + SbxVariable* pVar = FindVariable( pEntry ); + if ( pVar && pVar->IsA( TYPE(SbModule ) ) ) + return (SbModule*)pVar; + return 0; +} + + + +SvLBoxEntry* BasicTreeListBox::FindLibEntry( StarBASIC* pLib ) +{ + if ( !pLib ) + return 0; + + ULONG nRootPos = 0; + SvLBoxEntry* pRootEntry = GetEntry( nRootPos ); + while ( pRootEntry ) + { + BasicManager* pBasMgr = ((BasicManagerEntry*)pRootEntry->GetUserData())->GetBasicManager(); + DBG_ASSERT( pBasMgr, "Kein BasicManager?" ); + SvLBoxEntry* pLibEntry = FirstChild( pRootEntry ); + while ( pLibEntry ) + { + DBG_ASSERT( (((BasicEntry*)pLibEntry->GetUserData())->GetType() == OBJTYPE_LIB ), "Kein Libeintrag?" ); + StarBASIC* pL = pBasMgr->GetLib( GetEntryText( pLibEntry ) ); + if ( pL == pLib ) + return pLibEntry; + + pLibEntry = NextSibling( pLibEntry ); + } + pRootEntry = GetEntry( ++nRootPos ); + } + return 0; +} + + + +String CreateMgrAndLibStr( const String& rMgrName, const String& rLibName ) +{ + String aName( '[' ); + aName += rMgrName; + aName += String( RTL_CONSTASCII_USTRINGPARAM( "]." ) ); + aName += rLibName; + return aName; +} + + + +String GetMgrFromMgrAndLib( const String& rMgrAndLib ) +{ + // Format: [XXXXXX].Lib + DBG_ASSERT( rMgrAndLib.GetTokenCount( '.' ) >= 2, "BasMgrAndLib ungueltig! (.)" ); + DBG_ASSERT( rMgrAndLib.GetTokenCount( ']' ) >= 2, "BasMgrAndLib ungueltig! (])" ); + String aLib( rMgrAndLib.GetToken( + rMgrAndLib.GetTokenCount( '.' ) - 1, '.' ) ); + String aBasMgrAndLib( rMgrAndLib ); + aBasMgrAndLib.Erase( aBasMgrAndLib.Len() - ( aLib.Len() + 1 ) ); + DBG_ASSERT( ( aBasMgrAndLib.Len() > 2 ) && ( aBasMgrAndLib.GetChar( 0 ) == '[' ) && ( aBasMgrAndLib.GetChar( aBasMgrAndLib.Len() - 1 ) == ']' ), "BasMgrAndLib ungueltig! ([...])" ); + String aBasMgr( aBasMgrAndLib, 1, (USHORT)(aBasMgrAndLib.Len()-2) ); + return aBasMgr; +} + + + +String GetLibFromMgrAndLib( const String& rMgrAndLib ) +{ + // Format: [XXXXXX].Lib + DBG_ASSERT( rMgrAndLib.GetTokenCount( '.' ) >= 2, "BasMgrAndLib ungueltig! (.)" ); + DBG_ASSERT( rMgrAndLib.GetTokenCount( ']' ) >= 2, "BasMgrAndLib ungueltig! (])" ); + String aLib( rMgrAndLib.GetToken( + rMgrAndLib.GetTokenCount( '.' ) - 1, '.' ) ); + return aLib; +} + + +void EnableBasicDialogs( BOOL bEnable ) +{ + SiDLL* pSiDLL = SI_DLL(); + USHORT nDlgs = pSiDLL->GetSbxDlgCount(); + for ( USHORT nDlg = 0; nDlg < nDlgs; nDlg++ ) + { + VCSbxDialog* pVCDlg = pSiDLL->GetSbxDlg( nDlg ); + Dialog* pRealDlg = pVCDlg->GetDialog(); + if ( pRealDlg ) + { + if ( bEnable ) + pRealDlg->Enable(); + else + pRealDlg->Disable(); + } + } +} + diff --git a/basctl/source/basicide/bastype3.hxx b/basctl/source/basicide/bastype3.hxx new file mode 100644 index 000000000..4c24150ef --- /dev/null +++ b/basctl/source/basicide/bastype3.hxx @@ -0,0 +1,120 @@ +/************************************************************************* + * + * $RCSfile: bastype3.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _BASTYPE3_HXX +#define _BASTYPE3_HXX + +#ifndef _SVHEADER_HXX +#include <svheader.hxx> +#endif + +#ifdef VCL +#include <svtools/svmedit.hxx> +#endif + +#include <iderid.hxx> + +class EditorWindow; + +#ifndef NO_SPECIALEDIT + +class ExtendedEdit : public Edit +{ +private: + Accelerator aAcc; + Link aAccHdl; + Link aGotFocusHdl; + Link aLoseFocusHdl; + +protected: + DECL_LINK( EditAccHdl, Accelerator * ); + DECL_LINK( ImplGetFocusHdl, Control* ); + DECL_LINK( ImplLoseFocusHdl, Control* ); + +public: + ExtendedEdit( Window* pParent, IDEResId nRes ); + + void SetAccHdl( const Link& rLink ) { aAccHdl = rLink; } + void SetLoseFocusHdl( const Link& rLink ) { aLoseFocusHdl = rLink; } + void SetGotFocusHdl( const Link& rLink ) { aGotFocusHdl = rLink; } + Accelerator& GetAccelerator() { return aAcc; } +}; + +class ExtendedMultiLineEdit : public MultiLineEdit +{ +private: + Accelerator aAcc; + Link aAccHdl; + +protected: + DECL_LINK( EditAccHdl, Accelerator * ); + DECL_LINK( ImplGetFocusHdl, Control* ); + DECL_LINK( ImplLoseFocusHdl, Control* ); + +public: + ExtendedMultiLineEdit( Window* pParent, IDEResId nRes ); + + void SetAccHdl( const Link& rLink ) { aAccHdl = rLink; } + Accelerator& GetAccelerator() { return aAcc; } +}; + +#endif //NO_SPECIALEDIT + +#endif // _BASTYPE3_HXX diff --git a/basctl/source/basicide/bastype4.hxx b/basctl/source/basicide/bastype4.hxx new file mode 100644 index 000000000..5679fbc3d --- /dev/null +++ b/basctl/source/basicide/bastype4.hxx @@ -0,0 +1,103 @@ +/************************************************************************* + * + * $RCSfile: bastype4.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _BASTYPE4_HXX +#define _BASTYPE4_HXX + + +#ifndef _TABBAR_HXX //autogen +#include <svtools/tabbar.hxx> +#endif + +class EditEngine; +class EditView; + +class ExtendedTabBar : public TabBar +{ + EditEngine* pEditEngine; + EditView* pEditView; + BOOL bIsInKeyInput; +#if __PRIVATE + void ImpCheckEditEngine( BOOL bKeepNewText ); +#endif +protected: + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void LoseFocus(); + virtual void KeyInput( const KeyEvent& rKEvent ); + virtual void Paint( const Rectangle& ); + + virtual BOOL StartRenamingTab( USHORT nCurId ); + virtual BOOL AllowRenamingTab( USHORT nCurId, const String& rNewName ); + virtual void TabRenamed( USHORT nCurId, const String& rNewName ); + +public: + ExtendedTabBar( Window* pParent, WinBits nStyle ); + ~ExtendedTabBar(); + + void RenameSelectedTab(); + BOOL IsInEditMode() const { return pEditEngine ? TRUE : FALSE; } + void StopEditMode( BOOL bKeepCurText = FALSE ); +}; + +#endif //_BASTYPE4_HXX + + diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx new file mode 100644 index 000000000..142937506 --- /dev/null +++ b/basctl/source/basicide/bastypes.cxx @@ -0,0 +1,967 @@ +/************************************************************************* + * + * $RCSfile: bastypes.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <ide_pch.hxx> + +#pragma hdrstop + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#include <basidesh.hrc> +#include <bastypes.hxx> +#include <bastype2.hxx> +#include <baside2.hxx> // Leider brauche ich teilweise pModulWindow... +#include <baside2.hrc> +#include <svtools/textview.hxx> +#include <svtools/texteng.hxx> +#include <basobj.hxx> +#include <sbxitem.hxx> + +#ifndef _SV_DRAG_HXX //autogen +#include <vcl/drag.hxx> +#endif + +#ifndef _SV_CLIP_HXX //autogen +#include <vcl/clip.hxx> +#endif + +#ifndef _PASSWD_HXX //autogen +#include <sfx2/passwd.hxx> +#endif + + + + + + +DBG_NAME( IDEBaseWindow ); + +const char* pRegName = "BasicIDETabBar"; + +TYPEINIT0( IDEBaseWindow ) +TYPEINIT1( SbxItem, SfxPoolItem ); + +IDEBaseWindow::IDEBaseWindow( Window* pParent, StarBASIC* pBas ) : + Window( pParent, WinBits( WB_3DLOOK ) ) +{ + DBG_CTOR( IDEBaseWindow, 0 ); + xBasic = pBas; + pShellHScrollBar = 0; + pShellVScrollBar = 0; + nStatus = 0; +} + + + +__EXPORT IDEBaseWindow::~IDEBaseWindow() +{ + DBG_DTOR( IDEBaseWindow, 0 ); + if ( pShellVScrollBar ) + pShellVScrollBar->SetScrollHdl( Link() ); + if ( pShellHScrollBar ) + pShellHScrollBar->SetScrollHdl( Link() ); +} + + + +void IDEBaseWindow::Init() +{ + DBG_CHKTHIS( IDEBaseWindow, 0 ); + if ( pShellVScrollBar ) + pShellVScrollBar->SetScrollHdl( LINK( this, IDEBaseWindow, ScrollHdl ) ); + if ( pShellHScrollBar ) + pShellHScrollBar->SetScrollHdl( LINK( this, IDEBaseWindow, ScrollHdl ) ); + DoInit(); // virtuell... +} + + + +void __EXPORT IDEBaseWindow::DoInit() +{ +} + + + +void IDEBaseWindow::GrabScrollBars( ScrollBar* pHScroll, ScrollBar* pVScroll ) +{ + DBG_CHKTHIS( IDEBaseWindow, 0 ); + pShellHScrollBar = pHScroll; + pShellVScrollBar = pVScroll; +// Init(); // macht kein Sinn, fuehrt zu flackern, fuehr zu Fehlern... +} + + + +IMPL_LINK_INLINE_START( IDEBaseWindow, ScrollHdl, ScrollBar *, pCurScrollBar ) +{ + DBG_CHKTHIS( IDEBaseWindow, 0 ); + DoScroll( pCurScrollBar ); + return 0; +} +IMPL_LINK_INLINE_END( IDEBaseWindow, ScrollHdl, ScrollBar *, pCurScrollBar ) + + + +void __EXPORT IDEBaseWindow::ExecuteCommand( SfxRequest& rReq ) +{ + DBG_CHKTHIS( IDEBaseWindow, 0 ); +} + + + +void __EXPORT IDEBaseWindow::GetState( SfxItemSet& ) +{ + DBG_CHKTHIS( IDEBaseWindow, 0 ); +} + + +void __EXPORT IDEBaseWindow::DoScroll( ScrollBar* pCurScrollBar ) +{ + DBG_CHKTHIS( IDEBaseWindow, 0 ); +} + + +void __EXPORT IDEBaseWindow::StoreData() +{ +} + +BOOL __EXPORT IDEBaseWindow::CanClose() +{ + return TRUE; +} + +BOOL __EXPORT IDEBaseWindow::AllowUndo() +{ + return TRUE; +} + + + +void __EXPORT IDEBaseWindow::UpdateData() +{ +} + + + +void __EXPORT IDEBaseWindow::PrintData( Printer* pPrinter ) +{ +} + + + +String __EXPORT IDEBaseWindow::GetTitle() +{ + return String(); +} + + + +String IDEBaseWindow::CreateQualifiedName() +{ + BasicManager* pBasMgr = BasicIDE::FindBasicManager( xBasic ); + DBG_ASSERT( pBasMgr, "BasicManager nicht gefunden!" ); + DBG_ASSERT( xBasic.Is(), "Basic nicht initialisiert!" ); + String aName( BasicIDE::FindTitle( pBasMgr, 3 /*SFX_TITLE_APINAME*/ ) ); + aName += '.'; + aName += xBasic->GetName(); + aName += '.'; + aName += GetTitle(); + return aName; +} + +String IDEBaseWindow::CreateSbxDescription() +{ + BasicManager* pBasMgr = BasicIDE::FindBasicManager( xBasic ); + DBG_ASSERT( pBasMgr, "BasicManager nicht gefunden!" ); + DBG_ASSERT( xBasic.Is(), "Basic nicht initialisiert!" ); + String aDescription( BasicIDE::FindTitle( pBasMgr, 3 /*SFX_TITLE_APINAME*/ ) ); + aDescription += ';'; + aDescription += xBasic->GetName(); + return aDescription; +} + +void IDEBaseWindow::SetReadOnly( BOOL ) +{ +} + +void __EXPORT IDEBaseWindow::BasicStarted() +{ +} + +void __EXPORT IDEBaseWindow::BasicStopped() +{ +} + +BOOL __EXPORT IDEBaseWindow::IsModified() +{ + return TRUE; +} + +Window* __EXPORT IDEBaseWindow::GetLayoutWindow() +{ + return this; +} + +SfxUndoManager* __EXPORT IDEBaseWindow::GetUndoManager() +{ + return NULL; +} + +void BreakPointList::Reset() +{ + BreakPoint* pBrk = First(); + while ( pBrk ) + { + delete pBrk; + pBrk = Next(); + } + Clear(); +} + +void BreakPointList::InsertSorted( BreakPoint* pNewBrk ) +{ + BreakPoint* pBrk = First(); + while ( pBrk ) + { + if ( pNewBrk->nLine <= pBrk->nLine ) + { + DBG_ASSERT( ( pBrk->nLine != pNewBrk->nLine ) || pNewBrk->bTemp, "BreakPoint existiert schon!" ); + Insert( pNewBrk ); + return; + } + pBrk = Next(); + } + // Keine Einfuegeposition gefunden => LIST_APPEND + Insert( pNewBrk, LIST_APPEND ); +} + +void BreakPointList::SetBreakPointsInBasic( SbModule* pModule ) +{ + pModule->ClearAllBP(); + + BreakPoint* pBrk = First(); + while ( pBrk ) + { + if ( pBrk->bEnabled ) + pModule->SetBP( (USHORT)pBrk->nLine ); + pBrk = Next(); + } +} + +BreakPoint* BreakPointList::FindBreakPoint( ULONG nLine ) +{ + BreakPoint* pBrk = First(); + while ( pBrk ) + { + if ( pBrk->nLine == nLine ) + return pBrk; + + pBrk = Next(); + } + + return (BreakPoint*)0; +} + + + +void BreakPointList::AdjustBreakPoints( ULONG nLine, BOOL bInserted ) +{ + BreakPoint* pBrk = First(); + while ( pBrk ) + { + BOOL bDelBrk = FALSE; + if ( pBrk->nLine == nLine ) + { + if ( bInserted ) + pBrk->nLine++; + else + bDelBrk = TRUE; + } + else if ( pBrk->nLine > nLine ) + { + if ( bInserted ) + pBrk->nLine++; + else + pBrk->nLine--; + } + + if ( bDelBrk ) + { + ULONG n = GetCurPos(); + delete Remove( pBrk ); + pBrk = Seek( n ); + } + else + { + pBrk = Next(); + } + } +} + +void IDEBaseWindow::Deactivating() +{ +} + +USHORT __EXPORT IDEBaseWindow::GetSearchOptions() +{ + return 0; +} + + +BasicDockingWindow::BasicDockingWindow( Window* pParent ) : + DockingWindow( pParent, WB_BORDER | WB_3DLOOK | WB_DOCKABLE | WB_MOVEABLE | + WB_SIZEABLE /*| WB_HIDEWHENDEACTIVATE*/ | WB_ROLLABLE | + WB_DOCKABLE | WB_CLIPCHILDREN ) +{ +} + + + +BOOL __EXPORT BasicDockingWindow::Docking( const Point& rPos, Rectangle& rRect ) +{ + ModulWindowLayout* pLayout = (ModulWindowLayout*)GetParent(); + Rectangle aTmpRec( rRect ); + BOOL bDock = IsDockingPrevented() ? FALSE : pLayout->IsToBeDocked( this, rPos, aTmpRec ); + if ( bDock ) + { + rRect.SetSize( aTmpRec.GetSize() ); + } + else // Alte Groesse einstellen + { + if ( !aFloatingPosAndSize.IsEmpty() ) + rRect.SetSize( aFloatingPosAndSize.GetSize() ); + } + return !bDock; // bFloat +} + + + +void __EXPORT BasicDockingWindow::EndDocking( const Rectangle& rRect, BOOL bFloatMode ) +{ + if ( bFloatMode ) + DockingWindow::EndDocking( rRect, bFloatMode ); + else + { + SetFloatingMode( FALSE ); + ModulWindowLayout* pLayout = (ModulWindowLayout*)GetParent(); + pLayout->DockaWindow( this ); + } +} + + + +void __EXPORT BasicDockingWindow::ToggleFloatingMode() +{ + ModulWindowLayout* pLayout = (ModulWindowLayout*)GetParent(); + if ( IsFloatingMode() ) + { + if ( !aFloatingPosAndSize.IsEmpty() ) + SetPosSizePixel( GetParent()->ScreenToOutputPixel( aFloatingPosAndSize.TopLeft() ), + aFloatingPosAndSize.GetSize() ); + } + pLayout->DockaWindow( this ); +} + + + +BOOL __EXPORT BasicDockingWindow::PrepareToggleFloatingMode() +{ + if ( IsFloatingMode() ) + { + // Position und Groesse auf dem Desktop merken... + aFloatingPosAndSize.SetPos( GetParent()->OutputToScreenPixel( GetPosPixel() ) ); + aFloatingPosAndSize.SetSize( GetSizePixel() ); + } + return TRUE; +} + + + +void __EXPORT BasicDockingWindow::StartDocking() +{ + // Position und Groesse auf dem Desktop merken... + if ( IsFloatingMode() ) + { + aFloatingPosAndSize.SetPos( GetParent()->OutputToScreenPixel( GetPosPixel() ) ); + aFloatingPosAndSize.SetSize( GetSizePixel() ); + } +} + + + + +BasicToolBox::BasicToolBox( Window* pParent, IDEResId nRes ) : + ToolBox( pParent, nRes ) +{ +} + + + +void __EXPORT BasicToolBox::MouseButtonDown( const MouseEvent &rEvt ) +{ + ToolBox::MouseButtonDown( rEvt ); + if ( !GetCurItemId() ) + ((BasicDockingWindow*)GetParent())->MouseButtonDown( rEvt ); +} + + + + +ExtendedEdit::ExtendedEdit( Window* pParent, IDEResId nRes ) : + Edit( pParent, nRes ) +{ + aAcc.SetSelectHdl( LINK( this, ExtendedEdit, EditAccHdl ) ); + Control::SetGetFocusHdl( LINK( this, ExtendedEdit, ImplGetFocusHdl ) ); + Control::SetLoseFocusHdl( LINK( this, ExtendedEdit, ImplLoseFocusHdl ) ); +} + +IMPL_LINK( ExtendedEdit, ImplGetFocusHdl, Control*, EMPTYARG ) +{ + Application::InsertAccel( &aAcc ); + aLoseFocusHdl.Call( this ); + return 0; +} + + +IMPL_LINK( ExtendedEdit, ImplLoseFocusHdl, Control*, EMPTYARG ) +{ + Application::RemoveAccel( &aAcc ); + return 0; +} + + +IMPL_LINK_INLINE_START( ExtendedEdit, EditAccHdl, Accelerator *, pAcc ) +{ + aAccHdl.Call( pAcc ); + return 0; +} +IMPL_LINK_INLINE_END( ExtendedEdit, EditAccHdl, Accelerator *, pAcc ) + + + +ExtendedMultiLineEdit::ExtendedMultiLineEdit( Window* pParent, IDEResId nRes ) : + MultiLineEdit( pParent, nRes ) +{ + aAcc.SetSelectHdl( LINK( this, ExtendedMultiLineEdit, EditAccHdl ) ); + Control::SetGetFocusHdl( LINK( this, ExtendedMultiLineEdit, ImplGetFocusHdl ) ); + Control::SetLoseFocusHdl( LINK( this, ExtendedMultiLineEdit, ImplLoseFocusHdl ) ); +} + +IMPL_LINK( ExtendedMultiLineEdit, ImplGetFocusHdl, Control*, EMPTYARG ) +{ + Application::InsertAccel( &aAcc ); + return 0; +} + + +IMPL_LINK( ExtendedMultiLineEdit, ImplLoseFocusHdl, Control*, EMPTYARG ) +{ + Application::RemoveAccel( &aAcc ); + return 0; +} + +IMPL_LINK_INLINE_START( ExtendedMultiLineEdit, EditAccHdl, Accelerator *, pAcc ) +{ + aAccHdl.Call( pAcc ); + return 0; +} +IMPL_LINK_INLINE_END( ExtendedMultiLineEdit, EditAccHdl, Accelerator *, pAcc ) + +struct TabBarDDInfo +{ + ULONG npTabBar; + USHORT nPage; + + TabBarDDInfo() { npTabBar = 0; nPage, 0; } + TabBarDDInfo( ULONG _npTabBar, USHORT _nPage ) { npTabBar = _npTabBar; nPage = _nPage; } +}; + + +BasicIDETabBar::BasicIDETabBar( Window* pParent ) : + TabBar( pParent, WinBits( WB_SVLOOK | WB_SCROLL | WB_BORDER | WB_SIZEABLE | WB_DRAG ) ) +{ + pCurrentLib = NULL; + EnableEditMode( TRUE ); +} + +void __EXPORT BasicIDETabBar::MouseButtonDown( const MouseEvent& rMEvt ) +{ + if ( rMEvt.IsLeft() && ( rMEvt.GetClicks() == 2 ) && !IsInEditMode() ) + { + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_MODULEDLG ); + } + } + else + { + TabBar::MouseButtonDown( rMEvt ); + } +} + +void __EXPORT BasicIDETabBar::Command( const CommandEvent& rCEvt ) +{ + if ( ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) && !IsInEditMode() ) + { + Point aPos( rCEvt.IsMouseEvent() ? rCEvt.GetMousePosPixel() : Point(1,1) ); + if ( rCEvt.IsMouseEvent() ) // Richtige Tab selektieren + { + Point aP = PixelToLogic( aPos ); + MouseEvent aMouseEvent( aP, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT ); + TabBar::MouseButtonDown( aMouseEvent ); + } + PopupMenu aPopup( IDEResId( RID_POPUP_TABBAR ) ); + if ( GetPageCount() == 0 ) + { + aPopup.EnableItem( SID_BASICIDE_DELETECURRENT, FALSE ); + aPopup.EnableItem( SID_BASICIDE_RENAMECURRENT, FALSE ); + aPopup.EnableItem( SID_BASICIDE_HIDECURPAGE, FALSE ); + } + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( aPopup.Execute( this, aPos ) ); + } + } + else if ( ( rCEvt.GetCommand() == COMMAND_STARTDRAG ) && pCurrentLib && !IsInEditMode() ) + { + Region aRegion; + if ( StartDrag( rCEvt, aRegion ) ) + { + ULONG nReg = DragServer::RegisterFormatName( String( RTL_CONSTASCII_USTRINGPARAM( pRegName ) ) ); + TabBarDDInfo aInf( (ULONG)this, GetPagePos( GetCurPageId() ) ); + DragServer::CopyData( &aInf, sizeof( TabBarDDInfo ), nReg ); + + ExecuteDrag( Pointer( POINTER_MOVEFILE ), Pointer( POINTER_COPYFILE ), + DRAG_MOVEABLE, &aRegion ); + + HideDropPos(); + + } + } +} + +BOOL __EXPORT BasicIDETabBar::QueryDrop( DropEvent& rDEvt ) +{ + // ... pruefen, ob moeglich und ob gleiches Fenster.. + + if ( rDEvt.IsLeaveWindow() ) + { + HideDropPos(); + EndSwitchPage(); + return FALSE; + } + + ULONG nReg = Clipboard::RegisterFormatName( String( RTL_CONSTASCII_USTRINGPARAM( pRegName ) ) ); + if ( DragServer::HasFormat( 0, nReg ) ) + { + ULONG nThis = (ULONG)this; + TabBarDDInfo aInf; + DragServer::PasteData( 0, &aInf, sizeof( TabBarDDInfo ), nReg ); + if ( nThis == aInf.npTabBar ) + { + if ( rDEvt.GetAction() == DROP_MOVE ) + { + USHORT nDestPos = ShowDropPos( rDEvt.GetPosPixel() ); + if ( aInf.nPage < nDestPos ) + nDestPos--; + USHORT nMods = (USHORT) pCurrentLib->GetModules()->Count(); + return ( ( nDestPos != aInf.nPage ) && + ( ( ( aInf.nPage < nMods ) && ( nDestPos < nMods ) ) || + ( ( aInf.nPage >= nMods ) && ( nDestPos >= nMods ) ) ) ); + } + } + } + else if ( DragServer::HasFormat( 0, FORMAT_STRING ) ) + { + SwitchPage( rDEvt.GetPosPixel() ); + } + + return FALSE; +} + +BOOL __EXPORT BasicIDETabBar::Drop( const DropEvent& rDEvt ) +{ + USHORT nId = GetCurPageId(); + if ( nId ) + { + ULONG nReg = Clipboard::RegisterFormatName( String( RTL_CONSTASCII_USTRINGPARAM( pRegName ) ) ); + TabBarDDInfo aInf; + DragServer::PasteData( 0, &aInf, sizeof( TabBarDDInfo ), nReg ); + + ULONG nMods = pCurrentLib->GetModules()->Count(); + USHORT nPos = ShowDropPos( rDEvt.GetPosPixel() ); + USHORT nDestPos = nPos; + if ( aInf.nPage < nDestPos ) + nDestPos--; + + if ( aInf.nPage < nMods ) + { + // Module umsortieren + SbModuleRef xMod = (SbModule*) pCurrentLib->GetModules()->Get( aInf.nPage ); + pCurrentLib->GetModules()->Remove( xMod ); + pCurrentLib->GetModules()->Insert( xMod, nDestPos ); + } + else + { + // Objekte umsortieren, leider stehen in diesem Array nicht nur Dialoge... + USHORT nDlg = aInf.nPage - nMods; + nDestPos -= nMods; + USHORT nD = 0, nRealPos = 0, nRealDest = 0; + for ( USHORT nObject = 0; nObject < pCurrentLib->GetObjects()->Count(); nObject++ ) + { + SbxVariable* pVar = pCurrentLib->GetObjects()->Get( nObject ); + if ( pVar->GetSbxId() == GetDialogSbxId() ) + { + if ( nD == nDlg ) + nRealPos = nObject; + if ( nD == nDestPos ) + nRealDest = nObject; + nD++; + } + } + + SbxObjectRef xObj = (SbxObject*) pCurrentLib->GetObjects()->Get( nRealPos ); + pCurrentLib->GetObjects()->Remove( xObj ); + pCurrentLib->GetObjects()->Insert( xObj, nRealDest ); + } + + pCurrentLib->SetModified( TRUE ); + + MovePage( nId, nPos ); + return TRUE; + } + else + return FALSE; +} + + +long BasicIDETabBar::AllowRenaming() +{ + BOOL bValid = BasicIDE::IsValidSbxName( GetEditText() ); + + if ( !bValid ) + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_BADSBXNAME ) ) ).Execute(); + + return bValid ? TAB_RENAMING_YES : TAB_RENAMING_NO; +} + + +void __EXPORT BasicIDETabBar::EndRenaming() +{ + if ( !IsEditModeCanceled() ) + { + SfxUInt16Item aID( SID_BASICIDE_ARG_TABID, GetEditPageId() ); + SfxStringItem aNewName( SID_BASICIDE_ARG_MODULENAME, GetEditText() ); + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_NAMECHANGEDONTAB, + SFX_CALLMODE_SYNCHRON, &aID, &aNewName, 0L ); + } + } +} + + +BasicEntry::~BasicEntry() +{ +} + + + +BasicManagerEntry::BasicManagerEntry( BasicManager* pMgr ) : + BasicEntry( OBJTYPE_BASICMANAGER ) +{ + pBasMgr = pMgr; +} + + + +BasicManagerEntry::~BasicManagerEntry() +{ +} + + + + +void CutLines( String& rStr, USHORT nStartLine, USHORT nLines, BOOL bEraseTrailingEmptyLines ) +{ + rStr.ConvertLineEnd( LINEEND_LF ); + + USHORT nStartPos = 0; + USHORT nEndPos = 0; + USHORT nLine = 0; + while ( nLine < nStartLine ) + { + nStartPos = rStr.Search( LINE_SEP, nStartPos ); + nStartPos++; // nicht das \n. + nLine++; + } + + DBG_ASSERTWARNING( nStartPos != STRING_NOTFOUND, "CutLines: Startzeile nicht gefunden!" ); + + if ( nStartPos != STRING_NOTFOUND ) + { + nEndPos = nStartPos; + for ( USHORT i = 0; i < nLines; i++ ) + nEndPos = rStr.Search( LINE_SEP, nEndPos+1 ); + + if ( nEndPos != STRING_NOTFOUND ) // kann bei letzter Zeile passieren + nEndPos++; + if ( nEndPos > rStr.Len() ) + nEndPos = rStr.Len(); + + rStr.Erase( nStartPos, nEndPos-nStartPos ); + } + if ( bEraseTrailingEmptyLines ) + { + USHORT n = nStartPos; + while ( ( n < rStr.Len() ) && ( rStr.GetChar( n ) == LINE_SEP ) ) + n++; + + if ( n > nStartPos ) + rStr.Erase( nStartPos, n-nStartPos ); + } +} + +ULONG CalcLineCount( SvStream& rStream ) +{ + ULONG nLFs = 0; + ULONG nCRs = 0; + char c; + + rStream.Seek( 0 ); + rStream >> c; + while ( !rStream.IsEof() ) + { + if ( c == '\n' ) + nLFs++; + else if ( c == '\r' ) + nCRs++; + rStream >> c; + } + + rStream.Seek( 0 ); + if ( nLFs > nCRs ) + return nLFs; + return nCRs; +} + + + +LibInfos::~LibInfos() +{ + for ( ULONG n = Count(); n; ) + delete (LibInfo*)GetObject( --n ); +} + +void LibInfos::InsertInfo( const LibInfo& rInf ) +{ + Insert( (ULONG)rInf.pLib, new LibInfo( rInf ) ); +} + +void LibInfos::DestroyInfo( LibInfo* pInfo ) +{ + delete Remove( (ULONG)pInfo->pLib ); +} + +void LibInfos::DestroyInfo( StarBASIC* pLib ) +{ + delete Remove( (ULONG)pLib ); +} + +LibInfo* LibInfos::GetInfo( StarBASIC* pLib, BOOL bCreateIfNotExist ) +{ + LibInfo* pInf = (LibInfo*)Get( (ULONG)pLib ); + if ( !pInf && bCreateIfNotExist ) + { + pInf = new LibInfo; + pInf->pLib = pLib; + Insert( (ULONG)pLib, pInf ); + } + return pInf; +} + + +SbxItem::SbxItem(USHORT nWhich, const SbxBase* p ) : SfxPoolItem( nWhich ) +{ + pSbx = p; +} + +SbxItem::SbxItem(const SbxItem& rCopy) : SfxPoolItem( rCopy ) +{ + pSbx = rCopy.pSbx; +} + +int SbxItem::operator==( const SfxPoolItem& rCmp) const +{ + DBG_ASSERT( rCmp.ISA( SbxItem ), "==: Kein SbxItem!" ); + return ( SfxPoolItem::operator==( rCmp ) && ( pSbx == ((const SbxItem&)rCmp).pSbx ) ); +} + +SfxPoolItem *SbxItem::Clone( SfxItemPool* ) const +{ + return new SbxItem(*this); +} + +String CreateEntryDescription( const SvTreeListBox& rBox, SvLBoxEntry* pEntry ) +{ + String aDescription; + while ( pEntry ) + { + aDescription.Insert( rBox.GetEntryText( pEntry ), 0 ); + pEntry = rBox.GetParent( pEntry ); + if ( pEntry ) + aDescription.Insert( ';', 0 ); + } + return aDescription; +} + +SvLBoxEntry* FindMostMatchingEntry( const SvTreeListBox& rBox, const String& rDesrc ) +{ + SvLBoxEntry* pEntry = 0; + USHORT nIndex = 0; + while ( nIndex != STRING_NOTFOUND ) + { + String aTmp( rDesrc.GetToken( 0, ';', nIndex ) ); + SvLBoxEntry* pTmpEntry = rBox.FirstChild( pEntry ); + while ( pTmpEntry ) + { + if ( rBox.GetEntryText( pTmpEntry ) == aTmp ) + { + pEntry = pTmpEntry; + break; + } + pTmpEntry = rBox.NextSibling( pTmpEntry ); + } + if ( !pTmpEntry ) + return pEntry; + } + return pEntry; +} + +BOOL QueryDel( const String& rName, const ResId& rId, Window* pParent ) +{ + String aQuery( rId ); + String aName( rName ); + aName += '\''; + aName.Insert( '\'', 0 ); + aQuery.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "XX" ) ), aName ); + QueryBox aQueryBox( pParent, WB_YES_NO | WB_DEF_YES, aQuery ); + if ( aQueryBox.Execute() == RET_YES ) + return TRUE; + return FALSE; +} + +BOOL QueryDelMacro( const String& rName, Window* pParent ) +{ + return QueryDel( rName, IDEResId( RID_STR_QUERYDELMACRO ), pParent ); +} + +BOOL QueryDelDialog( const String& rName, Window* pParent ) +{ + return QueryDel( rName, IDEResId( RID_STR_QUERYDELDIALOG ), pParent ); +} + +BOOL QueryDelLib( const String& rName, BOOL bRef, Window* pParent ) +{ + return QueryDel( rName, IDEResId( bRef ? RID_STR_QUERYDELLIBREF : RID_STR_QUERYDELLIB ), pParent ); +} + +BOOL QueryDelModule( const String& rName, Window* pParent ) +{ + return QueryDel( rName, IDEResId( RID_STR_QUERYDELMODULE ), pParent ); +} + +BOOL QueryPassword( BasicManager* pBasicManager, USHORT nLib ) +{ + BOOL bOK = FALSE; + SfxPasswordDialog* pDlg = new SfxPasswordDialog( Application::GetDefDialogParent() ); + pDlg->SetMinLen( 1 ); + if ( pDlg->Execute() ) + { + String aPassword = pDlg->GetPassword(); + if ( aPassword == pBasicManager->GetPassword( nLib ) ) + { + bOK = TRUE; + pBasicManager->SetPasswordVerified( nLib ); + } + else + { + ErrorBox aErrorBox( Application::GetDefDialogParent(), WB_OK, String( IDEResId( RID_STR_WRONGPASSWORD ) ) ); + aErrorBox.Execute(); + } + } + delete pDlg; + return bOK; +} + + + diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx new file mode 100644 index 000000000..e046838f3 --- /dev/null +++ b/basctl/source/basicide/brkdlg.cxx @@ -0,0 +1,321 @@ +/************************************************************************* + * + * $RCSfile: brkdlg.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#pragma hdrstop +#include <vcl/sound.hxx> + +// #define ITEMID_SEARCH SID_SEARCH_ITEM +#define _SVX_NOIDERESIDS +#include <basidesh.hrc> +#include <brkdlg.hxx> +#include <brkdlg.hrc> + +#ifndef _SFXDISPATCH_HXX //autogen +#include <sfx2/dispatch.hxx> +#endif +#include <sfx2/viewfrm.hxx> + + +/************************** + Soll-Aufbau des Strings: + # <LineNr> +**************************/ + +BOOL lcl_ParseText( String aText, USHORT& rLineNr ) +{ + // Blanks ? + aText.EraseLeadingChars( ' ' ); + if ( !aText.Len() ) + return FALSE; + if ( aText.GetChar( 0 ) != '#' ) + return FALSE; + aText.EraseLeadingChars( ' ' ); + if ( !aText.Len() ) + return FALSE; + + rLineNr = (USHORT) aText.ToInt32(); + return TRUE; +} + + + +BreakPointDialog::BreakPointDialog( Window* pParent, BreakPointList& rBrkPntList ) : + ModalDialog( pParent, IDEResId( RID_BASICIDE_BREAKPOINTDLG ) ), + aComboBox( this, IDEResId( RID_CB_BRKPOINTS ) ), + aOKButton( this, IDEResId( RID_PB_OK ) ), + aCancelButton( this, IDEResId( RID_PB_CANCEL ) ), + aNewButton( this, IDEResId( RID_PB_NEW ) ), + aDelButton( this, IDEResId( RID_PB_DEL ) ), +// aShowButton( this, IDEResId( RID_PB_SHOW ) ), + aCheckBox( this, IDEResId( RID_CHKB_ACTIVE ) ), + aBrkText( this, IDEResId( RID_FT_BRKPOINTS ) ), + aPassText( this, IDEResId( RID_FT_PASS ) ), + aNumericField( this, IDEResId( RID_FLD_PASS ) ), + rBrkPointList( rBrkPntList ) +{ + FreeResource(); + + aComboBox.SetUpdateMode( FALSE ); + BreakPoint* pBrk = rBrkPointList.First(); + BreakPoint* pFirstBrk = pBrk; + while ( pBrk ) + { + String aEntryStr( RTL_CONSTASCII_USTRINGPARAM( "# " ) ); + aEntryStr += String::CreateFromInt32( pBrk->nLine ); + aComboBox.InsertEntry( aEntryStr, COMBOBOX_APPEND ); + pBrk = rBrkPointList.Next(); + } + aComboBox.SetUpdateMode( TRUE ); + + aOKButton.SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) ); + aNewButton.SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) ); + aDelButton.SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) ); +// aShowButton.SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) ); + + aCheckBox.SetClickHdl( LINK( this, BreakPointDialog, CheckBoxHdl ) ); + aComboBox.SetSelectHdl( LINK( this, BreakPointDialog, ComboBoxHighlightHdl ) ); + aComboBox.SetModifyHdl( LINK( this, BreakPointDialog, EditModifyHdl ) ); + aComboBox.GrabFocus(); + + aNumericField.SetMin( 0 ); + aNumericField.SetMax( 0x7FFFFFFF ); + aNumericField.SetSpinSize( 1 ); + aNumericField.SetStrictFormat( TRUE ); + aNumericField.SetModifyHdl( LINK( this, BreakPointDialog, EditModifyHdl ) ); + + aComboBox.SetText( aComboBox.GetEntry( 0 ) ); + UpdateFields( pFirstBrk ); + + CheckButtons(); +} + +void BreakPointDialog::SetCurrentBreakPoint( const BreakPoint& rBrk ) +{ + String aStr( RTL_CONSTASCII_USTRINGPARAM( "# " ) ); + aStr += String::CreateFromInt32( rBrk.nLine ); + aComboBox.SetText( aStr ); +} + +void BreakPointDialog::CheckButtons() +{ + BOOL bEnableAdd = FALSE; + + String aEditText( aComboBox.GetText() ); + if ( aEditText.Len() ) + bEnableAdd = TRUE; // es besteht die Moeglichkeit. + + for ( USHORT i = 0; i < aComboBox.GetEntryCount(); i++ ) + { + String aStr( aComboBox.GetEntry( i ) ); + if ( aStr.CompareIgnoreCaseToAscii( aEditText ) == COMPARE_EQUAL ) + { + bEnableAdd = FALSE; + break; + } + } + + if ( bEnableAdd ) + { + aNewButton.Enable(); + aOKButton.Disable(); + aDelButton.Disable(); + } + else + { + aNewButton.Disable(); + aOKButton.Enable(); + aDelButton.Enable(); + } +} + + + +IMPL_LINK_INLINE_START( BreakPointDialog, CheckBoxHdl, CheckBox *, pChkBx ) +{ + BreakPoint* pBrk = GetSelectedBreakPoint(); + if ( pBrk ) + pBrk->bEnabled = pChkBx->IsChecked(); + + return 0; +} +IMPL_LINK_INLINE_END( BreakPointDialog, CheckBoxHdl, CheckBox *, pChkBx ) + + + +IMPL_LINK( BreakPointDialog, ComboBoxHighlightHdl, ComboBox *, pBox ) +{ + aNewButton.Disable(); + aOKButton.Enable(); + aDelButton.Enable(); + + USHORT nEntry = pBox->GetEntryPos( pBox->GetText() ); + BreakPoint* pBrk = rBrkPointList.GetObject( nEntry ); + DBG_ASSERT( pBrk, "Kein passender Breakpoint zur Liste ?" ); + UpdateFields( pBrk ); + + return 0; +} + + + +IMPL_LINK( BreakPointDialog, EditModifyHdl, Edit *, pEdit ) +{ + if ( pEdit == &aComboBox ) + CheckButtons(); + else if ( pEdit == &aNumericField ) + { + BreakPoint* pBrk = GetSelectedBreakPoint(); + if ( pBrk ) + pBrk->nStopAfter = pEdit->GetText().ToInt32(); + } + return 0; +} + + + +IMPL_LINK( BreakPointDialog, ButtonHdl, Button *, pButton ) +{ + if ( pButton == &aOKButton ) + EndDialog( 1 ); + else if ( pButton == &aNewButton ) + { + // Checkbox beruecksichtigen! + String aText( aComboBox.GetText() ); + USHORT nLine; + BOOL bValid = lcl_ParseText( aText, nLine ); + if ( bValid ) + { + BreakPoint* pBrk = new BreakPoint( nLine ); + pBrk->bEnabled = aCheckBox.IsChecked(); + pBrk->nStopAfter = aNumericField.GetValue(); + rBrkPointList.InsertSorted( pBrk ); + String aEntryStr( RTL_CONSTASCII_USTRINGPARAM( "# " ) ); + aEntryStr += String::CreateFromInt32( pBrk->nLine ); + aComboBox.InsertEntry( aEntryStr, COMBOBOX_APPEND ); + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_BRKPNTSCHANGED ); + } + } + else + { + aComboBox.SetText( aText ); + aComboBox.GrabFocus(); + Sound::Beep(); + } + CheckButtons(); + } + else if ( pButton == &aDelButton ) + { + USHORT nEntry = aComboBox.GetEntryPos( aComboBox.GetText() ); + BreakPoint* pBrk = rBrkPointList.GetObject( nEntry ); + if ( pBrk ) + { + delete rBrkPointList.Remove( pBrk ); + aComboBox.RemoveEntry( nEntry ); + if ( nEntry && !( nEntry < aComboBox.GetEntryCount() ) ) + nEntry--; + aComboBox.SetText( aComboBox.GetEntry( nEntry ) ); + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_BRKPNTSCHANGED ); + } + } + CheckButtons(); + } +// else if ( pButton == &aShowButton ) +// { +// ; +// } + + return 0; +} + + + +void BreakPointDialog::UpdateFields( BreakPoint* pBrk ) +{ + if ( pBrk ) + { + aCheckBox.Check( pBrk->bEnabled ); + aNumericField.SetValue( pBrk->nStopAfter ); + } +} + + + +BreakPoint* BreakPointDialog::GetSelectedBreakPoint() +{ + USHORT nEntry = aComboBox.GetEntryPos( aComboBox.GetText() ); + BreakPoint* pBrk = rBrkPointList.GetObject( nEntry ); + return pBrk; +} + + + + diff --git a/basctl/source/basicide/brkdlg.hrc b/basctl/source/basicide/brkdlg.hrc new file mode 100644 index 000000000..ad71a460b --- /dev/null +++ b/basctl/source/basicide/brkdlg.hrc @@ -0,0 +1,80 @@ +/************************************************************************* + * + * $RCSfile: brkdlg.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _BRKDLG_HRC +#define _BRKDLG_HRC + +#include <svtools/solar.hrc> + +#define RID_BASICIDE_BREAKPOINTDLG ( RID_BASICIDE_START + 80 ) + +#define RID_CB_BRKPOINTS 2 +#define RID_PB_OK 3 +#define RID_PB_CANCEL 4 +#define RID_PB_NEW 5 +#define RID_PB_DEL 6 +#define RID_CHKB_ACTIVE 7 +#define RID_FT_PASS 8 +#define RID_FT_BRKPOINTS 9 +#define RID_FLD_PASS 10 +// #define RID_PB_SHOW 11 + +#endif // _BRKDLG_HRC + diff --git a/basctl/source/basicide/brkdlg.hxx b/basctl/source/basicide/brkdlg.hxx new file mode 100644 index 000000000..99576ad52 --- /dev/null +++ b/basctl/source/basicide/brkdlg.hxx @@ -0,0 +1,118 @@ +/************************************************************************* + * + * $RCSfile: brkdlg.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _BRKDLG_HXX +#define _BRKDLG_HXX + +#ifndef _SVHEADER_HXX +#include <svheader.hxx> +#endif +#include <bastypes.hxx> + +#ifndef _SV_DIALOG_HXX //autogen +#include <vcl/dialog.hxx> +#endif + +#ifndef _SV_BUTTON_HXX //autogen +#include <vcl/button.hxx> +#endif + +#ifndef _SV_FIELD_HXX //autogen +#include <vcl/field.hxx> +#endif + +#ifndef _SV_FIXED_HXX //autogen +#include <vcl/fixed.hxx> +#endif + +class BreakPointDialog : public ModalDialog +{ +private: + ComboBox aComboBox; + OKButton aOKButton; + CancelButton aCancelButton; + PushButton aNewButton; + PushButton aDelButton; +// PushButton aShowButton; + CheckBox aCheckBox; + FixedText aBrkText; + FixedText aPassText; + NumericField aNumericField; + + BreakPointList& rBrkPointList; + +protected: + void CheckButtons(); + DECL_LINK( CheckBoxHdl, CheckBox * ); + DECL_LINK( ComboBoxHighlightHdl, ComboBox * ); + DECL_LINK( EditModifyHdl, Edit * ); + DECL_LINK( ButtonHdl, Button * ); + void UpdateFields( BreakPoint* pBrk ); + BreakPoint* GetSelectedBreakPoint(); + + +public: + BreakPointDialog( Window* pParent, BreakPointList& rBrkList ); + + void SetCurrentBreakPoint( const BreakPoint& rBrk ); +}; + +#endif // _BRKDLG_HXX diff --git a/basctl/source/basicide/brkdlg.src b/basctl/source/basicide/brkdlg.src new file mode 100644 index 000000000..4eda73cba --- /dev/null +++ b/basctl/source/basicide/brkdlg.src @@ -0,0 +1,252 @@ +/************************************************************************* + * + * $RCSfile: brkdlg.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include "helpid.hrc" +#include <brkdlg.hrc> +ModalDialog RID_BASICIDE_BREAKPOINTDLG +{ + // HelpId = HID_BASICIDE_BRKPNTS ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 178 , 116 ) ; + Text = "Haltepunkte" ; + Text [ ENGLISH ] = "Breakpoints" ; + Moveable = TRUE ; + // Closeable = TRUE; + ComboBox RID_CB_BRKPOINTS + { + Pos = MAP_APPFONT ( 6 , 14 ) ; + Size = MAP_APPFONT ( 110 , 70 ) ; + TabStop = TRUE ; + }; + OKButton RID_PB_OK + { + Pos = MAP_APPFONT ( 122 , 6 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + CancelButton RID_PB_CANCEL + { + Pos = MAP_APPFONT ( 122 , 23 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + PushButton RID_PB_NEW + { + Pos = MAP_APPFONT ( 122 , 57 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + Text = "Neu" ; + Text [ ENGLISH ] = "New" ; + TabStop = TRUE ; + Text [ dutch ] = "Nieuw" ; + Text [ english_us ] = "New" ; + Text [ italian ] = "Nuovo" ; + Text [ spanish ] = "Nuevo" ; + Text [ french ] = "Nouveau" ; + Text [ swedish ] = "Ny" ; + Text [ danish ] = "Ny" ; + Text [ portuguese ] = "Novo" ; + Text [ portuguese_brazilian ] = "Novo" ; + Text[ chinese_simplified ] = "½"; + Text[ russian ] = ""; + Text[ polish ] = "Nowy"; + Text[ japanese ] = "VK"; + Text[ chinese_traditional ] = "}ҷs"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Yeni"; + Text[ language_user1 ] = " "; + }; + PushButton RID_PB_DEL + { + Pos = MAP_APPFONT ( 122 , 74 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + /* ### ACHTUNG: Neuer Text in Resource? Lschen : Lschen */ + Text = "Lschen" ; + Text [ ENGLISH ] = "Delete" ; + TabStop = TRUE ; + Text [ dutch ] = "Wissen" ; + Text [ english_us ] = "Delete" ; + Text [ italian ] = "Elimina" ; + Text [ spanish ] = "Eliminar" ; + Text [ french ] = "Supprimer" ; + Text [ swedish ] = "Radera" ; + Text [ danish ] = "Slet" ; + Text [ portuguese ] = "Eliminar" ; + Text [ portuguese_brazilian ] = "Lschen" ; + Text[ chinese_simplified ] = "ɾ"; + Text[ russian ] = ""; + Text[ polish ] = "Usu"; + Text[ japanese ] = "폜"; + Text[ chinese_traditional ] = "R"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Sil"; + Text[ language_user1 ] = " "; + }; + CheckBox RID_CHKB_ACTIVE + { + Pos = MAP_APPFONT ( 6 , 87 ) ; + Size = MAP_APPFONT ( 40 , 12 ) ; + Text = "Aktiv" ; + Text [ ENGLISH ] = "Active" ; + TabStop = TRUE ; + Text [ english_us ] = "Active" ; + Text [ italian ] = "Attivo" ; + Text [ spanish ] = "Activo" ; + Text [ french ] = "Actif" ; + Text [ dutch ] = "Actief" ; + Text [ swedish ] = "Aktiv" ; + Text [ danish ] = "Aktiv" ; + Text [ portuguese_brazilian ] = "Aktiv" ; + Text [ portuguese ] = "Activo" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Aktywny"; + Text[ japanese ] = "è"; + Text[ chinese_traditional ] = "E"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "Ȱ"; + Text[ turkish ] = "Etkin"; + Text[ language_user1 ] = " "; + }; + FixedText RID_FT_PASS + { + Pos = MAP_APPFONT ( 6 , 102 ) ; + Size = MAP_APPFONT ( 35 , 10 ) ; + Text = "Durchlauf:" ; + Text [ English ] = "Pass Count:" ; + Text [ english_us ] = "Pass Count:" ; + Text [ portuguese_brazilian ] = "Durchlauf:" ; + Text [ swedish ] = "Passager:" ; + Text [ danish ] = "Gennemlb:" ; + Text [ italian ] = "Passaggi:" ; + Text [ spanish ] = "Adaptacin:" ; + Text [ french ] = "Adaptation :" ; + Text [ dutch ] = "Doorloop:" ; + Text [ portuguese ] = "Adaptao:" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ":"; + Text[ polish ] = "Przepyw tekstu:"; + Text[ japanese ] = "܂ԂȂ:"; + Text[ chinese_traditional ] = "zG"; + Text[ arabic ] = ":"; + Text[ greek ] = " :"; + Text[ korean ] = "н Ƚ:"; + Text[ turkish ] = "Pass count:"; + Text[ language_user1 ] = " "; + }; + FixedText RID_FT_BRKPOINTS + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 40 , 10 ) ; + Text = "Haltepunkte" ; + Text [ ENGLISH ] = "Breakpoints" ; + Text [ english_us ] = "Breakpoints" ; + Text [ italian ] = "Punti di interruzione" ; + Text [ spanish ] = "Puntos de ruptura" ; + Text [ french ] = "Points d'arrt" ; + Text [ dutch ] = "Stoppunten" ; + Text [ swedish ] = "Brytpunkter" ; + Text [ danish ] = "Pausepunkter" ; + Text [ portuguese_brazilian ] = "Haltepunkte" ; + Text [ portuguese ] = "Pontos de ruptura" ; + Text[ chinese_simplified ] = "ֹ"; + Text[ russian ] = " "; + Text[ polish ] = "Punkty przerwania"; + Text[ japanese ] = "ڰ߲"; + Text[ chinese_traditional ] = "I"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "ߴ"; + Text[ turkish ] = "Kesme noktalar"; + Text[ language_user1 ] = " "; + }; + NumericField RID_FLD_PASS + { + Border = TRUE ; + Pos = MAP_APPFONT ( 41 , 100 ) ; + Size = MAP_APPFONT ( 40 , 12 ) ; + TabStop = TRUE ; + }; + Text [ english_us ] = "Breakpoints" ; + Text [ italian ] = "Punto di interruzione" ; + Text [ spanish ] = "Puntos de ruptura" ; + Text [ french ] = "Points d'arrt" ; + Text [ dutch ] = "Stoppunten" ; + Text [ swedish ] = "Brytpunkter" ; + Text [ danish ] = "Pausepunkter" ; + Text [ portuguese_brazilian ] = "Haltepunkte" ; + Text [ portuguese ] = "Pontos de ruptura" ; + Text[ chinese_simplified ] = "ֹ"; + Text[ russian ] = " "; + Text[ polish ] = "Punkty przerwania"; + Text[ japanese ] = "ڰ߲"; + Text[ chinese_traditional ] = "I"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "ߴ"; + Text[ turkish ] = "Kesme noktalar"; + Text[ language_user1 ] = " "; +}; diff --git a/basctl/source/basicide/ide_pch.cxx b/basctl/source/basicide/ide_pch.cxx new file mode 100644 index 000000000..2ed6865f3 --- /dev/null +++ b/basctl/source/basicide/ide_pch.cxx @@ -0,0 +1,63 @@ +/************************************************************************* + * + * $RCSfile: ide_pch.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include <ide_pch.hxx> +#pragma hdrstop + diff --git a/basctl/source/basicide/ide_pch.hxx b/basctl/source/basicide/ide_pch.hxx new file mode 100644 index 000000000..748fb3d1f --- /dev/null +++ b/basctl/source/basicide/ide_pch.hxx @@ -0,0 +1,181 @@ +/************************************************************************* + * + * $RCSfile: ide_pch.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include <svheader.hxx> + +#include <vcl/wrkwin.hxx> +#include <vcl/msgbox.hxx> +#include <vcl/menu.hxx> + +#include <svtools/svarray.hxx> +#include <svtools/itemset.hxx> +#include <svtools/aeitem.hxx> +#include <svtools/stritem.hxx> +#include <svtools/whiter.hxx> + +#define _BASIC_TEXTPORTIONS +#include <basic/sbdef.hxx> +#include <basic/sbstar.hxx> +#include <basic/sbmeth.hxx> +#include <basic/sbmod.hxx> +#include <basic/basmgr.hxx> + +#include <sfx2/app.hxx> +#include <sfx2/objface.hxx> +#include <sfx2/printer.hxx> +#include <sfx2/viewsh.hxx> +#include <sfx2/event.hxx> +#include <sfx2/bindings.hxx> +#include <sfx2/request.hxx> +#include <sfx2/childwin.hxx> +#include <sfx2/viewfrm.hxx> +#include <sfx2/dispatch.hxx> +#include <sfx2/objsh.hxx> +#include <sfx2/genlink.hxx> +#include <sfx2/dispatch.hxx> +#include <sfx2/tbxmgr.hxx> +#include <sfx2/minfitem.hxx> +#include <sfx2/dinfdlg.hxx> +#include <sfx2/stbmgr.hxx> +#include <sfx2/docfac.hxx> +#include <sfx2/progress.hxx> + + +#define ITEMID_FONT 0 +#define ITEMID_POSTURE 0 +#define ITEMID_WEIGHT 0 +#define ITEMID_SHADOWED 0 +#define ITEMID_CONTOUR 0 +#define ITEMID_CROSSEDOUT 0 +#define ITEMID_UNDERLINE 0 +#define ITEMID_FONTHEIGHT 0 +#define ITEMID_COLOR 0 +#define ITEMID_ADJUST 0 +#define ITEMID_LINESPACING 0 +#define ITEMID_TABSTOP 0 +#define ITEMID_LRSPACE 0 +#define ITEMID_ULSPACE 0 +#define ITEMID_SEARCH 0 +#define ITEMID_SEARCH 0 +#define ITEMID_SIZE 0 +#define ITEMID_FONTLIST 0 +#define ITEMID_AUTOKERN 0 +#define ITEMID_WORDLINEMODE 0 +#define ITEMID_PROPSIZE 0 +#define ITEMID_CHARSETCOLOR 0 +#define ITEMID_KERNING 0 +#define ITEMID_CASEMAP 0 +#define ITEMID_ESCAPEMENT 0 +#define ITEMID_LANGUAGE 0 +#define ITEMID_NOLINEBREAK 0 +#define ITEMID_NOHYPHENHERE 0 +#define ITEMID_BLINK 0 +#define ITEMID_PAPERBIN 0 +#define ITEMID_PRINT 0 +#define ITEMID_OPAQUE 0 +#define ITEMID_PROTECT 0 +#define ITEMID_SHADOW 0 +#define ITEMID_BOX 0 +#define ITEMID_BOXINFO 0 +#define ITEMID_FMTBREAK 0 +#define ITEMID_FMTKEEP 0 +#define ITEMID_LINE 0 +#define ITEMID_BRUSH 0 + +#include <svx/srchitem.hxx> +#include <svx/flstitem.hxx> +#include <svx/fontitem.hxx> +#include <svx/postitem.hxx> +#include <svx/wghtitem.hxx> +#include <svx/fhgtitem.hxx> +#include <svx/fwdtitem.hxx> +#include <svx/udlnitem.hxx> +#include <svx/crsditem.hxx> +#include <svx/shdditem.hxx> +#include <svx/akrnitem.hxx> +#include <svx/wrlmitem.hxx> +#include <svx/cntritem.hxx> +#include <svx/prszitem.hxx> +#include <svx/colritem.hxx> +#include <svx/cscoitem.hxx> +#include <svx/kernitem.hxx> + +#include <svx/cmapitem.hxx> +#include <svx/escpitem.hxx> +#include <svx/langitem.hxx> +#include <svx/nlbkitem.hxx> +#include <svx/nhypitem.hxx> +#include <svx/lcolitem.hxx> +#include <svx/blnkitem.hxx> + +#include <svx/pbinitem.hxx> +#include <svx/sizeitem.hxx> +#include <svx/lrspitem.hxx> +#include <svx/ulspitem.hxx> +#include <svx/prntitem.hxx> +#include <svx/opaqitem.hxx> +#include <svx/protitem.hxx> +#include <svx/shaditem.hxx> +#include <svx/boxitem.hxx> +#include <svx/brkitem.hxx> +#include <svx/keepitem.hxx> +#include <svx/bolnitem.hxx> +#include <svx/brshitem.hxx> + diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx new file mode 100644 index 000000000..5d3a2dad0 --- /dev/null +++ b/basctl/source/basicide/iderdll.cxx @@ -0,0 +1,273 @@ +/************************************************************************* + * + * $RCSfile: iderdll.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <ide_pch.hxx> + +#pragma hdrstop + +#include <svheader.hxx> + +#ifndef _SFXAPP_HXX //autogen +#include <sfx2/app.hxx> +#endif + +#ifndef _SFXDISPATCH_HXX //autogen +#include <sfx2/dispatch.hxx> +#endif + +#ifndef _SFXGENLINK_HXX //autogen +#include <sfx2/genlink.hxx> +#endif + +#pragma hdrstop + +#include <svtools/solar.hrc> +#include <iderdll.hxx> +#include <iderdll2.hxx> +#include <iderid.hxx> +#include <svx/svxids.hrc> +#include <basidesh.hxx> +#include <basidesh.hrc> +#include <basobj.hxx> +#include <bastypes.hxx> + +#define ITEMID_SEARCH 0 +#include <svx/srchitem.hxx> + +IDEResId::IDEResId( USHORT nId ): + ResId( nId, (*(BasicIDEDLL**)GetAppData(SHL_IDE))->GetResMgr() ) +{ +} + + +BasicIDEDLL::BasicIDEDLL() +{ + *(BasicIDEDLL**)GetAppData(SHL_IDE) = this; + + ByteString aResMgrName( "basctl" ); + aResMgrName += ByteString::CreateFromInt32( SOLARUPD ); + pResMgr = ResMgr::CreateResMgr( + aResMgrName.GetBuffer(), Application::GetAppInternational().GetLanguage() ); + pShell = 0; + pExtraData = 0; + GetExtraData(); // damit GlobalErrorHdl gesetzt wird. +} + +BasicIDEDLL::~BasicIDEDLL() +{ + delete pResMgr; + delete pExtraData; + *(BasicIDEDLL**)GetAppData(SHL_IDE) = NULL; +} + +BasicIDEData* BasicIDEDLL::GetExtraData() +{ + if ( !pExtraData ) + pExtraData = new BasicIDEData; + return pExtraData; +} + +BasicIDEData::BasicIDEData() : aObjCatPos( INVPOSITION, INVPOSITION ) +{ + nBasicDialogCount = 0; + bChoosingMacro = FALSE; + bShellInCriticalSection = FALSE; + pSearchItem = new SvxSearchItem( SID_SEARCH_ITEM ); + StarBASIC::SetGlobalErrorHdl( LINK( this, BasicIDEData, GlobalBasicErrorHdl ) ); + StarBASIC::SetGlobalBreakHdl( LINK( this, BasicIDEData, GlobalBasicBreakHdl ) ); + + pAccelerator = 0; +} + +BasicIDEData::~BasicIDEData() +{ + // ErrorHdl zuruecksetzen ist zwar sauberer, aber diese Instanz wird + // sowieso sehr spaet, nach dem letzten Basic, zerstoert. + // Durch den Aufruf werden dann aber wieder AppDaten erzeugt und nicht + // mehr zerstoert => MLK's beim Purify +// StarBASIC::SetGlobalErrorHdl( Link() ); +// StarBASIC::SetGlobalBreakHdl( Link() ); +// StarBASIC::setGlobalStarScriptListener( XEngineListenerRef() ); + + delete pSearchItem; + delete pAccelerator; +} + +void BasicIDEData::InitAccelerator() +{ + if ( !pAccelerator ) + { + pAccelerator = new Accelerator; + pAccelerator->InsertItem( 1, KeyCode( KEY_F5 ) ); + pAccelerator->InsertItem( 2, KeyCode( KEY_F5, KEY_SHIFT ) ); + pAccelerator->InsertItem( 3, KeyCode( KEY_F5, KEY_MOD2 ) ); + pAccelerator->InsertItem( 4, KeyCode( KEY_F7 ) ); + pAccelerator->InsertItem( 5, KeyCode( KEY_F8 ) ); + pAccelerator->InsertItem( 6, KeyCode( KEY_F8, KEY_SHIFT ) ); + pAccelerator->InsertItem( 7, KeyCode( KEY_F9 ) ); + } +} + +SvxSearchItem& BasicIDEData::GetSearchItem() const +{ + return *pSearchItem; +} + +void BasicIDEData::SetSearchItem( const SvxSearchItem& rItem ) +{ + delete pSearchItem; + pSearchItem = (SvxSearchItem*)rItem.Clone(); +} + +IMPL_LINK( BasicIDEData, GlobalBasicErrorHdl, StarBASIC *, pBasic ) +{ + BasicIDE::BasicStopped(); + + // Waerend der Macroauswahl keine Fehler ausgeben: + if ( bChoosingMacro ) + return 1; + if ( bShellInCriticalSection ) + return 2; + + long nRet = 0; + BasicIDEShell* pShell = 0; + if ( SFX_APP()->HasFeature( SFX_FEATURE_BASIC_IDE ) ) + { + BasicManager* pBasicManager = BasicIDE::FindBasicManager( pBasic ); + if ( pBasicManager ) + { + USHORT nLib = pBasicManager->GetLibId( pBasic ); + if ( !pBasicManager->HasPassword( nLib ) || + pBasicManager->IsPasswordVerified( nLib ) ) + { + pShell = IDE_DLL()->GetShell(); + if ( !pShell ) + { + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON ); + } + pShell = IDE_DLL()->GetShell(); + } + } + } + } + + if ( pShell ) + nRet = pShell->CallBasicErrorHdl( pBasic ); + else + BasicIDE::HandleBasicError(); + + return nRet; +} + + +IMPL_LINK( BasicIDEData, GlobalBasicBreakHdl, StarBASIC *, pBasic ) +{ + BasicIDEShell* pShell = IDE_DLL()->GetShell(); + if ( pShell ) + { + BasicManager* pBasicManager = BasicIDE::FindBasicManager( pBasic ); + if ( pBasicManager ) + { + USHORT nLib = pBasicManager->GetLibId( pBasic ); + // Hier lande ich zweimal, wenn Step into protected Basic + // => schlecht, wenn Passwortabfrage 2x, ausserdem sieht man in + // dem PasswordDlg nicht, fuer welche Lib... + // => An dieser Stelle keine Passwort-Abfrage starten + if ( !pBasicManager->HasPassword( nLib ) || + pBasicManager->IsPasswordVerified( nLib ) /* || + QueryPassword( pBasicManager, nLib ) */ ) + { + return pShell->CallBasicBreakHdl( pBasic ); + } + else + { + // Ein Step-Out muesste mich aus den geschuetzten Bereich befoerdern... + return SbDEBUG_STEPOUT; + } + } + } + + return 0; +} + +IMPL_LINK( BasicIDEData, ExecuteMacroEvent, void *, pData ) +{ + if ( pData ) + { + SFX_APP()->EnterBasicCall(); + SbMethod* pMethod = (SbMethod*)pData; + + // Ist es eine StarScript-Methode? Am Parent erkennen + SbModule* pModule = pMethod->GetModule(); + DBG_ASSERT( pMethod->GetParent()->GetFlags() & SBX_EXTSEARCH, "Kein EXTSEARCH!" ); + BasicIDE::RunMethod( pMethod ); + pMethod->ReleaseRef(); // muss vorher inkrementiert worden sein! + SFX_APP()->LeaveBasicCall(); + } + return 0; +} + diff --git a/basctl/source/basicide/iderdll2.hxx b/basctl/source/basicide/iderdll2.hxx new file mode 100644 index 000000000..aae75d640 --- /dev/null +++ b/basctl/source/basicide/iderdll2.hxx @@ -0,0 +1,157 @@ +/************************************************************************* + * + * $RCSfile: iderdll2.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _IDERDLL2_HXX +#define _IDERDLL2_HXX + +class StarBASIC; +class SvxSearchItem; +class Accelerator; + +#ifndef _STRING_HXX //autogen +#include <tools/string.hxx> +#endif + +#ifndef _GEN_HXX //autogen +#include <tools/gen.hxx> +#endif + +#ifndef _LINK_HXX //autogen +#include <tools/link.hxx> +#endif + +#include <bastypes.hxx> + +#define INVPOSITION 0x7fff + +class BasicIDEData +{ +private: + Accelerator* pAccelerator; + SvxSearchItem* pSearchItem; + + LibInfos aLibInfos; + + String TheLastMacroInMacroDlg; + + Point aObjCatPos; + Size aObjCatSize; + + String aAddLibPath; + String aAddLibFilter; + + USHORT nBasicDialogCount; + + BOOL OLD_bRelMacroRecording; + BOOL bChoosingMacro; + BOOL bShellInCriticalSection; + + void InitAccelerator(); + +protected: + DECL_LINK( GlobalBasicErrorHdl, StarBASIC * ); + DECL_LINK( GlobalBasicBreakHdl, StarBASIC * ); + +public: + BasicIDEData(); + ~BasicIDEData(); + + LibInfos& GetLibInfos() { return aLibInfos; } + + String& GetLastMacro() { return TheLastMacroInMacroDlg; } + BOOL& ChoosingMacro() { return bChoosingMacro; } + BOOL& ShellInCriticalSection() { return bShellInCriticalSection; } + + USHORT GetBasicDialogCount() const { return nBasicDialogCount; } + void IncBasicDialogCount() { nBasicDialogCount++; } + void DecBasicDialogCount() { nBasicDialogCount--; } + + SvxSearchItem& GetSearchItem() const; + void SetSearchItem( const SvxSearchItem& rItem ); + + void SetObjectCatalogPos( const Point& rPnt ) + { aObjCatPos = rPnt; } + const Point& GetObjectCatalogPos() const + { return aObjCatPos; } + + void SetObjectCatalogSize( const Size& rSize ) + { aObjCatSize = rSize; } + const Size& GetObjectCatalogSize() const + { return aObjCatSize; } + + const String& GetAddLibPath() const { return aAddLibPath; } + void SetAddLibPath( const String& rPath ) { aAddLibPath = rPath; } + + const String& GetAddLibFilter() const { return aAddLibFilter; } + void SetAddLibFilter( const String& rFilter ) { aAddLibFilter = rFilter; } + + Accelerator* GetAccelerator() + { + if ( !pAccelerator ) + InitAccelerator(); + return pAccelerator; + } + + DECL_LINK( ExecuteMacroEvent, void * ); +}; + + +#endif //_IDERDLL2_HXX diff --git a/basctl/source/basicide/idetemp.hxx b/basctl/source/basicide/idetemp.hxx new file mode 100644 index 000000000..b12d2d9e5 --- /dev/null +++ b/basctl/source/basicide/idetemp.hxx @@ -0,0 +1,87 @@ +/************************************************************************* + * + * $RCSfile: idetemp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _IDETEMP_HXX +#define _IDETEMP_HXX + + +enum SvxChooseControlEnum +{ + SVX_SNAP_PUSHBUTTON, + SVX_SNAP_CHECKBOX, + SVX_SNAP_RADIOBUTTON, + SVX_SNAP_SPINBUTTON, + SVX_SNAP_FIXEDTEXT, + SVX_SNAP_GROUPBOX, + SVX_SNAP_LISTBOX, + SVX_SNAP_COMBOBOX, + SVX_SNAP_EDIT, + SVX_SNAP_HSCROLLBAR, + SVX_SNAP_VSCROLLBAR, + SVX_SNAP_PREVIEW, + SVX_SNAP_SELECT, + SVX_SNAP_URLBUTTON, + SVX_SNAP_NOTHING +}; + +#define SvxChooseControlItem SfxAllEnumItem + +#endif + diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx new file mode 100644 index 000000000..bee3afd0c --- /dev/null +++ b/basctl/source/basicide/macrodlg.cxx @@ -0,0 +1,853 @@ +/************************************************************************* + * + * $RCSfile: macrodlg.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <ide_pch.hxx> + +#pragma hdrstop + +#include <macrodlg.hxx> +#include <macrodlg.hrc> +#include <basidesh.hrc> +#include <baside2.hrc> // ID's fuer Imagese +#include <basobj.hxx> + +#include <iderdll.hxx> +#include <iderdll2.hxx> +#include <iderid.hxx> + +#include <moduldlg.hxx> + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#include <bastypes.hxx> +#include <sbxitem.hxx> + +#ifndef _SFX_MINFITEM_HXX //autogen +#include <sfx2/minfitem.hxx> +#endif + +DECLARE_LIST( MacroList, SbMethod* ); + +MacroChooser::MacroChooser( Window* pParnt, BOOL bScanBasics ) : + SfxModalDialog( pParnt, IDEResId( RID_MACROCHOOSER ) ), + aMacroNameTxt( this, IDEResId( RID_TXT_MACRONAME ) ), + aMacroNameEdit( this, IDEResId( RID_ED_MACRONAME ) ), + aMacroBox( this, IDEResId( RID_CTRL_MACRO ) ), + aMacroFromTxT( this, IDEResId( RID_TXT_MACROFROM ) ), + aBasicBox( this, IDEResId( RID_CTRL_LIB ) ), + aRunButton( this, IDEResId( RID_PB_RUN ) ), + aCancelCloseButton( this, IDEResId( RID_PB_CANCEL ) ), + aAssignButton( this, IDEResId( RID_PB_ASSIGN ) ), + aEditButton( this, IDEResId( RID_PB_EDIT ) ), + aNewDelButton( this, IDEResId( RID_PB_DEL ) ), + aOrganizeButton( this, IDEResId( RID_PB_ORG ) ), + aHelpButton( this, IDEResId( RID_PB_HELP ) ), + aDescrTxt( this, IDEResId( RID_TXT_DESCRIPTION ) ), + aDescrEdit( this, IDEResId( RID_ML_DESCRIPTION ) ) +{ + FreeResource(); + + nMode = MACROCHOOSER_ALL; + bNewDelIsDel = TRUE; + bCancelCloseIsCancel = TRUE; + bAcceptDescription = TRUE; + + // Der Sfx fragt den BasicManager nicht, ob modified + // => Speichern anschmeissen, wenn Aenderung, aber kein Sprung in + // die BasicIDE. + bForceStoreBasic = FALSE; + + aMacroBox.SetSelectionMode( SINGLE_SELECTION ); + aMacroBox.SetHighlightRange(); // ueber ganze Breite selektieren + + aRunButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + aCancelCloseButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + aAssignButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + aEditButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + aNewDelButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + aOrganizeButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + + aMacroNameEdit.SetModifyHdl( LINK( this, MacroChooser, EditModifyHdl ) ); + + aBasicBox.SetSelectHdl( LINK( this, MacroChooser, BasicSelectHdl ) ); + + aMacroBox.SetDoubleClickHdl( LINK( this, MacroChooser, MacroDoubleClickHdl ) ); + aMacroBox.SetSelectHdl( LINK( this, MacroChooser, MacroSelectHdl ) ); + + aBasicBox.SetMode( BROWSEMODE_MODULES /* | BROWSEMODE_SUBS */ ); + aBasicBox.SetWindowBits( WB_HASLINES ); + + aDescrEdit.SetGetFocusHdl( LINK( this, MacroChooser, EditGotFocusHdl ) ); + aDescrEdit.SetLoseFocusHdl( LINK( this, MacroChooser, EditLoseFocusHdl ) ); + aDescrEdit.SetModifyHdl( LINK( this, MacroChooser, DescriptionModifyHdl ) ); + aDescrEdit.SetAccHdl( LINK( this, MacroChooser, EditAccHdl ) ); + aDescrEdit.GetAccelerator().InsertItem( 1, KeyCode( KEY_ESCAPE ) ); + + + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_STOREALLMODULESOURCES ); + } + + if ( bScanBasics ) + aBasicBox.ScanAllBasics(); +} + +MacroChooser::~MacroChooser() +{ + if ( bForceStoreBasic ) + SFX_APP()->SaveBasicManager(); +} + +void MacroChooser::StoreMacroDescription() +{ + String aLastMacroDescr( CreateEntryDescription( aBasicBox, aBasicBox.FirstSelected() ) ); + if ( aLastMacroDescr.GetTokenCount( ';' ) < 3 ) + aLastMacroDescr += ';'; + aLastMacroDescr += ';'; + SvLBoxEntry* pEntry = aMacroBox.FirstSelected(); + if ( pEntry ) + aLastMacroDescr += aMacroBox.GetEntryText ( pEntry ); + else + aLastMacroDescr += aMacroNameEdit.GetText(); + + /*aLastMacroDescr += pEntry ? aMacroBox.GetEntryText( pEntry ) : + aMacroNameEdit.GetText();*/ + IDE_DLL()->GetExtraData()->GetLastMacro() = aLastMacroDescr; +} + +void MacroChooser::RestoreMacroDescription() +{ + String aLastMacroDescr( IDE_DLL()->GetExtraData()->GetLastMacro() ); + if ( aLastMacroDescr.Len() ) + { + // MacroEntry: BasMgr;Bas;Mod;Macro + SvLBoxEntry* pEntry = FindMostMatchingEntry( aBasicBox, aLastMacroDescr ); + if ( pEntry ) + aBasicBox.SetCurEntry( pEntry ); + String aLastMacro( aLastMacroDescr.GetToken( 3, ';' ) ); + if ( aLastMacro.Len() ) + { + pEntry = FindMostMatchingEntry( aMacroBox, aLastMacro ); + if ( pEntry ) + aMacroBox.SetCurEntry( pEntry ); + else + { + aMacroNameEdit.SetText( aLastMacro ); + aMacroNameEdit.SetSelection( Selection( 0, 0 ) ); + } + } + } +} + +IMPL_LINK_INLINE_START( MacroChooser, EditGotFocusHdl, MultiLineEdit *, pEdit ) +{ + bAcceptDescription = TRUE; + return 0; +} +IMPL_LINK_INLINE_END( MacroChooser, EditGotFocusHdl, MultiLineEdit *, pEdit ) + +IMPL_LINK( MacroChooser, EditLoseFocusHdl, MultiLineEdit *, pEdit ) +{ + if ( bAcceptDescription ) + { + SbxVariable* pVar = GetMacro(); +/* + if ( !pVar ) + { + SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry(); + BYTE nType = pCurEntry ? ((BasicEntry*)pCurEntry->GetUserData())->GetType() : 0; + if ( ( nType == OBJTYPE_OBJECT ) || ( nType == OBJTYPE_MODULE ) || + ( nType == OBJTYPE_METHOD ) || ( nType == OBJTYPE_LIB ) || + ( nType == OBJTYPE_SUBOBJ ) ) + { + pVar = aBasicBox.FindVariable( pCurEntry ); + } + + } +*/ + if ( pVar ) + SetInfo( pVar ); + } + return 0; +} + +IMPL_LINK_INLINE_START( MacroChooser, DescriptionModifyHdl, MultiLineEdit *, pEdit ) +{ + CheckCancelClose(); + return 0; +} +IMPL_LINK_INLINE_END( MacroChooser, DescriptionModifyHdl, MultiLineEdit *, pEdit ) + + + +IMPL_LINK( MacroChooser, EditAccHdl, Accelerator *, pAcc ) +{ + if ( pAcc->GetCurKeyCode().GetCode() == KEY_ESCAPE ) + { + bAcceptDescription = FALSE; + UpdateFields(); + aCancelCloseButton.GrabFocus(); + } + + return 0; +} + +short __EXPORT MacroChooser::Execute() +{ + String aLastMacroDescr( IDE_DLL()->GetExtraData()->GetLastMacro() ); + + aBasicBox.ExpandAllTrees(); + if ( aLastMacroDescr.Len() ) + { + RestoreMacroDescription(); + aRunButton.GrabFocus(); + } + else + { + // Erstes Macro selektieren: + SvLBoxEntry* pEntry = aBasicBox.GetEntry( 0 ); +// SvLBoxEntry* pFirstEntry = pEntry; + SvLBoxEntry* pLastValid = pEntry; + while ( pEntry ) + { + pLastValid = pEntry; + pEntry = aBasicBox.FirstChild( pEntry ); + } + if ( pLastValid ) + { + // Pruefen, ob er Passwort-geschuetzt ist... +// String aLib, aDummy1, aDummy2, aDummy3; +// BasicManager* pBasicManager = aBasicBox.GetSbx( pLastValid, aLib, aDummy1, aDummy2, aDummy3 ); +// USHORT nLib = pBasicManager->GetLibId( aLib ); +// if ( !pBasicManager->HasPassword( nLib ) || +// pBasicManager->IsPasswordVerified( nLib ) ) +// { + aBasicBox.SetCurEntry( pLastValid ); +// } +// else +// { +// aBasicBox.SetCurEntry( pFirstEntry ); +// } + } + } + + CheckButtons(); + UpdateFields(); + + if ( StarBASIC::IsRunning() ) + aCancelCloseButton.GrabFocus(); + + Window* pPrevDlgParent = Application::GetDefDialogParent(); + Application::SetDefDialogParent( this ); + short nRet = ModalDialog::Execute(); + // #57314# Wenn die BasicIDE aktiviert wurde, dann nicht den DefModalDialogParent auf das inaktive Dokument zuruecksetzen. + if ( Application::GetDefDialogParent() == this ) + Application::SetDefDialogParent( pPrevDlgParent ); + return nRet; +} + +void MacroChooser::CheckCancelClose() +{ + if ( bCancelCloseIsCancel ) + { + bCancelCloseIsCancel = FALSE; + aCancelCloseButton.SetText( String( IDEResId( RID_STR_CLOSE ) ) ); + } +} + +void MacroChooser::EnableButton( Button& rButton, BOOL bEnable ) +{ + if ( bEnable ) + { + if ( nMode == MACROCHOOSER_CHOOSEONLY ) + { + // Nur der RunButton kann enabled werden + if ( &rButton == &aRunButton ) + rButton.Enable(); + else + rButton.Disable(); + } + else + rButton.Enable(); + } + else + rButton.Disable(); +} + + + + +SbMethod* MacroChooser::GetMacro() +{ + SbMethod* pMethod = 0; + SbModule* pModule = aBasicBox.FindModule( aBasicBox.GetCurEntry() ); + if ( pModule ) + { + SvLBoxEntry* pEntry = aMacroBox.FirstSelected(); + if ( pEntry ) + { + String aMacroName( aMacroBox.GetEntryText( pEntry ) ); + pMethod = (SbMethod*)pModule->GetMethods()->Find( aMacroName, SbxCLASS_METHOD ); + } + } + return pMethod; +} + + + +void MacroChooser::DeleteMacro() +{ + SbMethod* pMethod = GetMacro(); + DBG_ASSERT( pMethod, "DeleteMacro: Kein Macro !" ); + if ( pMethod && QueryDelMacro( pMethod->GetName(), this ) ) + { + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_STOREALLMODULESOURCES ); + } + + // Aktuelles Doc als geaendert markieren: + StarBASIC* pBasic = BasicIDE::FindBasic( pMethod ); + DBG_ASSERT( pBasic, "Basic?!" ); + BasicManager* pBasMgr = BasicIDE::FindBasicManager( pBasic ); + DBG_ASSERT( pBasMgr, "BasMgr?" ); + SfxObjectShell* pShell = BasicIDE::FindDocShell( pBasMgr ); + if ( pShell ) // Muss ja nicht aus einem Document kommen... + { + pShell->SetModified(); + BasicIDE::GetBindings().Invalidate( SID_SAVEDOC ); + } + + SbModule* pModule = pMethod->GetModule(); + DBG_ASSERT( pModule, "DeleteMacro: Kein Modul?!" ); + String aSource( pModule->GetSource() ); + USHORT nStart, nEnd; + pMethod->GetLineRange( nStart, nEnd ); + pModule->GetMethods()->Remove( pMethod ); + CutLines( aSource, nStart-1, nEnd-nStart+1, TRUE ); + pModule->SetSource( aSource ); + SvLBoxEntry* pEntry = aMacroBox.FirstSelected(); + DBG_ASSERT( pEntry, "DeleteMacro: Entry ?!" ); + aMacroBox.GetModel()->Remove( pEntry ); + bForceStoreBasic = TRUE; + } +} + +SbMethod* MacroChooser::CreateMacro() +{ + String aLib, aMod, aSub; + BasicManager* pBasMgr = aBasicBox.GetSelectedSbx( aLib, aMod, aSub ); + aSub = aMacroNameEdit.GetText(); + DBG_ASSERT( pBasMgr, "Record/New: Kein BasicManager?" ); + StarBASIC* pBasic = aLib.Len() ? pBasMgr->GetLib( aLib ) : pBasMgr->GetLib( 0 ); + if ( !pBasic ) + pBasic = pBasMgr->GetLib( 0 ); + DBG_ASSERT( pBasic, "Record/New: Kein Basic?" ); + SbModule* pModule = 0; + if( aMod.Len() ) + pModule = pBasic->FindModule( aMod ); + else if ( pBasic->GetModules()->Count() ) + pModule = (SbModule*)pBasic->GetModules()->Get( 0 ); + + if ( !pModule ) + { + NewObjectDialog* pNewDlg = new NewObjectDialog( this, NEWOBJECTMODE_MOD ); + pNewDlg->SetObjectName( BasicIDE::CreateModuleName( pBasic, aMod ) ); + if ( pNewDlg->Execute() ) + { + aMod = pNewDlg->GetObjectName(); + if ( !BasicIDE::FindModule( pBasic, aMod ) ) + { + pModule = BasicIDE::CreateModule( pBasic, aMod, FALSE ); + DBG_ASSERT( pModule , "Modul wurde nicht erzeugt!" ); + } + else + { + ErrorBox( this, WB_OK | WB_DEF_OK, + String( IDEResId( RID_STR_SBXNAMEALLREADYUSED2 ) ) ).Execute(); + } + } + delete pNewDlg; + } + + DBG_ASSERT( !pModule || !pModule->GetMethods()->Find( aSub, SbxCLASS_METHOD ), "Macro existiert schon!" ); + SbMethod* pMethod = pModule ? BasicIDE::CreateMacro( pModule, aSub ) : NULL; + return pMethod; +} + + + +void MacroChooser::ScanBasic( BasicManager* pBasMgr, const String& rName ) +{ + aBasicBox.ScanBasic( pBasMgr, rName ); +} + + + +void MacroChooser::SaveSetCurEntry( SvTreeListBox& rBox, SvLBoxEntry* pEntry ) +{ + // Durch das Highlight wird das Edit sonst platt gemacht: + + String aSaveText( aMacroNameEdit.GetText() ); + Selection aCurSel( aMacroNameEdit.GetSelection() ); + + rBox.SetCurEntry( pEntry ); + aMacroNameEdit.SetText( aSaveText ); + aMacroNameEdit.SetSelection( aCurSel ); +} + +void MacroChooser::CheckButtons() +{ + SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry(); + SvLBoxEntry* pMacroEntry = aMacroBox.FirstSelected(); + SbxVariable* pVar = aBasicBox.FindVariable( pCurEntry ); + SbMethod* pMethod = GetMacro(); + + // Run... + BOOL bEnable = pMethod ? TRUE : FALSE; + if ( ( nMode != MACROCHOOSER_CHOOSEONLY ) && StarBASIC::IsRunning() ) + bEnable = FALSE; + EnableButton( aRunButton, bEnable ); + + // Organisieren immer moeglich ? + + // Assign... + EnableButton( aAssignButton, pMethod ? TRUE : FALSE ); + + // Edit... + EnableButton( aEditButton, pMacroEntry ? TRUE : FALSE ); + + // aOrganizeButton + EnableButton( aOrganizeButton, !StarBASIC::IsRunning() && ( nMode == MACROCHOOSER_ALL )); + + // aNewDelButton.... + EnableButton( aNewDelButton, + !StarBASIC::IsRunning() && ( nMode == MACROCHOOSER_ALL ) && !aBasicBox.IsEntryProtected( aBasicBox.GetCurEntry() ) ); + BOOL bPrev = bNewDelIsDel; + bNewDelIsDel = pMethod ? TRUE : FALSE; + if ( ( bPrev != bNewDelIsDel ) && ( nMode != MACROCHOOSER_CHOOSEONLY ) ) + { + String aBtnText( bNewDelIsDel ? IDEResId( RID_STR_BTNDEL) : IDEResId( RID_STR_BTNNEW ) ); + aNewDelButton.SetText( aBtnText ); + } +} + + + +IMPL_LINK_INLINE_START( MacroChooser, MacroDoubleClickHdl, SvTreeListBox *, EMPTYARG ) +{ + StoreMacroDescription(); + EndDialog( MACRO_OK_RUN ); + return 0; +} +IMPL_LINK_INLINE_END( MacroChooser, MacroDoubleClickHdl, SvTreeListBox *, EMPTYARG ) + +IMPL_LINK( MacroChooser, MacroSelectHdl, SvTreeListBox *, pBox ) +{ + // Wird auch gerufen, wenn Deselektiert! + // 2 Funktionsaufrufe in jedem SelectHdl, nur weil Olli + // keinen separatren DeselctHdl einfuehren wollte: + // Also: Feststellen, ob Select oder Deselect: + if ( pBox->IsSelected( pBox->GetHdlEntry() ) ) + { + UpdateFields(); + CheckButtons(); + } + return 0; +} + +IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox ) +{ + // Wird auch gerufen, wenn Deselektiert! + // 2 Funktionsaufrufe in jedem SelectHdl, nur weil Olli + // keinen separatren DeselctHdl einfuehren wollte: + // Also: Feststellen, ob Select oder Deselect: + if ( !pBox->IsSelected( pBox->GetHdlEntry() ) ) + return 0; + + SbModule* pModule = aBasicBox.FindModule( aBasicBox.GetCurEntry() ); + + aMacroBox.Clear(); + if ( pModule ) + { + // Die Macros sollen in der Reihenfolge angezeigt werden, + // wie sie im Modul stehen. + MacroList aMacros; + USHORT nMacros = pModule->GetMethods()->Count(); + USHORT nMethod; + for ( nMethod = 0; nMethod < nMacros; nMethod++ ) + { + SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); + DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); + ULONG nPos = LIST_APPEND; + // Eventuell weiter vorne ? + USHORT nStart, nEnd; + pMethod->GetLineRange( nStart, nEnd ); + for ( ULONG n = 0; n < aMacros.Count(); n++ ) + { + USHORT nS, nE; + SbMethod* pM = aMacros.GetObject( n ); + DBG_ASSERT( pM, "Macro nicht in Liste ?!" ); + pM->GetLineRange( nS, nE ); + if ( nS > nStart ) + { + nPos = n; + break; + } + } + aMacros.Insert( pMethod, nPos ); + } + + aMacroBox.SetUpdateMode( FALSE ); + for ( nMethod = 0; nMethod < nMacros; nMethod++ ) + aMacroBox.InsertEntry( aMacros.GetObject( nMethod )->GetName() ); + aMacroBox.SetUpdateMode( TRUE ); + + if ( aMacroBox.GetEntryCount() ) + { + SvLBoxEntry* pEntry = aMacroBox.GetEntry( 0 ); + DBG_ASSERT( pEntry, "Entry ?!" ); + aMacroBox.SetCurEntry( pEntry ); + } + } + + UpdateFields(); + CheckButtons(); + return 0; +} + + + +IMPL_LINK( MacroChooser, EditModifyHdl, Edit *, pEdit ) +{ + // Das Modul, in dem bei Neu das Macro landet, selektieren, + // wenn BasicManager oder Lib selektiert. + SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry(); + if ( pCurEntry ) + { + USHORT nDepth = aBasicBox.GetModel()->GetDepth( pCurEntry ); + if ( ( nDepth == 1 ) && ( aBasicBox.IsEntryProtected( pCurEntry ) ) ) + { + // Dann auf die entsprechende Std-Lib stellen... + SvLBoxEntry* pManagerEntry = aBasicBox.GetModel()->GetParent( pCurEntry ); + pCurEntry = aBasicBox.GetModel()->FirstChild( pManagerEntry ); + } + if ( nDepth < 2 ) + { + SvLBoxEntry* pNewEntry = pCurEntry; + while ( pCurEntry && ( nDepth < 2 ) ) + { + pCurEntry = aBasicBox.FirstChild( pCurEntry ); + if ( pCurEntry ) + { + pNewEntry = pCurEntry; + nDepth = aBasicBox.GetModel()->GetDepth( pCurEntry ); + } + } + SaveSetCurEntry( aBasicBox, pNewEntry ); + } + if ( aMacroBox.GetEntryCount() ) + { + String aEdtText( aMacroNameEdit.GetText() ); + BOOL bFound = FALSE; + for ( USHORT n = 0; n < aMacroBox.GetEntryCount(); n++ ) + { + SvLBoxEntry* pEntry = aMacroBox.GetEntry( n ); + DBG_ASSERT( pEntry, "Entry ?!" ); + if ( aMacroBox.GetEntryText( pEntry ).CompareIgnoreCaseToAscii( aEdtText ) == COMPARE_EQUAL ) + { + SaveSetCurEntry( aMacroBox, pEntry ); + bFound = TRUE; + break; + } + } + if ( !bFound ) + { + SvLBoxEntry* pEntry = aMacroBox.FirstSelected(); + // Wenn es den Eintrag gibt ->Select ->Desription... +// aDescrEdit.SetText( "" ); + if ( pEntry ) + aMacroBox.Select( pEntry, FALSE ); + } + } + } + + CheckButtons(); + return 0; +} + + + +IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) +{ + // ausser bei New/Record wird die Description durch LoseFocus uebernommen. + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + + if ( pButton == &aRunButton ) + { + StoreMacroDescription(); + EndDialog( MACRO_OK_RUN ); + } + else if ( pButton == &aCancelCloseButton ) + { + if ( !bCancelCloseIsCancel ) + StoreMacroDescription(); + EndDialog( MACRO_CLOSE ); + } + else if ( ( pButton == &aEditButton ) || ( pButton == &aNewDelButton ) ) + { + String aLib, aMod, aSub; + BasicManager* pBasMgr = aBasicBox.GetSelectedSbx( aLib, aMod, aSub ); + SfxMacroInfoItem aInfoItem( SID_BASICIDE_ARG_MACROINFO, pBasMgr, aLib, aMod, aSub, String() ); + if ( pButton == &aEditButton ) + { + SvLBoxEntry* pEntry = aMacroBox.FirstSelected(); + if ( pEntry ) + aInfoItem.SetMethod( aMacroBox.GetEntryText( pEntry ) ); + StoreMacroDescription(); + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON ); + pDispatcher->Execute( SID_BASICIDE_EDITMACRO, SFX_CALLMODE_ASYNCHRON, &aInfoItem, 0L ); + } + EndDialog( MACRO_EDIT ); + } + else + { + if ( bNewDelIsDel ) + { + DeleteMacro(); + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_UPDATEMODULESOURCE, + SFX_CALLMODE_SYNCHRON, &aInfoItem, 0L ); + } + CheckButtons(); + UpdateFields(); + CheckCancelClose(); + //if ( aMacroBox.GetCurEntry() ) // OV-Bug ? + // aMacroBox.Select( aMacroBox.GetCurEntry() ); + } + else + { + BOOL bValid = BasicIDE::IsValidSbxName( aMacroNameEdit.GetText() ); + if ( !bValid ) + { + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_BADSBXNAME ) ) ).Execute(); + aMacroNameEdit.SetSelection( Selection( 0, aMacroNameEdit.GetText().Len() ) ); + aMacroNameEdit.GrabFocus(); + return 1; + } + SbMethod* pMethod = CreateMacro(); + if ( pMethod ) + { + SetInfo( pMethod ); + aInfoItem.SetMethod( pMethod->GetName() ); + aInfoItem.SetModule( pMethod->GetModule()->GetName() ); + aInfoItem.SetLib( pMethod->GetModule()->GetParent()->GetName() ); + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON ); + pDispatcher->Execute( SID_BASICIDE_EDITMACRO, SFX_CALLMODE_ASYNCHRON, &aInfoItem, 0L ); + } + StoreMacroDescription(); + EndDialog( MACRO_NEW ); + } + } + } + } + else if ( pButton == &aAssignButton ) + { + String aLib, aMod, aSub; + BasicManager* pBasMgr = aBasicBox.GetSelectedSbx( aLib, aMod, aSub ); + aSub = aMacroNameEdit.GetText(); + SbMethod* pMethod = GetMacro(); + DBG_ASSERT( pBasMgr, "BasMgr?" ); + DBG_ASSERT( pMethod, "Method?" ); + String aComment( GetInfo( pMethod ) ); + SfxMacroInfoItem aItem( SID_MACROINFO, pBasMgr, aLib, aMod, aSub, aComment ); + if( pDispatcher ) + { + pDispatcher->Execute( SID_CONFIG, + SFX_CALLMODE_SYNCHRON, &aItem, 0L ); + } + // Wenn jetzt ein FloatingWindow vom Config-Dlg hochgezogen wurde, + // muss dieser modale Dlg verschwinden: + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxChildWindow* pChildWin = pCurFrame ? pCurFrame->GetChildWindow(SID_CUSTOMIZETOOLBOX) : NULL; + if ( pChildWin ) + EndDialog( MACRO_CLOSE ); + } + else if ( pButton == &aOrganizeButton ) + { + StoreMacroDescription(); + + OrganizeDialog* pDlg = new OrganizeDialog( this ); + String aMacroDescr = CreateEntryDescription( aBasicBox, aBasicBox.FirstSelected() ); + pDlg->SetCurrentModule( aMacroDescr ); + USHORT nRet = pDlg->Execute(); + delete pDlg; + + if ( nRet ) // Nicht einfach nur geschlossen + { + EndDialog( MACRO_EDIT ); + return 0; + } + + if ( SFX_APP()->GetBasicManager()->IsModified() ) + bForceStoreBasic = TRUE; + + aBasicBox.Clear(); + aBasicBox.SetUpdateMode( FALSE ); + aBasicBox.ScanAllBasics(); + aBasicBox.ExpandAllTrees(); + aBasicBox.SetUpdateMode( TRUE ); + + RestoreMacroDescription(); + } + return 0; +} + + + +void MacroChooser::UpdateFields() +{ + SvLBoxEntry* pMacroEntry = aMacroBox.GetCurEntry(); + String aEmptyStr; + + aMacroNameEdit.SetText( aEmptyStr ); + if ( pMacroEntry ) + aMacroNameEdit.SetText( aMacroBox.GetEntryText( pMacroEntry ) ); + + aDescrEdit.SetText( aEmptyStr ); + // DescrEdit immer enablen: + // Entweder Text fuer aktuelles Macro oder fuer Aufzuzeichnendes +// aDescrEdit.Disable(); + SbxVariable* pVar = GetMacro(); +// if ( !pVar || !GetInfo( pVar).Len() ) +// pVar = aBasicBox.FindVariable( aBasicBox.GetCurEntry() ); + if ( pVar ) + { +// aDescrEdit.Enable(); + aDescrEdit.SetText( GetInfo( pVar ) ); + } +} + +void MacroChooser::SetMode( USHORT nM ) +{ + nMode = nM; + if ( nMode == MACROCHOOSER_ALL ) + { + aRunButton.SetText( String( IDEResId( RID_STR_RUN ) ) ); + EnableButton( aNewDelButton, TRUE ); + EnableButton( aOrganizeButton, TRUE ); + aDescrEdit.Enable(); + } + else if ( nMode == MACROCHOOSER_CHOOSEONLY ) + { + aRunButton.SetText( String( IDEResId( RID_STR_CHOOSE ) ) ); + EnableButton( aNewDelButton, FALSE ); + EnableButton( aOrganizeButton, FALSE ); + aDescrEdit.Disable(); + } + CheckButtons(); +} + +void MacroChooser::SetInfo( SbxVariable* pVar ) +{ + SbxInfoRef xInfo = pVar->GetInfo(); + if ( !xInfo.Is() ) + { + xInfo = new SbxInfo; + pVar->SetInfo( xInfo ); + } + xInfo->SetComment( aDescrEdit.GetText() ); + pVar->SetModified( TRUE ); + // Eine Method macht kein Modify auf den Parent + StarBASIC* pBasic = BasicIDE::FindBasic( pVar ); + if ( pBasic ) + { + pBasic->SetModified( TRUE ); + BasicIDE::MarkDocShellModified( pBasic ); + } +} + +String MacroChooser::GetInfo( SbxVariable* pVar ) +{ + String aComment; + SbxInfoRef xInfo = pVar->GetInfo(); + if ( xInfo.Is() ) + aComment = xInfo->GetComment(); + return aComment; +} + diff --git a/basctl/source/basicide/macrodlg.hrc b/basctl/source/basicide/macrodlg.hrc new file mode 100644 index 000000000..38318a4a3 --- /dev/null +++ b/basctl/source/basicide/macrodlg.hrc @@ -0,0 +1,87 @@ +/************************************************************************* + * + * $RCSfile: macrodlg.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _MACRODLG_HRC +#define _MACRODLG_HRC + +#include <svtools/solar.hrc> + +#define RID_MACROCHOOSER ( RID_BASICIDE_START + 50 ) +#define RID_STR_BTNDEL ( RID_BASICIDE_START + 51 ) +#define RID_STR_BTNNEW ( RID_BASICIDE_START + 52 ) +#define RID_STR_CHOOSE ( RID_BASICIDE_START + 53 ) +#define RID_STR_RUN ( RID_BASICIDE_START + 54 ) + +#define RID_CTRL_MACRO 1 +#define RID_CTRL_LIB 2 +#define RID_TXT_MACRONAME 3 +#define RID_TXT_MACROFROM 4 +#define RID_ED_MACRONAME 5 +#define RID_TXT_DESCRIPTION 6 +#define RID_PB_RUN 8 +#define RID_PB_CANCEL 9 +#define RID_PB_EDIT 10 +#define RID_PB_ORG 11 +#define RID_PB_DEL 12 +#define RID_PB_ASSIGN 13 +#define RID_PB_HELP 15 +#define RID_ML_DESCRIPTION 16 + +#endif // _MACRODLG_HRC diff --git a/basctl/source/basicide/macrodlg.hxx b/basctl/source/basicide/macrodlg.hxx new file mode 100644 index 000000000..d6d26093e --- /dev/null +++ b/basctl/source/basicide/macrodlg.hxx @@ -0,0 +1,163 @@ +/************************************************************************* + * + * $RCSfile: macrodlg.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +// +#ifndef _MACRODLG_HXX +#define _MACRODLG_HXX + +#ifndef _SVHEADER_HXX +#include <svheader.hxx> +#endif + +#include <bastype2.hxx> +#include <bastype3.hxx> + +#ifndef _BASEDLGS_HXX //autogen +#include <sfx2/basedlgs.hxx> +#endif + +#ifndef _SV_FIXED_HXX //autogen +#include <vcl/fixed.hxx> +#endif + +#ifndef _SV_BUTTON_HXX //autogen +#include <vcl/button.hxx> +#endif + +#define MACRO_CLOSE 10 +#define MACRO_OK_RUN 11 +#define MACRO_NEW 12 +#define MACRO_EDIT 14 +#define MACRO_ORGANIZE 15 +#define MACRO_ASSIGN 16 + +#define MACROCHOOSER_ALL 1 +#define MACROCHOOSER_CHOOSEONLY 2 +#define MACROCHOOSER_RECORDING 3 + +class BasicManager; + +class MacroChooser : public SfxModalDialog +{ +private: + FixedText aMacroNameTxt; + Edit aMacroNameEdit; + SvTreeListBox aMacroBox; + FixedText aMacroFromTxT; + BasicTreeListBox aBasicBox; + + PushButton aRunButton; + CancelButton aCancelCloseButton; + PushButton aAssignButton; + PushButton aEditButton; + PushButton aNewDelButton; + PushButton aOrganizeButton; + HelpButton aHelpButton; + + FixedText aDescrTxt; + ExtendedMultiLineEdit aDescrEdit; + + BOOL bNewDelIsDel; + BOOL bCancelCloseIsCancel; + BOOL bAcceptDescription; + BOOL bForceStoreBasic; + + USHORT nMode; + + DECL_LINK( MacroSelectHdl, SvTreeListBox * ); + DECL_LINK( MacroDoubleClickHdl, SvTreeListBox * ); + DECL_LINK( BasicSelectHdl, SvTreeListBox * ); + DECL_LINK( EditModifyHdl, Edit * ); + DECL_LINK( DescriptionModifyHdl, MultiLineEdit * ); + DECL_LINK( ButtonHdl, Button * ); + + void CheckButtons(); + void SaveSetCurEntry( SvTreeListBox& rBox, SvLBoxEntry* pEntry ); + void UpdateFields(); + + void EnableButton( Button& rButton, BOOL bEnable ); + void DeleteMacro(); + SbMethod* CreateMacro(); + DECL_LINK( EditGotFocusHdl, MultiLineEdit * ); + DECL_LINK( EditLoseFocusHdl, MultiLineEdit * ); + DECL_LINK( EditAccHdl, Accelerator * ); + void CheckCancelClose(); + + void SetInfo( SbxVariable* pVar ); + String GetInfo( SbxVariable* pVar ); + + void StoreMacroDescription(); + void RestoreMacroDescription(); + + +public: + MacroChooser( Window* pParent, BOOL ScanBasics = TRUE ); + ~MacroChooser(); + + void ScanBasic( BasicManager* pBasMgr, const String& rName ); + SbMethod* GetMacro(); + + virtual short Execute(); + + void SetMode( USHORT nMode ); + USHORT GetMode() const { return nMode; } +}; + +#endif // _MACRODLG_HXX diff --git a/basctl/source/basicide/macrodlg.src b/basctl/source/basicide/macrodlg.src new file mode 100644 index 000000000..0c06c57ce --- /dev/null +++ b/basctl/source/basicide/macrodlg.src @@ -0,0 +1,522 @@ +/************************************************************************* + * + * $RCSfile: macrodlg.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <sfx2/sfx.hrc> +#include <macrodlg.hrc> +#include <basidesh.hrc> +#include <helpid.hrc> +ModalDialog RID_MACROCHOOSER +{ + // HelpId = SID_BASICCHOOSER ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 287 , 165 ) ; + Text = "Makro" ; + Text [ ENGLISH ] = "Macro" ; + Text [ norwegian ] = "Makro" ; + Text [ italian ] = "Macro" ; + Text [ portuguese_brazilian ] = "Macro" ; + Text [ portuguese ] = "Macro" ; + Text [ finnish ] = "Makro" ; + Text [ danish ] = "Makro" ; + Text [ french ] = "Macro" ; + Text [ swedish ] = "Makro" ; + Text [ dutch ] = "Macro" ; + Text [ spanish ] = "Macro" ; + Text [ english_us ] = "Macro" ; + Moveable = TRUE ; + // Closeable = TRUE; + Control RID_CTRL_MACRO + { + HelpID = HID_BASICIDE_MACROS ; + Border = TRUE ; + Pos = MAP_APPFONT ( 6 , 31 ) ; + Size = MAP_APPFONT ( 100 , 80 ) ; + TabStop = TRUE ; + }; + Control RID_CTRL_LIB + { + HelpID = HID_BASICIDE_LIBS ; + Border = TRUE ; + Pos = MAP_APPFONT ( 112 , 16 ) ; + Size = MAP_APPFONT ( 110 , 95 ) ; + TabStop = TRUE ; + }; + FixedText RID_TXT_MACRONAME + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 100 , 10 ) ; + Text = "~Makroname" ; + Text [ ENGLISH ] = "~Macro name" ; + Text [ norwegian ] = "~Macro name" ; + Text [ italian ] = "Nome ~macro" ; + Text [ portuguese_brazilian ] = "Nome da ~macro" ; + Text [ portuguese ] = "Nome da ~macro" ; + Text [ finnish ] = "~Makron nimi" ; + Text [ danish ] = "Makronavn" ; + Text [ french ] = "~Nom de la macro" ; + Text [ swedish ] = "~Makronamn" ; + Text [ dutch ] = "~Macronaam" ; + Text [ spanish ] = "Nombre de la ~macro" ; + Text [ english_us ] = "Macro ~name" ; + Text[ chinese_simplified ] = "(~N)"; + Text[ russian ] = " "; + Text[ polish ] = "Nazwa makra"; + Text[ japanese ] = "ϸۖ(~N)"; + Text[ chinese_traditional ] = "W(~N)"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "ũ ̸(~N)"; + Text[ turkish ] = "Makro ad"; + }; + FixedText RID_TXT_MACROFROM + { + Pos = MAP_APPFONT ( 112 , 3 ) ; + Size = MAP_APPFONT ( 100 , 10 ) ; + Text = "Makro a~us" ; + Text [ ENGLISH ] = "Macro ~from" ; + Text [ norwegian ] = "Macro ~from" ; + Text [ italian ] = "Macro ~da" ; + Text [ portuguese_brazilian ] = "Macro ~from" ; + Text [ portuguese ] = "Macro ~de" ; + Text [ finnish ] = "Macro ~from" ; + Text [ danish ] = "Makro fra" ; + Text [ french ] = "M~acro de" ; + Text [ swedish ] = "Ma~kro frn" ; + Text [ dutch ] = "Ma~cro uit" ; + Text [ spanish ] = "Macro ~desde" ; + Text [ english_us ] = "Macro ~from" ; + Text[ chinese_simplified ] = "Դ(~F)"; + Text[ russian ] = " "; + Text[ polish ] = "Makro z"; + Text[ japanese ] = "ϸۂ̋L^(~F)"; + Text[ chinese_traditional ] = "ӷ(~F)"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "ũ ó(~F)"; + Text[ turkish ] = "Makro kayna"; + }; + Edit RID_ED_MACRONAME + { + Border = TRUE ; + SVLook = TRUE ; + Pos = MAP_APPFONT ( 6 , 16 ) ; + Size = MAP_APPFONT ( 100 , 12 ) ; + TabStop = TRUE ; + }; + FixedText RID_TXT_DESCRIPTION + { + Pos = MAP_APPFONT ( 6 , 117 ) ; + Size = MAP_APPFONT ( 100 , 10 ) ; + Text = "Be~schreibung" ; + Text [ ENGLISH ] = "De~scription" ; + Text [ norwegian ] = "Be~skrivelse" ; + Text [ italian ] = "De~scrizione" ; + Text [ portuguese_brazilian ] = "De~scrio" ; + Text [ portuguese ] = "De~scrio" ; + Text [ finnish ] = "Kuvau~s" ; + Text [ danish ] = "Beskrivelse" ; + Text [ french ] = "~Description" ; + Text [ swedish ] = "Be~skrivning" ; + Text [ dutch ] = "Be~schrijving" ; + Text [ spanish ] = "De~scripcin" ; + Text [ english_us ] = "De~scription" ; + Text[ chinese_simplified ] = "˵(~S)"; + Text[ russian ] = ""; + Text[ polish ] = "Opis"; + Text[ japanese ] = "(~S)"; + Text[ chinese_traditional ] = "yz(~S)"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "(~S)"; + Text[ turkish ] = "Aklama"; + }; + PushButton RID_PB_RUN + { + Pos = MAP_APPFONT ( 231 , 6 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + DefButton = TRUE; + /* ### ACHTUNG: Neuer Text in Resource? Aus~fhren : Aus~fhren */ + Text = "Aus~fhren" ; + Text [ ENGLISH ] = "R~un" ; + Text [ norwegian ] = "R~un" ; + Text [ italian ] = "Eseg~ui" ; + Text [ portuguese_brazilian ] = "Exec~utar" ; + Text [ portuguese ] = "Exec~utar" ; + Text [ finnish ] = "S~uorita" ; + Text [ danish ] = "Kr" ; + Text [ french ] = "E~xcuter" ; + Text [ swedish ] = "K~r" ; + Text [ dutch ] = "~Uitvoeren" ; + Text [ spanish ] = "Eje~cutar" ; + Text [ english_us ] = "R~un" ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "ִ(~U)"; + Text[ russian ] = ""; + Text[ polish ] = "Wykonaj"; + Text[ japanese ] = "s(~U)"; + Text[ chinese_traditional ] = "(~U)"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "(~U)"; + Text[ turkish ] = "Yrt"; + }; + CancelButton RID_PB_CANCEL + { + Pos = MAP_APPFONT ( 231 , 23 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + PushButton RID_PB_ASSIGN + { + Pos = MAP_APPFONT ( 231 , 60 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + Text = "~Zuordnen..." ; + Text [ ENGLISH ] = "~Assign..." ; + Text [ norwegian ] = "~Assign..." ; + Text [ italian ] = "~Assegna..." ; + Text [ portuguese_brazilian ] = "~Assign..." ; + Text [ portuguese ] = "~Atribuir" ; + Text [ finnish ] = "~Assign..." ; + Text [ danish ] = "Tildel..." ; + Text [ french ] = "~Assigner..." ; + Text [ swedish ] = "~Tilldela..." ; + Text [ dutch ] = "~Toewijzen..." ; + Text [ spanish ] = "Asig~nar..." ; + Text [ english_us ] = "~Assign..." ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "ָ(~A)..."; + Text[ russian ] = "..."; + Text[ polish ] = "Przyp~isz..."; + Text[ japanese ] = "蓖(~A)..."; + Text[ chinese_traditional ] = "w(~A)..."; + Text[ arabic ] = "..."; + Text[ greek ] = "..."; + Text[ korean ] = "(~A)..."; + Text[ turkish ] = "Ata..."; + }; + PushButton RID_PB_EDIT + { + Size = MAP_APPFONT ( 50 , 14 ) ; + Pos = MAP_APPFONT ( 231 , 77 ) ; + Text = "~Bearbeiten" ; + Text [ ENGLISH ] = "~Edit" ; + Text [ norwegian ] = "R~ediger" ; + Text [ italian ] = "Modifica" ; + Text [ portuguese_brazilian ] = "~Editar" ; + Text [ portuguese ] = "~Editar" ; + Text [ finnish ] = "Muo~kkaa" ; + Text [ danish ] = "~Rediger" ; + Text [ french ] = "~diter" ; + Text [ swedish ] = "~Redigera" ; + Text [ dutch ] = "~Bewerken" ; + Text [ spanish ] = "Edi~tar" ; + Text [ english_us ] = "~Edit" ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "༭(~E)"; + Text[ russian ] = "~"; + Text[ polish ] = "~Edytuj"; + Text[ japanese ] = "ҏW(~E)"; + Text[ chinese_traditional ] = "s(~E)"; + Text[ arabic ] = ""; + Text[ greek ] = "~"; + Text[ korean ] = "(~E)"; + Text[ turkish ] = "Dzenle"; + }; + PushButton RID_PB_DEL + { + Pos = MAP_APPFONT ( 231 , 94 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + /* ### ACHTUNG: Neuer Text in Resource? ~Lschen... : ~Lschen... */ + Text = "~Lschen..." ; + Text [ ENGLISH ] = "~Delete..." ; + Text [ norwegian ] = "~Slett..." ; + Text [ italian ] = "Elimina..." ; + Text [ portuguese_brazilian ] = "Apa~gar..." ; + Text [ portuguese ] = "Eliminar" ; + Text [ finnish ] = "~Poista..." ; + Text [ danish ] = "~Slet..." ; + Text [ french ] = "~Supprimer..." ; + Text [ swedish ] = "R~adera..." ; + Text [ dutch ] = "~Wissen..." ; + Text [ spanish ] = "~Eliminar..." ; + Text [ english_us ] = "~Delete..." ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "ɾ(~D)..."; + Text[ russian ] = "..."; + Text[ polish ] = "Usu..."; + Text[ japanese ] = "폜(~D)..."; + Text[ chinese_traditional ] = "R(~D)..."; + Text[ arabic ] = "..."; + Text[ greek ] = "..."; + Text[ korean ] = "(~D)..."; + Text[ turkish ] = "Sil..."; + }; + PushButton RID_PB_ORG + { + Pos = MAP_APPFONT ( 231 , 114 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + Text = "~Verwalten..." ; + Text [ ENGLISH ] = "Mana~ge..." ; + Text [ norwegian ] = "Mana~ge..." ; + Text [ italian ] = "Gestisci..." ; + Text [ portuguese_brazilian ] = "Geren~ciar..." ; + Text [ portuguese ] = "~Gerir..." ; + Text [ finnish ] = "~Ksittele..." ; + Text [ danish ] = "Administrer..." ; + Text [ french ] = "~Grer..." ; + Text [ swedish ] = "~Frvalta..." ; + Text [ dutch ] = "Be~heren..." ; + Text [ spanish ] = "~Administrar..." ; + Text [ english_us ] = "~Organizer..." ; + Text[ chinese_simplified ] = "(~O)..."; + Text[ russian ] = "..."; + Text[ polish ] = "Zarzdzaj..."; + Text[ japanese ] = "Ǘ(~O)..."; + Text[ chinese_traditional ] = "z(~O)..."; + Text[ arabic ] = "..."; + Text[ greek ] = "..."; + Text[ korean ] = "(~O)..."; + Text[ turkish ] = "Ynet..."; + }; + HelpButton RID_PB_HELP + { + Pos = MAP_APPFONT ( 231 , 131 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + MultiLineEdit RID_ML_DESCRIPTION + { + Border = TRUE ; + Pos = MAP_APPFONT ( 6 , 131 ) ; + Size = MAP_APPFONT ( 216 , 28 ) ; + TabStop = TRUE ; + VScroll = TRUE ; + IgnoreTab = TRUE ; + }; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Makro"; + Text[ japanese ] = "ϸ"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "ũ"; + Text[ turkish ] = "Makro"; +}; +String RID_STR_STDMACRONAME +{ + Text = "Makro" ; + Text [ ENGLISH ] = "Macro" ; + Text [ norwegian ] = "Makro" ; + Text [ italian ] = "Macro" ; + Text [ portuguese_brazilian ] = "Macro" ; + Text [ portuguese ] = "Macro" ; + Text [ finnish ] = "Makro" ; + Text [ danish ] = "Makro" ; + Text [ french ] = "Macro" ; + Text [ swedish ] = "Makro" ; + Text [ dutch ] = "Macro" ; + Text [ spanish ] = "Macro" ; + Text [ english_us ] = "Macro" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Makro"; + Text[ japanese ] = "ϸ"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "ũ"; + Text[ turkish ] = "Makro"; +}; +Bitmap RID_BMP_APPICON +{ + FILE = "basapp.bmp" ; +}; +String RID_STR_BTNDEL +{ + /* ### ACHTUNG: Neuer Text in Resource? ~Lschen... : ~Lschen... */ + Text = "~Lschen..." ; + Text [ ENGLISH ] = "~Delete..." ; + Text [ norwegian ] = "~Slett..." ; + Text [ italian ] = "Elimina" ; + Text [ portuguese_brazilian ] = "~Apagar..." ; + Text [ portuguese ] = "E~liminar..." ; + Text [ finnish ] = "~Poista..." ; + Text [ danish ] = "~Slet..." ; + Text [ french ] = "~Supprimer..." ; + Text [ swedish ] = "~Radera..." ; + Text [ dutch ] = "~Wissen..." ; + Text [ spanish ] = "~Eliminar..." ; + Text [ english_us ] = "~Delete..." ; + Text[ chinese_simplified ] = "ɾ(~D)"; + Text[ russian ] = "..."; + Text[ polish ] = "Usu..."; + Text[ japanese ] = "폜(~D)"; + Text[ chinese_traditional ] = "R(~D)"; + Text[ arabic ] = "..."; + Text[ greek ] = "..."; + Text[ korean ] = "(~D)..."; + Text[ turkish ] = "Sil..."; +}; +String RID_STR_BTNNEW +{ + Text = "~Neu" ; + Text [ ENGLISH ] = "~New" ; + Text [ norwegian ] = "~Ny" ; + Text [ italian ] = "~Nuovo" ; + Text [ portuguese_brazilian ] = "~Novo" ; + Text [ portuguese ] = "~Novo" ; + Text [ finnish ] = "~Uusi" ; + Text [ danish ] = "~Ny" ; + Text [ french ] = "~Nouveau" ; + Text [ swedish ] = "~Nytt" ; + Text [ dutch ] = "~Nieuw" ; + Text [ spanish ] = "~Nuevo" ; + Text [ english_us ] = "~New" ; + Text[ chinese_simplified ] = "½(~N)"; + Text[ russian ] = "~"; + Text[ polish ] = "Nowy"; + Text[ japanese ] = "VK쐬(~N)"; + Text[ chinese_traditional ] = "}ҷs(~N)"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "(~N)"; + Text[ turkish ] = "Yeni"; +}; +String RID_STR_CLOSE +{ + /* ### ACHTUNG: Neuer Text in Resource? Schlieen : Schlieen */ + Text = "Schlieen" ; + Text [ ENGLISH ] = "Close" ; + Text [ norwegian ] = "Lukk" ; + Text [ italian ] = "Chiudi" ; + Text [ portuguese_brazilian ] = "Fechar" ; + Text [ portuguese ] = "Fechar" ; + Text [ finnish ] = "Sulje" ; + Text [ danish ] = "Luk" ; + Text [ french ] = "Fermer" ; + Text [ swedish ] = "Stng" ; + Text [ dutch ] = "Sluiten" ; + Text [ spanish ] = "Cerrar" ; + Text [ english_us ] = "Close" ; + Text[ chinese_simplified ] = "ر"; + Text[ russian ] = ""; + Text[ polish ] = "Zamknij"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "ݱ"; + Text[ turkish ] = "Kapat"; +}; +String RID_STR_CHOOSE +{ + /* ### ACHTUNG: Neuer Text in Resource? Auswhlen : Auswhlen */ + Text = "Auswhlen" ; + Text [ ENGLISH ] = "Choose" ; + Text [ norwegian ] = "Choose" ; + Text [ italian ] = "Scegli" ; + Text [ portuguese_brazilian ] = "Choose" ; + Text [ portuguese ] = "Seleccionar" ; + Text [ english_us ] = "Choose" ; + Text [ finnish ] = "Choose" ; + Text [ danish ] = "Vlg" ; + Text [ french ] = "Slectionner" ; + Text [ swedish ] = "Vlj" ; + Text [ dutch ] = "Selecteren" ; + Text [ spanish ] = "Seleccionar" ; + Text[ chinese_simplified ] = "ѡ"; + Text[ russian ] = ""; + Text[ polish ] = "Wybierz"; + Text[ japanese ] = "I"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Se"; +}; +String RID_STR_RUN +{ + /* ### ACHTUNG: Neuer Text in Resource? Ausfhren : Ausfhren */ + Text = "Ausfhren" ; + Text [ ENGLISH ] = "Run" ; + Text [ norwegian ] = "Run" ; + Text [ italian ] = "Esegui" ; + Text [ portuguese_brazilian ] = "Executar" ; + Text [ portuguese ] = "Executar" ; + Text [ finnish ] = "Suorita" ; + Text [ danish ] = "Kr" ; + Text [ french ] = "Excuter" ; + Text [ swedish ] = "Kr" ; + Text [ dutch ] = "Uitvoeren" ; + Text [ spanish ] = "Ejecutar" ; + Text [ english_us ] = "Run" ; + Text[ chinese_simplified ] = "ִ"; + Text[ russian ] = ""; + Text[ polish ] = "Wykonaj"; + Text[ japanese ] = "s"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Yrt"; +}; diff --git a/basctl/source/basicide/makefile.mk b/basctl/source/basicide/makefile.mk new file mode 100644 index 000000000..9306a4b89 --- /dev/null +++ b/basctl/source/basicide/makefile.mk @@ -0,0 +1,123 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=BASCTL +TARGET=basicide + +PROJECTPCH4DLL=TRUE +PROJECTPCH=ide_pch +PROJECTPCHSOURCE=ide_pch + +# --- Settings ----------------------------------------------------------- + +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk +.INCLUDE : $(PRJ)$/util$/makefile.pmk + +.IF "$(basicdebug)" != "" || "$(BASICDEBUG)" != "" +CDEFS+=-DBASICDEBUG +.ENDIF + +# --- Allgemein ---------------------------------------------------------- + +IMGLST_SRS=$(SRS)$/basicide.srs +BMP_IN =$(PRJ)$/win/res + +SLOFILES = \ + $(SLO)$/basdoc.obj \ + $(SLO)$/basicbox.obj \ + $(SLO)$/basidesh.obj \ + $(SLO)$/basides1.obj \ + $(SLO)$/basides2.obj \ + $(SLO)$/basides3.obj \ + $(SLO)$/baside2.obj \ + $(SLO)$/baside2b.obj \ + $(SLO)$/baside3.obj \ + $(SLO)$/basobj.obj \ + $(SLO)$/basobj2.obj \ + $(SLO)$/basobj3.obj \ + $(SLO)$/bastypes.obj \ + $(SLO)$/bastype2.obj \ + $(SLO)$/bastype3.obj \ + $(SLO)$/brkdlg.obj \ + $(SLO)$/iderdll.obj \ + $(SLO)$/macrodlg.obj \ + $(SLO)$/moptions.obj \ + $(SLO)$/moduldlg.obj \ + $(SLO)$/moduldl2.obj \ + $(SLO)$/objdlg.obj \ + $(SLO)$/tbxctl.obj + +SRCFILES= basidesh.src macrodlg.src moptions.src moduldlg.src objdlg.src brkdlg.src tbxctl.src + + +.INCLUDE : target.mk + +.IF "$(depend)" == "" + +$(INCCOM)$/basicide.hrc: basidesh.hrc + @-+$(COPY) basidesh.hrc $@ + +.ENDIF diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx new file mode 100644 index 000000000..eca7af183 --- /dev/null +++ b/basctl/source/basicide/moduldl2.cxx @@ -0,0 +1,975 @@ +/************************************************************************* + * + * $RCSfile: moduldl2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#define GLOBALOVERFLOW + +#include <ide_pch.hxx> + +#ifdef VCL +#include <svtools/filedlg.hxx> +#endif + +#pragma hdrstop + +#include <sot/storinfo.hxx> + +#include <moduldlg.hrc> +#include <moduldlg.hxx> +#include <basidesh.hrc> +#include <bastypes.hxx> +#include <basobj.hxx> +#include <baside2.hrc> +#include <iderdll.hxx> +#include <iderdll2.hxx> +#include <svx/passwd.hxx> +#include <sbxitem.hxx> + +#ifndef _FSYS_HXX //autogen +#include <tools/fsys.hxx> +#endif + +#ifndef _SVSTOR_HXX //autogen +#include <so3/svstor.hxx> +#endif + + +#ifndef _IODLG_HXX //autogen +#include <sfx2/iodlg.hxx> +#endif + + + +LibPage::LibPage( Window * pParent ) : + TabPage( pParent,IDEResId( RID_TP_LIBS ) ), + aLibText( this, IDEResId( RID_STR_LIB ) ), + aLibBox( this, IDEResId( RID_TRLBOX ) ), + aBasicsBox( this, IDEResId( RID_LB_BASICS ) ), + aEditButton( this, IDEResId( RID_PB_EDIT ) ), + aCloseButton( this, IDEResId( RID_PB_CLOSE ) ), + aPasswordButton(this, IDEResId( RID_PB_PASSWORD ) ), + aNewLibButton( this, IDEResId( RID_PB_NEWLIB ) ), + aInsertLibButton( this, IDEResId( RID_PB_APPEND ) ), + aDelButton( this, IDEResId( RID_PB_DELETE ) ) +{ + FreeResource(); + pTabDlg = 0; + + aEditButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); + aNewLibButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); + aPasswordButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); + aInsertLibButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); + aDelButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); + aCloseButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); + aLibBox.SetSelectHdl( LINK( this, LibPage, TreeListHighlightHdl ) ); + + aBasicsBox.SetSelectHdl( LINK( this, LibPage, BasicSelectHdl ) ); + + aLibBox.SetMode( LIBMODE_MANAGER ); + aLibBox.EnableInplaceEditing( TRUE ); + aLibBox.SetCheckButtonHdl( LINK( this, LibPage, CheckBoxHdl ) ); + aCloseButton.GrabFocus(); + + long aTabs[] = { 2, 30, 120 }; + aLibBox.SetTabs( aTabs, MAP_PIXEL ); + + FillListBox(); + aBasicsBox.SelectEntryPos( 0 ); + SetCurLib(); + + CheckButtons(); +} + +void LibPage::CheckButtons() +{ + SvLBoxEntry* pCur = aLibBox.GetCurEntry(); + BOOL bCurChecked = pCur ? aLibBox.IsChecked( aLibBox.GetModel()->GetAbsPos( pCur ) ) : FALSE; + if ( bCurChecked ) + { + aEditButton.Enable(); + if ( aLibBox.GetModel()->GetAbsPos( pCur ) != 0 ) + aPasswordButton.Enable(); + else + aPasswordButton.Disable(); + } + else + { + aEditButton.Disable(); + aPasswordButton.Disable(); + } + + if ( pCur && aLibBox.GetModel()->GetAbsPos( pCur ) ) + aDelButton.Enable(); + else + aDelButton.Disable(); +} + + + +IMPL_LINK_INLINE_START( LibPage, CheckBoxHdl, SvTreeListBox *, EMPTYARG ) +{ + CheckButtons(); + return 0; +} +IMPL_LINK_INLINE_END( LibPage, CheckBoxHdl, SvTreeListBox *, EMPTYARG ) + + + +void __EXPORT LibPage::ActivatePage() +{ + SetCurLib(); +} + + + +void __EXPORT LibPage::DeactivatePage() +{ + ActivateCurrentLibSettings(); +} + + + +IMPL_LINK_INLINE_START( LibPage, TreeListHighlightHdl, SvTreeListBox *, pBox ) +{ + if ( pBox->IsSelected( pBox->GetHdlEntry() ) ) + CheckButtons(); + return 0; +} +IMPL_LINK_INLINE_END( LibPage, TreeListHighlightHdl, SvTreeListBox *, pBox ) + + + +IMPL_LINK_INLINE_START( LibPage, BasicSelectHdl, ListBox *, pBox ) +{ + SetCurLib(); + CheckButtons(); + return 0; +} +IMPL_LINK_INLINE_END( LibPage, BasicSelectHdl, ListBox *, pBox ) + + + +IMPL_LINK( LibPage, ButtonHdl, Button *, pButton ) +{ + if ( pButton == &aEditButton ) + { + ActivateCurrentLibSettings(); + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON ); + } + SvLBoxEntry* pCurEntry = aLibBox.GetCurEntry(); + DBG_ASSERT( pCurEntry, "Entry?!" ); + String aLib( CreateMgrAndLibStr( aCurBasMgr, aLibBox.GetEntryText( pCurEntry, 0 ) ) ); + SfxStringItem aLibName( SID_BASICIDE_ARG_LIBNAME, aLib ); + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_LIBSELECTED, + SFX_CALLMODE_ASYNCHRON, &aLibName, 0L ); + } + EndTabDialog( 1 ); + } + else if ( pButton == &aNewLibButton ) + NewLib(); + else if ( pButton == &aInsertLibButton ) + InsertLib(); + else if ( pButton == &aDelButton ) + DeleteCurrent(); + else if ( pButton == &aCloseButton ) + { + ActivateCurrentLibSettings(); + EndTabDialog( 0 ); + } + else if ( pButton == &aPasswordButton ) + { + String aBasicManager( aBasicsBox.GetSelectEntry() ); + BasicManager* pBasMgr = BasicIDE::FindBasicManager( aBasicManager ); + DBG_ASSERT( pBasMgr, "BasicManager?!" ); + + SvLBoxEntry* pCurEntry = aLibBox.GetCurEntry(); + USHORT nLib = (USHORT)aLibBox.GetModel()->GetAbsPos( pCurEntry ); + + BOOL bHadPassword = aLibBox.GetBasicManager()->HasPassword( nLib ); + // Noch nicht geladen, falls gerade erst aktiviert. + // Wuerde sonst erst beim Beenden des Dlg's geschehen. + if ( !aLibBox.GetBasicManager()->IsLibLoaded( nLib ) ) + { + Application::EnterWait(); + aLibBox.GetBasicManager()->LoadLib( nLib ); + Application::LeaveWait(); + } + + SvxPasswordDialog* pDlg = new SvxPasswordDialog( this, TRUE ); + String aPassword = pBasMgr->GetPassword( nLib ); +#ifdef DEBUG + InfoBox( 0, aPassword ).Execute(); +#endif + pDlg->SetOldPassword( aPassword ); + + if ( pDlg->Execute() == RET_OK ) + { + pBasMgr->SetPassword( nLib, pDlg->GetNewPassword() ); + pBasMgr->SetPasswordVerified( nLib ); + if ( bHadPassword != aLibBox.GetBasicManager()->HasPassword( nLib ) ) + { + aLibBox.GetModel()->Remove( pCurEntry ); + ImpInsertLibEntry( nLib ); + aLibBox.GetBasicManager()->SetPasswordVerified( nLib ); + } + } + delete pDlg; + } + CheckButtons(); + return 0; +} + +void LibPage::NewLib() +{ + BasicManager* pBasMgr = BasicIDE::FindBasicManager( aCurBasMgr ); + DBG_ASSERT( pBasMgr, "BasMgr?!" ); + String aLibName; + String aLibStdName( IDEResId( RID_STR_STDLIBNAME ) ); + BOOL bValid = FALSE; + USHORT i = 1; + while ( !bValid ) + { + aLibName = aLibStdName; + aLibName += String::CreateFromInt32( i ); + if ( !pBasMgr->HasLib( aLibName ) ) + bValid = TRUE; + i++; + } + + NewObjectDialog* pNewDlg = new NewObjectDialog( this, NEWOBJECTMODE_LIB ); + pNewDlg->SetObjectName( aLibName ); + BOOL bEnableSepFile = ( pBasMgr->GetStorageName().Len() && ( pBasMgr == SFX_APP()->GetBasicManager() ) ); + pNewDlg->EnableSeparateFile( bEnableSepFile ); + if ( pNewDlg->Execute() ) + { + if ( pNewDlg->GetObjectName().Len() ) + aLibName = pNewDlg->GetObjectName(); + + if ( aLibName.Len() > 30 ) + { + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_LIBNAMETOLONG ) ) ).Execute(); + } + else if ( !BasicIDE::IsValidSbxName( aLibName ) ) + { + ErrorBox( this, WB_OK | WB_DEF_OK, + String( IDEResId( RID_STR_BADSBXNAME ) ) ).Execute(); + } + else if ( pBasMgr->HasLib( aLibName ) ) + { + ErrorBox( this, WB_OK | WB_DEF_OK, + String( IDEResId( RID_STR_SBXNAMEALLREADYUSED2 ) ) ).Execute(); + } + else + { + BOOL bCreateLib = TRUE; + String aLibStorageName; + if ( pNewDlg->IsSeparateFile() ) + { + DirEntry aDirEntry( pBasMgr->GetStorageName() ); + String aExt = aDirEntry.GetExtension(); + aDirEntry.SetName( aLibName ); + aDirEntry.SetExtension( aExt ); + aLibStorageName = aDirEntry.GetFull(); + if ( aDirEntry.Exists() ) + { + String aText( IDEResId( RID_STR_FILEEXISTS ) ); + aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "XX" ) ), aLibStorageName ); + ErrorBox( this, WB_OK | WB_DEF_OK, aText ).Execute(); + bCreateLib = FALSE; + } + } + + if ( bCreateLib ) + { + StarBASIC* pLib = pBasMgr->CreateLib( aLibName ); + + SvLBoxEntry* pEntry = aLibBox.InsertEntry( aLibName ); + USHORT nPos = (USHORT)aLibBox.GetModel()->GetAbsPos( pEntry ); + USHORT nLib = pBasMgr->GetLibId( aLibName ); + aLibBox.CheckEntryPos( nPos, pBasMgr->IsLibLoaded( nLib ) ); + + if ( aLibStorageName.Len() ) + { + DirEntry aDirEntry( aLibStorageName ); + String aShortName = aDirEntry.GetName(); + + // Immer 8.3 + DirEntry aTempEntry( aDirEntry.GetPath() ); + if( aTempEntry.MakeShortName( aDirEntry.GetName(), FSYS_KIND_NONE, TRUE, FSYS_STYLE_FAT ) ) + { + aLibStorageName = aTempEntry.GetFull(); + aShortName = aTempEntry.GetName(); + } + pBasMgr->SetLibStorageName( nLib, aLibStorageName ); + aLibBox.SetEntryText( aShortName, pEntry, 1 ); + + // Sofort speichern, sonst erhaelt man ggf. spaeter + // nochmal den gleichen ShortName + pBasMgr->StoreLib( nLib ); + } + + // Ein Modul anlegen: + SbModule* pModule = BasicIDE::CreateModule( pLib, String(), TRUE ); + DBG_ASSERT( pModule , "Modul wurde nicht erzeugt!" ); + SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, pModule ); + + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_SBXINSERTED, + SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L ); + } + } + } + } + delete pNewDlg; +} + +void LibPage::InsertLib() +{ +// BasicManager* pBasMgr = BasicIDE::FindBasicManager( aCurBasMgr ); + BasicManager* pBasMgr = aLibBox.GetBasicManager(); + DBG_ASSERT( pBasMgr, "BasMgr?!" ); + + SfxFileDialog aFileDialogBox( this, WinBits( WB_OPEN | WB_3DLOOK ) ); + aFileDialogBox.SetText( String( IDEResId( RID_STR_APPENDLIBS ) ) ); + aFileDialogBox.AddFilter( String( IDEResId( RID_STR_BASIC ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.sbl" ) ) ); + aFileDialogBox.AddFilter( String( IDEResId( RID_STR_DOC ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.sdw;*.sdc;*.sdd" ) ) ); + + String aPath( IDE_DLL()->GetExtraData()->GetAddLibPath() ); + if ( aPath.Len() ) + { + aFileDialogBox.SetPath( aPath ); + aFileDialogBox.SetCurFilter( IDE_DLL()->GetExtraData()->GetAddLibFilter() ); + } + else + { + // Macro-Pfad vom Ini-Manager + SfxIniManager* pIni = SFX_INIMANAGER()->Find( SFX_KEY_WORK_PATH ); + if ( !pIni ) + pIni = SFX_INIMANAGER(); + DBG_ASSERT( pIni, "Ini?!" ); + aPath = pIni->Get( SFX_KEY_WORK_PATH ); + aPath += DirEntry::GetAccessDelimiter(); + aFileDialogBox.SetPath( aPath ); + aFileDialogBox.SetCurFilter( String( IDEResId( RID_STR_DOC ) ) ); + } + + if ( aFileDialogBox.Execute() ) + { + aPath = aFileDialogBox.GetPath(); + IDE_DLL()->GetExtraData()->SetAddLibPath( aPath ); + IDE_DLL()->GetExtraData()->SetAddLibFilter( aFileDialogBox.GetCurFilter() ); + DirEntry aDirEntry( aPath ); + String aFullName( aDirEntry.GetFull() ); + if ( SvStorage::IsStorageFile( aFullName ) ) + { + SvStorageRef xStorage = new SvStorage( aFullName, STREAM_READ | STREAM_SHARE_DENYWRITE ); + if ( xStorage->GetError() ) + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_ERROROPENSTORAGE ) ) ).Execute(); + else + { + // Die einzelnen Libs aus dem BasicStorage... + SvStorageRef xBasicStorage = xStorage->OpenStorage( String( RTL_CONSTASCII_USTRINGPARAM( "StarBASIC" ) ), STREAM_READ | STREAM_SHARE_DENYWRITE, 0 ); + if ( xBasicStorage->GetError() ) + InfoBox( this, String( IDEResId( RID_STR_NOLIBINSTORAGE ) ) ).Execute(); + else + { + LibDialog* pLibDlg = 0; + SvStorageInfoList aInfoList( 4, 4 ); + xBasicStorage->FillInfoList( &aInfoList ); + for ( USHORT nStream = 0; nStream < aInfoList.Count(); nStream++ ) + { + SvStorageInfo& rInf = aInfoList[nStream]; + if ( rInf.IsStream() ) + { + if ( !pLibDlg ) + { + pLibDlg = new LibDialog( this ); + pLibDlg->SetStorageName( aDirEntry.GetName() ); + pLibDlg->GetLibBox().SetMode( LIBMODE_CHOOSER ); + if ( pBasMgr == SFX_APP()->GetBasicManager() ) + pLibDlg->SetSeparateFileEnabled( TRUE ); + } + SvLBoxEntry* pEntry = pLibDlg->GetLibBox().InsertEntry( rInf.GetName() ); + USHORT nPos = (USHORT) pLibDlg->GetLibBox().GetModel()->GetAbsPos( pEntry ); + pLibDlg->GetLibBox().CheckEntryPos( nPos, TRUE); + + } + } + xBasicStorage.Clear(); + if ( !pLibDlg ) + InfoBox( this, String( IDEResId( RID_STR_NOLIBINSTORAGE ) ) ).Execute(); + else + { + BOOL bChanges = FALSE; + if ( pLibDlg->Execute() ) + { + ULONG nNewPos = aLibBox.GetEntryCount(); +// ULONG nCurPos = aLibBox.GetAbsPos( aLibBox.GetCurEntry() ); + BOOL bReplace = pLibDlg->IsReplace(); + BOOL bReference = pLibDlg->IsReference(); + for ( USHORT nLib = 0; nLib < pLibDlg->GetLibBox().GetEntryCount(); nLib++ ) + { + if ( pLibDlg->GetLibBox().IsChecked( nLib ) ) + { + SvLBoxEntry* pEntry = pLibDlg->GetLibBox().GetEntry( nLib ); + DBG_ASSERT( pEntry, "Entry?!" ); + String aName( pLibDlg->GetLibBox().GetEntryText( pEntry, 0 ) ); + // Optionen auswerten... + if ( pBasMgr->HasLib( aName ) ) + { + // Die Standard-Lib kann nicht ersetzt werden, + // weil Basics verkettet. + if ( bReplace && ( pBasMgr->GetLib( aName ) == pBasMgr->GetStdLib() ) ) + { + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_REPLACESTDLIB ) ) ).Execute(); + continue; + } + if ( bReplace ) + { + SvLBoxEntry* pEntry = aLibBox.FindEntry( aName ); + if ( pEntry ) + aLibBox.SvTreeListBox::GetModel()->Remove( pEntry ); + pBasMgr->RemoveLib( pBasMgr->GetLibId( aName ) ); + } + else if ( bReference ) + { + // Referenz nicht moeglich, wenn Lib mit + // Namen schon existiert, ausser bei Replace. + String aErrStr( IDEResId( RID_STR_REFNOTPOSSIBLE ) ); + aErrStr.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "XX" ) ), aName ); + aErrStr += '\n'; + aErrStr += String( IDEResId( RID_STR_SBXNAMEALLREADYUSED ) ); + ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute(); + continue; + } + } + StarBASIC* pNew = pBasMgr->AddLib( *xStorage, aName, bReference ); + if ( !pNew ) + { + String aErrStr( IDEResId( RID_STR_ERROROPENLIB ) ); + ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute(); + continue; + } + USHORT nLib = pBasMgr->GetLibId( pNew->GetName() ); + if ( pLibDlg->IsSeparateFile() ) + { + DirEntry aDirEntry( pBasMgr->GetStorageName() ); + String aExt = aDirEntry.GetExtension(); + aDirEntry.SetName( pBasMgr->GetLibName( nLib ) ); + aDirEntry.SetExtension( aExt ); + pBasMgr->SetLibStorageName( nLib, aDirEntry.GetFull() ); + } + DBG_ASSERT( nLib != LIB_NOTFOUND, "Lib nicht eingefuegt?!" ); + ImpInsertLibEntry( nLib ); + bChanges = TRUE; + } + } + SvLBoxEntry* pFirstNew = aLibBox.GetEntry( nNewPos ); + if ( pFirstNew ) + aLibBox.SetCurEntry( pFirstNew ); + } + delete pLibDlg; + if ( bChanges ) + BasicIDE::MarkDocShellModified( pBasMgr->GetStdLib() ); + } + } + } + } + else + { + // Erstmal nur in Storages moeglich, wie soll ein Basic in eine + // Datei kommen? + InfoBox( this, String( IDEResId( RID_STR_NOLIBINSTORAGE ) ) ).Execute(); + } + } +} + +void LibPage::DeleteCurrent() +{ + BasicManager* pBasMgr = BasicIDE::FindBasicManager( aCurBasMgr ); + DBG_ASSERT( pBasMgr, "BasMgr?!" ); + SvLBoxEntry* pCurEntry = aLibBox.GetCurEntry(); + DBG_ASSERT( pCurEntry && aLibBox.GetModel()->GetAbsPos( pCurEntry ), "Kann nicht loeschen!" ); + String aLibName( aLibBox.GetEntryText( pCurEntry, 0 ) ); + USHORT nLib = pBasMgr->GetLibId( aLibName ); + if ( QueryDelLib( aLibName, pBasMgr->IsReference( nLib ), this ) ) + { + // BasicIDE informieren, falls oben. + String aLib( CreateMgrAndLibStr( aCurBasMgr, aLibName ) ); + SfxStringItem aLibItem( SID_BASICIDE_ARG_LIBNAME, aLib ); + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_LIBREMOVED, + SFX_CALLMODE_SYNCHRON, &aLibItem, 0L ); + } + pBasMgr->RemoveLib( nLib, TRUE ); + ((SvLBox&)aLibBox).GetModel()->Remove( pCurEntry ); + BasicIDE::MarkDocShellModified( pBasMgr->GetStdLib() ); + } +} + + + +void LibPage::EndTabDialog( USHORT nRet ) +{ + DBG_ASSERT( pTabDlg, "TabDlg nicht gesetzt!" ); + if ( pTabDlg ) + pTabDlg->EndDialog( nRet ); +} + + + +void LibPage::FillListBox() +{ + BasicManager* pBasicMgr = SFX_APP()->GetBasicManager(); + SfxObjectShell* pDocShell = 0; + while ( pBasicMgr ) + { + // Nur, wenn es ein dazugehoeriges Fenster gibt, damit nicht die + // Gecachten Docs, die nicht sichtbar sind ( Remot-Dokumente ) + if ( !pDocShell || ( ( pBasicMgr != SFX_APP()->GetBasicManager() ) + && ( SfxViewFrame::GetFirst( pDocShell ) ) ) ) + { + String aBasMgr; + if (pDocShell) + aBasMgr = pDocShell->GetTitle( SFX_TITLE_FILENAME ); + else + aBasMgr = Application::GetAppName(); + + aBasicsBox.InsertEntry( aBasMgr, LISTBOX_APPEND ); + } + + if ( pDocShell ) + pDocShell = SfxObjectShell::GetNext( *pDocShell ); + else + pDocShell = SfxObjectShell::GetFirst(); + + pBasicMgr = ( pDocShell ? pDocShell->GetBasicManager() : 0 ); + } +} + + + +void LibPage::SetCurLib() +{ + String aSelected( aBasicsBox.GetSelectEntry() ); + if ( aSelected != aCurBasMgr ) + { + ActivateCurrentLibSettings(); + aCurBasMgr = aSelected; + BasicManager* pBasMgr = BasicIDE::FindBasicManager( aCurBasMgr ); + DBG_ASSERT( pBasMgr, "BasMgr?!" ); + aLibBox.SetBasicManager( pBasMgr ); + USHORT nLibs = pBasMgr->GetLibCount(); + aLibBox.Clear(); + Image aLockedImg( IDEResId( RID_IMG_LOCKED ) ); + for ( USHORT nLib = 0; nLib < nLibs; nLib++ ) + ImpInsertLibEntry( nLib ); + aLibBox.SetCurEntry( aLibBox.GetEntry( 0 ) ); + } +} + + + +void LibPage::ActivateCurrentLibSettings() +{ + BasicManager* pBasMgr = BasicIDE::FindBasicManager( aCurBasMgr ); + if ( pBasMgr ) // Beim ersten mal 0 + { + USHORT nLibs = (USHORT) aLibBox.GetEntryCount(); + // StandardLib kann nicht geaendert werden... + for ( USHORT nLib = 1; nLib < nLibs; nLib++ ) + { + BOOL bChecked = aLibBox.IsChecked( nLib ); + if ( bChecked != pBasMgr->IsLibLoaded( nLib ) ) + { + String aLibName( pBasMgr->GetLibName( nLib ) ); + String aLib( CreateMgrAndLibStr( aCurBasMgr, aLibName ) ); + SfxStringItem aLibItem( SID_BASICIDE_ARG_LIBNAME, aLib ); + + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if ( bChecked ) + { + pBasMgr->LoadLib( nLib ); + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_LIBLOADED, + SFX_CALLMODE_ASYNCHRON, &aLibItem, 0L ); + } + } + else + { + // Vorher aufrufen, damit noch im BasMgr + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_LIBREMOVED, + SFX_CALLMODE_SYNCHRON, &aLibItem, 0L ); + } + pBasMgr->StoreLib( nLib ); + pBasMgr->UnloadLib( nLib ); + } + } + } + } +} + +SvLBoxEntry* LibPage::ImpInsertLibEntry( USHORT nLib ) +{ + BasicManager* pBasicManager = aLibBox.GetBasicManager(); + DBG_ASSERT( pBasicManager, "ImpInsertLibEntry: Kein BasicManager!" ); + BOOL bPassword = pBasicManager->HasPassword( nLib ); +// if ( !pBasicManager->IsLibLoaded( nLib ) ) +// { +// // Lib muss geladen sein, wenn Passwortabfrage... +// pBasicManager->LoadLib( nLib ); +// bPassword = pBasicManager->HasPassword( nLib ); +// pBasicManager->UnloadLib( nLib ); +// } + if ( bPassword ) + { + Image aImg = Image( IDEResId( RID_IMG_LOCKED ) ); + Size aSz = aImg.GetSizePixel(); + aLibBox.SetDefaultExpandedEntryBmp( aImg ); + aLibBox.SetDefaultCollapsedEntryBmp( aImg ); + } + + SvLBoxEntry* pNewEntry = aLibBox.InsertEntry( pBasicManager->GetLibName( nLib ), nLib ); + + if ( pBasicManager->IsReference( nLib ) || pBasicManager->IsExtern( nLib ) ) + { + String aLibStorage = pBasicManager->GetLibStorageName( nLib ); + if ( pBasicManager->GetStorageName().Len() ) + { + DirEntry aEntry( pBasicManager->GetStorageName() ); + String aPath = aEntry.GetPath().GetFull(); + if ( aLibStorage.CompareIgnoreCaseToAscii( aPath, aPath.Len() ) == COMPARE_EQUAL ) + aLibStorage.Erase( 0, aPath.Len()+1 ); // Dann ohne Pfadangabe... + else if ( pBasicManager->GetRelLibStorageName( nLib ).Len() ) + aLibStorage = pBasicManager->GetRelLibStorageName( nLib ); // Kuerzer... + } + + aLibBox.SetEntryText( aLibStorage, pNewEntry, 1 ); + } + + aLibBox.CheckEntryPos( nLib, pBasicManager->IsLibLoaded( nLib ) ); + + if ( bPassword ) + { + Image aImg; // Default zuruecksetzen + aLibBox.SetDefaultExpandedEntryBmp( aImg ); + aLibBox.SetDefaultCollapsedEntryBmp( aImg ); + } + + return pNewEntry; +} + + +BasicCheckBox::BasicCheckBox( Window* pParent, const ResId& rResId ) : + SvTabListBox( pParent, rResId ) +{ + nMode = 0; + pBasMgr = 0; + long aTabs[] = { 1, 12 }; // Mindestens einen braucht die TabPos... + // 12 wegen der Checkbox + SetTabs( aTabs ); + Init(); +} + + + +__EXPORT BasicCheckBox::~BasicCheckBox() +{ + delete pCheckButton; +} + +void __EXPORT BasicCheckBox::CheckButtonHdl() +{ + SvLBoxEntry* pEntry = GetHdlEntry(); + DBG_ASSERT( pEntry, "HdlEntry?!" ); + ULONG nPos = GetModel()->GetAbsPos( pEntry ); + if ( !nPos && ( GetMode() == LIBMODE_MANAGER ) ) + { + CheckEntryPos( 0, TRUE ); + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_CANNOTUNLOADSTDLIB ) ) ).Execute(); + } + else + { + // SelectHdl ausloesen, damit Buttons geprueft werden. + SelectEntryPos( nPos, FALSE ); + SelectEntryPos( nPos, TRUE ); + } +} + +void BasicCheckBox::Init() +{ + BasicCheckBoxBitmaps theBmps; + + pCheckButton = new SvLBoxButtonData; + pCheckButton->aBmps[SV_BMP_UNCHECKED] = theBmps.GetUncheckedBmp(); + pCheckButton->aBmps[SV_BMP_CHECKED] = theBmps.GetCheckedBmp(); + pCheckButton->aBmps[SV_BMP_HICHECKED] = theBmps.GetHiCheckedBmp(); + pCheckButton->aBmps[SV_BMP_HIUNCHECKED] = theBmps.GetHiUncheckedBmp(); + pCheckButton->aBmps[SV_BMP_TRISTATE] = theBmps.GetTriStateBmp(); + pCheckButton->aBmps[SV_BMP_HITRISTATE] = theBmps.GetHiTriStateBmp(); + EnableCheckButton( pCheckButton ); + SetHighlightRange(); +} + +SvLBoxEntry* BasicCheckBox::InsertEntry( const String& rStr, ULONG nPos ) +{ +// return SvTreeListBox::InsertEntry( rStr, NULL, FALSE, nPos ); + return SvTabListBox::InsertEntry( rStr, nPos, 0 ); +} + + +void BasicCheckBox::RemoveEntry( ULONG nPos ) +{ + if ( nPos < GetEntryCount() ) + SvTreeListBox::GetModel()->Remove( GetEntry( nPos ) ); +} + +SvLBoxEntry* BasicCheckBox::FindEntry( const String& rName ) +{ + ULONG nCount = GetEntryCount(); + for ( ULONG i = 0; i < nCount; i++ ) + { + SvLBoxEntry* pEntry = GetEntry( i ); + DBG_ASSERT( pEntry, "pEntry?!" ); + if ( rName.CompareIgnoreCaseToAscii( GetEntryText( pEntry, 0 ) ) == COMPARE_EQUAL ) + return pEntry; + } + return 0; +} + + +void BasicCheckBox::SelectEntryPos( ULONG nPos, BOOL bSelect ) +{ + if ( nPos < GetEntryCount() ) + Select( GetEntry( nPos ), bSelect ); +} + + + +ULONG BasicCheckBox::GetSelectEntryPos() const +{ + return GetModel()->GetAbsPos( FirstSelected() ); +} + + + +ULONG BasicCheckBox::GetCheckedEntryCount() const +{ + ULONG nCheckCount = 0; + ULONG nCount = GetEntryCount(); + + for (ULONG i=0; i<nCount; i++ ) + { + if ( IsChecked( i ) ) + nCheckCount++; + } + + return nCheckCount; +} + + + +void BasicCheckBox::CheckEntryPos( ULONG nPos, BOOL bCheck ) +{ + if ( nPos < GetEntryCount() ) + { + SvLBoxEntry* pEntry = GetEntry( nPos ); + + if ( bCheck != GetCheckButtonState( pEntry ) ) + SetCheckButtonState( pEntry, + bCheck + ? SvButtonState(SV_BUTTON_CHECKED) + : SvButtonState(SV_BUTTON_UNCHECKED) ); + } +} + + + +BOOL BasicCheckBox::IsChecked( ULONG nPos ) const +{ + if ( nPos < GetEntryCount() ) + return (GetCheckButtonState( GetEntry( nPos ) ) == SV_BUTTON_CHECKED); + return FALSE; +} + + +BOOL __EXPORT BasicCheckBox::EditingEntry( SvLBoxEntry* pEntry, Selection& ) +{ + if ( nMode != LIBMODE_MANAGER ) + return FALSE; + + DBG_ASSERT( pEntry, "Kein Eintrag?" ); + ULONG nAbsPos = GetModel()->GetAbsPos( pEntry ); + if ( nAbsPos == 0 ) + { + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_CANNOTCHANGENAMESTDLIB ) ) ).Execute(); + return FALSE; + } + + // Prueffen, ob Referenz... + USHORT nLib = pBasMgr->GetLibId( GetEntryText( pEntry, 0 ) ); + DBG_ASSERT( nLib != LIB_NOTFOUND, "LibId ?!" ); + if ( pBasMgr->IsReference( nLib ) ) + { + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_CANNOTCHANGENAMEREFLIB ) ) ).Execute(); + return FALSE; + } + return TRUE; +} + + + +BOOL __EXPORT BasicCheckBox::EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ) +{ + BOOL bValid = ( rNewText.Len() <= 30 ) && BasicIDE::IsValidSbxName( rNewText ); + String aCurText( GetEntryText( pEntry, 0 ) ); + if ( bValid && ( aCurText != rNewText ) ) + { + // Prueffen, ob Lib mit dem Namen existiert! + DBG_ASSERT( pBasMgr, "BasMgr nicht gesetzt!" ); + if ( pBasMgr->HasLib( rNewText ) ) + { + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_SBXNAMEALLREADYUSED ) ) ).Execute(); + return FALSE; + } + USHORT nLib = pBasMgr->GetLibId( aCurText ); + DBG_ASSERT( nLib != LIB_NOTFOUND, "Lib nicht gefunden!" ); + pBasMgr->SetLibName( nLib, rNewText ); + BasicIDE::MarkDocShellModified( pBasMgr->GetStdLib() ); + BasicIDE::GetBindings().Invalidate( SID_BASICIDE_LIBSELECTOR ); + BasicIDE::GetBindings().Update( SID_BASICIDE_LIBSELECTOR ); + } + + if ( !bValid ) + { + if ( rNewText.Len() > 30 ) + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_LIBNAMETOLONG ) ) ).Execute(); + else + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_BADSBXNAME ) ) ).Execute(); + } + return bValid; +} + + + +BasicCheckBoxBitmaps::BasicCheckBoxBitmaps() : + Resource ( ResId( RID_RES_CHECKBITMAPS ) ), + aUncheckedBmp ( ResId( CHKBTN_UNCHECKED ) ), + aCheckedBmp ( ResId( CHKBTN_CHECKED ) ), + aHiCheckedBmp ( ResId( CHKBTN_HICHECKED ) ), + aHiUncheckedBmp ( ResId( CHKBTN_HIUNCHECKED ) ), + aTriStateBmp ( ResId( CHKBTN_TRISTATE ) ), + aHiTriStateBmp ( ResId( CHKBTN_HITRISTATE ) ) +{ + FreeResource(); +} + + +NewObjectDialog::NewObjectDialog( Window* pParent, USHORT nMode ) + : ModalDialog( pParent, IDEResId( RID_DLG_NEWLIB ) ), + aText( this, IDEResId( RID_FT_NEWLIB ) ), + aEdit( this, IDEResId( RID_ED_LIBNAME ) ), + aCheckBox( this, IDEResId( RID_CHKB_EXTRAFILE ) ), + aOKButton( this, IDEResId( RID_PB_OK ) ), + aCancelButton( this, IDEResId( RID_PB_CANCEL ) ) +{ + FreeResource(); + aEdit.GrabFocus(); + + if ( nMode == NEWOBJECTMODE_LIB ) + { + aCheckBox.Show(); + SetText( String( IDEResId( RID_STR_NEWLIB ) ) ); + } + else if ( nMode == NEWOBJECTMODE_MOD ) + { + SetText( String( IDEResId( RID_STR_NEWMOD ) ) ); + } + else + { + SetText( String( IDEResId( RID_STR_NEWDLG ) ) ); + } +} + +NewObjectDialog::~NewObjectDialog() +{ +} + diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx new file mode 100644 index 000000000..ee0d6d297 --- /dev/null +++ b/basctl/source/basicide/moduldlg.cxx @@ -0,0 +1,795 @@ +/************************************************************************* + * + * $RCSfile: moduldlg.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <ide_pch.hxx> + +#pragma hdrstop + +#include <moduldlg.hrc> +#include <moduldlg.hxx> +#include <basidesh.hrc> +#include <bastypes.hxx> +#include <basobj.hxx> +#include <baside2.hrc> +#include <sbxitem.hxx> + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif + +ExtBasicTreeListBox::ExtBasicTreeListBox( Window* pParent, const ResId& rRes ) + : BasicTreeListBox( pParent, rRes ) +{ +} + + + +ExtBasicTreeListBox::~ExtBasicTreeListBox() +{ +} + +BOOL __EXPORT ExtBasicTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection& ) +{ + DBG_ASSERT( pEntry, "Kein Eintrag?" ); + USHORT nDepth = GetModel()->GetDepth( pEntry ); + return nDepth == 2 ? TRUE : FALSE; +} + +BOOL __EXPORT ExtBasicTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ) +{ + BOOL bValid = BasicIDE::IsValidSbxName( rNewText ); + String aCurText( GetEntryText( pEntry ) ); + if ( bValid && ( aCurText != rNewText ) ) + { + SbxVariable* pVar = FindVariable( pEntry ); + DBG_ASSERT( pVar, "Variable nicht gefunden!" ); + + SbxVariable* pBasic = pVar->GetParent(); + DBG_ASSERT( pBasic->ISA( StarBASIC ), "Parent kein Basic ?!" ); + + // Pruefen, ob mit dem Namen vorhanden... + // Nicht im QueryDrop, zu Aufwendig! + // #63718# Darf aber 'case-sensitiv umbenannt' werden. + if ( ( aCurText.CompareIgnoreCaseToAscii( rNewText ) != COMPARE_EQUAL ) && + ( ( pVar->ISA( SbModule ) && ((StarBASIC*)pBasic)->FindModule( rNewText ) ) || + ( pVar->ISA( SbxObject ) && ((StarBASIC*)pBasic)->GetObjects()->Find( rNewText, SbxCLASS_OBJECT ) ) ) ) + { + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_SBXNAMEALLREADYUSED2 ) ) ).Execute(); + return FALSE; + } + + pVar->SetName( rNewText ); + BasicIDE::MarkDocShellModified( (StarBASIC*)pBasic ); + + SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, pVar ); + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_SBXRENAMED, + SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L ); + } + + // OV-Bug?! + SetEntryText( pEntry, rNewText ); + SetCurEntry( pEntry ); + SetCurEntry( pEntry ); + Select( pEntry, FALSE ); + Select( pEntry ); // damit Handler gerufen wird => Edit updaten + } + if ( !bValid ) + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_BADSBXNAME ) ) ).Execute(); + return bValid; +} + + + +DragDropMode __EXPORT ExtBasicTreeListBox::NotifyBeginDrag( SvLBoxEntry* pEntry ) +{ + USHORT nDepth = pEntry ? GetModel()->GetDepth( pEntry ) : 0; + return nDepth == 2 ? GetDragDropMode() : 0; +} + + + +BOOL __EXPORT ExtBasicTreeListBox::NotifyQueryDrop( SvLBoxEntry* pEntry ) +{ + USHORT nDepth = pEntry ? GetModel()->GetDepth( pEntry ) : 0; + BOOL bValid = nDepth ? TRUE : FALSE; // uebrall hin, nur nicht auf einen BasMgr + SvLBoxEntry* pSelected = FirstSelected(); + // nicht innerhalb einer Lib: + if ( ( nDepth == 1 ) && ( pEntry == GetParent( pSelected ) ) ) + bValid = FALSE; + else if ( ( nDepth == 2 ) && ( GetParent( pEntry ) == GetParent( pSelected ) ) ) + bValid = FALSE; + + if ( bValid && ( nDepth == 1 ) ) + { + // Es darf nicht auf eine geschuetzte oder nicht geladene + // Libary gedroppt werden. + String aLib = GetEntryText( pEntry ); + String aMgr = GetEntryText( GetParent( pEntry ) ); + BasicManager* pBasicManager = BasicIDE::FindBasicManager( aMgr ); + if ( pBasicManager ) + { + USHORT nLib = pBasicManager->GetLibId( aLib ); + if ( !pBasicManager->IsLibLoaded( nLib ) || ( + pBasicManager->HasPassword( nLib ) && + !pBasicManager->IsPasswordVerified( nLib ) ) ) + { + bValid = FALSE; + } + } + else + bValid = FALSE; + + } + return bValid; +} + + + +BOOL __EXPORT ExtBasicTreeListBox::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ) +{ + return NotifyCopyingMoving( pTarget, pEntry, + rpNewParent, rNewChildPos, TRUE ); +} + + + +BOOL __EXPORT ExtBasicTreeListBox::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ) +{ +// return FALSE; // Wie kopiere ich ein SBX ?! + return NotifyCopyingMoving( pTarget, pEntry, + rpNewParent, rNewChildPos, FALSE ); +} + + + +BOOL __EXPORT ExtBasicTreeListBox::NotifyCopyingMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos, BOOL bMove ) +{ + DBG_ASSERT( pEntry, "Kein Eintrag?" ); // Hier ASS ok, sollte nicht mit + DBG_ASSERT( pTarget, "Kein Ziel?" ); // NULL (ganz vorne) erreicht werden + USHORT nDepth = GetModel()->GetDepth( pTarget ); + DBG_ASSERT( nDepth, "Tiefe?" ); + if ( nDepth == 1 ) + { + // Target = Basic => Modul/Dialog unter das Basic haengen... + rpNewParent = pTarget; + rNewChildPos = 0; + } + else if ( nDepth == 2 ) + { + // Target = Modul/Dialog => Modul/Dialog unter das uebergeordnete Basic haengen... + rpNewParent = GetParent( pTarget ); + rNewChildPos = GetModel()->GetRelPos( pTarget ) + 1; + } + + // Moven... + + // Der Parent ist das Basic: + SbxVariable* pVar = FindVariable( rpNewParent ); + DBG_ASSERT( pVar && pVar->ISA( StarBASIC ), "Parent ist kein Basic!" ); + StarBASIC* pDestBasic = (StarBASIC*)pVar; + + // Kopiert/Verschoben wird ein Modul/Dialog: + pVar = FindVariable( FirstSelected() ); + DBG_ASSERT( pVar && pVar->ISA( SbxObject ), "Kein Object selektiert?" ); + SbxObject* pObj = (SbxObject*)pVar; + + // Pruefen, ob mit dem Namen vorhanden... + // Nicht im QueryDrop, zu Aufwendig! + if ( ( pVar->ISA( SbModule ) && pDestBasic->FindModule( pVar->GetName() ) ) || + ( pVar->ISA( SbxObject ) && pDestBasic->GetObjects()->Find( pVar->GetName(), SbxCLASS_OBJECT ) ) ) + { + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_SBXNAMEALLREADYUSED2 ) ) ).Execute(); + return FALSE; + } + + // Aus welchem Basic lommt das Object? + StarBASIC* pSourceBasic = BasicIDE::FindBasic( pObj ); + DBG_ASSERT( pSourceBasic, "Woher kommt das Object?" ); + + SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, pObj ); + + USHORT nDestPos = (USHORT)rNewChildPos; // evtl. anpassen... + SbxVariableRef xObj = pObj; // festhalten waehrend Remove! + + DBG_ASSERT( !xObj->ISA( SbMethod ), "Move/Copy fuer Methoden nicht implementiert!" ); + DBG_ASSERT( xObj->ISA( SbModule) || ( xObj->GetSbxId() == GetDialogSbxId() ), "Move fuer unbekanntes Objekt nicht implementiert!" ); + + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if ( bMove ) + { + // BasicIDE bescheid sagen, dass Sbx verschwindet + if ( pSourceBasic != pDestBasic ) + { + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_SBXDELETED, + SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L ); + } + } + + // Sbx aus dem Basic entfernen und in das andere Basic haengen... + pSourceBasic->Remove( xObj ); + pDestBasic->Insert( xObj ); + BasicIDE::MarkDocShellModified( pSourceBasic ); + BasicIDE::MarkDocShellModified( pDestBasic ); + } + else // Copy + { + // Wie ?! + SvMemoryStream aTmpStream; + BOOL bDone = xObj->Store( aTmpStream ); + aTmpStream.Seek( 0L ); + DBG_ASSERT( bDone, "Temporaeres Speichern fehlgeschlagen!" ); + SbxBaseRef xNewSbx = SbxBase::Load( aTmpStream ); + DBG_ASSERT( xNewSbx.Is() && xNewSbx->ISA( SbxVariable ), "Kein Object erzeugt, oder Object keine Variable!" ); + DBG_ASSERT( xNewSbx->ISA( SbModule) || ( ((SbxVariable*)(SbxBase*)xNewSbx)->GetSbxId() == GetDialogSbxId() ), "Copy fuer unbekanntes Objekt nicht implementiert!" ); + pDestBasic->Insert( (SbxVariable*)(SbxBase*)xNewSbx ); + BasicIDE::MarkDocShellModified( pDestBasic ); + } + + if ( pSourceBasic != pDestBasic ) + { + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_SBXINSERTED, + SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L ); + } + } + + return 2; // Aufklappen... +} + + +OrganizeDialog::OrganizeDialog( Window* pParent ) + : TabDialog( pParent, IDEResId( RID_TD_ORGANIZE ) ), + aTabCtrl( this, IDEResId( RID_TC_ORGANIZE ) ) +{ + FreeResource(); + aTabCtrl.SetActivatePageHdl( LINK( this, OrganizeDialog, ActivatePageHdl ) ); + aTabCtrl.SetCurPageId( RID_TP_MOD ); + ActivatePageHdl( &aTabCtrl ); + + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_STOREALLMODULESOURCES ); + } +} + +void OrganizeDialog::SetCurrentModule( const String& rMacroDescr ) +{ + TabPage* pTP = aTabCtrl.GetTabPage( RID_TP_MOD ); + if ( pTP ) + ((ObjectPage*)pTP)->SetCurrentModule( rMacroDescr ); +} + +__EXPORT OrganizeDialog::~OrganizeDialog() +{ + for ( USHORT i = 0; i < aTabCtrl.GetPageCount(); i++ ) + delete aTabCtrl.GetTabPage( aTabCtrl.GetPageId( i ) ); +}; + +short OrganizeDialog::Execute() +{ + Window* pPrevDlgParent = Application::GetDefDialogParent(); + Application::SetDefDialogParent( this ); + short nRet = TabDialog::Execute(); + Application::SetDefDialogParent( pPrevDlgParent ); + return nRet; +} + + +IMPL_LINK( OrganizeDialog, ActivatePageHdl, TabControl *, pTabCtrl ) +{ + USHORT nId = pTabCtrl->GetCurPageId(); + // Wenn TabPage noch nicht erzeugt wurde, dann erzeugen + if ( !pTabCtrl->GetTabPage( nId ) ) + { + TabPage* pNewTabPage = 0; + switch ( nId ) + { + case RID_TP_MOD: + { + pNewTabPage = new ObjectPage( pTabCtrl ); + ((ObjectPage*)pNewTabPage)->SetTabDlg( this ); + } + break; + case RID_TP_LIB: + { + pNewTabPage = new LibPage( pTabCtrl ); + ((LibPage*)pNewTabPage)->SetTabDlg( this ); + } + break; + default: DBG_ERROR( "PageHdl: Unbekannte ID!" ); + } + DBG_ASSERT( pNewTabPage, "Keine Page!" ); + pTabCtrl->SetTabPage( nId, pNewTabPage ); + } + return 0; +} + + + + +ObjectPage::ObjectPage( Window * pParent ) : + TabPage( pParent,IDEResId( RID_TP_MODULS ) ), + aLibText( this, IDEResId( RID_STR_LIB ) ), + aBasicBox( this, IDEResId( RID_TRLBOX ) ), +// aEdit( this, IDEResId( RID_EDIT ) ), + aEditButton( this, IDEResId( RID_PB_EDIT ) ), + aCloseButton( this, IDEResId( RID_PB_CLOSE ) ), + aNewModButton( this, IDEResId( RID_PB_NEWMOD ) ), + aNewDlgButton( this, IDEResId( RID_PB_NEWDLG ) ), + aDelButton( this, IDEResId( RID_PB_DELETE ) ) +{ + FreeResource(); + pTabDlg = 0; + + aEditButton.SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) ); + aNewModButton.SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) ); + aNewDlgButton.SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) ); + aDelButton.SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) ); + aCloseButton.SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) ); + aBasicBox.SetSelectHdl( LINK( this, ObjectPage, BasicBoxHighlightHdl ) ); + +// aEdit.SetModifyHdl( LINK( this, ObjectPage, EditModifyHdl ) ); + + aBasicBox.SetDragDropMode( SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY ); + aBasicBox.EnableInplaceEditing( TRUE ); + + aBasicBox.SetMode( BROWSEMODE_MODULES | BROWSEMODE_OBJS ); + aBasicBox.SetWindowBits( WB_HASLINES ); + + aEditButton.GrabFocus(); + CheckButtons(); +} + +void __EXPORT ObjectPage::ActivatePage() +{ + aBasicBox.Clear(); + aBasicBox.ScanAllBasics(); + aBasicBox.ExpandAllTrees(); + + ImplMarkCurrentModule(); +} + +void ObjectPage::ImplMarkCurrentModule() +{ + if ( aCurEntryDescr.Len() ) + { + SvLBoxEntry* pEntry = FindMostMatchingEntry( aBasicBox, aCurEntryDescr ); + if ( pEntry ) + aBasicBox.SetCurEntry( pEntry ); + } +} + +void __EXPORT ObjectPage::DeactivatePage() +{ + SvLBoxEntry* pEntry = aBasicBox.GetCurEntry(); + if ( pEntry ) + aCurEntryDescr = CreateEntryDescription( aBasicBox, pEntry ); +} + +void ObjectPage::CheckButtons() +{ + BOOL bEnableNew = FALSE; + +// String aEditText( aEdit.GetText() ); + + // Der Name muss nur im aktuellen Basic/Lib eindeutig sein + SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry(); + USHORT nDepth = pCurEntry ? aBasicBox.GetModel()->GetDepth( pCurEntry ) : 0; + + if ( nDepth == 2 ) + aEditButton.Enable(); + else + aEditButton.Disable(); + + SvLBoxEntry* pEntry = pCurEntry; + while ( pEntry && ( ((BasicEntry*)pEntry->GetUserData())->GetType() != OBJTYPE_LIB ) ) + pEntry = aBasicBox.GetParent( pEntry ); + +/* + if ( pEntry && aEditText.Len() ) + { + String aLibText = aBasicBox.GetEntryText( pEntry ); + if ( ( pEntry != pCurEntry ) || ( aLibText != aEditText ) ) + bEnableNew = TRUE; + pEntry = aBasicBox.FirstChild( pEntry ); + while ( pEntry ) + { + String aEntryText = aBasicBox.GetEntryText( pEntry ); + if ( aEntryText == aEditText ) + { + bEnableNew = FALSE; + break; + } + pEntry = aBasicBox.NextSibling( pEntry ); + } + } +*/ + if ( bEnableNew ) + { + aDelButton.Disable(); + } + else + { + if ( pCurEntry ) + { + BYTE nType = ((BasicEntry*)pCurEntry->GetUserData())->GetType(); + if ( ( nType == OBJTYPE_OBJECT ) || ( nType == OBJTYPE_MODULE ) ) + aDelButton.Enable(); + else + aDelButton.Disable(); + } + } +} + +IMPL_LINK( ObjectPage, BasicBoxHighlightHdl, BasicTreeListBox *, pBox ) +{ + if ( !pBox->IsSelected( pBox->GetHdlEntry() ) ) + return 0; + +/* + SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry(); + if ( pCurEntry ) + { + USHORT nDepth = aBasicBox.GetModel()->GetDepth( pCurEntry ); + if ( nDepth == 2 ) + aEdit.SetText( aBasicBox.GetEntryText( pCurEntry ) ); + else + aEdit.SetText( String() ); + } +*/ + CheckButtons(); + return 0; +} + + +/* +IMPL_LINK_INLINE_START( ObjectPage, EditModifyHdl, Edit *, pEdit ) +{ + CheckButtons(); + return 0; +} +IMPL_LINK_INLINE_END( ObjectPage, EditModifyHdl, Edit *, pEdit ) +*/ + +IMPL_LINK( ObjectPage, ButtonHdl, Button *, pButton ) +{ + if ( pButton == &aEditButton ) + { + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON ); + } + SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry(); + DBG_ASSERT( pCurEntry, "Entry?!" ); + if ( aBasicBox.GetModel()->GetDepth( pCurEntry ) == 2 ) + { + SbxVariable* pSbx = aBasicBox.FindVariable(pCurEntry ); + DBG_ASSERT( pSbx && pSbx->ISA( SbxObject ), "Object?!" ); + SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, pSbx ); + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_SHOWSBX, SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L ); + } + } + else // Nur Lib selektiert + { + DBG_ASSERT( aBasicBox.GetModel()->GetDepth( pCurEntry ) == 1, "Kein LibEntry?!" ); + String aLib( aBasicBox.GetEntryText( pCurEntry ) ); + String aBasMgr( aBasicBox.GetEntryText( aBasicBox.GetParent( pCurEntry ) ) ); + String aLibAndMgr( CreateMgrAndLibStr( aBasMgr, aLib ) ); + SfxStringItem aLibName( SID_BASICIDE_ARG_LIBNAME, aLibAndMgr ); + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_LIBSELECTED, SFX_CALLMODE_ASYNCHRON, &aLibName, 0L ); + } + } + EndTabDialog( 1 ); + } + else if ( pButton == &aNewModButton ) + NewModule(); + else if ( pButton == &aNewDlgButton ) + NewDialog(); + else if ( pButton == &aDelButton ) + DeleteCurrent(); + else if ( pButton == &aCloseButton ) + EndTabDialog( 0 ); + + return 0; +} + + + +StarBASIC* ObjectPage::GetSelectedBasic() +{ + String aLib, aModOrDlg, aSub; + BasicManager* pBasMgr = aBasicBox.GetSelectedSbx( aLib, aModOrDlg, aSub ); + DBG_ASSERT( pBasMgr, "Kein BasicManager!" ); + StarBASIC* pLib = aLib.Len() ? pBasMgr->GetLib( aLib ) : pBasMgr->GetLib( 0 ); + if ( !pLib && aLib.Len() ) + { + USHORT nLib = pBasMgr->GetLibId( aLib ); + BOOL bOK = TRUE; + if ( pBasMgr->HasPassword( nLib ) && + !pBasMgr->IsPasswordVerified( nLib ) ) + { + bOK = QueryPassword( pBasMgr, nLib ); + } + if ( bOK ) + { + pBasMgr->LoadLib( nLib ); + pLib = pBasMgr->GetLib( nLib ); + if ( !pLib ) + ErrorBox( this, WB_OK|WB_DEF_OK, String( IDEResId( RID_STR_ERROROPENLIB ) ) ).Execute(); + } + } + return pLib; +} + +/* +BOOL ObjectPage::UseEditText() +{ + SvLBoxEntry* pSel = aBasicBox.FirstSelected(); + if ( pSel ) + { + String aSelected( aBasicBox.GetEntryText( pSel ) ); + if ( aSelected == aEdit.GetText() ) + return FALSE; + } + return TRUE; +} +*/ + +void ObjectPage::NewModule() +{ + StarBASIC* pLib = GetSelectedBasic(); + DBG_ASSERT( pLib, "Keine Lib!" ); + if ( pLib ) + { + NewObjectDialog* pNewDlg = new NewObjectDialog( this, NEWOBJECTMODE_MOD ); + pNewDlg->SetObjectName( BasicIDE::CreateModuleName( pLib, String() ) ); + if ( pNewDlg->Execute() ) + { + String aModName( pNewDlg->GetObjectName() ); + if ( !BasicIDE::FindModule( pLib, aModName ) ) + { + SbModule* pModule = BasicIDE::CreateModule( pLib, aModName, TRUE ); + DBG_ASSERT( pModule , "Modul wurde nicht erzeugt!" ); + SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, pModule ); + + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_SBXINSERTED, + SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L ); + } + SvLBoxEntry* pLibEntry = aBasicBox.FindLibEntry( pLib ); + DBG_ASSERT( pLibEntry, "Libeintrag nicht gefunden!" ); + USHORT nImgId = IMGID_MODULE; + SvLBoxEntry* pEntry = aBasicBox.InsertEntry( pModule->GetName(), aBasicBox.GetImage( nImgId ), aBasicBox.GetImage( nImgId ), pLibEntry, FALSE, LIST_APPEND ); + DBG_ASSERT( pEntry, "InsertEntry fehlgeschlagen!" ); + pEntry->SetUserData( new BasicEntry( OBJTYPE_MODULE ) ); + aBasicBox.SetCurEntry( pEntry ); + aBasicBox.Select( aBasicBox.GetCurEntry() ); // OV-Bug?! + } + else + { + ErrorBox( this, WB_OK | WB_DEF_OK, + String( IDEResId( RID_STR_SBXNAMEALLREADYUSED2 ) ) ).Execute(); + } + } + delete pNewDlg; + } +} + +void ObjectPage::NewDialog() +{ + StarBASIC* pLib = GetSelectedBasic(); + DBG_ASSERT( pLib, "Keine Lib!" ); + if ( pLib ) + { + NewObjectDialog* pNewDlg = new NewObjectDialog( this, NEWOBJECTMODE_DLG ); + pNewDlg->SetObjectName( BasicIDE::CreateDialogName( pLib, String() ) ); + if ( pNewDlg->Execute() ) + { + String aDlgName( pNewDlg->GetObjectName() ); + if ( !BasicIDE::FindDialog( pLib, aDlgName ) ) + { + SbxObject* pDialog = BasicIDE::CreateDialog( pLib, aDlgName ); + DBG_ASSERT( pDialog, "Dialog wurde nicht erzeugt!" ); + SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, pDialog ); + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_SBXINSERTED, + SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L ); + } + SvLBoxEntry* pLibEntry = aBasicBox.FindLibEntry( pLib ); + DBG_ASSERT( pLibEntry, "Libeintrag nicht gefunden!" ); + SvLBoxEntry* pEntry = aBasicBox.InsertEntry( pDialog->GetName(), aBasicBox.GetImage( IMGID_OBJECT ), aBasicBox.GetImage( IMGID_OBJECT ), pLibEntry, FALSE, LIST_APPEND ); + DBG_ASSERT( pEntry, "InsertEntry fehlgeschlagen!" ); + pEntry->SetUserData( new BasicEntry( OBJTYPE_OBJECT ) ); + aBasicBox.SetCurEntry( pEntry ); + aBasicBox.Select( aBasicBox.GetCurEntry() ); // OV-Bug?! + } + else + { + ErrorBox( this, WB_OK | WB_DEF_OK, + String( IDEResId( RID_STR_SBXNAMEALLREADYUSED2 ) ) ).Execute(); + } + } + delete pNewDlg; + } +} + + + +void ObjectPage::DeleteCurrent() +{ + SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry(); + DBG_ASSERT( pCurEntry, "Kein aktueller Eintrag!" ); + + SbxVariableRef xVar = aBasicBox.FindVariable( pCurEntry ); + DBG_ASSERT( xVar.Is(), "Keine Variable?" ); + if ( ( xVar->ISA( SbModule ) && QueryDelModule( xVar->GetName(), this ) ) || + ( ( xVar->ISA( SbxObject ) && !xVar->ISA( SbModule ) && QueryDelDialog( xVar->GetName(), this ) ) ) ) + { + StarBASICRef xBasic = BasicIDE::FindBasic( xVar ); + DBG_ASSERT( xBasic.Is(), "Basic nicht gefunden!" ); + aBasicBox.GetModel()->Remove( pCurEntry ); + if ( aBasicBox.GetCurEntry() ) // OV-Bug ? + aBasicBox.Select( aBasicBox.GetCurEntry() ); + SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, xVar ); + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_SBXDELETED, + SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L ); + } + xBasic->Remove( xVar ); + BasicIDE::MarkDocShellModified( xBasic ); + } +} + + + +void ObjectPage::EndTabDialog( USHORT nRet ) +{ + DBG_ASSERT( pTabDlg, "TabDlg nicht gesetzt!" ); + if ( pTabDlg ) + pTabDlg->EndDialog( nRet ); +} + + +LibDialog::LibDialog( Window* pParent ) + : ModalDialog( pParent, IDEResId( RID_DLG_LIBS ) ), + aOKButton( this, IDEResId( RID_PB_OK ) ), + aCancelButton( this, IDEResId( RID_PB_CANCEL ) ), + aStorageName( this, IDEResId( RID_FT_STORAGENAME ) ), + aLibBox( this, IDEResId( RID_CTRL_LIBS ) ), + aGroupBox( this, IDEResId( RID_GB_OPTIONS ) ), + aReferenceBox( this, IDEResId( RID_CB_REF ) ), + aSepFileBox( this, IDEResId( RID_CB_SEP ) ), + aReplaceBox( this, IDEResId( RID_CB_REPL ) ) +{ + SetText( String( IDEResId( RID_STR_APPENDLIBS ) ) ); + FreeResource(); + + aReferenceBox.SetClickHdl( LINK( this, LibDialog, CheckBoxSelectHdl ) ); + aSepFileBox.SetClickHdl( LINK( this, LibDialog, CheckBoxSelectHdl ) ); + + bSepFileEnabled = FALSE; + aSepFileBox.Enable( FALSE ); +} + + +LibDialog::~LibDialog() +{ +} + +void LibDialog::SetStorageName( const String& rName ) +{ + String aName( IDEResId( RID_STR_FILENAME ) ); + aName += rName; + aStorageName.SetText( aName ); +} + +IMPL_LINK( LibDialog, CheckBoxSelectHdl, CheckBox*, EMPTYARG ) +{ + // Referenz und separate Datei schliessen sich aus... + if ( aReferenceBox.IsChecked() ) + aSepFileBox.Enable( FALSE ); + else if ( bSepFileEnabled ) + aSepFileBox.Enable( TRUE ); + + if ( aSepFileBox.IsChecked() ) + aReferenceBox.Enable( FALSE ); + else + aReferenceBox.Enable( TRUE ); + + return 1; +} + diff --git a/basctl/source/basicide/moduldlg.hrc b/basctl/source/basicide/moduldlg.hrc new file mode 100644 index 000000000..93099fe52 --- /dev/null +++ b/basctl/source/basicide/moduldlg.hrc @@ -0,0 +1,106 @@ +/************************************************************************* + * + * $RCSfile: moduldlg.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _MODULDLG_HRC +#define _MODULDLG_HRC + +#include <svtools/solar.hrc> + +#define RID_STR_LIB 1 +#define RID_TRLBOX 2 +#define RID_EDIT 3 +#define RID_PB_EDIT 4 +#define RID_PB_CLOSE 5 +#define RID_PB_NEWMOD 6 +#define RID_PB_NEWDLG 7 +#define RID_PB_DELETE 8 +#define RID_PB_NEWLIB 9 +#define RID_PB_APPEND 10 +#define RID_PB_PASSWORD 11 +#define RID_LB_BASICS 12 + +#define RID_TP_MOD 20 +#define RID_TP_LIB 21 + +#define RID_TC_ORGANIZE 30 + +#define RID_PB_OK 31 +#define RID_PB_CANCEL 32 +#define RID_CTRL_LIBS 33 +#define RID_GB_OPTIONS 34 +#define RID_CB_REF 35 +#define RID_CB_REPL 36 +#define RID_CB_SEP 37 +#define RID_FT_STORAGENAME 38 + +#define RID_FT_NEWLIB 40 +#define RID_ED_LIBNAME 41 +#define RID_CHKB_EXTRAFILE 42 + + +// Bitmaps fuer CheckBox +#define CHKBTN_UNCHECKED 1 +#define CHKBTN_CHECKED 2 +#define CHKBTN_HICHECKED 3 +#define CHKBTN_HIUNCHECKED 4 +#define CHKBTN_TRISTATE 5 +#define CHKBTN_HITRISTATE 6 + +#endif // _MODULDLG_HRC diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx new file mode 100644 index 000000000..7463cb6b2 --- /dev/null +++ b/basctl/source/basicide/moduldlg.hxx @@ -0,0 +1,348 @@ +/************************************************************************* + * + * $RCSfile: moduldlg.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _MODULDLG_HXX +#define _MODULDLG_HXX + +#ifndef _SVHEADER_HXX +#include <svheader.hxx> +#endif + +#include <bastype2.hxx> + +#ifndef _SV_DIALOG_HXX //autogen +#include <vcl/dialog.hxx> +#endif + +#ifndef _SV_BUTTON_HXX //autogen +#include <vcl/button.hxx> +#endif + +#ifndef _SV_FIXED_HXX //autogen +#include <vcl/fixed.hxx> +#endif + +#ifndef _SVTABBX_HXX //autogen +#include <svtools/svtabbx.hxx> +#endif + +#ifndef _SV_GROUP_HXX //autogen +#include <vcl/group.hxx> +#endif + +#ifndef _SV_TABDLG_HXX //autogen +#include <vcl/tabdlg.hxx> +#endif + +#ifndef _SV_TABPAGE_HXX //autogen +#include <vcl/tabpage.hxx> +#endif + + +#include <vcl/tabctrl.hxx> +#include <vcl/lstbox.hxx> + +class StarBASIC; + + +#define NEWOBJECTMODE_LIB 1 +#define NEWOBJECTMODE_MOD 2 +#define NEWOBJECTMODE_DLG 3 + +class NewObjectDialog : public ModalDialog +{ +private: + FixedText aText; + Edit aEdit; + OKButton aOKButton; + CancelButton aCancelButton; + + // NEWOBJECTMODE_LIB + CheckBox aCheckBox; + +public: + + NewObjectDialog( Window* pParent, USHORT nMode ); + ~NewObjectDialog(); + + String GetObjectName() const { return aEdit.GetText(); } + void SetObjectName( const String& rName ) { aEdit.SetText( rName ); aEdit.SetSelection( Selection( 0, rName.Len() ) );} + + BOOL IsSeparateFile() const { return aCheckBox.IsChecked(); } + void EnableSeparateFile( BOOL bEnable ) { aCheckBox.Enable( bEnable ); } +}; + + +class ExtBasicTreeListBox : public BasicTreeListBox +{ +protected: + virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& rSel ); + virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ); + + virtual DragDropMode NotifyBeginDrag( SvLBoxEntry* ); + virtual BOOL NotifyQueryDrop( SvLBoxEntry* ); + + virtual BOOL NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ); + virtual BOOL NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ); + BOOL NotifyCopyingMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos, BOOL bMove ); + +public: + ExtBasicTreeListBox( Window* pParent, const ResId& rRes ); + ~ExtBasicTreeListBox(); + +}; + +#define LIBMODE_CHOOSER 1 +#define LIBMODE_MANAGER 2 + +class BasicCheckBox : public SvTabListBox +{ +private: + USHORT nMode; + SvLBoxButtonData* pCheckButton; + BasicManager* pBasMgr; + void Init(); + +protected: + virtual void CheckButtonHdl(); + +public: + BasicCheckBox( Window* pParent, const ResId& rResId ); + ~BasicCheckBox(); + + SvLBoxEntry* InsertEntry( const String& rStr, ULONG nPos = LISTBOX_APPEND ); + void RemoveEntry( ULONG nPos ); + SvLBoxEntry* FindEntry( const String& rName ); + + void SelectEntryPos( ULONG nPos, BOOL bSelect = TRUE ); + ULONG GetSelectEntryPos() const; + + ULONG GetCheckedEntryCount() const; + void CheckEntryPos( ULONG nPos, BOOL bCheck = TRUE ); + BOOL IsChecked( ULONG nPos ) const; + + virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& rSel ); + virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ); + + void SetBasicManager( BasicManager* pMgr ) { pBasMgr = pMgr; } + BasicManager* GetBasicManager() const { return pBasMgr; } + + void SetMode( USHORT n ) { nMode = n; } + USHORT GetMode() const { return nMode; } + +}; + +class BasicCheckBoxBitmaps : public Resource +{ +private: + const Bitmap aUncheckedBmp; + const Bitmap aCheckedBmp; + const Bitmap aHiCheckedBmp; + const Bitmap aHiUncheckedBmp; + const Bitmap aTriStateBmp; + const Bitmap aHiTriStateBmp; + +public: + BasicCheckBoxBitmaps(); + + const Bitmap& GetUncheckedBmp () const { return aUncheckedBmp; } + const Bitmap& GetCheckedBmp () const { return aCheckedBmp; } + const Bitmap& GetHiCheckedBmp () const { return aHiCheckedBmp; } + const Bitmap& GetHiUncheckedBmp () const { return aHiUncheckedBmp; } + const Bitmap& GetTriStateBmp () const { return aTriStateBmp; } + const Bitmap& GetHiTriStateBmp () const { return aHiTriStateBmp; } +}; + + +class LibDialog: public ModalDialog +{ +private: + OKButton aOKButton; + CancelButton aCancelButton; + FixedText aStorageName; + + BasicCheckBox aLibBox; + + GroupBox aGroupBox; + CheckBox aReferenceBox; + CheckBox aSepFileBox; + CheckBox aReplaceBox; + + BOOL bSepFileEnabled; + +protected: + DECL_LINK( CheckBoxSelectHdl, CheckBox* ); + + +public: + LibDialog( Window* pParent ); + ~LibDialog(); + + void SetStorageName( const String& rName ); + + BasicCheckBox& GetLibBox() { return aLibBox; } + BOOL IsReference() const { return aReferenceBox.IsChecked(); } + BOOL IsReplace() const { return aReplaceBox.IsChecked(); } + BOOL IsSeparateFile() const { return aSepFileBox.IsChecked(); } + + void SetSeparateFileEnabled( BOOL b ) { bSepFileEnabled = b; + aSepFileBox.Enable( b ); } + BOOL IsSeparateFileEnabled() const { return bSepFileEnabled; } +}; + + +class OrganizeDialog : public TabDialog +{ +private: + TabControl aTabCtrl; + +public: + OrganizeDialog( Window* pParent ); + ~OrganizeDialog(); + + void SetCurrentModule( const String& rMacroDescr ); + virtual short Execute(); + + DECL_LINK( ActivatePageHdl, TabControl * ); +}; + +class ObjectPage: public TabPage +{ +protected: + PushButton aEditButton; + CancelButton aCloseButton; + PushButton aNewModButton; + PushButton aNewDlgButton; + PushButton aDelButton; + FixedText aLibText; +// Edit aEdit; + ExtBasicTreeListBox aBasicBox; + + String aCurEntryDescr; + + DECL_LINK( BasicBoxHighlightHdl, BasicTreeListBox * ); +// DECL_LINK( EditModifyHdl, Edit * ); + DECL_LINK( ButtonHdl, Button * ); + void CheckButtons(); + StarBASIC* GetSelectedBasic(); + void DeleteCurrent(); + void NewModule(); + void NewDialog(); + void EndTabDialog( USHORT nRet ); + + TabDialog* pTabDlg; + + void ImplMarkCurrentModule(); + +// BOOL UseEditText(); + virtual void ActivatePage(); + virtual void DeactivatePage(); + +public: + ObjectPage( Window* pParent ); + + void SetCurrentModule( const String& rMacroDescr ) { aCurEntryDescr = rMacroDescr; ImplMarkCurrentModule(); } + void SetTabDlg( TabDialog* p ) { pTabDlg = p;} +}; + +class LibPage: public TabPage +{ +protected: + PushButton aEditButton; + CancelButton aCloseButton; + PushButton aNewLibButton; + PushButton aPasswordButton; + PushButton aInsertLibButton; + PushButton aDelButton; + FixedText aLibText; + ListBox aBasicsBox; + BasicCheckBox aLibBox; + + String aCurBasMgr; + + DECL_LINK( TreeListHighlightHdl, SvTreeListBox * ); + DECL_LINK( BasicSelectHdl, ListBox * ); + DECL_LINK( CheckBoxHdl, SvTreeListBox * ); + DECL_LINK( ButtonHdl, Button * ); + void CheckButtons(); + void DeleteCurrent(); + void NewLib(); + void InsertLib(); + void EndTabDialog( USHORT nRet ); + void FillListBox(); + void SetCurLib(); + SvLBoxEntry* ImpInsertLibEntry( USHORT nLib ); + void ActivateCurrentLibSettings(); + virtual void ActivatePage(); + virtual void DeactivatePage(); + + TabDialog* pTabDlg; + +public: + LibPage( Window* pParent ); + + void SetTabDlg( TabDialog* p ) { pTabDlg = p;} +}; + +#endif // _MODULDLG_HXX diff --git a/basctl/source/basicide/moduldlg.src b/basctl/source/basicide/moduldlg.src new file mode 100644 index 000000000..3a298e606 --- /dev/null +++ b/basctl/source/basicide/moduldlg.src @@ -0,0 +1,839 @@ +/************************************************************************* + * + * $RCSfile: moduldlg.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include "helpid.hrc" +#include <moduldlg.hrc> +#include <basidesh.hrc> +TabDialog RID_TD_ORGANIZE +{ + OutputSize = TRUE ; + SVLook = TRUE ; + /* ### ACHTUNG: Neuer Text in Resource? Makros verwalten : Verwalten */ + /* ### ACHTUNG: Neuer Text in Resource? Makros verwalten : Verwalten */ + Text = "Makros verwalten" ; + Text [ ENGLISH ] = "Manage macros" ; + Moveable = TRUE ; + TEXT[ italian ] = "Gestione macro"; + TEXT[ portuguese_brazilian ] = "Gerenciar"; + TEXT[ portuguese ] = "Gerir macros"; + TEXT[ danish ] = "Makroadministration"; + TEXT[ french ] = "Gestion de macros"; + TEXT[ swedish ] = "Frvalta makron"; + TEXT[ dutch ] = "Macro's beheren"; + TEXT[ spanish ] = "Administrar"; + TEXT[ english_us ] = "Macro Organizer"; + TEXT[ chinese_simplified ] = ""; + TEXT[ russian ] = " "; + TEXT[ polish ] = "Zarzdzaj makrami"; + TEXT[ japanese ] = "ϸۂ̊Ǘ"; + TEXT[ chinese_traditional ] = "z"; + TEXT[ arabic ] = " "; + Closeable = TRUE ; + // Da Cancel-Button auf TabPage, nicht auf Dialog! + TabControl RID_TC_ORGANIZE + { + // HelpID = HID_BASICIDE_ORG_TC; + OutputSize = TRUE ; + PageList = + { + PageItem + { + Identifier = RID_TP_MOD ; + Text = "Module" ; + Text [ ENGLISH ] = "Modules" ; + Text [ norwegian ] = "Moduler" ; + Text [ italian ] = "Moduli" ; + Text [ portuguese_brazilian ] = "Mdulos" ; + Text [ portuguese ] = "Mdulos" ; + Text [ finnish ] = "Moduulit" ; + Text [ danish ] = "Moduler" ; + Text [ french ] = "Modules" ; + Text [ swedish ] = "Moduler" ; + Text [ dutch ] = "Modules" ; + Text [ spanish ] = "Mdulos" ; + Text [ ENGLISH_US ] = "Modules" ; + Text[ chinese_simplified ] = "ģ"; + Text[ russian ] = ""; + Text[ polish ] = "Moduy"; + Text[ japanese ] = "Ӽޭ"; + Text[ chinese_traditional ] = "Ҷ"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = ""; + Text[ turkish ] = "Modller"; + }; + PageItem + { + Identifier = RID_TP_LIB ; + Text = "Bibliotheken" ; + Text [ ENGLISH ] = "Libaries" ; + Text [ english_us ] = "Libraries" ; + Text [ italian ] = "Biblioteche" ; + Text [ spanish ] = "Bibliotecas" ; + Text [ french ] = "Bibliothques" ; + Text [ dutch ] = "Bibliotheken" ; + Text [ swedish ] = "Bibliotek" ; + Text [ danish ] = "Biblioteker" ; + Text [ portuguese ] = "Bibliotecas" ; + Text [ portuguese_brazilian ] = "Bibliotheken" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Biblioteki"; + Text[ japanese ] = "ײ"; + Text[ chinese_traditional ] = "{w"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "̺귯"; + Text[ turkish ] = "Kitaplklar"; + }; + }; + }; + Text [ portuguese ] = "Gerir macros" ; + Text [ english_us ] = "Macro Organizer" ; + Text [ portuguese_brazilian ] = "Gerenciar" ; + Text [ swedish ] = "Frvalta makron" ; + Text [ danish ] = "Makroadministration" ; + Text [ italian ] = "Gestione macro" ; + Text [ spanish ] = "Administrar" ; + Text [ french ] = "Gestion de macros" ; + Text [ dutch ] = "Macro's beheren" ; + Text[ greek ] = " "; + Text[ korean ] = "ũ "; + Text[ turkish ] = "Makrolar ynet"; +}; +TabPage RID_TP_MODULS +{ + // HelpId = HID_BASICIDE_MODULS ; + Hide = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 200 , 140 ) ; + FixedText RID_STR_LIB + { + Pos = MAP_APPFONT ( 6 , 6 ) ; + Size = MAP_APPFONT ( 130 , 10 ) ; + Text = "M~odul/Dialog" ; + Text [ ENGLISH ] = "M~odule/Dialog" ; + Text [ norwegian ] = "M~odule/Dialog" ; + Text [ italian ] = "M~odulo/Dialogo" ; + Text [ portuguese_brazilian ] = "M~dulo/Di logo" ; + Text [ portuguese ] = "M~dulo/Dilogo" ; + Text [ finnish ] = "M~oduuli-valintaikkuna" ; + Text [ danish ] = "Modul/Dialog" ; + Text [ french ] = "M~odule/bote de dialogue" ; + Text [ swedish ] = "M~odul/dialog" ; + Text [ dutch ] = "M~odule/dialoogvenster" ; + Text [ spanish ] = "Md~ulo/Dilogo" ; + Text [ english_us ] = "M~odule/Dialog" ; + Text[ chinese_simplified ] = "ģ/Ի(~O)"; + Text[ russian ] = "/"; + Text[ polish ] = "Modu/Dialog"; + Text[ japanese ] = "Ӽޭ/۸(~O)"; + Text[ chinese_traditional ] = "Ҷ/ܤ(~O)"; + Text[ arabic ] = " / "; + Text[ greek ] = " /"; + Text[ korean ] = "/ȭ (~O)"; + Text[ turkish ] = "Modl/diyalog"; + }; + /* + Edit RID_EDIT + { + Pos = MAP_APPFONT ( 6 , 17 ) ; + Size = MAP_APPFONT ( 130 , 12 ) ; + TabStop = TRUE ; + Border = TRUE ; + }; +*/ + Control RID_TRLBOX + { + HelpId = HID_BASICIDE_MODULES_TREE ; + Pos = MAP_APPFONT ( 6 , 17 ) ; + Size = MAP_APPFONT ( 130 , 117 ) ; + TabStop = TRUE ; + Border = TRUE ; + }; + PushButton RID_PB_EDIT + { + Text= "~Bearbeiten"; + Text[ italian ] = "Modi~fica"; + Text[ portuguese_brazilian ] = "~Editar"; + Text[ portuguese ] = "~Editar"; + Text[ danish ] = "~Rediger"; + Text[ french ] = "di~ter"; + Text[ swedish ] = "~Redigera"; + Text[ dutch ] = "~Bewerken"; + Text[ spanish ] = "~Editar"; + Text[ english_us ] = "~Edit"; + Text[ chinese_simplified ] = "༭(~E)"; + Pos = MAP_APPFONT ( 144 , 6 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + Text[ chinese_traditional ] = "s(~E)"; + Text = "~Bearbeiten" ; + Text [ ENGLISH ] = "~Edit" ; + Text [ norwegian ] = "~Rediger" ; + Text [ italian ] = "Modi~fica" ; + Text [ portuguese_brazilian ] = "~Editar" ; + Text [ portuguese ] = "~Editar" ; + Text [ finnish ] = "Muo~kkaa" ; + Text [ danish ] = "~Rediger" ; + Text [ french ] = "di~ter" ; + Text [ swedish ] = "~Redigera" ; + Text [ dutch ] = "~Bewerken" ; + Text [ spanish ] = "~Editar" ; + Text [ english_us ] = "~Edit" ; + TabStop = TRUE ; + DefButton = TRUE ; + Text[ arabic ] = ""; + Text[ russian ] = "~"; + Text[ greek ] = "~"; + Text[ polish ] = "~Edytuj"; + Text[ japanese ] = "ҏW(~E)"; + Text[ korean ] = "(~E)"; + Text[ turkish ] = "Dzenle"; + }; + CancelButton RID_PB_CLOSE + { + Text= "Schlieen"; + Text[ italian ] = "Chiudi"; + Text[ portuguese_brazilian ] = "Fechar"; + Text[ portuguese ] = "Fechar"; + Text[ danish ] = "Luk"; + Text[ french ] = "Fermer"; + Text[ swedish ] = "Stng"; + Text[ dutch ] = "Sluiten"; + Text[ spanish ] = "Cerrar"; + Text[ english_us ] = "Close"; + Text[ chinese_simplified ] = "ر"; + Pos = MAP_APPFONT ( 144 , 23 ) ; + Text[ chinese_traditional ] = ""; + Size = MAP_APPFONT ( 50 , 14 ) ; + /* ### ACHTUNG: Neuer Text in Resource? Schlieen : Schlieen */ + Text = "Schlieen" ; + Text [ ENGLISH ] = "Close" ; + Text [ norwegian ] = "Lukk" ; + Text [ italian ] = "Chiudi" ; + Text [ portuguese_brazilian ] = "Fechar" ; + Text [ portuguese ] = "Fechar" ; + Text [ finnish ] = "Sulje" ; + Text [ danish ] = "Luk" ; + Text [ french ] = "Fermer" ; + Text [ swedish ] = "Stng" ; + Text [ dutch ] = "Sluiten" ; + Text [ spanish ] = "Cerrar" ; + Text [ english_us ] = "Close" ; + TabStop = TRUE ; + Text[ arabic ] = ""; + Text[ russian ] = ""; + Text[ greek ] = ""; + Text[ polish ] = "Zamknij"; + Text[ japanese ] = ""; + Text[ korean ] = "ݱ"; + Text[ turkish ] = "Kapat"; + }; + PushButton RID_PB_NEWMOD + { + Pos = MAP_APPFONT ( 144 , 86 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + Text = "Neues ~Modul..." ; + Text [ ENGLISH ] = "New ~module..." ; + Text [ norwegian ] = "New ~module..." ; + Text [ italian ] = "Nuovo ~modulo" ; + Text [ portuguese_brazilian ] = "~Mdulo novo" ; + Text [ portuguese ] = "~Novo mdulo" ; + Text [ finnish ] = "~Uusi..." ; + Text [ danish ] = "Nyt modul..." ; + Text [ french ] = "Nouveau ~module" ; + Text [ swedish ] = "Ny ~modul..." ; + Text [ dutch ] = "Nieuwe ~module..." ; + Text [ spanish ] = "Nuevo ~mdulo..." ; + Text [ english_us ] = "New ~Module..." ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "½ģ(~M)..."; + Text[ russian ] = " ..."; + Text[ polish ] = "Nowy modu..."; + Text[ japanese ] = "VӼޭ (~M)..."; + Text[ chinese_traditional ] = "sؼҶ(~M)..."; + Text[ arabic ] = " ..."; + Text[ greek ] = " . ~..."; + Text[ korean ] = " (~M)..."; + Text[ turkish ] = "Yeni modl..."; + }; + PushButton RID_PB_NEWDLG + { + Pos = MAP_APPFONT ( 144 , 103 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + Text = "Neuer Dialo~g..." ; + Text [ ENGLISH ] = "New dialo~g..." ; + Text [ norwegian ] = "New dialo~g..." ; + Text [ italian ] = "Nuovo dialo~go" ; + Text [ portuguese_brazilian ] = "Di lo~go novo" ; + Text [ portuguese ] = "Novo dilo~go..." ; + Text [ finnish ] = "Uusi-~valintaikkuna..." ; + Text [ danish ] = "Ny dialog..." ; + Text [ french ] = "Nouvelle ~bote" ; + Text [ swedish ] = "Ny dialo~g..." ; + Text [ dutch ] = "Nieuwe ~dialoog..." ; + Text [ spanish ] = "Nuevo dilo~go..." ; + Text [ english_us ] = "~New Dialog..." ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "½Ի(~N)..."; + Text[ russian ] = " ..."; + Text[ polish ] = "Nowy dialog..."; + Text[ japanese ] = "V۸(~N)..."; + Text[ chinese_traditional ] = "sع(~N)..."; + Text[ arabic ] = " ..."; + Text[ greek ] = " ..."; + Text[ korean ] = " ȭ(~N)..."; + Text[ turkish ] = "Yeni diyalog..."; + }; + PushButton RID_PB_DELETE + { + Pos = MAP_APPFONT ( 144 , 120 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + /* ### ACHTUNG: Neuer Text in Resource? ~Lschen... : ~Lschen... */ + Text = "~Lschen..." ; + Text [ ENGLISH ] = "~Delete..." ; + Text [ norwegian ] = "~Slett..." ; + Text [ italian ] = "~Elimina..." ; + Text [ portuguese_brazilian ] = "~Apagar..." ; + Text [ portuguese ] = "E~liminar..." ; + Text [ finnish ] = "~Poista..." ; + Text [ danish ] = "Slet..." ; + Text [ french ] = "~Supprimer..." ; + Text [ swedish ] = "R~adera..." ; + Text [ dutch ] = "~Wissen..." ; + Text [ spanish ] = "E~liminar..." ; + Text [ english_us ] = "~Delete..." ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "ɾ(~D)"; + Text[ russian ] = "..."; + Text[ polish ] = "Usu..."; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = "R(~D)"; + Text[ arabic ] = "..."; + Text[ greek ] = "..."; + Text[ korean ] = "(~D)..."; + Text[ turkish ] = "Sil..."; + }; +}; +TabPage RID_TP_LIBS +{ + // HelpId = HID_BASICIDE_LIBS_TP ; + Hide = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 200 , 140 ) ; + FixedText RID_STR_LIB + { + Pos = MAP_APPFONT ( 6 , 6 ) ; + Size = MAP_APPFONT ( 130 , 10 ) ; + Text = "Bibliothe~k" ; + Text [ ENGLISH ] = "Libar~y" ; + Text [ dutch ] = "Bibliothee~k" ; + Text [ english_us ] = "~Library" ; + Text [ italian ] = "Library" ; + Text [ spanish ] = "~Biblioteca" ; + Text [ french ] = "Biblioth~que" ; + Text [ swedish ] = "Bibliote~k" ; + Text [ danish ] = "Bibliotek" ; + Text [ portuguese ] = "Bibliote~ca" ; + Text [ portuguese_brazilian ] = "Bibliothe~k" ; + Text[ chinese_simplified ] = "(~L)"; + Text[ russian ] = ""; + Text[ polish ] = "Biblioteka"; + Text[ japanese ] = "ײ(~L)"; + Text[ chinese_traditional ] = "{w(~L)"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "̺귯(~L)"; + Text[ turkish ] = "Kitaplk"; + }; + Control RID_TRLBOX + { + HelpID = HID_BASICIDE_LIBS_TREE ; + Border = TRUE ; + Pos = MAP_APPFONT ( 6 , 35 ) ; + Size = MAP_APPFONT ( 130 , 99 ) ; + TabStop = TRUE ; + }; + PushButton RID_PB_EDIT + { + Text= "~Bearbeiten"; + Text[ italian ] = "Modi~fica"; + Text[ portuguese_brazilian ] = "~Editar"; + Text[ portuguese ] = "~Editar"; + Text[ danish ] = "~Rediger"; + Text[ french ] = "di~ter"; + Text[ swedish ] = "~Redigera"; + Text[ dutch ] = "~Bewerken"; + Text[ spanish ] = "~Editar"; + Text[ english_us ] = "~Edit"; + Text[ chinese_simplified ] = "༭(~E)"; + Pos = MAP_APPFONT ( 144 , 6 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + Text[ chinese_traditional ] = "s(~E)"; + Text = "~Bearbeiten" ; + Text [ ENGLISH ] = "~Edit" ; + Text [ norwegian ] = "~Rediger" ; + Text [ italian ] = "Modi~fica" ; + Text [ portuguese_brazilian ] = "~Editar" ; + Text [ portuguese ] = "~Editar" ; + Text [ finnish ] = "Muo~kkaa" ; + Text [ danish ] = "~Rediger" ; + Text [ french ] = "di~ter" ; + Text [ swedish ] = "~Redigera" ; + Text [ dutch ] = "~Bewerken" ; + Text [ spanish ] = "~Editar" ; + Text [ english_us ] = "~Edit" ; + TabStop = TRUE ; + DefButton = TRUE ; + Text[ arabic ] = ""; + Text[ russian ] = "~"; + Text[ greek ] = "~"; + Text[ polish ] = "~Edytuj"; + Text[ japanese ] = "ҏW(~E)"; + Text[ korean ] = "(~E)"; + Text[ turkish ] = "Dzenle"; + }; + CancelButton RID_PB_CLOSE + { + Text= "Schlieen"; + Text[ italian ] = "Chiudi"; + Text[ portuguese_brazilian ] = "Fechar"; + Text[ portuguese ] = "Fechar"; + Text[ danish ] = "Luk"; + Text[ french ] = "Fermer"; + Text[ swedish ] = "Stng"; + Text[ dutch ] = "Sluiten"; + Text[ spanish ] = "Cerrar"; + Text[ english_us ] = "Close"; + Text[ chinese_simplified ] = "ر"; + Pos = MAP_APPFONT ( 144 , 23 ) ; + Text[ chinese_traditional ] = ""; + Size = MAP_APPFONT ( 50 , 14 ) ; + /* ### ACHTUNG: Neuer Text in Resource? Schlieen : Schlieen */ + Text = "Schlieen" ; + Text [ ENGLISH ] = "Close" ; + Text [ norwegian ] = "Lukk" ; + Text [ italian ] = "Chiudi" ; + Text [ portuguese_brazilian ] = "Fechar" ; + Text [ portuguese ] = "Fechar" ; + Text [ DANISH ] = "Luk" ; + Text [ ENGLISH_US ] = "Close" ; + Text [ SPANISH ] = "Cerrar" ; + Text [ FINNISH ] = "Sulje" ; + Text [ FRENCH ] = "Fermer" ; + Text [ DUTCH ] = "Sluiten" ; + Text [ SWEDISH ] = "Stng" ; + TabStop = TRUE ; + Text[ arabic ] = ""; + Text[ russian ] = ""; + Text[ greek ] = ""; + Text[ polish ] = "Zamknij"; + Text[ japanese ] = ""; + Text[ korean ] = "ݱ"; + Text[ turkish ] = "Kapat"; + }; + PushButton RID_PB_PASSWORD + { + Pos = MAP_APPFONT ( 144 , 43 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + /* ### ACHTUNG: Neuer Text in Resource? ~Pawort... : ~Pawort... */ + Text = "~Passwort..." ; + Text [ ENGLISH ] = "~Password..." ; + Text [ norwegian ] = "~Passord..." ; + Text [ italian ] = "~Password..." ; + Text [ portuguese_brazilian ] = "~Senha..." ; + Text [ portuguese ] = "~Senha..." ; + Text [ finnish ] = "~Salasana..." ; + Text [ danish ] = "Adgangskode..." ; + Text [ french ] = "Mot de ~passe..." ; + Text [ swedish ] = "~Lsenord..." ; + Text [ dutch ] = "W~achtwoord..." ; + Text [ spanish ] = "~Contrasea..." ; + Text [ english_us ] = "~Password..." ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "(~P)"; + Text[ russian ] = "..."; + Text[ polish ] = "Haso..."; + Text[ japanese ] = "߽ܰ(~P)"; + Text[ chinese_traditional ] = "KX(~P)..."; + Text[ arabic ] = " ..."; + Text[ greek ] = " ~."; + Text[ korean ] = "н(~P)..."; + Text[ turkish ] = "ifre..."; + }; + PushButton RID_PB_NEWLIB + { + Pos = MAP_APPFONT ( 144 , 86 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + Text = "~Neu..." ; + Text [ ENGLISH ] = "~New..." ; + Text [ norwegian ] = "~Ny..." ; + Text [ italian ] = "~Nuovo..." ; + Text [ portuguese_brazilian ] = "~Novo" ; + Text [ portuguese ] = "~Novo" ; + Text [ french ] = "Nou~veau" ; + Text [ dutch ] = "~Nieuw..." ; + Text [ spanish ] = "~Nuevo..." ; + Text [ danish ] = "Ny..." ; + Text [ swedish ] = "~Nytt..." ; + Text [ finnish ] = "~New..." ; + Text [ english_us ] = "~New..." ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "½(~N)..."; + Text[ russian ] = "..."; + Text[ polish ] = "Nowy..."; + Text[ japanese ] = "VK쐬(~N)..."; + Text[ chinese_traditional ] = "}ҷs(~N)..."; + Text[ arabic ] = "..."; + Text[ greek ] = "..."; + Text[ korean ] = "(~N)..."; + Text[ turkish ] = "Yeni..."; + }; + PushButton RID_PB_APPEND + { + Pos = MAP_APPFONT ( 144 , 103 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + /* ### ACHTUNG: Neuer Text in Resource? Hin~zufgen... : Hin~zufgen... */ + Text = "Hin~zufgen..." ; + Text [ ENGLISH ] = "A~ppend..." ; + Text [ dutch ] = "Toe~voegen..." ; + Text [ english_us ] = "~Append..." ; + Text [ italian ] = "Aggiungi..." ; + Text [ spanish ] = "~Aadir..." ; + Text [ french ] = "~Ajouter.." ; + Text [ swedish ] = "Lgg ~till..." ; + Text [ danish ] = "Tilfj..." ; + Text [ portuguese_brazilian ] = "Hin~zufgen..." ; + Text [ portuguese ] = "~Adicionar..." ; + Text[ chinese_simplified ] = "(~A)..."; + Text[ russian ] = "..."; + Text[ polish ] = "Dodaj..."; + Text[ japanese ] = "Yt(~A)..."; + Text[ chinese_traditional ] = "sW(~A)..."; + Text[ arabic ] = "..."; + Text[ greek ] = "..."; + Text[ korean ] = "߰(~A)..."; + Text[ turkish ] = "Ekle..."; + }; + PushButton RID_PB_DELETE + { + Pos = MAP_APPFONT ( 144 , 120 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + /* ### ACHTUNG: Neuer Text in Resource? ~Lschen... : ~Lschen... */ + Text = "~Lschen..." ; + Text [ ENGLISH ] = "~Delete..." ; + Text [ norwegian ] = "~Slett..." ; + Text [ italian ] = "~Elimina..." ; + Text [ portuguese_brazilian ] = "~Apagar..." ; + Text [ portuguese ] = "E~liminar..." ; + Text [ finnish ] = "~Poista..." ; + Text [ danish ] = "Slet..." ; + Text [ french ] = "~Supprimer..." ; + Text [ swedish ] = "R~adera..." ; + Text [ dutch ] = "~Wissen..." ; + Text [ spanish ] = "Elim~inar..." ; + Text [ english_us ] = "~Delete..." ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "ɾ(~D)"; + Text[ russian ] = "..."; + Text[ polish ] = "Usu..."; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = "R(~D)"; + Text[ arabic ] = "..."; + Text[ greek ] = "..."; + Text[ korean ] = "(~D)..."; + Text[ turkish ] = "Sil..."; + }; + ListBox RID_LB_BASICS + { + Border = TRUE ; + Pos = MAP_APPFONT ( 6 , 17 ) ; + Size = MAP_APPFONT ( 130 , 80 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + }; +}; +Resource RID_RES_CHECKBITMAPS +{ + Bitmap CHKBTN_UNCHECKED { File = "chkun.bmp" ; }; + Bitmap CHKBTN_CHECKED { File = "chkch.bmp" ; }; + Bitmap CHKBTN_HICHECKED { File = "chkchhi.bmp" ; }; + Bitmap CHKBTN_HIUNCHECKED { File = "chkunhi.bmp" ; }; + Bitmap CHKBTN_TRISTATE { File = "chktri.bmp" ; }; + Bitmap CHKBTN_HITRISTATE { File = "chktrihi.bmp" ; }; +}; +ModalDialog RID_DLG_LIBS +{ + // HelpId = HID_BASICIDE_LIBS_DLG ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 168 , 145 ) ; + Moveable = TRUE ; + Closeable = TRUE ; + OKButton RID_PB_OK + { + Pos = MAP_APPFONT ( 112 , 6 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + DefButton = TRUE ; + }; + CancelButton RID_PB_CANCEL + { + Pos = MAP_APPFONT ( 112 , 23 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + FixedText RID_FT_STORAGENAME + { + Pos = MAP_APPFONT ( 6 , 6 ) ; + Size = MAP_APPFONT ( 100 , 10 ) ; + }; + Control RID_CTRL_LIBS + { + HelpID = HID_BASICIDE_LIBSDLG_TREE ; + Border = TRUE ; + Pos = MAP_APPFONT ( 6 , 19 ) ; + Size = MAP_APPFONT ( 100 , 67 ) ; + TabStop = TRUE ; + }; + GroupBox RID_GB_OPTIONS + { + Pos = MAP_APPFONT ( 6 , 89 ) ; + Size = MAP_APPFONT ( 156 , 50 ) ; + Text = "Optionen" ; + Text [ English ] = "Options" ; + Text [ dutch ] = "Opties" ; + Text [ english_us ] = "Options" ; + Text [ italian ] = "Opzioni" ; + Text [ spanish ] = "Opciones" ; + Text [ french ] = "Options" ; + Text [ swedish ] = "Alternativ" ; + Text [ danish ] = "Indstillinger" ; + Text [ portuguese ] = "Opes" ; + Text [ portuguese_brazilian ] = "Optionen" ; + Text[ chinese_simplified ] = "ѡ"; + Text[ russian ] = ""; + Text[ polish ] = "Opcje"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = "ﶵ"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "ɼ"; + Text[ turkish ] = "Seenekler"; + }; + CheckBox RID_CB_REF + { + Pos = MAP_APPFONT ( 12 , 100 ) ; + Size = MAP_APPFONT ( 146 , 10 ) ; + TabStop = TRUE ; + /* ### ACHTUNG: Neuer Text in Resource? Als Referenz einfgen (nur lesen) : Als Referenz einfgen (nur lesen) */ + Text = "Als Referenz einfgen (nur lesen)" ; + Text [ English ] = "Insert as reference (read only)" ; + Text [ english_us ] = "Insert as reference (read only)" ; + Text [ portuguese_brazilian ] = "Referenzen (nur lesen)" ; + Text [ swedish ] = "Infoga som referens (endast lsning)" ; + Text [ danish ] = "Indst som reference (skrivebeskyttet)" ; + Text [ italian ] = "Inserisci come riferimento (sola lettura)" ; + Text [ spanish ] = "Insertar como referencia (solo leer)" ; + Text [ french ] = "Insrer en tant que rfrence (lecture seule)" ; + Text [ dutch ] = "Als verwijzing invoegen (alleen lezen)" ; + Text [ portuguese ] = "Inserir como referncia (s leitura)" ; + Text[ chinese_simplified ] = "ò(ֻ)"; + Text[ russian ] = " ( )"; + Text[ polish ] = "Wstaw jako odwoanie (tylko do odczytu)"; + Text[ japanese ] = "QƂƂđ}(ǂݎp)"; + Text[ chinese_traditional ] = "@ѷӴJ(Ū)"; + Text[ arabic ] = " ( )"; + Text[ greek ] = " ( )"; + Text[ korean ] = " (б⸸)"; + Text[ turkish ] = "Referans olarak ekle (salt okunur)"; + }; + CheckBox RID_CB_SEP + { + Pos = MAP_APPFONT ( 12 , 113 ) ; + Size = MAP_APPFONT ( 146 , 10 ) ; + Text = "Als separate Datei speichern" ; + Text [ English ] = "Als separate Datei speichern" ; + Text [ portuguese ] = "Guardar como ficheiro separado" ; + Text [ english_us ] = "Save as separate file" ; + Text [ portuguese_brazilian ] = "Als separate Datei speichern" ; + Text [ swedish ] = "Spara som separat fil" ; + Text [ danish ] = "Gem som separat fil" ; + Text [ italian ] = "Sava come file a parte" ; + Text [ spanish ] = "Guardar como archivo separado" ; + Text [ french ] = "Enregistrer comme fichier distinct" ; + Text [ dutch ] = "Als separaat bestand opslaan" ; + Text[ chinese_simplified ] = "ļ"; + Text[ russian ] = " "; + Text[ polish ] = "Zapisz w oddzielnym pliku"; + Text[ japanese ] = "ʂ̧قƂĕۑ"; + Text[ chinese_traditional ] = "tsɮ"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " Ϸ "; + Text[ turkish ] = "Ayr dosya olarak kaydet"; + }; + CheckBox RID_CB_REPL + { + Pos = MAP_APPFONT ( 12 , 126 ) ; + Size = MAP_APPFONT ( 146 , 10 ) ; + Text = "Existierende Bibliotheken ersetzen" ; + Text [ English ] = "Replace existing Libaries" ; + Text [ portuguese ] = "Substituir bibliotecas existentes" ; + Text [ english_us ] = "Replace existing libraries" ; + Text [ portuguese_brazilian ] = "Bibliotheken ersetzen" ; + Text [ swedish ] = "Erstt existerande bibliotek" ; + Text [ danish ] = "Erstat de eksisterende biblioteker" ; + Text [ italian ] = "Sostituisci biblioteche esistenti" ; + Text [ spanish ] = "Reemplazar bibliotecas existentes" ; + Text [ french ] = "Remplacer bibliothques existantes" ; + Text [ dutch ] = "Bestaande bibliotheken vervangen" ; + Text[ chinese_simplified ] = "ִĿ"; + Text[ russian ] = " "; + Text[ polish ] = "Zamie istniejce biblioteki"; + Text[ japanese ] = "ײu"; + Text[ chinese_traditional ] = "N{s{w"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " ̺귯 ü"; + Text[ turkish ] = "Mevcut kitapl deitir"; + }; +}; +ModalDialog RID_DLG_NEWLIB +{ + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 160 , 55 ) ; + Moveable = TRUE ; + Closeable = TRUE ; + OKButton RID_PB_OK + { + Pos = MAP_APPFONT ( 104 , 6 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + DefButton = TRUE ; + }; + CancelButton RID_PB_CANCEL + { + Pos = MAP_APPFONT ( 104 , 23 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + FixedText RID_FT_NEWLIB + { + Pos = MAP_APPFONT ( 6 , 6 ) ; + Size = MAP_APPFONT ( 100 , 10 ) ; + Text = "~Name:" ; + Text [ English ] = "~Name:" ; + Text [ english_us ] = "~Name:" ; + Text [ portuguese_brazilian ] = "~Name:" ; + Text [ swedish ] = "~Namn:" ; + Text [ danish ] = "Navn:" ; + Text [ italian ] = "~Nome:" ; + Text [ spanish ] = "~Nombre:" ; + Text [ french ] = "~Nom :" ; + Text [ dutch ] = "~Naam:" ; + Text [ portuguese ] = "~Nome:" ; + Text[ chinese_simplified ] = "(~N)"; + Text[ russian ] = ":"; + Text[ polish ] = "Nazwa:"; + Text[ japanese ] = "O:(~N)"; + Text[ chinese_traditional ] = "W(~N)"; + Text[ arabic ] = ":"; + Text[ greek ] = ":"; + Text[ korean ] = "̸:(~N)"; + Text[ turkish ] = "Ad:"; + }; + Edit RID_ED_LIBNAME + { + Border = TRUE ; + Pos = MAP_APPFONT ( 6 , 19 ) ; + Size = MAP_APPFONT ( 92 , 12 ) ; + TabStop = TRUE ; + }; + CheckBox RID_CHKB_EXTRAFILE + { + Pos = MAP_APPFONT ( 6 , 37 ) ; + Size = MAP_APPFONT ( 92 , 12 ) ; + TabStop = TRUE ; + Text = "~Separate Datei anlegen" ; + Text [ English ] = "~Separate Datei anlegen" ; + Text [ portuguese ] = "~Criar ficheiro separado" ; + Text [ english_us ] = "~Attach file" ; + Text [ portuguese_brazilian ] = "~Separate Datei anlegen" ; + Text [ swedish ] = "~Skapa separat fil" ; + Text [ danish ] = "Opret separat fil" ; + Text [ italian ] = "~Crea file distinto" ; + Text [ spanish ] = "Crear archivo ~separado" ; + Text [ french ] = "~Crer un fichier distinct" ; + Text [ dutch ] = "~Apart bestand maken" ; + Hide = TRUE ; + Text[ chinese_simplified ] = "һļ(~A)"; + Text[ russian ] = " "; + Text[ polish ] = "Utwrz oddzielny plik"; + Text[ japanese ] = "ق̧قYt(~A)"; + Text[ chinese_traditional ] = "t~}ҷs(~A)"; + Text[ arabic ] = " "; + Text[ greek ] = " ~ "; + Text[ korean ] = " ÷(~A)"; + Text[ turkish ] = "Ayr dosya olutur"; + }; +}; diff --git a/basctl/source/basicide/moptions.hrc b/basctl/source/basicide/moptions.hrc new file mode 100644 index 000000000..40c57674b --- /dev/null +++ b/basctl/source/basicide/moptions.hrc @@ -0,0 +1,81 @@ +/************************************************************************* + * + * $RCSfile: moptions.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _MOPTIONS_HRC +#define _MOPTIONS_HRC + +#include <svtools/solar.hrc> + +#define RID_MACROOPTIONS ( RID_BASICIDE_START + 55 ) + +#define RID_FT_SBXNAME 2 +#define RID_PB_OK 3 +#define RID_PB_CANCEL 4 +#define RID_PB_HELP 5 +#define RID_FT_DESCR 6 +#define RID_ME_DESCR 7 +#define RID_GB_HELP 8 +#define RID_FT_HELPID 9 +#define RID_NF_HELPID 10 +#define RID_FT_HELPNAME 11 +#define RID_ED_HELPNAME 12 + +#endif // _MOPTIONS_HRC + diff --git a/basctl/source/basicide/moptions.src b/basctl/source/basicide/moptions.src new file mode 100644 index 000000000..ba86ff3fd --- /dev/null +++ b/basctl/source/basicide/moptions.src @@ -0,0 +1,262 @@ +/************************************************************************* + * + * $RCSfile: moptions.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include "helpid.hrc" +#include <moptions.hrc> +ModalDialog RID_MACROOPTIONS +{ + // HelpId = HID_MACRO_OPTIONS ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 224 , 121 ) ; + Text = "Beschreibung" ; + Text [ English ] = "Description" ; + Text [ norwegian ] = "Beskrivelse" ; + Text [ italian ] = "Descrizione" ; + Text [ portuguese_brazilian ] = "Descrio" ; + Text [ portuguese ] = "Descrio" ; + Text [ finnish ] = "Kuvaus" ; + Text [ danish ] = "Beskrivelse" ; + Text [ french ] = "Description" ; + Text [ swedish ] = "Beskrivning" ; + Text [ dutch ] = "Beschrijving" ; + Text [ spanish ] = "Descripcin" ; + Text [ english_us ] = "Description" ; + Moveable = TRUE ; + Closeable = TRUE ; + FixedText RID_FT_SBXNAME + { + SVLook = TRUE ; + Pos = MAP_APPFONT ( 6 , 6 ) ; + Size = MAP_APPFONT ( 150 , 10 ) ; + }; + OKButton RID_PB_OK + { + Pos = MAP_APPFONT ( 168 , 6 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + DefButton = TRUE ; + }; + CancelButton RID_PB_CANCEL + { + Pos = MAP_APPFONT ( 168 , 23 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + HelpButton RID_PB_HELP + { + Pos = MAP_APPFONT ( 168 , 53 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + FixedText RID_FT_DESCR + { + SVLook = TRUE ; + Pos = MAP_APPFONT ( 6 , 19 ) ; + Size = MAP_APPFONT ( 69 , 10 ) ; + Text = "Beschreibung" ; + Text [ ENGLISH ] = "Description" ; + Text [ norwegian ] = "Beskrivelse" ; + Text [ italian ] = "Descrizione" ; + Text [ portuguese_brazilian ] = "Descrio" ; + Text [ portuguese ] = "Descrio" ; + Text [ finnish ] = "Kuvaus" ; + Text [ danish ] = "Beskrivelse" ; + Text [ french ] = "Description" ; + Text [ swedish ] = "Beskrivning" ; + Text [ dutch ] = "Beschrijving" ; + Text [ spanish ] = "Descripcin" ; + Text [ english_us ] = "Description" ; + Text[ chinese_simplified ] = "˵"; + Text[ russian ] = ""; + Text[ polish ] = "Opis"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = "yz"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Aklama"; + Text[ language_user1 ] = " "; + }; + MultiLineEdit RID_ME_DESCR + { + Border = TRUE ; + SVLook = TRUE ; + Pos = MAP_APPFONT ( 6 , 32 ) ; + Size = MAP_APPFONT ( 154 , 36 ) ; + TabStop = TRUE ; + VScroll = TRUE ; + IgnoreTab = TRUE ; + }; + GroupBox RID_GB_HELP + { + Pos = MAP_APPFONT ( 6 , 73 ) ; + Size = MAP_APPFONT ( 212 , 42 ) ; + Text = "Hilfe-Informationen" ; + Text [ ENGLISH ] = "Help informations" ; + Text [ norwegian ] = "Help informations" ; + Text [ italian ] = "Informazioni sulla Guida" ; + Text [ portuguese_brazilian ] = "Informaes do ajuda" ; + Text [ portuguese ] = "Informaes - Ajuda" ; + Text [ finnish ] = "Ohjetietoja" ; + Text [ danish ] = "Hjlp-information" ; + Text [ french ] = "Informations - Aide" ; + Text [ swedish ] = "Hjlp-information" ; + Text [ dutch ] = "Help informatie" ; + Text [ spanish ] = "Informaciones - Ayuda" ; + Text [ english_us ] = "Help information" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = "-"; + Text[ polish ] = "Pomoc-Informacje"; + Text[ japanese ] = "ߏ"; + Text[ chinese_traditional ] = "T"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " "; + Text[ turkish ] = "Yardm bilgileri"; + Text[ language_user1 ] = " "; + }; + FixedText RID_FT_HELPID + { + SVLook = TRUE ; + Pos = MAP_APPFONT ( 9 , 83 ) ; + Size = MAP_APPFONT ( 80 , 10 ) ; + Text = "Hilfe-Identifikation" ; + Text [ ENGLISH ] = "Help identification" ; + Text [ norwegian ] = "Help identification" ; + Text [ italian ] = "Identifica la Guida" ; + Text [ portuguese_brazilian ] = "Identificao do ajuda" ; + Text [ portuguese ] = "Ajuda - Identificao" ; + Text [ finnish ] = "Ohjetunnus" ; + Text [ danish ] = "Hjlp-identifikation" ; + Text [ french ] = "Identification de l'aide" ; + Text [ swedish ] = "Hjlp-identifikation" ; + Text [ dutch ] = "Help identificatie" ; + Text [ spanish ] = "Identificacin de ayuda" ; + Text [ english_us ] = "Help ID" ; + Text[ chinese_simplified ] = "ʶ"; + Text[ russian ] = " "; + Text[ polish ] = "Identyfikacja pomocy"; + Text[ japanese ] = "ID"; + Text[ chinese_traditional ] = "ѧO"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " ID"; + Text[ turkish ] = "Yardm tantcs"; + Text[ language_user1 ] = " "; + }; + NumericField RID_NF_HELPID + { + Border = TRUE ; + SVLook = TRUE ; + Pos = MAP_APPFONT ( 95 , 83 ) ; + Size = MAP_APPFONT ( 120 , 12 ) ; + TabStop = TRUE ; + Minimum = 0 ; + Maximum = 0xFFFFFFFF ; + }; + FixedText RID_FT_HELPNAME + { + SVLook = TRUE ; + Pos = MAP_APPFONT ( 9 , 99 ) ; + Size = MAP_APPFONT ( 80 , 10 ) ; + Text = "Hilfe-Dateiname" ; + Text [ ENGLISH ] = "Help filename" ; + Text [ norwegian ] = "Help filename" ; + Text [ italian ] = "Nome file della Guida" ; + Text [ portuguese_brazilian ] = "Nome de arquivo do ajuda" ; + Text [ portuguese ] = "Nome do ficheiro de ajuda" ; + Text [ finnish ] = "Ohjetiedoston nimi" ; + Text [ danish ] = "Hjlp-filnavn" ; + Text [ french ] = "Nom du fichier de l'aide" ; + Text [ swedish ] = "Hjlp-filnamn" ; + Text [ dutch ] = "Help-bestandsnaam" ; + Text [ spanish ] = "Nombre del archivo de ayuda" ; + Text [ english_us ] = "Help file name" ; + Text[ chinese_simplified ] = "ļ"; + Text[ russian ] = " "; + Text[ polish ] = "Nazwa pliku-Pomoc"; + Text[ japanese ] = "߂̧ٖ"; + Text[ chinese_traditional ] = "ɮצW"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " ϸ"; + Text[ turkish ] = "Yardm dosyas ad"; + Text[ language_user1 ] = " "; + }; + Edit RID_ED_HELPNAME + { + Border = TRUE ; + Pos = MAP_APPFONT ( 95 , 99 ) ; + Size = MAP_APPFONT ( 120 , 12 ) ; + TabStop = TRUE ; + }; + Text[ chinese_simplified ] = "˵"; + Text[ russian ] = ""; + Text[ polish ] = "Opis"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = "yz"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Aklama"; + Text[ language_user1 ] = " "; +}; diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx new file mode 100644 index 000000000..4b5a8e70f --- /dev/null +++ b/basctl/source/basicide/objdlg.cxx @@ -0,0 +1,420 @@ +/************************************************************************* + * + * $RCSfile: objdlg.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <ide_pch.hxx> + +#pragma hdrstop + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#ifndef _SV_CMDEVT_HXX +#include <vcl/cmdevt.hxx> +#endif +#include <vcl/sound.hxx> +#include <objdlg.hrc> +#include <objdlg.hxx> +#include <bastypes.hxx> +#include <basidesh.hrc> +#include <moptions.hxx> +#include <iderdll.hxx> +#include <iderdll2.hxx> +#include <sbxitem.hxx> + +#ifndef _SFX_HELP_HXX //autogen +#include <sfx2/sfxhelp.hxx> +#endif + +#ifndef _SV_CLIP_HXX //autogen +#include <vcl/clip.hxx> +#endif + +#ifndef _SV_DRAG_HXX //autogen +#include <vcl/drag.hxx> +#endif + + + + +ObjectTreeListBox::ObjectTreeListBox( Window* pParent, const ResId& rRes ) + : BasicTreeListBox( pParent, rRes ) +{ +} + +ObjectTreeListBox::~ObjectTreeListBox() +{ +} + +void ObjectTreeListBox::Command( const CommandEvent& rCEvt ) +{ + if ( rCEvt.GetCommand() == COMMAND_STARTDRAG ) + { + String aText; + + BYTE nType = GetSelectedType(); + if ( ( nType == OBJTYPE_METHOD ) || ( nType == OBJTYPE_METHODINOBJ ) || + ( nType == OBJTYPE_PROPERTY ) || ( nType == OBJTYPE_SUBOBJ ) ) + { + String aLib, aModOrObj, aSubOrPropOrSObj, aPropOrSubInSObj; + GetSelectedSbx( aLib, aModOrObj, aSubOrPropOrSObj, aPropOrSubInSObj ); + aText = aModOrObj; + aText += String( RTL_CONSTASCII_USTRINGPARAM( "." ) ); + aText += aSubOrPropOrSObj; + if ( aPropOrSubInSObj.Len() ) + { + aText += '.'; + aText += aPropOrSubInSObj; + } + + DragServer::Clear(); + DragServer::CopyString( aText ); + // Region? + ExecuteDrag( Pointer( POINTER_COPYDATA ), Pointer( POINTER_COPYDATA ), DRAG_COPYABLE ); + DragServer::Clear(); + } + } +} + +void ObjectTreeListBox::MouseButtonDown( const MouseEvent& rMEvt ) +{ + BasicTreeListBox::MouseButtonDown( rMEvt ); + + if ( rMEvt.IsLeft() && ( rMEvt.GetClicks() == 2 ) ) + { + SbxVariable* pSbx = FindVariable( GetCurEntry() ); + if ( pSbx && pSbx->ISA( SbMethod ) ) + { + SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, pSbx ); + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_SHOWSBX, + SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L ); + } + } + } +} + + + +ObjectCatalog::ObjectCatalog( Window * pParent ) + : FloatingWindow( pParent, IDEResId( RID_BASICIDE_OBJCAT ) ), + aMacroTreeList( this, IDEResId( RID_TLB_MACROS ) ), +// aShowButton( this, IDEResId( RID_PB_SHOW ) ), +// aOptionButton( this, IDEResId( RID_PB_OPTIONS ) ), +// aLittleHelp( this, IDEResId( RID_PB_LITTLEHELP ) ), + aToolBox( this, IDEResId( RID_TB_TOOLBOX ) ), + aMacroDescr( this, IDEResId( RID_FT_MACRODESCR ) ) +{ + FreeResource(); + +// aShowButton.SetClickHdl( LINK( this, ObjectCatalog, ButtonHdl ) ); +// aOptionButton.SetClickHdl( LINK( this, ObjectCatalog, ButtonHdl ) ); +// aLittleHelp.SetClickHdl( LINK( this, ObjectCatalog, ButtonHdl ) ); + + aToolBox.SetSizePixel( aToolBox.CalcWindowSizePixel() ); + aToolBox.SetSelectHdl( LINK( this, ObjectCatalog, ToolBoxHdl ) ); + + + aMacroTreeList.SetWindowBits( WB_HASLINES ); + aMacroTreeList.SetSelectHdl( LINK( this, ObjectCatalog, TreeListHighlightHdl ) ); + aMacroTreeList.SetDragDropMode( SV_DRAGDROP_CTRL_COPY ); + + aMacroTreeList.ScanAllBasics(); + aMacroTreeList.ExpandAllTrees(); + CheckButtons(); + + Point aPos = IDE_DLL()->GetExtraData()->GetObjectCatalogPos(); + Size aSize = IDE_DLL()->GetExtraData()->GetObjectCatalogSize(); + if ( aPos.X() == INVPOSITION ) + { + // Zentriert nach AppWin: + Window* pWin = GetParent(); + aPos = pWin->OutputToScreenPixel( Point( 0, 0 ) ); + Size aAppWinSz = pWin->GetSizePixel(); + Size aDlgWinSz = GetSizePixel(); + aPos.X() += aAppWinSz.Width() / 2; + aPos.X() -= aDlgWinSz.Width() / 2; + aPos.Y() += aAppWinSz.Height() / 2; + aPos.Y() -= aDlgWinSz.Height() / 2; + } + SetPosPixel( aPos ); + if ( aSize.Width() ) + SetOutputSizePixel( aSize ); + + Resize(); // damit der Resize-Handler die Controls anordnet +} + + +void __EXPORT ObjectCatalog::Move() +{ + IDE_DLL()->GetExtraData()->SetObjectCatalogPos( GetPosPixel() ); +} + +BOOL __EXPORT ObjectCatalog::Close() +{ + aCancelHdl.Call( this ); + return TRUE; +} + +void __EXPORT ObjectCatalog::Resize() +{ + Size aOutSz = GetOutputSizePixel(); + IDE_DLL()->GetExtraData()->SetObjectCatalogSize( aOutSz ); + + Point aTreePos = aMacroTreeList.GetPosPixel(); + Size aDescrSz = aMacroDescr.GetSizePixel(); + + Size aTreeSz; + long nCtrlWidth = aOutSz.Width() - 2*aTreePos.X(); + aTreeSz.Width() = nCtrlWidth; + aTreeSz.Height() = aOutSz.Height() - aTreePos.Y() - + 2*aTreePos.X() - aDescrSz.Height(); + + if ( aTreeSz.Height() > 0 ) + { + aMacroTreeList.SetSizePixel( aTreeSz ); + + Point aDescrPos( aTreePos.X(), aTreePos.Y()+aTreeSz.Height()+aTreePos.X() ); + + aMacroDescr.SetPosSizePixel( aDescrPos, Size( nCtrlWidth, aDescrSz.Height() ) ); + + String aDesc = aMacroDescr.GetText(); + aMacroDescr.SetText(String()); + aMacroDescr.SetText(aDesc); + } + + // Die Buttons oben bleiben immer unveraendert stehen... +} + + +void ObjectCatalog::ScanBasic( BasicManager* pBasMgr, const String& rName ) +{ + aMacroTreeList.ScanBasic( pBasMgr, rName ); +} + + + +IMPL_LINK( ObjectCatalog, ToolBoxHdl, ToolBox*, pToolBox ) +{ + USHORT nCurItem = pToolBox->GetCurItemId(); + switch ( nCurItem ) + { + case TBITEM_SHOW: + { + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON ); + } + SvLBoxEntry* pCurEntry = aMacroTreeList.GetCurEntry(); + DBG_ASSERT( pCurEntry, "Entry?!" ); + SbxVariable* pSbx = aMacroTreeList.FindVariable(pCurEntry ); + if ( pSbx ) + { + DBG_ASSERT( pSbx->ISA( SbxVariable ), "Var?!" ); + SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, pSbx ); + if( pDispatcher ) + { + pDispatcher->Execute( SID_BASICIDE_SHOWSBX, + SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L ); + } + } + else + { + ErrorBox( this, WB_OK, String( IDEResId( RID_STR_OBJNOTFOUND ) ) ).Execute(); + aMacroTreeList.GetModel()->Remove( pCurEntry ); + CheckButtons(); + } + } + break; + case TBITEM_PROPS: + { + SbxVariable* pVar = aMacroTreeList.FindVariable( aMacroTreeList.GetCurEntry() ); + DBG_ASSERT( pVar, "Variable nicht gefunden!" ); + if ( pVar ) + { + MacroOptionsDialog* pDlg = new MacroOptionsDialog( this, pVar ); + pDlg->Execute(); + delete pDlg; + UpdateFields(); + } + } + break; + case TBITEM_HELP: + { + SvLBoxEntry* pCurEntry = aMacroTreeList.GetCurEntry(); + if ( pCurEntry ) + { + BasicEntry* pInfo = (BasicEntry*)pCurEntry->GetUserData(); + DBG_ASSERT( pInfo, "Keine Info?" ); + SbxVariable* pVar = aMacroTreeList.FindVariable( pCurEntry ); + DBG_ASSERT( pVar, "Variable nicht gefunden!" ); + if ( pVar ) + { + SbxInfoRef xInfo = pVar->GetInfo(); + if ( xInfo.Is() ) + { + ByteString aHelpFile( xInfo->GetHelpFile(), RTL_TEXTENCODING_UTF8 ); + USHORT nHelpId = (USHORT)xInfo->GetHelpId(); + SfxHelp::ShowHelp( nHelpId, TRUE, aHelpFile.GetBuffer() ); + } + } + } + } + break; + } + + return 0; +} + + + +void ObjectCatalog::CheckButtons() +{ + SvLBoxEntry* pCurEntry = aMacroTreeList.GetCurEntry(); + + BYTE nType = pCurEntry ? ((BasicEntry*)pCurEntry->GetUserData())->GetType() : 0; + if ( ( nType == OBJTYPE_OBJECT ) || ( nType == OBJTYPE_MODULE ) || + ( nType == OBJTYPE_METHOD ) || ( nType == OBJTYPE_LIB ) ) + { + aToolBox.EnableItem( TBITEM_PROPS, TRUE ); + } + else + aToolBox.EnableItem( TBITEM_PROPS, FALSE ); + + if ( ( nType == OBJTYPE_OBJECT ) || ( nType == OBJTYPE_MODULE ) ) + { + aToolBox.EnableItem( TBITEM_SHOW, TRUE ); + } + else if ( ( nType == OBJTYPE_METHOD ) || ( nType == OBJTYPE_METHODINOBJ ) ) + { + if ( nType == OBJTYPE_METHOD ) + aToolBox.EnableItem( TBITEM_SHOW, TRUE ); + else + aToolBox.EnableItem( TBITEM_SHOW, FALSE ); + } + else + { + aToolBox.EnableItem( TBITEM_SHOW, FALSE ); + } +} + + + +IMPL_LINK_INLINE_START( ObjectCatalog, TreeListHighlightHdl, SvTreeListBox *, pBox ) +{ + if ( pBox->IsSelected( pBox->GetHdlEntry() ) ) + UpdateFields(); + return 0; +} +IMPL_LINK_INLINE_END( ObjectCatalog, TreeListHighlightHdl, SvTreeListBox *, pBox ) + + +/* +BYTE ObjectCatalog::GetSelectedType() +{ + return aMacroTreeList.GetSelectedType(); +} + +BasicManager* ObjectCatalog::GetSelectedSbx( String& rLib, String& rModOrObj, String& rSubOrProp ) +{ + return aMacroTreeList.GetSelectedSbx( rLib, rModOrObj, rSubOrProp ); +} + +*/ + + +void ObjectCatalog::UpdateFields() +{ + SvLBoxEntry* pCurEntry = aMacroTreeList.GetCurEntry(); + if ( pCurEntry ) + { + CheckButtons(); + aMacroDescr.SetText( String() ); +// aMacroTreeList.SetHelpText( String() ); + aToolBox.EnableItem( TBITEM_HELP, FALSE ); + SbxVariable* pVar = aMacroTreeList.FindVariable( pCurEntry ); + if ( pVar ) + { + SbxInfoRef xInfo = pVar->GetInfo(); + if ( xInfo.Is() ) + { + aMacroDescr.SetText( xInfo->GetComment() ); +// aMacroTreeList.SetHelpText( xInfo->GetComment() ); + if ( xInfo->GetHelpFile().Len() ) + aToolBox.EnableItem( TBITEM_HELP, TRUE ); + } + } + } +} + + +void ObjectCatalog::UpdateEntries() +{ + aMacroTreeList.UpdateEntries(); +} + diff --git a/basctl/source/basicide/objdlg.hrc b/basctl/source/basicide/objdlg.hrc new file mode 100644 index 000000000..92efa2904 --- /dev/null +++ b/basctl/source/basicide/objdlg.hrc @@ -0,0 +1,75 @@ +/************************************************************************* + * + * $RCSfile: objdlg.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _OBJDLG_HRC +#define _OBJDLG_HRC + +#include <svtools/solar.hrc> + +#define RID_BASICIDE_OBJCAT ( RID_BASICIDE_START + 70 ) +#define RID_FT_MACRODESCR 8 +#define RID_TLB_MACROS 10 +#define RID_TB_TOOLBOX 11 + +#define TBITEM_SHOW 1 +#define TBITEM_PROPS 2 +#define TBITEM_HELP 3 + +#endif // _OBJDLG_HXX diff --git a/basctl/source/basicide/objdlg.hxx b/basctl/source/basicide/objdlg.hxx new file mode 100644 index 000000000..a0b262361 --- /dev/null +++ b/basctl/source/basicide/objdlg.hxx @@ -0,0 +1,128 @@ +/************************************************************************* + * + * $RCSfile: objdlg.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _OBJDLG_HXX +#define _OBJDLG_HXX + +#ifndef _SVHEADER_HXX +#include <svheader.hxx> +#endif + +#ifndef _SV_FLOATWIN_HXX //autogen +#include <vcl/floatwin.hxx> +#endif + +#ifndef _SV_TOOLBOX_HXX //autogen +#include <vcl/toolbox.hxx> +#endif + +#ifndef _SV_FIXED_HXX //autogen +#include <vcl/fixed.hxx> +#endif + +#include <bastype2.hxx> + +class StarBASIC; + +class ObjectTreeListBox : public BasicTreeListBox +{ +private: + + virtual void Command( const CommandEvent& rCEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + +public: + ObjectTreeListBox( Window* pParent, const ResId& rRes ); + ~ObjectTreeListBox(); +}; + +class ObjectCatalog : public FloatingWindow +{ +private: + ObjectTreeListBox aMacroTreeList; + ToolBox aToolBox; + FixedText aMacroDescr; + Link aCancelHdl; + +protected: + DECL_LINK( ToolBoxHdl, ToolBox* ); + void CheckButtons(); + DECL_LINK( TreeListHighlightHdl, SvTreeListBox * ); + void UpdateFields(); + virtual void Move(); + virtual BOOL Close(); + virtual void Resize(); + +public: + ObjectCatalog( Window * pParent ); + + void ScanBasic( BasicManager* pBasMgr, const String& rName ); + void UpdateEntries(); + +// BYTE GetSelectedType(); +// BasicManager* GetSelectedSbx( String& rLib, String& rModOrObj, String& rSubOrProp ); + + void SetCancelHdl( const Link& rLink ) { aCancelHdl = rLink; } +// void SetInsertHdl( const Link& rLink ) { aInsertHdl = rLink; } +}; + +#endif //_OBJDLG_HXX + diff --git a/basctl/source/basicide/objdlg.src b/basctl/source/basicide/objdlg.src new file mode 100644 index 000000000..65d8109ee --- /dev/null +++ b/basctl/source/basicide/objdlg.src @@ -0,0 +1,257 @@ +/************************************************************************* + * + * $RCSfile: objdlg.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <objdlg.hrc> +#include <helpid.hrc> +FloatingWindow RID_BASICIDE_OBJCAT +{ + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 191 , 179 ) ; + Text = "Objekte" ; + Text [ English ] = "Objets" ; + Text [ norwegian ] = "Objets" ; + Text [ italian ] = "Oggetti" ; + Text [ portuguese_brazilian ] = "Objetos" ; + Text [ portuguese ] = "Objectos" ; + Text [ finnish ] = "Objektit" ; + Text [ danish ] = "Objekter" ; + Text [ french ] = "Objets" ; + Text [ swedish ] = "Objekt" ; + Text [ dutch ] = "Objecten" ; + Text [ spanish ] = "Objetos" ; + Text [ english_us ] = "Objects" ; + Closeable = TRUE ; + Moveable = TRUE ; + Sizeable = TRUE ; + Zoomable = TRUE ; + Hide = TRUE ; + ClipChildren = TRUE ; + Control RID_TLB_MACROS + { + HelpId = HID_BASICIDE_OBJECTCAT ; + Border = TRUE ; + Pos = MAP_APPFONT ( 3 , 24 ) ; + Size = MAP_APPFONT ( 185 , 126 ) ; + TabStop = TRUE ; + }; + /* + PushButton RID_PB_SHOW + { + Pos = MAP_APPFONT ( 3, 6 ) ; + Size = MAP_APPFONT ( 50 , 12 ) ; + Text = "Zeigen" ; + Text [ English ] = "Show" ; + Text [ norwegian ] = "Show" ; + Text [ italian ] = "Mostra" ; + Text [ portuguese_brazilian ] = "Mostrar" ; + Text [ portuguese ] = "Apresentar" ; + Text [ finnish ] = "Nyt" ; + Text [ danish ] = "Vis" ; + Text [ french ] = "Afficher" ; + Text [ swedish ] = "Visa" ; + Text [ dutch ] = "Beel~d" ; + Text [ spanish ] = "Mostrar" ; + Text [ english_us ] = "Show" ; + TabStop = TRUE ; + }; + PushButton RID_PB_OPTIONS + { + Pos = MAP_APPFONT ( 56, 6 ) ; + Size = MAP_APPFONT ( 50 , 12 ) ; + Text = "Beschreibung..." ; + Text [ English ] = "Description..." ; + TabStop = TRUE ; + }; + PushButton RID_PB_LITTLEHELP + { + Pos = MAP_APPFONT ( 109 , 6 ) ; + Size = MAP_APPFONT ( 14 , 12 ) ; + Text = "?" ; + Text [ English ] = "?" ; + Text [ norwegian ] = "?" ; + Text [ italian ] = "?" ; + Text [ portuguese_brazilian ] = "?" ; + Text [ portuguese ] = "?" ; + Text [ finnish ] = "?" ; + Text [ danish ] = "?" ; + Text [ french ] = "?" ; + Text [ swedish ] = "?" ; + Text [ dutch ] = "?" ; + Text [ spanish ] = "?" ; + Text [ english_us ] = "?" ; + TabStop = TRUE ; + }; +*/ + ToolBox RID_TB_TOOLBOX + { + HelpId = HID_BASICIDE_OBJECTS ; + SVLook = TRUE ; + Align = BOXALIGN_TOP ; + Pos = MAP_APPFONT ( 4 , 6 ) ; + ItemImageList = ImageList + { + ImageBitmap = Bitmap { FILE = "images3.bmp" ; }; + MaskColor = Color { Red = 0xC000 ; Green = 0xC000 ; Blue = 0xC000 ; }; + IdList = + { + TBITEM_SHOW ; + TBITEM_PROPS ; + TBITEM_HELP ; + }; + }; + ItemList = + { + ToolBoxItem + { + Identifier = TBITEM_SHOW ; + HelpId = HID_BASICIDE_OBJCAT_SHOW ; + Text = "Zeigen" ; + Text [ English ] = "Show" ; + Text [ norwegian ] = "Show" ; + Text [ italian ] = "Mostra" ; + Text [ portuguese_brazilian ] = "Mostrar" ; + Text [ portuguese ] = "Mostrar" ; + Text [ finnish ] = "Nyt" ; + Text [ danish ] = "Vis" ; + Text [ french ] = "Afficher" ; + Text [ swedish ] = "Visa" ; + Text [ dutch ] = "Weergeven" ; + Text [ spanish ] = "Mostrar" ; + Text [ english_us ] = "Show" ; + Text[ chinese_simplified ] = "ʾ"; + Text[ russian ] = ""; + Text[ polish ] = "Poka"; + Text[ japanese ] = "\\"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "̱"; + Text[ turkish ] = "Grntle"; + }; + ToolBoxItem + { + Identifier = TBITEM_PROPS ; + HelpId = HID_BASICIDE_OBJCAT_PROPS ; + Text = "Beschreibung" ; + Text [ English ] = "Description" ; + Text [ portuguese ] = "Descrio" ; + Text [ english_us ] = "Description" ; + Text [ portuguese_brazilian ] = "Beschreibung" ; + Text [ swedish ] = "Beskrivning" ; + Text [ danish ] = "Beskrivelse" ; + Text [ italian ] = "Descrizione" ; + Text [ spanish ] = "Descripcin" ; + Text [ french ] = "Description" ; + Text [ dutch ] = "Beschrijving" ; + Text[ chinese_simplified ] = "˵"; + Text[ russian ] = ""; + Text[ polish ] = "Opis"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = "yz"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Aklama"; + }; + ToolBoxItem + { + Identifier = TBITEM_HELP ; + HelpId = HID_BASICIDE_OBJCAT_HELP ; + Text = "Hilfe" ; + Text [ English ] = "Help" ; + Text [ portuguese ] = "Ajuda" ; + Text [ english_us ] = "Help" ; + Text [ portuguese_brazilian ] = "Hilfe" ; + Text [ swedish ] = "Hjlp" ; + Text [ danish ] = "Hjlp" ; + Text [ italian ] = "Guida" ; + Text [ spanish ] = "Ayuda" ; + Text [ french ] = "Aide" ; + Text [ dutch ] = "Help" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Pomoc"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Yardm"; + }; + }; + }; + FixedText RID_FT_MACRODESCR + { + WordBreak = TRUE ; + Pos = MAP_APPFONT ( 3 , 156 ) ; + Size = MAP_APPFONT ( 185 , 18 ) ; + }; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Obiekty"; + Text[ japanese ] = "ު"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "ü"; + Text[ turkish ] = "Nesneler"; +}; diff --git a/basctl/source/basicide/tbxctl.cxx b/basctl/source/basicide/tbxctl.cxx new file mode 100644 index 000000000..c7cf22a75 --- /dev/null +++ b/basctl/source/basicide/tbxctl.cxx @@ -0,0 +1,241 @@ +/************************************************************************* + * + * $RCSfile: tbxctl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <ide_pch.hxx> + +#pragma hdrstop + +#define _BASIDE_POPUPWINDOWTBX +#include <tbxctl.hxx> +#include <svx/svxids.hrc> +#include <iderid.hxx> +#include <tbxctl.hrc> +#include <idetemp.hxx> + +SFX_IMPL_TOOLBOX_CONTROL( TbxControls, SfxEnumItem ) + +/************************************************************************* +|* +|* WorkWindow Alignment +|* +\************************************************************************/ + +IMPL_LINK( PopupWindowTbx, SelectHdl, void*, EMPTYARG ) +{ +#ifdef VCL + if ( IsInPopupMode() ) + EndPopupMode(); +#endif + + aSelectLink.Call( &aTbx.GetToolBox() ); + + return 0; +} + +PopupWindowTbx::PopupWindowTbx( USHORT nId, ToolBoxAlign eAlign, + ResId aRIdWin, ResId aRIdTbx, + SfxBindings& rBind ) : + SfxPopupWindow ( nId, aRIdWin, rBind ), + aTbx ( this, GetBindings(), aRIdTbx ) +{ + FreeResource(); + aTbx.Initialize(); + + ToolBox& rBox = aTbx.GetToolBox(); + rBox.SetAlign( eAlign ); + if( eAlign == BOXALIGN_LEFT ) + SetText( String() ); + + Size aSize = aTbx.CalcWindowSizePixel(); + rBox.SetSizePixel( aSize ); + SetOutputSizePixel( aSize ); + aSelectLink = rBox.GetSelectHdl(); + rBox.SetSelectHdl( LINK( this, PopupWindowTbx, SelectHdl ) ); +} + +SfxPopupWindow* PopupWindowTbx::Clone() const +{ + return new PopupWindowTbx( GetId(), aTbx.GetAlign(), + IDEResId( RID_TBXCONTROLS ), + IDEResId( RID_TOOLBOX ), + (SfxBindings&) GetBindings() ); +} + +void PopupWindowTbx::PopupModeEnd() +{ + aTbx.GetToolBox().EndSelection(); + SfxPopupWindow::PopupModeEnd(); +} + +void PopupWindowTbx::Update() +{ + ToolBox *pBox = &aTbx.GetToolBox(); + aTbx.Activate( pBox ); + aTbx.Deactivate( pBox ); +} + +PopupWindowTbx::~PopupWindowTbx() +{ +} + +/************************************************************************* +|* +|* Klasse fuer Toolbox +|* +\************************************************************************/ + +TbxControls::TbxControls( USHORT nId, ToolBox& rTbx, SfxBindings& rBind ) : + SfxToolBoxControl( nId, rTbx, rBind ) +{ + nLastSlot = USHRT_MAX; +} + +/************************************************************************* +|* +|* Wenn man ein PopupWindow erzeugen will +|* +\************************************************************************/ +SfxPopupWindowType TbxControls::GetPopupWindowType() const +{ + if( nLastSlot == USHRT_MAX ) + return(SFX_POPUPWINDOW_ONCLICK); + return(SFX_POPUPWINDOW_ONTIMEOUT); +} + +void TbxControls::StateChanged( USHORT nSID, SfxItemState eState, + const SfxPoolItem* pState ) +{ + if( pState ) + { + SfxAllEnumItem* pItem = PTR_CAST(SfxAllEnumItem, pState); + if( pItem ) + { + USHORT nLastEnum = pItem->GetValue(); + USHORT nTemp = 0; + switch( nLastEnum ) + { + case SVX_SNAP_PUSHBUTTON: nTemp = SID_INSERT_PUSHBUTTON; break; + case SVX_SNAP_CHECKBOX: nTemp = SID_INSERT_CHECKBOX; break; + case SVX_SNAP_RADIOBUTTON: nTemp = SID_INSERT_RADIOBUTTON; break; + case SVX_SNAP_SPINBUTTON: nTemp = SID_INSERT_SPINBUTTON; break; + case SVX_SNAP_FIXEDTEXT: nTemp = SID_INSERT_FIXEDTEXT; break; + case SVX_SNAP_GROUPBOX: nTemp = SID_INSERT_GROUPBOX; break; + case SVX_SNAP_LISTBOX: nTemp = SID_INSERT_LISTBOX; break; + case SVX_SNAP_COMBOBOX: nTemp = SID_INSERT_COMBOBOX; break; + case SVX_SNAP_EDIT: nTemp = SID_INSERT_EDIT; break; + case SVX_SNAP_HSCROLLBAR: nTemp = SID_INSERT_HSCROLLBAR; break; + case SVX_SNAP_VSCROLLBAR: nTemp = SID_INSERT_VSCROLLBAR; break; + case SVX_SNAP_PREVIEW: nTemp = SID_INSERT_PREVIEW; break; + case SVX_SNAP_URLBUTTON: nTemp = SID_INSERT_URLBUTTON; break; + } + if( nTemp ) + { + Image aImage = SFX_IMAGEMANAGER()->GetImage( nTemp ); + GetToolBox().SetItemImage( SID_CHOOSE_CONTROLS, aImage ); + nLastSlot = nLastEnum; + } + } + } + SfxToolBoxControl::StateChanged( nSID, eState,pState ); +} + +void TbxControls::Select( USHORT nModifier ) +{ + SfxAllEnumItem aItem( SID_CHOOSE_CONTROLS, nLastSlot ); + SfxViewFrame* pCurFrame = SfxViewFrame::Current(); + DBG_ASSERT( pCurFrame != NULL, "No current view frame!" ); + SfxDispatcher* pDispatcher = pCurFrame ? pCurFrame->GetDispatcher() : NULL; + if( pDispatcher ) + { + pDispatcher->Execute( SID_CHOOSE_CONTROLS, SFX_CALLMODE_SYNCHRON, &aItem, 0L ); + } +} + +/************************************************************************* +|* +|* Hier wird das Fenster erzeugt +|* Lage der Toolbox mit GetToolBox() abfragbar +|* rItemRect sind die Screen-Koordinaten +|* +\************************************************************************/ +SfxPopupWindow* TbxControls::CreatePopupWindow() +{ + if (GetId() == SID_CHOOSE_CONTROLS) + { + PopupWindowTbx *pWin = + new PopupWindowTbx( GetId(), + GetToolBox().IsHorizontal() ? + BOXALIGN_LEFT : BOXALIGN_TOP, + IDEResId( RID_TBXCONTROLS ), + IDEResId( RID_TOOLBOX ), + GetBindings() ); + pWin->StartPopupMode(&GetToolBox(), TRUE); + pWin->Update(); + pWin->StartSelection(); + pWin->Show(); + return(pWin); + } + + return(0); +} + + diff --git a/basctl/source/basicide/tbxctl.hrc b/basctl/source/basicide/tbxctl.hrc new file mode 100644 index 000000000..86487891c --- /dev/null +++ b/basctl/source/basicide/tbxctl.hrc @@ -0,0 +1,64 @@ +/************************************************************************* + * + * $RCSfile: tbxctl.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include <svtools/solar.hrc> + +#define RID_TBXCONTROLS ( RID_BASICIDE_START + 65 ) +#define RID_TOOLBOX ( RID_BASICIDE_START + 66 ) diff --git a/basctl/source/basicide/tbxctl.hxx b/basctl/source/basicide/tbxctl.hxx new file mode 100644 index 000000000..b93f59d7e --- /dev/null +++ b/basctl/source/basicide/tbxctl.hxx @@ -0,0 +1,123 @@ +/************************************************************************* + * + * $RCSfile: tbxctl.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _BASIDE_TBXCTL_HXX +#define _BASIDE_TBXCTL_HXX + + +#ifndef _SFXTBXCTRL_HXX //autogen +#include <sfx2/tbxctrl.hxx> +#endif + +#ifndef _SFXTBXMGR_HXX +#include <sfx2/tbxmgr.hxx> +#endif + +#ifdef _BASIDE_POPUPWINDOWTBX + +// class PopupWindowTbx -------------------------------------------------- + +class PopupWindowTbx : public SfxPopupWindow +{ +private: + SfxToolBoxManager aTbx; + Link aSelectLink; + + DECL_LINK( SelectHdl, void* ); + +public: + PopupWindowTbx( USHORT nId, ToolBoxAlign eAlign, + ResId aRIdWin, ResId aRIdTbx, SfxBindings& rBind ); + ~PopupWindowTbx(); + + void StartSelection() + { aTbx.GetToolBox().StartSelection(); } + void Update(); + + virtual SfxPopupWindow* Clone() const; + virtual void PopupModeEnd(); +}; +#endif + +//------------------- +// class TbxControls +//------------------- +class TbxControls : public SfxToolBoxControl +{ + USHORT nLastSlot; + +protected: + virtual void StateChanged( USHORT nSID, SfxItemState eState, + const SfxPoolItem* pState ); +public: + SFX_DECL_TOOLBOX_CONTROL(); + + TbxControls(USHORT nId, ToolBox& rTbx, SfxBindings& rBind ); + ~TbxControls() {} + + virtual SfxPopupWindowType GetPopupWindowType() const; + virtual SfxPopupWindow* CreatePopupWindow(); + + void Select( USHORT nModifier ); +}; + + +#endif // _BASIDE_TBXCTL_HXX + diff --git a/basctl/source/basicide/tbxctl.src b/basctl/source/basicide/tbxctl.src new file mode 100644 index 000000000..33c3dc9a0 --- /dev/null +++ b/basctl/source/basicide/tbxctl.src @@ -0,0 +1,619 @@ +/************************************************************************* + * + * $RCSfile: tbxctl.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: mh $ $Date: 2000-09-29 11:02:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include "svx/svxids.hrc" +#include "tbxctl.hrc" +#include "helpid.hrc" +FloatingWindow RID_TBXCONTROLS +{ + Moveable = TRUE ; + Closeable = TRUE ; + Hide = TRUE ; + SVLook = TRUE ; + HelpId = HID_BASICIDE_CONTROLS ; + Text = "Kontrollfelder" ; + Text [ ENGLISH ] = "Controls" ; + Text [ english_us ] = "Controls" ; + Text [ swedish ] = "Kontrollflt" ; + Text [ danish ] = "Kontrolelementer" ; + Text [ italian ] = "Campi di controllo" ; + Text [ spanish ] = "Campos de control" ; + Text [ french ] = "Elments de contrle" ; + Text [ dutch ] = "Controlevelden" ; + Text [ portuguese_brazilian ] = "Kontrollfelder" ; + Text [ portuguese ] = "Campos de controlo" ; + String RID_TOOLBOX + { + Text = "Kontrollfelder" ; + Text [ ENGLISH ] = "Controls" ; + Text [ dutch ] = "Controlevelden" ; + Text [ english_us ] = "Controls" ; + Text [ swedish ] = "Kontrollflt" ; + Text [ danish ] = "Kontrolelementer" ; + Text [ italian ] = "Campi di controllo" ; + Text [ spanish ] = "Campos de control" ; + Text [ french ] = "Elments de contrle" ; + Text [ portuguese ] = "Campos de controlo" ; + Text [ portuguese_brazilian ] = "Kontrollfelder" ; + Text[ chinese_simplified ] = "ֶ"; + Text[ russian ] = " "; + Text[ polish ] = "Pola kontrolne"; + Text[ japanese ] = "۰"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "Ʈ"; + Text[ turkish ] = "Komut alanlar"; + Text[ language_user1 ] = " "; + }; + Text[ chinese_simplified ] = "ֶ"; + Text[ russian ] = " "; + Text[ polish ] = "Pola kontrolne"; + Text[ japanese ] = "۰"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "Ʈ"; + Text[ turkish ] = "Komut alanlar"; + Text[ language_user1 ] = " "; +}; +ToolBox RID_TOOLBOX +{ + SVLook = TRUE ; + // HelpId = HID_BASICIDE_CONTROLS ; + LineCount = 2 ; + ItemList = + { + ToolBoxItem + { + HelpId = SID_INSERT_PUSHBUTTON ; + Identifier = SID_INSERT_PUSHBUTTON ; + RadioCheck = TRUE ; + Text = "CommandButton" ; + Text [ english_us ] = "Command Button" ; + Text [ italian ] = "Pulsante di comando" ; + Text [ spanish ] = "Botn de comando" ; + Text [ french ] = "Bouton de commande" ; + Text [ dutch ] = "CommandButton" ; + Text [ swedish ] = "Kommandoknapp" ; + Text [ danish ] = "Kommandoknap" ; + Text [ portuguese ] = "Boto de comando" ; + Text [ portuguese_brazilian ] = "CommandButton" ; + /* ### ACHTUNG: Neuer Text in Resource? CommandButton einfgen : CommandButton einfgen */ + Text[ chinese_simplified ] = "ť"; + Text[ russian ] = " "; + Text[ polish ] = "Przycisk polecenia"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = "ROs"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " ư"; + Text[ turkish ] = "Komut dmesi"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_INSERT_CHECKBOX ; + Identifier = SID_INSERT_CHECKBOX ; + RadioCheck = TRUE ; + Text = "CheckBox" ; + Text [ english_us ] = "Check Box" ; + Text [ italian ] = "Casella di controllo" ; + Text [ spanish ] = "Casilla de verificacin" ; + Text [ french ] = "Case cocher" ; + Text [ dutch ] = "CheckBox" ; + Text [ swedish ] = "CheckBox" ; + Text [ danish ] = "Afkrydsningsfelt" ; + Text [ portuguese ] = "Caixa de verificao" ; + Text [ portuguese_brazilian ] = "CheckBox" ; + /* ### ACHTUNG: Neuer Text in Resource? CheckBox einfgen : CheckBox einfgen */ + Text[ chinese_simplified ] = "ѡ"; + Text[ russian ] = " "; + Text[ polish ] = "Pole wyboru"; + Text[ japanese ] = "ޯ"; + Text[ chinese_traditional ] = "֨"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "üũ ڽ"; + Text[ turkish ] = "Seme kutusu"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_INSERT_FIXEDTEXT ; + Identifier = SID_INSERT_FIXEDTEXT ; + RadioCheck = TRUE ; + Text = "Label" ; + Text [ english_us ] = "Label" ; + Text [ italian ] = "Testo fisso" ; + Text [ spanish ] = "Etiqueta" ; + Text [ french ] = "tiquette" ; + Text [ dutch ] = "Label" ; + Text [ swedish ] = "Etikett" ; + Text [ danish ] = "Etiket" ; + Text [ portuguese ] = "Etiqueta" ; + Text [ portuguese_brazilian ] = "Label" ; + /* ### ACHTUNG: Neuer Text in Resource? Label einfgen : Label einfgen */ + Text[ chinese_simplified ] = "ǩ"; + Text[ russian ] = ""; + Text[ polish ] = "Etykieta"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = " "; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Etiket"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_INSERT_LISTBOX ; + Identifier = SID_INSERT_LISTBOX ; + RadioCheck = TRUE ; + Text = "ListBox" ; + Text [ english_us ] = "List Box" ; + Text [ italian ] = "Casella di riepilogo" ; + Text [ spanish ] = "Listado" ; + Text [ french ] = "Zone de liste" ; + Text [ dutch ] = "ListBox" ; + Text [ swedish ] = "ListBox" ; + Text [ danish ] = "Liste" ; + Text [ portuguese ] = "Caixa de listagem" ; + Text [ portuguese_brazilian ] = "ListBox" ; + /* ### ACHTUNG: Neuer Text in Resource? ListBox einfgen : ListBox einfgen */ + Text[ chinese_simplified ] = "б"; + Text[ russian ] = " "; + Text[ polish ] = "Pole listy"; + Text[ japanese ] = "ؽޯ"; + Text[ chinese_traditional ] = "M"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "Ʈ ڽ"; + Text[ turkish ] = "Liste kutusu"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_INSERT_HSCROLLBAR ; + Identifier = SID_INSERT_HSCROLLBAR ; + RadioCheck = TRUE ; + Text = "HScrollBar" ; + Text [ dutch ] = "HScrollBar" ; + Text [ english_us ] = "Horiz. Scrollbar" ; + Text [ italian ] = "Barra di scorrimento oriz." ; + Text [ spanish ] = "BarraDesplazHoriz." ; + Text [ french ] = "Barre de dfilement horiz." ; + Text [ swedish ] = "HRullningslist" ; + Text [ danish ] = "Vandret rullepanel" ; + Text [ portuguese ] = "Barra de deslocamento horiz." ; + Text [ portuguese_brazilian ] = "HScrollBar" ; + /* ### ACHTUNG: Neuer Text in Resource? Horizontale ScrollBar einfgen : Horizontale ScrollBar einfgen */ + Text[ chinese_simplified ] = "ˮƽ"; + Text[ russian ] = " "; + Text[ polish ] = "Poziomy pasek przewijania"; + Text[ japanese ] = "۰ް"; + Text[ chinese_traditional ] = "Vb"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " ũ "; + Text[ turkish ] = "Yatay kaydrma ubuu"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_INSERT_GROUPBOX ; + Identifier = SID_INSERT_GROUPBOX ; + RadioCheck = TRUE ; + Text = "FrameControl" ; + Text [ dutch ] = "FrameControl" ; + Text [ english_us ] = "Frame Control" ; + Text [ italian ] = "FrameControl" ; + Text [ spanish ] = "FrameControl" ; + Text [ french ] = "FrameControl" ; + Text [ swedish ] = "FrameControl" ; + Text [ danish ] = "FrameControl" ; + Text [ portuguese ] = "FrameControl" ; + Text [ portuguese_brazilian ] = "FrameControl" ; + /* ### ACHTUNG: Neuer Text in Resource? GroupBox einfgen : GroupBox einfgen */ + Text[ chinese_simplified ] = ""; + Text[ russian ] = "FrameControl"; + Text[ polish ] = "FrameControl"; + Text[ japanese ] = "ڰѺ۰"; + Text[ chinese_traditional ] = "Tر"; + Text[ arabic ] = "Frame Control"; + Text[ greek ] = "Frame Control"; + Text[ korean ] = " Ʈ"; + Text[ turkish ] = "FrameControl"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_INSERT_URLBUTTON ; + Identifier = SID_INSERT_URLBUTTON ; + RadioCheck = TRUE ; + /* Uniform Resource Locator (internet) */ + Text = "URL-Button" ; + Text [ dutch ] = "URL-button" ; + Text [ english_us ] = "URL Button" ; + Text [ italian ] = "Pulsante URL" ; + Text [ spanish ] = "Botn URL" ; + Text [ french ] = "Bouton URL" ; + Text [ swedish ] = "URL-knapp" ; + Text [ danish ] = "URL-knap" ; + Text [ portuguese ] = "Boto URL" ; + Text [ portuguese_brazilian ] = "URL-Button" ; + /* ### ACHTUNG: Neuer Text in Resource? URL-Button einfgen : URL-Button einfgen */ + Text[ chinese_simplified ] = "URL ť"; + Text[ russian ] = " URL"; + Text[ polish ] = "Przycisk URL"; + Text[ japanese ] = "URL"; + Text[ chinese_traditional ] = "URL s"; + Text[ arabic ] = " URL"; + Text[ greek ] = " URL"; + Text[ korean ] = "URL ư"; + Text[ turkish ] = "URL dmesi"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; + ToolBoxItem + { + HelpId = SID_SHOW_BROWSER ; + Identifier = SID_SHOW_BROWSER ; + Text = "Eigenschaften" ; + Text [ ENGLISH ] = "Browser" ; + Text [ norwegian ] = "Browser" ; + Text [ italian ] = "Propriet" ; + Text [ portuguese_brazilian ] = "Paginar" ; + Text [ portuguese ] = "Propriedades" ; + Text [ finnish ] = "Selain" ; + Text [ danish ] = "Egenskaber" ; + Text [ french ] = "Proprits" ; + Text [ swedish ] = "Egenskaper" ; + Text [ dutch ] = "Eigenschappen" ; + Text [ spanish ] = "Propiedades" ; + Text [ english_us ] = "Properties" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Waciwoci"; + Text[ japanese ] = "è"; + Text[ chinese_traditional ] = "ݩ"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "zellikler"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_SHOW_HIDDEN ; + Identifier = SID_SHOW_HIDDEN ; + Text = "Unsichtbare Kontrollelemente anzeigen" ; + Text [ English ] = "Unsichtbare Kontrollelemente anzeigen" ; + Text [ portuguese ] = "Mostrar controlos invsiveis" ; + Text [ english_us ] = "Show Hidden Controls" ; + Text [ portuguese_brazilian ] = "Unsichtbare Kontrollelemente anzeigen" ; + Text [ swedish ] = "Visa osynliga kontrollelement" ; + Text [ danish ] = "Vis usynlige kontrolelementer" ; + Text [ italian ] = "Mostra gli elementi di controllo invisibili" ; + Text [ spanish ] = "Mostrar elementos de control invisibles" ; + Text [ french ] = "Afficher les lments de contrle invisibles" ; + Text [ dutch ] = "Onzichtbare controle-elementen weergeven" ; + Text[ chinese_simplified ] = "ʾĿ"; + Text[ russian ] = " "; + Text[ polish ] = "Poka ukryte pola kontrolne"; + Text[ japanese ] = "\\̺۰ٗvf\\"; + Text[ chinese_traditional ] = "J"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " Ʈ "; + Text[ turkish ] = "Gizli komut alanlarn grntle"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem { Type = TOOLBOXITEM_BREAK ; }; + ToolBoxItem + { + HelpId = SID_INSERT_SPINBUTTON ; + Identifier = SID_INSERT_SPINBUTTON ; + RadioCheck = TRUE ; + Text = "SpinButton" ; + Text [ dutch ] = "SpinButton" ; + Text [ english_us ] = "Spin Button" ; + Text [ italian ] = "Pulsante di selezione" ; + Text [ spanish ] = "Botn de seleccin" ; + Text [ french ] = "Compteur" ; + Text [ swedish ] = "SpinButton" ; + Text [ danish ] = "Rulleknap" ; + Text [ portuguese ] = "Boto de rotao" ; + Text [ portuguese_brazilian ] = "SpinButton" ; + /* ### ACHTUNG: Neuer Text in Resource? SpinButton einfgen : SpinButton einfgen */ + Text[ chinese_simplified ] = "ѡֵť"; + Text[ russian ] = " "; + Text[ polish ] = "Przycisk pokrta"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = "ո`s"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "ȸ ư"; + Text[ turkish ] = "Deer kutusu"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_INSERT_RADIOBUTTON ; + Identifier = SID_INSERT_RADIOBUTTON ; + RadioCheck = TRUE ; + Text = "OptionButton" ; + Text [ dutch ] = "OptionButton" ; + Text [ english_us ] = "Option Button" ; + Text [ italian ] = "Pulsante di scelta" ; + Text [ spanish ] = "Botn de opcin" ; + Text [ french ] = "Bouton radio" ; + Text [ swedish ] = "Alternativknapp" ; + Text [ danish ] = "Alternativknap" ; + Text [ portuguese ] = "Boto de opo" ; + Text [ portuguese_brazilian ] = "OptionButton" ; + /* ### ACHTUNG: Neuer Text in Resource? RadioButton einfgen : RadioButton einfgen */ + Text[ chinese_simplified ] = "ѡť"; + Text[ russian ] = " "; + Text[ polish ] = "Przycisk opcji"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = "ﶵs"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "ɼ ư"; + Text[ turkish ] = "Seenek dmesi"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_INSERT_EDIT ; + Identifier = SID_INSERT_EDIT ; + RadioCheck = TRUE ; + Text = "TextBox" ; + Text [ dutch ] = "TextBox" ; + Text [ english_us ] = "Text Box" ; + Text [ italian ] = "Casella di testo" ; + Text [ spanish ] = "Cuadro de texto" ; + Text [ french ] = "Zone de texte" ; + Text [ swedish ] = "TextBox" ; + Text [ danish ] = "Tekstboks" ; + Text [ portuguese ] = "Caixa de texto" ; + Text [ portuguese_brazilian ] = "TextBox" ; + /* ### ACHTUNG: Neuer Text in Resource? Edit einfgen : Edit einfgen */ + Text[ chinese_simplified ] = "ֿ"; + Text[ russian ] = " "; + Text[ polish ] = "Pole tekstowe"; + Text[ japanese ] = "÷ޯ"; + Text[ chinese_traditional ] = "r"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "ؽƮ ڽ"; + Text[ turkish ] = "Metin kutusu"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_INSERT_COMBOBOX ; + Identifier = SID_INSERT_COMBOBOX ; + RadioCheck = TRUE ; + Text = "ComboBox" ; + Text [ ENGLISH ] = "ComboBox" ; + Text [ dutch ] = "ComboBox" ; + Text [ english_us ] = "Combo Box" ; + Text [ italian ] = "Casella combinata" ; + Text [ spanish ] = "Cuadro combinado" ; + Text [ french ] = "Zone combine" ; + Text [ swedish ] = "ComboBox" ; + Text [ danish ] = "Kombinationsboks" ; + Text [ portuguese ] = "Caixa de combinao" ; + Text [ portuguese_brazilian ] = "ComboBox" ; + /* ### ACHTUNG: Neuer Text in Resource? ComboBox einfgen : ComboBox einfgen */ + Text[ chinese_simplified ] = "Ͽ"; + Text[ russian ] = " "; + Text[ polish ] = "Pole kombi"; + Text[ japanese ] = "ޯ"; + Text[ chinese_traditional ] = "զX"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " ڽ"; + Text[ turkish ] = "Kombinasyon alan"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_INSERT_VSCROLLBAR ; + Identifier = SID_INSERT_VSCROLLBAR ; + RadioCheck = TRUE ; + Text = "VScrollBar" ; + Text [ english_us ] = "Vert. Scrollbar" ; + Text [ italian ] = "Barra di scorrimento vert." ; + Text [ spanish ] = "Barra de desplazamiento vert." ; + Text [ french ] = "Barre de dfilement vert." ; + Text [ dutch ] = "VScrollBar" ; + Text [ swedish ] = "VRullningslist" ; + Text [ danish ] = "Lodret rullepanel" ; + Text [ portuguese ] = "Barra de deslocamento vert." ; + Text [ portuguese_brazilian ] = "VScrollBar" ; + /* ### ACHTUNG: Neuer Text in Resource? Vertikale ScrollBar einfgen : Vertikale ScrollBar einfgen */ + Text[ chinese_simplified ] = ""; + Text[ russian ] = " "; + Text[ polish ] = "Pionowy pasek przewijania"; + Text[ japanese ] = "۰ް"; + Text[ chinese_traditional ] = "aVb"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " ũ "; + Text[ turkish ] = "Dikey kaydrma ubuu"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_INSERT_PREVIEW ; + Identifier = SID_INSERT_PREVIEW ; + RadioCheck = TRUE ; + Text = "Preview" ; + Text [ dutch ] = "Voorbeeld" ; + Text [ english_us ] = "Preview" ; + Text [ italian ] = "Anteprima" ; + Text [ spanish ] = "Previsualizacin" ; + Text [ french ] = "Aperu" ; + Text [ swedish ] = "Frhandsvisning" ; + Text [ danish ] = "Eksempel" ; + Text [ portuguese ] = "Previsualizar" ; + Text [ portuguese_brazilian ] = "Preview" ; + /* ### ACHTUNG: Neuer Text in Resource? Preview einfgen : Preview einfgen */ + Text[ chinese_simplified ] = "Ԥ"; + Text[ russian ] = " "; + Text[ polish ] = "Podgld"; + Text[ japanese ] = "ޭ"; + Text[ chinese_traditional ] = "w"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "̸"; + Text[ turkish ] = "nizleme"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_OBJECT_SELECT ; + Identifier = SID_OBJECT_SELECT ; + RadioCheck = TRUE ; + Text = "Auswahl" ; + Text [ ENGLISH ] = "Select" ; + Text [ norwegian ] = "Select" ; + Text [ italian ] = "Seleziona" ; + Text [ portuguese_brazilian ] = "Selecionar" ; + Text [ portuguese ] = "Seleccionar" ; + Text [ finnish ] = "Valitse " ; + Text [ danish ] = "Marker" ; + Text [ french ] = "Slection" ; + Text [ swedish ] = "Urval" ; + Text [ dutch ] = "Selectie" ; + Text [ spanish ] = "Seleccin" ; + Text [ english_us ] = "Select" ; + Text[ chinese_simplified ] = "ѡ"; + Text[ russian ] = ""; + Text[ polish ] = "Wybr"; + Text[ japanese ] = "I"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Seim"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; + ToolBoxItem + { + HelpId = SID_DIALOG_TESTMODE ; + Identifier = SID_DIALOG_TESTMODE ; + Text = "Testmodus aktivieren" ; + Text [ ENGLISH ] = "Activate testmode" ; + Text [ norwegian ] = "Activate testmode" ; + Text [ italian ] = "Attiva modo testo" ; + Text [ portuguese_brazilian ] = "Ativar modoteste" ; + Text [ portuguese ] = "Activar modo Teste" ; + Text [ finnish ] = "Valitse testaustila" ; + Text [ danish ] = "Aktiver testtilstand" ; + Text [ french ] = "Activer le mode Test" ; + Text [ swedish ] = "Aktivera testlget" ; + Text [ dutch ] = "Testmodus inschakelen" ; + Text [ spanish ] = "Activar modo prueba" ; + Text [ english_us ] = "Activate Test Mode" ; + Text[ chinese_simplified ] = "ģʽ"; + Text[ russian ] = " "; + Text[ polish ] = "Uaktywnij tryb sprawdzania"; + Text[ japanese ] = "ýӰނèނɂ"; + Text[ chinese_traditional ] = "EҦ"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "Ʈ Ȱ"; + Text[ turkish ] = "Deneme kipini etkinletir"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + HelpId = SID_SHOW_FORMS ; + Identifier = SID_SHOW_FORMS ; + Text = "Form-Dialog anzeigen" ; + Text [ English ] = "Form-Dialog anzeigen" ; + Text [ portuguese ] = "Ver caixa de dilogo para formulrios" ; + Text [ english_us ] = "Show Form Dialog" ; + Text [ portuguese_brazilian ] = "Form-Dialog anzeigen" ; + Text [ swedish ] = "Visa form dialog" ; + Text [ danish ] = "Vis form-dialog" ; + Text [ italian ] = "Mostra dialogo per formulari" ; + Text [ spanish ] = "Mostrar dilogo para formularios" ; + Text [ french ] = "Afficher la bote de dialogue de formulaires" ; + Text [ dutch ] = "Vormdialoog weergeven" ; + Text[ chinese_simplified ] = "ʾԻ"; + Text[ russian ] = " "; + Text[ polish ] = "Poka dialog formularza"; + Text[ japanese ] = "̫т۸ނ\\"; + Text[ chinese_traditional ] = "ܪܤ"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " ȭ "; + Text[ turkish ] = "Biim diyalounu grntle"; + Text[ language_user1 ] = " "; + }; + }; +}; |