summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx19
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx5
-rw-r--r--sw/source/ui/fldui/inpdlg.cxx65
-rw-r--r--sw/source/ui/fldui/inpdlg.hrc28
-rw-r--r--sw/source/ui/fldui/inpdlg.src95
-rw-r--r--sw/source/ui/inc/inpdlg.hxx24
-rw-r--r--sw/source/ui/wrtsh/wrtsh2.cxx3
7 files changed, 40 insertions, 199 deletions
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index fb7a53c7a3d2..3fc1ef096442 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -1069,22 +1069,11 @@ AbstractGlossaryDlg* SwAbstractDialogFactory_Impl::CreateGlossaryDlg(SfxViewFram
return new AbstractGlossaryDlg_Impl( pDlg );
}
-AbstractFldInputDlg* SwAbstractDialogFactory_Impl::CreateFldInputDlg( int nResId,
- Window *pParent, SwWrtShell &rSh,
- SwField* pField, sal_Bool bNextButton ) //add for SwFldInputDlg
+AbstractFldInputDlg* SwAbstractDialogFactory_Impl::CreateFldInputDlg(Window *pParent,
+ SwWrtShell &rSh, SwField* pField, bool bNextButton) //add for SwFldInputDlg
{
- SwFldInputDlg* pDlg=NULL;
- switch ( nResId )
- {
- case DLG_FLD_INPUT :
- pDlg = new SwFldInputDlg( pParent, rSh, pField, bNextButton );
- break;
- default:
- break;
- }
- if ( pDlg )
- return new AbstractFldInputDlg_Impl( pDlg );
- return 0;
+ SwFldInputDlg* pDlg = new SwFldInputDlg( pParent, rSh, pField, bNextButton );
+ return new AbstractFldInputDlg_Impl( pDlg );
}
AbstractInsFootNoteDlg* SwAbstractDialogFactory_Impl::CreateInsFootNoteDlg(
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 9b681008e0f2..cf74c83df6d1 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -509,9 +509,8 @@ public:
virtual AbstractGlossaryDlg* CreateGlossaryDlg(SfxViewFrame* pViewFrame,
SwGlossaryHdl* pGlosHdl,
SwWrtShell *pWrtShell); //add for SwGlossaryDlg
- virtual AbstractFldInputDlg* CreateFldInputDlg( int nResId,
- Window *pParent, SwWrtShell &rSh,
- SwField* pField, sal_Bool bNextButton = sal_False ); //add for SwFldInputDlg
+ virtual AbstractFldInputDlg* CreateFldInputDlg(Window *pParent,
+ SwWrtShell &rSh, SwField* pField, bool bNextButton = false); //add for SwFldInputDlg
virtual AbstractInsFootNoteDlg* CreateInsFootNoteDlg(
Window * pParent, SwWrtShell &rSh, sal_Bool bEd = sal_False); //add for SwInsFootNoteDlg
virtual VclAbstractDialog * CreateTitlePageDlg ( Window * pParent );
diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx
index 1b4dbe07d0a5..c6e63403f704 100644
--- a/sw/source/ui/fldui/inpdlg.cxx
+++ b/sw/source/ui/fldui/inpdlg.cxx
@@ -29,48 +29,34 @@
#include <fldmgr.hxx>
#include <fldui.hrc>
-#include <inpdlg.hrc>
-
/*--------------------------------------------------------------------
Description: edit field-insert
--------------------------------------------------------------------*/
SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS,
- SwField* pField, sal_Bool bNextButton ) :
-
- SvxStandardDialog(pParent, SW_RES(DLG_FLD_INPUT)),
-
- rSh( rS ),
- pInpFld(0),
- pSetFld(0),
- pUsrType(0),
-
- aLabelED (this, SW_RES(ED_LABEL )),
- aEditED (this, SW_RES(ED_EDIT )),
- aEditFL (this, SW_RES(FL_EDIT )),
-
- aOKBT (this, SW_RES(BT_OK )),
- aCancelBT (this, SW_RES(BT_CANCEL )),
- aNextBT (this, SW_RES(PB_NEXT )),
- aHelpBT (this, SW_RES(PB_HELP ))
+ SwField* pField, sal_Bool bNextButton )
+ : SvxStandardDialog( pParent, "InputFieldDialog",
+ "modules/swriter/ui/inputfielddialog.ui")
+ , rSh( rS )
+ , pInpFld(0)
+ , pSetFld(0)
+ , pUsrType(0)
{
+ get(m_pLabelED, "name");
+ get(m_pEditED, "text");
+ m_pEditED->set_height_request(m_pEditED->GetTextHeight() * 9);
+ get(m_pNextBT, "next");
+ get(m_pOKBT, "ok");
// switch font for Edit
- Font aFont(aEditED.GetFont());
+ Font aFont(m_pEditED->GetFont());
aFont.SetWeight(WEIGHT_LIGHT);
- aEditED.SetFont(aFont);
+ m_pEditED->SetFont(aFont);
if( bNextButton )
{
- aNextBT.Show();
- aNextBT.SetClickHdl(LINK(this, SwFldInputDlg, NextHdl));
- }
- else
- {
- long nDiff = aCancelBT.GetPosPixel().Y() - aOKBT.GetPosPixel().Y();
- Point aPos = aHelpBT.GetPosPixel();
- aPos.Y() -= nDiff;
- aHelpBT.SetPosPixel(aPos);
+ m_pNextBT->Show();
+ m_pNextBT->SetClickHdl(LINK(this, SwFldInputDlg, NextHdl));
}
// evaluation here
@@ -79,7 +65,7 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS,
{ // it is an input field
//
pInpFld = (SwInputField*)pField;
- aLabelED.SetText( pInpFld->GetPar2() );
+ m_pLabelED->SetText( pInpFld->GetPar2() );
sal_uInt16 nSubType = pInpFld->GetSubType();
switch(nSubType & 0xff)
@@ -109,29 +95,24 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS,
}
else
aStr = sFormula;
- aLabelED.SetText( pSetFld->GetPromptText() );
+ m_pLabelED->SetText( pSetFld->GetPromptText() );
}
// JP 31.3.00: Inputfields in readonly regions must be allowed to
// input any content. - 74639
sal_Bool bEnable = !rSh.IsCrsrReadonly();
- aOKBT.Enable( bEnable );
- aEditED.SetReadOnly( !bEnable );
+ m_pOKBT->Enable( bEnable );
+ m_pEditED->SetReadOnly( !bEnable );
if( aStr.Len() )
- aEditED.SetText(convertLineEnd(aStr, GetSystemLineEnd()));
- FreeResource();
-}
-
-SwFldInputDlg::~SwFldInputDlg()
-{
+ m_pEditED->SetText(convertLineEnd(aStr, GetSystemLineEnd()));
}
void SwFldInputDlg::StateChanged( StateChangedType nType )
{
if ( nType == STATE_CHANGE_INITSHOW )
- aEditED.GrabFocus();
+ m_pEditED->GrabFocus();
SvxStandardDialog::StateChanged( nType );
}
@@ -141,7 +122,7 @@ void SwFldInputDlg::StateChanged( StateChangedType nType )
void SwFldInputDlg::Apply()
{
- OUString aTmp(comphelper::string::remove(aEditED.GetText(), '\r'));
+ OUString aTmp(comphelper::string::remove(m_pEditED->GetText(), '\r'));
rSh.StartAllAction();
bool bModified = false;
diff --git a/sw/source/ui/fldui/inpdlg.hrc b/sw/source/ui/fldui/inpdlg.hrc
deleted file mode 100644
index c5e52c93fa0e..000000000000
--- a/sw/source/ui/fldui/inpdlg.hrc
+++ /dev/null
@@ -1,28 +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_LABEL 1
-#define ED_EDIT 3
-#define FL_EDIT 4
-#define BT_OK 5
-#define BT_CANCEL 6
-#define ED_LABEL 7
-#define PB_NEXT 8
-#define PB_HELP 9
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/inpdlg.src b/sw/source/ui/fldui/inpdlg.src
deleted file mode 100644
index 4a816c053133..000000000000
--- a/sw/source/ui/fldui/inpdlg.src
+++ /dev/null
@@ -1,95 +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 "fldui.hrc"
-#include "inpdlg.hrc"
-#include "helpid.h"
-ModalDialog DLG_FLD_INPUT
-{
- HelpID = HID_FLD_INPUT ;
- OutputSize = TRUE ;
- Hide = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 194 , 119 ) ;
- Text [ en-US ] = "Input Field" ;
- Moveable = TRUE ;
- /* FixedText FT_LABEL
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 115 , 8 ) ;
- Text [ en-US ] = "Input" ;
- Left = TRUE ;
- };*/
- Edit ED_LABEL
- {
- HelpID = "sw:Edit:DLG_FLD_INPUT:ED_LABEL";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 115 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Text [ en-US ] = "Input" ;
- Readonly = TRUE ;
- };
- MultiLineEdit ED_EDIT
- {
- HelpID = "sw:MultiLineEdit:DLG_FLD_INPUT:ED_EDIT";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 32 ) ;
- Size = MAP_APPFONT ( 115 , 72 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- };
- FixedLine FL_EDIT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 127 , 8 ) ;
- Text [ en-US ] = "Edit" ;
- };
- OKButton BT_OK
- {
- Pos = MAP_APPFONT ( 139 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 15 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BT_CANCEL
- {
- Pos = MAP_APPFONT ( 139 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 15 ) ;
- TabStop = TRUE ;
- };
- PushButton PB_NEXT
- {
- HelpID = "sw:PushButton:DLG_FLD_INPUT:PB_NEXT";
- Pos = MAP_APPFONT ( 139 , 40 ) ;
- Size = MAP_APPFONT ( 50 , 15 ) ;
- TabStop = TRUE ;
- Hide = TRUE ;
- Text [ en-US ] = "~Next" ;
- };
- HelpButton PB_HELP
- {
- Pos = MAP_APPFONT ( 139 , 60 ) ;
- Size = MAP_APPFONT ( 50 , 15 ) ;
- TabStop = TRUE ;
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/inpdlg.hxx b/sw/source/ui/inc/inpdlg.hxx
index 7fd995ca31c0..09ec01c55940 100644
--- a/sw/source/ui/inc/inpdlg.hxx
+++ b/sw/source/ui/inc/inpdlg.hxx
@@ -21,9 +21,9 @@
#include <svx/stddlg.hxx>
-#include <svtools/svmedit.hxx>
-#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/vclmedit.hxx>
class SwInputField;
class SwSetExpField;
@@ -40,26 +40,22 @@ class SwFldInputDlg: public SvxStandardDialog
virtual void Apply();
virtual void StateChanged( StateChangedType );
- SwWrtShell &rSh;
- SwInputField* pInpFld;
- SwSetExpField* pSetFld;
- SwUserFieldType* pUsrType;
+ SwWrtShell& rSh;
+ SwInputField* pInpFld;
+ SwSetExpField* pSetFld;
+ SwUserFieldType* pUsrType;
- Edit aLabelED;
+ Edit* m_pLabelED;
- MultiLineEdit aEditED;
- FixedLine aEditFL;
+ VclMultiLineEdit* m_pEditED;
- OKButton aOKBT;
- CancelButton aCancelBT;
- PushButton aNextBT;
- HelpButton aHelpBT;
+ OKButton* m_pOKBT;
+ PushButton* m_pNextBT;
DECL_LINK(NextHdl, void *);
public:
SwFldInputDlg( Window *pParent, SwWrtShell &rSh,
SwField* pField, sal_Bool bNextButton = sal_False );
- ~SwFldInputDlg();
};
diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx
index 9aa908f31eb2..0b63e130f7d6 100644
--- a/sw/source/ui/wrtsh/wrtsh2.cxx
+++ b/sw/source/ui/wrtsh/wrtsh2.cxx
@@ -142,8 +142,7 @@ sal_Bool SwWrtShell::StartInputFldDlg( SwField* pFld, sal_Bool bNextButton,
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
- AbstractFldInputDlg* pDlg = pFact->CreateFldInputDlg( DLG_FLD_INPUT,
- pParentWin, *this, pFld, bNextButton);
+ AbstractFldInputDlg* pDlg = pFact->CreateFldInputDlg(pParentWin, *this, pFld, bNextButton);
OSL_ENSURE(pDlg, "Dialogdiet fail!");
if(pWindowState && !pWindowState->isEmpty())
pDlg->SetWindowState(*pWindowState);