Hi SDPhantom and AmadiDooke
Yes, I have already tried expanding the edit box and adjusting the insets, all without success.
When I try a test of just the edit box using the following code it works perfectly;
Lua Code:
local TestScaleNumber = 123
local function updateTextBoxNumber(scaleNumber)
if scaleNumber >= 301 then -- if the entered number is too high
scaleNumber = 300
elseif scaleNumber <= 49 then -- if the entered number is too low
scaleNumber = 50
end
TestScaleNumber = scaleNumber / 100
TestScaleBox:SetText(scaleNumber)
end
local TestScaleBox =
CreateFrame("EditBox", "TestScaleBox", UIParent, "ChatConfigBoxTemplate")
TestScaleBox:SetPoint("CENTER")
TestScaleBox:SetFontObject(NumberFontNormalLargeYellow)
TestScaleBox:SetNumeric(true)
TestScaleBox:SetSize(40, 25)
TestScaleBox:SetMaxLetters(3)
TestScaleBox:SetAutoFocus()
TestScaleBox:SetText("")
TestScaleBox:SetJustifyH("CENTER")
TestScaleBox:SetScript(
"OnEnterPressed",
function(self)
scaleNumber = tonumber(TestScaleBox:GetText())
print(scaleNumber) -- debug --
self:ClearFocus()
updateTextBoxNumber(scaleNumber)
end
)
updateTextBoxNumber(TestScaleNumber)
This code uses the same edit box code and the same function code, other than the UIParent.