sc/UIConfig_scalc.mk | 1 sc/inc/sc.hrc | 2 sc/inc/scabstdlg.hxx | 2 sc/source/ui/attrdlg/scdlgfact.cxx | 17 ---- sc/source/ui/attrdlg/scdlgfact.hxx | 2 sc/source/ui/inc/shtabdlg.hxx | 12 +-- sc/source/ui/miscdlgs/shtabdlg.cxx | 41 ++++------ sc/source/ui/src/miscdlgs.src | 47 ----------- sc/source/ui/view/tabvwsh3.cxx | 2 sc/source/ui/view/tabvwshf.cxx | 2 sc/uiconfig/scalc/ui/showsheetdialog.ui | 126 ++++++++++++++++++++++++++++++++ 11 files changed, 154 insertions(+), 100 deletions(-)
New commits: commit 3b385c20d8c50e11ef02006f0dab4fd8cf360e5b Author: Caolán McNamara <caol...@redhat.com> Date: Thu Dec 19 20:49:34 2013 +0000 convert show sheets dialog to .ui Change-Id: Ia32aa742b426872c6634a431170c441ae3c8c963 diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 248e8b1..77e54f4 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -124,6 +124,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/sharedocumentdlg \ sc/uiconfig/scalc/ui/sharedfooterdialog \ sc/uiconfig/scalc/ui/sharedheaderdialog \ + sc/uiconfig/scalc/ui/showsheetdialog \ sc/uiconfig/scalc/ui/sidebaralignment \ sc/uiconfig/scalc/ui/sidebarnumberformat \ sc/uiconfig/scalc/ui/sidebarcellappearance \ diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index e757185..c22b064 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1063,8 +1063,6 @@ // derivations from RID_SCDLG_SELENTRY -#define RID_SCDLG_SHOW_TAB (SC_DIALOGS_START + 109) - #define RID_SCPAGE_CONTENT (SC_DIALOGS_START + 113) #define RID_SCPAGE_LAYOUT (SC_DIALOGS_START + 114) diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 70bf915..371a362 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -452,7 +452,7 @@ public: virtual AbstractScNewScenarioDlg * CreateScNewScenarioDlg ( Window* pParent, const OUString& rName, int nId, sal_Bool bEdit = false, sal_Bool bSheetProtected = false ) = 0; - virtual AbstractScShowTabDlg * CreateScShowTabDlg ( Window* pParent, int nId ) = 0; + virtual AbstractScShowTabDlg * CreateScShowTabDlg(Window* pParent) = 0; virtual AbstractScStringInputDlg * CreateScStringInputDlg ( Window* pParent, const OUString& rTitle, diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 931de9f..8df625b 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -1004,21 +1004,10 @@ AbstractScNewScenarioDlg * ScAbstractDialogFactory_Impl::CreateScNewScenarioDlg return 0; } -AbstractScShowTabDlg * ScAbstractDialogFactory_Impl::CreateScShowTabDlg ( Window* pParent, int nId ) +AbstractScShowTabDlg * ScAbstractDialogFactory_Impl::CreateScShowTabDlg(Window* pParent) { - ScShowTabDlg * pDlg=NULL; - switch ( nId ) - { - case RID_SCDLG_SHOW_TAB : - pDlg = new ScShowTabDlg( pParent); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractScShowTabDlg_Impl( pDlg ); - return 0; + ScShowTabDlg * pDlg = new ScShowTabDlg( pParent); + return new AbstractScShowTabDlg_Impl( pDlg ); } AbstractScStringInputDlg * ScAbstractDialogFactory_Impl::CreateScStringInputDlg ( Window* pParent, diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 4b5ae12..6829114 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -521,7 +521,7 @@ public: virtual AbstractScNewScenarioDlg * CreateScNewScenarioDlg ( Window* pParent, const OUString& rName, int nId, sal_Bool bEdit = false, sal_Bool bSheetProtected = false ); - virtual AbstractScShowTabDlg * CreateScShowTabDlg ( Window* pParent, int nId ); + virtual AbstractScShowTabDlg * CreateScShowTabDlg(Window* pParent); virtual AbstractScStringInputDlg * CreateScStringInputDlg ( Window* pParent, const OUString& rTitle, diff --git a/sc/source/ui/inc/shtabdlg.hxx b/sc/source/ui/inc/shtabdlg.hxx index 326a0f4..6ba02b6 100644 --- a/sc/source/ui/inc/shtabdlg.hxx +++ b/sc/source/ui/inc/shtabdlg.hxx @@ -20,9 +20,9 @@ #ifndef SC_SHTABDLG_HXX #define SC_SHTABDLG_HXX -#include <vcl/fixed.hxx> #include <vcl/button.hxx> #include <vcl/dialog.hxx> +#include <vcl/layout.hxx> #include <vcl/lstbox.hxx> //------------------------------------------------------------------------ @@ -30,17 +30,13 @@ class ScShowTabDlg : public ModalDialog { private: - FixedText aFtLbTitle; - MultiListBox aLb; - OKButton aBtnOk; - CancelButton aBtnCancel; - HelpButton aBtnHelp; + VclFrame* m_pFrame; + ListBox* m_pLb; DECL_LINK( DblClkHdl, void * ); public: - ScShowTabDlg( Window* pParent ); - ~ScShowTabDlg(); + ScShowTabDlg( Window* pParent ); /** Sets dialog title, fixed text for listbox and help IDs. */ void SetDescription( diff --git a/sc/source/ui/miscdlgs/shtabdlg.cxx b/sc/source/ui/miscdlgs/shtabdlg.cxx index 03949ef7..cc05f1f 100644 --- a/sc/source/ui/miscdlgs/shtabdlg.cxx +++ b/sc/source/ui/miscdlgs/shtabdlg.cxx @@ -33,19 +33,16 @@ //================================================================== -ScShowTabDlg::ScShowTabDlg( Window* pParent ) : - ModalDialog ( pParent, ScResId( RID_SCDLG_SHOW_TAB ) ), - aFtLbTitle ( this, ScResId( FT_LABEL ) ), - aLb ( this, ScResId( LB_ENTRYLIST ) ), - aBtnOk ( this, ScResId( BTN_OK ) ), - aBtnCancel ( this, ScResId( BTN_CANCEL ) ), - aBtnHelp ( this, ScResId( BTN_HELP ) ) +ScShowTabDlg::ScShowTabDlg(Window* pParent) + : ModalDialog(pParent, "ShowSheetDialog", "modules/scalc/ui/showsheetdialog.ui") { - aLb.Clear(); - aLb.SetDoubleClickHdl( LINK( this, ScShowTabDlg, DblClkHdl ) ); + get(m_pFrame, "frame"); + get(m_pLb, "treeview"); - //------------- - FreeResource(); + m_pLb->Clear(); + m_pLb->EnableMultiSelection(true); + m_pLb->set_height_request(m_pLb->GetTextHeight() * 10); + m_pLb->SetDoubleClickHdl( LINK( this, ScShowTabDlg, DblClkHdl ) ); } //------------------------------------------------------------------------ @@ -54,34 +51,34 @@ void ScShowTabDlg::SetDescription( const OUString& rTitle, const OUString& rFixedText, const OString& rDlgHelpId, const OString& sLbHelpId ) { - SetText( rTitle ); - aFtLbTitle.SetText( rFixedText ); + SetText(rTitle); + m_pFrame->set_label(rFixedText); SetHelpId( rDlgHelpId ); - aLb.SetHelpId( sLbHelpId ); + m_pLb->SetHelpId( sLbHelpId ); } void ScShowTabDlg::Insert( const OUString& rString, sal_Bool bSelected ) { - aLb.InsertEntry( rString ); + m_pLb->InsertEntry( rString ); if( bSelected ) - aLb.SelectEntryPos( aLb.GetEntryCount() - 1 ); + m_pLb->SelectEntryPos( m_pLb->GetEntryCount() - 1 ); } //------------------------------------------------------------------------ sal_uInt16 ScShowTabDlg::GetSelectEntryCount() const { - return aLb.GetSelectEntryCount(); + return m_pLb->GetSelectEntryCount(); } OUString ScShowTabDlg::GetSelectEntry(sal_uInt16 nPos) const { - return aLb.GetSelectEntry(nPos); + return m_pLb->GetSelectEntry(nPos); } sal_uInt16 ScShowTabDlg::GetSelectEntryPos(sal_uInt16 nPos) const { - return aLb.GetSelectEntryPos(nPos); + return m_pLb->GetSelectEntryPos(nPos); } //------------------------------------------------------------------------ @@ -93,10 +90,4 @@ IMPL_LINK_NOARG_INLINE_START(ScShowTabDlg, DblClkHdl) } IMPL_LINK_NOARG_INLINE_END(ScShowTabDlg, DblClkHdl) -ScShowTabDlg::~ScShowTabDlg() -{ -} - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/src/miscdlgs.src b/sc/source/ui/src/miscdlgs.src index caf1eb2..479984a 100644 --- a/sc/source/ui/src/miscdlgs.src +++ b/sc/source/ui/src/miscdlgs.src @@ -496,53 +496,6 @@ ModalDialog RID_SCDLG_ROW_OPT }; }; -ModalDialog RID_SCDLG_SHOW_TAB -{ - HelpId = CMD_FID_TABLE_SHOW ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 168 , 100 ) ; - Text [ en-US ] = "Show Sheet" ; - Moveable = TRUE ; - Closeable = FALSE ; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 112 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 112 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 112 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - MultiListBox LB_ENTRYLIST - { - HelpID = "sc:MultiListBox:RID_SCDLG_SHOW_TAB:LB_ENTRYLIST"; - SimpleMode = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 19 ) ; - Size = MAP_APPFONT ( 100 , 75 ) ; - TabStop = TRUE ; - Sort = FALSE ; - }; - FixedText FT_LABEL - { - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 90 , 10 ) ; - Text [ en-US ] = "Hidden sheets" ; - }; -}; - - #define TXT_COLS \ Text [ en-US ] = "~Columns" ; \ diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 5cc58dc..aa68378 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -795,7 +795,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - AbstractScShowTabDlg* pDlg = pFact->CreateScShowTabDlg( GetDialogParent(), RID_SCDLG_SHOW_TAB); + AbstractScShowTabDlg* pDlg = pFact->CreateScShowTabDlg(GetDialogParent()); OSL_ENSURE(pDlg, "Dialog create fail!"); pDlg->SetDescription( OUString( ScResId( STR_DLG_SELECTTABLES_TITLE ) ), diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 18ab0c7..78e956b 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -131,7 +131,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - AbstractScShowTabDlg* pDlg = pFact->CreateScShowTabDlg( GetDialogParent(), RID_SCDLG_SHOW_TAB); + AbstractScShowTabDlg* pDlg = pFact->CreateScShowTabDlg(GetDialogParent()); OSL_ENSURE(pDlg, "Dialog create fail!"); OUString aTabName; diff --git a/sc/uiconfig/scalc/ui/showsheetdialog.ui b/sc/uiconfig/scalc/ui/showsheetdialog.ui new file mode 100644 index 0000000..646d76d --- /dev/null +++ b/sc/uiconfig/scalc/ui/showsheetdialog.ui @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="ShowSheetDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Show Sheet</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</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> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkTreeView" id="treeview:border"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection1"> + <property name="mode">multiple</property> + </object> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Hidden sheets</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">help</action-widget> + </action-widgets> + </object> +</interface>
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits