1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: ctrl_TextControl.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 07:43:41 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : marc.neumann@sun.com
36 '* short description : Text Control
38 '\***********************************************************************
44 call tRichTextControlDraw
47 '--------------------------------------------------------------------------------------
50 '/// Open a new document,
51 printlog "Open a new document,"
53 Kontext "DocumentWriter"
54 DocumentWriter.TypeKeys "tt_doc" , true
57 call hToolbarSelect("FormControls",true)
59 Kontext "FormControls"
62 '/// insert a text box
63 printlog "insert a text box"
64 call hDrawingWithSelection ( 50, 20, 60, 30 )
66 Kontext "FormControls"
67 ControlProperties.Click
69 '/// set properties: Background color, Horizontal scrollbar, Vertical scrollbar, Password
70 printlog "set properties"
71 fsetControlProperty("TextBox","Background","92")
72 fsetControlProperty("TextBox","TextType","3")
73 '/// save the document
74 printlog "save the document"
75 hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_TextBox.odt"))
78 '/// reload the document
79 printlog "reload the document"
80 hFileOpen ( gOfficePath + ConvertPath("user/work/TT_TextBox.odt"))
82 call hToolbarSelect("FormControls",true)
84 Kontext "FormControls"
85 SwitchControlDesignMode.Click
86 Kontext "DocumentWriter"
87 DocumentWriter.TypeKeys "<SHIFT F4>"
89 Kontext "FormControls"
91 ControlProperties.Click
93 warnlog "error while open the control properties browser"
97 '/// check if the values are saved
98 printlog "check if the values are saved"
100 if fgetControlProperty("TextBox","Background") <> "92" then
101 warnlog "the value: background is not saved"
104 if fgetControlProperty("TextBox","TextType") <> "3" then
105 warnlog "the value: TextType is not saved"
110 '--------------------------------------------------------------------------------------
111 testcase tRichTextControl
113 '/// Open a new document,
114 printlog "Open a new document,"
116 Kontext "DocumentWriter"
117 DocumentWriter.TypeKeys "tt_doc" , true
120 call hToolbarSelect("FormControls",true)
122 Kontext "FormControls"
125 '/// insert a text box
126 printlog "insert a text box"
127 call hDrawingWithSelection ( 50, 20, 60, 30 )
129 Kontext "FormControls"
130 ControlProperties.Click
132 '/// set properties: Background color, Horizontal scrollbar, Vertical scrollbar, Password
133 printlog "set properties"
134 fsetControlProperty("TextBox","TextType","3")
135 '/// turn off the design view
136 printlog "turn off the design view"
138 call hToolbarSelect("FormControls",true)
140 Kontext "FormControls"
141 SwitchControlDesignMode.Click
142 '/// insert some text in the control
143 printlog "insert some text in the control"
144 Kontext "DocumentWriter"
146 DocumentWriter.TypeKeys "<MOD1 F5>" , true
148 DocumentWriter.TypeKeys "this is a blind text" , true
150 DocumentWriter.TypeKeys "<SHIFT MOD1 LEFT>" ,2, true
152 FormatStyleStrikeThrough
154 '/// save the document
155 printlog "save the document"
156 hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_RichTextBox.odt"))
159 '/// reload the document
160 printlog "reload the document"
161 hFileOpen ( gOfficePath + ConvertPath("user/work/TT_RichTextBox.odt"))
162 Kontext "DocumentWriter"
163 DocumentWriter.TypeKeys "<MOD1 F5>" , true
164 qaerrorlog "workaround for issue 102010"
165 DocumentWriter.TypeKeys "<RIGHT>" , true
166 DocumentWriter.TypeKeys "<LEFT>" , true
168 DocumentWriter.TypeKeys "<MOD1 SHIFT END>" , true
170 DocumentWriter.TypeKeys "<MOD1 C>" , true
172 'printlog "getClipboard = " + getClipboard
173 if ( getClipboard <> "this is a blind text" ) then
174 warnlog "The text in the control is not saved (" + getClipboard() + ")"
176 DocumentWriter.TypeKeys "<END>" , true
178 DocumentWriter.TypeKeys "<SHIFT MOD1 LEFT>" ,2, true
182 active.SetPage TabFontEffects
183 Kontext "TabFontEffects"
184 if StrikeThrough.getSelIndex() <> 2 then
185 warnlog "StrikeThrought is not set"
187 printlog "StrikeThrought is set"
189 TabFontEffects.Cancel
195 '--------------------------------------------------------------------------------------
196 testcase tRichTextControlDraw
198 '/// Open a new document,
199 printlog "Open a new document,"
200 gApplication = "DRAW"
202 Kontext "DocumentDraw"
203 DocumentDraw.TypeKeys "tt_doc" , true
206 call hToolbarSelect("FormControls",true)
208 Kontext "DocumentDraw"
209 DocumentDraw.MouseDown ( 20, 20 )
211 DocumentDraw.MouseUp ( 20, 20 )
213 Kontext "FormControls"
217 call hDrawingWithSelection ( 50, 20, 60, 30 )
219 Kontext "FormControls"
220 ControlProperties.Click
222 '/// set properties: Background color, Horizontal scrollbar, Vertical scrollbar, Password
223 printlog "set properties"
224 fsetControlProperty("TextBox","TextType","3")
225 '/// turn off the design view
226 printlog "turn off the design view"
228 printlog "close control property browser"
229 Kontext "ControlPropertiesDialog"
230 ControlPropertiesDialog.close
232 call hToolbarSelect("FormControls",true)
234 Kontext "FormControls"
235 SwitchControlDesignMode.Click
236 '/// insert some text in the control
237 printlog "insert some text in the control"
238 Kontext "DocumentDraw"
240 DocumentDraw.TypeKeys "<MOD1 F5>" , true
242 DocumentDraw.TypeKeys "<MOD1 F5>" , true
244 DocumentDraw.TypeKeys "this is a blind text" , true
246 DocumentDraw.TypeKeys "<SHIFT MOD1 LEFT>" ,2, true
248 FormatStyleStrikeThrough
250 '/// save the document
251 printlog "save the document"
252 hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_RichTextBox.odg"),gDrawFilter)
255 '/// reload the document
256 printlog "reload the document"
257 hFileOpen ( gOfficePath + ConvertPath("user/work/TT_RichTextBox.odg"))
258 Kontext "DocumentDraw"
259 DocumentDraw.TypeKeys "<MOD1 F5>" , true
261 DocumentDraw.TypeKeys "<MOD1 F5>" , true
262 qaerrorlog "workaround for issue 102010"
263 DocumentDraw.TypeKeys "<RIGHT>" , true
264 DocumentDraw.TypeKeys "<LEFT>" , true
266 DocumentDraw.TypeKeys "<MOD1 SHIFT END>" , true
268 DocumentDraw.TypeKeys "<MOD1 C>" , true
270 printlog "getClipboard = " + getClipboard
271 if ( getClipboard <> "this is a blind text" ) then
272 warnlog "The text in the control is not saved"
274 DocumentDraw.TypeKeys "<END>" , true
276 DocumentDraw.TypeKeys "<SHIFT MOD1 LEFT>" ,2, true
280 active.SetPage TabFontEffects
281 Kontext "TabFontEffects"
282 if StrikeThrough.getSelIndex() <> 2 then
283 warnlog "StrikeThrought is not set (issue 32921)"
285 printlog "StrikeThrought is set"
287 TabFontEffects.Cancel
293 '--------------------------------------------------------------------------------------
294 '--------------------------------------------------------------------------------------
295 '--------------------------------------------------------------------------------------