1. RE: ES_NUMERIC
- Posted by Brian Broker <bkb at cnw.com> Oct 22, 2002
- 398 views
Hi Rubens, Try ES_NUMBER. Find other edit styles at: http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolstyles.asp -- Brian Rubens wrote: > Hi people; > > The flag ES_NUMERIC is working or not in win2000 ??? > > Where can I find a list of flags for each control in the docs ? > I didn't find, for example, this flag in the win32lib doc. > > > Thanks > > Rubens > >
2. RE: ES_NUMERIC
- Posted by rubis at fem.unicamp.br Oct 22, 2002
- 398 views
Hi Brian; I test ES_NUMBER in the same code under win98 and win2000. It works only in win98. Thanks Rubens At 20:46 22/10/2002, you wrote: > >Hi Rubens, > >Try ES_NUMBER. > >Find other edit styles at: >>http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolstyles.asp > > >-- Brian > >Rubens wrote: > > Hi people; > > > > The flag ES_NUMERIC is working or not in win2000 ??? > > > > Where can I find a list of flags for each control in the docs ? > > I didn't find, for example, this flag in the win32lib doc. > > > > > > Thanks > > > > Rubens > > > > > >
3. Re: RE: ES_NUMERIC
- Posted by Derek Parnell <ddparnell at bigpond.com> Oct 22, 2002
- 394 views
Hello Rubens, ES_NUMBER (also known as ES_NUMERIC is win32lib) does not appear to be working in Windows 2000. An alternative (with more flexibility) is to do something like this.. constant vFldSize = { -1, fld1, fld3, fld5} constant vMaxSize = {9999, 4, 5, 19} function CharFilter(integer pChar, sequence pFilter) -- Echo the character if its in the list else return -1 if find(pChar, pFilter) then return pChar else return -1 end if end function procedure ForceDigit(integer self, integer event, sequence parms) returnValue(CharFilter(parms[1], "0123456789" & VK_BACKSPACE) ) end procedure procedure ForceHexDigit(integer self, integer event, sequence parms) returnValue(CharFilter(parms[1], "0123456789ABCDEF" & VK_BACKSPACE) ) end procedure procedure CheckSize(integer self, integer event, sequence parms) if parms[1] != VK_BACKSPACE then if length(getText(self)) >= vMaxSize[find(self, vFldSize)+1] then returnValue(-1) end if end if end procedure -- Trap all the fields that can only have digits. setHandler({fld2, fld3}, w32HKeyPress, routine_id("ForceDigit")) -- Trap all the fields that can only have hexadecimal digits. setHandler({fld1}, w32HKeyPress, routine_id("ForceHexDigit")) -- Trap all the fields that have size restrictions. setHandler({fld1, fld3, fld5}, w32HKeyPress, routine_id("CheckSize")) --------- Derek. 23/10/2002 9:46:55 AM, Brian Broker <bkb at cnw.com> wrote: > >Hi Rubens, > >Try ES_NUMBER. > >Find other edit styles at: >http://msdn.microsoft.com/library/en- us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolstyles.asp > > >-- Brian > >Rubens wrote: >> Hi people; >> >> The flag ES_NUMERIC is working or not in win2000 ??? >> >> Where can I find a list of flags for each control in the docs ? >> I didn't find, for example, this flag in the win32lib doc. >> >> >> Thanks >> >> Rubens >> >> > > > --------- Cheers, Derek Parnell ICQ# 7647806
4. Re: RE: ES_NUMERIC
- Posted by Derek Parnell <ddparnell at bigpond.com> Oct 22, 2002
- 377 views
Ooops. A bug in the example code. > constant vFldSize = { -1, fld1, fld3, fld5} should be constant vFldSize = { fld1, fld3, fld5} --------- Cheers, Derek Parnell ICQ# 7647806
5. Re: RE: ES_NUMERIC
- Posted by rubis at fem.unicamp.br Oct 24, 2002
- 391 views
Thanks for the code Derek ! I will try it. Rubens At 01:57 23/10/2002, you wrote: > >Hello Rubens, > >ES_NUMBER (also known as ES_NUMERIC is win32lib) does not appear to be >working in Windows 2000. > >An alternative (with more flexibility) is to do something like this.. > > constant vFldSize = { -1, fld1, fld3, fld5} > constant vMaxSize = {9999, 4, 5, 19} > > function CharFilter(integer pChar, sequence pFilter) > -- Echo the character if its in the list else return -1 > if find(pChar, pFilter) then > return pChar > else > return -1 > end if > end function > > procedure ForceDigit(integer self, integer event, sequence parms) > returnValue(CharFilter(parms[1], "0123456789" & VK_BACKSPACE) ) > end procedure > > procedure ForceHexDigit(integer self, integer event, sequence parms) > returnValue(CharFilter(parms[1], "0123456789ABCDEF" & VK_BACKSPACE) ) > end procedure > > procedure CheckSize(integer self, integer event, sequence parms) > if parms[1] != VK_BACKSPACE then > if length(getText(self)) >= vMaxSize[find(self, vFldSize)+1] then > returnValue(-1) > end if > end if > end procedure > > -- Trap all the fields that can only have digits. > setHandler({fld2, fld3}, w32HKeyPress, routine_id("ForceDigit")) > > -- Trap all the fields that can only have hexadecimal digits. > setHandler({fld1}, w32HKeyPress, routine_id("ForceHexDigit")) > > -- Trap all the fields that have size restrictions. > setHandler({fld1, fld3, fld5}, w32HKeyPress, routine_id("CheckSize")) > >--------- >Derek. > >23/10/2002 9:46:55 AM, Brian Broker <bkb at cnw.com> wrote: > > > > >Hi Rubens, > > > >Try ES_NUMBER. > > > >Find other edit styles at: > >http://msdn.microsoft.com/library/en- >>us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolstyles.asp > > > > > >-- Brian > > > >Rubens wrote: > >> Hi people; > >> > >> The flag ES_NUMERIC is working or not in win2000 ??? > >> > >> Where can I find a list of flags for each control in the docs ? > >> I didn't find, for example, this flag in the win32lib doc. > >> > >> > >> Thanks > >> > >> Rubens > >> > >> >--------- >Cheers, >Derek Parnell >ICQ# 7647806 > > >