Salome HOME
PR: synchro V6_main tag mergeto_V7_main_11Feb13
[modules/geom.git] / src / DlgRef / DlgRef.cxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18
19 // File   : DlgRef.cxx
20 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
21
22 #include "DlgRef.h"
23
24 //////////////////////////////////////////
25 // DlgRef_1List1Spin1Btn
26 //////////////////////////////////////////
27
28 DlgRef_1List1Spin1Btn::DlgRef_1List1Spin1Btn( QWidget* parent, Qt::WindowFlags f )
29 : QWidget( parent, f )
30 {
31   setupUi( this );
32 }
33
34 DlgRef_1List1Spin1Btn::~DlgRef_1List1Spin1Btn()
35 {
36 }
37
38 //////////////////////////////////////////
39 // DlgRef_1Sel1Check1List
40 //////////////////////////////////////////
41
42 DlgRef_1Sel1Check1List::DlgRef_1Sel1Check1List( QWidget* parent, Qt::WindowFlags f )
43 : QWidget( parent, f )
44 {
45   setupUi( this );
46 }
47
48 DlgRef_1Sel1Check1List::~DlgRef_1Sel1Check1List()
49 {
50 }
51
52 //////////////////////////////////////////
53 // DlgRef_1Sel1Check1Sel
54 //////////////////////////////////////////
55
56 DlgRef_1Sel1Check1Sel::DlgRef_1Sel1Check1Sel( QWidget* parent, Qt::WindowFlags f )
57 : QWidget( parent, f )
58 {
59   setupUi( this );
60 }
61
62 DlgRef_1Sel1Check1Sel::~DlgRef_1Sel1Check1Sel()
63 {
64 }
65
66 //////////////////////////////////////////
67 // DlgRef_1Sel1Check
68 //////////////////////////////////////////
69
70 DlgRef_1Sel1Check::DlgRef_1Sel1Check( QWidget* parent, Qt::WindowFlags f )
71 : QWidget( parent, f )
72 {
73   setupUi( this );
74 }
75
76 DlgRef_1Sel1Check::~DlgRef_1Sel1Check()
77 {
78 }
79
80 //////////////////////////////////////////
81 // DlgRef_1Sel1Frame
82 //////////////////////////////////////////
83
84 DlgRef_1Sel1Frame::DlgRef_1Sel1Frame( QWidget* parent, Qt::WindowFlags f )
85 : QWidget( parent, f )
86 {
87   setupUi( this );
88 }
89
90 DlgRef_1Sel1Frame::~DlgRef_1Sel1Frame()
91 {
92 }
93
94 //////////////////////////////////////////
95 // DlgRef_1Sel1List1Check3Btn
96 //////////////////////////////////////////
97
98 DlgRef_1Sel1List1Check3Btn::DlgRef_1Sel1List1Check3Btn( QWidget* parent, Qt::WindowFlags f )
99 : QWidget( parent, f )
100 {
101   setupUi( this );
102 }
103
104 DlgRef_1Sel1List1Check3Btn::~DlgRef_1Sel1List1Check3Btn()
105 {
106 }
107
108 //////////////////////////////////////////
109 // DlgRef_1Sel1Spin1Check
110 //////////////////////////////////////////
111
112 DlgRef_1Sel1Spin1Check::DlgRef_1Sel1Spin1Check( QWidget* parent, Qt::WindowFlags f )
113 : QWidget( parent, f )
114 {
115   setupUi( this );
116 }
117
118 DlgRef_1Sel1Spin1Check::~DlgRef_1Sel1Spin1Check()
119 {
120 }
121
122 //////////////////////////////////////////
123 // DlgRef_1Sel1Spin
124 //////////////////////////////////////////
125
126 DlgRef_1Sel1Spin::DlgRef_1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
127 : QWidget( parent, f )
128 {
129   setupUi( this );
130 }
131
132 DlgRef_1Sel1Spin::~DlgRef_1Sel1Spin()
133 {
134 }
135
136 //////////////////////////////////////////
137 // DlgRef_1Sel2Spin1View1Check
138 //////////////////////////////////////////
139
140 DlgRef_1Sel2Spin1View1Check::DlgRef_1Sel2Spin1View1Check( QWidget* parent, Qt::WindowFlags f )
141 : QWidget( parent, f )
142 {
143   setupUi( this );
144 }
145
146 DlgRef_1Sel2Spin1View1Check::~DlgRef_1Sel2Spin1View1Check()
147 {
148 }
149
150 //////////////////////////////////////////
151 // DlgRef_1Sel2Spin
152 //////////////////////////////////////////
153
154 DlgRef_1Sel2Spin::DlgRef_1Sel2Spin( QWidget* parent, Qt::WindowFlags f )
155 : QWidget( parent, f )
156 {
157   setupUi( this );
158 }
159
160 DlgRef_1Sel2Spin::~DlgRef_1Sel2Spin()
161 {
162 }
163
164 //////////////////////////////////////////
165 // DlgRef_1Sel3Check
166 //////////////////////////////////////////
167
168 DlgRef_1Sel3Check::DlgRef_1Sel3Check( QWidget* parent, Qt::WindowFlags f )
169 : QWidget( parent, f )
170 {
171   setupUi( this );
172 }
173
174 DlgRef_1Sel3Check::~DlgRef_1Sel3Check()
175 {
176 }
177
178 //////////////////////////////////////////
179 // DlgRef_1Sel3Spin
180 //////////////////////////////////////////
181
182 DlgRef_1Sel3Spin::DlgRef_1Sel3Spin( QWidget* parent, Qt::WindowFlags f )
183 : QWidget( parent, f )
184 {
185   setupUi( this );
186 }
187
188 DlgRef_1Sel3Spin::~DlgRef_1Sel3Spin()
189 {
190 }
191
192 //////////////////////////////////////////
193 // DlgRef_1Sel3Spin2Check1Spin
194 //////////////////////////////////////////
195
196 DlgRef_1Sel3Spin2Check1Spin::DlgRef_1Sel3Spin2Check1Spin( QWidget* parent, Qt::WindowFlags f )
197 : QWidget( parent, f )
198 {
199   setupUi( this );
200 }
201
202 DlgRef_1Sel3Spin2Check1Spin::~DlgRef_1Sel3Spin2Check1Spin()
203 {
204 }
205
206 //////////////////////////////////////////
207 // DlgRef_1Sel3Spin1Check
208 //////////////////////////////////////////
209
210 DlgRef_1Sel3Spin1Check::DlgRef_1Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
211 : QWidget( parent, f )
212 {
213   setupUi( this );
214 }
215
216 DlgRef_1Sel3Spin1Check::~DlgRef_1Sel3Spin1Check()
217 {
218 }
219
220 //////////////////////////////////////////
221 // DlgRef_1Sel5Spin1Check
222 //////////////////////////////////////////
223
224 DlgRef_1Sel5Spin1Check::DlgRef_1Sel5Spin1Check( QWidget* parent, Qt::WindowFlags f )
225 : QWidget( parent, f )
226 {
227   setupUi( this );
228 }
229
230 DlgRef_1Sel5Spin1Check::~DlgRef_1Sel5Spin1Check()
231 {
232 }
233
234 //////////////////////////////////////////
235 // DlgRef_1Spin
236 //////////////////////////////////////////
237
238 DlgRef_1Spin::DlgRef_1Spin( QWidget* parent, Qt::WindowFlags f )
239 : QWidget( parent, f )
240 {
241   setupUi( this );
242 }
243
244 DlgRef_1Spin::~DlgRef_1Spin()
245 {
246 }
247
248 //////////////////////////////////////////
249 // DlgRef_1Sel
250 //////////////////////////////////////////
251
252 DlgRef_1Sel::DlgRef_1Sel( QWidget* parent, Qt::WindowFlags f )
253 : QWidget( parent, f )
254 {
255   setupUi( this );
256 }
257
258 DlgRef_1Sel::~DlgRef_1Sel()
259 {
260 }
261
262 //////////////////////////////////////////
263 // DlgRef_1SelExt
264 //////////////////////////////////////////
265
266 DlgRef_1SelExt::DlgRef_1SelExt( QWidget* parent, Qt::WindowFlags f )
267 : QWidget( parent, f )
268 {
269   setupUi( this );
270 }
271
272 DlgRef_1SelExt::~DlgRef_1SelExt()
273 {
274 }
275
276 //////////////////////////////////////////
277 // DlgRef_2Sel1List1Check
278 //////////////////////////////////////////
279
280 DlgRef_2Sel1List1Check::DlgRef_2Sel1List1Check( QWidget* parent, Qt::WindowFlags f )
281 : QWidget( parent, f )
282 {
283   setupUi( this );
284 }
285
286 DlgRef_2Sel1List1Check::~DlgRef_2Sel1List1Check()
287 {
288 }
289
290 //////////////////////////////////////////
291 // DlgRef_2Sel1List2Check
292 //////////////////////////////////////////
293
294 DlgRef_2Sel1List2Check::DlgRef_2Sel1List2Check( QWidget* parent, Qt::WindowFlags f )
295 : QWidget( parent, f )
296 {
297   setupUi( this );
298 }
299
300 DlgRef_2Sel1List2Check::~DlgRef_2Sel1List2Check()
301 {
302 }
303
304 //////////////////////////////////////////
305 // DlgRef_2Sel1List
306 //////////////////////////////////////////
307
308 DlgRef_2Sel1List::DlgRef_2Sel1List( QWidget* parent, Qt::WindowFlags f )
309 : QWidget( parent, f )
310 {
311   setupUi( this );
312 }
313
314 DlgRef_2Sel1List::~DlgRef_2Sel1List()
315 {
316 }
317
318 //////////////////////////////////////////
319 // DlgRef_2Sel1Spin2Check
320 //////////////////////////////////////////
321
322 DlgRef_2Sel1Spin2Check::DlgRef_2Sel1Spin2Check( QWidget* parent, Qt::WindowFlags f )
323 : QWidget( parent, f )
324 {
325   setupUi( this );
326 }
327
328 DlgRef_2Sel1Spin2Check::~DlgRef_2Sel1Spin2Check()
329 {
330 }
331
332 //////////////////////////////////////////
333 // DlgRef_2Sel1Spin3Check1Spin
334 //////////////////////////////////////////
335
336 DlgRef_2Sel1Spin3Check1Spin::DlgRef_2Sel1Spin3Check1Spin( QWidget* parent, Qt::WindowFlags f )
337 : QWidget( parent, f )
338 {
339   setupUi( this );
340 }
341
342 DlgRef_2Sel1Spin3Check1Spin::~DlgRef_2Sel1Spin3Check1Spin()
343 {
344 }
345
346 //////////////////////////////////////////
347 // DlgRef_2Sel1Spin
348 //////////////////////////////////////////
349
350 DlgRef_2Sel1Spin::DlgRef_2Sel1Spin( QWidget* parent, Qt::WindowFlags f )
351 : QWidget( parent, f )
352 {
353   setupUi( this );
354 }
355
356 DlgRef_2Sel1Spin::~DlgRef_2Sel1Spin()
357 {
358 }
359
360 //////////////////////////////////////////
361 // DlgRef_2Sel1SpinInt
362 //////////////////////////////////////////
363
364 DlgRef_2Sel1SpinInt::DlgRef_2Sel1SpinInt( QWidget* parent, Qt::WindowFlags f )
365 : QWidget( parent, f )
366 {
367   setupUi( this );
368 }
369
370 DlgRef_2Sel1SpinInt::~DlgRef_2Sel1SpinInt()
371 {
372 }
373
374 //////////////////////////////////////////
375 // DlgRef_2Sel2List
376 //////////////////////////////////////////
377
378 DlgRef_2Sel2List::DlgRef_2Sel2List( QWidget* parent, Qt::WindowFlags f )
379 : QWidget( parent, f )
380 {
381   setupUi( this );
382 }
383
384 DlgRef_2Sel2List::~DlgRef_2Sel2List()
385 {
386 }
387
388 //////////////////////////////////////////
389 // DlgRef_2Sel2Spin1Check
390 //////////////////////////////////////////
391
392 DlgRef_2Sel2Spin1Check::DlgRef_2Sel2Spin1Check( QWidget* parent, Qt::WindowFlags f )
393 : QWidget( parent, f )
394 {
395   setupUi( this );
396 }
397
398 DlgRef_2Sel2Spin1Check::~DlgRef_2Sel2Spin1Check()
399 {
400 }
401
402 //////////////////////////////////////////
403 // DlgRef_2Sel2Spin3Check
404 //////////////////////////////////////////
405
406 DlgRef_2Sel2Spin3Check::DlgRef_2Sel2Spin3Check( QWidget* parent, Qt::WindowFlags f )
407 : QWidget( parent, f )
408 {
409   setupUi( this );
410 }
411
412 DlgRef_2Sel2Spin3Check::~DlgRef_2Sel2Spin3Check()
413 {
414 }
415
416 //////////////////////////////////////////
417 // DlgRef_2Sel2Spin
418 //////////////////////////////////////////
419
420 DlgRef_2Sel2Spin::DlgRef_2Sel2Spin( QWidget* parent, Qt::WindowFlags f )
421 : QWidget( parent, f )
422 {
423   setupUi( this );
424 }
425
426 DlgRef_2Sel2Spin::~DlgRef_2Sel2Spin()
427 {
428 }
429
430 //////////////////////////////////////////
431 // DlgRef_2Sel2Spin1Push
432 //////////////////////////////////////////
433
434 DlgRef_2Sel2Spin1Push::DlgRef_2Sel2Spin1Push( QWidget* parent, Qt::WindowFlags f )
435 : QWidget( parent, f )
436 {
437   setupUi( this );
438 }
439
440 DlgRef_2Sel2Spin1Push::~DlgRef_2Sel2Spin1Push()
441 {
442 }
443
444 //////////////////////////////////////////
445 // DlgRef_2Sel2Spin2Push
446 //////////////////////////////////////////
447
448 DlgRef_2Sel2Spin2Push::DlgRef_2Sel2Spin2Push( QWidget* parent, Qt::WindowFlags f )
449 : QWidget( parent, f )
450 {
451   setupUi( this );
452 }
453
454 DlgRef_2Sel2Spin2Push::~DlgRef_2Sel2Spin2Push()
455 {
456 }
457
458 //////////////////////////////////////////
459 // DlgRef_2Sel3Spin2Rb
460 //////////////////////////////////////////
461
462 DlgRef_2Sel3Spin2Rb::DlgRef_2Sel3Spin2Rb( QWidget* parent, Qt::WindowFlags f )
463 : QWidget( parent, f )
464 {
465   setupUi( this );
466 }
467
468 DlgRef_2Sel3Spin2Rb::~DlgRef_2Sel3Spin2Rb()
469 {
470 }
471
472 //////////////////////////////////////////
473 // DlgRef_2Sel3Spin
474 //////////////////////////////////////////
475
476 DlgRef_2Sel3Spin::DlgRef_2Sel3Spin( QWidget* parent, Qt::WindowFlags f )
477 : QWidget( parent, f )
478 {
479   setupUi( this );
480 }
481
482 DlgRef_2Sel3Spin::~DlgRef_2Sel3Spin()
483 {
484 }
485
486 //////////////////////////////////////////
487 // DlgRef_2Sel
488 //////////////////////////////////////////
489
490 DlgRef_2Sel::DlgRef_2Sel( QWidget* parent, Qt::WindowFlags f )
491 : QWidget( parent, f )
492 {
493   setupUi( this );
494 }
495
496 DlgRef_2Sel::~DlgRef_2Sel()
497 {
498 }
499
500 //////////////////////////////////////////
501 // DlgRef_2SelExt
502 //////////////////////////////////////////
503
504 DlgRef_2SelExt::DlgRef_2SelExt( QWidget* parent, Qt::WindowFlags f )
505 : QWidget( parent, f )
506 {
507   setupUi( this );
508 }
509
510 DlgRef_2SelExt::~DlgRef_2SelExt()
511 {
512 }
513
514 //////////////////////////////////////////
515 // DlgRef_2Spin
516 //////////////////////////////////////////
517
518 DlgRef_2Spin::DlgRef_2Spin( QWidget* parent, Qt::WindowFlags f )
519 : QWidget( parent, f )
520 {
521   setupUi( this );
522 }
523
524 DlgRef_2Spin::~DlgRef_2Spin()
525 {
526 }
527
528 //////////////////////////////////////////
529 // DlgRef_3Check
530 //////////////////////////////////////////
531
532 DlgRef_3Check::DlgRef_3Check( QWidget* parent, Qt::WindowFlags f )
533 : QWidget( parent, f )
534 {
535   setupUi( this );
536 }
537
538 DlgRef_3Check::~DlgRef_3Check()
539 {
540 }
541
542 //////////////////////////////////////////
543 // DlgRef_3Radio
544 //////////////////////////////////////////
545
546 DlgRef_3Radio::DlgRef_3Radio( QWidget* parent, Qt::WindowFlags f )
547 : QWidget( parent, f )
548 {
549   setupUi( this );
550 }
551
552 DlgRef_3Radio::~DlgRef_3Radio()
553 {
554 }
555
556 //////////////////////////////////////////
557 // DlgRef_3Radio1Sel1Spin
558 //////////////////////////////////////////
559
560 DlgRef_3Radio1Sel1Spin::DlgRef_3Radio1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
561 : QWidget( parent, f )
562 {
563   setupUi( this );
564 }
565
566 DlgRef_3Radio1Sel1Spin::~DlgRef_3Radio1Sel1Spin()
567 {
568 }
569
570 //////////////////////////////////////////
571 // DlgRef_3Sel1Check
572 //////////////////////////////////////////
573
574 DlgRef_3Sel1Check::DlgRef_3Sel1Check( QWidget* parent, Qt::WindowFlags f )
575 : QWidget( parent, f )
576 {
577   setupUi( this );
578 }
579
580 DlgRef_3Sel1Check::~DlgRef_3Sel1Check()
581 {
582 }
583
584 //////////////////////////////////////////
585 // DlgRef_3Sel1Spin
586 //////////////////////////////////////////
587
588 DlgRef_3Sel1Spin::DlgRef_3Sel1Spin( QWidget* parent, Qt::WindowFlags f )
589 : QWidget( parent, f )
590 {
591   setupUi( this );
592 }
593
594 DlgRef_3Sel1Spin::~DlgRef_3Sel1Spin()
595 {
596 }
597
598 //////////////////////////////////////////
599 // DlgRef_3Sel2Spin
600 //////////////////////////////////////////
601
602 DlgRef_3Sel2Spin::DlgRef_3Sel2Spin( QWidget* parent, Qt::WindowFlags f )
603 : QWidget( parent, f )
604 {
605   setupUi( this );
606 }
607
608 DlgRef_3Sel2Spin::~DlgRef_3Sel2Spin()
609 {
610 }
611
612 //////////////////////////////////////////
613 // DlgRef_3Sel3Spin1Check
614 //////////////////////////////////////////
615
616 DlgRef_3Sel3Spin1Check::DlgRef_3Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
617 : QWidget( parent, f )
618 {
619   setupUi( this );
620 }
621
622 DlgRef_3Sel3Spin1Check::~DlgRef_3Sel3Spin1Check()
623 {
624 }
625
626 void DlgRef_3Sel3Spin1Check::ShowRows( int fromRow, int toRow, bool toShow )
627 {
628   const int maxRows = 7;
629   
630   if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
631     int c = gridLayout1->count();
632     for ( int i = 0; i < c; i++ ) {
633       QWidget* w = gridLayout1->itemAt( i )->widget();
634       int row, col, rowspan, colspan;
635       gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
636       if ( w && row >= fromRow && row <= toRow )
637         w->setVisible( toShow );
638     }
639   }
640 }
641
642 //////////////////////////////////////////
643 // DlgRef_3Sel2Check3Spin
644 //////////////////////////////////////////
645
646 DlgRef_3Sel2Check3Spin::DlgRef_3Sel2Check3Spin( QWidget* parent, Qt::WindowFlags f )
647 : QWidget( parent, f )
648 {
649   setupUi( this );
650 }
651
652 DlgRef_3Sel2Check3Spin::~DlgRef_3Sel2Check3Spin()
653 {
654 }
655
656 void DlgRef_3Sel2Check3Spin::ShowRows( int fromRow, int toRow, bool toShow )
657 {
658   const int maxRows = 8;
659   
660   if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
661     int c = gridLayout1->count();
662     for ( int i = 0; i < c; i++ ) {
663       QWidget* w = gridLayout1->itemAt( i )->widget();
664       int row, col, rowspan, colspan;
665       gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
666       if ( w && row >= fromRow && row <= toRow )
667         w->setVisible( toShow );
668     }
669   }
670 }
671
672 //////////////////////////////////////////
673 // DlgRef_3Sel3Spin2Check
674 //////////////////////////////////////////
675
676 DlgRef_3Sel3Spin2Check::DlgRef_3Sel3Spin2Check( QWidget* parent, Qt::WindowFlags f )
677 : QWidget( parent, f )
678 {
679   setupUi( this );
680 }
681
682 DlgRef_3Sel3Spin2Check::~DlgRef_3Sel3Spin2Check()
683 {
684 }
685
686 void DlgRef_3Sel3Spin2Check::ShowRows( int fromRow, int toRow, bool toShow )
687 {
688   const int maxRows = 8;
689   
690   if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
691     int c = gridLayout1->count();
692     for ( int i = 0; i < c; i++ ) {
693       QWidget* w = gridLayout1->itemAt( i )->widget();
694       int row, col, rowspan, colspan;
695       gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
696       if ( w && row >= fromRow && row <= toRow )
697         w->setVisible( toShow );
698     }
699   }
700 }
701
702 //////////////////////////////////////////
703 // DlgRef_3Sel4Spin2Check
704 //////////////////////////////////////////
705
706 DlgRef_3Sel4Spin2Check::DlgRef_3Sel4Spin2Check( QWidget* parent, Qt::WindowFlags f )
707 : QWidget( parent, f )
708 {
709   setupUi( this );
710 }
711
712 DlgRef_3Sel4Spin2Check::~DlgRef_3Sel4Spin2Check()
713 {
714 }
715
716 //////////////////////////////////////////
717 // DlgRef_3Sel
718 //////////////////////////////////////////
719
720 DlgRef_3Sel::DlgRef_3Sel( QWidget* parent, Qt::WindowFlags f )
721 : QWidget( parent, f )
722 {
723   setupUi( this );
724 }
725
726 DlgRef_3Sel::~DlgRef_3Sel()
727 {
728 }
729
730 //////////////////////////////////////////
731 // DlgRef_3Spin1Check
732 //////////////////////////////////////////
733
734 DlgRef_3Spin1Check::DlgRef_3Spin1Check( QWidget* parent, Qt::WindowFlags f )
735 : QWidget( parent, f )
736 {
737   setupUi( this );
738 }
739
740 DlgRef_3Spin1Check::~DlgRef_3Spin1Check()
741 {
742 }
743
744 //////////////////////////////////////////
745 // DlgRef_3Spin
746 //////////////////////////////////////////
747
748 DlgRef_3Spin::DlgRef_3Spin( QWidget* parent, Qt::WindowFlags f )
749 : QWidget( parent, f )
750 {
751   setupUi( this );
752 }
753
754 DlgRef_3Spin::~DlgRef_3Spin()
755 {
756 }
757
758 //////////////////////////////////////////
759 // DlgRef_4Spin
760 //////////////////////////////////////////
761
762 DlgRef_4Spin::DlgRef_4Spin( QWidget* parent, Qt::WindowFlags f )
763 : QWidget( parent, f )
764 {
765   setupUi( this );
766 }
767
768 DlgRef_4Spin::~DlgRef_4Spin()
769 {
770 }
771
772 //////////////////////////////////////////
773 // DlgRef_4Sel1List1Check
774 //////////////////////////////////////////
775
776 DlgRef_4Sel1List1Check::DlgRef_4Sel1List1Check( QWidget* parent, Qt::WindowFlags f )
777 : QWidget( parent, f )
778 {
779   setupUi( this );
780 }
781
782 DlgRef_4Sel1List1Check::~DlgRef_4Sel1List1Check()
783 {
784 }
785
786 //////////////////////////////////////////
787 // DlgRef_4Sel1List
788 //////////////////////////////////////////
789
790 DlgRef_4Sel1List::DlgRef_4Sel1List( QWidget* parent, Qt::WindowFlags f )
791 : QWidget( parent, f )
792 {
793   setupUi( this );
794 }
795
796 DlgRef_4Sel1List::~DlgRef_4Sel1List()
797 {
798 }
799
800 //////////////////////////////////////////
801 // DlgRef_4Sel1Spin2Check
802 //////////////////////////////////////////
803
804 DlgRef_4Sel1Spin2Check::DlgRef_4Sel1Spin2Check( QWidget* parent, Qt::WindowFlags f )
805 : QWidget( parent, f )
806 {
807   setupUi( this );
808 }
809
810 DlgRef_4Sel1Spin2Check::~DlgRef_4Sel1Spin2Check()
811 {
812 }
813
814 void DlgRef_4Sel1Spin2Check::ShowRows( int fromRow, int toRow, bool toShow )
815 {
816   const int maxRows = 6;
817   
818   if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
819     int c = gridLayout1->count();
820     for ( int i = 0; i < c; i++ ) {
821       QWidget* w = gridLayout1->itemAt( i )->widget();
822       int row, col, rowspan, colspan;
823       gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
824       if ( w && row >= fromRow && row <= toRow )
825         w->setVisible( toShow );
826     }
827   }
828 }
829
830 //////////////////////////////////////////
831 // DlgRef_4Sel1Spin3Check
832 //////////////////////////////////////////
833
834 DlgRef_4Sel1Spin3Check::DlgRef_4Sel1Spin3Check( QWidget* parent, Qt::WindowFlags f )
835 : QWidget( parent, f )
836 {
837   setupUi( this );
838 }
839
840 DlgRef_4Sel1Spin3Check::~DlgRef_4Sel1Spin3Check()
841 {
842 }
843
844 //////////////////////////////////////////
845 // DlgRef_6Sel
846 //////////////////////////////////////////
847
848 DlgRef_6Sel::DlgRef_6Sel( QWidget* parent, Qt::WindowFlags f )
849 : QWidget( parent, f )
850 {
851   setupUi( this );
852 }
853
854 DlgRef_6Sel::~DlgRef_6Sel()
855 {
856 }
857
858 //////////////////////////////////////////
859 // DlgRef_Skeleton
860 //////////////////////////////////////////
861
862 DlgRef_Skeleton::DlgRef_Skeleton( QWidget* parent, Qt::WindowFlags f )
863 : QWidget( parent, f )
864 {
865   setupUi( this );
866 }
867
868 DlgRef_Skeleton::~DlgRef_Skeleton()
869 {
870 }
871
872 //////////////////////////////////////////
873 // Utility functions
874 //////////////////////////////////////////
875
876 QString DlgRef::PrintDoubleValue( double theValue, int thePrecision )
877 {
878   const double prec = 1e-12;
879   
880   if ( qAbs(theValue) < prec )
881     return "0";
882
883   QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( thePrecision ) );
884
885   if ( prec > 0 ) {
886     int p = 0;
887     while ( p < thePrecision ) {
888       QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( p++ ) );
889       double v = aRes.toDouble();
890       double err = qAbs( theValue - v );
891       if ( err > 0 && err <= prec )
892         break;
893     }
894   }
895
896   // remove trailing zeroes
897
898   QRegExp expre( QString( "(%1|%2)[+-]?[0-9]+$" ).arg( QLocale().exponential().toLower(), 
899                                                        QLocale().exponential().toUpper() ) );
900
901   int idx = aRes.indexOf( expre );
902   QString aResExp = "";
903   if ( idx >= 0 ) {
904     aResExp = aRes.mid( idx );
905     aRes = aRes.left( idx );
906   }
907
908   if ( aRes.contains( QLocale().decimalPoint() ) )
909     aRes.remove( QRegExp( QString( "(\\%1|0)0*$" ).arg( QLocale().decimalPoint() ) ) );
910
911   return aRes == "-0" ? QString( "0" ) : aRes + aResExp;
912 }