Kaydet (Commit) 99d0ddf8 authored tarafından Jack Leigh's avatar Jack Leigh Kaydeden (comit) Caolán McNamara

migrate 'Insert Footnote' dialog to .ui file

Conflicts:
	sw/source/ui/misc/insfnote.src

Change-Id: If16285d85bca187b2e929f0327b15f103b5d786f
üst e65e9056
......@@ -145,7 +145,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/misc/docfnote.src \
sw/source/ui/misc/glosbib.src \
sw/source/ui/misc/glossary.src \
sw/source/ui/misc/insfnote.src \
sw/source/ui/misc/num.src \
sw/source/ui/misc/numberingtypelistbox.src \
sw/source/ui/misc/outline.src \
......
......@@ -19,6 +19,7 @@ $(eval $(call gb_UI_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/footnotepage \
sw/uiconfig/swriter/ui/indexentry \
sw/uiconfig/swriter/ui/insertbreak \
sw/uiconfig/swriter/ui/insertfootnote \
sw/uiconfig/swriter/ui/insertscript \
sw/uiconfig/swriter/ui/inserttable \
sw/uiconfig/swriter/ui/linenumbering \
......
......@@ -63,6 +63,8 @@
#define STR_JAVA_EDIT (RC_GLOBALS_BEGIN + 38)
#define STR_FOOTNOTE_DIALOG_CHAR (RC_GLOBALS_BEGIN + 39)
// DIALOGS -----------------------------------------------------------
#define DLG_THESAURUS (RC_GLOBALS_BEGIN + 2)
......
......@@ -220,6 +220,10 @@ String STR_JAVA_EDIT
Text [ en-US ] = "Edit Script" ;
};
String STR_FOOTNOTE_DIALOG_CHAR
{
Text [ en-US ] = "Character" ;
};
InfoBox MSG_ERROR_SEND_MAIL
{
......
......@@ -28,6 +28,8 @@
class SwWrtShell;
class VclFrame;
class SwInsFootNoteDlg: public SvxStandardDialog
{
SwWrtShell &rSh;
......@@ -37,28 +39,26 @@ class SwInsFootNoteDlg: public SvxStandardDialog
CharSet eCharSet;
sal_Bool bExtCharAvailable;
sal_Bool bEdit;
FixedLine aNumberFL;
RadioButton aNumberAutoBtn;
RadioButton aNumberCharBtn;
Edit aNumberCharEdit;
PushButton aNumberExtChar;
VclFrame* m_pNumberFrame;
RadioButton* m_pNumberAutoBtn;
RadioButton* m_pNumberCharBtn;
Edit* m_pNumberCharEdit;
PushButton* m_pNumberExtChar;
// everything for the selection footnote/endnote
FixedLine aTypeFL;
RadioButton aFtnBtn;
RadioButton aEndNoteBtn;
RadioButton* m_pFtnBtn;
RadioButton* m_pEndNoteBtn;
OKButton aOkBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
ImageButton aPrevBT;
ImageButton aNextBT;
PushButton* m_pOkBtn;
PushButton* m_pPrevBT;
PushButton* m_pNextBT;
DECL_LINK(NumberCharHdl, void *);
DECL_LINK( NumberEditHdl, void * );
DECL_LINK(NumberEditHdl, void *);
DECL_LINK(NumberAutoBtnHdl, void *);
DECL_LINK(NumberExtCharHdl, void *);
DECL_LINK( NextPrevHdl, Button * );
DECL_LINK(NextPrevHdl, Button *);
virtual void Apply();
......@@ -69,13 +69,13 @@ public:
~SwInsFootNoteDlg();
CharSet GetCharSet() { return eCharSet; }
sal_Bool IsExtCharAvailable() { return bExtCharAvailable; }
sal_Bool IsExtCharAvailable() { return bExtCharAvailable; }
String GetFontName() { return aFontName; }
sal_Bool IsEndNote() { return aEndNoteBtn.IsChecked(); }
sal_Bool IsEndNote() { return m_pEndNoteBtn->IsChecked(); }
String GetStr()
{
if ( aNumberCharBtn.IsChecked() )
return aNumberCharEdit.GetText();
if ( m_pNumberCharBtn->IsChecked() )
return m_pNumberCharEdit->GetText();
else
return String();
}
......
......@@ -32,10 +32,11 @@
#include <insfnote.hxx>
#include <crsskip.hxx>
#include <misc.hrc>
#include <insfnote.hrc>
#include <globals.hrc>
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
#include <sfx2/viewfrm.hxx>
#include <vcl/layout.hxx>
static sal_Bool bFootnote = sal_True;
......@@ -47,15 +48,15 @@ void SwInsFootNoteDlg::Apply()
{
String aStr;
if ( aNumberCharBtn.IsChecked() )
aStr = aNumberCharEdit.GetText();
if ( m_pNumberCharBtn->IsChecked() )
aStr = m_pNumberCharEdit->GetText();
if ( bEdit )
{
rSh.StartAction();
rSh.Left(CRSR_SKIP_CHARS, sal_False, 1, sal_False );
rSh.StartUndo( UNDO_START );
SwFmtFtn aNote( aEndNoteBtn.IsChecked() );
SwFmtFtn aNote( m_pEndNoteBtn->IsChecked() );
aNote.SetNumStr( aStr );
if( rSh.SetCurFtn( aNote ) && bExtCharAvailable )
......@@ -80,21 +81,21 @@ void SwInsFootNoteDlg::Apply()
}
bFootnote = aFtnBtn.IsChecked();
bFootnote = m_pFtnBtn->IsChecked();
}
IMPL_LINK_NOARG_INLINE_START(SwInsFootNoteDlg, NumberCharHdl)
{
aNumberCharEdit.GrabFocus();
aOkBtn.Enable( aNumberCharEdit.GetText().Len() || bExtCharAvailable );
m_pNumberCharEdit->GrabFocus();
m_pOkBtn->Enable( m_pNumberCharEdit->GetText().Len() || bExtCharAvailable );
return 0;
}
IMPL_LINK_NOARG_INLINE_END(SwInsFootNoteDlg, NumberCharHdl)
IMPL_LINK_NOARG_INLINE_START(SwInsFootNoteDlg, NumberEditHdl)
{
aNumberCharBtn.Check( sal_True );
aOkBtn.Enable( 0 != aNumberCharEdit.GetText().Len() );
m_pNumberCharBtn->Check( sal_True );
m_pOkBtn->Enable( 0 != m_pNumberCharEdit->GetText().Len() );
return 0;
}
......@@ -102,14 +103,14 @@ IMPL_LINK_NOARG_INLINE_END(SwInsFootNoteDlg, NumberEditHdl)
IMPL_LINK_NOARG_INLINE_START(SwInsFootNoteDlg, NumberAutoBtnHdl)
{
aOkBtn.Enable( sal_True );
m_pOkBtn->Enable( sal_True );
return 0;
}
IMPL_LINK_NOARG_INLINE_END(SwInsFootNoteDlg, NumberAutoBtnHdl)
IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberExtCharHdl)
{
aNumberCharBtn.Check( sal_True );
m_pNumberCharBtn->Check( sal_True );
SfxItemSet aSet( rSh.GetAttrPool(), RES_CHRATR_FONT, RES_CHRATR_FONT );
rSh.GetCurAttr( aSet );
......@@ -129,20 +130,20 @@ IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberExtCharHdl)
if ( pItem )
{
String sExtChars(pItem->GetValue());
aNumberCharEdit.SetText( sExtChars );
m_pNumberCharEdit->SetText( sExtChars );
if ( pFontItem )
{
aFontName = pFontItem->GetFamilyName();
eCharSet = pFontItem->GetCharSet();
Font aFont( aFontName, pFontItem->GetStyleName(), aNumberCharEdit.GetFont().GetSize() );
Font aFont( aFontName, pFontItem->GetStyleName(), m_pNumberCharEdit->GetFont().GetSize() );
aFont.SetCharSet( pFontItem->GetCharSet() );
aFont.SetPitch( pFontItem->GetPitch() );
aNumberCharEdit.SetFont( aFont );
m_pNumberCharEdit->SetFont( aFont );
}
bExtCharAvailable = sal_True;
aOkBtn.Enable(0 != aNumberCharEdit.GetText().Len());
m_pOkBtn->Enable(0 != m_pNumberCharEdit->GetText().Len());
}
}
delete pDlg;
......@@ -156,7 +157,7 @@ IMPL_LINK( SwInsFootNoteDlg, NextPrevHdl, Button *, pBtn )
// go to the next foot/endnote here
rSh.ResetSelect(0, sal_False);
if (pBtn == &aNextBT)
if (pBtn == m_pNextBT)
rSh.GotoNextFtnAnchor();
else
rSh.GotoPrevFtnAnchor();
......@@ -167,51 +168,44 @@ IMPL_LINK( SwInsFootNoteDlg, NextPrevHdl, Button *, pBtn )
}
SwInsFootNoteDlg::SwInsFootNoteDlg(Window *pParent, SwWrtShell &rShell, sal_Bool bEd) :
SvxStandardDialog(pParent,SW_RES(DLG_INS_FOOTNOTE)),
SvxStandardDialog(pParent, "InsertFootnoteDialog", "modules/swriter/ui/insertfootnote.ui"),
rSh(rShell),
bExtCharAvailable(sal_False),
bEdit(bEd),
aNumberFL (this,SW_RES(FL_NUMBER)),
aNumberAutoBtn (this,SW_RES(RB_NUMBER_AUTO)),
aNumberCharBtn (this,SW_RES(RB_NUMBER_CHAR)),
aNumberCharEdit (this,SW_RES(ED_NUMBER_CHAR)),
aNumberExtChar (this,SW_RES(BT_NUMBER_CHAR)),
aTypeFL (this,SW_RES(FL_TYPE)),
aFtnBtn (this,SW_RES(RB_TYPE_FTN)),
aEndNoteBtn (this,SW_RES(RB_TYPE_ENDNOTE)),
aOkBtn (this,SW_RES(BT_OK)),
aCancelBtn (this,SW_RES(BT_CANCEL)),
aHelpBtn (this,SW_RES(BT_HELP)),
aPrevBT (this,SW_RES(BT_PREV)),
aNextBT (this,SW_RES(BT_NEXT))
bEdit(bEd)
{
aNumberCharEdit.SetAccessibleName(String(SW_RES(STR_CHAR)));
aNumberExtChar.SetAccessibleRelationMemberOf(&aNumberFL);
aNumberCharEdit.SetAccessibleRelationLabeledBy(&aNumberCharBtn);
aNumberAutoBtn.SetClickHdl(LINK(this,SwInsFootNoteDlg,NumberAutoBtnHdl));
aNumberExtChar.SetClickHdl(LINK(this,SwInsFootNoteDlg,NumberExtCharHdl));
aNumberCharBtn.SetClickHdl(LINK(this,SwInsFootNoteDlg,NumberCharHdl));
aNumberCharEdit.SetModifyHdl(LINK(this,SwInsFootNoteDlg,NumberEditHdl));
aNumberCharEdit.SetMaxTextLen(10);
aNumberCharEdit.Enable();
aPrevBT.SetClickHdl(LINK(this, SwInsFootNoteDlg, NextPrevHdl));
aNextBT.SetClickHdl(LINK(this, SwInsFootNoteDlg, NextPrevHdl));
get(m_pNumberFrame, "numberingframe");
get(m_pNumberAutoBtn, "automatic");
get(m_pNumberCharBtn, "character");
get(m_pNumberCharEdit, "characterentry");
get(m_pNumberExtChar, "choosecharacter");
get(m_pFtnBtn, "footnote");
get(m_pEndNoteBtn, "endnote");
get(m_pOkBtn, "ok");
get(m_pPrevBT, "prev");
get(m_pNextBT, "next");
m_pNumberCharEdit->SetAccessibleName(String(SW_RES(STR_FOOTNOTE_DIALOG_CHAR)));
m_pNumberExtChar->SetAccessibleRelationMemberOf(m_pNumberFrame->get_label_widget());
m_pNumberCharEdit->SetAccessibleRelationLabeledBy(m_pNumberCharBtn);
m_pNumberAutoBtn->SetClickHdl(LINK(this,SwInsFootNoteDlg,NumberAutoBtnHdl));
m_pNumberExtChar->SetClickHdl(LINK(this,SwInsFootNoteDlg,NumberExtCharHdl));
m_pNumberCharBtn->SetClickHdl(LINK(this,SwInsFootNoteDlg,NumberCharHdl));
m_pNumberCharEdit->SetModifyHdl(LINK(this,SwInsFootNoteDlg,NumberEditHdl));
m_pNumberCharEdit->SetMaxTextLen(10);
m_pNumberCharEdit->Enable();
m_pPrevBT->SetClickHdl(LINK(this, SwInsFootNoteDlg, NextPrevHdl));
m_pNextBT->SetClickHdl(LINK(this, SwInsFootNoteDlg, NextPrevHdl));
FreeResource();
rSh.SetCareWin(this);
if (bEdit)
{
Init();
aPrevBT.Show();
aNextBT.Show();
m_pPrevBT->Show();
m_pNextBT->Show();
}
}
......@@ -243,7 +237,7 @@ void SwInsFootNoteDlg::Init()
rSh.GetCurAttr( aSet );
const SvxFontItem &rFont = (SvxFontItem &) aSet.Get( RES_CHRATR_FONT );
aFont = aNumberCharEdit.GetFont();
aFont = m_pNumberCharEdit->GetFont();
aFontName = rFont.GetFamilyName();
eCharSet = rFont.GetCharSet();
aFont.SetName(aFontName);
......@@ -253,20 +247,20 @@ void SwInsFootNoteDlg::Init()
}
bFootnote = !aFtnNote.IsEndNote();
}
aNumberCharEdit.SetFont(aFont);
m_pNumberCharEdit->SetFont(aFont);
sal_Bool bNumChar = sNumStr.Len() != 0;
aNumberCharEdit.SetText(sNumStr);
aNumberCharBtn.Check(bNumChar);
aNumberAutoBtn.Check(!bNumChar);
m_pNumberCharEdit->SetText(sNumStr);
m_pNumberCharBtn->Check(bNumChar);
m_pNumberAutoBtn->Check(!bNumChar);
if (bNumChar)
aNumberCharEdit.GrabFocus();
m_pNumberCharEdit->GrabFocus();
if (bFootnote)
aFtnBtn.Check();
m_pFtnBtn->Check();
else
aEndNoteBtn.Check();
m_pEndNoteBtn->Check();
sal_Bool bNext = rSh.GotoNextFtnAnchor();
......@@ -278,8 +272,8 @@ void SwInsFootNoteDlg::Init()
if (bPrev)
rSh.GotoNextFtnAnchor();
aPrevBT.Enable(bPrev);
aNextBT.Enable(bNext);
m_pPrevBT->Enable(bPrev);
m_pNextBT->Enable(bNext);
rSh.Right(CRSR_SKIP_CHARS, sal_True, 1, sal_False );
......
/*
* 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 RB_NUMBER_AUTO 1
#define RB_NUMBER_CHAR 2
#define ED_NUMBER_CHAR 3
#define BT_NUMBER_CHAR 4
#define FL_NUMBER 5
#define FL_TYPE 6
#define RB_TYPE_FTN 7
#define RB_TYPE_ENDNOTE 8
#define BT_OK 100
#define BT_CANCEL 101
#define BT_HELP 102
#define BT_PREV 103
#define BT_NEXT 104
#define STR_CHAR 105
/*
* 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 "misc.hrc"
#include "insfnote.hrc"
#include "helpid.h"
ModalDialog DLG_INS_FOOTNOTE
{
HelpID = "sw:ModalDialog:DLG_INS_FOOTNOTE";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 160 , 100 ) ;
Text [ en-US ] = "Insert Footnote/Endnote" ;
Moveable = TRUE ;
Edit ED_NUMBER_CHAR
{
HelpID = "sw:Edit:DLG_INS_FOOTNOTE:ED_NUMBER_CHAR";
Disable = TRUE ;
Border = TRUE ;
Pos = MAP_APPFONT ( 69 , 27 ) ;
Size = MAP_APPFONT ( 23 , 12 ) ;
TabStop = TRUE ;
Group = TRUE ;
Left = TRUE ;
};
String STR_CHAR
{
Text [ en-US ] = "Character" ;
};
OKButton BT_OK
{
Pos = MAP_APPFONT ( 104 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Group = TRUE ;
DefButton = TRUE ;
};
CancelButton BT_CANCEL
{
Pos = MAP_APPFONT ( 104 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Group = TRUE ;
};
HelpButton BT_HELP
{
Pos = MAP_APPFONT ( 104 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Group = TRUE ;
};
ImageButton BT_PREV
{
HelpID = "sw:ImageButton:DLG_INS_FOOTNOTE:BT_PREV";
Pos = MAP_APPFONT ( 104 , 82 ) ;
Size = MAP_APPFONT ( 24 , 14 ) ;
TabStop = TRUE ;
Hide = TRUE ;
SYMBOL = IMAGEBUTTON_PREV ;
};
ImageButton BT_NEXT
{
HelpID = "sw:ImageButton:DLG_INS_FOOTNOTE:BT_NEXT";
Pos = MAP_APPFONT ( 130 , 82 ) ;
Size = MAP_APPFONT ( 24 , 14 ) ;
TabStop = TRUE ;
Hide = TRUE ;
SYMBOL = IMAGEBUTTON_NEXT ;
};
RadioButton RB_NUMBER_AUTO
{
HelpID = "sw:RadioButton:DLG_INS_FOOTNOTE:RB_NUMBER_AUTO";
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "~Automatic" ;
TabStop = TRUE ;
Group = TRUE ;
Check = TRUE ;
};
RadioButton RB_NUMBER_CHAR
{
HelpID = "sw:RadioButton:DLG_INS_FOOTNOTE:RB_NUMBER_CHAR";
Pos = MAP_APPFONT ( 12 , 27 ) ;
Size = MAP_APPFONT ( 54 , 10 ) ;
Text [ en-US ] = "~Character" ;
};
FixedLine FL_NUMBER
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 92 , 8 ) ;
Text [ en-US ] = "Numbering" ;
};
PushButton BT_NUMBER_CHAR
{
HelpID = "sw:PushButton:DLG_INS_FOOTNOTE:BT_NUMBER_CHAR";
Pos = MAP_APPFONT ( 69 , 42 ) ;
Size = MAP_APPFONT ( 12 , 12 ) ;
Text = "..." ;
};
RadioButton RB_TYPE_FTN
{
HelpID = "sw:RadioButton:DLG_INS_FOOTNOTE:RB_TYPE_FTN";
Pos = MAP_APPFONT ( 12 , 70 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
TabStop = TRUE ;
Group = TRUE ;
Check = TRUE ;
Text [ en-US ] = "~Footnote" ;
};
RadioButton RB_TYPE_ENDNOTE
{
HelpID = "sw:RadioButton:DLG_INS_FOOTNOTE:RB_TYPE_ENDNOTE";
Pos = MAP_APPFONT ( 12 , 83 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "~Endnote" ;
};
FixedLine FL_TYPE
{
Pos = MAP_APPFONT ( 6 , 60 ) ;
Size = MAP_APPFONT ( 92 , 8 ) ;
Text [ en-US ] = "Type" ;
};
};
This diff is collapsed.
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