diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-12-01 12:01:48 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:06 +0100 |
commit | 3aaeca4c1b7a67fc33208fdf63d30de8af53049e (patch) | |
tree | e000f5a2dce5189383bb9f5f6e1bfe1a5f124e14 /sfx2 | |
parent | 16a9873a6f29ed89e5fadaef867f87a9322b2b0b (diff) |
make SfxTabDialog layout buttons with button-box
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/tabdlg.hxx | 21 | ||||
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 70 |
2 files changed, 59 insertions, 32 deletions
diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx index 9d86b92b5f22..69fd8c2b61cf 100644 --- a/sfx2/inc/sfx2/tabdlg.hxx +++ b/sfx2/inc/sfx2/tabdlg.hxx @@ -22,9 +22,10 @@ #include "sal/config.h" #include "sfx2/dllapi.h" #include "sal/types.h" -#include <vcl/tabdlg.hxx> #include <vcl/button.hxx> +#include <vcl/layout.hxx> #include <vcl/tabctrl.hxx> +#include <vcl/tabdlg.hxx> #include <vcl/tabpage.hxx> #include <svl/itempool.hxx> #include <svl/itemset.hxx> @@ -64,13 +65,17 @@ friend class SfxTabDialogController; SfxViewFrame* pFrame; - TabControl aTabCtrl; - OKButton aOKBtn; - PushButton* pUserBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; - PushButton aResetBtn; - PushButton aBaseFmtBtn; + VBox vbox; + VBox content_area; + TabControl aTabCtrl; + + HButtonBox action_area; + OKButton aOKBtn; + PushButton* pUserBtn; + CancelButton aCancelBtn; + HelpButton aHelpBtn; + PushButton aResetBtn; + PushButton aBaseFmtBtn; const SfxItemSet* pSet; SfxItemSet* pOutSet; diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index bd36b8c8561e..f8f02ab211f1 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -384,22 +384,25 @@ void SfxTabPage::AddItemConnection( sfx::ItemConnectionBase* pConnection ) } #define INI_LIST(ItemSetPtr) \ - aTabCtrl ( this, ResId(ID_TABCONTROL,*rResId.GetResMgr() ) ),\ - aOKBtn ( this ),\ - pUserBtn ( pUserButtonText? new PushButton(this): 0 ),\ - aCancelBtn ( this ),\ - aHelpBtn ( this ),\ - aResetBtn ( this ),\ - aBaseFmtBtn ( this ),\ - pSet ( ItemSetPtr ),\ - pOutSet ( 0 ),\ - pImpl ( new TabDlg_Impl( (sal_uInt8)aTabCtrl.GetPageCount() ) ), \ - pRanges ( 0 ), \ - nResId ( rResId.GetId() ), \ - nAppPageId ( USHRT_MAX ), \ - bItemsReset ( sal_False ),\ - bFmt ( bEditFmt ),\ - pExampleSet ( 0 ) + vbox(this, false, 7) \ + , content_area(&vbox) \ + , aTabCtrl(&content_area, ResId(ID_TABCONTROL,*rResId.GetResMgr())) \ + , action_area(&vbox) \ + , aOKBtn(&action_area) \ + , pUserBtn(pUserButtonText? new PushButton(&action_area): 0) \ + , aCancelBtn(&action_area) \ + , aHelpBtn(&action_area) \ + , aResetBtn(&action_area) \ + , aBaseFmtBtn(&action_area) \ + , pSet(ItemSetPtr) \ + , pOutSet(0) \ + , pImpl(new TabDlg_Impl( (sal_uInt8)aTabCtrl.GetPageCount() )) \ + , pRanges(0) \ + , nResId(rResId.GetId()) \ + , nAppPageId(USHRT_MAX) \ + , bItemsReset(sal_False) \ + , bFmt(bEditFmt)\ + , pExampleSet(0) // ----------------------------------------------------------------------- @@ -420,10 +423,10 @@ SfxTabDialog::SfxTabDialog // when yes -> additional Button for standard const String* pUserButtonText // Text for UserButton; // if != 0, the UserButton is created -) : - TabDialog( pParent, rResId ), - pFrame( pViewFrame ), - INI_LIST(pItemSet) +) + : TabDialog(pParent, rResId) + , pFrame(pViewFrame) + , INI_LIST(pItemSet) { Init_Impl( bFmt, pUserButtonText ); } @@ -446,10 +449,10 @@ SfxTabDialog::SfxTabDialog // when yes -> additional Button for standard const String* pUserButtonText // Text for UserButton; // if != 0, the UserButton is created -) : - TabDialog( pParent, rResId ), - pFrame( 0 ), - INI_LIST(pItemSet) +) + : TabDialog(pParent, rResId) + , pFrame(0) + , INI_LIST(pItemSet) { Init_Impl( bFmt, pUserButtonText ); DBG_WARNING( "Please use the Construtor with the ViewFrame" ); @@ -505,6 +508,25 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText ) */ { + rtl::OString sFill(RTL_CONSTASCII_STRINGPARAM("fill")); + rtl::OString sExpand(RTL_CONSTASCII_STRINGPARAM("expand")); + rtl::OString sPackType(RTL_CONSTASCII_STRINGPARAM("pack-type")); + rtl::OString sBorderWidth(RTL_CONSTASCII_STRINGPARAM("border-width")); + + vbox.setChildProperty(sFill, true); + //TO-DO, when vcontent_area belongs to dialog via builder, this becomes + //content-area-border on the dialog + vbox.setChildProperty(sBorderWidth, sal_Int32(7)); + + action_area.setChildProperty(sFill, true); + + content_area.setChildProperty(sFill, true); + content_area.setChildProperty(sExpand, true); + + aTabCtrl.setChildProperty(sFill, true); + aTabCtrl.setChildProperty(sExpand, true); + aTabCtrl.SetControlBackground(Color(0xff, 0x00, 0x00)); + aOKBtn.SetClickHdl( LINK( this, SfxTabDialog, OkHdl ) ); aCancelBtn.SetClickHdl( LINK( this, SfxTabDialog, CancelHdl ) ); aResetBtn.SetClickHdl( LINK( this, SfxTabDialog, ResetHdl ) ); |