Changeset 738

Show
Ignore:
Timestamp:
06/27/09 14:47:03 (14 months ago)
Author:
sience
Message:

-another check added to prevent craah using key-combinations like CRTL+v

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lugre/widgets/lib.gui.widget.edittext.lua

    r727 r738  
    6666function gWidgetPrototype.EditText:ClearText () self:SetText("") end 
    6767 
    68 function gWidgetPrototype.EditText:AppendChar (char)  
     68function gWidgetPrototype.EditText:AppendChar (char) 
    6969        if (not char) then return end 
    7070        self.text = self.text .. char 
     
    7979 
    8080 
    81 function gWidgetPrototype.EditText:on_focus_keydown             (key,char)  
     81function gWidgetPrototype.EditText:on_focus_keydown             (key,char) 
    8282        if (key == key_return) then  
    8383                self:on_return() 
     
    101101                        return true 
    102102                elseif (true) then 
    103                         if ((not self.params.bNumbersOnly) or (char and IsNumber(char))) then 
     103                        if (type(char) == "boolean") then return true end 
     104                        if ( (not self.params.bNumbersOnly) or 
     105                                 (char and IsNumber(char)) ) then 
    104106                                self:CheckClearOnFirstKeyDown() 
    105107                                self:AppendChar(char,unicodechar)