convert select index dialog to .ui

Change-Id: I49a3d67e9c22c1608354b732f8aee27afcf15885
This commit is contained in:
Caolán McNamara 2013-09-03 08:45:49 +01:00
parent 8b90ad8af9
commit 58fe754c70
12 changed files with 156 additions and 162 deletions

View File

@ -103,7 +103,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/globdoc/globdoc.src \
sw/source/ui/index/cnttab.src \
sw/source/ui/index/idxmrk.src \
sw/source/ui/index/multmrk.src \
sw/source/ui/lingu/olmenu.src \
sw/source/ui/misc/glossary.src \
sw/source/ui/misc/numberingtypelistbox.src \

View File

@ -166,6 +166,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/savelabeldialog \
sw/uiconfig/swriter/ui/sectionpage \
sw/uiconfig/swriter/ui/selectautotextdialog \
sw/uiconfig/swriter/ui/selectindexdialog \
sw/uiconfig/swriter/ui/sidebarpage \
sw/uiconfig/swriter/ui/sidebarwrap \
sw/uiconfig/swriter/ui/sortdialog \

View File

@ -26,8 +26,6 @@
#include "rcid.hrc"
#define DLG_MULTMRK (RC_INDEX_BEGIN + 5)
#define STR_TITLE (RC_INDEX_BEGIN + 6)
#define STR_ALPHA (RC_INDEX_BEGIN + 7)
#define STR_LEVEL (RC_INDEX_BEGIN + 8)

View File

@ -424,8 +424,7 @@ public:
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0 ) = 0;
virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg(Window* pParent) = 0;
virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg(Window* pParent) = 0;
virtual VclAbstractDialog* CreateMultiTOXMarkDlg( int nResId,
Window* pParent, SwTOXMgr &rTOXMgr ) = 0;
virtual VclAbstractDialog* CreateMultiTOXMarkDlg(Window* pParent, SwTOXMgr &rTOXMgr) = 0;
virtual SfxAbstractTabDialog* CreateSwTabDialog( int nResId,
Window* pParent,
const SfxItemSet* pSwItemSet,

View File

@ -1023,21 +1023,10 @@ AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailM
return new AbstractMailMergeFieldConnectionsDlg_Impl( pDlg );
}
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg( int nResId,
Window* pParent, SwTOXMgr &rTOXMgr )
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg(Window* pParent, SwTOXMgr &rTOXMgr)
{
Dialog* pDlg=NULL;
switch ( nResId )
{
case DLG_MULTMRK :
pDlg = new SwMultiTOXMarkDlg( pParent, rTOXMgr );
break;
default:
break;
}
if ( pDlg )
return new VclAbstractDialog_Impl( pDlg );
return 0;
Dialog* pDlg = new SwMultiTOXMarkDlg(pParent, rTOXMgr);
return new VclAbstractDialog_Impl(pDlg);
}
SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTabDialog( int nResId,

View File

@ -469,8 +469,7 @@ public:
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0 );
virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg(Window* pParent);
virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg(Window* pParent);
virtual VclAbstractDialog* CreateMultiTOXMarkDlg( int nResId,
Window* pParent, SwTOXMgr &rTOXMgr );
virtual VclAbstractDialog* CreateMultiTOXMarkDlg(Window* pParent, SwTOXMgr &rTOXMgr);
virtual SfxAbstractTabDialog* CreateSwTabDialog( int nResId,
Window* pParent,
const SfxItemSet* pSwItemSet,

View File

@ -37,15 +37,10 @@ class SwMultiTOXMarkDlg : public SvxStandardDialog
{
DECL_LINK( SelectHdl, ListBox * );
FixedLine aTOXFL;
FixedText aEntryFT;
FixedInfo aTextFT;
FixedText aTOXFT;
ListBox aTOXLB;
OKButton aOkBT;
CancelButton aCancelBT;
FixedText* m_pTextFT;
ListBox* m_pTOXLB;
SwTOXMgr &rMgr;
SwTOXMgr& rMgr;
sal_uInt16 nPos;
void Apply();

View File

@ -23,41 +23,34 @@
#include "toxmgr.hxx"
#include "index.hrc"
#include "multmrk.hrc"
SwMultiTOXMarkDlg::SwMultiTOXMarkDlg( Window* pParent, SwTOXMgr& rTOXMgr ) :
SvxStandardDialog(pParent, SW_RES(DLG_MULTMRK)),
aTOXFL(this, SW_RES(FL_TOX)),
aEntryFT(this, SW_RES(FT_ENTRY)),
aTextFT(this, SW_RES(FT_TEXT)),
aTOXFT(this, SW_RES(FT_TOX)),
aTOXLB(this, SW_RES(LB_TOX)),
aOkBT(this, SW_RES(OK_BT)),
aCancelBT(this, SW_RES(CANCEL_BT)),
rMgr( rTOXMgr ),
nPos(0)
SwMultiTOXMarkDlg::SwMultiTOXMarkDlg(Window* pParent, SwTOXMgr& rTOXMgr)
: SvxStandardDialog(pParent, "SelectIndexDialog",
"modules/swriter/ui/selectindexdialog.ui")
, rMgr(rTOXMgr)
, nPos(0)
{
aTOXLB.SetSelectHdl(LINK(this, SwMultiTOXMarkDlg, SelectHdl));
get(m_pTextFT, "type");
get(m_pTOXLB, "treeview");
m_pTOXLB->set_height_request(m_pTOXLB->GetTextHeight() * 10);
m_pTOXLB->set_width_request(m_pTOXLB->approximate_char_width() * 25);
m_pTOXLB->SetSelectHdl(LINK(this, SwMultiTOXMarkDlg, SelectHdl));
sal_uInt16 nSize = rMgr.GetTOXMarkCount();
for(sal_uInt16 i=0; i < nSize; ++i)
aTOXLB.InsertEntry(rMgr.GetTOXMark(i)->GetText());
m_pTOXLB->InsertEntry(rMgr.GetTOXMark(i)->GetText());
aTOXLB.SelectEntryPos(0);
aTextFT.SetText(rMgr.GetTOXMark(0)->GetTOXType()->GetTypeName());
FreeResource();
m_pTOXLB->SelectEntryPos(0);
m_pTextFT->SetText(rMgr.GetTOXMark(0)->GetTOXType()->GetTypeName());
}
IMPL_LINK_INLINE_START( SwMultiTOXMarkDlg, SelectHdl, ListBox *, pBox )
{
if(pBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND)
{ SwTOXMark* pMark = rMgr.GetTOXMark(pBox->GetSelectEntryPos());
aTextFT.SetText(pMark->GetTOXType()->GetTypeName());
m_pTextFT->SetText(pMark->GetTOXType()->GetTypeName());
nPos = pBox->GetSelectEntryPos();
}
return 0;

View File

@ -1,27 +0,0 @@
/* -*- 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 FT_ENTRY 1
#define FT_TOX 2
#define OK_BT 3
#define LB_TOX 4
#define FT_TEXT 5
#define FL_TOX 6
#define CANCEL_BT 7
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -1,82 +0,0 @@
/* -*- 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 "index.hrc"
#include "multmrk.hrc"
#include "cmdid.h"
#include "helpid.h"
ModalDialog DLG_MULTMRK
{
HelpID = CMD_FN_EDIT_IDX_ENTRY_DLG ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 220 , 95 ) ;
Text [ en-US ] = "Index Markings" ;
Moveable = TRUE ;
FixedLine FL_TOX
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 153 , 8 ) ;
Text [ en-US ] = "Selection" ;
};
FixedText FT_ENTRY
{
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 41 , 8 ) ;
Text [ en-US ] = "Index" ;
Left = TRUE ;
};
FixedText FT_TEXT
{
Pos = MAP_APPFONT ( 53 , 14 ) ;
Size = MAP_APPFONT ( 100 , 8 ) ;
Left = TRUE ;
};
FixedText FT_TOX
{
Pos = MAP_APPFONT ( 12 , 26 ) ;
Size = MAP_APPFONT ( 41 , 8 ) ;
Text [ en-US ] = "Entry" ;
Left = TRUE ;
};
ListBox LB_TOX
{
HelpID = "sw:ListBox:DLG_MULTMRK:LB_TOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 37 ) ;
Size = MAP_APPFONT ( 100 , 49 ) ;
TabStop = TRUE ;
AutoHScroll = TRUE ;
};
OKButton OK_BT
{
Pos = MAP_APPFONT ( 165 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton CANCEL_BT
{
Pos = MAP_APPFONT ( 165 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -85,8 +85,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
{ // Several marks, which should it be?
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
VclAbstractDialog* pMultDlg = pFact->CreateMultiTOXMarkDlg( DLG_MULTMRK,
pMDI, aMgr);
VclAbstractDialog* pMultDlg = pFact->CreateMultiTOXMarkDlg(pMDI, aMgr);
OSL_ENSURE(pMultDlg, "Dialogdiet fail!");
nRet = pMultDlg->Execute();
delete pMultDlg;

View File

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="SelectIndexDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Index Markings</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>
</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="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="type">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">treeview:border</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<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>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</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">Selection</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-widgets>
</object>
</interface>