summaryrefslogtreecommitdiff
path: root/basctl/source/basicide
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-03 14:38:01 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-03 14:55:42 +0000
commit6fd7f5b1c931051b9fff31436955c1c6af00d135 (patch)
tree85bd45f9bb554ab99abea0e3fd9fbd886156dbbb /basctl/source/basicide
parentbad191f1d643167a815077b0764306b8ddc6f9bd (diff)
convert import library dialog to .ui
Change-Id: Iaedcbeb5618ece65692a9688ccb5c13aad1e6626
Diffstat (limited to 'basctl/source/basicide')
-rw-r--r--basctl/source/basicide/moduldl2.cxx20
-rw-r--r--basctl/source/basicide/moduldlg.cxx25
-rw-r--r--basctl/source/basicide/moduldlg.hxx39
-rw-r--r--basctl/source/basicide/moduldlg.src56
4 files changed, 45 insertions, 95 deletions
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 9a4c1a1ff72c..4edc506747b5 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -173,6 +173,26 @@ CheckBox::CheckBox( Window* pParent, const ResId& rResId )
Init();
}
+CheckBox::CheckBox(Window* pParent, WinBits nStyle)
+ : SvTabListBox(pParent, nStyle)
+ , eMode(ObjectMode::Module)
+ , m_aDocument(ScriptDocument::getApplicationScriptDocument())
+{
+ long aTabs_[] = { 1, 12 }; // TabPos needs at least one...
+ // 12 because of the CheckBox
+ SetTabs( aTabs_ );
+ Init();
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeCheckBox(Window *pParent, VclBuilder::stringmap &rMap)
+{
+ WinBits nWinBits = WB_TABSTOP;
+ OString sBorder = VclBuilder::extractCustomProperty(rMap);
+ if (!sBorder.isEmpty())
+ nWinBits |= WB_BORDER;
+ return new CheckBox(pParent, nWinBits);
+}
+
//----------------------------------------------------------------------------
CheckBox::~CheckBox()
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index c6808c50a884..48bf93efbfb5 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -909,31 +909,22 @@ void ObjectPage::EndTabDialog( sal_uInt16 nRet )
pTabDlg->EndDialog( nRet );
}
-
LibDialog::LibDialog( Window* pParent )
- : ModalDialog( pParent, IDEResId( RID_DLG_LIBS ) ),
- aOKButton( this, IDEResId( RID_PB_OK ) ),
- aCancelButton( this, IDEResId( RID_PB_CANCEL ) ),
- aStorageName( this, IDEResId( RID_FT_STORAGENAME ) ),
- aLibBox( this, IDEResId( RID_CTRL_LIBS ) ),
- aFixedLine( this, IDEResId( RID_FL_OPTIONS ) ),
- aReferenceBox( this, IDEResId( RID_CB_REF ) ),
- aReplaceBox( this, IDEResId( RID_CB_REPL ) )
-{
- SetText( IDE_RESSTR(RID_STR_APPENDLIBS) );
- FreeResource();
-}
-
-
-LibDialog::~LibDialog()
+ : ModalDialog(pParent, "ImportLibDialog", "modules/BasicIDE/ui/importlibdialog.ui")
{
+ get(m_pStorageFrame, "storageframe");
+ get(m_pReferenceBox, "ref");
+ get(m_pReplaceBox, "replace");
+ get(m_pLibBox, "entries");
+ m_pLibBox->set_height_request(m_pLibBox->GetTextHeight() * 8);
+ m_pLibBox->set_width_request(m_pLibBox->approximate_char_width() * 32);
}
void LibDialog::SetStorageName( const OUString& rName )
{
OUString aName( IDE_RESSTR(RID_STR_FILENAME) );
aName += rName;
- aStorageName.SetText( aName );
+ m_pStorageFrame->set_label(aName);
}
// Helper function
diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx
index abd91fb07531..529e8406cdaf 100644
--- a/basctl/source/basicide/moduldlg.hxx
+++ b/basctl/source/basicide/moduldlg.hxx
@@ -23,18 +23,17 @@
#include <svheader.hxx>
#include <bastype2.hxx>
-#include <vcl/dialog.hxx>
-
+#include <svtools/svtabbx.hxx>
#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
-#include <svtools/svtabbx.hxx>
+#include <vcl/layout.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/tabctrl.hxx>
#include <vcl/tabdlg.hxx>
#include <vcl/tabpage.hxx>
#include <com/sun/star/task/XInteractionHandler.hpp>
-#include <vcl/tabctrl.hxx>
-#include <vcl/lstbox.hxx>
-
class SvxPasswordDialog;
namespace basctl
@@ -125,7 +124,8 @@ private:
void Init();
public:
- CheckBox( Window* pParent, const ResId& rResId );
+ CheckBox(Window* pParent, const ResId& rResId);
+ CheckBox(Window* pParent, WinBits nStyle);
~CheckBox();
SvTreeListEntry* DoInsertEntry( const OUString& rStr, sal_uLong nPos = LISTBOX_APPEND );
@@ -147,29 +147,24 @@ public:
class LibDialog: public ModalDialog
{
private:
- OKButton aOKButton;
- CancelButton aCancelButton;
- FixedText aStorageName;
- CheckBox aLibBox;
- FixedLine aFixedLine;
- ::CheckBox aReferenceBox;
- ::CheckBox aReplaceBox;
+ VclFrame* m_pStorageFrame;
+ CheckBox* m_pLibBox;
+ ::CheckBox* m_pReferenceBox;
+ ::CheckBox* m_pReplaceBox;
public:
- LibDialog( Window* pParent );
- ~LibDialog();
+ LibDialog( Window* pParent );
void SetStorageName( const OUString& rName );
- CheckBox& GetLibBox() { return aLibBox; }
- bool IsReference() const { return aReferenceBox.IsChecked(); }
- bool IsReplace() const { return aReplaceBox.IsChecked(); }
+ CheckBox& GetLibBox() { return *m_pLibBox; }
+ bool IsReference() const { return m_pReferenceBox->IsChecked(); }
+ bool IsReplace() const { return m_pReplaceBox->IsChecked(); }
- void EnableReference (bool b) { aReferenceBox.Enable(b); }
- void EnableReplace (bool b) { aReplaceBox.Enable(b); }
+ void EnableReference (bool b) { m_pReferenceBox->Enable(b); }
+ void EnableReplace (bool b) { m_pReplaceBox->Enable(b); }
};
-
class OrganizeDialog : public TabDialog
{
private:
diff --git a/basctl/source/basicide/moduldlg.src b/basctl/source/basicide/moduldlg.src
index 885ee0699121..4e542116cfc9 100644
--- a/basctl/source/basicide/moduldlg.src
+++ b/basctl/source/basicide/moduldlg.src
@@ -215,62 +215,6 @@ TabPage RID_TP_LIBS
TabStop = TRUE ;
};
};
-ModalDialog RID_DLG_LIBS
-{
- HelpId = "basctl:ModalDialog:RID_DLG_LIBS" ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 168 , 132 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- OKButton RID_PB_OK
- {
- Pos = MAP_APPFONT ( 112 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton RID_PB_CANCEL
- {
- Pos = MAP_APPFONT ( 112 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedText RID_FT_STORAGENAME
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- };
- Control RID_CTRL_LIBS
- {
- HelpID = HID_BASICIDE_LIBSDLG_TREE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 19 ) ;
- Size = MAP_APPFONT ( 100 , 67 ) ;
- TabStop = TRUE ;
- };
- FixedLine RID_FL_OPTIONS
- {
- Pos = MAP_APPFONT ( 6 , 89 ) ;
- Size = MAP_APPFONT ( 156 , 8 ) ;
- Text [ en-US ] = "Options" ;
- };
- CheckBox RID_CB_REF
- {
- HelpID = "basctl:CheckBox:RID_DLG_LIBS:RID_CB_REF";
- Pos = MAP_APPFONT ( 12 , 100 ) ;
- Size = MAP_APPFONT ( 146 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Insert as reference (read-only)" ;
- };
- CheckBox RID_CB_REPL
- {
- HelpID = "basctl:CheckBox:RID_DLG_LIBS:RID_CB_REPL";
- Pos = MAP_APPFONT ( 12 , 113 ) ;
- Size = MAP_APPFONT ( 146 , 10 ) ;
- Text [ en-US ] = "Replace existing libraries" ;
- };
-};
String RID_STR_EXPORTPACKAGE
{