31 SwField* pField,
bool bPrevButton,
bool bNextButton)
32 : GenericDialogController(pParent,
"modules/swriter/ui/dropdownfielddialog.ui",
"DropdownFieldDialog")
34 , m_pDropField(nullptr)
35 , m_pPressedButton(nullptr)
36 , m_xListItemsLB(m_xBuilder->weld_tree_view(
"list"))
37 , m_xOKPB(m_xBuilder->weld_button(
"ok"))
38 , m_xPrevPB(m_xBuilder->weld_button(
"prev"))
39 , m_xNextPB(m_xBuilder->weld_button(
"next"))
40 , m_xEditPB(m_xBuilder->weld_button(
"edit"))
50 m_xEditPB->connect_clicked(aEditButtonLk);
51 if( bPrevButton || bNextButton )
54 m_xPrevPB->connect_clicked(aPrevButtonLk);
58 m_xNextPB->connect_clicked(aNextButtonLk);
65 OUString sTitle =
m_xDialog->get_title() +
69 for (
const OUString& rItem : aItems)
75 m_xOKPB->set_sensitive(bEnable);
89 OUString sSelect = m_xListItemsLB->get_selected_text();
90 if (m_pDropField->GetPar1() == sSelect)
93 m_rSh.StartAllAction();
95 std::unique_ptr<SwDropDownField>
const pCopy(
98 pCopy->SetPar1(sSelect);
99 m_rSh.SwEditShell::UpdateOneField(*pCopy);
101 m_rSh.SetUndoNoResetModified();
102 m_rSh.EndAllAction();
107 return m_pPressedButton == m_xPrevPB.get();
112 return m_pPressedButton == m_xNextPB.get();
117 m_pPressedButton = m_xEditPB.get();
123 m_pPressedButton = m_xPrevPB.get();
129 m_pPressedButton = m_xNextPB.get();
136 if (m_xNextPB->get_visible() && m_xNextPB->get_sensitive())
137 m_pPressedButton = m_xNextPB.get();
Reference< XExecutableDialog > m_xDialog
bool IsCursorReadonly() const
virtual OUString GetPar2() const override
Returns the name of the field.
css::uno::Sequence< OUString > GetItemSequence() const
Returns the items of the dropdown box.
const OUString & GetSelectedItem() const
Returns the selected item.
Base class of all fields.
SwFieldType * GetTyp() const
Used by the UI to modify the document model.
std::unique_ptr< weld::Button > m_xPrevPB
std::unique_ptr< weld::Button > m_xNextPB
bool PrevButtonPressed() const
std::unique_ptr< weld::Button > m_xOKPB
virtual ~DropDownFieldDialog() override
DropDownFieldDialog(weld::Widget *pParent, SwWrtShell &rSh, SwField *pField, bool bPrevButton, bool bNextButton)
std::unique_ptr< weld::Button > m_xEditPB
bool NextButtonPressed() const
SwDropDownField * m_pDropField
std::unique_ptr< weld::TreeView > m_xListItemsLB
std::shared_ptr< weld::Dialog > m_xDialog
#define LINK(Instance, Class, Member)
IMPL_LINK_NOARG(DocumentTimerManager, DoIdleJobs, Timer *, void)