summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-03-03 17:24:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-03-03 22:13:26 +0100
commit1d9c7ec1f1bfe527fe83edb6afd3c924d0243328 (patch)
tree911f5ca86738f366e069f1bc467d566577375788 /cui
parentdef5287c1e77bce18d9a403527c23d754a1ada33 (diff)
weld SvxMacroAssignDlg
and SvxEventConfigPage, SvxMacroTabPage_, SvxMacroTabPage Change-Id: I98a2e71794f098015927dc7cd7ec4e258f56e703 Reviewed-on: https://gerrit.libreoffice.org/68649 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/inc/bitmaps.hlst3
-rw-r--r--cui/source/customize/cfg.cxx2
-rw-r--r--cui/source/customize/eventdlg.cxx69
-rw-r--r--cui/source/customize/eventdlg.hxx20
-rw-r--r--cui/source/customize/macropg.cxx397
-rw-r--r--cui/source/customize/macropg_impl.hxx12
-rw-r--r--cui/source/factory/dlgfact.cxx23
-rw-r--r--cui/source/factory/dlgfact.hxx2
-rw-r--r--cui/source/inc/headertablistbox.hxx31
-rw-r--r--cui/source/inc/macropg.hxx21
-rw-r--r--cui/uiconfig/ui/eventsconfigpage.ui139
-rw-r--r--cui/uiconfig/ui/macroassigndialog.ui9
-rw-r--r--cui/uiconfig/ui/macroassignpage.ui146
13 files changed, 290 insertions, 584 deletions
diff --git a/cui/inc/bitmaps.hlst b/cui/inc/bitmaps.hlst
index ae3516fe1f60..c6c2d19b3407 100644
--- a/cui/inc/bitmaps.hlst
+++ b/cui/inc/bitmaps.hlst
@@ -71,6 +71,9 @@
#define RID_SVXBMP_LEGTYP2 "svx/res/legtyp2.png"
#define RID_SVXBMP_LEGTYP3 "svx/res/legtyp3.png"
+#define RID_SVXBMP_COMPONENT "res/component_16.png"
+#define RID_SVXBMP_MACRO "svx/res/id018.png"
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 45301ee71b60..63db3c515db1 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -198,7 +198,7 @@ static VclPtr<SfxTabPage> CreateSvxToolbarConfigPage( TabPageParent pParent, con
static VclPtr<SfxTabPage> CreateSvxEventConfigPage( TabPageParent pParent, const SfxItemSet* rSet )
{
- return VclPtr<SvxEventConfigPage>::Create( pParent.pParent, *rSet, SvxEventConfigPage::EarlyInit() );
+ return VclPtr<SvxEventConfigPage>::Create(pParent, *rSet, SvxEventConfigPage::EarlyInit());
}
/******************************************************************************
diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx
index c7f1559330a2..d052a07ca8f0 100644
--- a/cui/source/customize/eventdlg.cxx
+++ b/cui/source/customize/eventdlg.cxx
@@ -44,34 +44,29 @@
#include <headertablistbox.hxx>
#include "macropg_impl.hxx"
+#include <bitmaps.hlst>
#include <cfgutil.hxx>
#include <cfg.hxx>
-
using namespace ::com::sun::star;
-SvxEventConfigPage::SvxEventConfigPage(vcl::Window *pParent, const SfxItemSet& rSet,
+SvxEventConfigPage::SvxEventConfigPage(TabPageParent pParent, const SfxItemSet& rSet,
SvxEventConfigPage::EarlyInit)
- : SvxMacroTabPage_(pParent, "EventsConfigPage",
- "cui/ui/eventsconfigpage.ui", rSet)
+ : SvxMacroTabPage_(pParent, "cui/ui/eventsconfigpage.ui", "EventsConfigPage", rSet)
+ , m_xSaveInListBox(m_xBuilder->weld_combo_box("savein"))
{
- get(m_pSaveInListBox, "savein");
-
- mpImpl->sStrEvent = get<FixedText>("eventft")->GetText();
- mpImpl->sAssignedMacro = get<FixedText>("actionft")->GetText();
- get(mpImpl->pEventLB, "events");
- Size aSize(LogicToPixel(Size(205, 229), MapMode(MapUnit::MapAppFont)));
- mpImpl->pEventLB->set_width_request(aSize.Width());
- mpImpl->pEventLB->set_height_request(aSize.Height());
- get(mpImpl->pAssignPB, "macro");
- get(mpImpl->pDeletePB, "delete");
- mpImpl->aMacroImg = get<FixedImage>("macroimg")->GetImage();
- mpImpl->aComponentImg = get<FixedImage>("componentimg")->GetImage();
+ mpImpl->xEventLB = m_xBuilder->weld_tree_view("events");
+ mpImpl->xAssignPB = m_xBuilder->weld_button("macro");
+ mpImpl->xDeletePB = m_xBuilder->weld_button("delete");
+ mpImpl->xAssignComponentPB = m_xBuilder->weld_button("component");
+
+ mpImpl->xEventLB->set_size_request(mpImpl->xEventLB->get_approximate_digit_width() * 70,
+ mpImpl->xEventLB->get_height_rows(20));
InitResources();
- m_pSaveInListBox->SetSelectHdl( LINK( this, SvxEventConfigPage,
+ m_xSaveInListBox->connect_changed( LINK( this, SvxEventConfigPage,
SelectHdl_Impl ) );
uno::Reference< frame::XGlobalEventBroadcaster > xSupplier;
@@ -80,10 +75,8 @@ SvxEventConfigPage::SvxEventConfigPage(vcl::Window *pParent, const SfxItemSet& r
frame::theGlobalEventBroadcaster::get(::comphelper::getProcessComponentContext());
m_xAppEvents = xSupplier->getEvents();
- const sal_Int32 nPos = m_pSaveInListBox->InsertEntry(
- utl::ConfigManager::getProductName() );
- m_pSaveInListBox->SetEntryData( nPos, new bool(true) );
- m_pSaveInListBox->SelectEntryPos( nPos );
+ m_xSaveInListBox->append(OUString::boolean(true), utl::ConfigManager::getProductName());
+ m_xSaveInListBox->set_active(0);
}
void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFrame )
@@ -93,7 +86,7 @@ void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFra
InitAndSetHandler( m_xAppEvents, m_xDocumentEvents, m_xDocumentModifiable );
- SelectHdl_Impl( *m_pSaveInListBox );
+ SelectHdl_Impl( *m_xSaveInListBox );
}
SvxEventConfigPage::~SvxEventConfigPage()
@@ -101,22 +94,6 @@ SvxEventConfigPage::~SvxEventConfigPage()
disposeOnce();
}
-void SvxEventConfigPage::dispose()
-{
- // need to delete the user data
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- SvTreeListEntry* pE = rListBox.GetEntry( 0 );
- while( pE )
- {
- OUString const * pEventName = static_cast<OUString const *>(pE->GetUserData());
- delete pEventName;
- pE->SetUserData(nullptr);
- pE = pE->NextSibling();
- }
- m_pSaveInListBox.clear();
- SvxMacroTabPage_::dispose();
-}
-
void SvxEventConfigPage::ImplInitDocument()
{
uno::Reference< frame::XFrame > xFrame( GetFrame() );
@@ -149,10 +126,9 @@ void SvxEventConfigPage::ImplInitDocument()
m_xDocumentModifiable.set(xModel, css::uno::UNO_QUERY);
OUString aTitle = ::comphelper::DocumentInfo::getDocumentTitle( xModel );
- const sal_Int32 nPos = m_pSaveInListBox->InsertEntry( aTitle );
- m_pSaveInListBox->SetEntryData( nPos, new bool(false) );
- m_pSaveInListBox->SelectEntryPos( nPos );
+ m_xSaveInListBox->append(OUString::boolean(false), aTitle);
+ m_xSaveInListBox->set_active(m_xSaveInListBox->get_count() - 1);
}
}
catch( const uno::Exception& )
@@ -161,13 +137,12 @@ void SvxEventConfigPage::ImplInitDocument()
}
}
-IMPL_LINK_NOARG( SvxEventConfigPage, SelectHdl_Impl, ListBox&, void )
+IMPL_LINK_NOARG( SvxEventConfigPage, SelectHdl_Impl, weld::ComboBox&, void )
{
- bool* bApp = static_cast<bool*>(m_pSaveInListBox->GetEntryData(
- m_pSaveInListBox->GetSelectedEntryPos()));
+ bool bApp = m_xSaveInListBox->get_active_id().toBoolean();
- mpImpl->pEventLB->SetUpdateMode( false );
- if ( *bApp )
+ mpImpl->xEventLB->freeze();
+ if (bApp)
{
SetReadOnly( false );
SvxMacroTabPage_::DisplayAppEvents( true );
@@ -199,7 +174,7 @@ IMPL_LINK_NOARG( SvxEventConfigPage, SelectHdl_Impl, ListBox&, void )
SvxMacroTabPage_::DisplayAppEvents( false );
}
- mpImpl->pEventLB->SetUpdateMode( true );
+ mpImpl->xEventLB->thaw();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/customize/eventdlg.hxx b/cui/source/customize/eventdlg.hxx
index 697fd5042215..0b2ce1a64ea7 100644
--- a/cui/source/customize/eventdlg.hxx
+++ b/cui/source/customize/eventdlg.hxx
@@ -19,34 +19,31 @@
#ifndef INCLUDED_CUI_SOURCE_CUSTOMIZE_EVENTDLG_HXX
#define INCLUDED_CUI_SOURCE_CUSTOMIZE_EVENTDLG_HXX
-#include <vcl/menubtn.hxx>
-
-#include <vcl/fixed.hxx>
#include <sfx2/evntconf.hxx>
+#include <vcl/weld.hxx>
#include <macropg.hxx>
#include <com/sun/star/frame/XFrame.hpp>
class SvxEventConfigPage : public SvxMacroTabPage_
{
- VclPtr<ListBox> m_pSaveInListBox;
-
css::uno::Reference< css::container::XNameReplace > m_xAppEvents;
css::uno::Reference< css::container::XNameReplace > m_xDocumentEvents;
css::uno::Reference< css::util::XModifiable > m_xDocumentModifiable;
- DECL_LINK( SelectHdl_Impl, ListBox&, void );
+ std::unique_ptr<weld::ComboBox> m_xSaveInListBox;
+
+ DECL_LINK( SelectHdl_Impl, weld::ComboBox&, void );
SvxEventConfigPage (const SvxEventConfigPage &) = delete;
SvxEventConfigPage & operator= (const SvxEventConfigPage &) = delete;
public:
- /// this is only to let callers know that there is a LateInit which *must* be called
- struct EarlyInit { };
- SvxEventConfigPage( vcl::Window *pParent, const SfxItemSet& rSet, EarlyInit );
- virtual ~SvxEventConfigPage() override;
- virtual void dispose() override;
+ /// this is only to let callers know that there is a LateInit which *must* be called
+ struct EarlyInit { };
+ SvxEventConfigPage(TabPageParent pParent, const SfxItemSet& rSet, EarlyInit);
+ virtual ~SvxEventConfigPage() override;
void LateInit( const css::uno::Reference< css::frame::XFrame >& _rxFrame );
@@ -54,7 +51,6 @@ private:
void ImplInitDocument();
};
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 189a44cb2c8d..ec69a666e477 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -30,9 +30,10 @@
#include <sfx2/objsh.hxx>
#include <com/sun/star/container/NoSuchElementException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <dialmgr.hxx>
-#include <cfgutil.hxx>
+#include <bitmaps.hlst>
#include <cfg.hxx>
+#include <cfgutil.hxx>
+#include <dialmgr.hxx>
#include <helpids.h>
#include <headertablistbox.hxx>
#include "macropg_impl.hxx"
@@ -51,11 +52,7 @@ using namespace ::com::sun::star::uno;
static const char aVndSunStarUNO[] = "vnd.sun.star.UNO:";
SvxMacroTabPage_Impl::SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet )
- : pAssignPB(nullptr)
- , pAssignComponentPB(nullptr)
- , pDeletePB(nullptr)
- , pEventLB(nullptr)
- , bReadOnly(false)
+ : bReadOnly(false)
, bIDEDialogMode(false)
{
const SfxPoolItem* pItem;
@@ -63,137 +60,6 @@ SvxMacroTabPage_Impl::SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet )
bIDEDialogMode = static_cast<const SfxBoolItem*>(pItem)->GetValue();
}
-// attention, this array is indexed directly (0, 1, ...) in the code
-static const long nTabs[] =
-{
- 0, 90
-};
-
-#define TAB_WIDTH_MIN 10
-
-// IDs for items in HeaderBar of EventLB
-#define ITEMID_EVENT 1
-#define ITEMID_ASSMACRO 2
-
-
-#define LB_MACROS_ITEMPOS 2
-
-
-IMPL_LINK( MacroEventListBox, HeaderEndDrag_Impl, HeaderBar*, pBar, void )
-{
- DBG_ASSERT( pBar == maHeaderBar.get(), "*MacroEventListBox::HeaderEndDrag_Impl: something is wrong here..." );
-
- if( !maHeaderBar->GetCurItemId() )
- return;
-
- if( !maHeaderBar->IsItemMode() )
- {
- Size aSz;
- sal_uInt16 _nTabs = maHeaderBar->GetItemCount();
- long nWidth = maHeaderBar->GetItemSize( ITEMID_EVENT );
- long nBarWidth = maHeaderBar->GetSizePixel().Width();
-
- if( nWidth < TAB_WIDTH_MIN )
- maHeaderBar->SetItemSize( ITEMID_EVENT, TAB_WIDTH_MIN );
- else if( ( nBarWidth - nWidth ) < TAB_WIDTH_MIN )
- maHeaderBar->SetItemSize( ITEMID_EVENT, nBarWidth - TAB_WIDTH_MIN );
-
- {
- long nTmpSz = 0;
- for( sal_uInt16 i = 1 ; i < _nTabs ; ++i )
- {
- long _nWidth = maHeaderBar->GetItemSize( i );
- aSz.setWidth( _nWidth + nTmpSz );
- nTmpSz += _nWidth;
- maListBox->SetTab( i, PixelToLogic( aSz, MapMode( MapUnit::MapAppFont ) ).Width() );
- }
- }
- }
-}
-
-bool MacroEventListBox::EventNotify( NotifyEvent& rNEvt )
-{
- bool bRet = Control::EventNotify(rNEvt);
-
- if( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
- {
- if ( rNEvt.GetWindow() != maListBox.get() )
- if (maListBox)
- maListBox->GrabFocus();
- }
-
- return bRet;
-}
-
-MacroEventListBox::MacroEventListBox( vcl::Window* pParent, WinBits nStyle )
- : Control( pParent, nStyle )
- , maHeaderBar( VclPtr<HeaderBar>::Create( this, WB_BUTTONSTYLE | WB_BOTTOMBORDER ) )
- , maListBox( VclPtr<SvHeaderTabListBox>::Create( this, WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ) )
-{
- maListBox->SetHelpId( HID_MACRO_HEADERTABLISTBOX );
-
- // enable the cell focus to show visible focus
- maListBox->EnableCellFocus();
-}
-
-MacroEventListBox::~MacroEventListBox()
-{
- disposeOnce();
-}
-
-void MacroEventListBox::dispose()
-{
- maHeaderBar.disposeAndClear();
- maListBox.disposeAndClear();
- Control::dispose();
-}
-
-VCL_BUILDER_FACTORY_CONSTRUCTOR(MacroEventListBox, WB_TABSTOP)
-
-Size MacroEventListBox::GetOptimalSize() const
-{
- return LogicToPixel(Size(192, 72), MapMode(MapUnit::MapAppFont ));
-}
-
-void MacroEventListBox::Resize()
-{
- Control::Resize();
-
- // calc pos and size of header bar
- Point aPnt( 0, 0 );
- Size aSize( maHeaderBar->CalcWindowSizePixel() );
- Size aCtrlSize( GetOutputSizePixel() );
- aSize.setWidth( aCtrlSize.Width() );
- maHeaderBar->SetPosSizePixel( aPnt, aSize );
-
- // calc pos and size of ListBox
- aPnt.AdjustY(aSize.Height() );
- aSize.setHeight( aCtrlSize.Height() - aSize.Height() );
- maListBox->SetPosSizePixel( aPnt, aSize );
-}
-
-void MacroEventListBox::ConnectElements()
-{
- Resize();
-
- // set handler
- maHeaderBar->SetEndDragHdl( LINK( this, MacroEventListBox, HeaderEndDrag_Impl ) );
-
- maListBox->InitHeaderBar( maHeaderBar.get() );
-}
-
-void MacroEventListBox::Show()
-{
- maListBox->Show();
- maHeaderBar->Show();
-}
-
-void MacroEventListBox::Enable()
-{
- maListBox->Enable();
- maHeaderBar->Enable();
-}
-
CuiMacroEventListBox::CuiMacroEventListBox(std::unique_ptr<weld::TreeView> xTreeView)
: m_xTreeView(std::move(xTreeView))
{
@@ -210,23 +76,22 @@ CuiMacroEventListBox::~CuiMacroEventListBox()
// and it is not read only
void SvxMacroTabPage_::EnableButtons()
{
- const SvTreeListEntry* pE = mpImpl->pEventLB->GetListBox().FirstSelected();
- if ( pE )
+ int nEvent = mpImpl->xEventLB->get_selected_index();
+ if (nEvent != -1)
{
- mpImpl->pDeletePB->Enable( !mpImpl->bReadOnly );
-
- mpImpl->pAssignPB->Enable( !mpImpl->bReadOnly );
- if( mpImpl->pAssignComponentPB )
- mpImpl->pAssignComponentPB->Enable( !mpImpl->bReadOnly );
+ mpImpl->xDeletePB->set_sensitive( !mpImpl->bReadOnly );
+ mpImpl->xAssignPB->set_sensitive( !mpImpl->bReadOnly );
+ if( mpImpl->xAssignComponentPB )
+ mpImpl->xAssignComponentPB->set_sensitive( !mpImpl->bReadOnly );
}
}
-SvxMacroTabPage_::SvxMacroTabPage_(vcl::Window* pParent, const OString& rID,
- const OUString& rUIXMLDescription, const SfxItemSet& rAttrSet)
- : SfxTabPage( pParent, rID, rUIXMLDescription, &rAttrSet ),
- bDocModified(false),
- bAppEvents(false),
- bInitialized(false)
+SvxMacroTabPage_::SvxMacroTabPage_(TabPageParent pParent, const OUString& rUIXMLDescription,
+ const OString& rID, const SfxItemSet& rAttrSet)
+ : SfxTabPage(pParent, rUIXMLDescription, rID, &rAttrSet)
+ , bDocModified(false)
+ , bAppEvents(false)
+ , bInitialized(false)
{
mpImpl.reset( new SvxMacroTabPage_Impl( rAttrSet ) );
}
@@ -425,66 +290,44 @@ bool SvxMacroTabPage_::IsReadOnly() const
return mpImpl->bReadOnly;
}
-
-class IconLBoxString : public SvLBoxString
-{
- Image* m_pMacroImg;
- Image* m_pComponentImg;
-
-public:
- IconLBoxString( const OUString& sText, Image* pMacroImg, Image* pComponentImg );
- virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext,
- const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) override;
-};
-
-
-IconLBoxString::IconLBoxString( const OUString& sText,
- Image* pMacroImg, Image* pComponentImg )
- : SvLBoxString( sText )
- , m_pMacroImg( pMacroImg )
- , m_pComponentImg( pComponentImg )
-{
-}
-
-
-void IconLBoxString::Paint(const Point& aPos, SvTreeListBox& /*aDevice*/, vcl::RenderContext& rRenderContext,
- const SvViewDataEntry* /*pView*/, const SvTreeListEntry& /*rEntry*/)
+namespace
{
- OUString aURL(GetText());
- if (!aURL.isEmpty())
+ OUString GetEventDisplayText(const OUString &rURL)
{
- sal_Int32 nIndex = aURL.indexOf(aVndSunStarUNO);
+ if (rURL.isEmpty())
+ return OUString();
+ sal_Int32 nIndex = rURL.indexOf(aVndSunStarUNO);
bool bUNO = nIndex == 0;
-
- const Image* pImg = bUNO ? m_pComponentImg : m_pMacroImg;
- rRenderContext.DrawImage(aPos, *pImg);
-
OUString aPureMethod;
if (bUNO)
{
- aPureMethod = aURL.copy(strlen(aVndSunStarUNO));
+ aPureMethod = rURL.copy(strlen(aVndSunStarUNO));
}
else
{
- aPureMethod = aURL.copy(strlen("vnd.sun.star.script:"));
+ aPureMethod = rURL.copy(strlen("vnd.sun.star.script:"));
aPureMethod = aPureMethod.copy( 0, aPureMethod.indexOf( '?' ) );
}
+ return aPureMethod;
+ }
- Point aPnt(aPos);
- aPnt.AdjustX(20 );
- rRenderContext.DrawText(aPnt, aPureMethod);
+ OUString GetEventDisplayImage(const OUString &rURL)
+ {
+ if (rURL.isEmpty())
+ return OUString();
+ sal_Int32 nIndex = rURL.indexOf(aVndSunStarUNO);
+ bool bUNO = nIndex == 0;
+ return bUNO ? OUString(RID_SVXBMP_COMPONENT) : OUString(RID_SVXBMP_MACRO);
}
}
-
// displays the app events if appEvents=true, otherwise displays the doc events
void SvxMacroTabPage_::DisplayAppEvents( bool appEvents)
{
bAppEvents = appEvents;
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- mpImpl->pEventLB->SetUpdateMode( false );
- rListBox.Clear();
+ mpImpl->xEventLB->freeze();
+ mpImpl->xEventLB->clear();
EventsHash* eventsHash;
Reference< container::XNameReplace> nameReplace;
if(bAppEvents)
@@ -526,77 +369,68 @@ void SvxMacroTabPage_::DisplayAppEvents( bool appEvents)
OUString eventURL = h_it->second.second;
OUString displayName(CuiResId(displayableEvent.pEventResourceID));
- displayName += "\t";
-
- SvTreeListEntry* _pE = rListBox.InsertEntry( displayName );
- OUString* pEventName = new OUString( sEventName );
- _pE->SetUserData( static_cast<void*>(pEventName) );
- OUString sNew( eventURL );
- _pE->ReplaceItem(std::make_unique<IconLBoxString>(sNew, &mpImpl->aMacroImg, &mpImpl->aComponentImg),
- LB_MACROS_ITEMPOS );
- rListBox.GetModel()->InvalidateEntry( _pE );
- rListBox.Select( _pE );
- rListBox.MakeVisible( _pE );
+ int nRow = mpImpl->xEventLB->n_children();
+ mpImpl->xEventLB->append(sEventName, displayName);
+ mpImpl->xEventLB->set_image(nRow, GetEventDisplayImage(eventURL), 1);
+ mpImpl->xEventLB->set_text(nRow, GetEventDisplayText(eventURL), 2);
}
- SvTreeListEntry* pE = rListBox.GetEntry(0);
- if( pE )
+ mpImpl->xEventLB->thaw();
+
+ if (mpImpl->xEventLB->n_children())
{
- rListBox.Select( pE );
- rListBox.MakeVisible( pE );
+ mpImpl->xEventLB->select(0);
+ mpImpl->xEventLB->scroll_to_row(0);
}
- rListBox.SetUpdateMode( true );
EnableButtons();
}
// select event handler on the listbox
-IMPL_LINK_NOARG( SvxMacroTabPage_, SelectEvent_Impl, SvTreeListBox*, void)
+IMPL_LINK_NOARG( SvxMacroTabPage_, SelectEvent_Impl, weld::TreeView&, void)
{
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- SvTreeListEntry* pE = rListBox.FirstSelected();
+ int nEntry = mpImpl->xEventLB->get_selected_index();
- if( !pE || LISTBOX_ENTRY_NOTFOUND == rListBox.GetModel()->GetAbsPos( pE ) )
+ if (nEntry == -1)
{
- DBG_ASSERT( pE, "Where does the empty entry come from?" );
+ DBG_ASSERT(false, "Where does the empty entry come from?" );
return;
}
EnableButtons();
}
-IMPL_LINK( SvxMacroTabPage_, AssignDeleteHdl_Impl, Button*, pBtn, void )
+IMPL_LINK( SvxMacroTabPage_, AssignDeleteHdl_Impl, weld::Button&, rBtn, void )
{
- GenericHandler_Impl( this, static_cast<PushButton*>(pBtn) );
+ GenericHandler_Impl(this, &rBtn);
}
-IMPL_LINK_NOARG( SvxMacroTabPage_, DoubleClickHdl_Impl, SvTreeListBox*, bool)
+IMPL_LINK_NOARG( SvxMacroTabPage_, DoubleClickHdl_Impl, weld::TreeView&, void)
{
- GenericHandler_Impl( this, nullptr );
- return false;
+ GenericHandler_Impl(this, nullptr);
}
// handler for double click on the listbox, and for the assign/delete buttons
-void SvxMacroTabPage_::GenericHandler_Impl( SvxMacroTabPage_* pThis, PushButton* pBtn )
+void SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, weld::Button* pBtn)
{
SvxMacroTabPage_Impl* pImpl = pThis->mpImpl.get();
- SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox();
- SvTreeListEntry* pE = rListBox.FirstSelected();
- if( !pE || LISTBOX_ENTRY_NOTFOUND == rListBox.GetModel()->GetAbsPos( pE ) )
+ weld::TreeView& rListBox = *pImpl->xEventLB;
+ int nEntry = rListBox.get_selected_index();
+ if (nEntry == -1)
{
- DBG_ASSERT( pE, "Where does the empty entry come from?" );
+ DBG_ASSERT(false, "Where does the empty entry come from?");
return;
}
- const bool bAssEnabled = pBtn != pImpl->pDeletePB && pImpl->pAssignPB->IsEnabled();
+ const bool bAssEnabled = pBtn != pImpl->xDeletePB.get() && pImpl->xAssignPB->get_sensitive();
- OUString* pEventName = static_cast<OUString*>(pE->GetUserData());
+ OUString sEventName = rListBox.get_id(nEntry);
OUString sEventURL;
OUString sEventType;
if(pThis->bAppEvents)
{
- EventsHash::iterator h_it = pThis->m_appEventsHash.find( *pEventName );
+ EventsHash::iterator h_it = pThis->m_appEventsHash.find(sEventName);
if(h_it != pThis->m_appEventsHash.end() )
{
sEventType = h_it->second.first;
@@ -605,7 +439,7 @@ void SvxMacroTabPage_::GenericHandler_Impl( SvxMacroTabPage_* pThis, PushButton*
}
else
{
- EventsHash::iterator h_it = pThis->m_docEventsHash.find( *pEventName );
+ EventsHash::iterator h_it = pThis->m_docEventsHash.find(sEventName);
if(h_it != pThis->m_docEventsHash.end() )
{
sEventType = h_it->second.first;
@@ -615,7 +449,7 @@ void SvxMacroTabPage_::GenericHandler_Impl( SvxMacroTabPage_* pThis, PushButton*
bool bDoubleClick = (pBtn == nullptr);
bool bUNOAssigned = sEventURL.startsWith( aVndSunStarUNO );
- if( pBtn == pImpl->pDeletePB )
+ if( pBtn == pImpl->xDeletePB.get() )
{
// delete pressed
sEventType = "Script" ;
@@ -624,7 +458,7 @@ void SvxMacroTabPage_::GenericHandler_Impl( SvxMacroTabPage_* pThis, PushButton*
pThis->bDocModified = true;
}
else if ( ( ( pBtn != nullptr )
- && ( pBtn == pImpl->pAssignComponentPB )
+ && ( pBtn == pImpl->xAssignComponentPB.get() )
)
|| ( bDoubleClick
&& bUNOAssigned
@@ -659,26 +493,22 @@ void SvxMacroTabPage_::GenericHandler_Impl( SvxMacroTabPage_* pThis, PushButton*
// update the hashes
if(pThis->bAppEvents)
{
- EventsHash::iterator h_it = pThis->m_appEventsHash.find( *pEventName );
+ EventsHash::iterator h_it = pThis->m_appEventsHash.find(sEventName);
h_it->second.first = sEventType;
h_it->second.second = sEventURL;
}
else
{
- EventsHash::iterator h_it = pThis->m_docEventsHash.find( *pEventName );
+ EventsHash::iterator h_it = pThis->m_docEventsHash.find(sEventName);
h_it->second.first = sEventType;
h_it->second.second = sEventURL;
}
- // update the listbox entry
- pImpl->pEventLB->SetUpdateMode( false );
- pE->ReplaceItem(std::make_unique<IconLBoxString>(sEventURL, &pImpl->aMacroImg, &pImpl->aComponentImg),
- LB_MACROS_ITEMPOS );
+ rListBox.set_image(nEntry, GetEventDisplayImage(sEventURL), 1);
+ rListBox.set_text(nEntry, GetEventDisplayText(sEventURL), 2);
- rListBox.GetModel()->InvalidateEntry( pE );
- rListBox.Select( pE );
- rListBox.MakeVisible( pE );
- rListBox.SetUpdateMode( true );
+ rListBox.select(nEntry );
+ rListBox.scroll_to_row(nEntry);
pThis->EnableButtons();
}
@@ -690,34 +520,21 @@ void SvxMacroTabPage_::InitAndSetHandler( const Reference< container::XNameRepla
m_xAppEvents = xAppEvents;
m_xDocEvents = xDocEvents;
m_xModifiable = xModifiable;
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- HeaderBar& rHeaderBar = mpImpl->pEventLB->GetHeaderBar();
- Link<Button*,void> aLnk(LINK(this, SvxMacroTabPage_, AssignDeleteHdl_Impl ));
- mpImpl->pDeletePB->SetClickHdl( aLnk );
- mpImpl->pAssignPB->SetClickHdl( aLnk );
- if( mpImpl->pAssignComponentPB )
- mpImpl->pAssignComponentPB->SetClickHdl( aLnk );
- rListBox.SetDoubleClickHdl( LINK(this, SvxMacroTabPage_, DoubleClickHdl_Impl ) );
-
- rListBox.SetSelectHdl( LINK( this, SvxMacroTabPage_, SelectEvent_Impl ));
-
- rListBox.SetSelectionMode( SelectionMode::Single );
- rListBox.SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
- Size aSize( nTabs[ 1 ], 0 );
- rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() );
- aSize.setWidth( 1764 ); // don't know what, so 42^2 is best to use...
- rHeaderBar.InsertItem( ITEMID_ASSMACRO, mpImpl->sAssignedMacro, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() );
- rListBox.SetSpaceBetweenEntries( 0 );
-
- mpImpl->pEventLB->Show();
- mpImpl->pEventLB->ConnectElements();
-
- long nMinLineHeight = mpImpl->aMacroImg.GetSizePixel().Height() + 2;
- if( nMinLineHeight > mpImpl->pEventLB->GetListBox().GetEntryHeight() )
- mpImpl->pEventLB->GetListBox().SetEntryHeight(
- sal::static_int_cast< short >(nMinLineHeight) );
-
- mpImpl->pEventLB->Enable();
+ Link<weld::Button&,void> aLnk(LINK(this, SvxMacroTabPage_, AssignDeleteHdl_Impl ));
+ mpImpl->xDeletePB->connect_clicked(aLnk);
+ mpImpl->xAssignPB->connect_clicked(aLnk);
+ if( mpImpl->xAssignComponentPB )
+ mpImpl->xAssignComponentPB->connect_clicked( aLnk );
+ mpImpl->xEventLB->connect_row_activated( LINK(this, SvxMacroTabPage_, DoubleClickHdl_Impl ) );
+ mpImpl->xEventLB->connect_changed( LINK( this, SvxMacroTabPage_, SelectEvent_Impl ));
+
+ std::vector<int> aWidths;
+ aWidths.push_back(mpImpl->xEventLB->get_approximate_digit_width() * 32);
+ aWidths.push_back(mpImpl->xEventLB->get_checkbox_column_width());
+ mpImpl->xEventLB->set_column_fixed_widths(aWidths);
+
+ mpImpl->xEventLB->show();
+ mpImpl->xEventLB->set_sensitive(true);
if(!m_xAppEvents.is())
{
@@ -785,45 +602,42 @@ std::pair< OUString, OUString > SvxMacroTabPage_::GetPairFromAny( const Any& aA
return std::make_pair( type, url );
}
-SvxMacroTabPage::SvxMacroTabPage(vcl::Window* pParent,
+SvxMacroTabPage::SvxMacroTabPage(TabPageParent pParent,
const Reference< frame::XFrame >& _rxDocumentFrame,
const SfxItemSet& rSet,
Reference< container::XNameReplace > const & xNameReplace,
sal_uInt16 nSelectedIndex)
- : SvxMacroTabPage_(pParent, "MacroAssignPage", "cui/ui/macroassignpage.ui", rSet)
+ : SvxMacroTabPage_(pParent, "cui/ui/macroassignpage.ui", "MacroAssignPage", rSet)
{
- mpImpl->sStrEvent = get<FixedText>("eventft")->GetText();
- mpImpl->sAssignedMacro = get<FixedText>("assignft")->GetText();
- get(mpImpl->pEventLB, "assignments");
- get(mpImpl->pAssignPB, "assign");
- get(mpImpl->pDeletePB, "delete");
- get(mpImpl->pAssignComponentPB, "component");
- mpImpl->aMacroImg = get<FixedImage>("macroimg")->GetImage();
- mpImpl->aComponentImg = get<FixedImage>("componentimg")->GetImage();
+ mpImpl->xEventLB = m_xBuilder->weld_tree_view("assignments");
+ mpImpl->xEventLB->set_size_request(mpImpl->xEventLB->get_approximate_digit_width() * 70,
+ mpImpl->xEventLB->get_height_rows(9));
+ mpImpl->xAssignPB = m_xBuilder->weld_button("assign");
+ mpImpl->xDeletePB = m_xBuilder->weld_button("delete");
+ mpImpl->xAssignComponentPB = m_xBuilder->weld_button("component");
SetFrame( _rxDocumentFrame );
if( !mpImpl->bIDEDialogMode )
{
- mpImpl->pAssignComponentPB->Hide();
- mpImpl->pAssignComponentPB->Disable();
+ mpImpl->xAssignComponentPB->hide();
+ mpImpl->xAssignComponentPB->set_sensitive(false);
}
InitResources();
InitAndSetHandler( xNameReplace, Reference< container::XNameReplace>(nullptr), Reference< util::XModifiable >(nullptr));
DisplayAppEvents(true);
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- SvTreeListEntry* pE = rListBox.GetEntry( static_cast<sal_uLong>(nSelectedIndex) );
- if( pE )
- rListBox.Select(pE);
+ mpImpl->xEventLB->select(nSelectedIndex);
}
-SvxMacroAssignDlg::SvxMacroAssignDlg( vcl::Window* pParent, const Reference< frame::XFrame >& _rxDocumentFrame, const SfxItemSet& rSet,
- const Reference< container::XNameReplace >& xNameReplace, sal_uInt16 nSelectedIndex )
+SvxMacroAssignDlg::SvxMacroAssignDlg(weld::Window* pParent, const Reference< frame::XFrame >& _rxDocumentFrame, const SfxItemSet& rSet,
+ const Reference< container::XNameReplace >& xNameReplace, sal_uInt16 nSelectedIndex)
: SvxMacroAssignSingleTabDialog(pParent, rSet)
{
- SetTabPage(VclPtr<SvxMacroTabPage>::Create(get_content_area(), _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex));
+ TabPageParent pPageParent(get_content_area(), this);
+ auto pPage = VclPtr<SvxMacroTabPage>::Create(pPageParent, _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex);
+ SetTabPage(pPage);
}
IMPL_LINK_NOARG(AssignComponentDialog, ButtonHandler, weld::Button&, void)
@@ -859,18 +673,17 @@ AssignComponentDialog::~AssignComponentDialog()
{
}
-IMPL_LINK_NOARG( SvxMacroAssignSingleTabDialog, OKHdl_Impl, Button *, void )
+IMPL_LINK_NOARG(SvxMacroAssignSingleTabDialog, OKHdl_Impl, weld::Button&, void)
{
- GetTabPage()->FillItemSet( nullptr );
- EndDialog( RET_OK );
+ m_xSfxPage->FillItemSet(nullptr);
+ m_xDialog->response(RET_OK);
}
-
-SvxMacroAssignSingleTabDialog::SvxMacroAssignSingleTabDialog(vcl::Window *pParent,
+SvxMacroAssignSingleTabDialog::SvxMacroAssignSingleTabDialog(weld::Window *pParent,
const SfxItemSet& rSet)
- : SfxSingleTabDialog(pParent, rSet, "MacroAssignDialog", "cui/ui/macroassigndialog.ui")
+ : SfxSingleTabDialogController(pParent, rSet, "cui/ui/macroassigndialog.ui", "MacroAssignDialog")
{
- GetOKButton()->SetClickHdl( LINK( this, SvxMacroAssignSingleTabDialog, OKHdl_Impl ) );
+ GetOKButton().connect_clicked(LINK(this, SvxMacroAssignSingleTabDialog, OKHdl_Impl));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/customize/macropg_impl.hxx b/cui/source/customize/macropg_impl.hxx
index 61f7fe3ac73c..4c82b378ecbf 100644
--- a/cui/source/customize/macropg_impl.hxx
+++ b/cui/source/customize/macropg_impl.hxx
@@ -25,14 +25,10 @@ class SvxMacroTabPage_Impl
public:
explicit SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet );
- VclPtr<PushButton> pAssignPB;
- VclPtr<PushButton> pAssignComponentPB;
- VclPtr<PushButton> pDeletePB;
- Image aMacroImg;
- Image aComponentImg;
- OUString sStrEvent;
- OUString sAssignedMacro;
- VclPtr<MacroEventListBox> pEventLB;
+ std::unique_ptr<weld::Button> xAssignPB;
+ std::unique_ptr<weld::Button> xAssignComponentPB;
+ std::unique_ptr<weld::Button> xDeletePB;
+ std::unique_ptr<weld::TreeView> xEventLB;
bool bReadOnly;
bool bIDEDialogMode;
};
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index f1258eaecd57..11ee06af964d 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1372,41 +1372,28 @@ VclPtr<AbstractSvxPostItDialog> AbstractDialogFactory_Impl::CreateSvxPostItDialo
class SvxMacroAssignDialog : public VclAbstractDialog
{
public:
- SvxMacroAssignDialog( vcl::Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode,
+ SvxMacroAssignDialog( weld::Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode,
const Reference< XNameReplace >& _rxEvents, const sal_uInt16 _nInitiallySelectedEvent )
:m_aItems( SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM>{} )
{
m_aItems.Put( SfxBoolItem( SID_ATTR_MACROITEM, _bUnoDialogMode ) );
- m_pDialog.reset( VclPtr<SvxMacroAssignDlg>::Create( _pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent ) );
+ m_xDialog.reset(new SvxMacroAssignDlg(_pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent));
}
virtual short Execute() override;
- virtual ~SvxMacroAssignDialog() override;
- virtual void dispose() override;
private:
SfxItemSet m_aItems;
- VclPtr<SvxMacroAssignDlg > m_pDialog;
+ std::unique_ptr<SvxMacroAssignDlg> m_xDialog;
};
short SvxMacroAssignDialog::Execute()
{
- return m_pDialog->Execute();
-}
-
-SvxMacroAssignDialog::~SvxMacroAssignDialog()
-{
- disposeOnce();
-}
-
-void SvxMacroAssignDialog::dispose()
-{
- m_pDialog.clear();
- VclAbstractDialog::dispose();
+ return m_xDialog->run();
}
VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateSvxMacroAssignDlg(
- vcl::Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode,
+ weld::Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode,
const Reference< XNameReplace >& _rxEvents, const sal_uInt16 _nInitiallySelectedEvent )
{
return VclPtr<SvxMacroAssignDialog>::Create( _pParent, _rxDocumentFrame, _bUnoDialogMode, _rxEvents, _nInitiallySelectedEvent );
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 0099a726f30c..ea21cfd90575 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -821,7 +821,7 @@ public:
virtual VclPtr<VclAbstractDialog> CreateScriptErrorDialog(const css::uno::Any& rException) override;
virtual VclPtr<VclAbstractDialog> CreateSvxMacroAssignDlg(
- vcl::Window* _pParent,
+ weld::Window* _pParent,
const css::uno::Reference< css::frame::XFrame >& _rxDocumentFrame,
const bool _bUnoDialogMode,
const css::uno::Reference< css::container::XNameReplace >& _rxEvents,
diff --git a/cui/source/inc/headertablistbox.hxx b/cui/source/inc/headertablistbox.hxx
index b3f812ee1012..360bed4937f8 100644
--- a/cui/source/inc/headertablistbox.hxx
+++ b/cui/source/inc/headertablistbox.hxx
@@ -23,37 +23,6 @@
#include <vcl/headbar.hxx>
#include <vcl/svtabbx.hxx>
-class MacroEventListBox final : public Control
-{
-private:
- VclPtr<HeaderBar> maHeaderBar;
- VclPtr<SvHeaderTabListBox> maListBox;
- DECL_LINK( HeaderEndDrag_Impl, HeaderBar*, void );
- virtual bool EventNotify( NotifyEvent& rNEvt ) override;
-public:
- MacroEventListBox( vcl::Window* pParent, WinBits nStyle );
- virtual ~MacroEventListBox() override;
- virtual void dispose() override;
-
- virtual void Resize() override;
- virtual Size GetOptimalSize() const override;
-
- SvHeaderTabListBox& GetListBox()
- {
- return *maListBox;
- }
-
- HeaderBar& GetHeaderBar()
- {
- return *maHeaderBar;
- }
-
- void ConnectElements();/**< should be called after all manipulations on elements are done
- calcs real sizes depending on sizes of this */
- void Show(); ///< same meaning as Windows::Show()
- void Enable(); ///< same meaning as Windows::Enable()
-};
-
class CuiMacroEventListBox final
{
private:
diff --git a/cui/source/inc/macropg.hxx b/cui/source/inc/macropg.hxx
index 5950a1ef3fa5..cf60d2ad0a49 100644
--- a/cui/source/inc/macropg.hxx
+++ b/cui/source/inc/macropg.hxx
@@ -56,11 +56,11 @@ class SvxMacroTabPage_Impl;
class SvxMacroTabPage_ : public SfxTabPage
{
- DECL_LINK( SelectEvent_Impl, SvTreeListBox*, void );
- DECL_LINK( AssignDeleteHdl_Impl, Button *, void );
- DECL_LINK( DoubleClickHdl_Impl, SvTreeListBox*, bool );
+ DECL_LINK( SelectEvent_Impl, weld::TreeView&, void );
+ DECL_LINK( AssignDeleteHdl_Impl, weld::Button&, void );
+ DECL_LINK( DoubleClickHdl_Impl, weld::TreeView&, void );
- static void GenericHandler_Impl( SvxMacroTabPage_* pThis, PushButton* pBtn );
+ static void GenericHandler_Impl( SvxMacroTabPage_* pThis, weld::Button* pBtn );
css::uno::Reference< css::container::XNameReplace > m_xAppEvents;
protected:
@@ -72,7 +72,7 @@ protected:
bool bDocModified, bAppEvents, bInitialized;
EventDisplayNames aDisplayNames;
- SvxMacroTabPage_( vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet& rItemSet );
+ SvxMacroTabPage_(TabPageParent pParent, const OUString& rUIXMLDescription, const OString& rID, const SfxItemSet& rItemSet);
void EnableButtons();
static css::uno::Any GetPropsByName( const OUString& eventName, EventsHash& eventsHash );
@@ -98,7 +98,7 @@ class SvxMacroTabPage : public SvxMacroTabPage_
{
public:
SvxMacroTabPage(
- vcl::Window* pParent,
+ TabPageParent pParent,
const css::uno::Reference< css::frame::XFrame >& _rxDocumentFrame,
const SfxItemSet& rSet,
css::uno::Reference< css::container::XNameReplace > const & xNameReplace,
@@ -110,21 +110,20 @@ public:
typedef const sal_uInt16* (*GetTabPageRanges)(); // gives international Which-values
-class SvxMacroAssignSingleTabDialog : public SfxSingleTabDialog
+class SvxMacroAssignSingleTabDialog : public SfxSingleTabDialogController
{
public:
- SvxMacroAssignSingleTabDialog(vcl::Window* pParent, const SfxItemSet& rOptionsSet);
+ SvxMacroAssignSingleTabDialog(weld::Window* pParent, const SfxItemSet& rOptionsSet);
private:
- DECL_LINK( OKHdl_Impl, Button *, void );
+ DECL_LINK(OKHdl_Impl, weld::Button&, void);
};
-
class SvxMacroAssignDlg : public SvxMacroAssignSingleTabDialog
{
public:
SvxMacroAssignDlg(
- vcl::Window* pParent,
+ weld::Window* pParent,
const css::uno::Reference< css::frame::XFrame >& _rxDocumentFrame,
const SfxItemSet& rSet,
const css::uno::Reference< css::container::XNameReplace >& xNameReplace,
diff --git a/cui/uiconfig/ui/eventsconfigpage.ui b/cui/uiconfig/ui/eventsconfigpage.ui
index e765175ef8ea..b80d3313c5dc 100644
--- a/cui/uiconfig/ui/eventsconfigpage.ui
+++ b/cui/uiconfig/ui/eventsconfigpage.ui
@@ -1,8 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
- <requires lib="LibreOffice" version="1.0"/>
+ <object class="GtkTreeStore" id="liststore3">
+ <columns>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name image -->
+ <column type="GdkPixbuf"/>
+ <!-- column-name text2 -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<object class="GtkGrid" id="EventsConfigPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -27,8 +38,8 @@
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="eventsconfigpage|label1">Assign:</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -96,15 +107,16 @@
<object class="GtkGrid" id="grid3">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="eventsconfigpage|label2">Save in:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">savein</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -125,52 +137,67 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="cuilo-MacroEventListBox" id="events:border">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview-selection1"/>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="grid4">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="hexpand">True</property>
+ <property name="shadow_type">in</property>
<child>
- <object class="GtkLabel" id="eventft">
+ <object class="GtkTreeView" id="events">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
<property name="hexpand">True</property>
- <property name="label" translatable="yes" context="eventsconfigpage|eventft">Event</property>
+ <property name="vexpand">True</property>
+ <property name="model">liststore3</property>
+ <property name="search_column">0</property>
+ <property name="show_expanders">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="Macro Library List-selection2"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn3">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <property name="title" translatable="yes" context="eventsconfigpage|eventft">Event</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCellRendererPixbuf" id="cellrenderertext4"/>
+ <attributes>
+ <attribute name="pixbuf">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn4">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <property name="title" translatable="yes" context="eventsconfigpage|actionft">Assigned Action</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer2"/>
+ <attributes>
+ <attribute name="text">2</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="actionft">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="label" translatable="yes" context="eventsconfigpage|actionft">Assigned Action</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
</child>
</object>
<packing>
@@ -178,40 +205,6 @@
<property name="top_attach">0</property>
</packing>
</child>
- <child>
- <object class="GtkGrid" id="grid5">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <child>
- <object class="GtkImage" id="macroimg">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="pixbuf">svx/res/id018.png</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="componentimg">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="pixbuf">res/component_16.png</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
</object>
<packing>
<property name="left_attach">0</property>
diff --git a/cui/uiconfig/ui/macroassigndialog.ui b/cui/uiconfig/ui/macroassigndialog.ui
index 08988159916b..563231b870d5 100644
--- a/cui/uiconfig/ui/macroassigndialog.ui
+++ b/cui/uiconfig/ui/macroassigndialog.ui
@@ -1,13 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="MacroAssignDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="macroassigndialog|MacroAssignDialog">Assign Action</property>
- <property name="resizable">False</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>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
diff --git a/cui/uiconfig/ui/macroassignpage.ui b/cui/uiconfig/ui/macroassignpage.ui
index e1d90f47ccc4..89f55d117c5f 100644
--- a/cui/uiconfig/ui/macroassignpage.ui
+++ b/cui/uiconfig/ui/macroassignpage.ui
@@ -1,11 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.0 on Thu Jan 23 10:25:37 2014 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
- <requires lib="LibreOffice" version="1.0"/>
+ <object class="GtkTreeStore" id="liststore3">
+ <columns>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name image -->
+ <column type="GdkPixbuf"/>
+ <!-- column-name text2 -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<object class="GtkGrid" id="MacroAssignPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
<property name="row_spacing">12</property>
<property name="column_spacing">12</property>
<child>
@@ -25,64 +38,63 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkGrid" id="grid1">
+ <object class="GtkScrolledWindow">
<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="shadow_type">in</property>
<child>
- <object class="cuilo-MacroEventListBox" id="assignments:border">
+ <object class="GtkTreeView" id="assignments">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="grid2">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="hexpand">True</property>
- <property name="column_homogeneous">True</property>
+ <property name="model">liststore3</property>
+ <property name="search_column">0</property>
+ <property name="show_expanders">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="Macro Library List-selection2"/>
+ </child>
<child>
- <object class="GtkLabel" id="eventft">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="macroassignpage|eventft">Event</property>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn3">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <property name="title" translatable="yes" context="macroassignpage|eventft">Event</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
</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="GtkLabel" id="assignft">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="macroassignpage|assignft">Assigned Action</property>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCellRendererPixbuf" id="cellrenderertext4"/>
+ <attributes>
+ <attribute name="pixbuf">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn4">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <property name="title" translatable="yes" context="macroassignpage|assignft">Assigned Action</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer2"/>
+ <attributes>
+ <attribute name="text">2</attribute>
+ </attributes>
+ </child>
</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="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
</object>
</child>
@@ -102,8 +114,6 @@
<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>
@@ -167,44 +177,6 @@
<property name="position">2</property>
</packing>
</child>
- <child>
- <object class="GtkGrid" id="grid3">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="halign">center</property>
- <child>
- <object class="GtkImage" id="macroimg">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">svx/res/id018.png</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="GtkImage" id="componentimg">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/component_16.png</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">3</property>
- </packing>
- </child>
</object>
</child>
</object>
@@ -223,8 +195,6 @@
<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>