~ubuntu-branches/ubuntu/wily/libui-dialog-perl/wily

« back to all changes in this revision

Viewing changes to .pc/FixSpellingAndManDescription.diff/lib/UI/Dialog/Backend/CDialog.pod

  • Committer: Package Import Robot
  • Author(s): Alejandro Garrido Mota
  • Date: 2013-08-10 17:03:03 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130810170303-z23sxbboezqbjcas
Tags: 1.09-1
* New upstream release. 
* Add watch file.
* d/control:
  - Update Standards-Version to 3.9.4
  - Add Vcs-Git and Vcs-Browser.  
* Add source-format 3.0.
* d/copyright:
  - Update to copyright-format 1.0.
  - Push copyright years.
* Update d/rules to dh.
* Remove docs file.
* Add d/libui-dialog-perl.examples file
* Add FixPod2manErrors.diff and FixSpellingAndManDescription.diff patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=head1 NAME
 
2
 
 
3
UI::Dialog::Backend::CDialog
 
4
 
 
5
=head1 SYNOPSIS
 
6
 
 
7
  use UI::Dialog::Backend::CDialog;
 
8
  my $d = new UI::Dialog::Backend::CDialog ( backtitle => 'Demo',
 
9
                                             title => 'Default' );
 
10
 
 
11
  $d->msgbox( title => 'Welcome!', text => 'Welcome one and all!' );
 
12
 
 
13
=head1 ABSTRACT
 
14
 
 
15
UI::Dialog::Backend::CDialog is the UI::Dialog backend for the console
 
16
dialog variant. While this module is used through UI::Dialog or any other loader
 
17
module only the compatible methods are ever accessible. However, when using
 
18
this module directly in your application (as in the SYNOPSIS example) you are
 
19
given access to all the options and features of the real dialog(1) application.
 
20
 
 
21
=head1 DESCRIPTION
 
22
 
 
23
There are essentially two versions of the console dialog program. One has
 
24
support for colours as well as extra widgets, while the other does not have
 
25
either. You can read about the colour support in the TEXT MARKUP section.
 
26
 
 
27
=head1 EXPORT
 
28
 
 
29
=over 2
 
30
 
 
31
None
 
32
 
 
33
=back
 
34
 
 
35
=head1 INHERITS
 
36
 
 
37
=over 2
 
38
 
 
39
UI::Dialog::Backend
 
40
 
 
41
=back
 
42
 
 
43
=head1 CONSTRUCTOR
 
44
 
 
45
=head2 new( @options )
 
46
 
 
47
=over 4
 
48
 
 
49
=item EXAMPLE
 
50
 
 
51
=over 6
 
52
 
 
53
 my $d = new( title => 'Default Title', backtitle => 'Backtitle',
 
54
              width => 65, height => 20, listheight => 5 );
 
55
 
 
56
=back
 
57
 
 
58
=item DESCRIPTION
 
59
 
 
60
=over 6
 
61
 
 
62
This is the Class Constructor method. It accepts a list of key => value pairs
 
63
and uses them as the defaults when interacting with the various widgets.
 
64
 
 
65
=back
 
66
 
 
67
=item RETURNS
 
68
 
 
69
=over 6
 
70
 
 
71
A blessed object reference of the UI::Dialog::Backend::CDialog class.
 
72
 
 
73
=back
 
74
 
 
75
=item OPTIONS
 
76
 
 
77
The (...)'s after each option indicate the default for the option. An * denotes
 
78
support by all the widget methods on a per-use policy defaulting to the values
 
79
decided during object creation.
 
80
 
 
81
=over 6
 
82
 
 
83
=item B<debug = 0,1,2> (0)
 
84
 
 
85
=item B<literal = 0,1> (0)
 
86
 
 
87
=item B<backtitle = "backtitle"> ('') *
 
88
 
 
89
=item B<title = "title"> ('') *
 
90
 
 
91
=item B<height = \d+> (0) *
 
92
 
 
93
=item B<width = \d+> (0) *
 
94
 
 
95
=item B<beepbefore = 0,1> (0) *
 
96
 
 
97
=item B<beepafter = 0,1> (0) *
 
98
 
 
99
=back
 
100
 
 
101
=back
 
102
 
 
103
=head1 WIDGET METHODS
 
104
 
 
105
=head2 yesno( )
 
106
 
 
107
=over 4
 
108
 
 
109
=item EXAMPLE
 
110
 
 
111
=over 6
 
112
 
 
113
 if ($d->yesno( text => 'A binary type question?') ) {
 
114
     # user pressed yes
 
115
 } else {
 
116
     # user pressed no or cancel
 
117
 }
 
118
 
 
119
=back
 
120
 
 
121
=item DESCRIPTION
 
122
 
 
123
=over 6
 
124
 
 
125
Present the end user with a message box that has two buttons, yes and no.
 
126
 
 
127
=back
 
128
 
 
129
=item RETURNS
 
130
 
 
131
=over 6
 
132
 
 
133
TRUE (1) for a response of YES or FALSE (0) for anything else.
 
134
 
 
135
=back
 
136
 
 
137
=back
 
138
 
 
139
=head2 msgbox( )
 
140
 
 
141
=over 4
 
142
 
 
143
=item EXAMPLE
 
144
 
 
145
=over 6
 
146
 
 
147
 $d->msgbox( text => 'A simple message' );
 
148
 
 
149
=back
 
150
 
 
151
=item DESCRIPTION
 
152
 
 
153
=over 6
 
154
 
 
155
Pesent the end user with a message box that has an OK button.
 
156
 
 
157
=back
 
158
 
 
159
=item RETURNS
 
160
 
 
161
=over 6
 
162
 
 
163
TRUE (1) for a response of OK or FALSE (0) for anything else.
 
164
 
 
165
=back
 
166
 
 
167
=back
 
168
 
 
169
=head2 infobox( )
 
170
 
 
171
=over 4
 
172
 
 
173
=item EXAMPLE
 
174
 
 
175
=over 6
 
176
 
 
177
 $d->infobox( text => 'A simple 6 second message.', timeout => 6000 );
 
178
 
 
179
=back
 
180
 
 
181
=item DESCRIPTION
 
182
 
 
183
=over 6
 
184
 
 
185
Pesent the end user with a message box for a limited duration of time. The
 
186
timeout is specified in thousandths of a second, ie: 1000 = 1 second.
 
187
 
 
188
=back
 
189
 
 
190
=item RETURNS
 
191
 
 
192
=over 6
 
193
 
 
194
TRUE (1) for a response of OK or FALSE (0) for anything else.
 
195
 
 
196
=back
 
197
 
 
198
=back
 
199
 
 
200
=head2 password( )
 
201
 
 
202
=over 4
 
203
 
 
204
=item EXAMPLE
 
205
 
 
206
=over 6
 
207
 
 
208
 my $string = $d->password( text => 'Enter some (hidden) text.' );
 
209
 
 
210
=back
 
211
 
 
212
=item DESCRIPTION
 
213
 
 
214
=over 6
 
215
 
 
216
Present the end user with a text input field that doesn't reveal the input
 
217
(except to the script) and a message.
 
218
 
 
219
=back
 
220
 
 
221
=item RETURNS
 
222
 
 
223
=over 6
 
224
 
 
225
a SCALAR if the response is OK and FALSE (0) for anything else.
 
226
 
 
227
=back
 
228
 
 
229
=back
 
230
 
 
231
=head2 inputbox( )
 
232
 
 
233
=over 4
 
234
 
 
235
=item EXAMPLE
 
236
 
 
237
=over 6
 
238
 
 
239
 my $string = $d->inputbox( text => 'Please enter some text.',
 
240
                            entry => 'this is the input field' );
 
241
 
 
242
=back
 
243
 
 
244
=item DESCRIPTION
 
245
 
 
246
=over 6
 
247
 
 
248
Present the end user with a text input field and a message.
 
249
 
 
250
=back
 
251
 
 
252
=item RETURNS
 
253
 
 
254
=over 6
 
255
 
 
256
a SCALAR if the response is OK and FALSE (0) for anything else.
 
257
 
 
258
=back
 
259
 
 
260
=back
 
261
 
 
262
=head2 textbox( )
 
263
 
 
264
=over 4
 
265
 
 
266
=item EXAMPLE
 
267
 
 
268
=over 6
 
269
 
 
270
 $d->textbox( path => '/path/to/a/text/file' );
 
271
 
 
272
=back
 
273
 
 
274
=item DESCRIPTION
 
275
 
 
276
=over 6
 
277
 
 
278
Present the end user with a simple scrolling box containing the contents
 
279
of the given text file.
 
280
 
 
281
=back
 
282
 
 
283
=item RETURNS
 
284
 
 
285
=over 6
 
286
 
 
287
TRUE (1) if the response is OK and FALSE (0) for anything else.
 
288
 
 
289
=back
 
290
 
 
291
=back
 
292
 
 
293
=head2 menu( )
 
294
 
 
295
=over 4
 
296
 
 
297
=item EXAMPLE
 
298
 
 
299
=over 6
 
300
 
 
301
 my $selection1 = $d->menu( text => 'Select one:',
 
302
                            list => [ 'tag1', 'item1',
 
303
                                      'tag2', 'item2',
 
304
                                      'tag3', 'item3' ]
 
305
                          );
 
306
 
 
307
=back
 
308
 
 
309
=item DESCRIPTION
 
310
 
 
311
=over 6
 
312
 
 
313
Present the user with a selectable list.
 
314
 
 
315
=back
 
316
 
 
317
=item RETURNS
 
318
 
 
319
=over 6
 
320
 
 
321
a SCALAR of the chosen tag if the response is OK and FALSE (0) for
 
322
anything else.
 
323
 
 
324
=back
 
325
 
 
326
=back
 
327
 
 
328
=head2 checklist( )
 
329
 
 
330
=over 4
 
331
 
 
332
=item EXAMPLE
 
333
 
 
334
=over 6
 
335
 
 
336
 my @selection = $d->checklist( text => 'Select one:',
 
337
                                list => [ 'tag1', [ 'item1', 0 ],
 
338
                                          'tag2', [ 'item2', 1 ],
 
339
                                          'tag3', [ 'item3', 1 ] ]
 
340
                              );
 
341
 
 
342
=back
 
343
 
 
344
=item DESCRIPTION
 
345
 
 
346
=over 6
 
347
 
 
348
Present the user with a selectable checklist.
 
349
 
 
350
=back
 
351
 
 
352
=item RETURNS
 
353
 
 
354
=over 6
 
355
 
 
356
an ARRAY of the chosen tags if the response is OK and FALSE (0) for
 
357
anything else.
 
358
 
 
359
=back
 
360
 
 
361
=back
 
362
 
 
363
=head2 form( )
 
364
 
 
365
=over 4
 
366
 
 
367
=item EXAMPLE
 
368
 
 
369
=over 6
 
370
 
 
371
 my @data = $d->form( text => 'Select one:',
 
372
                      list => [ [ 'tag1', 1, 1 ], [ 'item1', 1, 10, 10, 10 ],
 
373
                                [ 'tag2', 2, 1 ], [ 'item2', 2, 10, 10, 10 ],
 
374
                                [ 'tag3', 3, 1 ], [ 'item3', 3, 10, 10, 10 ] ]
 
375
                    );
 
376
 
 
377
=back
 
378
 
 
379
=item DESCRIPTION
 
380
 
 
381
=over 6
 
382
 
 
383
Present the user with a selectable and potentially editable form.
 
384
 
 
385
=back
 
386
 
 
387
=item RETURNS
 
388
 
 
389
=over 6
 
390
 
 
391
an ARRAY of the form data if the response is OK and FALSE (0) for
 
392
anything else.
 
393
 
 
394
=back
 
395
 
 
396
=back
 
397
 
 
398
=head2 radiolist( )
 
399
 
 
400
=over 4
 
401
 
 
402
=item EXAMPLE
 
403
 
 
404
=over 6
 
405
 
 
406
 my $selection = $d->radiolist( text => 'Select one:',
 
407
                                list => [ 'tag1', [ 'item1', 0 ],
 
408
                                          'tag2', [ 'item2', 1 ],
 
409
                                          'tag3', [ 'item3', 0 ] ]
 
410
                              );
 
411
 
 
412
=back
 
413
 
 
414
=item DESCRIPTION
 
415
 
 
416
=over 6
 
417
 
 
418
Present the user with a selectable radiolist.
 
419
 
 
420
=back
 
421
 
 
422
=item RETURNS
 
423
 
 
424
=over 6
 
425
 
 
426
a SCALAR of the chosen tag if the response is OK and FALSE (0) for
 
427
anything else.
 
428
 
 
429
=back
 
430
 
 
431
=back
 
432
 
 
433
=head2 fselect( )
 
434
 
 
435
=over 4
 
436
 
 
437
=item EXAMPLE
 
438
 
 
439
=over 6
 
440
 
 
441
 my $text = $d->fselect( path => '/path/to/a/file/or/directory' );
 
442
 
 
443
=back
 
444
 
 
445
=item DESCRIPTION
 
446
 
 
447
=over 6
 
448
 
 
449
Present the user with a file selection widget preset with the given path.
 
450
 
 
451
=back
 
452
 
 
453
=item RETURNS
 
454
 
 
455
=over 6
 
456
 
 
457
a SCALAR if the response is OK and FALSE (0) for anything else.
 
458
 
 
459
=back
 
460
 
 
461
=back
 
462
 
 
463
=head2 dselect( )
 
464
 
 
465
=over 4
 
466
 
 
467
=item EXAMPLE
 
468
 
 
469
=over 6
 
470
 
 
471
 my $text = $d->dselect( path => '/path/to/a/directory' );
 
472
 
 
473
=back
 
474
 
 
475
=item DESCRIPTION
 
476
 
 
477
=over 6
 
478
 
 
479
Present the user with a file selection widget preset with the given path.
 
480
Unlike fselect() this widget will only return a directory selection.
 
481
 
 
482
=back
 
483
 
 
484
=item RETURNS
 
485
 
 
486
=over 6
 
487
 
 
488
a SCALAR if the response is OK and FALSE (0) for anything else.
 
489
 
 
490
=back
 
491
 
 
492
=back
 
493
 
 
494
=head2 calendar( )
 
495
 
 
496
=over 4
 
497
 
 
498
=item EXAMPLE
 
499
 
 
500
=over 6
 
501
 
 
502
 my $date = $d->calendar( text => 'Pick a date...',
 
503
                          day => 1, month => 1, year => 1970 );
 
504
 my ($m,$d,$y) = split(/\//,$date);
 
505
 
 
506
 # or alternatively...
 
507
 
 
508
 $d->calendar( text => 'Pick a date...',
 
509
               day => 1, month => 1, year => 1970 );
 
510
 ($m,$d,$y) = $d->ra();
 
511
 
 
512
=back
 
513
 
 
514
=item DESCRIPTION
 
515
 
 
516
=over 6
 
517
 
 
518
Present the user with a calendar widget preset with the given date or if
 
519
none is specified, use the current date.
 
520
 
 
521
=back
 
522
 
 
523
=item RETURNS
 
524
 
 
525
=over 6
 
526
 
 
527
a SCALAR if the response is OK and FALSE (0) for anything else.
 
528
 
 
529
=back
 
530
 
 
531
=back
 
532
 
 
533
=head2 timebox( )
 
534
 
 
535
=over 4
 
536
 
 
537
=item EXAMPLE
 
538
 
 
539
=over 6
 
540
 
 
541
 my $time = $d->timebox( text => 'What time?' );
 
542
 my ($h,$m,$s) = split(/\:/,$time);
 
543
 
 
544
 # or alternatively...
 
545
 
 
546
 $d->timebox( text => 'What time?',
 
547
              hour => 10, minute => 01, second => 01 );
 
548
 my ($h,$m,$s) = $d->ra();
 
549
 
 
550
=back
 
551
 
 
552
=item DESCRIPTION
 
553
 
 
554
=over 6
 
555
 
 
556
Present the user with a time widget preset with the current time.
 
557
 
 
558
=back
 
559
 
 
560
=item RETURNS
 
561
 
 
562
=over 6
 
563
 
 
564
a SCALAR if the response is OK and FALSE (0) for anything else.
 
565
 
 
566
=back
 
567
 
 
568
=back
 
569
 
 
570
=head2 tailbox( )
 
571
 
 
572
=over 4
 
573
 
 
574
=item EXAMPLE
 
575
 
 
576
=over 6
 
577
 
 
578
 $d->tailbox( path => '/path/to/a/text/file' );
 
579
 
 
580
=back
 
581
 
 
582
=item DESCRIPTION
 
583
 
 
584
=over 6
 
585
 
 
586
Present the end user with a scrolling box containing the contents
 
587
of the given text file. The contents of the window is constantly updated
 
588
in a similar manner to that of the unix tail(1) command.
 
589
 
 
590
=back
 
591
 
 
592
=item RETURNS
 
593
 
 
594
=over 6
 
595
 
 
596
TRUE (1) if the response is OK and FALSE (0) for anything else.
 
597
 
 
598
=back
 
599
 
 
600
=back
 
601
 
 
602
=head2 gauge_start( )
 
603
 
 
604
=over 4
 
605
 
 
606
=item EXAMPLE
 
607
 
 
608
=over 6
 
609
 
 
610
 $d->gauge_start( text => 'gauge...', percentage => 1 );
 
611
 
 
612
=back
 
613
 
 
614
=item DESCRIPTION
 
615
 
 
616
=over 6
 
617
 
 
618
Display a meter bar to the user. This get's the widget realized but requires
 
619
the use of the other gauge_*() methods for functionality.
 
620
 
 
621
=back
 
622
 
 
623
=item RETURNS
 
624
 
 
625
=over 6
 
626
 
 
627
TRUE (1) if the widget loaded fine and FALSE (0) for anything else.
 
628
 
 
629
=back
 
630
 
 
631
=back
 
632
 
 
633
=head2 gauge_inc( )
 
634
 
 
635
=over 4
 
636
 
 
637
=item EXAMPLE
 
638
 
 
639
=over 6
 
640
 
 
641
 $d->gauge_inc( 1 );
 
642
 
 
643
=back
 
644
 
 
645
=item DESCRIPTION
 
646
 
 
647
=over 6
 
648
 
 
649
Increment the meter by the given amount.
 
650
 
 
651
=back
 
652
 
 
653
=item RETURNS
 
654
 
 
655
=over 6
 
656
 
 
657
TRUE (1) if the widget incremented fine and FALSE (0) for anything else.
 
658
 
 
659
=back
 
660
 
 
661
=back
 
662
 
 
663
=head2 gauge_dec( )
 
664
 
 
665
=over 4
 
666
 
 
667
=item EXAMPLE
 
668
 
 
669
=over 6
 
670
 
 
671
 $d->gauge_dec( 1 );
 
672
 
 
673
=back
 
674
 
 
675
=item DESCRIPTION
 
676
 
 
677
=over 6
 
678
 
 
679
Decrement the meter by the given amount.
 
680
 
 
681
=back
 
682
 
 
683
=item RETURNS
 
684
 
 
685
=over 6
 
686
 
 
687
TRUE (1) if the widget incremented fine and FALSE (0) for anything else.
 
688
 
 
689
=back
 
690
 
 
691
=back
 
692
 
 
693
=head2 gauge_set( )
 
694
 
 
695
=over 4
 
696
 
 
697
=item EXAMPLE
 
698
 
 
699
=over 6
 
700
 
 
701
 $d->gauge_set( 99 );
 
702
 
 
703
=back
 
704
 
 
705
=item DESCRIPTION
 
706
 
 
707
=over 6
 
708
 
 
709
Set the meter bar to the given amount.
 
710
 
 
711
=back
 
712
 
 
713
=item RETURNS
 
714
 
 
715
=over 6
 
716
 
 
717
TRUE (1) if the widget set fine and FALSE (0) for anything else.
 
718
 
 
719
=back
 
720
 
 
721
=back
 
722
 
 
723
=head2 gauge_text( )
 
724
 
 
725
=over 4
 
726
 
 
727
=item EXAMPLE
 
728
 
 
729
=over 6
 
730
 
 
731
 $d->gauge_text( 'string' );
 
732
 
 
733
=back
 
734
 
 
735
=item DESCRIPTION
 
736
 
 
737
=over 6
 
738
 
 
739
Set the meter bar message to the given string.
 
740
 
 
741
=back
 
742
 
 
743
=item RETURNS
 
744
 
 
745
=over 6
 
746
 
 
747
TRUE (1) if the widget set fine and FALSE (0) for anything else.
 
748
 
 
749
=back
 
750
 
 
751
=back
 
752
 
 
753
=head2 gauge_stop( )
 
754
 
 
755
=over 4
 
756
 
 
757
=item EXAMPLE
 
758
 
 
759
=over 6
 
760
 
 
761
 $d->gauge_stop();
 
762
 
 
763
=back
 
764
 
 
765
=item DESCRIPTION
 
766
 
 
767
=over 6
 
768
 
 
769
End the meter bar widget process. One of the flaws with gdialog is that the
 
770
gauge widget does not close properly and requies the end user to close the
 
771
gauge window when 100% has been reached. This is the second reason why I'm
 
772
glad gdialog is going the way of the dodo.
 
773
 
 
774
=back
 
775
 
 
776
=item RETURNS
 
777
 
 
778
=over 6
 
779
 
 
780
TRUE (1) if the widget closed fine and FALSE (0) for anything else.
 
781
 
 
782
=back
 
783
 
 
784
=back
 
785
 
 
786
=head1 SEE ALSO
 
787
 
 
788
=over 2
 
789
 
 
790
=item PERLDOC
 
791
 
 
792
 UI::Dialog
 
793
 UI::Dialog::Console
 
794
 UI::Dialog::Backend
 
795
 
 
796
=back
 
797
 
 
798
=over 2
 
799
 
 
800
=item MAN FILES
 
801
 
 
802
dialog(1)
 
803
 
 
804
=back
 
805
 
 
806
=head1 BUGS
 
807
 
 
808
Please email the author with any bug reports. Include the name of the
 
809
module in the subject line.
 
810
 
 
811
=head1 AUTHOR
 
812
 
 
813
Kevin C. Krinke, E<lt>kevin@krinke.caE<gt>
 
814
 
 
815
=head1 COPYRIGHT AND LICENSE
 
816
 
 
817
 Copyright (C) 2013  Kevin C. Krinke <kevin@krinke.ca>
 
818
 
 
819
 This library is free software; you can redistribute it and/or
 
820
 modify it under the terms of the GNU Lesser General Public
 
821
 License as published by the Free Software Foundation; either
 
822
 version 2.1 of the License, or (at your option) any later version.
 
823
 
 
824
 This library is distributed in the hope that it will be useful,
 
825
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 
826
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
827
 Lesser General Public License for more details.
 
828
 
 
829
 You should have received a copy of the GNU Lesser General Public
 
830
 License along with this library; if not, write to the Free Software
 
831
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 
832
 
 
833
=cut