Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Начинающим";
Текущий архив: 2011.05.15;
Скачать: [xml.tar.bz2];

Вниз

Шаблон   Найти похожие ветки 

 
И. Павел ©   (2011-02-04 08:33) [0]

Здравствуйте.

Хочу сделать в TMaskEdit (точнее в TsMaskEdit, но разница невелика) шаблон, содержащий прямые слеши ("/") между символами. В справке обещают, что после обратного слеша можно писать любой символ, и он не будет воспринят как управляющий, но конструкция "\/" выдает двоеточие (разделитель времени на моем компьютере). Подскажите, пожалуйста, можно ли в шаблон TNaskEdit вставить именно "/"?

Заранее спасибо.


 
sniknik ©   (2011-02-04 10:03) [1]

Represents the mask that validates and formats user input.

Unit

MaskUtils or QMask

Delphi syntax:

type TEditMask = type string;

C++ syntax:

typedef AnsiString TEditMask

Description

TEditMask is a string that consists of three fields with semicolons separating them. The first part of the mask is the mask itself. The second part is the character that determines whether the literal characters of a mask are saved as part of the data. The third part of the mask is the character used to represent unentered characters in the mask.

These are the special characters used in the first field of the mask:

Character Meaning in mask

! If a ! character appears in the mask, optional characters are represented in the text as leading blanks. If a ! character is not present, optional characters are represented in the text as trailing blanks.
> If a > character appears in the mask, all characters that follow are in uppercase until the end of the mask or until a < character is encountered.
< If a < character appears in the mask, all characters that follow are in lowercase until the end of the mask or until a > character is encountered.

<> If these two characters appear together in a mask, no case checking is done and the data is formatted with the case the user uses to enter the data.
\ The character that follows a \ character is a literal character. Use this character to use any of the mask special characters as a literal in the data.
L The L character requires an alphabetic character only in this position. For the US, this is A-Z, a-z.
l The l character permits only an alphabetic character in this position, but doesn"t require it.

A The A character requires an alphanumeric character only in this position. For the US, this is A-Z, a-z, 0-9.
a The a character permits an alphanumeric character in this position, but doesn"t require it.
C The C character requires an arbitrary character in this position.
c The c character permits an arbitrary character in this position, but doesn"t require it.
0 The 0 character requires a numeric character only in this position.
9 The 9 character permits a numeric character in this position, but doesn"t require it.

# The # character permits a numeric character or a plus or minus sign in this position, but doesn"t require it.
: The : character is used to separate hours, minutes, and seconds in times. If the character that separates hours, minutes, and seconds is different in the regional settings of the Control Panel utility on your computer system, that character is used instead.
/ The / character is used to separate months, days, and years in dates. If the character that separates months, days, and years is different in the regional settings of the Control Panel utility on your computer system, that character is used instead.

; The ; character is used to separate the three fields of the mask.
_ The _ character automatically inserts spaces into the text. When the user enters characters in the field, the cursor skips the _ character.


 
И. Павел ©   (2011-02-04 10:09) [2]


> [1] sniknik ©   (04.02.11 10:03)


Такую справку я находил. У меня EditMask = "\/;1;_". Если учитывать:

> \ The character that follows a \ character is a literal
> character. Use this character to use any of the mask special
> characters as a literal in the data.

то в поле EditMask должен появиться литерал "/", а у меня появляется точка (не двоеточие, а точка - разделитель даты, я спутался, но суть не меняется - мне не нужны ни точка, ни двоеточие).


 
sniknik ©   (2011-02-04 11:30) [3]

точно, в стандартном TMaskEdit в D7 так и есть, в коде стоит безусловная замена для ...
function MaskIntlLiteralToChar(IChar: Char): Char;
begin
 Result := IChar;
 case IChar of
   mMskTimeSeparator: Result := TimeSeparator;
   mMskDateSeparator: Result := DateSeparator;
 end;
end;

независимо от предыдущего управляющего символа.

ну, либо править, либо искать замену.


 
И. Павел ©   (2011-02-04 11:41) [4]

> [3] sniknik ©   (04.02.11 11:30)

Ясно. Спасибо. В генотип лезть не буду. Тогда либо наследуюсь, либо придумаю альтернативу.



Страницы: 1 вся ветка

Форум: "Начинающим";
Текущий архив: 2011.05.15;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.47 MB
Время: 0.003 c
2-1296987414
Fr
2011-02-06 13:16
2011.05.15
использование TDialogOpen


15-1296077394
Юрий
2011-01-27 00:29
2011.05.15
С днем рождения ! 27 января 2011 четверг


15-1296651069
Сергей М.
2011-02-02 15:51
2011.05.15
Удал.доступ к виндовому раб.столу и ввод кириллицы в DOS-прил-я


2-1296832003
John McLein
2011-02-04 18:06
2011.05.15
проверка условия в Assert


15-1296595780
Юрий
2011-02-02 00:29
2011.05.15
С днем рождения ! 2 февраля 2011 среда





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский