diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-02-25 15:12:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-03-01 09:49:40 +0100 |
commit | 9584b37b10fb84934023cb7f4df3d05223647a38 (patch) | |
tree | b53e6ef298f9cff95238ed5f10422f0dd3b38ed0 | |
parent | 4bdc3ad0e8b50255eef77a74d383adba623c25f6 (diff) |
weld SwAddressListDialog
Change-Id: I0a62f2c03b5c8acef9d4231be1a1d5f0b83e81fb
Reviewed-on: https://gerrit.libreoffice.org/68501
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | extras/source/glade/libreoffice-catalog.xml.in | 3 | ||||
-rw-r--r-- | solenv/sanitizers/ui/modules/swriter.suppr | 3 | ||||
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/source/ui/dbui/addresslistdialog.cxx | 23 | ||||
-rw-r--r-- | sw/source/ui/dbui/createaddresslistdialog.cxx | 536 | ||||
-rw-r--r-- | sw/source/ui/dbui/createaddresslistdialog.hxx | 55 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/addressfragment.ui | 21 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/createaddresslist.ui | 97 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/findentrydialog.ui | 3 |
9 files changed, 323 insertions, 419 deletions
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index 6dc2fd503938..b92d8e16f8b2 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -27,9 +27,6 @@ <glade-widget-class title="Search Results Box" name="sfxlo-SearchResultsBox" generic-name="SearchResultsBox" parent="GtkComboBoxText" icon-name="widget-gtk-comboboxtext"/> - <glade-widget-class title="Address Control" name="swuilo-SwAddressControlImpl" - generic-name="SwAddressControlImpl" parent="GtkComboBoxText" - icon-name="widget-gtk-comboboxtext"/> <glade-widget-class title="Thesaurus View" name="cuilo-ThesaurusAlternativesCtrl" generic-name="ThesaurusAlternativesCtrl" parent="GtkTextView" icon-name="widget-gtk-textview"/> diff --git a/solenv/sanitizers/ui/modules/swriter.suppr b/solenv/sanitizers/ui/modules/swriter.suppr index 889cdb320384..27a4d9d9db2c 100644 --- a/solenv/sanitizers/ui/modules/swriter.suppr +++ b/solenv/sanitizers/ui/modules/swriter.suppr @@ -37,7 +37,8 @@ sw/uiconfig/swriter/ui/conditionpage.ui://GtkLabel[@id='styleft'] orphan-label sw/uiconfig/swriter/ui/conditionpage.ui://GtkTreeView[@id='styles:border'] no-labelled-by sw/uiconfig/swriter/ui/conditionpage.ui://GtkComboBoxText[@id='filter'] no-labelled-by sw/uiconfig/swriter/ui/converttexttable.ui://GtkLabel[@id='label4'] orphan-label -sw/uiconfig/swriter/ui/createaddresslist.ui://GtkSpinButton[@id='SETNO-nospin'] no-labelled-by +sw/uiconfig/swriter/ui/createaddresslist.ui://GtkEntry[@id='SETNO-nospin'] no-labelled-by +sw/uiconfig/swriter/ui/createaddresslist.ui://GtkSpinButton[@id='SETNO'] no-labelled-by sw/uiconfig/swriter/ui/createautomarkdialog.ui://GtkLabel[@id='searchterm'] orphan-label sw/uiconfig/swriter/ui/createautomarkdialog.ui://GtkLabel[@id='alternative'] orphan-label sw/uiconfig/swriter/ui/createautomarkdialog.ui://GtkLabel[@id='key1'] orphan-label diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 4e0b7ecfc037..f18fde50ab17 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -90,6 +90,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/addentrydialog \ sw/uiconfig/swriter/ui/addressblockdialog \ sw/uiconfig/swriter/ui/alreadyexistsdialog \ + sw/uiconfig/swriter/ui/addressfragment \ sw/uiconfig/swriter/ui/annotationmenu \ sw/uiconfig/swriter/ui/asciifilterdialog \ sw/uiconfig/swriter/ui/asksearchdialog \ diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index a0b5a522de7f..767800ec8f43 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -346,18 +346,14 @@ IMPL_LINK_NOARG(SwAddressListDialog, LoadHdl_Impl, Button*, void) } } -IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, Button*, pButton, void) +IMPL_LINK_NOARG(SwAddressListDialog, CreateHdl_Impl, Button*, void) { OUString sInputURL; - ScopedVclPtr<SwCreateAddressListDialog> pDlg( - VclPtr<SwCreateAddressListDialog>::Create( - pButton, - sInputURL, - m_pAddressPage->GetWizard()->GetConfigItem())); - if(RET_OK == pDlg->Execute()) + SwCreateAddressListDialog aDlg(GetFrameWeld(), sInputURL, m_pAddressPage->GetWizard()->GetConfigItem()); + if (RET_OK == aDlg.run()) { //register the URL a new datasource - const OUString sURL = pDlg->GetURL(); + const OUString sURL = aDlg.GetURL(); try { uno::Reference<XSingleServiceFactory> xFact( m_xDBContext, UNO_QUERY); @@ -424,7 +420,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, Button*, pButton, void) } } -IMPL_LINK(SwAddressListDialog, EditHdl_Impl, Button*, pButton, void) +IMPL_LINK_NOARG(SwAddressListDialog, EditHdl_Impl, Button*, void) { SvTreeListEntry* pEntry = m_pListLB->FirstSelected(); AddressUserData_Impl* pUserData = pEntry ? static_cast<AddressUserData_Impl*>(pEntry->GetUserData()) : nullptr; @@ -443,12 +439,9 @@ IMPL_LINK(SwAddressListDialog, EditHdl_Impl, Button*, pButton, void) pUserData->xColumnsSupplier.clear(); pUserData->xConnection.clear(); // will automatically close if it was the las reference - VclPtr<SwCreateAddressListDialog> pDlg( - VclPtr<SwCreateAddressListDialog>::Create( - pButton, - pUserData->sURL, - m_pAddressPage->GetWizard()->GetConfigItem())); - pDlg->Execute(); + SwCreateAddressListDialog aDlg(GetFrameWeld(), pUserData->sURL, + m_pAddressPage->GetWizard()->GetConfigItem()); + aDlg.run(); } }; diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 73cb33b9b68f..2ce36a5dc45e 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -31,6 +31,7 @@ #include <vcl/event.hxx> #include <vcl/fixed.hxx> #include <vcl/commandevent.hxx> +#include <vcl/svapp.hxx> #include <svtools/controldims.hxx> #include <unotools/pathoptions.hxx> #include <sfx2/filedlghelper.hxx> @@ -50,36 +51,47 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::ui::dialogs; -class SwAddressControl_Impl : public Control +struct SwAddressFragment { - VclPtr<ScrollBar> m_pScrollBar; - VclPtr<Window> m_pWindow; + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Container> m_xOrigContainer; + std::unique_ptr<weld::Label> m_xLabel; + std::unique_ptr<weld::Entry> m_xEntry; - std::vector<VclPtr<FixedText> > m_aFixedTexts; - std::vector<VclPtr<Edit> > m_aEdits; - std::map<void*, sal_Int32> m_aEditLines; + SwAddressFragment(weld::Container* pGrid, int nLine) + : m_xBuilder(Application::CreateBuilder(pGrid, "modules/swriter/ui/addressfragment.ui")) + , m_xLabel(m_xBuilder->weld_label("label")) + , m_xEntry(m_xBuilder->weld_entry("entry")) + { + m_xLabel->set_grid_left_attach(0); + m_xLabel->set_grid_top_attach(nLine); + + m_xEntry->set_grid_left_attach(1); + m_xEntry->set_grid_top_attach(nLine); + } +}; + +class SwAddressControl_Impl +{ + std::map<weld::Entry*, sal_Int32> m_aEditLines; SwCSVData* m_pData; Size m_aWinOutputSize; - sal_Int32 m_nLineHeight; sal_uInt32 m_nCurrentDataSet; bool m_bNoDataSet; - DECL_LINK(ScrollHdl_Impl, ScrollBar*, void); - DECL_LINK(GotFocusHdl_Impl, Control&, void); - DECL_LINK(EditModifyHdl_Impl, Edit&, void); + std::unique_ptr<weld::ScrolledWindow> m_xScrollBar; + std::unique_ptr<weld::Container> m_xWindow; + std::vector<std::unique_ptr<SwAddressFragment>> m_aLines; - void MakeVisible(const tools::Rectangle& aRect); + DECL_LINK(GotFocusHdl_Impl, weld::Widget&, void); + DECL_LINK(EditModifyHdl_Impl, weld::Entry&, void); - virtual bool PreNotify( NotifyEvent& rNEvt ) override; - virtual void Command( const CommandEvent& rCEvt ) override; - virtual Size GetOptimalSize() const override; + void MakeVisible(const tools::Rectangle& aRect); public: - SwAddressControl_Impl(vcl::Window* pParent , WinBits nBits ); - virtual ~SwAddressControl_Impl() override; - virtual void dispose() override; + SwAddressControl_Impl(weld::Builder& rBuilder); void SetData(SwCSVData& rDBData); @@ -87,160 +99,54 @@ public: void CurrentDataSetInvalidated() { m_nCurrentDataSet = std::numeric_limits<sal_uInt32>::max(); } sal_uInt32 GetCurrentDataSet() const { return m_nCurrentDataSet; } void SetCursorTo(std::size_t nElement); - virtual void Resize() override; }; -SwAddressControl_Impl::SwAddressControl_Impl(vcl::Window* pParent, WinBits nBits ) : - Control(pParent, nBits), - m_pScrollBar(VclPtr<ScrollBar>::Create(this)), - m_pWindow(VclPtr<vcl::Window>::Create(this, WB_DIALOGCONTROL)), - m_pData(nullptr), - m_nLineHeight(0), - m_nCurrentDataSet(0), - m_bNoDataSet(true) -{ - long nScrollBarWidth = m_pScrollBar->GetOutputSize().Width(); - Size aSize = GetOutputSizePixel(); - - m_pWindow->SetSizePixel(Size(aSize.Width() - nScrollBarWidth, aSize.Height())); - m_aWinOutputSize = m_pWindow->GetOutputSizePixel(); - m_pWindow->Show(); - m_pScrollBar->Show(); - - Link<ScrollBar*,void> aScrollLink = LINK(this, SwAddressControl_Impl, ScrollHdl_Impl); - m_pScrollBar->SetScrollHdl(aScrollLink); - m_pScrollBar->SetEndScrollHdl(aScrollLink); - m_pScrollBar->EnableDrag(); -} - -extern "C" SAL_DLLPUBLIC_EXPORT void makeSwAddressControlImpl(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap &) +SwAddressControl_Impl::SwAddressControl_Impl(weld::Builder& rBuilder) + : m_pData(nullptr) + , m_nCurrentDataSet(0) + , m_bNoDataSet(true) + , m_xScrollBar(rBuilder.weld_scrolled_window("scrollwin")) + , m_xWindow(rBuilder.weld_container("CONTAINER")) { - rRet = VclPtr<SwAddressControl_Impl>::Create(pParent, WB_BORDER | WB_DIALOGCONTROL); -} - -SwAddressControl_Impl::~SwAddressControl_Impl() -{ - disposeOnce(); -} - -void SwAddressControl_Impl::dispose() -{ - for(auto& rText : m_aFixedTexts) - rText.disposeAndClear(); - m_aFixedTexts.clear(); - for(auto& rEdit : m_aEdits) - rEdit.disposeAndClear(); - m_aEdits.clear(); - m_pScrollBar.disposeAndClear(); - m_pWindow.disposeAndClear(); - Control::dispose(); } void SwAddressControl_Impl::SetData(SwCSVData& rDBData) { m_pData = &rDBData; //when the address data is updated then remove the controls an build again - if(!m_aFixedTexts.empty()) + if (!m_aLines.empty()) { - for(auto& rText : m_aFixedTexts) - rText.disposeAndClear(); - m_aFixedTexts.clear(); - for(auto& rEdit : m_aEdits) - rEdit.disposeAndClear(); - m_aEdits.clear(); + m_aLines.clear(); m_bNoDataSet = true; } - //now create appropriate controls - - long nFTXPos = m_pWindow->LogicToPixel(Point(RSC_SP_CTRL_X, RSC_SP_CTRL_X), MapMode(MapUnit::MapAppFont)).X(); - long nFTHeight = m_pWindow->LogicToPixel(Size(RSC_BS_CHARHEIGHT, RSC_BS_CHARHEIGHT), MapMode(MapUnit::MapAppFont)).Height(); - long nFTWidth = 0; - //determine the width of the FixedTexts - for(const auto& rHeader : m_pData->aDBColumnHeaders) - { - sal_Int32 nTemp = m_pWindow->GetTextWidth(rHeader); - if(nTemp > nFTWidth) - nFTWidth = nTemp; - } - //add some pixels - nFTWidth += 2; - long nEDXPos = nFTWidth + nFTXPos + - m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_DESC_X, RSC_SP_CTRL_DESC_X), MapMode(MapUnit::MapAppFont)).Width(); - long nEDHeight = m_pWindow->LogicToPixel(Size(RSC_CD_TEXTBOX_HEIGHT, RSC_CD_TEXTBOX_HEIGHT), MapMode(MapUnit::MapAppFont)).Height(); - long nEDWidth = m_aWinOutputSize.Width() - nEDXPos - nFTXPos; - m_nLineHeight = nEDHeight + m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_GROUP_Y, RSC_SP_CTRL_GROUP_Y), MapMode(MapUnit::MapAppFont)).Height(); - - long nEDYPos = m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_DESC_Y, RSC_SP_CTRL_DESC_Y), MapMode(MapUnit::MapAppFont)).Height(); - long nFTYPos = nEDYPos + nEDHeight - nFTHeight; - - Link<Control&,void> aFocusLink = LINK(this, SwAddressControl_Impl, GotFocusHdl_Impl); - Link<Edit&,void> aEditModifyLink = LINK(this, SwAddressControl_Impl, EditModifyHdl_Impl); - Edit* pLastEdit = nullptr; - sal_Int32 nVisibleLines = 0; + Link<weld::Widget&,void> aFocusLink = LINK(this, SwAddressControl_Impl, GotFocusHdl_Impl); + Link<weld::Entry&,void> aEditModifyLink = LINK(this, SwAddressControl_Impl, EditModifyHdl_Impl); sal_Int32 nLines = 0; - for(const auto& rHeader : m_pData->aDBColumnHeaders) + for (const auto& rHeader : m_pData->aDBColumnHeaders) { - VclPtr<FixedText> pNewFT = VclPtr<FixedText>::Create(m_pWindow, WB_RIGHT); - VclPtr<Edit> pNewED = VclPtr<Edit>::Create(m_pWindow, WB_BORDER); - //set nLines a position identifier - used in the ModifyHdl - m_aEditLines[pNewED.get()] = nLines; - pNewED->SetGetFocusHdl(aFocusLink); - pNewED->SetModifyHdl(aEditModifyLink); - - pNewFT->SetPosSizePixel(Point(nFTXPos, nFTYPos), Size(nFTWidth, nFTHeight)); - pNewED->SetPosSizePixel(Point(nEDXPos, nEDYPos), Size(nEDWidth, nEDHeight)); - if(nEDYPos + nEDHeight < m_aWinOutputSize.Height()) - ++nVisibleLines; - - pNewFT->SetText(rHeader); - - pNewFT->Show(); - pNewED->Show(); - m_aFixedTexts.push_back(pNewFT); - m_aEdits.push_back(pNewED); - pLastEdit = pNewED; - nEDYPos += m_nLineHeight; - nFTYPos += m_nLineHeight; - nLines++; - } - //scrollbar adjustment - if(pLastEdit) - { - //the m_aWindow has to be at least as high as the ScrollBar and it must include the last Edit - sal_Int32 nContentHeight = pLastEdit->GetPosPixel().Y() + nEDHeight + - m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_GROUP_Y, RSC_SP_CTRL_GROUP_Y), MapMode(MapUnit::MapAppFont)).Height(); - if(nContentHeight < m_pScrollBar->GetSizePixel().Height()) - { - nContentHeight = m_pScrollBar->GetSizePixel().Height(); - // Reset the scrollbar's thumb to the top before it is disabled. - m_pScrollBar->DoScroll(0); - m_pScrollBar->SetThumbPos(0); - m_pScrollBar->Enable(false); - } - else + m_aLines.emplace_back(new SwAddressFragment(m_xWindow.get(), nLines)); + + // when we have one line, measure it to get the line height to use as + // the basis for overall size request + if (nLines == 0) { - m_pScrollBar->Enable(); - m_pScrollBar->SetRange(Range(0, nLines)); - m_pScrollBar->SetThumbPos(0); - m_pScrollBar->SetVisibleSize(nVisibleLines); - // Reset the scroll bar position (especially if items deleted) - m_pScrollBar->DoScroll(m_pScrollBar->GetRangeMax()); - m_pScrollBar->DoScroll(0); + auto nLineHeight = m_xWindow->get_preferred_size().Height(); + m_xScrollBar->set_size_request(m_xScrollBar->get_approximate_digit_width() * 65, + nLineHeight * 10); } - Size aWinOutputSize(m_aWinOutputSize); - aWinOutputSize.setHeight( nContentHeight ); - m_pWindow->SetOutputSizePixel(aWinOutputSize); + weld::Label* pNewFT = m_aLines.back()->m_xLabel.get(); + weld::Entry* pNewED = m_aLines.back()->m_xEntry.get(); + //set nLines a position identifier - used in the ModifyHdl + m_aEditLines[pNewED] = nLines; + pNewED->connect_focus_in(aFocusLink); + pNewED->connect_changed(aEditModifyLink); + + pNewFT->set_label(rHeader); + + nLines++; } - // Even if no items in m_aEdits, the scrollbar will still exist; - // we might as well disable it. - if (m_aEdits.empty()) { - m_pScrollBar->DoScroll(0); - m_pScrollBar->SetThumbPos(0); - m_pScrollBar->Enable(false); - } - Resize(); } void SwAddressControl_Impl::SetCurrentDataSet(sal_uInt32 nSet) @@ -253,180 +159,95 @@ void SwAddressControl_Impl::SetCurrentDataSet(sal_uInt32 nSet) if(m_pData->aDBData.size() > m_nCurrentDataSet) { sal_uInt32 nIndex = 0; - for(auto& rEdit : m_aEdits) + for(auto& rLine : m_aLines) { OSL_ENSURE(nIndex < m_pData->aDBData[m_nCurrentDataSet].size(), "number of columns doesn't match number of Edits"); - rEdit->SetText(m_pData->aDBData[m_nCurrentDataSet][nIndex]); + rLine->m_xEntry->set_text(m_pData->aDBData[m_nCurrentDataSet][nIndex]); ++nIndex; } } } } -IMPL_LINK(SwAddressControl_Impl, ScrollHdl_Impl, ScrollBar*, pScroll, void) -{ - long nThumb = pScroll->GetThumbPos(); - m_pWindow->SetPosPixel(Point(0, - (m_nLineHeight * nThumb))); -} - -IMPL_LINK(SwAddressControl_Impl, GotFocusHdl_Impl, Control&, rControl, void) +IMPL_LINK(SwAddressControl_Impl, GotFocusHdl_Impl, weld::Widget&, rEdit, void) { - Edit* pEdit = static_cast<Edit*>(&rControl); - if(GetFocusFlags::Tab & pEdit->GetGetFocusFlags()) - { - tools::Rectangle aRect(pEdit->GetPosPixel(), pEdit->GetSizePixel()); - MakeVisible(aRect); - } + int x, y, width, height; + rEdit.get_extents_relative_to(*m_xWindow, x, y, width, height); + // the container has a border of 3 in the .ui + tools::Rectangle aRect(Point(x - 3, y - 3), Size(width + 6, height + 6)); + MakeVisible(aRect); } void SwAddressControl_Impl::MakeVisible(const tools::Rectangle & rRect) { - long nThumb = m_pScrollBar->GetThumbPos(); //determine range of visible positions - long nMinVisiblePos = - m_pWindow->GetPosPixel().Y(); - long nMaxVisiblePos = m_pScrollBar->GetSizePixel().Height() + nMinVisiblePos; - if( rRect.TopLeft().Y() < nMinVisiblePos) - { - nThumb -= 1 + ((nMinVisiblePos - rRect.TopLeft().Y()) / m_nLineHeight); - } - else if(rRect.BottomLeft().Y() > nMaxVisiblePos) - { - nThumb += 1 + ((nMaxVisiblePos - rRect.BottomLeft().Y()) / m_nLineHeight); - } - if(nThumb != m_pScrollBar->GetThumbPos()) - { - m_pScrollBar->SetThumbPos(nThumb); - ScrollHdl_Impl(m_pScrollBar); - } + auto nMinVisiblePos = m_xScrollBar->vadjustment_get_value(); + auto nMaxVisiblePos = nMinVisiblePos + m_xScrollBar->vadjustment_get_page_size(); + if (rRect.Top() < nMinVisiblePos || rRect.Bottom() > nMaxVisiblePos) + m_xScrollBar->vadjustment_set_value(rRect.Top()); } // copy data changes into database -IMPL_LINK(SwAddressControl_Impl, EditModifyHdl_Impl, Edit&, rEdit, void) +IMPL_LINK(SwAddressControl_Impl, EditModifyHdl_Impl, weld::Entry&, rEdit, void) { //get the data element number of the current set sal_Int32 nIndex = m_aEditLines[&rEdit]; //get the index of the set OSL_ENSURE(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index" ); - if(m_pData->aDBData.size() > m_nCurrentDataSet) + if (m_pData->aDBData.size() > m_nCurrentDataSet) { - m_pData->aDBData[m_nCurrentDataSet][nIndex] = rEdit.GetText(); + m_pData->aDBData[m_nCurrentDataSet][nIndex] = rEdit.get_text(); } } void SwAddressControl_Impl::SetCursorTo(std::size_t nElement) { - if(nElement < m_aEdits.size()) - { - Edit* pEdit = m_aEdits[nElement].get(); - pEdit->GrabFocus(); - tools::Rectangle aRect(pEdit->GetPosPixel(), pEdit->GetSizePixel()); - MakeVisible(aRect); - } - -} - -void SwAddressControl_Impl::Command( const CommandEvent& rCEvt ) -{ - switch ( rCEvt.GetCommand() ) + if (nElement < m_aLines.size()) { - case CommandEventId::Wheel: - case CommandEventId::StartAutoScroll: - case CommandEventId::AutoScroll: - { - const CommandWheelData* pWheelData = rCEvt.GetWheelData(); - if(pWheelData && !pWheelData->IsHorz() && CommandWheelMode::ZOOM != pWheelData->GetMode()) - { - HandleScrollCommand( rCEvt, nullptr, m_pScrollBar ); - } - } - break; - default: - Control::Command(rCEvt); - } -} - -bool SwAddressControl_Impl::PreNotify( NotifyEvent& rNEvt ) -{ - if(rNEvt.GetType() == MouseNotifyEvent::COMMAND) - { - const CommandEvent* pCEvt = rNEvt.GetCommandEvent(); - if( pCEvt->GetCommand() == CommandEventId::Wheel ) - { - Command(*pCEvt); - return true; - } - } - return Control::PreNotify(rNEvt); -} - -Size SwAddressControl_Impl::GetOptimalSize() const -{ - return LogicToPixel(Size(250, 160), MapMode(MapUnit::MapAppFont)); -} - -void SwAddressControl_Impl::Resize() -{ - Window::Resize(); - m_pScrollBar->SetSizePixel(Size(m_pScrollBar->GetOutputSizePixel().Width(), GetOutputSizePixel().Height())); - - if(m_nLineHeight) - m_pScrollBar->SetVisibleSize(m_pScrollBar->GetOutputSize().Height() / m_nLineHeight); - m_pScrollBar->DoScroll(0); - - long nScrollBarWidth = m_pScrollBar->GetOutputSize().Width(); - Size aSize = GetOutputSizePixel(); - - m_pWindow->SetSizePixel(Size(aSize.Width() - nScrollBarWidth, m_pWindow->GetOutputSizePixel().Height())); - m_pScrollBar->SetPosPixel(Point(aSize.Width() - nScrollBarWidth, 0)); - - if(!m_aEdits.empty()) - { - long nNewEditSize = aSize.Width() - (*m_aEdits.begin())->GetPosPixel().X() - nScrollBarWidth - 6; - - for(auto& rEdit : m_aEdits) - { - rEdit->SetSizePixel(Size(nNewEditSize, rEdit->GetSizePixel().Height())); - } + weld::Entry* pEdit = m_aLines[nElement]->m_xEntry.get(); + pEdit->grab_focus(); + GotFocusHdl_Impl(*pEdit); } } SwCreateAddressListDialog::SwCreateAddressListDialog( - vcl::Window* pParent, const OUString& rURL, SwMailMergeConfigItem const & rConfig) : - SfxModalDialog(pParent, "CreateAddressList", "modules/swriter/ui/createaddresslist.ui"), - m_sAddressListFilterName( SwResId( ST_FILTERNAME)), - m_sURL(rURL), - m_pCSVData( new SwCSVData ) -{ - get(m_pNewPB, "NEW"); - get(m_pDeletePB, "DELETE"); - get(m_pFindPB, "FIND"); - get(m_pCustomizePB, "CUSTOMIZE"); - get(m_pStartPB, "START"); - get(m_pPrevPB, "PREV"); - get(m_pSetNoNF, "SETNO-nospin"); - m_pSetNoNF->SetFirst(1); - m_pSetNoNF->SetMin(1); - get(m_pNextPB, "NEXT"); - get(m_pEndPB, "END"); - get(m_pOK, "ok"); - get(m_pAddressControl, "CONTAINER"); - - m_pNewPB->SetClickHdl(LINK(this, SwCreateAddressListDialog, NewHdl_Impl)); - m_pDeletePB->SetClickHdl(LINK(this, SwCreateAddressListDialog, DeleteHdl_Impl)); - m_pFindPB->SetClickHdl(LINK(this, SwCreateAddressListDialog, FindHdl_Impl)); - m_pCustomizePB->SetClickHdl(LINK(this, SwCreateAddressListDialog, CustomizeHdl_Impl)); - m_pOK->SetClickHdl(LINK(this, SwCreateAddressListDialog, OkHdl_Impl)); - - Link<Button*,void> aLk = LINK(this, SwCreateAddressListDialog, DBCursorHdl_Impl); - m_pStartPB->SetClickHdl(aLk); - m_pPrevPB->SetClickHdl(aLk); - m_pSetNoNF->SetModifyHdl(LINK(this, SwCreateAddressListDialog, DBNumCursorHdl_Impl)); - m_pNextPB->SetClickHdl(aLk); - m_pEndPB->SetClickHdl(aLk); - - if(!m_sURL.isEmpty()) + weld::Window* pParent, const OUString& rURL, SwMailMergeConfigItem const & rConfig) + : SfxDialogController(pParent, "modules/swriter/ui/createaddresslist.ui", "CreateAddressList") + , m_sAddressListFilterName(SwResId(ST_FILTERNAME)) + , m_sURL(rURL) + , m_pCSVData(new SwCSVData) + , m_xAddressControl(new SwAddressControl_Impl(*m_xBuilder)) + , m_xNewPB(m_xBuilder->weld_button("NEW")) + , m_xDeletePB(m_xBuilder->weld_button("DELETE")) + , m_xFindPB(m_xBuilder->weld_button("FIND")) + , m_xCustomizePB(m_xBuilder->weld_button("CUSTOMIZE")) + , m_xStartPB(m_xBuilder->weld_button("START")) + , m_xPrevPB(m_xBuilder->weld_button("PREV")) + , m_xSetNoED(m_xBuilder->weld_entry("SETNO-nospin")) + , m_xSetNoNF(m_xBuilder->weld_spin_button("SETNO")) + , m_xNextPB(m_xBuilder->weld_button("NEXT")) + , m_xEndPB(m_xBuilder->weld_button("END")) + , m_xOK(m_xBuilder->weld_button("ok")) +{ + m_xSetNoNF->set_min(1); + + m_xNewPB->connect_clicked(LINK(this, SwCreateAddressListDialog, NewHdl_Impl)); + m_xDeletePB->connect_clicked(LINK(this, SwCreateAddressListDialog, DeleteHdl_Impl)); + m_xFindPB->connect_clicked(LINK(this, SwCreateAddressListDialog, FindHdl_Impl)); + m_xCustomizePB->connect_clicked(LINK(this, SwCreateAddressListDialog, CustomizeHdl_Impl)); + m_xOK->connect_clicked(LINK(this, SwCreateAddressListDialog, OkHdl_Impl)); + + Link<weld::Button&,void> aLk = LINK(this, SwCreateAddressListDialog, DBCursorHdl_Impl); + m_xStartPB->connect_clicked(aLk); + m_xPrevPB->connect_clicked(aLk); + m_xSetNoED->connect_changed(LINK(this, SwCreateAddressListDialog, DBNumCursorHdl_Impl)); + m_xSetNoED->connect_focus_out(LINK(this, SwCreateAddressListDialog, RefreshNum_Impl)); + m_xNextPB->connect_clicked(aLk); + m_xEndPB->connect_clicked(aLk); + + if (!m_sURL.isEmpty()) { //file exists, has to be loaded here SfxMedium aMedium( m_sURL, StreamMode::READ ); @@ -486,71 +307,57 @@ SwCreateAddressListDialog::SwCreateAddressListDialog( m_pCSVData->aDBData.push_back(aNewData); } //now fill the address control - m_pAddressControl->SetData(*m_pCSVData); - m_pAddressControl->SetCurrentDataSet(0); - m_pSetNoNF->SetMax(m_pCSVData->aDBData.size()); + m_xAddressControl->SetData(*m_pCSVData); + m_xAddressControl->SetCurrentDataSet(0); + m_xSetNoNF->set_max(m_pCSVData->aDBData.size()); + + m_xSetNoNF->set_value(1); + RefreshNum_Impl(*m_xSetNoED); + UpdateButtons(); } SwCreateAddressListDialog::~SwCreateAddressListDialog() { - disposeOnce(); -} - -void SwCreateAddressListDialog::dispose() -{ - m_pCSVData.reset(); - m_pAddressControl.clear(); - m_pNewPB.clear(); - m_pDeletePB.clear(); - m_pFindPB.clear(); - m_pCustomizePB.clear(); - m_pStartPB.clear(); - m_pPrevPB.clear(); - m_pSetNoNF.clear(); - m_pNextPB.clear(); - m_pEndPB.clear(); - m_pOK.clear(); - m_xFindDlg.reset(); - SfxModalDialog::dispose(); } -IMPL_LINK_NOARG(SwCreateAddressListDialog, NewHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SwCreateAddressListDialog, NewHdl_Impl, weld::Button&, void) { - sal_uInt32 nCurrent = m_pAddressControl->GetCurrentDataSet(); + sal_uInt32 nCurrent = m_xAddressControl->GetCurrentDataSet(); std::vector<OUString> aNewData; aNewData.insert(aNewData.begin(), m_pCSVData->aDBColumnHeaders.size(), OUString()); m_pCSVData->aDBData.insert(m_pCSVData->aDBData.begin() + ++nCurrent, aNewData); - m_pSetNoNF->SetMax(m_pCSVData->aDBData.size()); + m_xSetNoNF->set_max(m_pCSVData->aDBData.size()); //the NumericField start at 1 - m_pSetNoNF->SetValue(nCurrent + 1); + m_xSetNoNF->set_value(nCurrent + 1); + RefreshNum_Impl(*m_xSetNoED); //the address control starts at 0 - m_pAddressControl->SetCurrentDataSet(nCurrent); + m_xAddressControl->SetCurrentDataSet(nCurrent); UpdateButtons(); } -IMPL_LINK_NOARG(SwCreateAddressListDialog, DeleteHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SwCreateAddressListDialog, DeleteHdl_Impl, weld::Button&, void) { - sal_uInt32 nCurrent = m_pAddressControl->GetCurrentDataSet(); - if(m_pCSVData->aDBData.size() > 1) + sal_uInt32 nCurrent = m_xAddressControl->GetCurrentDataSet(); + if (m_pCSVData->aDBData.size() > 1) { m_pCSVData->aDBData.erase(m_pCSVData->aDBData.begin() + nCurrent); - if(nCurrent) + if (nCurrent) --nCurrent; } else { // if only one set is available then clear the data m_pCSVData->aDBData[0].assign(m_pCSVData->aDBData[0].size(), OUString()); - m_pDeletePB->Enable(false); + m_xDeletePB->set_sensitive(false); } - m_pAddressControl->CurrentDataSetInvalidated(); - m_pAddressControl->SetCurrentDataSet(nCurrent); - m_pSetNoNF->SetMax(m_pCSVData->aDBData.size()); + m_xAddressControl->CurrentDataSetInvalidated(); + m_xAddressControl->SetCurrentDataSet(nCurrent); + m_xSetNoNF->set_max(m_pCSVData->aDBData.size()); UpdateButtons(); } -IMPL_LINK_NOARG(SwCreateAddressListDialog, FindHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SwCreateAddressListDialog, FindHdl_Impl, weld::Button&, void) { if (!m_xFindDlg) { @@ -565,14 +372,14 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, FindHdl_Impl, Button*, void) m_xFindDlg->show(!m_xFindDlg->get_visible()); } -IMPL_LINK_NOARG(SwCreateAddressListDialog, CustomizeHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SwCreateAddressListDialog, CustomizeHdl_Impl, weld::Button&, void) { - SwCustomizeAddressListDialog aDlg(GetFrameWeld(), *m_pCSVData); + SwCustomizeAddressListDialog aDlg(m_xDialog.get(), *m_pCSVData); if (aDlg.run() == RET_OK) { m_pCSVData = aDlg.ReleaseNewData(); - m_pAddressControl->SetData(*m_pCSVData); - m_pAddressControl->SetCurrentDataSet(m_pAddressControl->GetCurrentDataSet()); + m_xAddressControl->SetData(*m_pCSVData); + m_xAddressControl->SetCurrentDataSet(m_xAddressControl->GetCurrentDataSet()); } //update find dialog @@ -609,12 +416,12 @@ void lcl_WriteValues(const std::vector<OUString> *pFields, SvStream* pStream) } -IMPL_LINK_NOARG(SwCreateAddressListDialog, OkHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SwCreateAddressListDialog, OkHdl_Impl, weld::Button&, void) { if(m_sURL.isEmpty()) { sfx2::FileDialogHelper aDlgHelper(TemplateDescription::FILESAVE_SIMPLE, - FileDialogFlags::NONE, GetFrameWeld()); + FileDialogFlags::NONE, m_xDialog.get()); uno::Reference < XFilePicker3 > xFP = aDlgHelper.GetFilePicker(); const OUString sPath( SvtPathOptions().SubstituteVariable("$(userurl)/database") ); @@ -645,56 +452,68 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, OkHdl_Impl, Button*, void) lcl_WriteValues(&rData, pStream); } aMedium.Commit(); - EndDialog(RET_OK); + m_xDialog->response(RET_OK); } } -IMPL_LINK(SwCreateAddressListDialog, DBCursorHdl_Impl, Button*, pButton, void) +IMPL_LINK(SwCreateAddressListDialog, DBCursorHdl_Impl, weld::Button&, rButton, void) { - sal_uInt32 nValue = static_cast< sal_uInt32 >(m_pSetNoNF->GetValue()); + int nValue = m_xSetNoNF->get_value(); - if(pButton == m_pStartPB) + if (&rButton == m_xStartPB.get()) nValue = 1; - else if(pButton == m_pPrevPB) + else if (&rButton == m_xPrevPB.get()) { - if(nValue > 1) + if (nValue > 1) --nValue; } - else if(pButton == m_pNextPB) + else if (&rButton == m_xNextPB.get()) { - if(nValue < static_cast<sal_uInt32>(m_pSetNoNF->GetMax())) + if (nValue < m_xSetNoNF->get_max()) ++nValue; } else //m_aEndPB - nValue = static_cast< sal_uInt32 >(m_pSetNoNF->GetMax()); - if(nValue != m_pSetNoNF->GetValue()) + nValue = m_xSetNoNF->get_max(); + if (nValue != m_xSetNoNF->get_value()) { - m_pSetNoNF->SetValue(nValue); - DBNumCursorHdl_Impl(*m_pSetNoNF); + m_xSetNoNF->set_value(nValue); + RefreshNum_Impl(*m_xSetNoED); + DBNumCursor(); } } -IMPL_LINK_NOARG(SwCreateAddressListDialog, DBNumCursorHdl_Impl, Edit&, void) +IMPL_LINK_NOARG(SwCreateAddressListDialog, DBNumCursorHdl_Impl, weld::Entry&, void) +{ + m_xSetNoNF->set_text(m_xSetNoED->get_text()); + DBNumCursor(); +} + +IMPL_LINK_NOARG(SwCreateAddressListDialog, RefreshNum_Impl, weld::Widget&, void) +{ + m_xSetNoED->set_text(OUString::number(m_xSetNoNF->get_value())); +} + +void SwCreateAddressListDialog::DBNumCursor() { - m_pAddressControl->SetCurrentDataSet( static_cast< sal_uInt32 >(m_pSetNoNF->GetValue() - 1) ); + m_xAddressControl->SetCurrentDataSet(m_xSetNoNF->get_value() - 1); UpdateButtons(); } void SwCreateAddressListDialog::UpdateButtons() { - sal_uInt32 nCurrent = static_cast< sal_uInt32 >(m_pSetNoNF->GetValue() ); + sal_uInt32 nCurrent = static_cast< sal_uInt32 >(m_xSetNoNF->get_value() ); sal_uInt32 nSize = static_cast<sal_uInt32>(m_pCSVData->aDBData.size()); - m_pStartPB->Enable(nCurrent != 1); - m_pPrevPB->Enable(nCurrent != 1); - m_pNextPB->Enable(nCurrent != nSize); - m_pEndPB->Enable(nCurrent != nSize); - m_pDeletePB->Enable(nSize > 0); + m_xStartPB->set_sensitive(nCurrent != 1); + m_xPrevPB->set_sensitive(nCurrent != 1); + m_xNextPB->set_sensitive(nCurrent != nSize); + m_xEndPB->set_sensitive(nCurrent != nSize); + m_xDeletePB->set_sensitive(nSize > 0); } void SwCreateAddressListDialog::Find(const OUString& rSearch, sal_Int32 nColumn) { const OUString sSearch = rSearch.toAsciiLowerCase(); - sal_uInt32 nCurrent = m_pAddressControl->GetCurrentDataSet(); + sal_uInt32 nCurrent = m_xAddressControl->GetCurrentDataSet(); //search forward bool bFound = false; sal_uInt32 nStart = nCurrent + 1; @@ -728,15 +547,16 @@ void SwCreateAddressListDialog::Find(const OUString& rSearch, sal_Int32 nColumn) } if(bFound) { - m_pAddressControl->SetCurrentDataSet(nPos); - m_pSetNoNF->SetValue( nPos + 1 ); + m_xAddressControl->SetCurrentDataSet(nPos); + m_xSetNoNF->set_value( nPos + 1 ); + RefreshNum_Impl(*m_xSetNoED); UpdateButtons(); - m_pAddressControl->SetCursorTo(nElement); + m_xAddressControl->SetCursorTo(nElement); } } SwFindEntryDialog::SwFindEntryDialog(SwCreateAddressListDialog* pParent) - : GenericDialogController(pParent->GetFrameWeld(), "modules/swriter/ui/findentrydialog.ui", "FindEntryDialog") + : GenericDialogController(pParent->getDialog(), "modules/swriter/ui/findentrydialog.ui", "FindEntryDialog") , m_pParent(pParent) , m_xFindED(m_xBuilder->weld_entry("entry")) , m_xFindOnlyCB(m_xBuilder->weld_check_button("findin")) diff --git a/sw/source/ui/dbui/createaddresslistdialog.hxx b/sw/source/ui/dbui/createaddresslistdialog.hxx index 87d2d72fe842..75e1ca5bd703 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.hxx +++ b/sw/source/ui/dbui/createaddresslistdialog.hxx @@ -36,53 +36,50 @@ struct SwCSVData }; class SwFindEntryDialog; -class SwCreateAddressListDialog : public SfxModalDialog +class SwCreateAddressListDialog : public SfxDialogController { - VclPtr<SwAddressControl_Impl> m_pAddressControl; - - VclPtr<PushButton> m_pNewPB; - VclPtr<PushButton> m_pDeletePB; - VclPtr<PushButton> m_pFindPB; - VclPtr<PushButton> m_pCustomizePB; - - VclPtr<PushButton> m_pStartPB; - VclPtr<PushButton> m_pPrevPB; - VclPtr<NumericField> m_pSetNoNF; - VclPtr<PushButton> m_pNextPB; - VclPtr<PushButton> m_pEndPB; - - - VclPtr<OKButton> m_pOK; - OUString const m_sAddressListFilterName; OUString m_sURL; std::unique_ptr<SwCSVData> m_pCSVData; std::unique_ptr<SwFindEntryDialog> m_xFindDlg; - DECL_LINK(NewHdl_Impl, Button*, void); - DECL_LINK(DeleteHdl_Impl, Button*, void); - DECL_LINK(FindHdl_Impl, Button*, void); - DECL_LINK(CustomizeHdl_Impl, Button*, void); - DECL_LINK(OkHdl_Impl, Button*, void); - DECL_LINK(DBCursorHdl_Impl, Button*, void); - DECL_LINK(DBNumCursorHdl_Impl, Edit&, void); + std::unique_ptr<SwAddressControl_Impl> m_xAddressControl; + std::unique_ptr<weld::Button> m_xNewPB; + std::unique_ptr<weld::Button> m_xDeletePB; + std::unique_ptr<weld::Button> m_xFindPB; + std::unique_ptr<weld::Button> m_xCustomizePB; + std::unique_ptr<weld::Button> m_xStartPB; + std::unique_ptr<weld::Button> m_xPrevPB; + std::unique_ptr<weld::Entry> m_xSetNoED; + std::unique_ptr<weld::SpinButton> m_xSetNoNF; + std::unique_ptr<weld::Button> m_xNextPB; + std::unique_ptr<weld::Button> m_xEndPB; + std::unique_ptr<weld::Button> m_xOK; + + DECL_LINK(NewHdl_Impl, weld::Button&, void); + DECL_LINK(DeleteHdl_Impl, weld::Button&, void); + DECL_LINK(FindHdl_Impl, weld::Button&, void); + DECL_LINK(CustomizeHdl_Impl, weld::Button&, void); + DECL_LINK(OkHdl_Impl, weld::Button&, void); + DECL_LINK(DBCursorHdl_Impl, weld::Button&, void); + DECL_LINK(DBNumCursorHdl_Impl, weld::Entry&, void); + DECL_LINK(RefreshNum_Impl, weld::Widget&, void); + void DBNumCursor(); void UpdateButtons(); public: - SwCreateAddressListDialog( - vcl::Window* pParent, const OUString& rURL, SwMailMergeConfigItem const & rConfig); + SwCreateAddressListDialog(weld::Window* pParent, const OUString& rURL, SwMailMergeConfigItem const & rConfig); virtual ~SwCreateAddressListDialog() override; - virtual void dispose() override; - const OUString& GetURL() const { return m_sURL; } + const OUString& GetURL() const { return m_sURL; } void Find( const OUString& rSearch, sal_Int32 nColumn); }; class SwFindEntryDialog : public weld::GenericDialogController { - VclPtr<SwCreateAddressListDialog> m_pParent; + SwCreateAddressListDialog* m_pParent; std::unique_ptr<weld::Entry> m_xFindED; std::unique_ptr<weld::CheckButton> m_xFindOnlyCB; diff --git a/sw/uiconfig/swriter/ui/addressfragment.ui b/sw/uiconfig/swriter/ui/addressfragment.ui new file mode 100644 index 000000000000..27ea4759aac4 --- /dev/null +++ b/sw/uiconfig/swriter/ui/addressfragment.ui @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.1 --> +<interface domain="sw"> + <requires lib="gtk+" version="3.18"/> + <object class="GtkEntry" id="entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">False</property> + <property name="activates_default">True</property> + <property name="width_chars">14</property> + </object> + <object class="GtkLabel" id="label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">entry</property> + <property name="xalign">0</property> + </object> +</interface> diff --git a/sw/uiconfig/swriter/ui/createaddresslist.ui b/sw/uiconfig/swriter/ui/createaddresslist.ui index e19e9674b7ef..db16de638378 100644 --- a/sw/uiconfig/swriter/ui/createaddresslist.ui +++ b/sw/uiconfig/swriter/ui/createaddresslist.ui @@ -1,14 +1,21 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.22.1 --> <interface domain="sw"> <requires lib="gtk+" version="3.18"/> - <requires lib="LibreOffice" version="1.0"/> + <object class="GtkAdjustment" id="adjustment1"> + <property name="upper">100</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> <object class="GtkDialog" id="CreateAddressList"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="createaddresslist|CreateAddressList">New Address List</property> <property name="resizable">False</property> <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -92,7 +99,7 @@ <property name="halign">start</property> <property name="label" translatable="yes" context="createaddresslist|ADDRESS_INFORMATION">Address Information</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">CONTAINER</property> + <property name="mnemonic_widget">scrollwin</property> </object> <packing> <property name="expand">False</property> @@ -101,14 +108,62 @@ </packing> </child> <child> - <object class="swuilo-SwAddressControlImpl" id="CONTAINER"> + <object class="GtkScrolledWindow" id="scrollwin"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">always</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <object class="GtkGrid" id="CONTAINER"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="orientation">vertical</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + </child> + </object> + </child> </object> <packing> - <property name="expand">True</property> + <property name="expand">False</property> <property name="fill">True</property> <property name="position">1</property> </packing> @@ -123,10 +178,10 @@ <object class="GtkLabel" id="VIEW_ENTRIES"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="createaddresslist|VIEW_ENTRIES">Sho_w entry number</property> <property name="use_underline">True</property> <property name="mnemonic_widget">grid2</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -190,10 +245,32 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="SETNO-nospin"> + <object class="GtkGrid"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="numeric">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkSpinButton" id="SETNO"> + <property name="can_focus">True</property> + <property name="no_show_all">True</property> + <property name="adjustment">adjustment1</property> + <property name="numeric">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="SETNO-nospin"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="width_chars">4</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> </object> <packing> <property name="left_attach">2</property> diff --git a/sw/uiconfig/swriter/ui/findentrydialog.ui b/sw/uiconfig/swriter/ui/findentrydialog.ui index cb57e2aad4aa..671522ba4b1c 100644 --- a/sw/uiconfig/swriter/ui/findentrydialog.ui +++ b/sw/uiconfig/swriter/ui/findentrydialog.ui @@ -8,9 +8,6 @@ <property name="default_width">0</property> <property name="default_height">0</property> <property name="type_hint">dialog</property> - <child type="titlebar"> - <placeholder/> - </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="visible">True</property> |