| 1 | package TUI::StdDlg::Const; | ||
| 2 | # ABSTRACT: Constants for standard dialog components | ||
| 3 | |||
| 4 | 21 | ▶ | use 5.010; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 21 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 21 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 21 | our $VERSION = '2.000002'; | |
| 9 | 21 | $VERSION =~ tr/_//d; | |
| 10 | 21 | our $AUTHORITY = 'cpan:BRICKPOOL'; | |
| 11 | |||
| 12 | 21 | ▶ | use Exporter 'import'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 21 | our @EXPORT_OK = qw( | |
| 15 | ); | ||
| 16 | |||
| 17 | 21 | our %EXPORT_TAGS = ( | |
| 18 | |||
| 19 | cdXXXX => [qw( | ||
| 20 | cdNormal | ||
| 21 | cdNoLoadDir | ||
| 22 | cdHelpButton | ||
| 23 | )], | ||
| 24 | |||
| 25 | cmXXXX => [qw( | ||
| 26 | cmFileOpen | ||
| 27 | cmFileReplace | ||
| 28 | cmFileClear | ||
| 29 | cmFileInit | ||
| 30 | cmChangeDir | ||
| 31 | cmRevert | ||
| 32 | cmDirSelection | ||
| 33 | |||
| 34 | cmFileFocused | ||
| 35 | cmFileDoubleClicked | ||
| 36 | )], | ||
| 37 | |||
| 38 | cpXXXX => [qw( | ||
| 39 | cpInfoPane | ||
| 40 | )], | ||
| 41 | |||
| 42 | fdXXXX => [qw( | ||
| 43 | fdOKButton | ||
| 44 | fdOpenButton | ||
| 45 | fdReplaceButton | ||
| 46 | fdClearButton | ||
| 47 | fdHelpButton | ||
| 48 | fdNoLoadDir | ||
| 49 | )], | ||
| 50 | |||
| 51 | FA_ => [qw( | ||
| 52 | FA_NORMAL | ||
| 53 | FA_RDONLY | ||
| 54 | FA_HIDDEN | ||
| 55 | FA_SYSTEM | ||
| 56 | FA_LABEL | ||
| 57 | FA_DIREC | ||
| 58 | FA_ARCH | ||
| 59 | )], | ||
| 60 | |||
| 61 | _A_ => [qw( | ||
| 62 | _A_NORMAL | ||
| 63 | _A_RDONLY | ||
| 64 | _A_HIDDEN | ||
| 65 | _A_SYSTEM | ||
| 66 | _A_VOLID | ||
| 67 | _A_SUBDIR | ||
| 68 | _A_ARCH | ||
| 69 | )], | ||
| 70 | |||
| 71 | DIR => [qw( | ||
| 72 | WILDCARDS | ||
| 73 | EXTENSION | ||
| 74 | FILENAME | ||
| 75 | DIRECTORY | ||
| 76 | DRIVE | ||
| 77 | )], | ||
| 78 | |||
| 79 | MAX => [qw( | ||
| 80 | MAXDRIVE | ||
| 81 | MAXPATH | ||
| 82 | MAXDIR | ||
| 83 | MAXFILE | ||
| 84 | MAXEXT | ||
| 85 | )], | ||
| 86 | |||
| 87 | ); | ||
| 88 | |||
| 89 | # add all the other %EXPORT_TAGS ":class" tags to the ":all" class and | ||
| 90 | # @EXPORT_OK, deleting duplicates | ||
| 91 | { | ||
| 92 | 21 | my %seen; | |
| 93 | push | ||
| 94 | @EXPORT_OK, | ||
| 95 | 903 | grep {!$seen{$_}++} @{$EXPORT_TAGS{$_}} | |
| 96 | 21 | foreach keys %EXPORT_TAGS; | |
| 97 | push | ||
| 98 | 21 | @{$EXPORT_TAGS{all}}, | |
| 99 | @EXPORT_OK; | ||
| 100 | } | ||
| 101 | |||
| 102 | # Commands | ||
| 103 | |||
| 104 | 21 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 105 | 21 | cmFileOpen => 1001, # Returned from TFileDialog when Open pressed | |
| 106 | cmFileReplace => 1002, # Returned from TFileDialog when Replace pressed | ||
| 107 | cmFileClear => 1003, # Returned from TFileDialog when Clear pressed | ||
| 108 | cmFileInit => 1004, # Used by TFileDialog internally | ||
| 109 | cmChangeDir => 1005, | ||
| 110 | cmRevert => 1006, # Used by TChDirDialog internally | ||
| 111 | cmDirSelection => 1007, # ! New event - Used by TChDirDialog internally .. | ||
| 112 | # .. and TDirListbox externally | ||
| 113 | 21 | }; | |
| 114 | |||
| 115 | # Messages | ||
| 116 | |||
| 117 | 21 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 118 | 21 | cmFileFocused => 102, # A new file was focused in the TFileList | |
| 119 | cmFileDoubleClicked => 103, # A file was selected in the TFileList | ||
| 120 | 21 | }; | |
| 121 | |||
| 122 | # TFileInfoPane palette layout | ||
| 123 | |||
| 124 | 21 | ▶ | use constant cpInfoPane => "\x1E"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 125 | |||
| 126 | # TFileDialog options | ||
| 127 | |||
| 128 | 21 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 129 | 21 | fdOKButton => 0x0001, # Put an OK button in the dialog | |
| 130 | fdOpenButton => 0x0002, # Put an Open button in the dialog | ||
| 131 | fdReplaceButton => 0x0004, # Put a Replace button in the dialog | ||
| 132 | fdClearButton => 0x0008, # Put a Clear button in the dialog | ||
| 133 | fdHelpButton => 0x0010, # Put a Help button in the dialog | ||
| 134 | fdNoLoadDir => 0x0100, # Do not load the current directory | ||
| 135 | # contents into the dialog at BUILD. | ||
| 136 | # This means you intend to change the | ||
| 137 | # wildCard by using setData or store | ||
| 138 | # the dialog on a stream. | ||
| 139 | 21 | }; | |
| 140 | |||
| 141 | # TChDirDialog options | ||
| 142 | |||
| 143 | 21 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 144 | 21 | cdNormal => 0x0000, # Option to use dialog immediately | |
| 145 | cdNoLoadDir => 0x0001, # Option to init the dialog to store on a stream | ||
| 146 | cdHelpButton => 0x0002, # Put a help button in the dialog | ||
| 147 | 21 | }; | |
| 148 | |||
| 149 | # DOS-Attributes for File Dialogs | ||
| 150 | |||
| 151 | 21 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 152 | 21 | FA_NORMAL => 0x00, # Normal file, no attributes | |
| 153 | FA_RDONLY => 0x01, # Read only attribute | ||
| 154 | FA_HIDDEN => 0x02, # Hidden file | ||
| 155 | FA_SYSTEM => 0x04, # System file | ||
| 156 | FA_LABEL => 0x08, # Volume label | ||
| 157 | FA_DIREC => 0x10, # Directory | ||
| 158 | FA_ARCH => 0x20, # Archive | ||
| 159 | 21 | }; | |
| 160 | |||
| 161 | # MSC names for file attributes | ||
| 162 | |||
| 163 | 21 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 164 | 21 | _A_NORMAL => 0x00, # Normal file, no attributes | |
| 165 | _A_RDONLY => 0x01, # Read only attribute | ||
| 166 | _A_HIDDEN => 0x02, # Hidden file | ||
| 167 | _A_SYSTEM => 0x04, # System file | ||
| 168 | _A_VOLID => 0x08, # Volume label | ||
| 169 | _A_SUBDIR => 0x10, # Directory | ||
| 170 | _A_ARCH => 0x20, # Archive | ||
| 171 | 21 | }; | |
| 172 | |||
| 173 | # Borland-RTL-Attributes for File Dialogs | ||
| 174 | |||
| 175 | 21 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 176 | 21 | WILDCARDS => 0x01, | |
| 177 | EXTENSION => 0x02, | ||
| 178 | FILENAME => 0x04, | ||
| 179 | DIRECTORY => 0x08, | ||
| 180 | DRIVE => 0x10, | ||
| 181 | 21 | }; | |
| 182 | |||
| 183 | 21 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 184 | 21 | MAXDRIVE => 3, | |
| 185 | MAXPATH => 260, | ||
| 186 | MAXDIR => 256, | ||
| 187 | MAXFILE => 256, | ||
| 188 | MAXEXT => 256, | ||
| 189 | 21 | }; | |
| 190 | |||
| 191 | 21 | 1 | |
| 192 | |||
| 193 | __END__ | ||