diff options
author | Jack Leigh <leighman@gmx.se> | 2012-10-11 23:47:56 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-12 16:33:42 +0100 |
commit | 5cb6877206c459530caa104b34e494badab5a4d1 (patch) | |
tree | fa876a7f94b5b5d6b8f895c68dd0ee873584fae7 /cui/source | |
parent | 53acdd29e32707eb4ad6e922b47e1c1216f9d7d6 (diff) |
migrate 'Insert OLE Object' dialog to use .ui file
Change-Id: If2a241e34f88a39bacee5344f89893e3ccfdc57d
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/dialogs/insdlg.cxx | 56 | ||||
-rw-r--r-- | cui/source/dialogs/svuidlg.hrc | 7 | ||||
-rw-r--r-- | cui/source/dialogs/svuidlg.src | 80 | ||||
-rw-r--r-- | cui/source/inc/insdlg.hxx | 49 |
4 files changed, 47 insertions, 145 deletions
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index 43786ca67ede..b3a10cb1e57f 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -42,6 +42,7 @@ #include <vcl/button.hxx> #include <vcl/fixed.hxx> #include <vcl/group.hxx> +#include <vcl/layout.hxx> #include <vcl/lstbox.hxx> #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> @@ -151,7 +152,7 @@ IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl) { Sequence< OUString > aPathSeq( xFilePicker->getFiles() ); INetURLObject aObj( aPathSeq[0] ); - aEdFilepath.SetText( aObj.PathToFileName() ); + m_pEdFilepath->SetText( aObj.PathToFileName() ); } } } @@ -163,22 +164,15 @@ IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl) IMPL_LINK_NOARG(SvInsertOleDlg, RadioHdl) { - if ( aRbNewObject.IsChecked() ) + if ( m_pRbNewObject->IsChecked() ) { - aLbObjecttype.Show(); - aEdFilepath.Hide(); - aBtnFilepath.Hide(); - aCbFilelink.Hide(); - aGbObject.SetText( _aOldStr ); + m_pObjectTypeFrame->Show(); + m_pFileFrame->Hide(); } else { - aCbFilelink.Show(); - aLbObjecttype.Hide(); - aEdFilepath.Show(); - aBtnFilepath.Show(); - aCbFilelink.Show(); - aGbObject.SetText( aStrFile ); + m_pFileFrame->Show(); + m_pObjectTypeFrame->Hide(); } return 0; } @@ -187,7 +181,7 @@ IMPL_LINK_NOARG(SvInsertOleDlg, RadioHdl) void SvInsertOleDlg::SelectDefault() { - aLbObjecttype.SelectEntryPos( 0 ); + m_pLbObjecttype->SelectEntryPos(0); } // ----------------------------------------------------------------------- @@ -197,30 +191,24 @@ SvInsertOleDlg::SvInsertOleDlg const Reference < embed::XStorage >& xStorage, const SvObjectServerList* pServers ) - : InsertObjectDialog_Impl( pParent, CUI_RES( MD_INSERT_OLEOBJECT ), xStorage ), - aRbNewObject( this, CUI_RES( RB_NEW_OBJECT ) ), - aRbObjectFromfile( this, CUI_RES( RB_OBJECT_FROMFILE ) ), - aGbObject( this, CUI_RES( GB_OBJECT ) ), - aLbObjecttype( this, CUI_RES( LB_OBJECTTYPE ) ), - aEdFilepath( this, CUI_RES( ED_FILEPATH ) ), - aBtnFilepath( this, CUI_RES( BTN_FILEPATH ) ), - aCbFilelink( this, CUI_RES( CB_FILELINK ) ), - aOKButton1( this, CUI_RES( 1 ) ), - aCancelButton1( this, CUI_RES( 1 ) ), - aHelpButton1( this, CUI_RES( 1 ) ), - aStrFile( CUI_RES( STR_FILE ) ), + : InsertObjectDialog_Impl( pParent, "InsertOLEObjectDialog", "cui/ui/insertoleobject.ui", xStorage ), m_pServers( pServers ) { - FreeResource(); - _aOldStr = aGbObject.GetText(); - aLbObjecttype.SetDoubleClickHdl( LINK( this, SvInsertOleDlg, DoubleClickHdl ) ); - aBtnFilepath.SetClickHdl( LINK( this, SvInsertOleDlg, BrowseHdl ) ); + get(m_pRbNewObject, "createnew"); + get(m_pRbObjectFromfile, "createfromfile"); + get(m_pObjectTypeFrame, "objecttypeframe"); + get(m_pLbObjecttype, "types"); + get(m_pFileFrame, "fileframe"); + get(m_pEdFilepath, "urled"); + get(m_pBtnFilepath, "urlbtn"); + get(m_pCbFilelink, "linktofile"); + m_pLbObjecttype->SetDoubleClickHdl( LINK( this, SvInsertOleDlg, DoubleClickHdl ) ); + m_pBtnFilepath->SetClickHdl( LINK( this, SvInsertOleDlg, BrowseHdl ) ); Link aLink( LINK( this, SvInsertOleDlg, RadioHdl ) ); - aRbNewObject.SetClickHdl( aLink ); - aRbObjectFromfile.SetClickHdl( aLink ); - aRbNewObject.Check( sal_True ); + m_pRbNewObject->SetClickHdl( aLink ); + m_pRbObjectFromfile->SetClickHdl( aLink ); + m_pRbNewObject->Check( sal_True ); RadioHdl( NULL ); - aBtnFilepath.SetAccessibleRelationMemberOf(&aGbObject); } short SvInsertOleDlg::Execute() diff --git a/cui/source/dialogs/svuidlg.hrc b/cui/source/dialogs/svuidlg.hrc index 17e3ad4ad44e..e2d69f463507 100644 --- a/cui/source/dialogs/svuidlg.hrc +++ b/cui/source/dialogs/svuidlg.hrc @@ -83,13 +83,6 @@ #define ED_APPLET_OPTIONS 20 #define GB_APPLET_OPTIONS 21 -#define MD_INSERT_OLEOBJECT 32010 -#define RB_NEW_OBJECT 10 -#define RB_OBJECT_FROMFILE 11 -#define LB_OBJECTTYPE 12 -#define GB_OBJECT 13 -#define STR_FILE 14 - #define MD_INSERT_OBJECT_IFRAME 32011 #define FT_FRAMENAME 3 #define ED_FRAMENAME 4 diff --git a/cui/source/dialogs/svuidlg.src b/cui/source/dialogs/svuidlg.src index af30d3a71a94..7c5bce2cc91d 100644 --- a/cui/source/dialogs/svuidlg.src +++ b/cui/source/dialogs/svuidlg.src @@ -305,86 +305,6 @@ ModalDialog MD_LINKEDIT Text [ en-US ] = "Edit" ; }; }; -ModalDialog MD_INSERT_OLEOBJECT -{ - HelpID = "cui:ModalDialog:MD_INSERT_OLEOBJECT"; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 284 , 105 ) ; - Moveable = TRUE ; - RadioButton RB_NEW_OBJECT - { - HelpID = "cui:RadioButton:MD_INSERT_OLEOBJECT:RB_NEW_OBJECT"; - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 81 , 10 ) ; - Text [ en-US ] = "~Create new" ; - }; - RadioButton RB_OBJECT_FROMFILE - { - HelpID = "cui:RadioButton:MD_INSERT_OLEOBJECT:RB_OBJECT_FROMFILE"; - Pos = MAP_APPFONT ( 90 , 6 ) ; - Size = MAP_APPFONT ( 81 , 10 ) ; - Text [ en-US ] = "Create from ~file" ; - }; - ListBox LB_OBJECTTYPE - { - HelpID = "cui:ListBox:MD_INSERT_OLEOBJECT:LB_OBJECTTYPE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 33 ) ; - Size = MAP_APPFONT ( 204 , 60 ) ; - }; - Edit ED_FILEPATH - { - HelpID = "cui:Edit:MD_INSERT_OLEOBJECT:ED_FILEPATH"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 33 ) ; - Size = MAP_APPFONT ( 204 , 12 ) ; - }; - PushButton BTN_FILEPATH - { - HelpID = "cui:PushButton:MD_INSERT_OLEOBJECT:BTN_FILEPATH"; - Pos = MAP_APPFONT ( 166 , 48 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Search..." ; - }; - CheckBox CB_FILELINK - { - HelpID = "cui:CheckBox:MD_INSERT_OLEOBJECT:CB_FILELINK"; - Pos = MAP_APPFONT ( 12 , 48 ) ; - Size = MAP_APPFONT ( 138 , 10 ) ; - Text [ en-US ] = "~Link to file" ; - }; - FixedLine GB_OBJECT - { - Pos = MAP_APPFONT ( 6 , 22 ) ; - Size = MAP_APPFONT ( 216 , 8 ) ; - Text [ en-US ] = "Object type" ; - }; - OKButton 1 - { - Pos = MAP_APPFONT ( 228 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE ; - TabStop = TRUE ; - }; - CancelButton 1 - { - Pos = MAP_APPFONT ( 228 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton 1 - { - Pos = MAP_APPFONT ( 228 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - String STR_FILE - { - Text [ en-US ] = "File" ; - }; - Text [ en-US ] = "Insert OLE Object" ; -}; ModalDialog MD_INSERT_OBJECT_APPLET { HelpID = "cui:ModalDialog:MD_INSERT_OBJECT_APPLET"; diff --git a/cui/source/inc/insdlg.hxx b/cui/source/inc/insdlg.hxx index 27ebff9acf74..c4486c98de1a 100644 --- a/cui/source/inc/insdlg.hxx +++ b/cui/source/inc/insdlg.hxx @@ -33,6 +33,8 @@ #include <svtools/svmedit.hxx> // MultiLineEdit #include <comphelper/embeddedobjectcontainer.hxx> +class VclFrame; + class INetURLObject; class InsertObjectDialog_Impl : public ModalDialog @@ -55,38 +57,37 @@ public: class SvInsertOleDlg : public InsertObjectDialog_Impl { - RadioButton aRbNewObject; - RadioButton aRbObjectFromfile; - FixedLine aGbObject; - ListBox aLbObjecttype; - Edit aEdFilepath; - PushButton aBtnFilepath; - CheckBox aCbFilelink; - OKButton aOKButton1; - CancelButton aCancelButton1; - HelpButton aHelpButton1; - String aStrFile; - String _aOldStr; + RadioButton* m_pRbNewObject; + RadioButton* m_pRbObjectFromfile; + VclFrame* m_pObjectTypeFrame; + ListBox* m_pLbObjecttype; + VclFrame* m_pFileFrame; + Edit* m_pEdFilepath; + PushButton* m_pBtnFilepath; + CheckBox* m_pCbFilelink; const SvObjectServerList* m_pServers; ::com::sun::star::uno::Sequence< sal_Int8 > m_aIconMetaFile; - ::rtl::OUString m_aIconMediaType; + OUString m_aIconMediaType; - DECL_LINK( DoubleClickHdl, void* ); + DECL_LINK(DoubleClickHdl, void*); DECL_LINK(BrowseHdl, void *); DECL_LINK(RadioHdl, void *); - void SelectDefault(); - ListBox& GetObjectTypes() - { return aLbObjecttype; } - String GetFilePath() const { return aEdFilepath.GetText(); } - sal_Bool IsLinked() const { return aCbFilelink.IsChecked(); } - sal_Bool IsCreateNew() const { return aRbNewObject.IsChecked(); } + void SelectDefault(); + ListBox& GetObjectTypes() + { return *m_pLbObjecttype; } + OUString GetFilePath() const + { return m_pEdFilepath->GetText(); } + sal_Bool IsLinked() const + { return m_pCbFilelink->IsChecked(); } + sal_Bool IsCreateNew() const + { return m_pRbNewObject->IsChecked(); } public: - SvInsertOleDlg( Window* pParent, - const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage, - const SvObjectServerList* pServers = NULL ); - virtual short Execute(); + SvInsertOleDlg( Window* pParent, + const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage, + const SvObjectServerList* pServers = NULL ); + virtual short Execute(); /// get replacement for the iconified embedded object and the mediatype of the replacement ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( ::rtl::OUString* pGraphicMediaType ); |