| 1 | # ---------------------------------------------------------------------- | ||
| 2 | # Curses::UI::PasswordEntry | ||
| 3 | # | ||
| 4 | # (c) 2001-2002 by Maurice Makaay. All rights reserved. | ||
| 5 | # This file is part of Curses::UI. Curses::UI is free software. | ||
| 6 | # You can redistribute it and/or modify it under the same terms | ||
| 7 | # as perl itself. | ||
| 8 | # | ||
| 9 | # Currently maintained by Marcus Thiesen | ||
| 10 | # e-mail: marcus@cpan.thiesenweb.de | ||
| 11 | # ---------------------------------------------------------------------- | ||
| 12 | |||
| 13 | # TODO: fix dox | ||
| 14 | |||
| 15 | package Curses::UI::PasswordEntry; | ||
| 16 | |||
| 17 | use strict; | ||
| 18 | use Curses; | ||
| 19 | use Curses::UI::TextEntry; | ||
| 20 | use Curses::UI::Common; | ||
| 21 | |||
| 22 | use vars qw($VERSION @ISA); | ||
| 23 | |||
| 24 | @ISA = qw( | ||
| 25 | Curses::UI::TextEntry | ||
| 26 | ); | ||
| 27 | |||
| 28 | $VERSION = '1.10'; | ||
| 29 | |||
| 30 | sub new () | ||
| 31 | { | ||
| 32 | my $class = shift; | ||
| 33 | |||
| 34 | my %userargs = @_; | ||
| 35 | keys_to_lowercase(\%userargs); | ||
| 36 | |||
| 37 | my %args = ( | ||
| 38 | -undolevels => 20, # number of undolevels. 0 = infinite | ||
| 39 | -homeonblur => 1, # cursor to homepos on blur? | ||
| 40 | -fg => -1, | ||
| 41 | -bg => -1, | ||
| 42 | |||
| 43 | %userargs, | ||
| 44 | |||
| 45 | -password => '*',# force password token | ||
| 46 | -showhardreturns => 0, | ||
| 47 | ); | ||
| 48 | |||
| 49 | # Create the entry. | ||
| 50 | my $this = $class->SUPER::new( %args); | ||
| 51 | |||
| 52 | return $this; | ||
| 53 | } | ||
| 54 | |||
| 55 | 1; | ||
| 56 | |||
| 57 | |||
| 58 | =pod | ||
| 59 | |||
| 60 | =head1 NAME | ||
| 61 | |||
| 62 | Curses::UI::PasswordEntry - Create and manipulate passwordentry widgets | ||
| 63 | |||
| 64 | =head1 CLASS HIERARCHY | ||
| 65 | |||
| 66 | Curses::UI::Widget | ||
| 67 | Curses::UI::Searchable | ||
| 68 | | | ||
| 69 | +----Curses::UI::TextEditor | ||
| 70 | | | ||
| 71 | +----Curses::UI::TextEntry | ||
| 72 | | | ||
| 73 | +----Curses::UI::PasswordEntry | ||
| 74 | |||
| 75 | |||
| 76 | =head1 SYNOPSIS | ||
| 77 | |||
| 78 | use Curses::UI; | ||
| 79 | my $cui = new Curses::UI; | ||
| 80 | my $win = $cui->add('window_id', 'Window'); | ||
| 81 | |||
| 82 | my $passwordentry = $win->add( | ||
| 83 | 'mypasswordentry', 'PasswordEntry' | ||
| 84 | ); | ||
| 85 | |||
| 86 | $passwordentry->focus(); | ||
| 87 | my $password = $passwordentry->get(); | ||
| 88 | |||
| 89 | |||
| 90 | =head1 DESCRIPTION | ||
| 91 | |||
| 92 | Curses::UI::PasswordEntry is a widget that can be used | ||
| 93 | to create a passwordentry widget. This class is | ||
| 94 | derived from Curses::UI::TextEntry. The | ||
| 95 | only special thing about this class is that the | ||
| 96 | B<-password> option is forced to '*'. | ||
| 97 | So for the usage of Curses::UI::PasswordEntry see | ||
| 98 | L<Curses::UI::TextEntry|Curses::UI::TextEntry>. | ||
| 99 | |||
| 100 | |||
| 101 | |||
| 102 | |||
| 103 | =head1 SEE ALSO | ||
| 104 | |||
| 105 | L<Curses::UI|Curses::UI>, | ||
| 106 | L<Curses::UI::TextEntry|Curses::UI::TextEntry>, | ||
| 107 | |||
| 108 | |||
| 109 | |||
| 110 | |||
| 111 | =head1 AUTHOR | ||
| 112 | |||
| 113 | Copyright (c) 2001-2002 Maurice Makaay. All rights reserved. | ||
| 114 | |||
| 115 | Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de) | ||
| 116 | |||
| 117 | |||
| 118 | This package is free software and is provided "as is" without express | ||
| 119 | or implied warranty. It may be used, redistributed and/or modified | ||
| 120 | under the same terms as perl itself. | ||
| 121 |