xref: /aoo42x/main/sc/source/ui/miscdlgs/strindlg.cxx (revision a479921a)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_scui.hxx"
26 
27 
28 
29 
30 //------------------------------------------------------------------
31 
32 #include <tools/debug.hxx>
33 
34 #include "strindlg.hxx"
35 #include "scresid.hxx"
36 #include "miscdlgs.hrc"
37 
38 #include <layout/layout-pre.hxx>
39 
40 #if ENABLE_LAYOUT
41 #undef ScResId
42 #define ScResId(x) #x
43 #undef ModalDialog
44 #define ModalDialog( parent, id ) Dialog( parent, "string-input.xml", id )
45 #endif /* ENABLE_LAYOUT */
46 
47 //==================================================================
48 
ScStringInputDlg(Window * pParent,const String & rTitle,const String & rEditTitle,const String & rDefault,const rtl::OString & sHelpId,const rtl::OString & sEditHelpId)49 ScStringInputDlg::ScStringInputDlg( Window*         pParent,
50 									const String&   rTitle,
51 									const String&   rEditTitle,
52 									const String&   rDefault,
53 									const rtl::OString& sHelpId, const rtl::OString& sEditHelpId    ) :
54 	ModalDialog     ( pParent, ScResId( RID_SCDLG_STRINPUT ) ),
55 	//
56 	aFtEditTitle    ( this, ScResId( FT_LABEL ) ),
57 	aEdInput        ( this, ScResId( ED_INPUT ) ),
58 	aBtnOk          ( this, ScResId( BTN_OK ) ),
59 	aBtnCancel      ( this, ScResId( BTN_CANCEL ) ),
60 	aBtnHelp        ( this, ScResId( BTN_HELP ) )
61 {
62 	SetHelpId( sHelpId );
63 	SetText( rTitle );
64 	aFtEditTitle.SetText( rEditTitle );
65     aEdInput.SetText( rDefault );
66     aEdInput.SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
67     aEdInput.SetHelpId( sEditHelpId );
68 	//-------------
69 	FreeResource();
70 }
71 
72 //------------------------------------------------------------------------
73 
GetInputString(String & rString) const74 void ScStringInputDlg::GetInputString( String& rString ) const
75 {
76 	rString = aEdInput.GetText();
77 }
78 
~ScStringInputDlg()79 __EXPORT ScStringInputDlg::~ScStringInputDlg()
80 {
81 }
82 
83 
84 
85