[Libreoffice-commits] core.git: 2 commits - cui/source cui/uiconfig cui/UIConfig_cui.mk extras/source

Caolán McNamara caolanm at redhat.com
Thu Jan 23 03:16:27 PST 2014


 cui/UIConfig_cui.mk                            |    2 
 cui/source/customize/eventdlg.cxx              |   20 --
 cui/source/customize/eventdlg.hxx              |    2 
 cui/source/customize/macropg.cxx               |  220 +++++++----------------
 cui/source/customize/macropg.src               |   69 -------
 cui/source/customize/macropg_impl.hxx          |   15 -
 cui/source/inc/headertablistbox.hxx            |    4 
 cui/source/inc/macropg.hxx                     |   26 --
 cui/uiconfig/ui/macroassigndialog.ui           |   82 ++++++++
 cui/uiconfig/ui/macroassignpage.ui             |  231 +++++++++++++++++++++++++
 extras/source/glade/libreoffice-catalog.xml.in |    3 
 11 files changed, 410 insertions(+), 264 deletions(-)

New commits:
commit 121b8691b31b3eae459844d377b6d7d80ded83b6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 23 11:10:08 2014 +0000

    adjust macro assign dialog to have horizontal buttons
    
    Change-Id: I9acb9a85f7172e492818fecea73f64a2a1071a4b

diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index db4c9ba..87ed9afe 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -66,6 +66,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
 	cui/uiconfig/ui/linetabpage \
 	cui/uiconfig/ui/lineendstabpage \
 	cui/uiconfig/ui/linestyletabpage \
+	cui/uiconfig/ui/macroassigndialog \
 	cui/uiconfig/ui/macroassignpage \
 	cui/uiconfig/ui/macroselectordialog \
 	cui/uiconfig/ui/messbox \
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 734c598..3542706 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -930,7 +930,7 @@ IMPL_LINK( SvxMacroAssignSingleTabDialog, OKHdl_Impl, Button *, pButton )
 
 SvxMacroAssignSingleTabDialog::SvxMacroAssignSingleTabDialog(Window *pParent,
     const SfxItemSet& rSet)
-    : SfxSingleTabDialog(pParent, rSet)
+    : SfxSingleTabDialog(pParent, rSet, "MacroAssignDialog", "cui/ui/macroassigndialog.ui")
 {
     GetOKButton()->SetClickHdl( LINK( this, SvxMacroAssignSingleTabDialog, OKHdl_Impl ) );
 }
diff --git a/cui/uiconfig/ui/macroassigndialog.ui b/cui/uiconfig/ui/macroassigndialog.ui
new file mode 100644
index 0000000..3b16131
--- /dev/null
+++ b/cui/uiconfig/ui/macroassigndialog.ui
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Thu Jan 23 11:08:16 2014 -->
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="MacroAssignDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Assign action</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+    </action-widgets>
+  </object>
+</interface>
commit 39366b11bfed35408f16057fdb27b5b3ee6c2eaa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 22 19:58:48 2014 +0000

    convert macro assign page to .ui
    
    as seen in calc->right click on tab->sheet events
    
    Change-Id: I4df1e1c7f79f4f6431905bfc286a0f9d214ccf6c

diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index 0b59749..db4c9ba 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -66,6 +66,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
 	cui/uiconfig/ui/linetabpage \
 	cui/uiconfig/ui/lineendstabpage \
 	cui/uiconfig/ui/linestyletabpage \
+	cui/uiconfig/ui/macroassignpage \
 	cui/uiconfig/ui/macroselectordialog \
 	cui/uiconfig/ui/messbox \
 	cui/uiconfig/ui/movemenu \
diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx
index 2fcb6cf..faacfdc 100644
--- a/cui/source/customize/eventdlg.cxx
+++ b/cui/source/customize/eventdlg.cxx
@@ -61,14 +61,14 @@ SvxEventConfigPage::SvxEventConfigPage( Window *pParent, const SfxItemSet& rSet,
     aSaveInListBox( this, CUI_RES( LB_SAVEIN ) ),
     bAppConfig  ( sal_True )
 {
-    mpImpl->pStrEvent           = new OUString( CUI_RES( STR_EVENT ));
-    mpImpl->pAssignedMacro      = new OUString( CUI_RES( STR_ASSMACRO ));
+    mpImpl->sStrEvent           = OUString( CUI_RES( STR_EVENT ));
+    mpImpl->sAssignedMacro      = OUString( CUI_RES( STR_ASSMACRO ));
     mpImpl->pEventLB            = new MacroEventListBox( this, CUI_RES( LB_EVENT ));
     mpImpl->pAssignFT           = new FixedText( this,  CUI_RES( FT_ASSIGN ));
     mpImpl->pAssignPB           = new PushButton( this, CUI_RES( PB_ASSIGN ));
     mpImpl->pDeletePB           = new PushButton( this, CUI_RES( PB_DELETE ));
-    mpImpl->pMacroImg           = new Image( CUI_RES( IMG_MACRO) );
-    mpImpl->pComponentImg       = new Image( CUI_RES( IMG_COMPONENT) );
+    mpImpl->aMacroImg           = Image( CUI_RES( IMG_MACRO) );
+    mpImpl->aComponentImg       = Image( CUI_RES( IMG_COMPONENT) );
 
     FreeResource();
 
@@ -108,7 +108,10 @@ void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFra
 
 SvxEventConfigPage::~SvxEventConfigPage()
 {
-    //DF Do I need to delete bools?
+    delete mpImpl->pEventLB;
+    delete mpImpl->pAssignFT;
+    delete mpImpl->pAssignPB;
+    delete mpImpl->pDeletePB;
 }
 
 // -----------------------------------------------------------------------
@@ -213,11 +216,4 @@ sal_Bool SvxEventConfigPage::FillItemSet( SfxItemSet& rSet )
     return _SvxMacroTabPage::FillItemSet( rSet );
 }
 
-// -----------------------------------------------------------------------
-
-void SvxEventConfigPage::Reset( const SfxItemSet& )
-{
-    _SvxMacroTabPage::Reset();
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/customize/eventdlg.hxx b/cui/source/customize/eventdlg.hxx
index b5ce0a0..0039c857 100644
--- a/cui/source/customize/eventdlg.hxx
+++ b/cui/source/customize/eventdlg.hxx
@@ -55,8 +55,6 @@ public:
 
 protected:
     virtual sal_Bool    FillItemSet( SfxItemSet& );
-    virtual void    Reset( const SfxItemSet& );
-    using _SvxMacroTabPage::Reset;
 
 private:
     void    ImplInitDocument();
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index b362a99..734c598 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -20,6 +20,7 @@
 #include <basic/basmgr.hxx>
 
 #include "macropg.hxx"
+#include <vcl/layout.hxx>
 #include <vcl/msgbox.hxx>
 #include <svtools/svmedit.hxx>
 #include <svtools/svlbitm.hxx>
@@ -52,14 +53,9 @@ static OUString aVndSunStarUNO( "vnd.sun.star.UNO:" );
 static OUString aVndSunStarScript( "vnd.sun.star.script:" );
 
 _SvxMacroTabPage_Impl::_SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet ) :
-    pAssignFT( NULL ),
     pAssignPB( NULL ),
     pAssignComponentPB( NULL ),
     pDeletePB( NULL ),
-    pMacroImg( NULL ),
-    pComponentImg( NULL ),
-    pStrEvent( NULL ),
-    pAssignedMacro( NULL ),
     pEventLB( NULL ),
     bReadOnly( sal_False ),
     bIDEDialogMode( sal_False )
@@ -69,19 +65,6 @@ _SvxMacroTabPage_Impl::_SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet ) :
         bIDEDialogMode = ((const SfxBoolItem*)pItem)->GetValue();
 }
 
-_SvxMacroTabPage_Impl::~_SvxMacroTabPage_Impl()
-{
-    delete pAssignFT;
-    delete pAssignPB;
-    delete pAssignComponentPB;
-    delete pDeletePB;
-    delete pMacroImg;
-    delete pComponentImg;
-    delete pStrEvent;
-    delete pAssignedMacro;
-    delete pEventLB;
-}
-
 // attention, this array is indexed directly (0, 1, ...) in the code
 static long nTabs[] =
     {
@@ -157,6 +140,33 @@ MacroEventListBox::MacroEventListBox( Window* pParent, const ResId& rId )
     maListBox.EnableCellFocus();
 }
 
+MacroEventListBox::MacroEventListBox( Window* pParent, WinBits nStyle )
+    : Control( pParent, nStyle )
+    , maHeaderBar( this, WB_BUTTONSTYLE | WB_BOTTOMBORDER )
+    , maListBox( this, WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP )
+{
+    maListBox.SetHelpId( HID_MACRO_HEADERTABLISTBOX );
+
+    // enable the cell focus to show visible focus
+    maListBox.EnableCellFocus();
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeMacroEventListBox(Window *pParent, VclBuilder::stringmap &rMap)
+{
+    WinBits nWinBits = WB_TABSTOP;
+
+    OString sBorder = VclBuilder::extractCustomProperty(rMap);
+    if (!sBorder.isEmpty())
+       nWinBits |= WB_BORDER;
+
+    return new MacroEventListBox(pParent, nWinBits);
+}
+
+Size MacroEventListBox::GetOptimalSize() const
+{
+    return LogicToPixel(Size(192, 200), MapMode(MAP_APPFONT ));
+}
+
 void MacroEventListBox::Resize()
 {
     Control::Resize();
@@ -225,6 +235,19 @@ _SvxMacroTabPage::_SvxMacroTabPage( Window* pParent, const ResId& rResId, const
     mpImpl = new _SvxMacroTabPage_Impl( rAttrSet );
 }
 
+_SvxMacroTabPage::_SvxMacroTabPage(Window* pParent, const OString& rID,
+    const OUString& rUIXMLDescription, const SfxItemSet& rAttrSet)
+    : SfxTabPage( pParent, rID, rUIXMLDescription, rAttrSet ),
+    m_xAppEvents(0),
+    m_xDocEvents(0),
+    bReadOnly(false),
+    bDocModified(false),
+    bAppEvents(false),
+    bInitialized(false)
+{
+    mpImpl = new _SvxMacroTabPage_Impl( rAttrSet );
+}
+
 _SvxMacroTabPage::~_SvxMacroTabPage()
 {
     // need to delete the user data
@@ -379,7 +402,7 @@ sal_Bool _SvxMacroTabPage::FillItemSet( SfxItemSet& /*rSet*/ )
 }
 
 // the following method clears the bindings in the hashes for both doc & app
-void _SvxMacroTabPage::Reset()
+void _SvxMacroTabPage::Reset( const SfxItemSet& )
 {
     // called once in creation - don't reset the data this time
     if(!bInitialized)
@@ -514,9 +537,7 @@ void _SvxMacroTabPage::DisplayAppEvents( bool appEvents)
     // have to use the original XNameReplace since the hash iterators do
     // not guarantee the order in which the elements are returned
     if(!nameReplace.is())
-    {
         return;
-    }
 
     Sequence< OUString > eventNames = nameReplace->getElementNames();
     ::std::set< OUString > aEventNamesCache;
@@ -546,12 +567,13 @@ void _SvxMacroTabPage::DisplayAppEvents( bool appEvents)
         OUString displayName( CUI_RES( displayableEvent->nEventResourceID ) );
 
         displayName += "\t";
+
         SvTreeListEntry*    _pE = rListBox.InsertEntry( displayName );
         OUString* pEventName = new OUString( sEventName );
         _pE->SetUserData( (void*)pEventName );
         OUString sNew( eventURL );
         _pE->ReplaceItem( new IconLBoxString( _pE, 0, sNew,
-            mpImpl->pMacroImg, mpImpl->pComponentImg ), LB_MACROS_ITEMPOS );
+            &mpImpl->aMacroImg, &mpImpl->aComponentImg ), LB_MACROS_ITEMPOS );
         rListBox.GetModel()->InvalidateEntry( _pE );
         rListBox.Select( _pE );
         rListBox.MakeVisible( _pE );
@@ -700,7 +722,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton*
     // update the listbox entry
     pImpl->pEventLB->SetUpdateMode( sal_False );
     pE->ReplaceItem( new IconLBoxString( pE, 0, sEventURL,
-            pImpl->pMacroImg, pImpl->pComponentImg ), LB_MACROS_ITEMPOS );
+            &pImpl->aMacroImg, &pImpl->aComponentImg ), LB_MACROS_ITEMPOS );
 
     rListBox.GetModel()->InvalidateEntry( pE );
     rListBox.Select( pE );
@@ -732,15 +754,15 @@ void _SvxMacroTabPage::InitAndSetHandler( Reference< container::XNameReplace> xA
     rListBox.SetSelectionMode( SINGLE_SELECTION );
     rListBox.SetTabs( &nTabs[0], MAP_APPFONT );
     Size aSize( nTabs[ 2 ], 0 );
-    rHeaderBar.InsertItem( ITEMID_EVENT, *mpImpl->pStrEvent, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() );
+    rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() );
     aSize.Width() = 1764;        // don't know what, so 42^2 is best to use...
-    rHeaderBar.InsertItem( ITMEID_ASSMACRO, *mpImpl->pAssignedMacro, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() );
+    rHeaderBar.InsertItem( ITMEID_ASSMACRO, mpImpl->sAssignedMacro, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() );
     rListBox.SetSpaceBetweenEntries( 0 );
 
     mpImpl->pEventLB->Show();
     mpImpl->pEventLB->ConnectElements();
 
-    long nMinLineHeight = mpImpl->pMacroImg->GetSizePixel().Height() + 2;
+    long nMinLineHeight = mpImpl->aMacroImg.GetSizePixel().Height() + 2;
     if( nMinLineHeight > mpImpl->pEventLB->GetListBox().GetEntryHeight() )
         mpImpl->pEventLB->GetListBox().SetEntryHeight(
             sal::static_int_cast< short >(nMinLineHeight) );
@@ -813,42 +835,32 @@ Any _SvxMacroTabPage::GetPropsByName( const OUString& eventName, EventsHash& eve
     return ::std::make_pair( type, url );
 }
 
-SvxMacroTabPage::SvxMacroTabPage( Window* pParent, const Reference< frame::XFrame >& _rxDocumentFrame, const SfxItemSet& rSet, Reference< container::XNameReplace > xNameReplace, sal_uInt16 nSelectedIndex )
-    : _SvxMacroTabPage( pParent, CUI_RES( RID_SVXPAGE_MACROASSIGN ), rSet )
+SvxMacroTabPage::SvxMacroTabPage(Window* pParent,
+    const Reference< frame::XFrame >& _rxDocumentFrame,
+    const SfxItemSet& rSet,
+    Reference< container::XNameReplace > xNameReplace,
+    sal_uInt16 nSelectedIndex)
+    : _SvxMacroTabPage(pParent, "MacroAssignPage", "cui/ui/macroassignpage.ui", rSet)
 {
-    mpImpl->pStrEvent           = new OUString(                     CUI_RES( STR_EVENT ) );
-    mpImpl->pAssignedMacro      = new OUString(                     CUI_RES( STR_ASSMACRO ) );
-    mpImpl->pEventLB            = new MacroEventListBox( this,      CUI_RES( LB_EVENT ) );
-    mpImpl->pAssignFT           = new FixedText( this,              CUI_RES( FT_ASSIGN ) );
-    mpImpl->pAssignPB           = new PushButton( this,             CUI_RES( PB_ASSIGN ) );
-    mpImpl->pDeletePB           = new PushButton( this,             CUI_RES( PB_DELETE ) );
-    mpImpl->pAssignComponentPB  = new PushButton( this,         CUI_RES( PB_ASSIGN_COMPONENT ) );
-    mpImpl->pMacroImg           = new Image(                        CUI_RES(IMG_MACRO) );
-    mpImpl->pComponentImg       = new Image(                        CUI_RES(IMG_COMPONENT) );
-
-    FreeResource();
+    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();
 
     SetFrame( _rxDocumentFrame );
 
     if( !mpImpl->bIDEDialogMode )
     {
-        Point aPosAssign = mpImpl->pAssignPB->GetPosPixel();
-        Point aPosComp = mpImpl->pAssignComponentPB->GetPosPixel();
-
-        Point aPosDelete = mpImpl->pDeletePB->GetPosPixel();
-        long nYDiff = aPosComp.Y() - aPosAssign.Y();
-        aPosDelete.Y() -= nYDiff;
-        mpImpl->pDeletePB->SetPosPixel( aPosDelete );
-
         mpImpl->pAssignComponentPB->Hide();
         mpImpl->pAssignComponentPB->Disable();
     }
 
-    // must be done after FreeResource is called
     InitResources();
 
-    mpImpl->pEventLB->GetListBox().SetHelpId( HID_SVX_MACRO_LB_EVENT );
-
     InitAndSetHandler( xNameReplace, Reference< container::XNameReplace>(0), Reference< util::XModifiable >(0));
     DisplayAppEvents(true);
     SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
@@ -857,22 +869,13 @@ SvxMacroTabPage::SvxMacroTabPage( Window* pParent, const Reference< frame::XFram
         rListBox.Select(pE);
 }
 
-SvxMacroTabPage::~SvxMacroTabPage()
-{
-}
-
 SvxMacroAssignDlg::SvxMacroAssignDlg( Window* pParent, const Reference< frame::XFrame >& _rxDocumentFrame, const SfxItemSet& rSet,
     const Reference< container::XNameReplace >& xNameReplace, sal_uInt16 nSelectedIndex )
-        : SvxMacroAssignSingleTabDialog( pParent, rSet, 0 )
-{
-    SetTabPage( new SvxMacroTabPage( this, _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex ) );
-}
-
-SvxMacroAssignDlg::~SvxMacroAssignDlg()
+        : SvxMacroAssignSingleTabDialog(pParent, rSet)
 {
+    setTabPage(new SvxMacroTabPage(get_content_area(), _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex));
 }
 
-
 //===============================================
 
 IMPL_LINK_NOARG(AssignComponentDialog, ButtonHandler)
@@ -918,103 +921,18 @@ AssignComponentDialog::~AssignComponentDialog()
 IMPL_LINK( SvxMacroAssignSingleTabDialog, OKHdl_Impl, Button *, pButton )
 {
     (void)pButton; //unused
-    pPage->FillItemSet( *pOutSet );
+    GetTabPage()->FillItemSet( *(SfxItemSet*)0 );
     EndDialog( RET_OK );
     return 0;
 }
 
 // -----------------------------------------------------------------------
 
-SvxMacroAssignSingleTabDialog::SvxMacroAssignSingleTabDialog
-    ( Window *pParent, const SfxItemSet& rSet, sal_uInt16 nUniqueId ) :
-        SfxModalDialog( pParent, nUniqueId, WinBits( WB_STDMODAL | WB_3DLOOK ) ),
-        pFixedLine      ( 0 ),
-        pOKBtn          ( 0 ),
-        pCancelBtn      ( 0 ),
-        pHelpBtn        ( 0 ),
-        pPage           ( 0 ),
-        pOptions        ( &rSet ),
-        pOutSet         ( 0 )
-{}
-
-
-// -----------------------------------------------------------------------
-
-SvxMacroAssignSingleTabDialog::~SvxMacroAssignSingleTabDialog()
+SvxMacroAssignSingleTabDialog::SvxMacroAssignSingleTabDialog(Window *pParent,
+    const SfxItemSet& rSet)
+    : SfxSingleTabDialog(pParent, rSet)
 {
-    delete pFixedLine;
-    delete pOKBtn;
-    delete pCancelBtn;
-    delete pHelpBtn;
-    delete pPage;
-}
-
-// -----------------------------------------------------------------------
-
-// According to SfxNoLayoutSingleTabDialog
-void SvxMacroAssignSingleTabDialog::SetTabPage( SfxTabPage* pTabPage )
-{
-    pFixedLine = new FixedLine( this );
-
-    pOKBtn = new OKButton( this, WB_DEFBUTTON );
-    pOKBtn->SetClickHdl( LINK( this, SvxMacroAssignSingleTabDialog, OKHdl_Impl ) );
-
-    pCancelBtn = new CancelButton( this );
-    pHelpBtn = new HelpButton( this );
-
-    pPage = pTabPage;
-
-    if ( pPage )
-    {
-        OUString sUserData;
-        pPage->SetUserData( sUserData );
-        pPage->Reset( *pOptions );
-        pPage->Show();
-
-        // Set dialog's and buttons' size and position according to tabpage size
-        long nSpaceX = LogicToPixel( Size( 6, 0 ), MAP_APPFONT ).Width();
-        long nSpaceY = LogicToPixel( Size( 0, 6 ), MAP_APPFONT ).Height();
-        long nHalfSpaceX = LogicToPixel( Size( 3, 0 ), MAP_APPFONT ).Width();
-        long nHalfSpaceY = LogicToPixel( Size( 0, 3 ), MAP_APPFONT ).Height();
-
-        pPage->SetPosPixel( Point() );
-        Size aTabpageSize( pPage->GetSizePixel() );
-        Size aDialogSize( aTabpageSize );
-        Size aButtonSize = LogicToPixel( Size( 50, 14 ), MAP_APPFONT );
-        long nButtonWidth  = aButtonSize.Width();
-        long nButtonHeight = aButtonSize.Height();
-
-        Size aFixedLineSize( aTabpageSize );
-        long nFixedLineHeight = LogicToPixel( Size( 0, 8 ), MAP_APPFONT ).Height();
-        aFixedLineSize.Height() = nFixedLineHeight;
-
-        aDialogSize.Height() += nFixedLineHeight + nButtonHeight + nSpaceY + nHalfSpaceY;
-        SetOutputSizePixel( aDialogSize );
-
-        long nButtonPosY = aTabpageSize.Height() + nFixedLineHeight + nHalfSpaceY;
-        long nHelpButtonPosX = nSpaceX;
-        pHelpBtn->SetPosSizePixel( Point( nHelpButtonPosX, nButtonPosY), aButtonSize );
-        pHelpBtn->Show();
-
-        long nCancelButtonPosX = aDialogSize.Width() - nButtonWidth - nSpaceX + 1;
-        pCancelBtn->SetPosSizePixel( Point( nCancelButtonPosX, nButtonPosY), aButtonSize );
-        pCancelBtn->Show();
-
-        long nOkButtonPosX = nCancelButtonPosX - nButtonWidth - nHalfSpaceX;
-        pOKBtn->SetPosSizePixel( Point( nOkButtonPosX, nButtonPosY), aButtonSize );
-        pOKBtn->Show();
-
-        long nFixedLinePosY = aTabpageSize.Height();
-        pFixedLine->SetPosSizePixel( Point( 0, nFixedLinePosY), aFixedLineSize );
-        pFixedLine->Show();
-
-        // Get text from TabPage
-        SetText( pPage->GetText() );
-
-        // Get IDs from TabPage
-        SetHelpId( pPage->GetHelpId() );
-        SetUniqueId( pPage->GetUniqueId() );
-    }
+    GetOKButton()->SetClickHdl( LINK( this, SvxMacroAssignSingleTabDialog, OKHdl_Impl ) );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/customize/macropg.src b/cui/source/customize/macropg.src
index 0a8b42d..199bb66 100644
--- a/cui/source/customize/macropg.src
+++ b/cui/source/customize/macropg.src
@@ -26,75 +26,6 @@
 #define MASKCOLOR  MaskColor = \
     Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
 
-TabPage RID_SVXPAGE_MACROASSIGN
-{
-    HelpID = "cui:TabPage:RID_SVXPAGE_MACROASSIGN" ;
-    Hide = TRUE ;
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
-    Text [ en-US ] = "Assign action" ;
-    String STR_EVENT
-    {
-        Text [ en-US ] = "Event" ;
-    };
-    String STR_ASSMACRO
-    {
-        Text [ en-US ] = "Assigned Action" ;
-    };
-    Control LB_EVENT
-    {
-        Border = TRUE ;
-        TabStop = TRUE;
-        Pos = MAP_APPFONT ( COL0 , ROW0 ) ;
-        Size = MAP_APPFONT ( WIDTH1_2 , HEIGHT0 ) ;
-        HelpID = HID_SVX_MACRO_LB_EVENT ;
-    };
-    FixedText FT_ASSIGN
-    {
-        Pos = MAP_APPFONT ( COL4 , ROW0 ) ;
-        Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_FIXEDTEXT_HEIGHT ) ;
-        Text [ en-US ] = "Assign:" ;
-    };
-    PushButton PB_ASSIGN
-    {
-        HelpID = "cui:PushButton:RID_SVXPAGE_MACROASSIGN:PB_ASSIGN";
-        Pos = MAP_APPFONT ( COL4 , ROW0A  ) ;
-        Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
-        Text [ en-US ] = "M~acro..." ;
-        Disable = TRUE ;
-        TabStop = TRUE ;
-    };
-    PushButton PB_ASSIGN_COMPONENT
-    {
-        HelpID = "cui:PushButton:RID_SVXPAGE_MACROASSIGN:PB_ASSIGN_COMPONENT";
-        Pos = MAP_APPFONT ( COL4 , ROW2  ) ;
-        Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
-        Disable = TRUE ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "Com~ponent..." ;
-    };
-    PushButton PB_DELETE
-    {
-        HelpID = "cui:PushButton:RID_SVXPAGE_MACROASSIGN:PB_DELETE";
-        Pos = MAP_APPFONT ( COL4 , ROW5_REMOVE  ) ;
-        Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
-        Text [ en-US ] = "~Remove" ;
-        Disable = TRUE ;
-        TabStop = TRUE ;
-    };
-    Image IMG_MACRO
-    {
-        ImageBitmap = Bitmap { File = "id018.png"; };
-        MASKCOLOR
-    };
-    Image IMG_COMPONENT
-    {
-        ImageBitmap = Bitmap { File = "component_16.png"; };
-        MASKCOLOR
-    };
-};
-
 ModalDialog RID_SVXDLG_ASSIGNCOMPONENT
 {
     HelpID = "cui:ModalDialog:RID_SVXDLG_ASSIGNCOMPONENT";
diff --git a/cui/source/customize/macropg_impl.hxx b/cui/source/customize/macropg_impl.hxx
index c467137..49f3c7b 100644
--- a/cui/source/customize/macropg_impl.hxx
+++ b/cui/source/customize/macropg_impl.hxx
@@ -23,20 +23,19 @@
 class _SvxMacroTabPage_Impl
 {
 public:
-                                    _SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet );
-                                    ~_SvxMacroTabPage_Impl();
+    _SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet );
 
     FixedText*                      pAssignFT;
     PushButton*                     pAssignPB;
     PushButton*                     pAssignComponentPB;
     PushButton*                     pDeletePB;
-    Image*                          pMacroImg;
-    Image*                          pComponentImg;
-    OUString*                       pStrEvent;
-    OUString*                       pAssignedMacro;
+    Image                           aMacroImg;
+    Image                           aComponentImg;
+    OUString                        sStrEvent;
+    OUString                        sAssignedMacro;
     MacroEventListBox*              pEventLB;
-    sal_Bool                            bReadOnly;
-    sal_Bool                            bIDEDialogMode;
+    sal_Bool                        bReadOnly;
+    sal_Bool                        bIDEDialogMode;
 };
 
 class AssignComponentDialog : public ModalDialog
diff --git a/cui/source/inc/headertablistbox.hxx b/cui/source/inc/headertablistbox.hxx
index 0e01475..fd8ff3e 100644
--- a/cui/source/inc/headertablistbox.hxx
+++ b/cui/source/inc/headertablistbox.hxx
@@ -34,8 +34,10 @@ protected:
     virtual bool                Notify( NotifyEvent& rNEvt );
 public:
     MacroEventListBox( Window* pParent, const ResId& rId );
+    MacroEventListBox( Window* pParent, WinBits nStyle );
 
-    void Resize();
+    virtual void Resize();
+    virtual Size GetOptimalSize() const;
 
     SvHeaderTabListBox& GetListBox()
     {
diff --git a/cui/source/inc/macropg.hxx b/cui/source/inc/macropg.hxx
index 5b11d02..3f4be4d 100644
--- a/cui/source/inc/macropg.hxx
+++ b/cui/source/inc/macropg.hxx
@@ -72,7 +72,8 @@ protected:
     bool bReadOnly, bDocModified, bAppEvents, bInitialized;
     EventDisplayNames aDisplayNames;
 
-                                _SvxMacroTabPage( Window* pParent, const ResId& rId, const SfxItemSet& rItemSet );
+    _SvxMacroTabPage( Window* pParent, const ResId& rId, const SfxItemSet& rItemSet );
+    _SvxMacroTabPage( Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet& rItemSet );
 
     void                        EnableButtons();
     ::com::sun::star::uno::Any  GetPropsByName( const OUString& eventName, EventsHash& eventsHash );
@@ -86,8 +87,7 @@ public:
     void                        InitAndSetHandler( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > xAppEvents, ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > xDocEvents, ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifiable > xModifiable );
     virtual sal_Bool                FillItemSet( SfxItemSet& rSet );
 
-    using SfxTabPage::Reset;
-    virtual void                Reset();
+    virtual void        Reset( const SfxItemSet& );
 
     void                        DisplayAppEvents( bool appEvents);
     void                        SetReadOnly( sal_Bool bSet );
@@ -104,33 +104,18 @@ public:
         ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > xNameReplace,
         sal_uInt16 nSelectedIndex
     );
-    virtual ~SvxMacroTabPage();
 };
 
 // class SvxMacroAssignDlg --------------------------------------------------
 
 typedef sal_uInt16* (*GetTabPageRanges)(); // gives international Which-values
 
-class SvxMacroAssignSingleTabDialog : public SfxModalDialog
+class SvxMacroAssignSingleTabDialog : public SfxSingleTabDialog
 {
 public:
-    SvxMacroAssignSingleTabDialog( Window* pParent, const SfxItemSet& rOptionsSet, sal_uInt16 nUniqueId );
-
-    virtual             ~SvxMacroAssignSingleTabDialog();
-
-    void                SetTabPage( SfxTabPage* pTabPage );
+    SvxMacroAssignSingleTabDialog(Window* pParent, const SfxItemSet& rOptionsSet);
 
 private:
-    FixedLine*          pFixedLine;
-
-    OKButton*           pOKBtn;
-    CancelButton*       pCancelBtn;
-    HelpButton*         pHelpBtn;
-
-    SfxTabPage*         pPage;
-    const SfxItemSet*   pOptions;
-    SfxItemSet*         pOutSet;
-
     DECL_DLLPRIVATE_LINK( OKHdl_Impl, Button * );
 };
 
@@ -145,7 +130,6 @@ public:
         const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace >& xNameReplace,
         sal_uInt16 nSelectedIndex
     );
-    virtual ~SvxMacroAssignDlg();
 };
 
 #endif
diff --git a/cui/uiconfig/ui/macroassignpage.ui b/cui/uiconfig/ui/macroassignpage.ui
new file mode 100644
index 0000000..cfbd216
--- /dev/null
+++ b/cui/uiconfig/ui/macroassignpage.ui
@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Thu Jan 23 10:25:37 2014 -->
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <!-- interface-requires LibreOffice 1.0 -->
+  <object class="GtkGrid" id="MacroAssignPage">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="row_spacing">12</property>
+    <property name="column_spacing">12</property>
+    <child>
+      <object class="GtkFrame" id="frame1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="vexpand">True</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <property name="top_padding">6</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkGrid" id="grid1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <child>
+                  <object class="cuilo-MacroEventListBox" id="assignments:border">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</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>
+                    <child>
+                      <object class="GtkLabel" id="eventft">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Event</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="GtkLabel" id="assignft">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Assigned Action</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="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="libraryft1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Assignments</property>
+            <attributes>
+              <attribute name="weight" value="bold"/>
+            </attributes>
+          </object>
+        </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="GtkFrame" id="frame2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="top_padding">6</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkButtonBox" id="buttonbox1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <property name="spacing">6</property>
+                <property name="layout_style">start</property>
+                <child>
+                  <object class="GtkButton" id="assign">
+                    <property name="label" translatable="yes">M_acro...</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="component">
+                    <property name="label">Com_ponent...</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="delete">
+                    <property name="label">Remove</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <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>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="label1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Assign</property>
+            <attributes>
+              <attribute name="weight" value="bold"/>
+            </attributes>
+          </object>
+        </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>
+</interface>
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index f215a45..22003b8 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -18,6 +18,9 @@
     <glade-widget-class title="Font PickListBox" name="smlo-SmFontPickListBox"
                         generic-name="SmFontPickListBox" parent="GtkComboBoxText"
                         icon-name="widget-gtk-comboboxtext"/>
+    <glade-widget-class title="Macro EventListBox" name="cuilo-MacroEventListBox"
+                        generic-name="Macro EventListBox" 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"/>


More information about the Libreoffice-commits mailing list