adam@0: local _, AskMrRobot = ... yellowfive@11: local L = AskMrRobot.L; adam@0: adam@0: -- initialize the ImportTab class adam@0: AskMrRobot.ImportTab = AskMrRobot.inheritsFrom(AskMrRobot.Frame) adam@0: adam@0: function AskMrRobot.ImportTab:new(parent) adam@0: adam@0: local tab = AskMrRobot.Frame:new(nil, parent) adam@0: setmetatable(tab, { __index = AskMrRobot.ImportTab }) adam@0: tab:SetPoint("TOPLEFT") adam@0: tab:SetPoint("BOTTOMRIGHT") adam@0: tab:Hide() adam@0: adam@0: -- import button adam@0: tab.button = CreateFrame("Button", "AmrImportButton", tab, "UIPanelButtonTemplate") adam@0: tab.button:SetPoint("BOTTOM") yellowfive@11: tab.button:SetText(L.AMR_IMPORTTAB_BUTTON) adam@0: tab.button:SetWidth(100) adam@0: tab.button:SetHeight(20) adam@0: tab.button:SetPoint("BOTTOM", 0, 15) adam@0: adam@0: local text = tab:CreateFontString("AmrImportText1", "ARTWORK", "GameFontNormalLarge") adam@0: text:SetPoint("TOPLEFT", 0, -5) yellowfive@11: text:SetFormattedText(L.AMR_IMPORTTAB_TITLE) adam@0: adam@0: text = tab:CreateFontString("AmrImportText2", "ARTWORK", "GameFontWhite") adam@0: text:SetPoint("TOPLEFT", "AmrImportText1", "BOTTOMLEFT", 0, -20) adam@0: text:SetPoint("RIGHT", 0, -20) adam@0: text:SetWidth(text:GetWidth()) adam@0: text:SetJustifyH("LEFT") yellowfive@11: text:SetText(L.AMR_IMPORTTAB_INSTRUCTIONS_1) adam@0: adam@0: local image = tab:CreateTexture(nil, "BACKGROUND") adam@0: image:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 16, -10) adam@0: image:SetTexture("Interface\\AddOns\\AskMrRobot\\Media\\AddonExport") adam@0: image:SetSize(256, 256) adam@0: adam@0: text = tab:CreateFontString("AmrImportText3", "ARTWORK", "GameFontWhite") adam@0: text:SetPoint("TOPLEFT", image, "BOTTOMLEFT", -16, 24) adam@0: text:SetPoint("RIGHT", -15, 40) adam@0: text:SetWidth(text:GetWidth()) adam@0: text:SetJustifyH("LEFT") yellowfive@11: text:SetText(L.AMR_IMPORTTAB_INSTRUCTIONS_2) adam@0: adam@0: local scrollFrame = CreateFrame("ScrollFrame", "AmrImportScrollFrame", tab, "InputScrollFrameTemplate") adam@0: scrollFrame:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 5, -10) adam@0: scrollFrame:SetPoint("BOTTOM", "AmrImportButton", "TOP", 0, 10) adam@0: scrollFrame:SetPoint("RIGHT", -30, 0) adam@0: scrollFrame:SetWidth(430) adam@0: scrollFrame.EditBox:SetWidth(scrollFrame:GetWidth()) adam@0: scrollFrame.EditBox:SetMaxLetters(1100) adam@0: scrollFrame.CharCount:Hide() yellowfive@11: scrollFrame.EditBox.PromptText:SetText(L.AMR_IMPORTTAB_INSTRUCTIONS_3) adam@0: scrollFrame.EditBox:SetFocus() adam@0: scrollFrame.EditBox:HighlightText() adam@0: tab.scrollFrame = scrollFrame adam@0: adam@0: tab:SetScript("OnShow", function() adam@0: tab.scrollFrame.EditBox:HighlightText() adam@0: tab.scrollFrame.EditBox:SetFocus() adam@0: end) adam@0: adam@0: return tab adam@0: end