ManageNames: Paste names, initial layout without table

This commit is contained in:
Markus Mohrhard 2011-11-19 22:40:51 +01:00
parent 7f7c90861d
commit ce26c58c7f
5 changed files with 41 additions and 99 deletions

View file

@ -91,6 +91,10 @@
#define FL_SEP1 51
#define FL_SEP2 52
#define BTN_CLOSE 60
#define BTN_PASTE 61
#define BTN_PASTE_ALL 62
// Tabelle einfuegen/loeschen
#define FT_DEST 1
#define LB_DEST 2

View file

@ -42,16 +42,12 @@ class ScRangeName;
class ScNamePasteDlg : public ModalDialog
{
DECL_LINK( ButtonHdl, Button * );
DECL_LINK( ListSelHdl, ListBox * );
DECL_LINK( ListDblClickHdl, ListBox * );
protected:
FixedText aLabelText;
ListBox aNameList;
OKButton aOKButton;
CancelButton aCancelButton;
HelpButton aHelpButton;
PushButton aInsListButton;
HelpButton maHelpButton;
PushButton maBtnClose;
PushButton maBtnPaste;
PushButton maBtnPasteAll;
public:
ScNamePasteDlg( Window * pParent, const ScRangeName* pList, const ScRangeName* pLocalList, bool bInsList=true );

View file

@ -50,6 +50,7 @@
#define BTN_PASTE_NAME 100 // from namepast.hxx
#define BTN_PASTE_LIST 101 // from namepast.hxx
#define BTN_PASTE_CLOSE 102 // from namepast.hxx
#define BTN_EXTEND_RANGE 150
#define BTN_CURRENT_SELECTION 151

View file

@ -45,36 +45,15 @@
ScNamePasteDlg::ScNamePasteDlg( Window * pParent, const ScRangeName* pList, const ScRangeName* pLocalList, bool bInsList )
: ModalDialog( pParent, ScResId( RID_SCDLG_NAMES_PASTE ) ),
aLabelText ( this, ScResId( FT_LABEL ) ),
aNameList ( this, ScResId( LB_ENTRYLIST ) ),
aOKButton ( this, ScResId( BTN_OK ) ),
aCancelButton ( this, ScResId( BTN_CANCEL ) ),
aHelpButton ( this, ScResId( BTN_HELP ) ),
aInsListButton ( this, ScResId( BTN_ADD ) )
maHelpButton ( this, ScResId( BTN_HELP ) ),
maBtnClose ( this, ScResId( BTN_CLOSE ) ),
maBtnPaste ( this, ScResId( BTN_PASTE ) ),
maBtnPasteAll ( this, ScResId( BTN_PASTE_ALL ) )
{
if( ! bInsList )
aInsListButton.Disable();
aInsListButton.SetClickHdl( LINK( this,ScNamePasteDlg,ButtonHdl) );
aOKButton.SetClickHdl( LINK( this,ScNamePasteDlg,ButtonHdl) );
aNameList.SetSelectHdl( LINK( this,ScNamePasteDlg,ListSelHdl) );
aNameList.SetDoubleClickHdl( LINK( this,ScNamePasteDlg,ListDblClickHdl) );
ScRangeName::const_iterator itr = pLocalList->begin(), itrEnd = pLocalList->end();
for (; itr != itrEnd; ++itr)
{
if (!itr->HasType(RT_DATABASE) && !itr->HasType(RT_SHARED))
aNameList.InsertEntry(itr->GetName());
}
itr = pList->begin(), itrEnd = pList->end();
for (; itr != itrEnd; ++itr)
{
if (!itr->HasType(RT_DATABASE) && !itr->HasType(RT_SHARED) && !pLocalList->findByName(itr->GetName()))
aNameList.InsertEntry(itr->GetName());
}
ListSelHdl( &aNameList );
maBtnPaste.SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl) );
maBtnPasteAll.SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl));
maBtnClose.SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl));
FreeResource();
}
@ -83,49 +62,27 @@ ScNamePasteDlg::ScNamePasteDlg( Window * pParent, const ScRangeName* pList, cons
IMPL_LINK( ScNamePasteDlg, ButtonHdl, Button *, pButton )
{
if( pButton == &aInsListButton )
if( pButton == &maBtnPasteAll )
{
EndDialog( BTN_PASTE_LIST );
}
else if( pButton == &aOKButton )
else if( pButton == &maBtnPaste )
{
EndDialog( BTN_PASTE_NAME );
}
return 0;
}
//------------------------------------------------------------------
IMPL_LINK( ScNamePasteDlg, ListSelHdl, ListBox *, pListBox )
{
if( pListBox == &aNameList )
else if( pButton == &maBtnClose )
{
if( aNameList.GetSelectEntryCount() )
aOKButton.Enable();
else
aOKButton.Disable();
EndDialog( BTN_PASTE_CLOSE );
}
return 0;
}
//------------------------------------------------------------------
IMPL_LINK_INLINE_START( ScNamePasteDlg, ListDblClickHdl, ListBox *, pListBox )
{
if( pListBox == &aNameList )
{
ButtonHdl( &aOKButton );
}
return 0;
}
IMPL_LINK_INLINE_END( ScNamePasteDlg, ListDblClickHdl, ListBox *, pListBox )
//------------------------------------------------------------------
std::vector<rtl::OUString> ScNamePasteDlg::GetSelectedNames() const
{
std::vector<rtl::OUString> aSelectedNames;
aSelectedNames.push_back(aNameList.GetSelectEntry());
//aSelectedNames.push_back(aNameList.GetSelectEntry());
return aSelectedNames;
}

View file

@ -1413,52 +1413,36 @@ ModalDialog RID_SCDLG_NAMES_PASTE
OutputSize = TRUE ;
HelpId = CMD_FID_INSERT_NAME ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 228 , 85 ) ;
Size = MAP_APPFONT ( 228 , 140 ) ;
Moveable = TRUE ;
FixedText FT_LABEL
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 156 , 10 ) ;
Text [ en-US ] = "Insert name" ;
};
ListBox LB_ENTRYLIST
{
HelpID = "sc:ListBox:RID_SCDLG_NAMES_PASTE:LB_ENTRYLIST";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 14 ) ;
Size = MAP_APPFONT ( 160 , 65 ) ;
TabStop = TRUE ;
VScroll = TRUE ;
Sort = TRUE ;
};
OKButton BTN_OK
{
Pos = MAP_APPFONT ( 172 , 4 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton BTN_CANCEL
{
Pos = MAP_APPFONT ( 172 , 21 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
HelpButton BTN_HELP
{
Pos = MAP_APPFONT ( 172 , 41 ) ;
Pos = MAP_APPFONT ( 6, 120 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
PushButton BTN_ADD
PushButton BTN_PASTE
{
HelpID = "sc:PushButton:RID_SCDLG_NAMES_PASTE:BTN_ADD";
Pos = MAP_APPFONT ( 172 , 66 ) ;
Pos = MAP_APPFONT ( 172 , 90 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Insert ~All" ;
Text [en-US] = "Paste";
};
Text [ en-US ] = "Insert Name" ;
PushButton BTN_PASTE_ALL
{
Pos = MAP_APPFONT ( 6 , 90 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Text [en-US] = "Paste All";
};
PushButton BTN_CLOSE
{
Pos = MAP_APPFONT ( 172 , 120 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Text [en-US] = "Close";
};
Text [ en-US ] = "Paste Names" ;
};
ModalDialog RID_SCDLG_CHARTCOLROW