Kaydet (Commit) ce26c58c authored tarafından Markus Mohrhard's avatar Markus Mohrhard

ManageNames: Paste names, initial layout without table

üst 7f7c9086
...@@ -91,6 +91,10 @@ ...@@ -91,6 +91,10 @@
#define FL_SEP1 51 #define FL_SEP1 51
#define FL_SEP2 52 #define FL_SEP2 52
#define BTN_CLOSE 60
#define BTN_PASTE 61
#define BTN_PASTE_ALL 62
// Tabelle einfuegen/loeschen // Tabelle einfuegen/loeschen
#define FT_DEST 1 #define FT_DEST 1
#define LB_DEST 2 #define LB_DEST 2
......
...@@ -42,16 +42,12 @@ class ScRangeName; ...@@ -42,16 +42,12 @@ class ScRangeName;
class ScNamePasteDlg : public ModalDialog class ScNamePasteDlg : public ModalDialog
{ {
DECL_LINK( ButtonHdl, Button * ); DECL_LINK( ButtonHdl, Button * );
DECL_LINK( ListSelHdl, ListBox * );
DECL_LINK( ListDblClickHdl, ListBox * );
protected: protected:
FixedText aLabelText; HelpButton maHelpButton;
ListBox aNameList; PushButton maBtnClose;
OKButton aOKButton; PushButton maBtnPaste;
CancelButton aCancelButton; PushButton maBtnPasteAll;
HelpButton aHelpButton;
PushButton aInsListButton;
public: public:
ScNamePasteDlg( Window * pParent, const ScRangeName* pList, const ScRangeName* pLocalList, bool bInsList=true ); ScNamePasteDlg( Window * pParent, const ScRangeName* pList, const ScRangeName* pLocalList, bool bInsList=true );
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#define BTN_PASTE_NAME 100 // from namepast.hxx #define BTN_PASTE_NAME 100 // from namepast.hxx
#define BTN_PASTE_LIST 101 // 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_EXTEND_RANGE 150
#define BTN_CURRENT_SELECTION 151 #define BTN_CURRENT_SELECTION 151
......
...@@ -45,36 +45,15 @@ ...@@ -45,36 +45,15 @@
ScNamePasteDlg::ScNamePasteDlg( Window * pParent, const ScRangeName* pList, const ScRangeName* pLocalList, bool bInsList ) ScNamePasteDlg::ScNamePasteDlg( Window * pParent, const ScRangeName* pList, const ScRangeName* pLocalList, bool bInsList )
: ModalDialog( pParent, ScResId( RID_SCDLG_NAMES_PASTE ) ), : ModalDialog( pParent, ScResId( RID_SCDLG_NAMES_PASTE ) ),
aLabelText ( this, ScResId( FT_LABEL ) ), maHelpButton ( this, ScResId( BTN_HELP ) ),
aNameList ( this, ScResId( LB_ENTRYLIST ) ), maBtnClose ( this, ScResId( BTN_CLOSE ) ),
aOKButton ( this, ScResId( BTN_OK ) ), maBtnPaste ( this, ScResId( BTN_PASTE ) ),
aCancelButton ( this, ScResId( BTN_CANCEL ) ), maBtnPasteAll ( this, ScResId( BTN_PASTE_ALL ) )
aHelpButton ( this, ScResId( BTN_HELP ) ),
aInsListButton ( this, ScResId( BTN_ADD ) )
{ {
if( ! bInsList )
aInsListButton.Disable();
aInsListButton.SetClickHdl( LINK( this,ScNamePasteDlg,ButtonHdl) ); maBtnPaste.SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl) );
aOKButton.SetClickHdl( LINK( this,ScNamePasteDlg,ButtonHdl) ); maBtnPasteAll.SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl));
aNameList.SetSelectHdl( LINK( this,ScNamePasteDlg,ListSelHdl) ); maBtnClose.SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl));
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 );
FreeResource(); FreeResource();
} }
...@@ -83,49 +62,27 @@ ScNamePasteDlg::ScNamePasteDlg( Window * pParent, const ScRangeName* pList, cons ...@@ -83,49 +62,27 @@ ScNamePasteDlg::ScNamePasteDlg( Window * pParent, const ScRangeName* pList, cons
IMPL_LINK( ScNamePasteDlg, ButtonHdl, Button *, pButton ) IMPL_LINK( ScNamePasteDlg, ButtonHdl, Button *, pButton )
{ {
if( pButton == &aInsListButton ) if( pButton == &maBtnPasteAll )
{ {
EndDialog( BTN_PASTE_LIST ); EndDialog( BTN_PASTE_LIST );
} }
else if( pButton == &aOKButton ) else if( pButton == &maBtnPaste )
{ {
EndDialog( BTN_PASTE_NAME ); EndDialog( BTN_PASTE_NAME );
} }
return 0; else if( pButton == &maBtnClose )
}
//------------------------------------------------------------------
IMPL_LINK( ScNamePasteDlg, ListSelHdl, ListBox *, pListBox )
{
if( pListBox == &aNameList )
{
if( aNameList.GetSelectEntryCount() )
aOKButton.Enable();
else
aOKButton.Disable();
}
return 0;
}
//------------------------------------------------------------------
IMPL_LINK_INLINE_START( ScNamePasteDlg, ListDblClickHdl, ListBox *, pListBox )
{
if( pListBox == &aNameList )
{ {
ButtonHdl( &aOKButton ); EndDialog( BTN_PASTE_CLOSE );
} }
return 0; return 0;
} }
IMPL_LINK_INLINE_END( ScNamePasteDlg, ListDblClickHdl, ListBox *, pListBox )
//------------------------------------------------------------------ //------------------------------------------------------------------
std::vector<rtl::OUString> ScNamePasteDlg::GetSelectedNames() const std::vector<rtl::OUString> ScNamePasteDlg::GetSelectedNames() const
{ {
std::vector<rtl::OUString> aSelectedNames; std::vector<rtl::OUString> aSelectedNames;
aSelectedNames.push_back(aNameList.GetSelectEntry()); //aSelectedNames.push_back(aNameList.GetSelectEntry());
return aSelectedNames; return aSelectedNames;
} }
......
...@@ -1413,52 +1413,36 @@ ModalDialog RID_SCDLG_NAMES_PASTE ...@@ -1413,52 +1413,36 @@ ModalDialog RID_SCDLG_NAMES_PASTE
OutputSize = TRUE ; OutputSize = TRUE ;
HelpId = CMD_FID_INSERT_NAME ; HelpId = CMD_FID_INSERT_NAME ;
SVLook = TRUE ; SVLook = TRUE ;
Size = MAP_APPFONT ( 228 , 85 ) ; Size = MAP_APPFONT ( 228 , 140 ) ;
Moveable = TRUE ; Moveable = TRUE ;
FixedText FT_LABEL HelpButton BTN_HELP
{
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 ) ; Pos = MAP_APPFONT ( 6, 120 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ; Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ; TabStop = TRUE ;
DefButton = TRUE ;
}; };
CancelButton BTN_CANCEL PushButton BTN_PASTE
{ {
Pos = MAP_APPFONT ( 172 , 21 ) ; Pos = MAP_APPFONT ( 172 , 90 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ; Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ; TabStop = TRUE ;
Text [en-US] = "Paste";
}; };
HelpButton BTN_HELP PushButton BTN_PASTE_ALL
{ {
Pos = MAP_APPFONT ( 172 , 41 ) ; Pos = MAP_APPFONT ( 6 , 90 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ; Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ; TabStop = TRUE ;
Text [en-US] = "Paste All";
}; };
PushButton BTN_ADD PushButton BTN_CLOSE
{ {
HelpID = "sc:PushButton:RID_SCDLG_NAMES_PASTE:BTN_ADD"; Pos = MAP_APPFONT ( 172 , 120 ) ;
Pos = MAP_APPFONT ( 172 , 66 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ; Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ; TabStop = TRUE ;
Text [ en-US ] = "Insert ~All" ; Text [en-US] = "Close";
}; };
Text [ en-US ] = "Insert Name" ; Text [ en-US ] = "Paste Names" ;
}; };
ModalDialog RID_SCDLG_CHARTCOLROW ModalDialog RID_SCDLG_CHARTCOLROW
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment