diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-04-16 13:10:48 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-17 11:33:38 +0200 |
commit | c8780642a5e8dc0bdcc97940ee7d9cacdc64c928 (patch) | |
tree | 0256fe5f3886b17e9141e1bee5510254940addfd /sw | |
parent | cdb14b4f079e56243c55029e4322f587fd6335b0 (diff) |
weld SwFieldInputDlg
and GetWindowState/SetWindowState are unused as it turns out
Change-Id: Id1c5dad151e1f3c94189b7bca1a7cf335613d3bd
Reviewed-on: https://gerrit.libreoffice.org/53001
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/swabstdlg.hxx | 7 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 37 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 16 | ||||
-rw-r--r-- | sw/source/ui/fldui/inpdlg.cxx | 83 | ||||
-rw-r--r-- | sw/source/uibase/fldui/fldmgr.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/inpdlg.hxx | 36 | ||||
-rw-r--r-- | sw/source/uibase/inc/wrtsh.hxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/shells/textfld.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh2.cxx | 24 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/inputfielddialog.ui | 94 |
10 files changed, 138 insertions, 167 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 2c24fc1bfbe1..d64bc9aad389 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -104,9 +104,6 @@ class AbstractFieldInputDlg : public VclAbstractTerminatedDialog protected: virtual ~AbstractFieldInputDlg() override = default; public: - //from class SalFrame - virtual void SetWindowState( const OString & rStr ) = 0; - virtual OString GetWindowState() const = 0; virtual void EndDialog(sal_Int32 nResult) override = 0; virtual bool PrevButtonPressed() const = 0; virtual bool NextButtonPressed() const = 0; @@ -278,8 +275,6 @@ class AbstractDropDownFieldDialog : public VclAbstractDialog protected: virtual ~AbstractDropDownFieldDialog() override = default; public: - virtual OString GetWindowState() const = 0; //this method inherit from SystemWindow - virtual void SetWindowState( const OString & rStr ) = 0; //this method inherit from SystemWindow virtual bool PrevButtonPressed() const = 0; virtual bool NextButtonPressed() const = 0; }; @@ -460,7 +455,7 @@ public: virtual VclPtr<AbstractGlossaryDlg> CreateGlossaryDlg(SfxViewFrame* pViewFrame, SwGlossaryHdl* pGlosHdl, SwWrtShell *pWrtShell) = 0; - virtual VclPtr<AbstractFieldInputDlg> CreateFieldInputDlg(vcl::Window *pParent, + virtual VclPtr<AbstractFieldInputDlg> CreateFieldInputDlg(weld::Window *pParent, SwWrtShell &rSh, SwField* pField, bool bPrevButton, bool bNextButton) = 0; virtual VclPtr<AbstractInsFootNoteDlg> CreateInsFootNoteDlg(weld::Window * pParent, SwWrtShell &rSh, bool bEd = false) = 0; diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index e3e9559a3331..cf431989c93f 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -147,7 +147,11 @@ short AbstractSwRenameXNamedDlg_Impl::Execute() } IMPL_ABSTDLG_BASE(AbstractSwModalRedlineAcceptDlg_Impl); IMPL_ABSTDLG_BASE(AbstractGlossaryDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractFieldInputDlg_Impl); + +short AbstractFieldInputDlg_Impl::Execute() +{ + return m_xDlg->execute(); +} short AbstractInsFootNoteDlg_Impl::Execute() { @@ -275,16 +279,6 @@ void AbstractSwInsertDBColAutoPilot_Impl::DataToDoc( const uno::Sequence< uno::A pDlg->DataToDoc(rSelection, rxSource, xConnection, xResultSet); } -OString AbstractDropDownFieldDialog_Impl::GetWindowState() const -{ - return pDlg->GetWindowState(); -} - -void AbstractDropDownFieldDialog_Impl::SetWindowState( const OString& rStr ) -{ - pDlg->SetWindowState(rStr); -} - bool AbstractDropDownFieldDialog_Impl::PrevButtonPressed() const { return pDlg->PrevButtonPressed(); @@ -442,29 +436,19 @@ OUString AbstractGlossaryDlg_Impl::GetCurrShortName() const return pDlg->GetCurrShortName(); } -void AbstractFieldInputDlg_Impl::SetWindowState( const OString& rStr ) -{ - pDlg->SetWindowState( rStr ); -} - -OString AbstractFieldInputDlg_Impl::GetWindowState() const -{ - return pDlg->GetWindowState(); -} - void AbstractFieldInputDlg_Impl::EndDialog(sal_Int32 n) { - pDlg->EndDialog(n); + m_xDlg->response(n); } bool AbstractFieldInputDlg_Impl::PrevButtonPressed() const { - return pDlg->PrevButtonPressed(); + return m_xDlg->PrevButtonPressed(); } bool AbstractFieldInputDlg_Impl::NextButtonPressed() const { - return pDlg->NextButtonPressed(); + return m_xDlg->NextButtonPressed(); } OUString AbstractInsFootNoteDlg_Impl::GetFontName() @@ -933,11 +917,10 @@ VclPtr<AbstractGlossaryDlg> SwAbstractDialogFactory_Impl::CreateGlossaryDlg(SfxV return VclPtr<AbstractGlossaryDlg_Impl>::Create( pDlg ); } -VclPtr<AbstractFieldInputDlg> SwAbstractDialogFactory_Impl::CreateFieldInputDlg(vcl::Window *pParent, +VclPtr<AbstractFieldInputDlg> SwAbstractDialogFactory_Impl::CreateFieldInputDlg(weld::Window *pParent, SwWrtShell &rSh, SwField* pField, bool bPrevButton, bool bNextButton) { - VclPtr<SwFieldInputDlg> pDlg = VclPtr<SwFieldInputDlg>::Create( pParent, rSh, pField, bPrevButton, bNextButton ); - return VclPtr<AbstractFieldInputDlg_Impl>::Create( pDlg ); + return VclPtr<AbstractFieldInputDlg_Impl>::Create(new SwFieldInputDlg(pParent, rSh, pField, bPrevButton, bNextButton)); } VclPtr<AbstractInsFootNoteDlg> SwAbstractDialogFactory_Impl::CreateInsFootNoteDlg( diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index d53aad217e3c..b708efc4098c 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -263,8 +263,6 @@ class AbstractSwInsertDBColAutoPilot_Impl : public AbstractSwInsertDBColAutoPil class AbstractDropDownFieldDialog_Impl : public AbstractDropDownFieldDialog { DECL_ABSTDLG_BASE(AbstractDropDownFieldDialog_Impl, sw::DropDownFieldDialog) - virtual OString GetWindowState() const override; //this method inherit from SystemWindow - virtual void SetWindowState( const OString& rStr ) override; //this method inherit from SystemWindow virtual bool PrevButtonPressed() const override; virtual bool NextButtonPressed() const override; }; @@ -355,10 +353,14 @@ class AbstractGlossaryDlg_Impl : public AbstractGlossaryDlg class SwFieldInputDlg; class AbstractFieldInputDlg_Impl : public AbstractFieldInputDlg { - DECL_ABSTDLG_BASE(AbstractFieldInputDlg_Impl,SwFieldInputDlg) - //from class SalFrame - virtual void SetWindowState( const OString & rStr ) override; - virtual OString GetWindowState() const override; +protected: + std::unique_ptr<SwFieldInputDlg> m_xDlg; +public: + explicit AbstractFieldInputDlg_Impl(SwFieldInputDlg* p) + : m_xDlg(p) + { + } + virtual short Execute() override; virtual void EndDialog(sal_Int32) override; virtual bool PrevButtonPressed() const override; virtual bool NextButtonPressed() const override; @@ -587,7 +589,7 @@ public: virtual VclPtr<AbstractGlossaryDlg> CreateGlossaryDlg(SfxViewFrame* pViewFrame, SwGlossaryHdl* pGlosHdl, SwWrtShell *pWrtShell) override; - virtual VclPtr<AbstractFieldInputDlg> CreateFieldInputDlg(vcl::Window *pParent, + virtual VclPtr<AbstractFieldInputDlg> CreateFieldInputDlg(weld::Window *pParent, SwWrtShell &rSh, SwField* pField, bool bPrevButton, bool bNextButton) override; virtual VclPtr<AbstractInsFootNoteDlg> CreateInsFootNoteDlg( weld::Window * pParent, SwWrtShell &rSh, bool bEd = false) override; diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx index 5d10fa20ad94..e8afcea97704 100644 --- a/sw/source/ui/fldui/inpdlg.cxx +++ b/sw/source/ui/fldui/inpdlg.cxx @@ -28,36 +28,31 @@ #include <fldmgr.hxx> // edit field-insert -SwFieldInputDlg::SwFieldInputDlg( vcl::Window *pParent, SwWrtShell &rS, - SwField* pField, bool bPrevButton, bool bNextButton ) - : SvxStandardDialog( pParent, "InputFieldDialog", - "modules/swriter/ui/inputfielddialog.ui") +SwFieldInputDlg::SwFieldInputDlg(weld::Window *pParent, SwWrtShell &rS, + SwField* pField, bool bPrevButton, bool bNextButton) + : GenericDialogController(pParent, "modules/swriter/ui/inputfielddialog.ui", "InputFieldDialog") , rSh( rS ) , pInpField(nullptr) , pSetField(nullptr) , pUsrType(nullptr) , m_pPressedButton(nullptr) + , m_xLabelED(m_xBuilder->weld_entry("name")) + , m_xEditED(m_xBuilder->weld_text_view("text")) + , m_xPrevBT(m_xBuilder->weld_button("prev")) + , m_xNextBT(m_xBuilder->weld_button("next")) + , m_xOKBT(m_xBuilder->weld_button("ok")) { - get(m_pLabelED, "name"); - get(m_pEditED, "text"); - m_pEditED->set_height_request(m_pEditED->GetTextHeight() * 9); - get(m_pPrevBT, "prev"); - get(m_pNextBT, "next"); - get(m_pOKBT, "ok"); - // switch font for Edit - vcl::Font aFont(m_pEditED->GetFont()); - aFont.SetWeight(WEIGHT_LIGHT); - m_pEditED->SetFont(aFont); + m_xEditED->set_size_request(-1, m_xEditED->get_height_rows(8)); if( bPrevButton || bNextButton ) { - m_pPrevBT->Show(); - m_pPrevBT->SetClickHdl(LINK(this, SwFieldInputDlg, PrevHdl)); - m_pPrevBT->Enable(bPrevButton); + m_xPrevBT->show(); + m_xPrevBT->connect_clicked(LINK(this, SwFieldInputDlg, PrevHdl)); + m_xPrevBT->set_sensitive(bPrevButton); - m_pNextBT->Show(); - m_pNextBT->SetClickHdl(LINK(this, SwFieldInputDlg, NextHdl)); - m_pNextBT->Enable(bNextButton); + m_xNextBT->show(); + m_xNextBT->connect_clicked(LINK(this, SwFieldInputDlg, NextHdl)); + m_xNextBT->set_sensitive(bNextButton); } // evaluation here @@ -66,7 +61,7 @@ SwFieldInputDlg::SwFieldInputDlg( vcl::Window *pParent, SwWrtShell &rS, { // it is an input field pInpField = static_cast<SwInputField*>(pField); - m_pLabelED->SetText( pInpField->GetPar2() ); + m_xLabelED->set_text(pInpField->GetPar2()); sal_uInt16 nSubType = pInpField->GetSubType(); switch(nSubType & 0xff) @@ -96,47 +91,29 @@ SwFieldInputDlg::SwFieldInputDlg( vcl::Window *pParent, SwWrtShell &rS, } else aStr = sFormula; - m_pLabelED->SetText( pSetField->GetPromptText() ); + m_xLabelED->set_text(pSetField->GetPromptText()); } // JP 31.3.00: Inputfields in readonly regions must be allowed to // input any content. - 74639 bool bEnable = !rSh.IsCursorReadonly(); - m_pOKBT->Enable( bEnable ); - m_pEditED->SetReadOnly( !bEnable ); + m_xOKBT->set_sensitive( bEnable ); + m_xEditED->set_editable( bEnable ); if( !aStr.isEmpty() ) - m_pEditED->SetText(convertLineEnd(aStr, GetSystemLineEnd())); + m_xEditED->set_text(convertLineEnd(aStr, GetSystemLineEnd())); + m_xEditED->grab_focus(); } SwFieldInputDlg::~SwFieldInputDlg() { - disposeOnce(); -} - -void SwFieldInputDlg::dispose() -{ - m_pLabelED.clear(); - m_pEditED.clear(); - m_pOKBT.clear(); - m_pPrevBT.clear(); - m_pNextBT.clear(); - m_pPressedButton.clear(); - SvxStandardDialog::dispose(); -} - -void SwFieldInputDlg::StateChanged( StateChangedType nType ) -{ - if ( nType == StateChangedType::InitShow ) - m_pEditED->GrabFocus(); - SvxStandardDialog::StateChanged( nType ); } // Close void SwFieldInputDlg::Apply() { - OUString aTmp = m_pEditED->GetText().replaceAll("\r", ""); + OUString aTmp = m_xEditED->get_text().replaceAll("\r", ""); rSh.StartAllAction(); bool bModified = false; if(pInpField) @@ -172,24 +149,24 @@ void SwFieldInputDlg::Apply() bool SwFieldInputDlg::PrevButtonPressed() const { - return m_pPressedButton == m_pPrevBT; + return m_pPressedButton == m_xPrevBT.get(); } bool SwFieldInputDlg::NextButtonPressed() const { - return m_pPressedButton == m_pNextBT; + return m_pPressedButton == m_xNextBT.get(); } -IMPL_LINK_NOARG(SwFieldInputDlg, PrevHdl, Button*, void) +IMPL_LINK_NOARG(SwFieldInputDlg, PrevHdl, weld::Button&, void) { - m_pPressedButton = m_pPrevBT; - EndDialog(RET_OK); + m_pPressedButton = m_xPrevBT.get(); + m_xDialog->response(RET_OK); } -IMPL_LINK_NOARG(SwFieldInputDlg, NextHdl, Button*, void) +IMPL_LINK_NOARG(SwFieldInputDlg, NextHdl, weld::Button&, void) { - m_pPressedButton = m_pNextBT; - EndDialog(RET_OK); + m_pPressedButton = m_xNextBT.get(); + m_xDialog->response(RET_OK); } diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index bd1926b80788..e90d325dc476 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -1512,7 +1512,7 @@ bool SwFieldMgr::InsertField( // start dialog, not before the field is inserted tdf#99529 pCurShell->Left(CRSR_SKIP_CHARS, false, (INP_VAR == (nSubType & 0xff)) ? 1 : 2, false ); - pCurShell->StartInputFieldDlg(pField, false, true, rData.m_pParent); + pCurShell->StartInputFieldDlg(pField, false, true, rData.m_pParent ? rData.m_pParent->GetFrameWeld() : nullptr); pCurShell->Pop(SwCursorShell::PopMode::DeleteCurrent); } diff --git a/sw/source/uibase/inc/inpdlg.hxx b/sw/source/uibase/inc/inpdlg.hxx index 9307f5d9e8cd..223c835b37cf 100644 --- a/sw/source/uibase/inc/inpdlg.hxx +++ b/sw/source/uibase/inc/inpdlg.hxx @@ -33,34 +33,36 @@ class SwWrtShell; class SwFieldMgr; // insert fields -class SwFieldInputDlg: public SvxStandardDialog +class SwFieldInputDlg : public weld::GenericDialogController { - virtual void Apply() override; - virtual void StateChanged( StateChangedType ) override; + void Apply(); SwWrtShell& rSh; SwInputField* pInpField; SwSetExpField* pSetField; SwUserFieldType* pUsrType; - VclPtr<Edit> m_pLabelED; + weld::Button* m_pPressedButton; + std::unique_ptr<weld::Entry> m_xLabelED; + std::unique_ptr<weld::TextView> m_xEditED; + std::unique_ptr<weld::Button> m_xPrevBT; + std::unique_ptr<weld::Button> m_xNextBT; + std::unique_ptr<weld::Button> m_xOKBT; - VclPtr<VclMultiLineEdit> m_pEditED; - - VclPtr<OKButton> m_pOKBT; - VclPtr<PushButton> m_pNextBT; - VclPtr<PushButton> m_pPrevBT; - - VclPtr<PushButton> m_pPressedButton; - - DECL_LINK(NextHdl, Button*, void); - DECL_LINK(PrevHdl, Button*, void); + DECL_LINK(NextHdl, weld::Button&, void); + DECL_LINK(PrevHdl, weld::Button&, void); public: - SwFieldInputDlg( vcl::Window *pParent, SwWrtShell &rSh, - SwField* pField, bool bPrevButton, bool bNextButton ); + SwFieldInputDlg(weld::Window *pParent, SwWrtShell &rSh, + SwField* pField, bool bPrevButton, bool bNextButton); + short execute() + { + short nRet = run(); + if (nRet == RET_OK) + Apply(); + return nRet; + } virtual ~SwFieldInputDlg() override; - virtual void dispose() override; bool PrevButtonPressed() const; bool NextButtonPressed() const; }; diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index 51fd466b81fc..e9ba09ceafb1 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -394,9 +394,9 @@ typedef bool (SwWrtShell:: *FNSimpleMove)(); void MoveCursor( bool bWithSelect = false ); // update input fields - bool StartInputFieldDlg(SwField*, bool bPrevButton, bool bNextButton, vcl::Window* pParentWin = nullptr, OString* pWindowState = nullptr, FieldDialogPressedButton* pPressedButton = nullptr); + bool StartInputFieldDlg(SwField*, bool bPrevButton, bool bNextButton, weld::Window* pParentWin, FieldDialogPressedButton* pPressedButton = nullptr); // update DropDown fields - bool StartDropDownFieldDlg(SwField*, bool bPrevButton, bool bNextButton, OString* pWindowState = nullptr, FieldDialogPressedButton* pPressedButton = nullptr); + bool StartDropDownFieldDlg(SwField*, bool bPrevButton, bool bNextButton, FieldDialogPressedButton* pPressedButton = nullptr); //"Handler" for changes at DrawView - for controls. virtual void DrawSelChanged( ) override; diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index fc7735bd7ec2..d5d68916c371 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -198,7 +198,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) } else { - rSh.StartInputFieldDlg( rSh.GetCurField( true ), false, false ); + rSh.StartInputFieldDlg(rSh.GetCurField(true), false, false, GetView().GetFrameWeld()); } bRet = true; } diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index a2e328ed4c4a..0a5525bbce97 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -143,7 +143,6 @@ void SwWrtShell::UpdateInputFields( SwInputFieldList* pLst ) pTmp->PushCursor(); bool bCancel = false; - OString aDlgPos; size_t nIndex = 0; FieldDialogPressedButton ePressedButton = BTN_NONE; @@ -169,10 +168,10 @@ void SwWrtShell::UpdateInputFields( SwInputFieldList* pLst ) pField = pTmp->GetField(nIndex); if (pField->GetTyp()->Which() == SwFieldIds::Dropdown) { - bCancel = StartDropDownFieldDlg(pField, bPrev, bNext, &aDlgPos, &ePressedButton); + bCancel = StartDropDownFieldDlg(pField, bPrev, bNext, &ePressedButton); } else - bCancel = StartInputFieldDlg(pField, bPrev, bNext, nullptr, &aDlgPos, &ePressedButton); + bCancel = StartInputFieldDlg(pField, bPrev, bNext, GetView().GetFrameWeld(), &ePressedButton); if (!bCancel) { @@ -251,16 +250,14 @@ class FieldDeletionModify : public SwModify }; // Start input dialog for a specific field -bool SwWrtShell::StartInputFieldDlg( SwField* pField, bool bPrevButton, bool bNextButton, - vcl::Window* pParentWin, OString* pWindowState, SwWrtShell::FieldDialogPressedButton* pPressedButton ) +bool SwWrtShell::StartInputFieldDlg(SwField* pField, bool bPrevButton, bool bNextButton, + weld::Window* pParentWin, SwWrtShell::FieldDialogPressedButton* pPressedButton) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); ScopedVclPtr<AbstractFieldInputDlg> pDlg(pFact->CreateFieldInputDlg(pParentWin, *this, pField, bPrevButton, bNextButton)); OSL_ENSURE(pDlg, "Dialog creation failed!"); - if(pWindowState && !pWindowState->isEmpty()) - pDlg->SetWindowState(*pWindowState); bool bRet; @@ -269,9 +266,6 @@ bool SwWrtShell::StartInputFieldDlg( SwField* pField, bool bPrevButton, bool bNe bRet = RET_CANCEL == pDlg->Execute(); } - if(pWindowState) - *pWindowState = pDlg->GetWindowState(); - if (pPressedButton) { if (pDlg->PrevButtonPressed()) @@ -285,18 +279,14 @@ bool SwWrtShell::StartInputFieldDlg( SwField* pField, bool bPrevButton, bool bNe return bRet; } -bool SwWrtShell::StartDropDownFieldDlg(SwField* pField, bool bPrevButton, bool bNextButton, OString* pWindowState, SwWrtShell::FieldDialogPressedButton* pPressedButton) +bool SwWrtShell::StartDropDownFieldDlg(SwField* pField, bool bPrevButton, bool bNextButton, SwWrtShell::FieldDialogPressedButton* pPressedButton) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); ScopedVclPtr<AbstractDropDownFieldDialog> pDlg(pFact->CreateDropDownFieldDialog(*this, pField, bPrevButton, bNextButton)); OSL_ENSURE(pDlg, "Dialog creation failed!"); - if(pWindowState && !pWindowState->isEmpty()) - pDlg->SetWindowState(*pWindowState); const short nRet = pDlg->Execute(); - if(pWindowState) - *pWindowState = pDlg->GetWindowState(); if (pPressedButton) { @@ -430,14 +420,14 @@ void SwWrtShell::ClickToField( const SwField& rField ) const SwInputField* pInputField = dynamic_cast<const SwInputField*>(&rField); if ( pInputField == nullptr ) { - StartInputFieldDlg( const_cast<SwField*>(&rField), false, false ); + StartInputFieldDlg(const_cast<SwField*>(&rField), false, false, GetView().GetFrameWeld()); } } break; case SwFieldIds::SetExp: if( static_cast<const SwSetExpField&>(rField).GetInputFlag() ) - StartInputFieldDlg( const_cast<SwField*>(&rField), false, false ); + StartInputFieldDlg(const_cast<SwField*>(&rField), false, false, GetView().GetFrameWeld()); break; case SwFieldIds::Dropdown : StartDropDownFieldDlg( const_cast<SwField*>(&rField), false, false ); diff --git a/sw/uiconfig/swriter/ui/inputfielddialog.ui b/sw/uiconfig/swriter/ui/inputfielddialog.ui index a0e0a427a9b0..c5c41ade7a76 100644 --- a/sw/uiconfig/swriter/ui/inputfielddialog.ui +++ b/sw/uiconfig/swriter/ui/inputfielddialog.ui @@ -1,10 +1,24 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.20.4 --> <interface domain="sw"> - <!-- interface-requires gtk+ 3.0 --> + <requires lib="gtk+" version="3.0"/> + <object class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-go-back</property> + </object> + <object class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-go-forward</property> + </object> <object class="GtkDialog" id="InputFieldDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="inputfielddialog|InputFieldDialog">Input Field</property> + <property name="modal">True</property> + <property name="default_width">0</property> + <property name="default_height">0</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> @@ -16,14 +30,36 @@ <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="ok"> - <property name="label">gtk-ok</property> + <object class="GtkGrid" id="grid2"> <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> + <property name="can_focus">False</property> + <property name="column_spacing">6</property> + <property name="column_homogeneous">True</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">image1</property> + <property name="image_position">right</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</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">image2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> @@ -32,10 +68,12 @@ </packing> </child> <child> - <object class="GtkButton" id="cancel"> - <property name="label">gtk-cancel</property> + <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> @@ -46,11 +84,11 @@ </packing> </child> <child> - <object class="GtkButton" id="prev"> - <property name="label">gtk-media-previous</property> + <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="no_show_all">True</property> <property name="use_stock">True</property> </object> <packing> @@ -60,20 +98,6 @@ </packing> </child> <child> - <object class="GtkButton" id="next"> - <property name="label">gtk-media-next</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="no_show_all">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="help"> <property name="label">gtk-help</property> <property name="visible">True</property> @@ -84,7 +108,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">4</property> + <property name="position">5</property> <property name="secondary">True</property> </packing> </child> @@ -110,13 +134,12 @@ <property name="can_focus">False</property> <property name="halign">start</property> <property name="label" translatable="yes" context="inputfielddialog|inputfieldname">Reference:</property> + <property name="use_underline">True</property> <property name="mnemonic_widget">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> @@ -126,13 +149,12 @@ <property name="can_focus">False</property> <property name="hexpand">True</property> <property name="editable">False</property> + <property name="activates_default">True</property> <property name="width_chars">32</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> @@ -146,7 +168,7 @@ <object class="GtkTextView" id="text"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="has_default">True</property> + <property name="has_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> </object> @@ -156,7 +178,6 @@ <property name="left_attach">0</property> <property name="top_attach">1</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> </object> @@ -171,9 +192,10 @@ <action-widgets> <action-widget response="-5">ok</action-widget> <action-widget response="-6">cancel</action-widget> - <action-widget response="0">prev</action-widget> - <action-widget response="0">next</action-widget> <action-widget response="-11">help</action-widget> </action-widgets> + <child> + <placeholder/> + </child> </object> </interface> |