refactoring
This commit is contained in:
@@ -26,9 +26,9 @@ StaticPopupDialogs.AUX_SEARCH_AUTO_BUY = {
|
||||
hideOnEscape = 1,
|
||||
}
|
||||
|
||||
private.RESULTS = 1
|
||||
private.SAVED = 2
|
||||
private.FILTER = 3
|
||||
public.RESULTS = 1
|
||||
public.SAVED = 2
|
||||
public.FILTER = 3
|
||||
|
||||
function LOAD()
|
||||
aux_search_tab_frame.create()
|
||||
|
||||
@@ -249,7 +249,7 @@ end
|
||||
private.post_filter = t
|
||||
private.filter_builder_state = T('selected', 0)
|
||||
|
||||
function private.data_link_click()
|
||||
function public.data_link_click()
|
||||
local button = arg3
|
||||
local index = tonumber(arg1)
|
||||
if button == 'LeftButton' then
|
||||
@@ -274,7 +274,7 @@ function private.add_component(component)
|
||||
tinsert(post_filter, filter_builder_state.selected, component)
|
||||
end
|
||||
|
||||
function private.add_post_filter()
|
||||
function public.add_post_filter()
|
||||
for str in present(filter_input:GetText()) do
|
||||
for filter in present(filter_util.filters[str]) do
|
||||
if filter.input_type ~= '' then
|
||||
@@ -316,7 +316,7 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
function private.set_filter_display_offset(x_offset, y_offset)
|
||||
function public.set_filter_display_offset(x_offset, y_offset)
|
||||
local scroll_frame = filter_display:GetParent()
|
||||
x_offset, y_offset = x_offset or scroll_frame:GetHorizontalScroll(), y_offset or scroll_frame:GetVerticalScroll()
|
||||
local width, height = filter_display_size()
|
||||
|
||||
@@ -177,7 +177,7 @@ function public.create()
|
||||
btn:SetWidth(30)
|
||||
btn:SetHeight(25)
|
||||
btn:SetText('<')
|
||||
btn:SetScript('OnClick', previous_search)
|
||||
btn:SetScript('OnClick', aux_search_tab_results.previous_search)
|
||||
public.previous_button = btn
|
||||
end
|
||||
do
|
||||
@@ -186,7 +186,7 @@ function public.create()
|
||||
btn:SetWidth(30)
|
||||
btn:SetHeight(25)
|
||||
btn:SetText('>')
|
||||
btn:SetScript('OnClick', next_search)
|
||||
btn:SetScript('OnClick', aux_search_tab_results.next_search)
|
||||
public.next_button = btn
|
||||
end
|
||||
do
|
||||
@@ -525,7 +525,7 @@ function public.create()
|
||||
if filter_parameter_input:IsVisible() then
|
||||
filter_parameter_input:SetFocus()
|
||||
else
|
||||
add_post_filter()
|
||||
aux_search_tab_filter.add_post_filter()
|
||||
end
|
||||
end
|
||||
public.filter_input = input
|
||||
@@ -538,7 +538,7 @@ function public.create()
|
||||
filter_input:SetFocus()
|
||||
end)
|
||||
input.char = function() this:complete() end
|
||||
input.enter = add_post_filter
|
||||
input.enter = aux_search_tab_filter.add_post_filter
|
||||
input:Hide()
|
||||
public.filter_parameter_input = input
|
||||
end
|
||||
@@ -564,7 +564,7 @@ function public.create()
|
||||
local new_x_offset = this.x_offset + x - this.x
|
||||
local new_y_offset = this.y_offset + y - this.y
|
||||
|
||||
set_filter_display_offset(new_x_offset - this.x_extra, new_y_offset - this.y_extra)
|
||||
aux_search_tab_filter.set_filter_display_offset(new_x_offset - this.x_extra, new_y_offset - this.y_extra)
|
||||
|
||||
this.x_extra = max(this.x_extra, new_x_offset)
|
||||
this.y_extra = min(this.y_extra, new_y_offset)
|
||||
@@ -580,7 +580,7 @@ function public.create()
|
||||
scroll_child:SetTextColor('p', color.label.enabled())
|
||||
scroll_child:SetWidth(1)
|
||||
scroll_child:SetHeight(1)
|
||||
scroll_child:SetScript('OnHyperlinkClick', data_link_click)
|
||||
scroll_child:SetScript('OnHyperlinkClick', aux_search_tab_filter.data_link_click)
|
||||
-- scroll_child:SetHyperlinkFormat("format") TODO
|
||||
scroll_child.measure = scroll_child:CreateFontString()
|
||||
public.filter_display = scroll_child
|
||||
|
||||
@@ -118,13 +118,13 @@ do
|
||||
update_search(getn(searches))
|
||||
end
|
||||
|
||||
function private.previous_search()
|
||||
function public.previous_search()
|
||||
search_box:ClearFocus()
|
||||
update_search(search_index - 1)
|
||||
subtab = RESULTS
|
||||
end
|
||||
|
||||
function private.next_search()
|
||||
function public.next_search()
|
||||
search_box:ClearFocus()
|
||||
update_search(search_index + 1)
|
||||
subtab = RESULTS
|
||||
|
||||
Reference in New Issue
Block a user