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

convert insert autotext dialog to .ui

Change-Id: Ia57a5e74300fb52d2618b086fe51a8b33547101b
üst 3e65dc7f
...@@ -93,7 +93,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ ...@@ -93,7 +93,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/dialog/dialog.src \ sw/source/ui/dialog/dialog.src \
sw/source/ui/dialog/regionsw.src \ sw/source/ui/dialog/regionsw.src \
sw/source/ui/dochdl/dochdl.src \ sw/source/ui/dochdl/dochdl.src \
sw/source/ui/dochdl/selglos.src \
sw/source/ui/docvw/annotation.src \ sw/source/ui/docvw/annotation.src \
sw/source/ui/docvw/access.src \ sw/source/ui/docvw/access.src \
sw/source/ui/docvw/docvw.src \ sw/source/ui/docvw/docvw.src \
......
...@@ -93,6 +93,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ ...@@ -93,6 +93,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/indexentry \ sw/uiconfig/swriter/ui/indexentry \
sw/uiconfig/swriter/ui/inputfielddialog \ sw/uiconfig/swriter/ui/inputfielddialog \
sw/uiconfig/swriter/ui/indentpage \ sw/uiconfig/swriter/ui/indentpage \
sw/uiconfig/swriter/ui/insertautotextdialog \
sw/uiconfig/swriter/ui/insertbookmark \ sw/uiconfig/swriter/ui/insertbookmark \
sw/uiconfig/swriter/ui/insertbreak \ sw/uiconfig/swriter/ui/insertbreak \
sw/uiconfig/swriter/ui/insertcaption \ sw/uiconfig/swriter/ui/insertcaption \
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#define MSG_CLPBRD_FORMAT_ERROR (RC_DOCHDL_BEGIN + 4) #define MSG_CLPBRD_FORMAT_ERROR (RC_DOCHDL_BEGIN + 4)
#define MSG_UPDATE_NEW_GLOS_FMT (RC_DOCHDL_BEGIN + 5) #define MSG_UPDATE_NEW_GLOS_FMT (RC_DOCHDL_BEGIN + 5)
#define DLG_SEL_GLOS (RC_DOCHDL_BEGIN + 6)
#define STR_NO_TABLE (RC_DOCHDL_BEGIN + 7) #define STR_NO_TABLE (RC_DOCHDL_BEGIN + 7)
#define STR_PRIVATETEXT (RC_DOCHDL_BEGIN + 8) #define STR_PRIVATETEXT (RC_DOCHDL_BEGIN + 8)
......
...@@ -369,7 +369,7 @@ public: ...@@ -369,7 +369,7 @@ public:
sal_Bool bDraw = sal_False, sal_Bool bDraw = sal_False,
sal_uInt16 nDefPage = 0) = 0; sal_uInt16 nDefPage = 0) = 0;
virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ) = 0; //add for SwSelGlossaryDlg virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg(Window * pParent, const String &rShortName) = 0; //add for SwSelGlossaryDlg
virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ) = 0; //add for SwTableHeightDlg SwSortDlg virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ) = 0; //add for SwTableHeightDlg SwSortDlg
virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ) = 0; //add for SwSplitTblDlg virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ) = 0; //add for SwSplitTblDlg
......
...@@ -859,22 +859,10 @@ AbstractSplitTableDialog * SwAbstractDialogFactory_Impl::CreateSplitTblDialog ( ...@@ -859,22 +859,10 @@ AbstractSplitTableDialog * SwAbstractDialogFactory_Impl::CreateSplitTblDialog (
return new AbstractSplitTableDialog_Impl( new SwSplitTblDlg( pParent, rSh) ); return new AbstractSplitTableDialog_Impl( new SwSplitTblDlg( pParent, rSh) );
} }
AbstractSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ) AbstractSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg(Window * pParent, const String &rShortName)
{ {
SwSelGlossaryDlg* pDlg=NULL; SwSelGlossaryDlg* pDlg = new SwSelGlossaryDlg(pParent, rShortName);
switch ( nResId ) return new AbstractSwSelGlossaryDlg_Impl(pDlg);
{
case DLG_SEL_GLOS :
pDlg = new SwSelGlossaryDlg( pParent, rShortName);
break;
default:
break;
}
if ( pDlg )
return new AbstractSwSelGlossaryDlg_Impl( pDlg );
return 0;
} }
AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg(Window* pParent, AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg(Window* pParent,
......
...@@ -470,7 +470,7 @@ public: ...@@ -470,7 +470,7 @@ public:
sal_Bool bDraw = sal_False, sal_Bool bDraw = sal_False,
sal_uInt16 nDefPage = 0); sal_uInt16 nDefPage = 0);
virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ); //add for SwSelGlossaryDlg virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg(Window * pParent, const String &rShortName); //add for SwSelGlossaryDlg
virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ); //add for SwTableHeightDlg SwSortDlg virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ); //add for SwTableHeightDlg SwSortDlg
virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ); //add for SwSplitTblDlg virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ); //add for SwSplitTblDlg
......
...@@ -454,7 +454,7 @@ sal_Bool SwGlossaryHdl::Expand( const OUString& rShortName, ...@@ -454,7 +454,7 @@ sal_Bool SwGlossaryHdl::Expand( const OUString& rShortName,
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwSelGlossaryDlg* pDlg = pFact->CreateSwSelGlossaryDlg( 0, aShortName, DLG_SEL_GLOS ); AbstractSwSelGlossaryDlg* pDlg = pFact->CreateSwSelGlossaryDlg(0, aShortName);
OSL_ENSURE(pDlg, "Dialogdiet fail!"); OSL_ENSURE(pDlg, "Dialogdiet fail!");
for(sal_uInt16 i = 0; i < aFoundArr.size(); ++i) for(sal_uInt16 i = 0; i < aFoundArr.size(); ++i)
{ {
......
...@@ -21,32 +21,20 @@ ...@@ -21,32 +21,20 @@
#include "selglos.hxx" #include "selglos.hxx"
#include "selglos.hrc"
#include "dochdl.hrc" #include "dochdl.hrc"
#include <vcl/msgbox.hxx> #include <vcl/layout.hxx>
// STATIC DATA -----------------------------------------------------------
// CTOR / DTOR -----------------------------------------------------------
SwSelGlossaryDlg::SwSelGlossaryDlg(Window * pParent, const OUString &rShortName) SwSelGlossaryDlg::SwSelGlossaryDlg(Window * pParent, const OUString &rShortName)
: ModalDialog(pParent, SW_RES(DLG_SEL_GLOS)), : ModalDialog(pParent, "InsertAutoTextDialog",
aGlosBox(this, SW_RES( LB_GLOS)), "modules/swriter/ui/insertautotextdialog.ui")
aGlosFL(this, SW_RES( FL_GLOS)),
aOKBtn(this, SW_RES( BT_OK)),
aCancelBtn(this, SW_RES( BT_CANCEL)),
aHelpBtn(this, SW_RES(BT_HELP))
{ {
aGlosFL.SetText(aGlosFL.GetText() + rShortName); VclFrame *pFrame(get<VclFrame>("frame"));
FreeResource(); pFrame->set_label(pFrame->get_label() + rShortName);
get(m_pGlosBox, "treeview");
aGlosBox.SetDoubleClickHdl(LINK(this, SwSelGlossaryDlg, DoubleClickHdl)); m_pGlosBox->set_height_request(m_pGlosBox->GetTextHeight() * 10);
m_pGlosBox->SetDoubleClickHdl(LINK(this, SwSelGlossaryDlg, DoubleClickHdl));
} }
// overload dtor
SwSelGlossaryDlg::~SwSelGlossaryDlg() {}
IMPL_LINK(SwSelGlossaryDlg, DoubleClickHdl, ListBox*, /*pBox*/) IMPL_LINK(SwSelGlossaryDlg, DoubleClickHdl, ListBox*, /*pBox*/)
{ {
EndDialog(RET_OK); EndDialog(RET_OK);
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#define BT_OK 100
#define BT_CANCEL 101
#define BT_HELP 102
#define LB_GLOS 1
#define FL_GLOS 2
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "selglos.hrc"
#include "dochdl.hrc"
#include "cmdid.h"
#include "helpid.h"
ModalDialog DLG_SEL_GLOS
{
HelpID = CMD_FN_EXPAND_GLOSSARY ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 220 , 100 ) ;
Text [ en-US ] = "Insert AutoText" ;
Moveable = TRUE ;
OKButton BT_OK
{
Pos = MAP_APPFONT ( 164 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton BT_CANCEL
{
Pos = MAP_APPFONT ( 164 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
HelpButton BT_HELP
{
Pos = MAP_APPFONT ( 164 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
FixedLine FL_GLOS
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 152 , 8 ) ;
Text [ en-US ] = "AutoTexts for shortcut " ;
};
ListBox LB_GLOS
{
HelpID = "sw:ListBox:DLG_SEL_GLOS:LB_GLOS";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 140 , 74 ) ;
TabStop = TRUE ;
AutoHScroll = TRUE ;
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -29,32 +29,26 @@ ...@@ -29,32 +29,26 @@
class SwSelGlossaryDlg : public ModalDialog class SwSelGlossaryDlg : public ModalDialog
{ {
protected: protected:
ListBox aGlosBox; ListBox* m_pGlosBox;
FixedLine aGlosFL;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
DECL_LINK(DoubleClickHdl, ListBox*); DECL_LINK(DoubleClickHdl, ListBox*);
public: public:
SwSelGlossaryDlg(Window * pParent, const OUString &rShortName); SwSelGlossaryDlg(Window * pParent, const OUString &rShortName);
~SwSelGlossaryDlg(); void InsertGlos(const OUString &rRegion, const OUString &rGlosName)
void InsertGlos(const OUString &rRegion, const OUString &rGlosName); // inline {
sal_uInt16 GetSelectedIdx() const; // inline const OUString aTmp = rRegion + ":" + rGlosName;
void SelectEntryPos(sal_uInt16 nIdx); // inline m_pGlosBox->InsertEntry(aTmp);
}
sal_uInt16 GetSelectedIdx() const
{
return m_pGlosBox->GetSelectEntryPos();
}
void SelectEntryPos(sal_uInt16 nIdx)
{
m_pGlosBox->SelectEntryPos(nIdx);
}
}; };
inline void SwSelGlossaryDlg::InsertGlos(const OUString &rRegion,
const OUString &rGlosName)
{
const OUString aTmp = rRegion + ":" + rGlosName;
aGlosBox.InsertEntry( aTmp );
}
inline sal_uInt16 SwSelGlossaryDlg::GetSelectedIdx() const
{ return aGlosBox.GetSelectEntryPos(); }
inline void SwSelGlossaryDlg::SelectEntryPos(sal_uInt16 nIdx)
{ aGlosBox.SelectEntryPos(nIdx); }
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="InsertAutoTextDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Insert AutoText</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="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>
<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="GtkFrame" id="frame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkTreeView" id="treeview:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">AutoTexts for shortcut </property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</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">ok</action-widget>
<action-widget response="0">cancel</action-widget>
<action-widget response="0">help</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