Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed text changing in text entry
When updating from history or from the menu, the proper function(s)
is/are being called now, to allow autocomplete support and
callback/event support.
  • Loading branch information
vercas committed Dec 19, 2013
1 parent b62f338 commit 064effc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions garrysmod/lua/vgui/dtextentry.lua
Expand Up @@ -148,6 +148,8 @@ function PANEL:UpdateFromHistory()
self:SetText( text )
self:SetCaretPos( text:len() )
self:OnTextChanged()
self.HistoryPos = pos
Expand Down Expand Up @@ -175,6 +177,8 @@ function PANEL:UpdateFromMenu()
self:SetText( txt )
self:SetCaretPos( txt:len() )
self:OnTextChanged(true)
self.HistoryPos = pos
Expand All @@ -183,7 +187,7 @@ end
--[[---------------------------------------------------------
OnTextChanged
-----------------------------------------------------------]]
function PANEL:OnTextChanged()
function PANEL:OnTextChanged(noMenuRemoval)
self.HistoryPos = 0
Expand All @@ -192,7 +196,7 @@ function PANEL:OnTextChanged()
self:OnValueChange( self:GetText() )
end
if ( IsValid( self.Menu ) ) then
if ( IsValid( self.Menu ) and not noMenuRemoval ) then
self.Menu:Remove()
end
Expand Down

0 comments on commit 064effc

Please sign in to comment.