diff options
Diffstat (limited to 'sw/source/ui/fldui')
-rw-r--r-- | sw/source/ui/fldui/inpdlg.cxx | 65 | ||||
-rw-r--r-- | sw/source/ui/fldui/inpdlg.hrc | 28 | ||||
-rw-r--r-- | sw/source/ui/fldui/inpdlg.src | 95 |
3 files changed, 23 insertions, 165 deletions
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: */ |