summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-12-31 20:28:16 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-12-31 20:28:16 +0000
commitec6050497acb445d168f835dfc745ceace072ab9 (patch)
tree8ec86a188f691e34b6c4b0417106f10a06a50197 /basctl
parentc6aea0bac0b168c3b0e5172d10e2d974cf5fd331 (diff)
convert goto line dialog to .ui
Change-Id: I4c4ec4f2169d001e6f09c9c7bb06a4b0b327a2f8
Diffstat (limited to 'basctl')
-rw-r--r--basctl/UIConfig_basicide.mk1
-rw-r--r--basctl/inc/basidesh.hrc2
-rw-r--r--basctl/source/basicide/basidesh.src5
-rw-r--r--basctl/source/basicide/moduldl2.cxx23
-rw-r--r--basctl/source/basicide/moduldlg.hxx10
-rw-r--r--basctl/source/basicide/moduldlg.src37
-rw-r--r--basctl/uiconfig/basicide/ui/gotolinedialog.ui108
7 files changed, 122 insertions, 64 deletions
diff --git a/basctl/UIConfig_basicide.mk b/basctl/UIConfig_basicide.mk
index 6f84bb404a79..053f77b35b2f 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/gotolinedialog \
basctl/uiconfig/basicide/ui/organizedialog \
))
diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc
index b064dcb36966..b5077b8b0193 100644
--- a/basctl/inc/basidesh.hrc
+++ b/basctl/inc/basidesh.hrc
@@ -153,10 +153,8 @@
#define RID_STR_NORMAL_MODULES ( RID_BASICIDE_START + 120 )
#define RID_STR_CLASS_MODULES ( RID_BASICIDE_START + 121 )
-#define RID_DLG_GOTOLINE ( RID_BASICIDE_START + 122 )
#define RID_FT_LINE ( RID_BASICIDE_START + 123 )
#define RID_ED_LINE ( RID_BASICIDE_START + 124 )
-#define RID_STR_GETLINE ( RID_BASICIDE_START + 125 )
#endif // _SVX_NOIDERESIDS
diff --git a/basctl/source/basicide/basidesh.src b/basctl/source/basicide/basidesh.src
index 6876130f944f..b52526e2cbd3 100644
--- a/basctl/source/basicide/basidesh.src
+++ b/basctl/source/basicide/basidesh.src
@@ -601,11 +601,6 @@ String RID_STR_DLGIMP_MISMATCH_TEXT
Text [ en-US ] = "The dialog to be imported supports other languages than the target library.\n\nAdd these languages to the library to keep additional language resources provided by the dialog or omit them to stay with the current library languages.\n\nNote: For languages not supported by the dialog the resources of the dialog's default language will be used.\n " ;
};
-String RID_STR_GETLINE
-{
- Text [ en-US ] = "Goto Line";
-};
-
#define MN_EDIT 20
#define MN_VIEW 21
#define MN_EXTRA 22
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 6ad6b4f8253d..315479d182c2 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -436,23 +436,18 @@ NewObjectDialog::~NewObjectDialog()
//----------------------------------------------------------------------------
GotoLineDialog::GotoLineDialog(Window * pParent )
- : ModalDialog( pParent, IDEResId( RID_DLG_GOTOLINE ) ),
- aText( this, IDEResId( RID_FT_LINE ) ),
- aEdit( this, IDEResId( RID_ED_LINE ) ),
- aOKButton( this, IDEResId( RID_PB_OK ) ),
- aCancelButton( this, IDEResId( RID_PB_CANCEL ) )
+ : ModalDialog(pParent, "GotoLineDialog",
+ "modules/BasicIDE/ui/gotolinedialog.ui")
{
- FreeResource();
- aEdit.GrabFocus();
-
- SetText( IDE_RESSTR(RID_STR_GETLINE) );
- aOKButton.SetClickHdl(LINK(this, GotoLineDialog, OkButtonHandler));
-
+ get(m_pEdit, "entry");
+ get(m_pOKButton, "ok");
+ m_pEdit->GrabFocus();
+ m_pOKButton->SetClickHdl(LINK(this, GotoLineDialog, OkButtonHandler));
}
-sal_Int32 GotoLineDialog::GetLineNumber()
+sal_Int32 GotoLineDialog::GetLineNumber() const
{
- return OUString( aEdit.GetText() ).toInt32();
+ return m_pEdit->GetText().toInt32();
}
IMPL_LINK_NOARG(GotoLineDialog, OkButtonHandler)
@@ -460,7 +455,7 @@ IMPL_LINK_NOARG(GotoLineDialog, OkButtonHandler)
if ( GetLineNumber() )
EndDialog(1);
else
- aEdit.SetText( aEdit.GetText(), Selection(0, aEdit.GetText().getLength() ));
+ m_pEdit->SetText(m_pEdit->GetText(), Selection(0, m_pEdit->GetText().getLength()));
return 0;
}
diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx
index 0ea6a2dac6e1..921aa7df31d9 100644
--- a/basctl/source/basicide/moduldlg.hxx
+++ b/basctl/source/basicide/moduldlg.hxx
@@ -71,14 +71,12 @@ public:
class GotoLineDialog : public ModalDialog
{
- FixedText aText;
- Edit aEdit;
- OKButton aOKButton;
- CancelButton aCancelButton;
+ Edit* m_pEdit;
+ OKButton* m_pOKButton;
DECL_LINK(OkButtonHandler, void *);
public:
- GotoLineDialog( Window * pParent );
- sal_Int32 GetLineNumber();
+ GotoLineDialog(Window * pParent);
+ sal_Int32 GetLineNumber() const;
};
class ExportDialog : public ModalDialog
diff --git a/basctl/source/basicide/moduldlg.src b/basctl/source/basicide/moduldlg.src
index febc9b5fd658..20fd38106958 100644
--- a/basctl/source/basicide/moduldlg.src
+++ b/basctl/source/basicide/moduldlg.src
@@ -272,43 +272,6 @@ ModalDialog RID_DLG_LIBS
};
};
-ModalDialog RID_DLG_GOTOLINE
-{
- HelpID = "basctl:ModalDialog:RID_DLG_GOTOLINE";
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 160 , 55 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- OKButton RID_PB_OK
- {
- Pos = MAP_APPFONT ( 104 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton RID_PB_CANCEL
- {
- Pos = MAP_APPFONT ( 104 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedText RID_FT_LINE
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 96 , 10 ) ;
- Text [ en-US ] = "~Line Number:" ;
- };
- Edit RID_ED_LINE
- {
- HelpID = "basctl:Edit:RID_DLG_GOTOLINE:RID_ED_LINE";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 19 ) ;
- Size = MAP_APPFONT ( 62 , 12 ) ;
- TabStop = TRUE ;
- };
-};
-
ModalDialog RID_DLG_NEWLIB
{
HelpID = "basctl:ModalDialog:RID_DLG_NEWLIB";
diff --git a/basctl/uiconfig/basicide/ui/gotolinedialog.ui b/basctl/uiconfig/basicide/ui/gotolinedialog.ui
new file mode 100644
index 000000000000..9ddf4c87ee7c
--- /dev/null
+++ b/basctl/uiconfig/basicide/ui/gotolinedialog.ui
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Tue Dec 31 19:57:17 2013 -->
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="GotoLineDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Goto Line</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>
+ <object class="GtkGrid" id="grid3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <property name="row_homogeneous">True</property>
+ <child>
+ <object class="GtkLabel" id="area">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Line Number:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">entry</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="GtkEntry" id="entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">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 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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ </action-widgets>
+ </object>
+</interface>