diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-12-19 10:19:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-12-19 15:23:15 +0000 |
commit | 8c2da9a4ba786b08d1aa07e01060bbf1eb9f167f (patch) | |
tree | 1f1b16e4027a36d8fce1a569b8358f108781c082 | |
parent | da5390f5613c2daa18f0f30760e47e7a102694df (diff) |
split out custom info page and convert to .ui
Change-Id: I4353c839f6b081fcffd33edb2eb6722e91379cf5
-rw-r--r-- | sfx2/UI_sfx.mk | 1 | ||||
-rw-r--r-- | sfx2/inc/sfx2/dinfdlg.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 30 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.hrc | 1 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.src | 75 | ||||
-rw-r--r-- | sfx2/source/inc/sfxlocal.hrc | 1 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/custominfopage.ui | 58 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/documentproperties.ui | 162 |
8 files changed, 115 insertions, 217 deletions
diff --git a/sfx2/UI_sfx.mk b/sfx2/UI_sfx.mk index c1923c10d420..6d50bc8221af 100644 --- a/sfx2/UI_sfx.mk +++ b/sfx2/UI_sfx.mk @@ -11,6 +11,7 @@ $(eval $(call gb_UI_UI,sfx)) $(eval $(call gb_UI_add_uifiles,sfx,\ sfx2/uiconfig/ui/checkin \ + sfx2/uiconfig/ui/custominfopage \ sfx2/uiconfig/ui/descriptioninfopage \ sfx2/uiconfig/ui/documentinfopage \ sfx2/uiconfig/ui/internetinfopage \ diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx index abb3e495eae5..3bd64daee6a9 100644 --- a/sfx2/inc/sfx2/dinfdlg.hxx +++ b/sfx2/inc/sfx2/dinfdlg.hxx @@ -526,9 +526,7 @@ public: class SfxCustomPropertiesPage : public SfxTabPage { private: - CustomPropertiesControl m_aPropertiesCtrl; - PushButton m_aAddBtn; - FixedText m_aPropertiesFT; // Sym2_5121----, Moved by Steve Yin + CustomPropertiesControl* m_pPropertiesCtrl; DECL_LINK(AddHdl, void *); diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index bd008f7c7786..d83528116f31 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -2228,6 +2228,12 @@ CustomPropertiesControl::CustomPropertiesControl( Window* pParent, const ResId& m_aVertScroll.SetScrollHdl( aScrollLink ); } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeCustomPropertiesControl(Window *pParent, + VclBuilder::stringmap &) +{ + return new CustomPropertiesControl(pParent, SfxResId(SFX_CTRL_CUSTOM_PROPERTIES)); +} + CustomPropertiesControl::~CustomPropertiesControl() { } @@ -2258,23 +2264,17 @@ void CustomPropertiesControl::AddLine( const ::rtl::OUString& sName, Any& rAny, } // class SfxCustomPropertiesPage ----------------------------------------- -SfxCustomPropertiesPage::SfxCustomPropertiesPage( Window* pParent, const SfxItemSet& rItemSet ) : - - SfxTabPage( pParent, SfxResId( TP_CUSTOMPROPERTIES ), rItemSet ), - m_aPropertiesCtrl ( this, SfxResId( CTRL_PROPERTIES ) ), - m_aAddBtn ( this, SfxResId( BTN_ADD ) ), - m_aPropertiesFT ( this, SfxResId( FT_PROPERTIES ) ) - +SfxCustomPropertiesPage::SfxCustomPropertiesPage( Window* pParent, const SfxItemSet& rItemSet ) + : SfxTabPage(pParent, "CustomInfoPage", "sfx/ui/custominfopage.ui", rItemSet) { - FreeResource(); - - m_aAddBtn.SetClickHdl( LINK( this, SfxCustomPropertiesPage, AddHdl ) ); + get(m_pPropertiesCtrl, "properties"); + get<PushButton>("add")->SetClickHdl(LINK(this, SfxCustomPropertiesPage, AddHdl)); } IMPL_LINK_NOARG(SfxCustomPropertiesPage, AddHdl) { Any aAny; - m_aPropertiesCtrl.AddLine( ::rtl::OUString(), aAny, true ); + m_pPropertiesCtrl->AddLine( ::rtl::OUString(), aAny, true ); return 0; } @@ -2300,7 +2300,7 @@ sal_Bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet& rSet ) if ( pInfo ) { pInfo->ClearCustomProperties(); - Sequence< beans::PropertyValue > aPropertySeq = m_aPropertiesCtrl.GetCustomProperties(); + Sequence< beans::PropertyValue > aPropertySeq = m_pPropertiesCtrl->GetCustomProperties(); sal_Int32 i = 0, nCount = aPropertySeq.getLength(); for ( ; i < nCount; ++i ) { @@ -2319,19 +2319,19 @@ sal_Bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet& rSet ) void SfxCustomPropertiesPage::Reset( const SfxItemSet& rItemSet ) { - m_aPropertiesCtrl.ClearAllLines(); + m_pPropertiesCtrl->ClearAllLines(); const SfxDocumentInfoItem* m_pInfoItem = &(const SfxDocumentInfoItem &)rItemSet.Get(SID_DOCINFO); std::vector< CustomProperty* > aCustomProps = m_pInfoItem->GetCustomProperties(); for ( sal_uInt32 i = 0; i < aCustomProps.size(); i++ ) { - m_aPropertiesCtrl.AddLine( aCustomProps[i]->m_sName, aCustomProps[i]->m_aValue, false ); + m_pPropertiesCtrl->AddLine( aCustomProps[i]->m_sName, aCustomProps[i]->m_aValue, false ); } } int SfxCustomPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ ) { int nRet = LEAVE_PAGE; - if ( !m_aPropertiesCtrl.AreAllLinesValid() ) + if ( !m_pPropertiesCtrl->AreAllLinesValid() ) nRet = KEEP_PAGE; return nRet; } diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc index 94b753c0829c..2df47b86a363 100644 --- a/sfx2/source/dialog/dinfdlg.hrc +++ b/sfx2/source/dialog/dinfdlg.hrc @@ -45,7 +45,6 @@ #define WIN_PROPERTIES 90 #define SB_VERTICAL 91 #define FT_PROPERTIES 92 -#define CTRL_PROPERTIES 93 #define BTN_ADD 94 #define RB_PROPERTY_YES 100 #define RB_PROPERTY_NO 101 diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src index 3835a3deafa1..007a6d223500 100644 --- a/sfx2/source/dialog/dinfdlg.src +++ b/sfx2/source/dialog/dinfdlg.src @@ -101,6 +101,44 @@ TabPage TP_DOCINFOUSER }; }; +Control SFX_CTRL_CUSTOM_PROPERTIES +{ + HelpId = HID_CTRL_CUSTOMPROPERTIES; + Pos = MAP_APPFONT ( 6 , 18 ) ; + Size = MAP_APPFONT ( 248 , 141 ) ; + Border = TRUE; + DialogControl = TRUE; + Window WIN_PROPERTIES + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 0 , 10 ) ; + Size = MAP_APPFONT ( 240 , 134 ) ; + DialogControl = TRUE; + }; + ScrollBar SB_VERTICAL + { + Pos = MAP_APPFONT ( 238 , 10 ) ; + Size = MAP_APPFONT ( 8 , 129 ) ; + VScroll = TRUE; + }; + String STR_HEADER_NAME + { + Text [ en-US ] = "Name" ; + }; + String STR_HEADER_TYPE + { + Text [ en-US ] = "Type" ; + }; + String STR_HEADER_VALUE + { + Text [ en-US ] = "Value" ; + }; + String STR_HEADER_ACTION + { + Text [ en-US ] = "" ; + }; +}; + // TP_CUSTOMPROPERTIES --------------------------------------------------- TabPage TP_CUSTOMPROPERTIES @@ -115,43 +153,6 @@ TabPage TP_CUSTOMPROPERTIES Left = TRUE ; Text [ en-US ] = "~Properties" ; }; - Control CTRL_PROPERTIES - { - HelpId = HID_CTRL_CUSTOMPROPERTIES; - Pos = MAP_APPFONT ( 6 , 18 ) ; - Size = MAP_APPFONT ( 248 , 141 ) ; - Border = TRUE; - DialogControl = TRUE; - Window WIN_PROPERTIES - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 0 , 10 ) ; - Size = MAP_APPFONT ( 240 , 134 ) ; - DialogControl = TRUE; - }; - ScrollBar SB_VERTICAL - { - Pos = MAP_APPFONT ( 238 , 10 ) ; - Size = MAP_APPFONT ( 8 , 129 ) ; - VScroll = TRUE; - }; - String STR_HEADER_NAME - { - Text [ en-US ] = "Name" ; - }; - String STR_HEADER_TYPE - { - Text [ en-US ] = "Type" ; - }; - String STR_HEADER_VALUE - { - Text [ en-US ] = "Value" ; - }; - String STR_HEADER_ACTION - { - Text [ en-US ] = "" ; - }; - }; PushButton BTN_ADD { HelpID = "sfx2:PushButton:TP_CUSTOMPROPERTIES:BTN_ADD"; diff --git a/sfx2/source/inc/sfxlocal.hrc b/sfx2/source/inc/sfxlocal.hrc index 2a3cbcb631ab..134f9bb5987c 100644 --- a/sfx2/source/inc/sfxlocal.hrc +++ b/sfx2/source/inc/sfxlocal.hrc @@ -48,6 +48,7 @@ #define SFX_FLD_TIME (RID_SFX_SFXLOCAL_START + 11) #define SFX_FLD_DURATION (RID_SFX_SFXLOCAL_START + 12) #define SFX_ST_DURATION_FORMAT (RID_SFX_SFXLOCAL_START + 13) +#define SFX_CTRL_CUSTOM_PROPERTIES (RID_SFX_SFXLOCAL_START + 14) // Images ---------------------------------------------------------------- diff --git a/sfx2/uiconfig/ui/custominfopage.ui b/sfx2/uiconfig/ui/custominfopage.ui new file mode 100644 index 000000000000..fe4f2076ac19 --- /dev/null +++ b/sfx2/uiconfig/ui/custominfopage.ui @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkGrid" id="grid12"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row_spacing">12</property> + <child> + <object class="GtkLabel" id="label56"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes">_Properties</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="add"> + <property name="label">gtk-add</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="halign">end</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="sfxlo:CustomPropertiesControl" id="properties"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> +</interface> diff --git a/sfx2/uiconfig/ui/documentproperties.ui b/sfx2/uiconfig/ui/documentproperties.ui index 34071734df8c..946e0ae7c568 100644 --- a/sfx2/uiconfig/ui/documentproperties.ui +++ b/sfx2/uiconfig/ui/documentproperties.ui @@ -40,167 +40,7 @@ </packing> </child> <child> - <object class="GtkGrid" id="grid12"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">18</property> - <property name="column_spacing">10</property> - <child> - <object class="GtkLabel" id="label56"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="label" translatable="yes">Properties</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkButtonBox" id="buttonbox2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="homogeneous">True</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="add"> - <property name="label">gtk-add</property> - <property name="use_action_appearance">False</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkGrid" id="grid13"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkScrolledWindow" id="scrolledwindow2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="shadow_type">in</property> - <child> - <placeholder/> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkGrid" id="grid14"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">9</property> - <property name="column_spacing">10</property> - <child> - <object class="GtkLabel" id="label57"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_left">1</property> - <property name="margin_right">1</property> - <property name="margin_top">1</property> - <property name="margin_bottom">1</property> - <property name="label" translatable="yes">Name </property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label58"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_left">1</property> - <property name="margin_right">1</property> - <property name="margin_top">1</property> - <property name="margin_bottom">1</property> - <property name="label" translatable="yes">Type </property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label59"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_left">1</property> - <property name="margin_right">1</property> - <property name="margin_top">1</property> - <property name="margin_bottom">1</property> - <property name="label" translatable="yes">Value </property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label60"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes"> </property> - </object> - <packing> - <property name="left_attach">3</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">2</property> - </packing> + <placeholder/> </child> <child type="tab"> <object class="GtkLabel" id="label55"> |