[Gambas-user] Miscellaneous routines for text box validation
Stefano Palmeri
rospolosco at ...152...
Fri Feb 8 12:56:19 CET 2008
Alle 11:32, venerdì 8 febbraio 2008, Stefano Palmeri ha scritto:
> Alle 04:39, venerdì 8 febbraio 2008, richard terry ha scritto:
> > Hi all,
> >
> > My gambas learning project is progressing well (a contacts database
> > manager), and I've got the point I can create new
> > people/names/address(es), etc, now have to fine tune the gui, so not
> > wanting to re-invent the wheel, I wondered if anyone had in their
> > possession, or pointers to it, code which would do stuff like.
> >
> > for textboxes:
> >
> > Autocapitalise, or autocaps
> > Date validation routines/formatting routines
> > Name auto capitalisation eg for McBeth, or O'Neil etc
> >
> > Also In VB in the textbox routines one had (index, keyascii) and one
> > could manipulate the keyascii value to whatever to either exclude keys or
> > autocapitalise things etc
> >
> > I wondered how this worked in gambas, as though I can detect the
> > keypress, I couldnt see a way to send back a changed key value to the
> > textbox.
> >
> > Thanks in anticipation.
> >
> >
> > Richard
>
> Hi, Richard.
>
> In the attached example, you have a form with a textbox.
> What it does:
>
> 1) it autocapitalises the text when it changes
>
> 2) print the ascii code of the pressed key
>
> 3) it doesn't allow "W" or "w"
>
> 4) when you press space bar it becomes an underscore
>
> all is commented in the code, so you see what does what.
>
> I think it will not be difficult for you to manage Mc or O'
> using string manipulation functions.
>
> Regards,
>
> Stefano Palmeri
>
Please, use the attached 0.0.2 source as I fixed a bug.
Stefano
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
-------------- next part --------------
A non-text attachment was scrubbed...
Name: textboxstuff-0.0.2.tar.gz
Type: application/x-tgz
Size: 8181 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20080208/1639c766/attachment.bin>
More information about the User
mailing list