infopower的汉字输入(200)(200分)

  • 主题发起人 主题发起人 0738
  • 开始时间 开始时间
0

0738

Unregistered / Unconfirmed
GUEST, unregistred user!
用TwwDBComboDlg连接一个整型子段,设置Picture为"*@",可以输入字符,
但无论如何不能输入汉字,请各位指教
 
整型子段?
 
不懂在说什么,整型字段当然不能输字符。
 
整型字段不能输字符。请把问题说清楚。
 
整型哦大哥!
 
对不起,可能我说的不是很清楚,我的问题是这样的:我用一个TwwDBComboDlg连接到一个
整型字段,例如客户ID,但操作员在利用键盘操作时,有可能输入客户的编号或名称,而没有
可能要求他一定要输入客户的ID(当然,最后实际写入的是ID,此时可利用
TwwDBComboDlg.DataLink.OnUpdateField事件).设置TwwDBComboDlg.Picture.PictureMask := '*@'时,
在Edit中可以输入字符或数字,但是却怎么也输入不了汉字。我想应该只有两种可能,
要么就是我的PictureMask设置错了,要么就是Picture属性根本就不支持汉字输入
 
没有人知道了吗?
 
'*@'掩码是什么意思?过滤什么啊?
 
softdog: 如果真不知道Infopower中的Picture有何作用的话,请仔细看了下面的说明
后再说话(摘自infopower关于picturemask的帮助原文)
Defining a PictureMask property string:

To define a PictureMask property string, use the following special characters for the definition of required characters, digits, repeats, literals, letter case conversion, and optional entries, along with any other character as a constant:

Character Description
# Any digit (0-9)
? Any letter (a-z or A-Z)
& Any letter (a-z or A-Z ?automatically converted to uppercase)
~ Any letter (a-z or A-Z ?automatically converted to lowercase)
@ Any character
! Any characters (letters automatically converted to uppercase
; Next character is to be used literally and not used as a picture mask character
* Repeat the following character any number of times. For instance *& means convert any number of characters to uppercase. To specify a specific number of times, follow the * with a number. For instance, to specify 5 numbers in a row, you would use *5{#}

[abc] Optional sequence of characters abc that do not need to be entered by the end-user
{a, b, c} Grouping operator. Set of a, b, or c. The end-user must choose either a, b, or c. For instance {Red,Green,Blue} means the end-user must choose either Red, Green, or Blue. Similarly {R,G,B} means the end-user must choose between the characters R, G, or B.
Note: The picture mask must be carefully constructed to avoid situations where one element completely contains another element in the group. For instance if you have 3 valid choices of Auto, Automobile, and Car, do NOT set the picture mask to {Auto,Automobile,Car}. Instead set the picture mask to {Auto[mobile],Car}.

If you enter any other character in a picture mask, InfoPower treats the character as a constant. When the end-user is entering a value in a field with a picture mask that contains constant values, and they come to the point where the constant value is specified, InfoPower automatically fills-in (enters or types) the constant for the end-user. This is known as Auto-Fill and requires the AutoFill property setting to be true, otherwise the constant characters will not be filled-in automatically.

Simple Examples:

#####[-####] Standard U.S.A. 5-digit postal code with optional 4-digit suffix (i.e. 12345 or 12345-6789). Optionally, this picture mask can be specified as *5{#}[-*4#]. This 搒horthand?method allows you to specify very long picture masks in just a few characters.
#&#&#& Standard Canadian postal code (i.e. 1A2B3C).
*! Any number or any character with all letters automatically converted to uppercase (i.e. 123abc becomes 123ABC).
{Yes,No} Either "Yes", "No", or blank (since the braces indicate that an entry in this field is optional). If the AutoFill property is set to true, all the user has to type is either 搚?or 搉?and the respective value is automatically entered into the field. If AutoFill is set to false, the user must enter the entire word, either 揧es?or 揘o?

&*? Letters, with first letter capitalized.
#[#][#] Numeric of 3 digits or less

Complex AutoFill Example:

{Red,Gr{ay,een},B{l{ack,ue},rown},White,Yellow}
 
0738:我看了你给的帮助信息。

我有一个疑问:你想在TwwDBComboDlg上进行什么样的过滤控制?

'*@'应该是不过滤任何输入字符,那这样的话也就失去了过滤的意义了。

不过不能输入汉字可能是这个原因:
@: Repeat the following character any number of times
因为汉字是双字节,所以这个过滤中无法同时处理2个字节的输入,尽管是any number of times.
我想,如果能把汉字的前半字节和后半字节拆开输入,那可能是可以的,不过那样也就失去使用意义了。
 
0738:我终于懂了你的意思了。

你是不是想这样:
用TwwDBComboDlg连接一个整形字段,但是在正常情况下,该TwwDBComboDlg中是不能输入除了
数字以外的任何字符的,然后你想通过设置TwwDBComboDlg.Picture来使该TwwDBComboDlg中可以
输入任何字符,在保存数据的时候用OnUpdateField控制真正返回数据库的值。

是这样吗?不能输入汉字应该是TwwDBComboDlg的问题,原因可能是我上面说的那样。

如果我没领会错你的意思,建议你不要用TwwDBComboDlg,使用TEDit,和数据库的感应自己写代码,
这样比较灵活一些。
 
没有人再有兴趣研究这一点了吗?
to softdog:
目前我不可能用TEdit来控制,因为太繁琐
 
看来ip2000中可能是没办法了,至少我不知道。

0738:如果实现了你说的功能有什么实际的用处呢?在输入上就控制用户数据数据的合法性,
不是比自己写代码控制方便一些吗?
 
问题我自己解决了,没办法,最后还是只能修改ip2000的底层事件
 
多人接受答案了。
 
后退
顶部