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