diff options
author | Joost Wezenbeek <joost.eekhoorn@gmail.com> | 2010-12-10 20:03:11 +0100 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-12-13 23:38:19 -0500 |
commit | b8591032221134de771a7781394882ed3ab18504 (patch) | |
tree | 1e910fbfd74f2f442527598ffdb57a290bf4fc6a /sc/source/ui/miscdlgs/mvtabdlg.cxx | |
parent | c36e61421b36099b041a508f09cd1da0af32dd01 (diff) |
Change Sheet copy process
Easy Hacks 3.27
Added rename in Move/Copy Sheet in calc
Diffstat (limited to 'sc/source/ui/miscdlgs/mvtabdlg.cxx')
-rw-r--r-- | sc/source/ui/miscdlgs/mvtabdlg.cxx | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx index 2dfaa510959a..b92d66a230c7 100644 --- a/sc/source/ui/miscdlgs/mvtabdlg.cxx +++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx @@ -65,13 +65,17 @@ ScMoveTableDlg::ScMoveTableDlg( Window* pParent ) aFtTable ( this, ScResId( FT_INSERT ) ), aLbTable ( this, ScResId( LB_INSERT ) ), aBtnCopy ( this, ScResId( BTN_COPY ) ), + aBtnRename ( this, ScResId( BTN_RENAME ) ), + aFtTabName ( this, ScResId( FT_LABEL ) ), + aEdTabName ( this, ScResId( ED_INPUT ) ), aBtnOk ( this, ScResId( BTN_OK ) ), aBtnCancel ( this, ScResId( BTN_CANCEL ) ), aBtnHelp ( this, ScResId( BTN_HELP ) ), // nDocument ( 0 ), nTable ( 0 ), - bCopyTable ( FALSE ) + bCopyTable ( FALSE ), + bRenameTable( FALSE ) { #if ENABLE_LAYOUT #undef ScResId @@ -95,6 +99,13 @@ SCTAB ScMoveTableDlg::GetSelectedTable () const { return nTable; } BOOL ScMoveTableDlg::GetCopyTable () const { return bCopyTable; } +BOOL ScMoveTableDlg::GetRenameTable () const { return bRenameTable; } + +void ScMoveTableDlg::GetTabNameString( String& rString ) const +{ + rString = aEdTabName.GetText(); +} + void ScMoveTableDlg::SetCopyTable(BOOL bFlag) { aBtnCopy.Check(bFlag); @@ -107,6 +118,24 @@ void ScMoveTableDlg::EnableCopyTable(BOOL bFlag) aBtnCopy.Disable(); } +void ScMoveTableDlg::SetRenameTable(BOOL bFlag) +{ + aBtnRename.Check(bFlag); + SetTabNameVisible(bFlag); +} + +void ScMoveTableDlg::SetTabNameVisible(BOOL bFlag) +{ + if(bFlag) + { + aFtTabName.Show(); + aEdTabName.Show(); + } else + { + aFtTabName.Hide(); + aEdTabName.Hide(); + } +} //------------------------------------------------------------------------ @@ -114,7 +143,10 @@ void ScMoveTableDlg::Init() { aBtnOk.SetClickHdl ( LINK( this, ScMoveTableDlg, OkHdl ) ); aLbDoc.SetSelectHdl ( LINK( this, ScMoveTableDlg, SelHdl ) ); + aBtnRename.SetToggleHdl( LINK( this, ScMoveTableDlg, RenameHdl ) ); aBtnCopy.Check( FALSE ); + aBtnRename.Check( FALSE ); + SetTabNameVisible( FALSE ); InitDocListBox(); SelHdl( &aLbDoc ); } @@ -157,6 +189,13 @@ void ScMoveTableDlg::InitDocListBox() //------------------------------------------------------------------------ // Handler: +IMPL_LINK( ScMoveTableDlg, RenameHdl, void *, EMPTYARG ) +{ + SetTabNameVisible( aBtnRename.IsChecked() ); + + return 0; +} + IMPL_LINK( ScMoveTableDlg, OkHdl, void *, EMPTYARG ) { USHORT nDocSel = aLbDoc.GetSelectEntryPos(); @@ -167,6 +206,7 @@ IMPL_LINK( ScMoveTableDlg, OkHdl, void *, EMPTYARG ) nDocument = (nDocSel != nDocLast) ? nDocSel : SC_DOC_NEW; nTable = (nTabSel != nTabLast) ? static_cast<SCTAB>(nTabSel) : SC_TAB_APPEND; bCopyTable = aBtnCopy.IsChecked(); + bRenameTable= aBtnRename.IsChecked(); EndDialog( RET_OK ); return 0; |