July 21th Tuesday (七月 二十一日 火曜日)

  A programmer creating a new validator class should provide the following functionality.

  A validator constructor is responsible for allowing the programmer to specify the kind of validation required, and perhaps
a pointer to a C++ variable that is used for storing the data for the control.  If such a variable address is not supplied by
the user, then the validator should store the data internally.

  The wxValidator::Validate member function should return true if the data in the control (not the C++ variable) is valid.
It should also show an appropriate message if data was not valid.

  The wxValidator::TransferToWindow member function should transfer the data from the validator or associated C++ variable to
the control.

  The wxValidator::TransferFromWindow member function should transfer the data from the control to the validator or associated
C++ variable.

  There should be a copy constructor, and a wxValidator::Clone function which returns a copy of the validator object.  This is
important because validators are passed by reference to window constructors, and must therefore be cloned internally.

  You can optionally define event handlers for the validator, to implement filtering. These handlers will capture events before
the control itself does.

  For an example implementation, see the valtext.h and valtext.cpp files in the wxWidgets library.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值