summaryrefslogtreecommitdiff
path: root/testautomation/dbaccess/optional/includes/ctrl_Several2.inc
blob: 82fa9229b1f81006815dab9d82b2c623d3a9c03b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
'encoding UTF-8  Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU Lesser General Public License version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org.  If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* owner : marc.neumann@oracle.com
'*
'* short description : Control Serveral Part 2 (more controls) - check each control and each property
'*
'\***********************************************************************

sub ctrl_Several2
	
    call fSwitchAutopilotOff(true)  ' has to run first to switch off the autopilot
    
    call tSpinButton       ' tested properties: Repeat, Name, Symbol color (disabled bug:i39944), Background color
    call tScrollBar        ' tested properties: Scroll value min, Scroll value max, Default Scroll value, Orientation, Line increment (small change), Block increment (large change), Delay, Visible Size
    call tImageButton      ' tested properties: Scale, Frame (disabled bug:i39970)
    call tImageControl     ' tested properties: Help URL
    call tFileControl      ' tested properties: Border, Tabstop
    call tDateField        ' tested properties: Date max, Date min, Date format, Dropdown
    call tTimeField        ' tested properties: Time min, Time max, Time format
    call tNumericField     ' tested properties: Spin Button, Strict format, Thousands Seperator, Value step
    call tCurrencyField    ' tested properties: Inc/dec value, Prefix symbol, Currency symbol, Accuracy
    call tPatternField     ' tested properties: Read only, Edit mask, Literal mask, Order
    call tGroupBox         ' tested properties: Character set, Label
    call tTableControl     ' tested properties: Navigation bar, Record marker, Row high
    call tNavigationBar    ' tested properties: IconSize, Positioning, Navigation, RecordActions, FilteringSorting
    
    call fSwitchAutopilotOff(false)
    
end sub


'--------------------------------------------------------------------------------------

testcase tSpinButton
	
    '/// Open a new document,
        printlog "Open a new document,"
        call hNewDocument
    Kontext "DocumentWriter"       
	    DocumentWriter.TypeKeys "tt_doc" , true
        sleep(1)    
        call addControl ( "SpinButton", 50, 20, 60, 30 )
        sleep(2)
    '/// open the control property browser
	call fOpenControlPropertyBrowser
    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
        sleep(2)
    '/// set properties: Repeat, Name
        printlog "set properties"  
        call fsetControlProperty("ScrollBar","Repeat","1")           'listbox property: no
        call fsetControlProperty("ScrollBar","NameText","Changed")
        call fsetControlProperty("ScrollBar","Background","55")
    '/// save the document
    printlog "save the document"
    hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_Spinbutton.odt"))
	hCloseDocument
    sleep(1)
    '/// reload the document
    printlog "reload the document"
	hFileOpen ( gOfficePath + ConvertPath("user/work/TT_Spinbutton.odt"))
    Kontext "Toolbar"
	    call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
        call fSwitchControlDesignMode
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
    
    call fOpenControlPropertyBrowser     
        
    '/// check if inserted property values are saved right
    printlog "check if property values are inserted"
    Kontext "TabGeneralControl"	
        dim bScrOK as boolean       'control variable if all properties are correct
        bScrOK = true           
    if fgetControlProperty("Spinbutton","Repeat") <> "1" then
        warnlog "the spinbutton is not saved with property: Repeat"
        bScrOK = false
    endif
    if fgetControlProperty("Spinbutton","NameText") <> "Changed" then
        warnlog "the spinbutton is not saved with property: NameText"
        bScrOK = false
    endif
    if fgetControlProperty("Spinbutton","Background") <> "55" then
        warnlog "the spinbutton is not saved with property: Background"
        bScrOK = false
    endif
    if bScrOK = true then printlog "Spinbutton was saved correctly"
        sleep(1)  
    
    call closePropertyBrowserAndDocument()
       
endcase
'--------------------------------------------------------------------------------------

testcase tScrollBar
	
    dim sMem as string      'comparing variable
    
    '/// Open a new document,
        printlog "Open a new document,"
        call hNewDocument
    Kontext "DocumentWriter"       
        DocumentWriter.TypeKeys "tt_doc" , true
        sleep(1)       	
   	    call addControl("ScrollBar", 50, 20, 60, 30 )        
    
    printlog "open the control property browser"
    call fOpenControlPropertyBrowser	    
        
    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
        sleep(2)
    '/// set properties: Scroll value min, Scroll value max, Default Scroll value, Orientation, Line increment, Block increment, Delay, symbol color, Visible Size
        printlog "set properties"  
        call fsetControlProperty("ScrollBar","ScrollValueMin","10")
        call fsetControlProperty("ScrollBar","ScrollValueMax","90")
        call fsetControlProperty("ScrollBar","ScrollValueDefault","5")
        call fsetControlProperty("ScrollBar","Orientation","2")           'listbox property: vertical
        call fsetControlProperty("ScrollBar","LineIncrement","10")
        call fsetControlProperty("ScrollBar","BlockIncrement","25")
        call fsetControlProperty("ScrollBar","Delay","100")
        TabGeneralControl.TypeKeys "<RETURN>" , true            'an ms is added to 100 -> 100ms
        sMem = fgetControlProperty("ScrollBar","Delay")    
        call fsetControlProperty("ScrollBar","VisibleSize","10")    
    
    '/// save the document
    printlog "save the document"
    hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_Scrollbar.odt"))
    hCloseDocument    
    
    '/// reload the document
    printlog "reload the document"
    hFileOpen ( gOfficePath + ConvertPath("user/work/TT_Scrollbar.odt"))
    
    Kontext "Toolbar"
	    call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
        call fSwitchControlDesignMode
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
        
    call fOpenControlPropertyBrowser    
    
    '/// check if inserted property values are saved right
        printlog "check if property values are inserted"
    Kontext "TabGeneralControl"	
        dim bScrOK as boolean       'control variable if all properties are correct
        bScrOK = true           
    if fgetControlProperty("ScrollBar","ScrollValueMin") <> "10" then
        warnlog "the scrollbar is not saved with property: ScrollValueMin"
        bScrOK = false
    endif
    if fgetControlProperty("ScrollBar","ScrollValueMax") <> "90" then
        warnlog "the scrollbar is not saved with property: ScrollValueMax"
        bScrOK = false
    endif
    if fgetControlProperty("ScrollBar","ScrollValueDefault") <> "5" then
        warnlog "the scrollbar is not saved with property: ScrollValueDefault"
        bScrOK = false
    endif
    if fgetControlProperty("ScrollBar","Orientation") <> "2" then
        warnlog "the scrollbar is not saved with property: Orientation"
        bScrOK = false
    endif
    if fgetControlProperty("ScrollBar","LineIncrement") <> "10" then
        warnlog "the scrollbar is not saved with property: LineIncrement"
        bScrOK = false
    endif
    if fgetControlProperty("ScrollBar","BlockIncrement") <> "25" then
        warnlog "the scrollbar is not saved with property: BlockIncrement"
        bScrOK = false
    endif
    if fgetControlProperty("ScrollBar","Delay") <> sMem then
        warnlog "the scrollbar is not saved with property: Delay"
        bScrOK = false
    endif
    if fgetControlProperty("ScrollBar","VisibleSize") <> "10" then
        warnlog "the scrollbar is not saved with property: VisibleSize"
        bScrOK = false
    endif
    if bScrOK = true then printlog "Scrollbar was saved correctly"
        sleep(1)   
    
    call closePropertyBrowserAndDocument()
        
endcase
'--------------------------------------------------------------------------------------

testcase tImageButton
    
    '/// Open a new document,
        printlog "Open a new document,"
	call hNewDocument
    Kontext "DocumentWriter"       
	    DocumentWriter.TypeKeys "tt_doc" , true
        
	call addControl("ImageButton", 50, 20, 60, 30 )
        
	printlog "open the control property browser"
    call fOpenControlPropertyBrowser
    
    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
        sleep(2)
    '/// set properties
         printlog "set properties" 
    'to activate property: scale, following properties must be active: Graphics (with choosen path)
    Kontext "TabGeneralControl"	
    fsetControlProperty("ImageButton","Graphics", gOfficePath + ConvertPath("share/gallery/bullets/blkpearl.gif"))
    
    sleep(1)
        TabGeneralControl.TypeKeys "<RETURN>" , true
        fsetControlProperty("ImageControl","Scale","1")          'listbox content: no   
        'fsetControlProperty("ImageControl","Frame","4")
    '/// save the document
        printlog "save the document"
        hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_ImageButton.odt"))
	hCloseDocument
        sleep(1)
    '/// reload and prepare the document
        printlog "reload the document"
	hFileOpen ( gOfficePath + ConvertPath("user/work/TT_ImageButton.odt"))
    Kontext "Toolbar"
	    call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
        call fSwitchControlDesignMode
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
    call fOpenControlPropertyBrowser
    '/// check if property values are inserted
        printlog "check if property values are inserted"
    Kontext "TabGeneralControl"	
        dim bScrOK as boolean       'control variable if all properties are correct
        bScrOK = true   
    if fgetControlProperty("ImageButton","Scale") <> "1" then
        warnlog "the imagebutton is not saved with property: Frame"
        bScrOK = false
    endif        
    'if fgetControlProperty("ImageButton","Frame") <> "4" then
        'warnlog "the imagebutton is not saved with property: Frame"
        'bScrOK = false
    'endif
    if bScrOK = true then printlog "Imagebutton was saved correctly"
        
    call closePropertyBrowserAndDocument()
           
endcase
'--------------------------------------------------------------------------------------
testcase tImageControl     
    
    '/// Open a new document,
        printlog "Open a new document,"
	call hNewDocument
    Kontext "DocumentWriter"       
	    DocumentWriter.TypeKeys "tt_doc" , true
    
    call addControl("ImageControl", 50, 20, 60, 30 )
    
    printlog "open the control property browser"
    call fOpenControlPropertyBrowser

    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
        sleep(2)
    '/// set HelpURL 
        printlog "set HelpURL"
        fsetControlProperty("ImageControl","HelpURL","HID:1234567")    
    '/// save the document
        printlog "save the document"
        hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_ImageControl.odt"))
	hCloseDocument
        sleep(1)
    '/// reload and prepare the document
        printlog "reload the document"
	hFileOpen ( gOfficePath + ConvertPath("user/work/TT_ImageControl.odt"))
    Kontext "Toolbar"
	    call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
        call fSwitchControlDesignMode
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
    call fOpenControlPropertyBrowser
    '/// check if property values are inserted
        printlog "check if property values are inserted"
    Kontext "TabGeneralControl"	
        dim bScrOK as boolean       'control variable if all properties are correct
        bScrOK = true           
    if fgetControlProperty("ImageControl","HelpURL") <> "HID:1234567" then
        warnlog "the imagecontrol is not saved with property: HelpURL"
        bScrOK = false
    endif
    if bScrOK = true then printlog "Imagecontrol was saved correctly"
        sleep(1)   

     call closePropertyBrowserAndDocument()
   
endcase
'--------------------------------------------------------------------------------------

testcase tFileControl
	
    '/// Open a new document,
        printlog "Open a new document,"
	call hNewDocument
    Kontext "DocumentWriter"       
	    DocumentWriter.TypeKeys "tt_doc" , true
        
    call addControl("FileControl", 50, 20, 60, 30 )
    
    printlog "open the control property browser"
    call fOpenControlPropertyBrowser

    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
        sleep(2)
    '/// set properties: border to flat, tabstop to no    
        printlog "set border to flat"        	
        fsetControlProperty("FileControl","Border","3")	
        fsetControlProperty("FileControl","TabStop","1")
    '/// save the document
        printlog "save the document"
        hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_FileControl.odt"))
	hCloseDocument
        sleep(1)
    '/// reload the document
        printlog "reload the document"
	hFileOpen ( gOfficePath + ConvertPath("user/work/TT_FileControl.odt"))    
    Kontext "Toolbar"
	    call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
  	call fSwitchControlDesignMode
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
    call fOpenControlPropertyBrowser
    '/// check if the values are saved
        printlog "check if the values are saved"
        sleep(2)
    Kontext "TabGeneralControl"    
	    TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't know why but it is.
    if fgetControlProperty("FileControl","Border") <> "3" then
        warnlog "the value border is not saved"
    endif  
    if fgetControlProperty("FileControl","TabStop") <> "1" then
        warnlog "the value border is not saved"
    endif  
    
    call closePropertyBrowserAndDocument()
    
endcase
'--------------------------------------------------------------------------------------

testcase tDateField
	
    '/// Open a new document,
        printlog "Open a new document,"
	call hNewDocument
    Kontext "DocumentWriter"       
	    DocumentWriter.TypeKeys "tt_doc" , true
        
    call addControl("DateField", 50, 20, 60, 30 )
    
    printlog "open the control property browser"
    call fOpenControlPropertyBrowser

    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
        sleep(2)
    '/// set DateMin to 09/09/2009 and DateMax to 10/10/2010
        printlog "set DateMin to 09/09/2009 and DateMax to 10/10/2010"  
    if iSystemSprache = 01 then      	
	    fsetControlProperty("DateField","DateMin","09/09/2009")
        fsetControlProperty("DateField","DateMax","10/10/2010")
    elseif iSystemSprache = 49 then
        fsetControlProperty("DateField","DateMin","09.09.2009")
        fsetControlProperty("DateField","DateMax","10.10.2010")
    endif  
    '/// set date format, dropdown
        printlog "set date format, date format"
        fsetControlProperty("DateField","DateFormat","7")        'YY/MM/DD
        printlog "set date format, dropdown"
        fsetControlProperty("DateField","DropDown","2")          'yes
    '/// save the document
        printlog "save the document"
        hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_DateField.odt"))
	hCloseDocument
        sleep(1)
    '/// reload the document
        printlog "reload the document"
	hFileOpen ( gOfficePath + ConvertPath("user/work/TT_DateField.odt"))    
    Kontext "Toolbar"
	    call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
  	call fSwitchControlDesignMode 
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
    call fOpenControlPropertyBrowser
    '/// check if the values are saved
        printlog "check if the values are saved"
        sleep(2)
    Kontext "TabGeneralControl"    
	    TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is.
    if iSystemSprache = 01 then
        if fgetControlProperty("DateField","DateMin") <> "09/09/2009" then
            warnlog "the value date min is not saved"
        endif
        if fgetControlProperty("DateField","DateMax") <> "10/10/2010" then
            warnlog "the value date max is not saved"
        endif
    elseif iSystemSprache = 49 then
        if fgetControlProperty("DateField","DateMin") <> "09.09.2009" then
            warnlog "the value date min is not saved"
        endif
        if fgetControlProperty("DateField","DateMax") <> "10.10.2010" then
            warnlog "the value date max is not saved"
        endif
    endif
    if fgetControlProperty("DateField","DateFormat") <> "7" then
        warnlog "the value date format is not saved"
    endif  
    if fgetControlProperty("DateField","DropDown") <> "2" then
        warnlog "the value dropdown is not saved"
    endif  
        sleep(1)  
        printlog " - testcase end"
    
    call closePropertyBrowserAndDocument()
        
endcase
'--------------------------------------------------------------------------------------

testcase tTimeField
	
    '/// Open a new document,
        printlog "Open a new document,"
	call hNewDocument
    Kontext "DocumentWriter"       
	    DocumentWriter.TypeKeys "tt_doc" , true
        
    call addControl("TimeField", 50, 20, 60, 30 )
    
    printlog "open the control property browser"
    call fOpenControlPropertyBrowser

    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
        sleep(2)
    '/// set TimeMin to 09:09:09 and TimeMax to 10:10:10 and time format to 01:45 PM
        printlog "set TimeMin to 09:09:09 and TimeMax to 10:10:10 and time format to 01:45 PM"        	
        fsetControlProperty("TimeField","TimeMin","09:09:09")
        fsetControlProperty("TimeField","TimeMax","10:10:10") 
        fsetControlProperty("TimeField","TimeFormat","3")
    '/// save the document
        printlog "save the document"
        hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_TimeField.odt"))
	hCloseDocument
        sleep(1)
    '/// reload the document
        printlog "reload the document"
	hFileOpen ( gOfficePath + ConvertPath("user/work/TT_TimeField.odt"))    
    Kontext "Toolbar"
	    call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
  	call fSwitchControlDesignMode
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
    call fOpenControlPropertyBrowser
    '/// check if the values are saved
        printlog "check if the values are saved"
        sleep(2)
    Kontext "TabGeneralControl"    
	    TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is.
    if fgetControlProperty("TimeField","TimeMin") <> "09:09:09" then
        warnlog "the value time min is not saved"
    endif
    if fgetControlProperty("TimeField","TimeMax") <> "10:10:10" then
        warnlog "the value time max is not saved"
    endif
    if fgetControlProperty("TimeField","TimeFormat") <> "3" then
        warnlog "the value time format is not saved"
    endif
        sleep(1)  
        printlog " - testcase end"
    
    call closePropertyBrowserAndDocument()
        
endcase
'--------------------------------------------------------------------------------------

testcase tNumericField
	
    '/// Open a new document,
        printlog "Open a new document,"
	call hNewDocument
    Kontext "DocumentWriter"       
	    DocumentWriter.TypeKeys "tt_doc" , true
        
    call addControl("NumericField", 50, 20, 60, 30 )
    
    printlog "open the control property browser"
    call fOpenControlPropertyBrowser

    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
        sleep(2)
    '/// set properties: spinbutton, Strict format, Thousands seperator
        printlog "set properties: spinbutton, Default value, Strict format, Tabstop, Thousands seperator"   
        fsetControlProperty("NumericField","StrictFormat","2")           'yes
        fsetControlProperty("NumericField","ThousandSeperator","2")      'yes
        fsetControlProperty("NumericField","Spin","2")                   'yes
        fsetControlProperty("NumericField","ValueStep","6") 
    '/// save the document
        printlog "save the document"
        hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_NumericField.odt"))
	hCloseDocument
        sleep(1)
    '/// reload and prepare the document
        printlog "reload the document"
	hFileOpen ( gOfficePath + ConvertPath("user/work/TT_NumericField.odt"))
    Kontext "Toolbar"
	    call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
  	call fSwitchControlDesignMode 
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
    call fOpenControlPropertyBrowser
    '/// check if property values are inserted
        printlog "check if property values are inserted"
    Kontext "TabGeneralControl"	
        dim bScrOK as boolean       'control variable if all properties are correct
        bScrOK = true           
    if fgetControlProperty("NumericField","StrictFormat") <> "2" then
        warnlog "the NumericField is not saved with property: StrictFormat"
        bScrOK = false
    endif
    if fgetControlProperty("NumericField","ThousandSeperator") <> "2" then
        warnlog "the NumericField is not saved with property: ThousandSeperator"
        bScrOK = false
    endif
    if fgetControlProperty("NumericField","Spin") <> "2" then
        warnlog "the NumericField is not saved with property: Spin"
        bScrOK = false
    endif
    '(spin field - cannot be read out)
    'if fgetControlProperty("NumericField","ValueStep") <> "2" then
        'warnlog "the NumericField is not saved with property: Value Step"
        'bScrOK = false
    'endif
    if bScrOK = true then printlog "Numeric field was saved correctly"
        sleep(1)   
        
    call closePropertyBrowserAndDocument()
          
endcase
'--------------------------------------------------------------------------------------

testcase tCurrencyField
	
    '/// Open a new document,
        printlog "Open a new document,"
	call hNewDocument
    Kontext "DocumentWriter"       
	    DocumentWriter.TypeKeys "tt_doc" , true
    
    call addControl("CurrencyField", 50, 20, 60, 30 )
    
    printlog "open the control property browser"
    call fOpenControlPropertyBrowser

    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
        sleep(2)
    '/// set valueStep to 5 and prefix symbol to yes and current symbol to zoq
        printlog "set valueStep to 5 and prefix symbol to yes and current symbol to zoq"       
        fsetControlProperty("CurrencyField","CurrSymPosition","2")    
        fsetControlProperty("CurrencyField","ValueStep","5")
        fsetControlProperty("CurrencyField","CurrencySymbol","nin")
        fsetControlProperty("CurrencyField","Accuracy","3")
    '/// save the document
        printlog "save the document"
        hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_CurrencyField.odt"))
	hCloseDocument
        sleep(1)
    '/// reload the document
        printlog "reload the document"
        hFileOpen ( gOfficePath + ConvertPath("user/work/TT_CurrencyField.odt"))    
    Kontext "Toolbar"
	    call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
  	call fSwitchControlDesignMode
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
    call fOpenControlPropertyBrowser
    '/// check if the values are saved
        printlog "check if the values are saved"
        sleep(2)
    Kontext "TabGeneralControl"    
	    TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is.
    if fgetControlProperty("CurrencyField","CurrSymPosition") <> "2" then    
        warnlog "the prefix symbol is not saved"
    endif    
    if fgetControlProperty("CurrencyField","ValueStep") <> "5" then
        warnlog "the value step is not saved"
    endif
    if fgetControlProperty("CurrencyField","CurrencySymbol") <> "nin" then
        warnlog "the CurrencySymbol is not saved"
    endif
    '(spin field - cannot be read out)
    'if fgetControlProperty("CurrencyField","Accuracy") <> "3" then
        'warnlog "the CurrencySymbol is not saved"
    'endif
        sleep(1)  
        printlog " - testcase end"
        
    call closePropertyBrowserAndDocument()
        
endcase
'--------------------------------------------------------------------------------------

testcase tPatternField     
    
    '/// Open a new document,
        printlog "Open a new document,"
	call hNewDocument
    Kontext "DocumentWriter"       
	    DocumentWriter.TypeKeys "tt_doc" , true
    
    call addControl("PatternField", 50, 20, 60, 30 )
    
    printlog "open the control property browser"
    call fOpenControlPropertyBrowser

    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
        sleep(2)
    '/// set properties: Readonly, Edit mask, Literal mask, Order
        printlog "set properties: Readonly, Edit mask, Literal mask, Order"            	
        fsetControlProperty("PatternField","Readonly","2")   
        fsetControlProperty("PatternField","EditMask","oxox")    
        fsetControlProperty("PatternField","LiteralMask","ooxoo")    
        fsetControlProperty("PatternField","Order","7")  
    '/// save the document
        printlog "save the document"
        hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_PatternField.odt"))
	hCloseDocument
        sleep(1)
    '/// reload the document
        printlog "reload the document"
	hFileOpen ( gOfficePath + ConvertPath("user/work/TT_PatternField.odt"))    
    Kontext "Toolbar"
	    call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
  	call fSwitchControlDesignMode
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
    call fOpenControlPropertyBrowser
    '/// check if the values are saved
        printlog "check if the values are saved"
        sleep(2)
    Kontext "TabGeneralControl"    
	    TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is.
    if fgetControlProperty("PatternField","Readonly") <> "2" then
        warnlog "the value readonly is not saved"
    endif        
    if fgetControlProperty("PatternField","EditMask") <> "oxox" then
        warnlog "the value EditMask is not saved"
    endif  
    if fgetControlProperty("PatternField","LiteralMask") <> "ooxoo" then
        warnlog "the value LiteralMask is not saved"
    endif  
    if fgetControlProperty("PatternField","Order") <> "7" then
        warnlog "the value Order is not saved"
    endif  
        sleep(1)  
        printlog " - testcase end"
        
    call closePropertyBrowserAndDocument()
         
endcase
'--------------------------------------------------------------------------------------

testcase tGroupBox
	
    '/// Open a new document,
        printlog "Open a new document,"
	call hNewDocument
    Kontext "DocumentWriter"       
	    DocumentWriter.TypeKeys "tt_doc" , true
        
    addControl("GroupBox", 50, 20, 60, 30 )
     
    printlog "open the control property browser"
    call fOpenControlPropertyBrowser

    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
    '/// set properties: Label, Character set
        printlog "set properties"  
    Kontext "TabGeneralControl"
        TabGeneralControl.TypeKeys "<TAB>",TRUE                 'label
        TabGeneralControl.TypeKeys "Changed label name",TRUE
        CharacterSetButton.Click                                'character set
        sleep(1)
    Kontext "TabFont"
        TabFont.TypeKeys "<DOWN>",TRUE
        TabFont.OK
    '/// save the document
        printlog "save the document"
        hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_GroupBox.odt"))
	hCloseDocument
        sleep(1)
    '/// reload and prepare the document
        printlog "reload the document"
	hFileOpen ( gOfficePath + ConvertPath("user/work/TT_GroupBox.odt"))
    Kontext "Toolbar"
	    call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
  	call fSwitchControlDesignMode
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
    call fOpenControlPropertyBrowser
    '/// check if property values are inserted
        printlog "check if property values are inserted"
    Kontext "TabGeneralControl"	
        TabGeneralControl.TypeKeys "<TAB>" , true    
        TabGeneralControl.TypeKeys "<MOD1 C>" , true
    if getclipboard() <> "Changed label name" then
        warnlog "Property:  Label is not saved correctly"
    endif    
    'printlog "property character set text: " & CharacterSet.getText
    if CharacterSet.getText = "" then
        warnlog "Property:  Character set is not saved correctly"
    endif
        sleep(1)
        printlog " - testcase end"
       
    call closePropertyBrowserAndDocument()
        
endcase
'--------------------------------------------------------------------------------------

testcase tTableControl
    
    '/// Open a new document,
        printlog "Open a new document,"
	call hNewDocument
    Kontext "DocumentWriter"       
	    DocumentWriter.TypeKeys "tt_doc" , true
        
    call addControl("Grid", 50, 20, 60, 30 )
     
    printlog "open the control property browser"
    call fOpenControlPropertyBrowser

    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
        sleep(2)
    '/// set properties: Navigation bar, Record marker, Row high
        printlog "set properties" 
        fsetControlProperty("TableControl","NavigationBar","1")      'listbox content: no
        fsetControlProperty("TableControl","RecordMarker","1")       'listbox content: no
        fsetControlProperty("TableControl","RowHeight","5")          
    '/// save the document
        printlog "save the document"
        hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_TableControl.odt"))
	hCloseDocument
        sleep(1)
    '/// reload and prepare the document
        printlog "reload the document"
	hFileOpen ( gOfficePath + ConvertPath("user/work/TT_TableControl.odt"))
    Kontext "Toolbar"
	    call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
  	call fSwitchControlDesignMode  
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
    call fOpenControlPropertyBrowser
    '/// check if property values are inserted
        printlog "check if property values are inserted"
    Kontext "TabGeneralControl"	
        dim bScrOK as boolean       'control variable if all properties are correct
        bScrOK = true           
    if fgetControlProperty("TableControl","NavigationBar") <> "1" then
        warnlog "the imagebutton is not saved with property: NavigationBar"
        bScrOK = false
    endif
    if fgetControlProperty("TableControl","RecordMarker") <> "1" then
        warnlog "the imagebutton is not saved with property: RecordMarker"
        bScrOK = false
    endif
    if fgetControlProperty("TableControl","RowHeight") = "" then
        warnlog "the imagebutton is not saved with property: RowHeight"
        bScrOK = false
    endif
    if bScrOK = true then printlog "TableControl was saved correctly"
        sleep(1)  
        
    call closePropertyBrowserAndDocument()
          
endcase
'--------------------------------------------------------------------------------------

testcase tNavigationBar
    
    '/// Open a new document,
        printlog "Open a new document,"
	call hNewDocument
    Kontext "DocumentWriter"       
	    DocumentWriter.TypeKeys "tt_doc" , true
    
    call addControl("NavigationBar", 50, 20, 60, 30 )
    
    printlog "open the control property browser"
    call fOpenControlPropertyBrowser

    Kontext "ControlPropertiesTabControl"   
        ControlPropertiesTabControl.setPage TabGeneralControl       'make shure that tabpage general in property is choosen
        sleep(2)
    '/// set properties: IconSize, Positioning, Navigation, RecordActions, FilteringSorting
        printlog "set properties" 
        fsetControlProperty("NavigationBar","IconSize","2")          'listbox content: large
        fsetControlProperty("NavigationBar","Positioning","1")       'listbox content: no
        fsetControlProperty("NavigationBar","Navigation","1")        'listbox content: no
        fsetControlProperty("NavigationBar","RecordActions","1")     'listbox content: no
        fsetControlProperty("NavigationBar","FilteringSorting","1")  'listbox content: no
    '/// save the document
        printlog "save the document"
        hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_NavigationBar.odt"))
	hCloseDocument
        sleep(1)
    '/// reload and prepare the document
        printlog "reload the document"
	hFileOpen ( gOfficePath + ConvertPath("user/work/TT_NavigationBar.odt"))
        Kontext "Toolbar"
        call hToolbarSelect("MoreControls",true)
        call hToolbarSelect("FormControls",true)
  	call fSwitchControlDesignMode 
    Kontext "DocumentWriter"
        DocumentWriter.TypeKeys "<SHIFT F4>"
        sleep(1)
    call fOpenControlPropertyBrowser
    '/// check if property values are inserted
        printlog "check if property values are inserted"
    Kontext "TabGeneralControl"	
        dim bScrOK as boolean       'control variable if all properties are correct
        bScrOK = true           
    if fgetControlProperty("NavigationBar","IconSize") <> "2" then
        warnlog "the NavigationBar is not saved with property: IconSize"
        bScrOK = false
    endif
    if fgetControlProperty("NavigationBar","Positioning") <> "1" then
        warnlog "the NavigationBar is not saved with property: Positioning"
        bScrOK = false
    endif
    if fgetControlProperty("NavigationBar","Navigation") <> "1" then
        warnlog "the NavigationBar is not saved with property: Navigation"
        bScrOK = false
    endif
    if fgetControlProperty("NavigationBar","RecordActions") <> "1" then
        warnlog "the NavigationBar is not saved with property: RecordActions"
        bScrOK = false
    endif
    if fgetControlProperty("NavigationBar","FilteringSorting") <> "1" then
        warnlog "the NavigationBar is not saved with property: FilteringSorting"
        bScrOK = false
    endif
    if bScrOK = true then printlog "NavigationBar was saved correctly"
        sleep(1)   
        
    call closePropertyBrowserAndDocument()
           
endcase
'--------------------------------------------------------------------------------------
'--------------------------------------------------------------------------------------

   

'make shure that design mode is not off, else switch on
function fSwitchOn_DesignMode
Kontext "FormControls"
        try
            PushButton.Click    
        catch 
            SwitchControlDesignMode.Click
            sleep(2)
        endcatch
end function