From f7134bee012d98fbb792d1d9c712cbf68dfec379 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Tue, 23 Mar 2010 02:38:07 -0400 Subject: [PATCH] For the search_box: Highlight the text in the box when pressing enter, gaining focus, or having non-default text set so users can start typing over the previous entry immediately. --- Frame.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Frame.lua b/Frame.lua index b5e5f48..2cb984c 100644 --- a/Frame.lua +++ b/Frame.lua @@ -1422,6 +1422,7 @@ MainPanel.search_editbox:SetScript("OnEnterPressed", if searchtext and searchtext ~= L["SEARCH_BOX_DESC"] then self.prev_search = searchtext + self:HighlightText() self:AddHistoryLine(searchtext) SearchRecipes(searchtext) MainPanel.scroll_frame:Update(false, false) @@ -1437,7 +1438,7 @@ MainPanel.search_editbox:SetScript("OnEnterPressed", MainPanel.search_editbox:SetScript("OnEditFocusGained", function(self) if self:GetText() == L["SEARCH_BOX_DESC"] then - self:SetText("") + self:HighlightText() end end) @@ -1458,6 +1459,7 @@ MainPanel.search_editbox:SetScript("OnTextSet", local text = self:GetText() if text ~= "" and text ~= L["SEARCH_BOX_DESC"] and text ~= self.prev_search then + self:HighlightText() ARL_SearchButton:SetNormalFontObject("GameFontNormalSmall") ARL_SearchButton:Enable() else -- 1.7.9.5