1. RE: ES_NUMERIC

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
> 
>

new topic     » topic index » view message » categorize

2. RE: ES_NUMERIC

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
> >
> >
>
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: RE: ES_NUMERIC

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: RE: ES_NUMERIC

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: RE: ES_NUMERIC

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
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu