[Libreoffice-commits] core.git: include/svx svx/inc svx/source svx/uiconfig svx/UIConfig_svx.mk

Caolán McNamara caolanm at redhat.com
Fri Aug 15 08:06:06 PDT 2014


 include/svx/dialogs.hrc          |    1 
 include/svx/fmresids.hrc         |    2 
 svx/UIConfig_svx.mk              |    1 
 svx/inc/fmhelp.hrc               |   12 
 svx/source/form/datanavi.cxx     |  646 +++++++++++++++++----------------------
 svx/source/form/datanavi.src     |  141 --------
 svx/source/inc/datanavi.hrc      |   24 -
 svx/source/inc/datanavi.hxx      |   23 -
 svx/uiconfig/ui/datanavigator.ui |  204 ++++++++++++
 9 files changed, 527 insertions(+), 527 deletions(-)

New commits:
commit 38cbb4c7176d85973c4945a10a262bb487388246
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Aug 15 15:09:57 2014 +0100

    convert datanavigator sport to .ui
    
    Change-Id: I14f9f8d8df9fc8246e7fc8c0b6762ca51dad67d9

diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index ce486d9..bd2fbe1 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -138,6 +138,7 @@
 #define RID_SVXSW_FRAMEPOSITIONS            (RID_SVX_START + 289)
 
 #define RID_SVXIL_FRAME                     (RID_SVX_START +  65)
+#define RID_SVXIL_DATANAVI                  (RID_SVX_START +  66)
 
 #define RID_SVXFLOAT_3D                     (RID_SVX_START + 209)
 
diff --git a/include/svx/fmresids.hrc b/include/svx/fmresids.hrc
index 5299c1c..82a792b 100644
--- a/include/svx/fmresids.hrc
+++ b/include/svx/fmresids.hrc
@@ -63,8 +63,6 @@
 // Dialog-Id's -----------------------------------------------------------
 #define RID_SVX_FMEXPLORER                          (RID_FORMS_START + 6)
 
-#define RID_SVXWIN_DATANAVIGATOR                    (RID_FORMS_START + 19)
-
 // Toolbars ------------------------------------------------------------
 #define RID_SVXTBX_FORM_NAVIGATION                  (RID_FORMS_START +  1)
 #define RID_SVXTBX_FORM_FILTER                      (RID_FORMS_START +  2)
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index 9545379..76e7f12 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
 	svx/uiconfig/ui/chineseconversiondialog \
 	svx/uiconfig/ui/chinesedictionary \
 	svx/uiconfig/ui/compressgraphicdialog \
+	svx/uiconfig/ui/datanavigator \
 	svx/uiconfig/ui/deleteheaderdialog \
 	svx/uiconfig/ui/deletefooterdialog \
 	svx/uiconfig/ui/docrecoverybrokendialog \
diff --git a/svx/inc/fmhelp.hrc b/svx/inc/fmhelp.hrc
index 2334002..35eb10d 100644
--- a/svx/inc/fmhelp.hrc
+++ b/svx/inc/fmhelp.hrc
@@ -36,24 +36,12 @@
 #define UID_SEARCH_RECORDSTATUS                               "SVX_UID_SEARCH_RECORDSTATUS"
 #define UID_FORMPROPBROWSER_FRAME                             "SVX_UID_FORMPROPBROWSER_FRAME"
 #define UID_ABSOLUTE_RECORD_WINDOW                            "SVX_UID_ABSOLUTE_RECORD_WINDOW"
-#define HID_DATA_NAVIGATOR_WIN                                "SVX_HID_DATA_NAVIGATOR_WIN"
-#define HID_MN_XFORMS_MODELS_ADD                              "SVX_HID_MN_XFORMS_MODELS_ADD"
-#define HID_MN_XFORMS_MODELS_EDIT                             "SVX_HID_MN_XFORMS_MODELS_EDIT"
-#define HID_MN_XFORMS_MODELS_REMOVE                           "SVX_HID_MN_XFORMS_MODELS_REMOVE"
-#define HID_MN_XFORMS_INSTANCES_ADD                           "SVX_HID_MN_XFORMS_INSTANCES_ADD"
-#define HID_MN_XFORMS_INSTANCES_EDIT                          "SVX_HID_MN_XFORMS_INSTANCES_EDIT"
-#define HID_MN_XFORMS_INSTANCES_REMOVE                        "SVX_HID_MN_XFORMS_INSTANCES_REMOVE"
-#define HID_MN_XFORMS_SHOW_DETAILS                            "SVX_HID_MN_XFORMS_SHOW_DETAILS"
 #define HID_XFORMS_TOOLBOX_ITEM_ADD                           "SVX_HID_XFORMS_TOOLBOX_ITEM_ADD"
 #define HID_XFORMS_TOOLBOX_ITEM_ADD_ELEMENT                   "SVX_HID_XFORMS_TOOLBOX_ITEM_ADD_ELEMENT"
 #define HID_XFORMS_TOOLBOX_ITEM_ADD_ATTRIBUTE                 "SVX_HID_XFORMS_TOOLBOX_ITEM_ADD_ATTRIBUTE"
 #define HID_XFORMS_TOOLBOX_ITEM_EDIT                          "SVX_HID_XFORMS_TOOLBOX_ITEM_EDIT"
 #define HID_XFORMS_TOOLBOX_ITEM_REMOVE                        "SVX_HID_XFORMS_TOOLBOX_ITEM_REMOVE"
-#define HID_XFORMS_MODELS_LIST                                "SVX_HID_XFORMS_MODELS_LIST"
-#define HID_XFORMS_MODELS_MENUBTN                             "SVX_HID_XFORMS_MODELS_MENUBTN"
-#define HID_XFORMS_INSTANCES_MENUBTN                          "SVX_HID_XFORMS_INSTANCES_MENUBTN"
 #define HID_XFORMS_MID_INSERT_CONTROL                         "SVX_HID_XFORMS_MID_INSERT_CONTROL"
-#define HID_XFORMS_TAB_CONTROL                                "SVX_HID_XFORMS_TAB_CONTROL"
 #define HID_FM_DELETEROWS                                     "SVX_HID_FM_DELETEROWS"
 #define HID_FM_INSERTCOL                                      "SVX_HID_FM_INSERTCOL"
 #define HID_FM_CHANGECOL                                      "SVX_HID_FM_CHANGECOL"
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 7a40de4..a0a2890 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -41,6 +41,7 @@
 #include <sfx2/objsh.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/dispatch.hxx>
+#include <vcl/layout.hxx>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/container/XSet.hpp>
 #include <com/sun/star/datatransfer/XTransferable.hpp>
@@ -1342,61 +1343,39 @@ namespace svxform
         }
     }
 
-
-
     // class DataNavigatorWindow
-
-    DataNavigatorWindow::DataNavigatorWindow( Window* pParent, SfxBindings* pBindings ) :
-
-        Window( pParent, SVX_RES( RID_SVXWIN_DATANAVIGATOR ) ),
-
-        m_aModelsBox        ( this, SVX_RES( LB_MODELS ) ),
-        m_aModelBtn         ( this, SVX_RES( MB_MODELS ) ),
-        m_aTabCtrl          ( this, SVX_RES( TC_ITEMS ) ),
-        m_aInstanceBtn      ( this, SVX_RES( MB_INSTANCES ) ),
-
-        m_pInstPage         ( NULL ),
-        m_pSubmissionPage   ( NULL ),
-        m_pBindingPage      ( NULL ),
-
-        m_nMinWidth         ( 0 ),
-        m_nMinHeight        ( 0 ),
-        m_nBorderHeight     ( 0 ),
-        m_nLastSelectedPos  ( LISTBOX_ENTRY_NOTFOUND ),
-        m_bShowDetails      ( false ),
-        m_bIsNotifyDisabled ( false ),
-
-        m_aItemImageList    (       SVX_RES( IL_ITEM_BMPS ) ),
-        m_xDataListener     ( new DataListener( this ) )
-
-    {
-        FreeResource();
-
-        // init minimal metric
-        m_a2Size = LogicToPixel( Size( 2, 2 ), MAP_APPFONT );
-        m_a3Size = LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
-        Size aOutSz = GetOutputSizePixel();
-        Size aLogSize = PixelToLogic( aOutSz, MAP_APPFONT );
-        m_nMinWidth = aLogSize.Width();
-        m_nMinHeight = aLogSize.Height();
-        m_nBorderHeight = 4*m_a3Size.Height() +
-            m_aModelBtn.GetSizePixel().Height() + m_aInstanceBtn.GetSizePixel().Height();
+    DataNavigatorWindow::DataNavigatorWindow(Window* pParent, SfxBindings* pBindings)
+        : Window(pParent)
+        , m_pInstPage(NULL)
+        , m_pSubmissionPage(NULL)
+        , m_pBindingPage(NULL)
+        , m_nLastSelectedPos(LISTBOX_ENTRY_NOTFOUND)
+        , m_bShowDetails(false)
+        , m_bIsNotifyDisabled(false)
+        , m_aItemImageList(SVX_RES(RID_SVXIL_DATANAVI))
+        , m_xDataListener(new DataListener(this))
+    {
+        m_pUIBuilder = new VclBuilder(this, getUIRootDir(), "svx/ui/datanavigator.ui", "DataNavigator");
+        get(m_pModelsBox, "modelslist");
+        get(m_pModelBtn, "modelsbutton");
+        get(m_pTabCtrl, "tabcontrol");
+        get(m_pInstanceBtn, "instances");
 
         // handler
-        m_aModelsBox.SetSelectHdl( LINK( this, DataNavigatorWindow, ModelSelectHdl ) );
+        m_pModelsBox->SetSelectHdl( LINK( this, DataNavigatorWindow, ModelSelectHdl ) );
         Link aLink = LINK( this, DataNavigatorWindow, MenuSelectHdl );
-        m_aModelBtn.SetSelectHdl( aLink );
-        m_aInstanceBtn.SetSelectHdl( aLink );
+        m_pModelBtn->SetSelectHdl( aLink );
+        m_pInstanceBtn->SetSelectHdl( aLink );
         aLink = LINK( this, DataNavigatorWindow, MenuActivateHdl );
-        m_aModelBtn.SetActivateHdl( aLink );
-        m_aInstanceBtn.SetActivateHdl( aLink );
-        m_aTabCtrl.SetActivatePageHdl( LINK( this, DataNavigatorWindow, ActivatePageHdl ) );
+        m_pModelBtn->SetActivateHdl( aLink );
+        m_pInstanceBtn->SetActivateHdl( aLink );
+        m_pTabCtrl->SetActivatePageHdl( LINK( this, DataNavigatorWindow, ActivatePageHdl ) );
         m_aUpdateTimer.SetTimeout( 2000 );
         m_aUpdateTimer.SetTimeoutHdl( LINK( this, DataNavigatorWindow, UpdateHdl ) );
 
         // init tabcontrol
-        m_aTabCtrl.Show();
-        sal_Int32 nPageId = TID_INSTANCE;
+        m_pTabCtrl->Show();
+        sal_Int32 nPageId = m_pTabCtrl->GetPageId("instance");
         SvtViewOptions aViewOpt( E_TABDIALOG, CFGNAME_DATANAVIGATOR );
         if ( aViewOpt.Exists() )
         {
@@ -1404,12 +1383,13 @@ namespace svxform
             aViewOpt.GetUserItem(CFGNAME_SHOWDETAILS) >>= m_bShowDetails;
         }
 
-        Menu* pMenu = m_aInstanceBtn.GetPopupMenu();
-        pMenu->SetItemBits( MID_SHOW_DETAILS, MIB_CHECKABLE );
-        pMenu->CheckItem( MID_SHOW_DETAILS, m_bShowDetails );
+        Menu* pMenu = m_pInstanceBtn->GetPopupMenu();
+        sal_uInt16 nInstancesDetailsId = pMenu->GetItemId("instancesdetails");
+        pMenu->SetItemBits(nInstancesDetailsId, MIB_CHECKABLE );
+        pMenu->CheckItem(nInstancesDetailsId, m_bShowDetails );
 
-        m_aTabCtrl.SetCurPageId( static_cast< sal_uInt16 >( nPageId ) );
-        ActivatePageHdl( &m_aTabCtrl );
+        m_pTabCtrl->SetCurPageId( static_cast< sal_uInt16 >( nPageId ) );
+        ActivatePageHdl(m_pTabCtrl);
 
         // get our frame
         DBG_ASSERT( pBindings != NULL,
@@ -1430,7 +1410,7 @@ namespace svxform
     DataNavigatorWindow::~DataNavigatorWindow()
     {
         SvtViewOptions aViewOpt( E_TABDIALOG, CFGNAME_DATANAVIGATOR );
-        aViewOpt.SetPageID( static_cast< sal_Int32 >( m_aTabCtrl.GetCurPageId() ) );
+        aViewOpt.SetPageID( static_cast< sal_Int32 >( m_pTabCtrl->GetCurPageId() ) );
         Any aAny;
         aAny <<= m_bShowDetails;
         aViewOpt.SetUserItem(CFGNAME_SHOWDETAILS,aAny);
@@ -1452,7 +1432,7 @@ namespace svxform
 
     IMPL_LINK( DataNavigatorWindow, ModelSelectHdl, ListBox *, pBox )
     {
-        sal_Int32 nPos = m_aModelsBox.GetSelectEntryPos();
+        sal_Int32 nPos = m_pModelsBox->GetSelectEntryPos();
         // pBox == NULL, if you want to force a new fill.
         if ( nPos != m_nLastSelectedPos || !pBox )
         {
@@ -1469,8 +1449,8 @@ namespace svxform
     {
         bool bIsDocModified = false;
         Reference< css::xforms::XFormsUIHelper1 > xUIHelper;
-        sal_Int32 nSelectedPos = m_aModelsBox.GetSelectEntryPos();
-        OUString sSelectedModel( m_aModelsBox.GetEntry( nSelectedPos ) );
+        sal_Int32 nSelectedPos = m_pModelsBox->GetSelectEntryPos();
+        OUString sSelectedModel( m_pModelsBox->GetEntry( nSelectedPos ) );
         Reference< css::xforms::XModel > xModel;
         try
         {
@@ -1486,112 +1466,47 @@ namespace svxform
 
         m_bIsNotifyDisabled = true;
 
-        if ( &m_aModelBtn == pBtn )
+        if (m_pModelBtn == pBtn)
         {
-            switch ( pBtn->GetCurItemId() )
+            OString sIdent(pBtn->GetCurItemIdent());
+            if (sIdent == "modelsadd")
             {
-                case MID_MODELS_ADD :
+                AddModelDialog aDlg( this, false );
+                bool bShowDialog = true;
+                while ( bShowDialog )
                 {
-                    AddModelDialog aDlg( this, false );
-                    bool bShowDialog = true;
-                    while ( bShowDialog )
+                    bShowDialog = false;
+                    if ( aDlg.Execute() == RET_OK )
                     {
-                        bShowDialog = false;
-                        if ( aDlg.Execute() == RET_OK )
-                        {
-                            OUString sNewName = aDlg.GetName();
-                            bool bDocumentData = aDlg.GetModifyDoc();
+                        OUString sNewName = aDlg.GetName();
+                        bool bDocumentData = aDlg.GetModifyDoc();
 
-                            if ( m_aModelsBox.GetEntryPos( sNewName ) != LISTBOX_ENTRY_NOTFOUND )
-                            {
-                                // error: model name already exists
-                                ErrorBox aErrBox( this, SVX_RES( RID_ERR_DOUBLE_MODELNAME ) );
-                                OUString sMessText = aErrBox.GetMessText();
-                                sMessText = sMessText.replaceFirst( MSG_VARIABLE, sNewName );
-                                aErrBox.SetMessText( sMessText );
-                                aErrBox.Execute();
-                                bShowDialog = true;
-                            }
-                            else
-                            {
-                                try
-                                {
-                                    // add new model to frame model
-                                    Reference< css::xforms::XModel > xNewModel(
-                                        xUIHelper->newModel( m_xFrameModel, sNewName ), UNO_SET_THROW );
-
-                                    Reference< XPropertySet > xModelProps( xNewModel, UNO_QUERY_THROW );
-                                    xModelProps->setPropertyValue(
-                                        OUString( "ExternalData" ),
-                                        makeAny( !bDocumentData ) );
-
-                                    sal_Int32 nNewPos = m_aModelsBox.InsertEntry( sNewName );
-                                    m_aModelsBox.SelectEntryPos( nNewPos );
-                                    ModelSelectHdl( &m_aModelsBox );
-                                    bIsDocModified = true;
-                                }
-                                catch ( Exception& )
-                                {
-                                    SAL_WARN( "svx.form", "DataNavigatorWindow::MenuSelectHdl(): exception caught" );
-                                }
-                            }
+                        if ( m_pModelsBox->GetEntryPos( sNewName ) != LISTBOX_ENTRY_NOTFOUND )
+                        {
+                            // error: model name already exists
+                            ErrorBox aErrBox( this, SVX_RES( RID_ERR_DOUBLE_MODELNAME ) );
+                            OUString sMessText = aErrBox.GetMessText();
+                            sMessText = sMessText.replaceFirst( MSG_VARIABLE, sNewName );
+                            aErrBox.SetMessText( sMessText );
+                            aErrBox.Execute();
+                            bShowDialog = true;
                         }
-                    }
-                    break;
-                }
-                case MID_MODELS_EDIT :
-                {
-                    AddModelDialog aDlg( this, true );
-                    aDlg.SetName( sSelectedModel );
-
-                    bool bDocumentData( false );
-                    try
-                    {
-                        Reference< css::xforms::XFormsSupplier > xFormsSupp( m_xFrameModel, UNO_QUERY_THROW );
-                        Reference< XNameContainer > xXForms( xFormsSupp->getXForms(), UNO_SET_THROW );
-                        Reference< XPropertySet > xModelProps( xXForms->getByName( sSelectedModel ), UNO_QUERY_THROW );
-                        bool bExternalData = false;
-                        OSL_VERIFY( xModelProps->getPropertyValue(
-                            OUString( "ExternalData" ) ) >>= bExternalData );
-                        bDocumentData = !bExternalData;
-                    }
-                    catch( const Exception& )
-                    {
-                        DBG_UNHANDLED_EXCEPTION();
-                    }
-                    aDlg.SetModifyDoc( bDocumentData );
-
-                    if ( aDlg.Execute() == RET_OK )
-                    {
-                        if ( aDlg.GetModifyDoc() != bool( bDocumentData ) )
+                        else
                         {
-                            bDocumentData = aDlg.GetModifyDoc();
                             try
                             {
-                                Reference< css::xforms::XFormsSupplier > xFormsSupp( m_xFrameModel, UNO_QUERY_THROW );
-                                Reference< XNameContainer > xXForms( xFormsSupp->getXForms(), UNO_SET_THROW );
-                                Reference< XPropertySet > xModelProps( xXForms->getByName( sSelectedModel ), UNO_QUERY_THROW );
+                                // add new model to frame model
+                                Reference< css::xforms::XModel > xNewModel(
+                                    xUIHelper->newModel( m_xFrameModel, sNewName ), UNO_SET_THROW );
+
+                                Reference< XPropertySet > xModelProps( xNewModel, UNO_QUERY_THROW );
                                 xModelProps->setPropertyValue(
                                     OUString( "ExternalData" ),
                                     makeAny( !bDocumentData ) );
-                                bIsDocModified = true;
-                            }
-                            catch( const Exception& )
-                            {
-                                DBG_UNHANDLED_EXCEPTION();
-                            }
-                        }
-
-                        OUString sNewName = aDlg.GetName();
-                        if ( !sNewName.isEmpty() && ( sNewName != sSelectedModel ) )
-                        {
-                            try
-                            {
-                                xUIHelper->renameModel( m_xFrameModel, sSelectedModel, sNewName );
 
-                                m_aModelsBox.RemoveEntry( nSelectedPos );
-                                nSelectedPos = m_aModelsBox.InsertEntry( sNewName );
-                                m_aModelsBox.SelectEntryPos( nSelectedPos );
+                                sal_Int32 nNewPos = m_pModelsBox->InsertEntry( sNewName );
+                                m_pModelsBox->SelectEntryPos( nNewPos );
+                                ModelSelectHdl(m_pModelsBox);
                                 bIsDocModified = true;
                             }
                             catch ( Exception& )
@@ -1600,171 +1515,226 @@ namespace svxform
                             }
                         }
                     }
-                    break;
                 }
-                case MID_MODELS_REMOVE :
+            }
+            else if (sIdent == "modelsedit")
+            {
+                AddModelDialog aDlg( this, true );
+                aDlg.SetName( sSelectedModel );
+
+                bool bDocumentData( false );
+                try
+                {
+                    Reference< css::xforms::XFormsSupplier > xFormsSupp( m_xFrameModel, UNO_QUERY_THROW );
+                    Reference< XNameContainer > xXForms( xFormsSupp->getXForms(), UNO_SET_THROW );
+                    Reference< XPropertySet > xModelProps( xXForms->getByName( sSelectedModel ), UNO_QUERY_THROW );
+                    bool bExternalData = false;
+                    OSL_VERIFY( xModelProps->getPropertyValue(
+                        OUString( "ExternalData" ) ) >>= bExternalData );
+                    bDocumentData = !bExternalData;
+                }
+                catch( const Exception& )
                 {
-                    QueryBox aQBox( this, SVX_RES( RID_QRY_REMOVE_MODEL ) );
-                    OUString sText = aQBox.GetMessText();
-                    sText = sText.replaceFirst( MODELNAME, sSelectedModel );
-                    aQBox.SetMessText( sText );
-                    if ( aQBox.Execute() == RET_YES )
+                    DBG_UNHANDLED_EXCEPTION();
+                }
+                aDlg.SetModifyDoc( bDocumentData );
+
+                if ( aDlg.Execute() == RET_OK )
+                {
+                    if ( aDlg.GetModifyDoc() != bool( bDocumentData ) )
                     {
+                        bDocumentData = aDlg.GetModifyDoc();
                         try
                         {
-                            xUIHelper->removeModel( m_xFrameModel, sSelectedModel );
+                            Reference< css::xforms::XFormsSupplier > xFormsSupp( m_xFrameModel, UNO_QUERY_THROW );
+                            Reference< XNameContainer > xXForms( xFormsSupp->getXForms(), UNO_SET_THROW );
+                            Reference< XPropertySet > xModelProps( xXForms->getByName( sSelectedModel ), UNO_QUERY_THROW );
+                            xModelProps->setPropertyValue(
+                                OUString( "ExternalData" ),
+                                makeAny( !bDocumentData ) );
+                            bIsDocModified = true;
+                        }
+                        catch( const Exception& )
+                        {
+                            DBG_UNHANDLED_EXCEPTION();
+                        }
+                    }
+
+                    OUString sNewName = aDlg.GetName();
+                    if ( !sNewName.isEmpty() && ( sNewName != sSelectedModel ) )
+                    {
+                        try
+                        {
+                            xUIHelper->renameModel( m_xFrameModel, sSelectedModel, sNewName );
+
+                            m_pModelsBox->RemoveEntry( nSelectedPos );
+                            nSelectedPos = m_pModelsBox->InsertEntry( sNewName );
+                            m_pModelsBox->SelectEntryPos( nSelectedPos );
+                            bIsDocModified = true;
                         }
                         catch ( Exception& )
                         {
                             SAL_WARN( "svx.form", "DataNavigatorWindow::MenuSelectHdl(): exception caught" );
                         }
-                        m_aModelsBox.RemoveEntry( nSelectedPos );
-                        if ( m_aModelsBox.GetEntryCount() <= nSelectedPos )
-                            nSelectedPos = m_aModelsBox.GetEntryCount() - 1;
-                        m_aModelsBox.SelectEntryPos( nSelectedPos );
-                        ModelSelectHdl( &m_aModelsBox );
-                        bIsDocModified = true;
                     }
-                    break;
                 }
-                default:
+            }
+            else if (sIdent == "modelsremove")
+            {
+                QueryBox aQBox( this, SVX_RES( RID_QRY_REMOVE_MODEL ) );
+                OUString sText = aQBox.GetMessText();
+                sText = sText.replaceFirst( MODELNAME, sSelectedModel );
+                aQBox.SetMessText( sText );
+                if ( aQBox.Execute() == RET_YES )
                 {
-                    SAL_WARN( "svx.form", "DataNavigatorWindow::MenuSelectHdl(): wrong menu item" );
+                    try
+                    {
+                        xUIHelper->removeModel( m_xFrameModel, sSelectedModel );
+                    }
+                    catch ( Exception& )
+                    {
+                        SAL_WARN( "svx.form", "DataNavigatorWindow::MenuSelectHdl(): exception caught" );
+                    }
+                    m_pModelsBox->RemoveEntry( nSelectedPos );
+                    if ( m_pModelsBox->GetEntryCount() <= nSelectedPos )
+                        nSelectedPos = m_pModelsBox->GetEntryCount() - 1;
+                    m_pModelsBox->SelectEntryPos( nSelectedPos );
+                    ModelSelectHdl(m_pModelsBox);
+                    bIsDocModified = true;
                 }
             }
+            else
+            {
+                SAL_WARN( "svx.form", "DataNavigatorWindow::MenuSelectHdl(): wrong menu item" );
+            }
         }
-        else if ( &m_aInstanceBtn == pBtn )
+        else if (m_pInstanceBtn == pBtn)
         {
-            switch ( pBtn->GetCurItemId() )
+            OString sIdent(pBtn->GetCurItemIdent());
+            if (sIdent == "instancesadd")
             {
-                case MID_INSTANCES_ADD :
+                AddInstanceDialog aDlg( this, false );
+                if ( aDlg.Execute() == RET_OK )
                 {
-                    AddInstanceDialog aDlg( this, false );
+                    sal_uInt16 nInst = GetNewPageId();
+                    OUString sName = aDlg.GetName();
+                    OUString sURL = aDlg.GetURL();
+                    bool bLinkOnce = aDlg.IsLinkInstance();
+                    try
+                    {
+                        Reference< css::xml::dom::XDocument > xNewInst =
+                            xUIHelper->newInstance( sName, sURL, !bLinkOnce );
+                    }
+                    catch ( Exception& )
+                    {
+                        SAL_WARN( "svx.form", "DataNavigatorWindow::MenuSelectHdl(): exception caught" );
+                    }
+                    ModelSelectHdl( NULL );
+                    m_pTabCtrl->SetCurPageId( nInst );
+                    XFormsPage* pPage = GetCurrentPage( nInst );
+                    pPage->SetInstanceName(sName);
+                    pPage->SetInstanceURL(sURL);
+                    pPage->SetLinkOnce(bLinkOnce);
+                    ActivatePageHdl(m_pTabCtrl);
+                    bIsDocModified = true;
+                }
+            }
+            else if (sIdent == "instancesedit")
+            {
+                sal_uInt16 nId = 0;
+                XFormsPage* pPage = GetCurrentPage( nId );
+                if ( pPage )
+                {
+                    AddInstanceDialog aDlg( this, true );
+                    aDlg.SetName( pPage->GetInstanceName() );
+                    aDlg.SetURL( pPage->GetInstanceURL() );
+                    aDlg.SetLinkInstance( pPage->GetLinkOnce() );
+                    OUString sOldName = aDlg.GetName();
                     if ( aDlg.Execute() == RET_OK )
                     {
-                        sal_uInt16 nInst = GetNewPageId();
-                        OUString sName = aDlg.GetName();
+                        OUString sNewName = aDlg.GetName();
                         OUString sURL = aDlg.GetURL();
                         bool bLinkOnce = aDlg.IsLinkInstance();
                         try
                         {
-                            Reference< css::xml::dom::XDocument > xNewInst =
-                                xUIHelper->newInstance( sName, sURL, !bLinkOnce );
+                            xUIHelper->renameInstance( sOldName,
+                                                       sNewName,
+                                                       sURL,
+                                                       !bLinkOnce );
                         }
                         catch ( Exception& )
                         {
                             SAL_WARN( "svx.form", "DataNavigatorWindow::MenuSelectHdl(): exception caught" );
                         }
-                        ModelSelectHdl( NULL );
-                        m_aTabCtrl.SetCurPageId( nInst );
-                        XFormsPage* pPage = GetCurrentPage( nInst );
-                        pPage->SetInstanceName(sName);
+                        pPage->SetInstanceName(sNewName);
                         pPage->SetInstanceURL(sURL);
                         pPage->SetLinkOnce(bLinkOnce);
-                        ActivatePageHdl( &m_aTabCtrl );
+                        m_pTabCtrl->SetPageText( nId, sNewName );
                         bIsDocModified = true;
                     }
-                    break;
                 }
-                case MID_INSTANCES_EDIT :
+            }
+            else if (sIdent == "instancesremove")
+            {
+                sal_uInt16 nId = 0;
+                XFormsPage* pPage = GetCurrentPage( nId );
+                if ( pPage )
                 {
-                    sal_uInt16 nId = 0;
-                    XFormsPage* pPage = GetCurrentPage( nId );
-                    if ( pPage )
+                    OUString sInstName = pPage->GetInstanceName();
+                    QueryBox aQBox( this, SVX_RES( RID_QRY_REMOVE_INSTANCE ) );
+                    OUString sMessText = aQBox.GetMessText();
+                    sMessText = sMessText.replaceFirst( INSTANCENAME, sInstName );
+                    aQBox.SetMessText( sMessText );
+                    if ( aQBox.Execute() == RET_YES )
                     {
-                        AddInstanceDialog aDlg( this, true );
-                        aDlg.SetName( pPage->GetInstanceName() );
-                        aDlg.SetURL( pPage->GetInstanceURL() );
-                        aDlg.SetLinkInstance( pPage->GetLinkOnce() );
-                        OUString sOldName = aDlg.GetName();
-                        if ( aDlg.Execute() == RET_OK )
+                        bool bDoRemove = false;
+                        if (IsAdditionalPage(nId))
                         {
-                            OUString sNewName = aDlg.GetName();
-                            OUString sURL = aDlg.GetURL();
-                            bool bLinkOnce = aDlg.IsLinkInstance();
-                            try
+                            PageList::iterator aPageListEnd = m_aPageList.end();
+                            PageList::iterator aFoundPage =
+                                std::find( m_aPageList.begin(), aPageListEnd, pPage );
+                            if ( aFoundPage != aPageListEnd )
                             {
-                                xUIHelper->renameInstance( sOldName,
-                                                           sNewName,
-                                                           sURL,
-                                                           !bLinkOnce );
-                            }
-                            catch ( Exception& )
-                            {
-                                SAL_WARN( "svx.form", "DataNavigatorWindow::MenuSelectHdl(): exception caught" );
+                                m_aPageList.erase( aFoundPage );
+                                delete pPage;
+                                bDoRemove = true;
                             }
-                            pPage->SetInstanceName(sNewName);
-                            pPage->SetInstanceURL(sURL);
-                            pPage->SetLinkOnce(bLinkOnce);
-                            m_aTabCtrl.SetPageText( nId, sNewName );
-                            bIsDocModified = true;
                         }
-                    }
-                    break;
-                }
-                case MID_INSTANCES_REMOVE :
-                {
-                    sal_uInt16 nId = 0;
-                    XFormsPage* pPage = GetCurrentPage( nId );
-                    if ( pPage )
-                    {
-                        OUString sInstName = pPage->GetInstanceName();
-                        QueryBox aQBox( this, SVX_RES( RID_QRY_REMOVE_INSTANCE ) );
-                        OUString sMessText = aQBox.GetMessText();
-                        sMessText = sMessText.replaceFirst( INSTANCENAME, sInstName );
-                        aQBox.SetMessText( sMessText );
-                        if ( aQBox.Execute() == RET_YES )
+                        else
                         {
-                            bool bDoRemove = false;
-                            if ( nId > TID_INSTANCE )
-                            {
-                                PageList::iterator aPageListEnd = m_aPageList.end();
-                                PageList::iterator aFoundPage =
-                                    std::find( m_aPageList.begin(), aPageListEnd, pPage );
-                                if ( aFoundPage != aPageListEnd )
-                                {
-                                    m_aPageList.erase( aFoundPage );
-                                    delete pPage;
-                                    bDoRemove = true;
-                                }
-                            }
-                            else
+                            DELETEZ( m_pInstPage );
+                            bDoRemove = true;
+                        }
+
+                        if ( bDoRemove )
+                        {
+                            try
                             {
-                                DELETEZ( m_pInstPage );
-                                bDoRemove = true;
+                                xUIHelper->removeInstance( sInstName );
                             }
-
-                            if ( bDoRemove )
+                            catch (const Exception&)
                             {
-                                try
-                                {
-                                    xUIHelper->removeInstance( sInstName );
-                                }
-                                catch ( Exception& )
-                                {
-                                    SAL_WARN( "svx.form", "DataNavigatorWindow::MenuSelectHdl(): exception caught" );
-                                }
-                                m_aTabCtrl.RemovePage( nId );
-                                m_aTabCtrl.SetCurPageId( TID_INSTANCE );
-                                ModelSelectHdl( NULL );
-                                bIsDocModified = true;
+                                SAL_WARN( "svx.form", "DataNavigatorWindow::MenuSelectHdl(): exception caught" );
                             }
+                            m_pTabCtrl->RemovePage( nId );
+                            m_pTabCtrl->SetCurPageId(m_pTabCtrl->GetPageId("instance"));
+                            ModelSelectHdl( NULL );
+                            bIsDocModified = true;
                         }
                     }
-                    break;
-                }
-                case MID_SHOW_DETAILS :
-                {
-                    m_bShowDetails = !m_bShowDetails;
-                    m_aInstanceBtn.GetPopupMenu()->CheckItem( MID_SHOW_DETAILS, m_bShowDetails );
-                    ModelSelectHdl( &m_aModelsBox );
-                    break;
-                }
-                default:
-                {
-                    SAL_WARN( "svx.form", "DataNavigatorWindow::MenuSelectHdl(): wrong menu item" );
                 }
             }
+            else if (sIdent == "instancesdetails")
+            {
+                m_bShowDetails = !m_bShowDetails;
+                PopupMenu* pMenu = m_pInstanceBtn->GetPopupMenu();
+                pMenu->CheckItem(pMenu->GetItemId("instancesdetails"), m_bShowDetails );
+                ModelSelectHdl(m_pModelsBox);
+            }
+            else
+            {
+                SAL_WARN( "svx.form", "DataNavigatorWindow::MenuSelectHdl(): wrong menu item" );
+            }
         }
         else
         {
@@ -1778,22 +1748,28 @@ namespace svxform
         return 0;
     }
 
+    bool DataNavigatorWindow::IsAdditionalPage(sal_uInt16 nId) const
+    {
+        return m_pTabCtrl->GetPagePos(nId) >= 3;
+    }
+
     IMPL_LINK( DataNavigatorWindow, MenuActivateHdl, MenuButton *, pBtn )
     {
         Menu* pMenu = pBtn->GetPopupMenu();
 
-        if ( &m_aInstanceBtn == pBtn )
+        if (m_pInstanceBtn == pBtn)
         {
-            bool bIsInstPage = ( m_aTabCtrl.GetCurPageId() >= TID_INSTANCE );
-            pMenu->EnableItem( MID_INSTANCES_EDIT, bIsInstPage );
-            pMenu->EnableItem( MID_INSTANCES_REMOVE,
-                bIsInstPage && m_aTabCtrl.GetPageCount() > MIN_PAGE_COUNT );
-            pMenu->EnableItem( MID_SHOW_DETAILS, bIsInstPage );
+            sal_uInt16 nId(m_pTabCtrl->GetCurPageId());
+            bool bIsInstPage = (IsAdditionalPage(nId) || m_pTabCtrl->GetPageName(nId) == "instance");
+            pMenu->EnableItem( "instancesedit", bIsInstPage );
+            pMenu->EnableItem( "instancesremove",
+                bIsInstPage && m_pTabCtrl->GetPageCount() > MIN_PAGE_COUNT );
+            pMenu->EnableItem( "instancesdetails", bIsInstPage );
         }
-        else if ( &m_aModelBtn == pBtn )
+        else if (m_pModelBtn == pBtn)
         {
             // we need at least one model!
-            pMenu->EnableItem( MID_MODELS_REMOVE, m_aModelsBox.GetEntryCount() > 1 );
+            pMenu->EnableItem("modelsremove", m_pModelsBox->GetEntryCount() > 1 );
         }
         else
         {
@@ -1808,7 +1784,7 @@ namespace svxform
         XFormsPage* pPage = GetCurrentPage( nId );
         if ( pPage )
         {
-            m_aTabCtrl.SetTabPage( nId, pPage );
+            m_pTabCtrl->SetTabPage( nId, pPage );
             if ( m_xDataContainer.is() && !pPage->HasModel() )
                 SetPageModel();
         }
@@ -1824,45 +1800,37 @@ namespace svxform
 
     XFormsPage* DataNavigatorWindow::GetCurrentPage( sal_uInt16& rCurId )
     {
-        rCurId = m_aTabCtrl.GetCurPageId();
+        rCurId = m_pTabCtrl->GetCurPageId();
         XFormsPage* pPage = NULL;
-        switch ( rCurId )
+        OString sName(m_pTabCtrl->GetPageName(rCurId));
+        if (sName == "submissions")
         {
-            case TID_SUBMISSION:
-            {
-                if ( !m_pSubmissionPage )
-                    m_pSubmissionPage = new XFormsPage( &m_aTabCtrl, this, DGTSubmission );
-                pPage = m_pSubmissionPage;
-                break;
-            }
-
-            case TID_BINDINGS:
-            {
-                if ( !m_pBindingPage )
-                    m_pBindingPage = new XFormsPage( &m_aTabCtrl, this, DGTBinding );
-                pPage = m_pBindingPage;
-                break;
-            }
-
-            case TID_INSTANCE:
-            {
-                if ( !m_pInstPage )
-                    m_pInstPage = new XFormsPage( &m_aTabCtrl, this, DGTInstance );
-                pPage = m_pInstPage;
-                break;
-            }
+            if ( !m_pSubmissionPage )
+                m_pSubmissionPage = new XFormsPage(m_pTabCtrl, this, DGTSubmission);
+            pPage = m_pSubmissionPage;
         }
-
-        if ( rCurId > TID_INSTANCE )
+        else if (sName == "bindings")
+        {
+            if ( !m_pBindingPage )
+                m_pBindingPage = new XFormsPage(m_pTabCtrl, this, DGTBinding);
+            pPage = m_pBindingPage;
+        }
+        else if (sName == "instance")
+        {
+            if ( !m_pInstPage )
+                m_pInstPage = new XFormsPage(m_pTabCtrl, this, DGTInstance);
+            pPage = m_pInstPage;
+        }
+        else
         {
-            sal_uInt16 nPos = m_aTabCtrl.GetPagePos( rCurId );
+            sal_uInt16 nPos = m_pTabCtrl->GetPagePos( rCurId );
             if ( HasFirstInstancePage() && nPos > 0 )
                 nPos--;
             if ( m_aPageList.size() > nPos )
                 pPage = m_aPageList[nPos];
             else
             {
-                pPage = new XFormsPage( &m_aTabCtrl, this, DGTInstance );
+                pPage = new XFormsPage(m_pTabCtrl, this, DGTInstance);
                 m_aPageList.push_back( pPage );
             }
         }
@@ -1908,7 +1876,7 @@ namespace svxform
                             Any aAny = m_xDataContainer->getByName( pNames[i] );
                             Reference< css::xforms::XModel > xFormsModel;
                             if ( aAny >>= xFormsModel )
-                                m_aModelsBox.InsertEntry( xFormsModel->getID() );
+                                m_pModelsBox->InsertEntry( xFormsModel->getID() );
                         }
                     }
                 }
@@ -1919,16 +1887,16 @@ namespace svxform
             }
         }
 
-        if ( m_aModelsBox.GetEntryCount() > 0 )
+        if ( m_pModelsBox->GetEntryCount() > 0 )
         {
-            m_aModelsBox.SelectEntryPos(0);
-            ModelSelectHdl( &m_aModelsBox );
+            m_pModelsBox->SelectEntryPos(0);
+            ModelSelectHdl(m_pModelsBox);
         }
     }
 
     void DataNavigatorWindow::SetPageModel()
     {
-        OUString sModel( m_aModelsBox.GetSelectEntry() );
+        OUString sModel( m_pModelsBox->GetSelectEntry() );
         try
         {
             Any aAny = m_xDataContainer->getByName( sModel );
@@ -1939,17 +1907,17 @@ namespace svxform
                 sal_uInt16 nId = 0;
                 XFormsPage* pPage = GetCurrentPage( nId );
                 DBG_ASSERT( pPage, "DataNavigatorWindow::SetPageModel(): no page" );
-                if ( nId >= TID_INSTANCE )
+                if (IsAdditionalPage(nId) || m_pTabCtrl->GetPageName(nId) == "instance")
                     // instance page
-                    nPagePos = m_aTabCtrl.GetPagePos( nId );
+                    nPagePos = m_pTabCtrl->GetPagePos( nId );
                 m_bIsNotifyDisabled = true;
                 OUString sText = pPage->SetModel( xFormsModel, nPagePos );
                 m_bIsNotifyDisabled = false;
                 if ( !sText.isEmpty() )
-                    m_aTabCtrl.SetPageText( nId, sText );
+                    m_pTabCtrl->SetPageText( nId, sText );
             }
         }
-        catch ( NoSuchElementException& )
+        catch (const NoSuchElementException& )
         {
             SAL_WARN( "svx.form", "DataNavigatorWindow::SetPageModel(): no such element" );
         }
@@ -1961,7 +1929,7 @@ namespace svxform
 
     void DataNavigatorWindow::InitPages()
     {
-        OUString sModel( m_aModelsBox.GetSelectEntry() );
+        OUString sModel( m_pModelsBox->GetSelectEntry() );
         try
         {
             Any aAny = m_xDataContainer->getByName( sModel );
@@ -2029,8 +1997,8 @@ namespace svxform
         if ( bClearPages )
         {
             m_aPageList.clear();
-            while ( m_aTabCtrl.GetPageCount() > MIN_PAGE_COUNT )
-                m_aTabCtrl.RemovePage( m_aTabCtrl.GetPageId( 1 ) );
+            while ( m_pTabCtrl->GetPageCount() > MIN_PAGE_COUNT )
+                m_pTabCtrl->RemovePage( m_pTabCtrl->GetPageId( 1 ) );
         }
     }
 
@@ -2057,56 +2025,40 @@ namespace svxform
             sTemp += OUString::number( nPageId );
             sInstName = sTemp;
         }
-        m_aTabCtrl.InsertPage( nPageId, sInstName, m_aTabCtrl.GetPageCount() - 2 );
+        m_pTabCtrl->InsertPage( nPageId, sInstName, m_pTabCtrl->GetPageCount() - 2 );
     }
 
-
     bool DataNavigatorWindow::HasFirstInstancePage() const
     {
-        return ( m_aTabCtrl.GetPageId( 0 ) == TID_INSTANCE );
+        return (m_pTabCtrl->GetPageName(m_pTabCtrl->GetPageId(0)) == "instance");
     }
 
-
     sal_uInt16 DataNavigatorWindow::GetNewPageId() const
     {
-        sal_uInt16 i, nMax = 0, nCount = m_aTabCtrl.GetPageCount();
+        sal_uInt16 i, nMax = 0, nCount = m_pTabCtrl->GetPageCount();
         for ( i = 0; i < nCount; ++i )
         {
-            if ( nMax < m_aTabCtrl.GetPageId(i) )
-                nMax = m_aTabCtrl.GetPageId(i);
+            if ( nMax < m_pTabCtrl->GetPageId(i) )
+                nMax = m_pTabCtrl->GetPageId(i);
         }
         return ( nMax + 1 );
     }
 
-
     void DataNavigatorWindow::Resize()
     {
-        Window::Resize();
-
-        Size aOutSz = GetOutputSizePixel();
-        long nWidth = std::max( aOutSz.Width(), m_nMinWidth );
-        long nHeight = std::max( aOutSz.Height(), m_nMinHeight );
-
-        Size aSz = m_aModelsBox.GetSizePixel();
-        aSz.Width() = nWidth - 3*m_a3Size.Width() - m_aModelBtn.GetSizePixel().Width();
-        m_aModelsBox.SetSizePixel( aSz );
-        Point aPos = m_aModelBtn.GetPosPixel();
-        aPos.X() = m_aModelsBox.GetPosPixel().X() + aSz.Width() + m_a3Size.Width();
-        m_aModelBtn.SetPosPixel( aPos );
-
-        aSz = m_aTabCtrl.GetSizePixel();
-        aSz.Width() = nWidth - 2*m_a3Size.Width();
-        aSz.Height() = nHeight - m_nBorderHeight;
-        m_aTabCtrl.SetSizePixel( aSz );
-        // Instance button positioning
-        aPos = m_aInstanceBtn.GetPosPixel();
-        // right aligned
-        aPos.X() = nWidth - m_aInstanceBtn.GetSizePixel().Width() - m_a3Size.Width();
-        // under the tabcontrol
-        aPos.Y() = m_aTabCtrl.GetPosPixel().Y() + aSz.Height() + m_a3Size.Height();
-        m_aInstanceBtn.SetPosPixel( aPos );
+        Window *pChild = GetWindow(WINDOW_FIRSTCHILD);
+        if (!pChild)
+            return;
+        VclContainer::setLayoutAllocation(*pChild, Point(0,0), GetSizePixel());
     }
 
+    Size DataNavigatorWindow::GetOptimalSize() const
+    {
+        const Window *pChild = GetWindow(WINDOW_FIRSTCHILD);
+        if (!pChild)
+            return Window::GetOptimalSize();
+        return VclContainer::getLayoutRequisition(*pChild);
+    }
 
     void DataNavigatorWindow::SetDocModified()
     {
@@ -2116,7 +2068,6 @@ namespace svxform
             pCurrentDoc->SetModified();
     }
 
-
     void DataNavigatorWindow::NotifyChanges( bool _bLoadAll )
     {
         if ( !m_bIsNotifyDisabled )
@@ -2127,7 +2078,7 @@ namespace svxform
                 RemoveBroadcaster();
                 m_xDataContainer.clear();
                 m_xFrameModel.clear();
-                m_aModelsBox.Clear();
+                m_pModelsBox->Clear();
                 m_nLastSelectedPos = LISTBOX_ENTRY_NOTFOUND;
                 // for a reload
                 LoadModels();
@@ -2192,7 +2143,6 @@ namespace svxform
 
     {
 
-        SetHelpId( HID_DATA_NAVIGATOR_WIN );
         SetText( SVX_RES( RID_STR_DATANAVIGATOR ) );
 
         Size aSize = m_aDataWin.GetOutputSizePixel();
diff --git a/svx/source/form/datanavi.src b/svx/source/form/datanavi.src
index f4c071b..62ac609 100644
--- a/svx/source/form/datanavi.src
+++ b/svx/source/form/datanavi.src
@@ -19,6 +19,7 @@
 
 #include "datanavi.hrc"
 #include "globlmn.hrc"
+#include "svx/dialogs.hrc"
 #include "svx/fmresids.hrc"
 #include "fmhelp.hrc"
 
@@ -43,138 +44,20 @@ ImageList RID_SVXIMGLIST_XFORMS_TBX
 };
 #undef IMG_LST
 
-Window RID_SVXWIN_DATANAVIGATOR
+ImageList RID_SVXIL_DATANAVI
 {
-    OutputSize = TRUE ;
-    Hide = TRUE ;
-    SVLook = TRUE ;
-    DialogControl = TRUE ;
-    HelpId = HID_DATA_NAVIGATOR_WIN ;
-    Pos = MAP_APPFONT ( 0 , 0 ) ;
-    Size = MAP_APPFONT ( 300 , 400 ) ;
-    ListBox LB_MODELS
-    {
-        HelpId = HID_XFORMS_MODELS_LIST ;
-        Pos = MAP_APPFONT ( 3 , 4 ) ;
-        Size = MAP_APPFONT ( 63 , 45 ) ;
-        DropDown = TRUE ;
-        DDExtraWidth = TRUE ;
-    };
-    MenuButton MB_MODELS
-    {
-        HelpId = HID_XFORMS_MODELS_MENUBTN ;
-        Pos = MAP_APPFONT ( 69 , 3 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        Text [ en-US ] = "~Models";
-        ButtonMenu = Menu
-        {
-            ItemList =
-            {
-                MenuItem
-                {
-                    Identifier = MID_MODELS_ADD ;
-                    HelpId = HID_MN_XFORMS_MODELS_ADD ;
-                    Text [ en-US ] = "~Add..." ;
-                };
-                MenuItem
-                {
-                    Identifier = MID_MODELS_EDIT ;
-                    HelpId = HID_MN_XFORMS_MODELS_EDIT ;
-                    Text [ en-US ] = "~Edit..." ;
-                };
-                MenuItem
-                {
-                    Identifier = MID_MODELS_REMOVE ;
-                    HelpId = HID_MN_XFORMS_MODELS_REMOVE ;
-                    Text [ en-US ] = "~Remove" ;
-                };
-            };
-        };
-    };
-    TabControl TC_ITEMS
-    {
-        HelpId = HID_XFORMS_TAB_CONTROL ;
-        Pos = MAP_APPFONT ( 3, 20 ) ;
-        TabStop = TRUE;
-        PageList =
-        {
-            PageItem
-            {
-                Identifier = TID_INSTANCE ;
-                Text [ en-US ] = "Instance";
-            };
-            PageItem
-            {
-                Identifier = TID_SUBMISSION ;
-                Text [ en-US ] = "Submissions";
-            };
-            PageItem
-            {
-                Identifier = TID_BINDINGS ;
-                Text [ en-US ] = "Bindings";
-            };
-        };
-    };
-    MenuButton MB_INSTANCES
-    {
-        HelpId = HID_XFORMS_INSTANCES_MENUBTN ;
-        Pos = MAP_APPFONT ( 69 , 133 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        Text [ en-US ] = "~Instances";
-        ButtonMenu = Menu
-        {
-            ItemList =
-            {
-                MenuItem
-                {
-                    Identifier = MID_INSTANCES_ADD ;
-                    HelpId = HID_MN_XFORMS_INSTANCES_ADD ;
-                    Text [ en-US ] = "~Add..." ;
-                };
-                MenuItem
-                {
-                    Identifier = MID_INSTANCES_EDIT ;
-                    HelpId = HID_MN_XFORMS_INSTANCES_EDIT ;
-                    Text [ en-US ] = "~Edit..." ;
-                };
-                MenuItem
-                {
-                    Identifier = MID_INSTANCES_REMOVE ;
-                    HelpId = HID_MN_XFORMS_INSTANCES_REMOVE ;
-                    Text [ en-US ] = "~Remove" ;
-                };
-                MenuItem
-                {
-                    Separator = TRUE;
-                };
-                MenuItem
-                {
-                    Identifier = MID_SHOW_DETAILS ;
-                    HelpId = HID_MN_XFORMS_SHOW_DETAILS ;
-                    Text [ en-US ] = "~Show Details" ;
-                };
-            };
-        };
-    };
-
-#define IMG_LST2            \
-IdList =                    \
-{                           \
-    IID_GROUP_CLOSED ;      \
-    IID_GROUP_OPEN ;        \
-    IID_ELEMENT ;           \
-    IID_ATTRIBUTE ;         \
-    IID_TEXT ;              \
-    IID_OTHER ;             \
-};                          \
-IdCount = { 6 ; } ;
-
-    ImageList IL_ITEM_BMPS
+    Prefix = "da";
+    MASKCOLOR
+    IdList =
     {
-        Prefix = "da";
-        MASKCOLOR
-        IMG_LST2
+        IID_GROUP_CLOSED ;
+        IID_GROUP_OPEN ;
+        IID_ELEMENT ;
+        IID_ATTRIBUTE ;
+        IID_TEXT ;
+        IID_OTHER ;
     };
+    IdCount = { 6 ; } ;
 };
 
 QueryBox RID_QRY_REMOVE_MODEL
diff --git a/svx/source/inc/datanavi.hrc b/svx/source/inc/datanavi.hrc
index a9ba599..2168994 100644
--- a/svx/source/inc/datanavi.hrc
+++ b/svx/source/inc/datanavi.hrc
@@ -39,30 +39,6 @@
 #define IID_ITEM_EDIT           4
 #define IID_ITEM_REMOVE         5
 
-// class DataNavigatorWindow
-// Controls
-#define LB_MODELS               10
-#define MB_MODELS               11
-#define TC_ITEMS                12
-#define MB_INSTANCES            13
-
-// MenuItems
-#define MID_MODELS_ADD          10
-#define MID_MODELS_EDIT         11
-#define MID_MODELS_REMOVE       12
-#define MID_INSTANCES_ADD       20
-#define MID_INSTANCES_EDIT      21
-#define MID_INSTANCES_REMOVE    22
-#define MID_SHOW_DETAILS        30
-
-// TabPage Ids
-#define TID_SUBMISSION          10
-#define TID_BINDINGS            11
-#define TID_INSTANCE            12
-
-// ImageLists
-#define IL_ITEM_BMPS            30
-
 // ImageIndexes
 #define IID_GROUP_CLOSED        1
 #define IID_GROUP_OPEN          2
diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx
index 43788ca..3a2d80c 100644
--- a/svx/source/inc/datanavi.hxx
+++ b/svx/source/inc/datanavi.hxx
@@ -19,6 +19,7 @@
 #ifndef INCLUDED_SVX_SOURCE_INC_DATANAVI_HXX
 #define INCLUDED_SVX_SOURCE_INC_DATANAVI_HXX
 
+#include <vcl/builder.hxx>
 #include <vcl/dialog.hxx>
 #include <vcl/fixed.hxx>
 #include <vcl/layout.hxx>
@@ -36,6 +37,7 @@
 #include <sfx2/childwin.hxx>
 #include <sfx2/ctrlitem.hxx>
 #include <svx/dialmgr.hxx>
+#include <svx/dialogs.hrc>
 #include <svx/fmresids.hrc>
 #include <svx/svxdllapi.h>
 #include <rtl/ref.hxx>
@@ -322,27 +324,21 @@ namespace svxform
     typedef std::vector< XFormsPage* >          PageList;
     typedef ::rtl::Reference < DataListener >   DataListener_ref;
 
-    class DataNavigatorWindow : public Window
+    class DataNavigatorWindow : public Window, public VclBuilderContainer
     {
     private:
-
-        ListBox                     m_aModelsBox;
-        MenuButton                  m_aModelBtn;
-        TabControl                  m_aTabCtrl;
-        MenuButton                  m_aInstanceBtn;
+        ListBox*                    m_pModelsBox;
+        MenuButton*                 m_pModelBtn;
+        TabControl*                 m_pTabCtrl;
+        MenuButton*                 m_pInstanceBtn;
 
         XFormsPage*                 m_pInstPage;
         XFormsPage*                 m_pSubmissionPage;
         XFormsPage*                 m_pBindingPage;
 
-        long                        m_nMinWidth;
-        long                        m_nMinHeight;
-        long                        m_nBorderHeight;
         sal_Int32                   m_nLastSelectedPos;
         bool                        m_bShowDetails;
         bool                        m_bIsNotifyDisabled;
-        Size                        m_a2Size;
-        Size                        m_a3Size;
         ImageList                   m_aItemImageList;
         PageList                    m_aPageList;
         ContainerList               m_aContainerList;
@@ -367,10 +363,13 @@ namespace svxform
         void                        InitPages();
         void                        CreateInstancePage( const PropertyValue_seq& _xPropSeq );
         bool                        HasFirstInstancePage() const;
-        sal_uInt16                      GetNewPageId() const;
+        sal_uInt16                  GetNewPageId() const;
+
+        bool                        IsAdditionalPage(sal_uInt16 nPageId) const;
 
     protected:
         virtual void                Resize() SAL_OVERRIDE;
+        virtual Size                GetOptimalSize() const SAL_OVERRIDE;
 
     public:
         DataNavigatorWindow( Window* pParent, SfxBindings* pBindings );
diff --git a/svx/uiconfig/ui/datanavigator.ui b/svx/uiconfig/ui/datanavigator.ui
new file mode 100644
index 0000000..45d0c0c
--- /dev/null
+++ b/svx/uiconfig/ui/datanavigator.ui
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+  <requires lib="gtk+" version="3.0"/>
+  <object class="GtkBox" id="DataNavigator">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <child>
+      <object class="GtkBox" id="box1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="vexpand">True</property>
+        <property name="border_width">0</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">6</property>
+        <child>
+          <object class="GtkGrid" id="grid2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="column_spacing">12</property>
+            <child>
+              <object class="GtkComboBoxText" id="modelslist">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</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="GtkButton" id="modelsbutton:modelsmenu">
+                <property name="label" translatable="yes">_Models</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="hexpand">True</property>
+                <property name="use_underline">True</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">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkNotebook" id="tabcontrol">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="instance">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Instance</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="submissions">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Submissions</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="bindings">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Bindings</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="instances:instancesmenu">
+            <property name="label" translatable="yes">_Instances</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="halign">end</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>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+  </object>
+  <object class="GtkMenu" id="instancesmenu">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkMenuItem" id="instancesadd">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Add...</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="instancesedit">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Edit...</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="instancesremove">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Remove...</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkSeparatorMenuItem" id="menuitem1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="instancesdetails">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Show Details</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+  </object>
+  <object class="GtkMenu" id="modelsmenu">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkMenuItem" id="modelsadd">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Add...</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="modelsedit">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Edit...</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="modelsremove">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Remove</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list