On Wed, May 29, 2002 at 05:01:07PM +0200, Pascal Bauermeister wrote: > Hello, > > this may have been discussed before, but is there a way to filter inputs > in a PG_WIDGET_FIELD ? > > I would find useful to be able to register a validation function > (provided by the application) to the widget, that gets the string as it > would be if the key stroke is accepted; the function would check the > string and return a boolean to accept or reject it, and finally the > field would hold either the new string or the old value accordingly. > > This principle allows a great flexibility, like regex checking, length > checking, etc. etc. > > If this is not yet available, and if you all agree (or don't care), we > would like to implement it, but I need from you Micah a few hints to > start.
This sounds good. For implementation, you could have a widget property you turn on to enable this filtering, then when the field contents changes the field sends an event to the app, then if the app accepts the new contents it sets it. Something like this: 1. App sets PG_WP_VALIDATION to 1 2. Field initially contains "moo" 3. User presses "!" 4. Field sends an event to the app (PG_WE_MODIFY maybe) with the data "moo!" 5. If the app's input validation agrees that this is a valid value, it sets the field's PG_WP_TEXT to "moo!" > > Regards, > > Pascal > > > -- > Pascal Bauermeister > Head of Software Development > > SMARTDATA > PSE-A / EPFL > CH-1015 Lausanne > > http://www.smartdata.ch > mailto:[EMAIL PROTECTED] > Phone: +41 (21) 693 84 98 > fax: +41 (21) 693 84 91 > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Pgui-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/pgui-devel -- Only you can prevent creeping featurism! _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink _______________________________________________ Pgui-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/pgui-devel
