@@ -67,9 +67,16 @@ local EditClass = newClass("EditControl", "ControlHost", "Control", "UndoHandler
67
67
self .controls .buttonDown = new (" ButtonControl" , {" RIGHT" ,self ," RIGHT" }, {- 2 , 0 , buttonSize , buttonSize }, " -" , function ()
68
68
self :OnKeyUp (" DOWN" )
69
69
end )
70
+ self .controls .buttonDown .enabled = function ()
71
+ return self :IsEnabled ()
72
+ end
73
+
70
74
self .controls .buttonUp = new (" ButtonControl" , {" RIGHT" ,self .controls .buttonDown ," LEFT" }, {- 1 , 0 , buttonSize , buttonSize }, " +" , function ()
71
75
self :OnKeyUp (" UP" )
72
76
end )
77
+ self .controls .buttonUp .enabled = function ()
78
+ return self :IsEnabled ()
79
+ end
73
80
elseif clearable then
74
81
self .controls .buttonClear = new (" ButtonControl" , {" RIGHT" ,self ," RIGHT" }, {- 2 , 0 , buttonSize , buttonSize }, " x" , function ()
75
82
self :SetText (" " , true )
@@ -277,10 +284,8 @@ function EditClass:Draw(viewPort, noTooltip)
277
284
end
278
285
textX = textX + DrawStringWidth (textHeight , self .font , self .prompt ) + textHeight / 2
279
286
end
280
- if not enabled then
281
- return
282
- end
283
- if mOver and not noTooltip then
287
+
288
+ if enabled and mOver and not noTooltip then
284
289
SetDrawLayer (nil , 100 )
285
290
self :DrawTooltip (x , y , width , height , viewPort )
286
291
SetDrawLayer (nil , 0 )
@@ -290,7 +295,7 @@ function EditClass:Draw(viewPort, noTooltip)
290
295
local marginR = self .controls .scrollBarV :IsShown () and 14 or 0
291
296
local marginB = self .controls .scrollBarH :IsShown () and 14 or 0
292
297
SetViewport (textX , textY , width - 4 - marginL - marginR , height - 4 - marginB )
293
- if not self .hasFocus then
298
+ if not enabled or not self .hasFocus then
294
299
if self .buf == ' ' and self .placeholder then
295
300
SetDrawColor (self .disableCol )
296
301
DrawString (- self .controls .scrollBarH .offset , - self .controls .scrollBarV .offset , " LEFT" , textHeight , self .font , self .placeholder )
0 commit comments