Re: XForms: input fields

From: T.C. Zhao (
Date: Sat Jun 10 2000 - 22:21:57 EDT

  • Next message: T.C. Zhao: "Re: XForms: Bug report for fl_show_fselector(..)"

    # To subscribers of the xforms list from "T.C. Zhao" <> :

    --- wrote:
    > # To subscribers of the xforms list from :
    > The following program is a modified version of one
    > of the example programs. It creates a form with
    > one input field with a filter, and maximum characters
    > set to 8.
    > I've noticed that if the field has the maximum characters (8)
    > entered, and if part of that field is selected, the next
    > keystroke causes an incorrect replacement of the selected
    > region. In fact, it requires two keystrokes to change
    > the field. It works fine if the field has less than
    > the maximum characters.
    > Also, why is the filter called twice for each keystroke.
    If you set return to FL_RETURN_END, it should be
    called only once. The filter parameter old==new and newc==0
    signifies the end of input. FL_RETURN_ALWAYS
    requires the end of input to happen on every keystroke.
    > Am I doing something incorrectly?

    No. It was a real bug in xforms. The string length
    was computed before the selection was deleted, causing
    the maxchar check to fail and short-circuited the redraw.


    > FL_INPUTVALIDATOR hex_filter(FL_OBJECT *ob, const char *old, const
    > char
    > *cur, int c)
    > {
    > printf("old (%s) new (%s) (%c) (%x)\n", old, cur, c,
    > c);fflush(stdout);
    > if (isxdigit(c))
    > else
    > }

    BTW, this is a wrong prototype. Your filter function
    should be decleared as int hex_filter().

    Do You Yahoo!?
    Yahoo! Photos -- now, 100 FREE prints!
    To unsubscribe, send the message "unsubscribe" to or see
    XForms Home Page:
    List Archive:

    This archive was generated by hypermail 2b29 : Sat Jun 10 2000 - 22:26:18 EDT