#99369# New dialog 'Select Sheets'

This commit is contained in:
Daniel Rentz 2002-05-22 06:23:28 +00:00
parent 7f86daa43d
commit 604d08a000
7 changed files with 132 additions and 62 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: shtabdlg.hxx,v $
*
* $Revision: 1.1.1.1 $
* $Revision: 1.2 $
*
* last change: $Author: hr $ $Date: 2000-09-18 16:45:00 $
* last change: $Author: dr $ $Date: 2002-05-22 07:19:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -62,9 +62,6 @@
#ifndef SC_SHTABDLG_HXX
#define SC_SHTABDLG_HXX
#ifndef _LIST_HXX //autogen
#include <tools/list.hxx>
#endif
#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
#endif
@ -92,11 +89,20 @@ private:
DECL_LINK( DblClkHdl, void * );
public:
ScShowTabDlg( Window* pParent, List& aEntryList );
ScShowTabDlg( Window* pParent );
~ScShowTabDlg();
/** Sets dialog title, fixed text for listbox and help IDs. */
void SetDescription(
const String& rTitle, const String& rFixedText,
ULONG nDlgHelpId, ULONG nLbHelpId );
/** Inserts a string into the ListBox. */
void Insert( const String& rString, BOOL bSelected );
USHORT GetSelectEntryCount() const;
String GetSelectEntry(USHORT nPos) const;
USHORT GetSelectEntryPos(USHORT nPos) const;
};

View file

@ -2,9 +2,9 @@
*
* $RCSfile: submenu.hrc,v $
*
* $Revision: 1.1.1.1 $
* $Revision: 1.2 $
*
* last change: $Author: hr $ $Date: 2000-09-18 16:45:01 $
* last change: $Author: dr $ $Date: 2002-05-22 07:19:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -98,4 +98,5 @@
#define SUBMENU_OBJANCHOR 35
#define SUBMENU_SENDTO 36
#define SUBMENU_CHANGES 37
#define MN_TEMPLATES 38
#define SUBMENU_EDIT_TABLE 38
#define MN_TEMPLATES 39

View file

@ -2,9 +2,9 @@
*
* $RCSfile: shtabdlg.cxx,v $
*
* $Revision: 1.1.1.1 $
* $Revision: 1.2 $
*
* last change: $Author: hr $ $Date: 2000-09-18 16:45:03 $
* last change: $Author: dr $ $Date: 2002-05-22 07:20:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -76,7 +76,7 @@
//==================================================================
ScShowTabDlg::ScShowTabDlg( Window* pParent, List& aEntryList ) :
ScShowTabDlg::ScShowTabDlg( Window* pParent ) :
ModalDialog ( pParent, ScResId( RID_SCDLG_SHOW_TAB ) ),
aLb ( this, ScResId( LB_ENTRYLIST ) ),
aBtnOk ( this, ScResId( BTN_OK ) ),
@ -87,22 +87,31 @@ ScShowTabDlg::ScShowTabDlg( Window* pParent, List& aEntryList ) :
aLb.Clear();
aLb.SetDoubleClickHdl( LINK( this, ScShowTabDlg, DblClkHdl ) );
void* pListEntry = aEntryList.First();
while ( pListEntry )
{
aLb.InsertEntry( *((String*)pListEntry ) );
pListEntry = aEntryList.Next();
}
if ( aLb.GetEntryCount() > 0 )
aLb.SelectEntryPos( 0 );
//-------------
FreeResource();
}
//------------------------------------------------------------------------
void ScShowTabDlg::SetDescription(
const String& rTitle, const String& rFixedText,
ULONG nDlgHelpId, ULONG nLbHelpId )
{
SetText( rTitle );
aFtLbTitle.SetText( rFixedText );
SetHelpId( nDlgHelpId );
aLb.SetHelpId( nLbHelpId );
}
void ScShowTabDlg::Insert( const String& rString, BOOL bSelected )
{
aLb.InsertEntry( rString );
if( bSelected )
aLb.SelectEntryPos( aLb.GetEntryCount() - 1 );
}
//------------------------------------------------------------------------
USHORT ScShowTabDlg::GetSelectEntryCount() const
{
return aLb.GetSelectEntryCount();
@ -113,6 +122,11 @@ String ScShowTabDlg::GetSelectEntry(USHORT nPos) const
return aLb.GetSelectEntry(nPos);
}
USHORT ScShowTabDlg::GetSelectEntryPos(USHORT nPos) const
{
return aLb.GetSelectEntryPos(nPos);
}
//------------------------------------------------------------------------
IMPL_LINK_INLINE_START( ScShowTabDlg, DblClkHdl, void *, EMPTYARG )

View file

@ -2,9 +2,9 @@
*
* $RCSfile: scstring.src,v $
*
* $Revision: 1.51 $
* $Revision: 1.52 $
*
* last change: $Author: kz $ $Date: 2002-05-16 15:09:30 $
* last change: $Author: dr $ $Date: 2002-05-22 07:21:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -3174,24 +3174,18 @@ String STR_CAPTION_DEFAULT_TEXT
Text[ thai ] = "ข้อความ";
};
// Select tables dialog title
String STR_DLG_SELECTTABLES_TITLE
{
Text = "Tabellen selektieren";
Text[ ENGLISH ] = "Select Sheets";
Text[ english_us ] = "Select Sheets";
};
// Select tables dialog listbox
String STR_DLG_SELECTTABLES_LBNAME
{
Text = "~Selektierte Tabellen";
Text[ ENGLISH ] = "~Selected sheets";
Text[ english_us ] = "~Selected sheets";
};

View file

@ -2,9 +2,9 @@
*
* $RCSfile: tabvwsh3.cxx,v $
*
* $Revision: 1.7 $
* $Revision: 1.8 $
*
* last change: $Author: nn $ $Date: 2002-03-04 19:28:30 $
* last change: $Author: dr $ $Date: 2002-05-22 07:22:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -105,6 +105,7 @@
#include "autoform.hxx"
#include "autofmt.hxx"
#include "dwfunctr.hxx"
#include "shtabdlg.hxx"
#define IS_EDITMODE() GetViewData()->HasEditView( GetViewData()->GetActivePart() )
#define IS_AVAILABLE(WhichId,ppItem) \
@ -707,6 +708,65 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
rReq.Done();
break;
case SID_SELECT_TABLES:
{
ScViewData& rViewData = *GetViewData();
ScDocument& rDoc = *rViewData.GetDocument();
ScMarkData& rMark = rViewData.GetMarkData();
sal_uInt16 nTabCount = rDoc.GetTableCount();
sal_uInt16 nTab;
ScShowTabDlg* pDlg = new ScShowTabDlg( GetDialogParent() );
pDlg->SetDescription(
String( ScResId( STR_DLG_SELECTTABLES_TITLE ) ),
String( ScResId( STR_DLG_SELECTTABLES_LBNAME ) ),
SID_SELECT_TABLES, HID_SELECTTABLES );
// fill all table names with selection state
String aTabName;
for( nTab = 0; nTab < nTabCount; ++nTab )
{
rDoc.GetName( nTab, aTabName );
pDlg->Insert( aTabName, rMark.GetTableSelect( nTab ) );
}
if( pDlg->Execute() == RET_OK )
{
sal_uInt16 nSelCount = pDlg->GetSelectEntryCount();
sal_uInt16 nSelIx;
sal_uInt16 nSelTab = nSelCount ? pDlg->GetSelectEntryPos( 0 ) : 0;
sal_uInt16 nFirstVisTab = 0;
// special case: only hidden tables selected -> do nothing
sal_Bool bVisSelected = sal_False;
for( nSelIx = 0; !bVisSelected && (nSelIx < nSelCount); ++nSelIx )
bVisSelected = rDoc.IsVisible( nFirstVisTab = pDlg->GetSelectEntryPos( nSelIx ) );
if( !bVisSelected )
nSelCount = 0;
// select the tables
if( nSelCount )
{
for( nTab = 0; nTab < nTabCount; ++nTab )
rMark.SelectTable( nTab, sal_False );
for( nSelIx = 0; nSelIx < nSelCount; ++nSelIx )
rMark.SelectTable( pDlg->GetSelectEntryPos( nSelIx ), sal_True );
// activate another table, if current is deselected
if( !rMark.GetTableSelect( rViewData.GetTabNo() ) )
{
rMark.SelectTable( nFirstVisTab, sal_True );
SetTabNo( nFirstVisTab );
}
rViewData.GetDocShell()->PostPaintExtras();
rViewData.GetBindings().Invalidate( FID_FILL_TAB );
}
}
delete pDlg;
}
break;
case SID_OUTLINE_DELETEALL:

View file

@ -2,9 +2,9 @@
*
* $RCSfile: tabvwshf.cxx,v $
*
* $Revision: 1.1.1.1 $
* $Revision: 1.2 $
*
* last change: $Author: hr $ $Date: 2000-09-18 16:45:10 $
* last change: $Author: dr $ $Date: 2002-05-22 07:22:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -195,19 +195,20 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
}
else
{
List aList;
ScShowTabDlg* pDlg = new ScShowTabDlg( GetDialogParent() );
String aTabName;
BOOL bFirst = TRUE;
for ( USHORT i=0; i != nTabCount; i++ )
{
if (!pDoc->IsVisible(i))
{
String* pNewEntry = new String;
pDoc->GetName( i, *pNewEntry );
aList.Insert( pNewEntry );
pDoc->GetName( i, aTabName );
pDlg->Insert( aTabName, bFirst );
bFirst = FALSE;
}
}
ScShowTabDlg* pDlg = new ScShowTabDlg( GetDialogParent(), aList );
if ( pDlg->Execute() == RET_OK )
{
USHORT nCount = pDlg->GetSelectEntryCount();
@ -220,13 +221,6 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
rReq.Done();
}
delete pDlg;
void* pEntry = aList.First();
while ( pEntry )
{
delete (String*) aList.Remove( pEntry );
pEntry = aList.Next();
}
}
}
break;

View file

@ -2,9 +2,9 @@
*
* $RCSfile: hidother.src,v $
*
* $Revision: 1.12 $
* $Revision: 1.13 $
*
* last change: $Author: dr $ $Date: 2002-05-15 08:30:00 $
* last change: $Author: dr $ $Date: 2002-05-22 07:23:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -121,6 +121,7 @@ hidspecial HID_PASSWD_DOC { HelpID = HID_PASSWD_DOC; };
hidspecial HID_CHG_PROTECT { HelpID = HID_CHG_PROTECT; };
hidspecial HID_SCDLG_LINKAREAURL { HelpID = HID_SCDLG_LINKAREAURL; };
hidspecial HID_SC_RENAME_OBJECT { HelpID = HID_SC_RENAME_OBJECT; };
hidspecial HID_SELECTTABLES { HelpId = HID_SELECTTABLES; };
// 2. Seite Funktionsautopilot: nur als Unique-IDs