diff options
-rw-r--r-- | include/sfx2/basedlgs.hxx | 10 | ||||
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 12 | ||||
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/fldui.hrc | 9 | ||||
-rw-r--r-- | sw/inc/helpid.h | 7 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldedt.cxx | 77 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldpage.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldui.src | 32 | ||||
-rw-r--r-- | sw/source/ui/inc/fldedt.hxx | 10 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/editfielddialog.ui | 147 |
10 files changed, 200 insertions, 109 deletions
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx index 609d639e9ed4..11854d21c31b 100644 --- a/include/sfx2/basedlgs.hxx +++ b/include/sfx2/basedlgs.hxx @@ -181,9 +181,11 @@ typedef sal_uInt16* (*GetTabPageRanges)(); // liefert internationale Which-Werte class SFX2_DLLPUBLIC SfxSingleTabDialogBase : public SfxModalDialog { public: - //layout ctor + //layout ctors SfxSingleTabDialogBase(Window *pParent, const SfxItemSet& rOptionsSet, const OString& rID, const OUString& rUIXMLDescription); + SfxSingleTabDialogBase(Window *pParent, const SfxItemSet* pInSet, + const OString& rID, const OUString& rUIXMLDescription); //non-layout ctors SfxSingleTabDialogBase( Window* pParent, const SfxItemSet& rOptionsSet, sal_uInt16 nUniqueId ); @@ -217,6 +219,12 @@ public: : SfxSingleTabDialogBase(pParent, rOptionsSet, rID, rUIXMLDescription) { } + SfxSingleTabDialog(Window *pParent, const SfxItemSet* pInSet = 0, + const OString& rID = OString("SingleTabDialog"), + const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui")) + : SfxSingleTabDialogBase(pParent, pInSet, rID, rUIXMLDescription) + { + } void setTabPage(SfxTabPage* pTabPage, GetTabPageRanges pRangesFunc = 0, sal_uInt32 nSettingsId = 0); }; diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index 24cfb9e40df4..4f52052bc6c1 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -761,6 +761,18 @@ SfxSingleTabDialogBase::SfxSingleTabDialogBase(Window *pParent, const SfxItemSet SetInputSet( &rSet ); } +SfxSingleTabDialogBase::SfxSingleTabDialogBase(Window* pParent, const SfxItemSet* pInSet, + const OString& rID, const OUString& rUIXMLDescription) + : SfxModalDialog(pParent, rID, rUIXMLDescription) + , pImpl(new SingleTabDlgImpl) +{ + get(pOKBtn, "ok"); + pOKBtn->SetClickHdl( LINK( this, SfxSingleTabDialogBase, OKHdl_Impl ) ); + get(pCancelBtn, "cancel"); + get(pHelpBtn, "help"); + SetInputSet( pInSet ); +} + // ----------------------------------------------------------------------- SfxSingleTabDialogBase::~SfxSingleTabDialogBase() diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index b81d8f8dfe6e..dbc3b7f8d24b 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -83,6 +83,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/dropcapspage \ sw/uiconfig/swriter/ui/dropdownfielddialog \ sw/uiconfig/swriter/ui/editcategories \ + sw/uiconfig/swriter/ui/editfielddialog \ sw/uiconfig/swriter/ui/editsectiondialog \ sw/uiconfig/swriter/ui/endnotepage \ sw/uiconfig/swriter/ui/envaddresspage \ diff --git a/sw/inc/fldui.hrc b/sw/inc/fldui.hrc index 655bf2e7556e..b5ff6f38877a 100644 --- a/sw/inc/fldui.hrc +++ b/sw/inc/fldui.hrc @@ -240,14 +240,6 @@ #define STR_EXTRA (STR_FLDUI + 2) /*-------------------------------------------------------------------- - Buttons for Field-Edit-Dlg - --------------------------------------------------------------------*/ - -#define BTN_FLDEDT_PREV STR_EXTRA -#define BTN_FLDEDT_NEXT (STR_EXTRA + 1) -#define PB_FLDEDT_ADDRESS (STR_EXTRA + 2) - -/*-------------------------------------------------------------------- Additional Strings --------------------------------------------------------------------*/ @@ -265,7 +257,6 @@ #define STR_URLPROMPT (STR_EXTRA + 11) #define STR_FORMULA (STR_EXTRA + 12) #define STR_ALL_DATABASE (STR_EXTRA + 13) -#define STR_FLD_EDIT_DLG (STR_EXTRA + 14) diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index d40048398a5f..431a8c98d1a9 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -112,7 +112,6 @@ #define HID_NAVI_CONTENT "SW_HID_NAVI_CONTENT" #define HID_NAVI_GLOBAL "SW_HID_NAVI_GLOBAL" #define HID_LTEMPL_NUMBERING "SW_HID_LTEMPL_NUMBERING" -#define HID_FLDEDT_ADDRESS "SW_HID_FLDEDT_ADDRESS" #define HID_SORT_ACTION "SW_HID_SORT_ACTION" #define HID_SORT_AUTHOR "SW_HID_SORT_AUTHOR" #define HID_SORT_DATE "SW_HID_SORT_DATE" @@ -141,12 +140,6 @@ #define HID_GRF_EXT "SW_HID_GRF_EXT" #define HID_COND_COLL "SW_HID_COND_COLL" -#define HID_EDIT_FLD_DB "SW_HID_EDIT_FLD_DB" -#define HID_EDIT_FLD_DOKINF "SW_HID_EDIT_FLD_DOKINF" -#define HID_EDIT_FLD_VAR "SW_HID_EDIT_FLD_VAR" -#define HID_EDIT_FLD_DOK "SW_HID_EDIT_FLD_DOK" -#define HID_EDIT_FLD_FUNC "SW_HID_EDIT_FLD_FUNC" -#define HID_EDIT_FLD_REF "SW_HID_EDIT_FLD_REF" #define HID_REDLINE_CTRL "SW_HID_REDLINE_CTRL" #define HID_OPTCAPTION_PAGE "SW_HID_OPTCAPTION_PAGE" #define HID_TP_TOX_SELECT "SW_HID_TP_TOX_SELECT" diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index b376360a1fdf..a9b907af3c17 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -52,13 +52,15 @@ namespace swui SwAbstractDialogFactory * GetFactory(); } -SwFldEditDlg::SwFldEditDlg(SwView& rVw) : - SfxNoLayoutSingleTabDialog(&rVw.GetViewFrame()->GetWindow(), 0, 0), - pSh (rVw.GetWrtShellPtr()), - aPrevBT (this, SW_RES(BTN_FLDEDT_PREV)), - aNextBT (this, SW_RES(BTN_FLDEDT_NEXT)), - aAddressBT (this, SW_RES(PB_FLDEDT_ADDRESS)) +SwFldEditDlg::SwFldEditDlg(SwView& rVw) + : SfxSingleTabDialog(&rVw.GetViewFrame()->GetWindow(), 0, + "EditFieldDialog", "modules/swriter/ui/editfielddialog.ui") + , pSh(rVw.GetWrtShellPtr()) { + get(m_pPrevBT, "prev"); + get(m_pNextBT, "next"); + get(m_pAddressBT, "edit"); + SwFldMgr aMgr(pSh); SwField *pCurFld = aMgr.GetCurFld(); @@ -70,38 +72,20 @@ SwFldEditDlg::SwFldEditDlg(SwView& rVw) : /* #108536# Only create selection if there is none already. Normalize PaM instead of swapping. */ if ( ! pSh->HasSelection() ) - pSh->Right(CRSR_SKIP_CHARS, sal_True, 1, sal_False ); + pSh->Right(CRSR_SKIP_CHARS, true, 1, false); pSh->NormalizePam(); - sal_uInt16 nGroup = aMgr.GetGroup(sal_False, pCurFld->GetTypeId(), pCurFld->GetSubType()); + sal_uInt16 nGroup = aMgr.GetGroup(false, pCurFld->GetTypeId(), pCurFld->GetSubType()); CreatePage(nGroup); GetOKButton()->SetClickHdl(LINK(this, SwFldEditDlg, OKHdl)); - // position buttons ourselves because otherwise when font sizes are - // varying, they are in the woods, and because PB uses fixed pixel sizes - // for its buttons and dialog width in SingleTabDlg. - aPrevBT.SetPosPixel(Point(GetOKButton()->GetPosPixel().X(), aPrevBT.GetPosPixel().Y())); - sal_uInt16 nWidth = static_cast< sal_uInt16 >(GetOKButton()->GetOutputSize().Width() / 2 - 3); - Size aNewSize(LogicToPixel(Size(nWidth, GetOKButton()->GetOutputSize().Height()))); - aPrevBT.SetSizePixel(aNewSize); - - aNextBT.SetSizePixel(aPrevBT.GetSizePixel()); - - long nXPos = GetOKButton()->GetPosPixel().X() + GetOKButton()->GetSizePixel().Width() - - aNextBT.GetSizePixel().Width() - 1; - aNextBT.SetPosPixel(Point(nXPos, aNextBT.GetPosPixel().Y())); + m_pPrevBT->SetClickHdl(LINK(this, SwFldEditDlg, NextPrevHdl)); + m_pNextBT->SetClickHdl(LINK(this, SwFldEditDlg, NextPrevHdl)); - aAddressBT.SetPosPixel(Point(GetOKButton()->GetPosPixel().X(), aAddressBT.GetPosPixel().Y())); - aAddressBT.SetSizePixel(GetOKButton()->GetSizePixel()); - - aPrevBT.SetClickHdl(LINK(this, SwFldEditDlg, NextPrevHdl)); - aNextBT.SetClickHdl(LINK(this, SwFldEditDlg, NextPrevHdl)); - - aAddressBT.SetClickHdl(LINK(this, SwFldEditDlg, AddressHdl)); - aAddressBT.SetHelpId(HID_FLDEDT_ADDRESS); + m_pAddressBT->SetClickHdl(LINK(this, SwFldEditDlg, AddressHdl)); Init(); } @@ -129,14 +113,14 @@ void SwFldEditDlg::Init() sal_Bool bMove = rMgr.GoNext(); if( bMove ) rMgr.GoPrev(); - aNextBT.Enable(bMove); + m_pNextBT->Enable(bMove); if( 0 != ( bMove = rMgr.GoPrev() ) ) rMgr.GoNext(); - aPrevBT.Enable( bMove ); + m_pPrevBT->Enable( bMove ); if (pCurFld->GetTypeId() == TYP_EXTUSERFLD) - aAddressBT.Show(); + m_pAddressBT->Show(); pSh->DestroyCrsr(); pSh->EndAction(); @@ -150,21 +134,17 @@ SfxTabPage* SwFldEditDlg::CreatePage(sal_uInt16 nGroup) { // create TabPage SfxTabPage* pTabPage = 0; - const char* pHelpId = 0; switch (nGroup) { case GRP_DOC: - pTabPage = SwFldDokPage::Create(this, *(SfxItemSet*)0); - pHelpId = HID_EDIT_FLD_DOK; + pTabPage = SwFldDokPage::Create(get_content_area(), *(SfxItemSet*)0); break; case GRP_FKT: - pTabPage = SwFldFuncPage::Create(this, *(SfxItemSet*)0); - pHelpId = HID_EDIT_FLD_FUNC; + pTabPage = SwFldFuncPage::Create(get_content_area(), *(SfxItemSet*)0); break; case GRP_REF: - pTabPage = SwFldRefPage::Create(this, *(SfxItemSet*)0); - pHelpId = HID_EDIT_FLD_REF; + pTabPage = SwFldRefPage::Create(get_content_area(), *(SfxItemSet*)0); break; case GRP_REG: { @@ -179,31 +159,22 @@ SfxTabPage* SwFldEditDlg::CreatePage(sal_uInt16 nGroup) xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW); pSet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(xUDProps) ) ); - pTabPage = SwFldDokInfPage::Create(this, *pSet); - pHelpId = HID_EDIT_FLD_DOKINF; + pTabPage = SwFldDokInfPage::Create(get_content_area(), *pSet); break; } case GRP_DB: - pTabPage = SwFldDBPage::Create(this, *(SfxItemSet*)0); + pTabPage = SwFldDBPage::Create(get_content_area(), *(SfxItemSet*)0); static_cast<SwFldDBPage*>(pTabPage)->SetWrtShell(*pSh); - pHelpId = HID_EDIT_FLD_DB; break; case GRP_VAR: - pTabPage = SwFldVarPage::Create(this, *(SfxItemSet*)0); - pHelpId = HID_EDIT_FLD_VAR; + pTabPage = SwFldVarPage::Create(get_content_area(), *(SfxItemSet*)0); break; } - pTabPage->SetHelpId(pHelpId); static_cast<SwFldPage*>(pTabPage)->SetWrtShell(pSh); - SetTabPage(pTabPage); - - String sTitle(GetText()); - sTitle.Insert(OUString(": "), 0); - sTitle.Insert(SW_RESSTR(STR_FLD_EDIT_DLG), 0); - SetText(sTitle); + setTabPage(pTabPage); return pTabPage; } @@ -256,7 +227,7 @@ short SwFldEditDlg::Execute() --------------------------------------------------------------------*/ IMPL_LINK( SwFldEditDlg, NextPrevHdl, Button *, pButton ) { - sal_Bool bNext = pButton == &aNextBT; + bool bNext = pButton == m_pNextBT; pSh->EnterStdMode(); diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index d36c309aaee0..0096bc5d6fc6 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -351,7 +351,7 @@ IMPL_LINK( SwFldPage, InsertHdl, Button *, pBtn ) } else { - SwFldEditDlg *pEditDlg = (SwFldEditDlg *)GetParent(); + SwFldEditDlg *pEditDlg = (SwFldEditDlg *)GetParentDialog(); pEditDlg->InsertHdl(); } @@ -373,7 +373,7 @@ void SwFldPage::EnableInsert(sal_Bool bEnable) } else { - SwFldEditDlg *pEditDlg = (SwFldEditDlg *)GetParent(); + SwFldEditDlg *pEditDlg = (SwFldEditDlg *)GetParentDialog(); pEditDlg->EnableInsert(bEnable); } diff --git a/sw/source/ui/fldui/fldui.src b/sw/source/ui/fldui/fldui.src index 8b139716613a..788a018e28f6 100644 --- a/sw/source/ui/fldui/fldui.src +++ b/sw/source/ui/fldui/fldui.src @@ -24,13 +24,6 @@ /*-------------------------------------------------------------------- Description: strings for the types --------------------------------------------------------------------*/ -String STR_FLD_EDIT_DLG -{ - Text [ en-US ] = "Edit Fields" ; -}; -/*-------------------------------------------------------------------- - Description: strings for the types - --------------------------------------------------------------------*/ // // range document // @@ -638,31 +631,6 @@ String STR_ALL_DATABASE { Text [ en-US ] = "<All>" ; }; -ImageButton BTN_FLDEDT_PREV -{ - Pos = MAP_APPFONT ( 263 , 115 ) ; - Size = MAP_APPFONT ( 24 , 14 ) ; - TabStop = TRUE ; - SYMBOL = IMAGEBUTTON_PREV ; - Helpid = HID_DLG_FLDEDT_PREV ; -}; -ImageButton BTN_FLDEDT_NEXT -{ - Pos = MAP_APPFONT ( 294 , 115 ) ; - Size = MAP_APPFONT ( 24 , 14 ) ; - TabStop = TRUE ; - SYMBOL = IMAGEBUTTON_NEXT ; - Helpid = HID_DLG_FLDEDT_NEXT ; -}; -PushButton PB_FLDEDT_ADDRESS -{ - Pos = MAP_APPFONT ( 294 , 100 ) ; - Size = MAP_APPFONT ( 24 , 14 ) ; - TabStop = TRUE ; - Hide = TRUE ; - Text [ en-US ] = "Edit" ; - Helpid = HID_DLG_FLDEDT_ADDRESS ; -}; String STR_CUSTOM { Text [ en-US ] = "Custom" ; diff --git a/sw/source/ui/inc/fldedt.hxx b/sw/source/ui/inc/fldedt.hxx index c547c68ef8f4..f512af977be4 100644 --- a/sw/source/ui/inc/fldedt.hxx +++ b/sw/source/ui/inc/fldedt.hxx @@ -24,15 +24,15 @@ class SwView; class SwWrtShell; -class SwFldEditDlg : public SfxNoLayoutSingleTabDialog +class SwFldEditDlg : public SfxSingleTabDialog { SwWrtShell* pSh; - ImageButton aPrevBT; - ImageButton aNextBT; - PushButton aAddressBT; + PushButton* m_pPrevBT; + PushButton* m_pNextBT; + PushButton* m_pAddressBT; DECL_LINK(AddressHdl, void *); - DECL_LINK( NextPrevHdl, Button *pBt = 0 ); + DECL_LINK(NextPrevHdl, Button *pBt = 0); void Init(); SfxTabPage* CreatePage(sal_uInt16 nGroup); diff --git a/sw/uiconfig/swriter/ui/editfielddialog.ui b/sw/uiconfig/swriter/ui/editfielddialog.ui new file mode 100644 index 000000000000..ca6a041a59e6 --- /dev/null +++ b/sw/uiconfig/swriter/ui/editfielddialog.ui @@ -0,0 +1,147 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkImage" id="image3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-media-previous</property> + </object> + <object class="GtkImage" id="image4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-media-next</property> + </object> + <object class="GtkDialog" id="EditFieldDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Edit Fields</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="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkButton" id="prev"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image">image3</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="next"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image">image4</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> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + <property name="secondary">True</property> + </packing> + </child> + <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">1</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">2</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">3</property> + </packing> + </child> + <child> + <object class="GtkButton" id="edit"> + <property name="label" translatable="yes">_Edit</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="no_show_all">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + <property name="secondary">True</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> + <placeholder/> + </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-widget response="0">edit</action-widget> + </action-widgets> + </object> +</interface> |