xref: /aoo41x/main/sc/source/ui/miscdlgs/strindlg.cxx (revision b3f79822)
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_sc.hxx"
26 
27 #undef SC_DLLIMPLEMENTATION
28 
29 
30 
31 //------------------------------------------------------------------
32 
33 #include <tools/debug.hxx>
34 
35 #include "strindlg.hxx"
36 #include "scresid.hxx"
37 #include "miscdlgs.hrc"
38 
39 #include <layout/layout-pre.hxx>
40 
41 #if ENABLE_LAYOUT
42 #undef ScResId
43 #define ScResId(x) #x
44 #undef ModalDialog
45 #define ModalDialog( parent, id ) Dialog( parent, "string-input.xml", id )
46 #endif /* ENABLE_LAYOUT */
47 
48 //==================================================================
49 
ScStringInputDlg(Window * pParent,const String & rTitle,const String & rEditTitle,const String & rDefault,const rtl::OString & sHelpId,const rtl::OString & sEditHelpId)50 ScStringInputDlg::ScStringInputDlg( Window*         pParent,
51 									const String&   rTitle,
52 									const String&   rEditTitle,
53 									const String&   rDefault,
54 									const rtl::OString& sHelpId, const rtl::OString& sEditHelpId    ) :
55 	ModalDialog     ( pParent, ScResId( RID_SCDLG_STRINPUT ) ),
56 	//
57 	aFtEditTitle    ( this, ScResId( FT_LABEL ) ),
58 	aEdInput        ( this, ScResId( ED_INPUT ) ),
59 	aBtnOk          ( this, ScResId( BTN_OK ) ),
60 	aBtnCancel      ( this, ScResId( BTN_CANCEL ) ),
61 	aBtnHelp        ( this, ScResId( BTN_HELP ) )
62 {
63 	SetHelpId( sHelpId );
64 	SetText( rTitle );
65 	aFtEditTitle.SetText( rEditTitle );
66     aEdInput.SetText( rDefault );
67     aEdInput.SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
68     aEdInput.SetHelpId( sEditHelpId );
69 	//-------------
70 	FreeResource();
71 }
72 
73 //------------------------------------------------------------------------
74 
GetInputString(String & rString) const75 void ScStringInputDlg::GetInputString( String& rString ) const
76 {
77 	rString = aEdInput.GetText();
78 }
79 
~ScStringInputDlg()80 __EXPORT ScStringInputDlg::~ScStringInputDlg()
81 {
82 }
83 
84 
85 
86