Kaydet (Commit) e6f6818b authored tarafından Caolán McNamara's avatar Caolán McNamara

convert new lib dialog to .ui

Change-Id: I99043f2c259b56a7bfc2e7251f128b692e7d0e7f
üst bb90d11b
...@@ -65,6 +65,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ ...@@ -65,6 +65,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/messbox \ cui/uiconfig/ui/messbox \
cui/uiconfig/ui/movemenu \ cui/uiconfig/ui/movemenu \
cui/uiconfig/ui/namedialog \ cui/uiconfig/ui/namedialog \
cui/uiconfig/ui/newlibdialog \
cui/uiconfig/ui/newtabledialog \ cui/uiconfig/ui/newtabledialog \
cui/uiconfig/ui/newtoolbardialog \ cui/uiconfig/ui/newtoolbardialog \
cui/uiconfig/ui/numberingformatpage \ cui/uiconfig/ui/numberingformatpage \
......
...@@ -427,68 +427,36 @@ void SFTreeListBox::ExpandedHdl() ...@@ -427,68 +427,36 @@ void SFTreeListBox::ExpandedHdl()
// CuiInputDialog ------------------------------------------------------------ // CuiInputDialog ------------------------------------------------------------
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
CuiInputDialog::CuiInputDialog(Window * pParent, sal_uInt16 nMode ) CuiInputDialog::CuiInputDialog(Window * pParent, sal_uInt16 nMode )
: ModalDialog( pParent, CUI_RES( RID_DLG_NEWLIB ) ), : ModalDialog(pParent, "NewLibDialog",
aText( this, CUI_RES( FT_NEWLIB ) ), "cui/ui/newlibdialog.ui")
aEdit( this, CUI_RES( ED_LIBNAME ) ),
aOKButton( this, CUI_RES( PB_OK ) ),
aCancelButton( this, CUI_RES( PB_CANCEL ) )
{ {
aEdit.GrabFocus(); get(m_pEdit, "entry");
if ( nMode == INPUTMODE_NEWLIB ) m_pEdit->GrabFocus();
{
SetText( OUString( CUI_RES( STR_NEWLIB ) ) ); FixedText *pNewLibFT = get<FixedText>("newlibft");
}
else if ( nMode == INPUTMODE_NEWMACRO ) if ( nMode == INPUTMODE_NEWMACRO )
{ {
SetText( OUString( CUI_RES( STR_NEWMACRO ) ) ); pNewLibFT->Hide();
aText.SetText( OUString( CUI_RES( STR_FT_NEWMACRO ) ) ); FixedText *pNewMacroFT = get<FixedText>("newmacroft");
pNewMacroFT->Show();
SetText(get<FixedText>("altmacrotitle")->GetText());
} }
else if ( nMode == INPUTMODE_RENAME ) else if ( nMode == INPUTMODE_RENAME )
{ {
SetText( OUString( CUI_RES( STR_RENAME ) ) ); pNewLibFT->Hide();
aText.SetText( OUString( CUI_RES( STR_FT_RENAME ) ) ); FixedText *pRenameFT = get<FixedText>("renameft");
pRenameFT->Show();
SetText(get<FixedText>("altrenametitle")->GetText());
} }
FreeResource();
// some resizing so that the text fits
Point point, newPoint;
Size siz, newSiz;
long gap;
sal_uInt16 style = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP |
TEXT_DRAW_LEFT | TEXT_DRAW_WORDBREAK;
// get dimensions of dialog instructions control
point = aText.GetPosPixel();
siz = aText.GetSizePixel();
// get dimensions occupied by text in the control
Rectangle rect =
GetTextRect( Rectangle( point, siz ), aText.GetText(), style );
newSiz = rect.GetSize();
// the gap is the difference between the text width and its control width
gap = siz.Height() - newSiz.Height();
//resize the text field
newSiz = Size( siz.Width(), siz.Height() - gap );
aText.SetSizePixel( newSiz );
//move the OK & cancel buttons
point = aEdit.GetPosPixel();
newPoint = Point( point.X(), point.Y() - gap );
aEdit.SetPosPixel( newPoint );
} }
CuiInputDialog::~CuiInputDialog()
{
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// ScriptOrgDialog ------------------------------------------------------------ // ScriptOrgDialog ------------------------------------------------------------
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
SvxScriptOrgDialog::SvxScriptOrgDialog( Window* pParent, OUString language ) SvxScriptOrgDialog::SvxScriptOrgDialog( Window* pParent, OUString language )
: SfxModalDialog(pParent, "ScriptOrganizerDialog", "cui/ui/scriptorganizer.ui") : SfxModalDialog(pParent, "ScriptOrganizerDialog",
"cui/ui/scriptorganizer.ui")
, m_sLanguage(language) , m_sLanguage(language)
, m_delErrStr(CUI_RESSTR(RID_SVXSTR_DELFAILED)) , m_delErrStr(CUI_RESSTR(RID_SVXSTR_DELFAILED))
, m_delErrTitleStr(CUI_RESSTR(RID_SVXSTR_DELFAILED_TITLE)) , m_delErrTitleStr(CUI_RESSTR(RID_SVXSTR_DELFAILED_TITLE))
......
...@@ -21,62 +21,6 @@ ...@@ -21,62 +21,6 @@
#include "scriptdlg.hrc" #include "scriptdlg.hrc"
#include "helpid.hrc" #include "helpid.hrc"
ModalDialog RID_DLG_NEWLIB
{
HelpID = "cui:ModalDialog:RID_DLG_NEWLIB";
Text [ en-US ] = "Create Library" ;
Size = MAP_APPFONT ( 160 , 50 ) ;
Moveable = TRUE ;
Closeable = TRUE ;
OKButton PB_OK
{
Pos = MAP_APPFONT ( 104 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton PB_CANCEL
{
Pos = MAP_APPFONT ( 104 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
FixedText FT_NEWLIB
{
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 100 , 50 ) ;
WordBreak = TRUE ;
Text [ en-US ] = "Enter the name for the new library." ;
};
Edit ED_LIBNAME
{
HelpID = "cui:Edit:RID_DLG_NEWLIB:ED_LIBNAME";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 59 ) ;
Size = MAP_APPFONT ( 92 , 12 ) ;
TabStop = TRUE ;
};
String STR_NEWLIB
{
Text [ en-US ] = "Create Library" ;
};
String STR_NEWMACRO
{
Text [ en-US ] = "Create Macro" ;
};
String STR_FT_NEWMACRO
{
Text [ en-US ] = "Enter the name for the new macro." ;
};
String STR_RENAME
{
Text [ en-US ] = "Rename" ;
};
String STR_FT_RENAME
{
Text [ en-US ] = "Enter the new name for the selected object." ;
};
};
String RID_SVXSTR_DELQUERY String RID_SVXSTR_DELQUERY
{ {
Text [ en-US ] = "Do you want to delete the following object?"; Text [ en-US ] = "Do you want to delete the following object?";
......
...@@ -241,7 +241,6 @@ ...@@ -241,7 +241,6 @@
// script organizer // script organizer
#define RID_DLG_SCRIPTORGANIZER (RID_SVX_START + 258) #define RID_DLG_SCRIPTORGANIZER (RID_SVX_START + 258)
#define RID_DLG_NEWLIB (RID_SVX_START + 290)
#define RID_SVXSTR_DELQUERY (RID_SVX_START + 1027) #define RID_SVXSTR_DELQUERY (RID_SVX_START + 1027)
#define RID_SVXSTR_DELQUERY_TITLE (RID_SVX_START + 1028) #define RID_SVXSTR_DELQUERY_TITLE (RID_SVX_START + 1028)
#define RID_SVXSTR_DELFAILED (RID_SVX_START + 1029) #define RID_SVXSTR_DELFAILED (RID_SVX_START + 1029)
......
...@@ -101,23 +101,22 @@ public: ...@@ -101,23 +101,22 @@ public:
class CuiInputDialog : public ModalDialog class CuiInputDialog : public ModalDialog
{ {
private: private:
FixedText aText; Edit* m_pEdit;
Edit aEdit;
OKButton aOKButton;
CancelButton aCancelButton;
public: public:
CuiInputDialog( Window * pParent, sal_uInt16 nMode ); CuiInputDialog(Window * pParent, sal_uInt16 nMode);
~CuiInputDialog();
OUString GetObjectName() const { return m_pEdit->GetText(); }
OUString GetObjectName() const { return aEdit.GetText(); } void SetObjectName(const OUString& rName)
void SetObjectName( const OUString& rName ) { aEdit.SetText( rName ); aEdit.SetSelection( Selection( 0, rName.getLength() ) );} {
m_pEdit->SetText( rName );
m_pEdit->SetSelection( Selection( 0, rName.getLength() ) );
}
}; };
class SFEntry class SFEntry
{ {
private: private:
sal_uInt8 nType; sal_uInt8 nType;
bool loaded; bool loaded;
::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > nodes; ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > nodes;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > model; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > model;
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.0 on Sat Jan 4 16:52:18 2014 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="NewLibDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Create Library</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="newlibft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Enter the name for the new library.</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">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="newmacroft">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Enter the name for the new macro.</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">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="renameft">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Enter the new name for the selected object.</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">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="altmacrotitle">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes">Create Macro</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="altrenametitle">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes">Rename</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment