1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_sc.hxx" 30 31 #undef SC_DLLIMPLEMENTATION 32 33 34 35 //------------------------------------------------------------------ 36 37 #include <tools/debug.hxx> 38 39 #include "strindlg.hxx" 40 #include "scresid.hxx" 41 #include "miscdlgs.hrc" 42 43 #include <layout/layout-pre.hxx> 44 45 #if ENABLE_LAYOUT 46 #undef ScResId 47 #define ScResId(x) #x 48 #undef ModalDialog 49 #define ModalDialog( parent, id ) Dialog( parent, "string-input.xml", id ) 50 #endif /* ENABLE_LAYOUT */ 51 52 //================================================================== 53 54 ScStringInputDlg::ScStringInputDlg( Window* pParent, 55 const String& rTitle, 56 const String& rEditTitle, 57 const String& rDefault, 58 const rtl::OString& sHelpId, const rtl::OString& sEditHelpId ) : 59 ModalDialog ( pParent, ScResId( RID_SCDLG_STRINPUT ) ), 60 // 61 aFtEditTitle ( this, ScResId( FT_LABEL ) ), 62 aEdInput ( this, ScResId( ED_INPUT ) ), 63 aBtnOk ( this, ScResId( BTN_OK ) ), 64 aBtnCancel ( this, ScResId( BTN_CANCEL ) ), 65 aBtnHelp ( this, ScResId( BTN_HELP ) ) 66 { 67 SetHelpId( sHelpId ); 68 SetText( rTitle ); 69 aFtEditTitle.SetText( rEditTitle ); 70 aEdInput.SetText( rDefault ); 71 aEdInput.SetSelection(Selection(SELECTION_MIN, SELECTION_MAX)); 72 aEdInput.SetHelpId( sEditHelpId ); 73 //------------- 74 FreeResource(); 75 } 76 77 //------------------------------------------------------------------------ 78 79 void ScStringInputDlg::GetInputString( String& rString ) const 80 { 81 rString = aEdInput.GetText(); 82 } 83 84 __EXPORT ScStringInputDlg::~ScStringInputDlg() 85 { 86 } 87 88 89 90