Mercurial > wow > askmrrobot
diff ui/ImportTab.lua @ 17:e77e01abce98
Warlords of Draenor pre-patch
author | Adam tegen <adam.tegen@gmail.com> |
---|---|
date | Mon, 13 Oct 2014 21:28:32 -0500 |
parents | ece9167c0d1c |
children |
line wrap: on
line diff
--- a/ui/ImportTab.lua Thu Jul 10 15:32:11 2014 -0700 +++ b/ui/ImportTab.lua Mon Oct 13 21:28:32 2014 -0500 @@ -12,54 +12,61 @@ tab:SetPoint("BOTTOMRIGHT") tab:Hide() - -- import button - tab.button = CreateFrame("Button", "AmrImportButton", tab, "UIPanelButtonTemplate") - tab.button:SetPoint("BOTTOM") - tab.button:SetText(L.AMR_IMPORTTAB_BUTTON) - tab.button:SetWidth(100) - tab.button:SetHeight(20) - tab.button:SetPoint("BOTTOM", 0, 15) - local text = tab:CreateFontString("AmrImportText1", "ARTWORK", "GameFontNormalLarge") text:SetPoint("TOPLEFT", 0, -5) text:SetFormattedText(L.AMR_IMPORTTAB_TITLE) text = tab:CreateFontString("AmrImportText2", "ARTWORK", "GameFontWhite") text:SetPoint("TOPLEFT", "AmrImportText1", "BOTTOMLEFT", 0, -20) - text:SetPoint("RIGHT", 0, -20) + text:SetPoint("RIGHT", -15, 0) text:SetWidth(text:GetWidth()) text:SetJustifyH("LEFT") text:SetText(L.AMR_IMPORTTAB_INSTRUCTIONS_1) - local image = tab:CreateTexture(nil, "BACKGROUND") - image:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 16, -10) - image:SetTexture("Interface\\AddOns\\AskMrRobot\\Media\\AddonExport") - image:SetSize(256, 256) - text = tab:CreateFontString("AmrImportText3", "ARTWORK", "GameFontWhite") - text:SetPoint("TOPLEFT", image, "BOTTOMLEFT", -16, 24) - text:SetPoint("RIGHT", -15, 40) + text:SetPoint("TOPLEFT", "AmrImportText2", "BOTTOMLEFT", 0, -10) + text:SetPoint("RIGHT", -15, 0) text:SetWidth(text:GetWidth()) text:SetJustifyH("LEFT") text:SetText(L.AMR_IMPORTTAB_INSTRUCTIONS_2) local scrollFrame = CreateFrame("ScrollFrame", "AmrImportScrollFrame", tab, "InputScrollFrameTemplate") scrollFrame:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 5, -10) - scrollFrame:SetPoint("BOTTOM", "AmrImportButton", "TOP", 0, 10) scrollFrame:SetPoint("RIGHT", -30, 0) scrollFrame:SetWidth(430) + scrollFrame:SetHeight(60); scrollFrame.EditBox:SetWidth(scrollFrame:GetWidth()) - scrollFrame.EditBox:SetMaxLetters(1100) + scrollFrame.EditBox:SetMaxLetters(2400) scrollFrame.CharCount:Hide() - scrollFrame.EditBox.PromptText:SetText(L.AMR_IMPORTTAB_INSTRUCTIONS_3) scrollFrame.EditBox:SetFocus() scrollFrame.EditBox:HighlightText() tab.scrollFrame = scrollFrame - + + tab.button = CreateFrame("Button", "AmrImportButton", tab, "UIPanelButtonTemplate") + tab.button:SetText(L.AMR_IMPORTTAB_BUTTON) + tab.button:SetWidth(100) + tab.button:SetHeight(20) + tab.button:SetPoint("BOTTOM", tab, "BOTTOM", 0, 20) + scrollFrame:SetPoint("BOTTOM", tab.button, "TOP", 0, 15) + tab:SetScript("OnShow", function() tab.scrollFrame.EditBox:HighlightText() tab.scrollFrame.EditBox:SetFocus() + tab:Update() end) return tab end + +function AskMrRobot.ImportTab:GetImportText() + return self.scrollFrame.EditBox:GetText() +end + +function AskMrRobot.ImportTab:SetImportText(text) + self.scrollFrame.EditBox:SetText(text) + self.scrollFrame.EditBox:HighlightText() +end + +-- update the panel and state +function AskMrRobot.ImportTab:Update() +end \ No newline at end of file