basctl/UIConfig_basicide.mk                   |    1 
 basctl/inc/basidesh.hrc                       |    1 
 basctl/inc/helpid.hrc                         |    1 
 basctl/source/basicide/moduldl2.cxx           |   10 --
 basctl/source/basicide/moduldlg.cxx           |   79 ++++++++---------
 basctl/source/basicide/moduldlg.hrc           |    6 -
 basctl/source/basicide/moduldlg.hxx           |    4 
 basctl/source/basicide/moduldlg.src           |   56 ------------
 basctl/uiconfig/basicide/ui/organizedialog.ui |  117 ++++++++++++++++++++++++++
 9 files changed, 160 insertions(+), 115 deletions(-)

New commits:
commit 2544a2a810bc9182d5f062cafb41b5be96111982
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue Dec 24 09:41:27 2013 +0000

    convert organize macros dialog to .ui
    
    Change-Id: I210ab0bb294ddfefc3f60cffe64b72e5d8fa4650

diff --git a/basctl/UIConfig_basicide.mk b/basctl/UIConfig_basicide.mk
index 013df6e..6f84bb4 100644
--- a/basctl/UIConfig_basicide.mk
+++ b/basctl/UIConfig_basicide.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/BasicIDE,\
 
 $(eval $(call gb_UIConfig_add_uifiles,modules/BasicIDE,\
        basctl/uiconfig/basicide/ui/basicmacrodialog \
+       basctl/uiconfig/basicide/ui/organizedialog \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc
index 623cb0e..b064dcb 100644
--- a/basctl/inc/basidesh.hrc
+++ b/basctl/inc/basidesh.hrc
@@ -30,7 +30,6 @@
 #define RID_POPUP_BRKDLG                ( RID_BASICIDE_START + 10 )
 #define RID_POPUP_BRKPROPS              ( RID_BASICIDE_START + 11 )
 #define RID_POPUP_TABBAR                ( RID_BASICIDE_START + 12 )
-#define RID_TD_ORGANIZE                 ( RID_BASICIDE_START + 36 )
 #define RID_TP_MODULS                   ( RID_BASICIDE_START + 37 )
 #define RID_TP_LIBS                     ( RID_BASICIDE_START + 38 )
 #define RID_TP_DLGS                     ( RID_BASICIDE_START + 39 )
diff --git a/basctl/inc/helpid.hrc b/basctl/inc/helpid.hrc
index da3d500..4d6c92b 100644
--- a/basctl/inc/helpid.hrc
+++ b/basctl/inc/helpid.hrc
@@ -23,7 +23,6 @@
 #define HID_BASICIDE_OBJECTS                              
"BASCTL_HID_BASICIDE_OBJECTS"
 #define HID_BASICIDE_MACROS                               
"BASCTL_HID_BASICIDE_MACROS"
 #define HID_BASICIDE_LIBS                                 
"BASCTL_HID_BASICIDE_LIBS"
-#define HID_BASICIDE_ORG_TC                               
"BASCTL_HID_BASICIDE_ORG_TC"
 
 #define HID_BASICIDE_MODULES_TREE                         
"BASCTL_HID_BASICIDE_MODULES_TREE"
 #define HID_BASICIDE_LIBS_TREE                            
"BASCTL_HID_BASICIDE_LIBS_TREE"
diff --git a/basctl/source/basicide/moduldl2.cxx 
b/basctl/source/basicide/moduldl2.cxx
index b52eea9..6ad6b4f 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -506,7 +506,6 @@ LibPage::LibPage( Window * pParent )
     ,aLibText( this, IDEResId( RID_STR_LIB ) )
     ,aLibBox( this, IDEResId( RID_TRLBOX ) )
     ,aEditButton( this, IDEResId( RID_PB_EDIT ) )
-    ,aCloseButton( this, IDEResId( RID_PB_CLOSE ) )
     ,aPasswordButton( this, IDEResId( RID_PB_PASSWORD ) )
     ,aNewLibButton( this, IDEResId( RID_PB_NEWLIB ) )
     ,aInsertLibButton( this, IDEResId( RID_PB_APPEND ) )
@@ -524,7 +523,6 @@ LibPage::LibPage( Window * pParent )
     aExportButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
     aInsertLibButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
     aDelButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
-    aCloseButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
     aLibBox.SetSelectHdl( LINK( this, LibPage, TreeListHighlightHdl ) );
 
     aBasicsBox.SetSelectHdl( LINK( this, LibPage, BasicSelectHdl ) );
@@ -532,7 +530,6 @@ LibPage::LibPage( Window * pParent )
     aLibBox.SetMode(ObjectMode::Module);
     aLibBox.EnableInplaceEditing(true);
     aLibBox.SetStyle( WB_HSCROLL | WB_BORDER | WB_TABSTOP );
-    aCloseButton.GrabFocus();
 
     long aTabs[] = { 2, 30, 120 };
     aLibBox.SetTabs( aTabs, MAP_PIXEL );
@@ -581,8 +578,6 @@ void LibPage::CheckButtons()
             aInsertLibButton.Enable();
             aExportButton.Disable();
             aDelButton.Disable();
-            if ( !aLibBox.HasFocus() )
-                aCloseButton.GrabFocus();
         }
         else if ( ( xModLibContainer.is() && xModLibContainer->hasByName( 
aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) ) ||
                   ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( 
aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) ) )
@@ -676,11 +671,6 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton )
         Export();
     else if ( pButton == &aDelButton )
         DeleteCurrent();
-    else if ( pButton == &aCloseButton )
-    {
-        EndTabDialog( 0 );
-        return 0;
-    }
     else if ( pButton == &aPasswordButton )
     {
         SvTreeListEntry* pCurEntry = aLibBox.GetCurEntry();
diff --git a/basctl/source/basicide/moduldlg.cxx 
b/basctl/source/basicide/moduldlg.cxx
index 5cc8c5d..c6808c5 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -459,27 +459,30 @@ sal_Bool ExtTreeListBox::NotifyCopyingMoving( 
SvTreeListEntry* pTarget, SvTreeLi
 // ==============
 //
 
-OrganizeDialog::OrganizeDialog( Window* pParent, sal_Int16 tabId, 
EntryDescriptor& rDesc )
-    :TabDialog( pParent, IDEResId( RID_TD_ORGANIZE ) )
-    ,aTabCtrl( this, IDEResId( RID_TC_ORGANIZE ) )
-    ,m_aCurEntry( rDesc )
+OrganizeDialog::OrganizeDialog(Window* pParent, sal_Int16 tabId,
+    EntryDescriptor& rDesc )
+    : TabDialog( pParent, "OrganizeDialog",
+        "modules/BasicIDE/ui/organizedialog.ui" )
+    , m_aCurEntry( rDesc )
 {
-    FreeResource();
-    aTabCtrl.SetActivatePageHdl( LINK( this, OrganizeDialog, ActivatePageHdl ) 
);
+    get(m_pTabCtrl, "tabcontrol");
+
+    m_pTabCtrl->SetActivatePageHdl(LINK(this, OrganizeDialog, 
ActivatePageHdl));
+
     if( tabId == 0 )
     {
-        aTabCtrl.SetCurPageId( RID_TP_MOD );
+        m_pTabCtrl->SetCurPageId(m_pTabCtrl->GetPageId("modules"));
     }
     else if ( tabId == 1 )
     {
-        aTabCtrl.SetCurPageId( RID_TP_DLG );
+        m_pTabCtrl->SetCurPageId(m_pTabCtrl->GetPageId("dialogs"));
     }
     else
     {
-        aTabCtrl.SetCurPageId( RID_TP_LIB );
+        m_pTabCtrl->SetCurPageId(m_pTabCtrl->GetPageId("libraries"));
     }
 
-    ActivatePageHdl( &aTabCtrl );
+    ActivatePageHdl(m_pTabCtrl);
 
     if (SfxDispatcher* pDispatcher = GetDispatcher())
         pDispatcher->Execute( SID_BASICIDE_STOREALLMODULESOURCES );
@@ -487,8 +490,8 @@ OrganizeDialog::OrganizeDialog( Window* pParent, sal_Int16 
tabId, EntryDescripto
 
 OrganizeDialog::~OrganizeDialog()
 {
-    for ( sal_uInt16 i = 0; i < aTabCtrl.GetPageCount(); i++ )
-        delete aTabCtrl.GetTabPage( aTabCtrl.GetPageId( i ) );
+    for ( sal_uInt16 i = 0; i < m_pTabCtrl->GetPageCount(); i++ )
+        delete m_pTabCtrl->GetTabPage( m_pTabCtrl->GetPageId( i ) );
 };
 
 short OrganizeDialog::Execute()
@@ -507,33 +510,31 @@ IMPL_LINK( OrganizeDialog, ActivatePageHdl, TabControl *, 
pTabCtrl )
 
     if ( !pTabCtrl->GetTabPage( nId ) )
     {
+        OString sPageName(pTabCtrl->GetPageName(nId));
         TabPage* pNewTabPage = 0;
-        switch ( nId )
+        if (sPageName == "modules")
         {
-            case RID_TP_MOD:
-            {
-                ObjectPage* pObjectPage = new ObjectPage(pTabCtrl, 
IDEResId(RID_TP_MODULS), BROWSEMODE_MODULES);
-                pNewTabPage = pObjectPage;
-                pObjectPage->SetTabDlg(this);
-                pObjectPage->SetCurrentEntry(m_aCurEntry);
-            }
-            break;
-            case RID_TP_DLG:
-            {
-                ObjectPage* pObjectPage = new ObjectPage( pTabCtrl, IDEResId( 
RID_TP_DLGS ), BROWSEMODE_DIALOGS );
-                pNewTabPage = pObjectPage;
-                pObjectPage->SetTabDlg(this);
-                pObjectPage->SetCurrentEntry(m_aCurEntry);
-            }
-            break;
-            case RID_TP_LIB:
-            {
-                LibPage* pLibPage = new LibPage( pTabCtrl );
-                pNewTabPage = pLibPage;
-                pLibPage->SetTabDlg( this );
-            }
-            break;
-            default:    OSL_FAIL( "PageHdl: Unbekannte ID!" );
+            ObjectPage* pObjectPage = new ObjectPage(pTabCtrl, 
IDEResId(RID_TP_MODULS), BROWSEMODE_MODULES);
+            pNewTabPage = pObjectPage;
+            pObjectPage->SetTabDlg(this);
+            pObjectPage->SetCurrentEntry(m_aCurEntry);
+        }
+        else if (sPageName == "dialogs")
+        {
+            ObjectPage* pObjectPage = new ObjectPage( pTabCtrl, IDEResId( 
RID_TP_DLGS ), BROWSEMODE_DIALOGS );
+            pNewTabPage = pObjectPage;
+            pObjectPage->SetTabDlg(this);
+            pObjectPage->SetCurrentEntry(m_aCurEntry);
+        }
+        else if (sPageName == "libraries")
+        {
+            LibPage* pLibPage = new LibPage( pTabCtrl );
+            pNewTabPage = pLibPage;
+            pLibPage->SetTabDlg( this );
+        }
+        else
+        {
+            OSL_FAIL( "PageHdl: Unbekannte ID!" );
         }
         DBG_ASSERT( pNewTabPage, "Keine Page!" );
         pTabCtrl->SetTabPage( nId, pNewTabPage );
@@ -551,7 +552,6 @@ ObjectPage::ObjectPage( Window * pParent, const ResId& 
rResId, sal_uInt16 nMode
         aLibText(       this,   IDEResId( RID_STR_LIB ) ),
         aBasicBox(      this,   IDEResId( RID_TRLBOX ) ),
         aEditButton(    this,   IDEResId( RID_PB_EDIT ) ),
-        aCloseButton(   this,   IDEResId( RID_PB_CLOSE ) ),
         aNewModButton(  this,   IDEResId( RID_PB_NEWMOD ) ),
         aNewDlgButton(  this,   IDEResId( RID_PB_NEWDLG ) ),
         aDelButton(     this,   IDEResId( RID_PB_DELETE ) )
@@ -561,7 +561,6 @@ ObjectPage::ObjectPage( Window * pParent, const ResId& 
rResId, sal_uInt16 nMode
 
     aEditButton.SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) );
     aDelButton.SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) );
-    aCloseButton.SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) );
     aBasicBox.SetSelectHdl( LINK( this, ObjectPage, BasicBoxHighlightHdl ) );
 
     if( nMode & BROWSEMODE_MODULES )
@@ -724,8 +723,6 @@ IMPL_LINK( ObjectPage, ButtonHdl, Button *, pButton )
         NewDialog();
     else if ( pButton == &aDelButton )
         DeleteCurrent();
-    else if ( pButton == &aCloseButton )
-        EndTabDialog( 0 );
 
     return 0;
 }
diff --git a/basctl/source/basicide/moduldlg.hrc 
b/basctl/source/basicide/moduldlg.hrc
index 64ff503..acbc542 100644
--- a/basctl/source/basicide/moduldlg.hrc
+++ b/basctl/source/basicide/moduldlg.hrc
@@ -26,7 +26,7 @@
 #define RID_TRLBOX              2
 // free
 #define RID_PB_EDIT             4
-#define RID_PB_CLOSE            5
+
 #define RID_PB_NEWMOD           6
 #define RID_PB_NEWDLG           7
 #define RID_PB_DELETE           8
@@ -38,10 +38,6 @@
 
 #define RID_PB_EXPORT           14
 
-#define RID_TP_MOD              20
-#define RID_TP_LIB              21
-#define RID_TP_DLG              22
-
 #define RID_TC_ORGANIZE         30
 
 #define RID_PB_OK               31
diff --git a/basctl/source/basicide/moduldlg.hxx 
b/basctl/source/basicide/moduldlg.hxx
index 7ddb2d4..0ea6a2d 100644
--- a/basctl/source/basicide/moduldlg.hxx
+++ b/basctl/source/basicide/moduldlg.hxx
@@ -179,7 +179,7 @@ public:
 class OrganizeDialog : public TabDialog
 {
 private:
-    TabControl         aTabCtrl;
+    TabControl*        m_pTabCtrl;
     EntryDescriptor    m_aCurEntry;
 
 public:
@@ -197,7 +197,6 @@ protected:
     FixedText           aLibText;
     ExtTreeListBox      aBasicBox;
     PushButton          aEditButton;
-    CancelButton        aCloseButton;
     PushButton          aNewModButton;
     PushButton          aNewDlgButton;
     PushButton          aDelButton;
@@ -232,7 +231,6 @@ protected:
     FixedText           aLibText;
     CheckBox            aLibBox;
     PushButton          aEditButton;
-    CancelButton        aCloseButton;
     PushButton          aPasswordButton;
     PushButton          aNewLibButton;
     PushButton          aInsertLibButton;
diff --git a/basctl/source/basicide/moduldlg.src 
b/basctl/source/basicide/moduldlg.src
index f5f8ade..febc9b5 100644
--- a/basctl/source/basicide/moduldlg.src
+++ b/basctl/source/basicide/moduldlg.src
@@ -20,38 +20,7 @@
 #include "helpid.hrc"
 #include <moduldlg.hrc>
 #include <basidesh.hrc>
-TabDialog RID_TD_ORGANIZE
-{
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Text[ en-US ] = "%PRODUCTNAME Basic Macro Organizer";
-    Moveable = TRUE ;
-    Closeable = TRUE ;
-     // Da Cancel-Button auf TabPage, nicht auf Dialog!
-    TabControl RID_TC_ORGANIZE
-    {
-         //     HelpID = HID_BASICIDE_ORG_TC;
-        OutputSize = TRUE ;
-        PageList =
-        {
-            PageItem
-            {
-                Identifier = RID_TP_MOD ;
-                Text [ en-US ] = "Modules" ;
-            };
-            PageItem
-            {
-                Identifier = RID_TP_DLG ;
-                Text [ en-US ] = "Dialogs" ;
-            };
-            PageItem
-            {
-                Identifier = RID_TP_LIB ;
-                Text [ en-US ] = "Libraries" ;
-            };
-        };
-    };
-};
+
 TabPage RID_TP_MODULS
 {
     HelpId = "basctl:TabPage:RID_TP_MODULS" ;
@@ -81,13 +50,6 @@ TabPage RID_TP_MODULS
         TabStop = TRUE ;
         DefButton = TRUE ;
     };
-    CancelButton RID_PB_CLOSE
-    {
-        Text [ en-US ] = "Close";
-        Pos = MAP_APPFONT ( 144 , 23 ) ;
-        Size = MAP_APPFONT ( 60 , 14 ) ;
-        TabStop = TRUE ;
-    };
     PushButton RID_PB_NEWMOD
     {
         HelpID = "basctl:PushButton:RID_TP_MODULS:RID_PB_NEWMOD";
@@ -142,13 +104,6 @@ TabPage RID_TP_DLGS
         TabStop = TRUE ;
         DefButton = TRUE ;
     };
-    CancelButton RID_PB_CLOSE
-    {
-        Text[ en-US ] = "Close";
-        Pos = MAP_APPFONT ( 144 , 23 ) ;
-        Size = MAP_APPFONT ( 60 , 14 ) ;
-        TabStop = TRUE ;
-    };
     PushButton RID_PB_NEWMOD
     {
         HelpID = "basctl:PushButton:RID_TP_DLGS:RID_PB_NEWMOD";
@@ -219,17 +174,10 @@ TabPage RID_TP_LIBS
         TabStop = TRUE ;
         DefButton = TRUE ;
     };
-    CancelButton RID_PB_CLOSE
-    {
-        Text [ en-US ] = "Close";
-        Pos = MAP_APPFONT ( 144 , 23 ) ;
-        Size = MAP_APPFONT ( 60 , 14 ) ;
-        TabStop = TRUE ;
-    };
     PushButton RID_PB_PASSWORD
     {
         HelpID = "basctl:PushButton:RID_TP_LIBS:RID_PB_PASSWORD";
-        Pos = MAP_APPFONT ( 144 , 43 ) ;
+        Pos = MAP_APPFONT ( 144 , 23 ) ;
         Size = MAP_APPFONT ( 60 , 14 ) ;
         Text [ en-US ] = "~Password..." ;
         TabStop = TRUE ;
diff --git a/basctl/uiconfig/basicide/ui/organizedialog.ui 
b/basctl/uiconfig/basicide/ui/organizedialog.ui
new file mode 100644
index 0000000..3163d69
--- /dev/null
+++ b/basctl/uiconfig/basicide/ui/organizedialog.ui
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="OrganizeDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">%PRODUCTNAME Basic Macro 
Organizer</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="close">
+                <property name="label">gtk-close</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">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>
+          <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="modules">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Modules</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="dialogs">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Dialogs</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="libraries">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Libraries</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>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">close</action-widget>
+      <action-widget response="0">help</action-widget>
+    </action-widgets>
+  </object>
+</interface>
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to