From 4c59fab99c90921b989a7003e3cd79e3d7c7da5a Mon Sep 17 00:00:00 2001 From: shagu Date: Fri, 3 Jan 2020 01:03:12 +0100 Subject: [PATCH] ui-widgets: add function to create textboxes --- api/ui-widgets.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/ui-widgets.lua b/api/ui-widgets.lua index d138a27b..ff47c7a1 100644 --- a/api/ui-widgets.lua +++ b/api/ui-widgets.lua @@ -193,6 +193,18 @@ function pfUI.api.CreateScrollChild(name, parent) return f end +-- [ CreateTextBox ] +-- Creates and returns a default pfUI skinned EditBox +function pfUI.api.CreateTextBox(name, parent) + local f = CreateFrame("EditBox", name, parent) + f:SetScript("OnEscapePressed", function() this:ClearFocus() end) + f:SetAutoFocus(false) + f:SetTextInsets(5, 5, 5, 5) + f:SetFontObject(GameFontNormal) + CreateBackdrop(f, nil, true) + return f +end + -- [ EnableClickRotate ] -- Enables Modelframes to be rotated by click-drag -- 'frame' [frame] the modelframe that should be used