editbox changes

This commit is contained in:
Manuel Simon Hirsig
2016-08-19 16:03:29 +02:00
parent 829483900e
commit 37e789184b
18 changed files with 422 additions and 404 deletions
+188 -188
View File
@@ -4,40 +4,40 @@ FILTER_SPACING = 28.5
function create_frames()
frame = CreateFrame('Frame', nil, aux.frame)
m.frame:SetAllPoints()
m.frame:SetScript('OnUpdate', m.on_update)
m.frame:Hide()
frame:SetAllPoints()
frame:SetScript('OnUpdate', on_update)
frame:Hide()
m.frame.filter = aux.gui.panel(m.frame)
m.frame.filter:SetAllPoints(aux.frame.content)
frame.filter = aux.gui.panel(frame)
frame.filter:SetAllPoints(aux.frame.content)
m.frame.results = aux.gui.panel(m.frame)
m.frame.results:SetAllPoints(aux.frame.content)
frame.results = aux.gui.panel(frame)
frame.results:SetAllPoints(aux.frame.content)
m.frame.saved = CreateFrame('Frame', nil, m.frame)
m.frame.saved:SetAllPoints(aux.frame.content)
frame.saved = CreateFrame('Frame', nil, frame)
frame.saved:SetAllPoints(aux.frame.content)
m.frame.saved.favorite = aux.gui.panel(m.frame.saved)
m.frame.saved.favorite:SetWidth(378.5)
m.frame.saved.favorite:SetPoint('TOPLEFT', 0, 0)
m.frame.saved.favorite:SetPoint('BOTTOMLEFT', 0, 0)
frame.saved.favorite = aux.gui.panel(frame.saved)
frame.saved.favorite:SetWidth(378.5)
frame.saved.favorite:SetPoint('TOPLEFT', 0, 0)
frame.saved.favorite:SetPoint('BOTTOMLEFT', 0, 0)
m.frame.saved.recent = aux.gui.panel(m.frame.saved)
m.frame.saved.recent:SetWidth(378.5)
m.frame.saved.recent:SetPoint('TOPRIGHT', 0, 0)
m.frame.saved.recent:SetPoint('BOTTOMRIGHT', 0, 0)
frame.saved.recent = aux.gui.panel(frame.saved)
frame.saved.recent:SetWidth(378.5)
frame.saved.recent:SetPoint('TOPRIGHT', 0, 0)
frame.saved.recent:SetPoint('BOTTOMRIGHT', 0, 0)
do
local btn = aux.gui.button(m.frame)
local btn = aux.gui.button(frame)
btn:SetPoint('TOPLEFT', 0, 0)
btn:SetWidth(42)
btn:SetHeight(42)
btn:SetScript('OnClick', function()
if this.open then
m.settings:Hide()
m.controls:Show()
settings:Hide()
controls:Show()
else
m.settings:Show()
m.controls:Hide()
settings:Show()
controls:Hide()
end
this.open = not this.open
end)
@@ -52,34 +52,34 @@ function create_frames()
settings_button = btn
end
do
local panel = CreateFrame('Frame', nil, m.frame)
local panel = CreateFrame('Frame', nil, frame)
panel:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]]}
panel:SetBackdropColor(unpack(aux.gui.color.content.background))
panel:SetPoint('LEFT', m.settings_button, 'RIGHT', 0, 0)
panel:SetPoint('LEFT', settings_button, 'RIGHT', 0, 0)
panel:SetPoint('RIGHT', 0, 0)
panel:SetHeight(42)
panel:Hide()
settings = panel
end
do
local panel = CreateFrame('Frame', nil, m.frame)
panel:SetPoint('LEFT', m.settings_button, 'RIGHT', 0, 0)
local panel = CreateFrame('Frame', nil, frame)
panel:SetPoint('LEFT', settings_button, 'RIGHT', 0, 0)
panel:SetPoint('RIGHT', 0, 1)
panel:SetHeight(40)
controls = panel
end
do
local editbox = aux.gui.editbox(m.settings)
local editbox = aux.gui.editbox(settings)
editbox:SetPoint('LEFT', 75, 0)
editbox:SetWidth(50)
editbox:SetNumeric(true)
editbox:SetMaxLetters(nil)
editbox:SetScript('OnTabPressed', function()
m.last_page_input:SetFocus()
last_page_input:SetFocus()
end)
editbox:SetScript('OnEnterPressed', function()
this:ClearFocus()
m.execute()
execute()
end)
editbox:SetScript('OnTextChanged', function()
local page = tonumber(this:GetText())
@@ -87,7 +87,7 @@ function create_frames()
if this:GetText() ~= valid_input then
this:SetText(valid_input)
end
if m.blizzard_page_index(this:GetText()) and not m.real_time_button:GetChecked() then
if blizzard_page_index(this:GetText()) and not real_time_button:GetChecked() then
this:SetBackdropColor(unpack(aux.gui.color.state.enabled))
else
this:SetBackdropColor(unpack(aux.gui.color.state.disabled))
@@ -100,17 +100,17 @@ function create_frames()
first_page_input = editbox
end
do
local editbox = aux.gui.editbox(m.settings)
editbox:SetPoint('LEFT', m.first_page_input, 'RIGHT', 10, 0)
local editbox = aux.gui.editbox(settings)
editbox:SetPoint('LEFT', first_page_input, 'RIGHT', 10, 0)
editbox:SetWidth(50)
editbox:SetNumeric(true)
editbox:SetMaxLetters(nil)
editbox:SetScript('OnTabPressed', function()
m.first_page_input:SetFocus()
first_page_input:SetFocus()
end)
editbox:SetScript('OnEnterPressed', function()
this:ClearFocus()
m.execute()
execute()
end)
editbox:SetScript('OnTextChanged', function()
local page = tonumber(this:GetText())
@@ -118,7 +118,7 @@ function create_frames()
if this:GetText() ~= valid_input then
this:SetText(valid_input)
end
if m.blizzard_page_index(this:GetText()) and not m.real_time_button:GetChecked() then
if blizzard_page_index(this:GetText()) and not real_time_button:GetChecked() then
this:SetBackdropColor(unpack(aux.gui.color.state.enabled))
else
this:SetBackdropColor(unpack(aux.gui.color.state.disabled))
@@ -131,23 +131,23 @@ function create_frames()
last_page_input = editbox
end
do
local btn = aux.gui.checkbutton(m.settings)
local btn = aux.gui.checkbutton(settings)
btn:SetPoint('LEFT', 230, 0)
btn:SetWidth(140)
btn:SetHeight(25)
btn:SetText('Real Time Mode')
btn:SetScript('OnClick', function()
this:SetChecked(not this:GetChecked())
this = m.first_page_input
m.first_page_input:GetScript('OnTextChanged')()
this = m.last_page_input
m.last_page_input:GetScript('OnTextChanged')()
this = first_page_input
first_page_input:GetScript('OnTextChanged')()
this = last_page_input
last_page_input:GetScript('OnTextChanged')()
end)
public.real_time_button = btn
end
do
local btn = aux.gui.checkbutton(m.settings)
btn:SetPoint('LEFT', m.real_time_button, 'RIGHT', 15, 0)
local btn = aux.gui.checkbutton(settings)
btn:SetPoint('LEFT', real_time_button, 'RIGHT', 15, 0)
btn:SetWidth(140)
btn:SetHeight(25)
btn:SetText('Auto Buyout Mode')
@@ -161,17 +161,17 @@ function create_frames()
auto_buy_button = btn
end
do
local btn = aux.gui.checkbutton(m.settings)
btn:SetPoint('LEFT', m.auto_buy_button, 'RIGHT', 15, 0)
local btn = aux.gui.checkbutton(settings)
btn:SetPoint('LEFT', auto_buy_button, 'RIGHT', 15, 0)
btn:SetWidth(140)
btn:SetHeight(25)
btn:SetText('Auto Buyout Filter')
btn:SetScript('OnClick', function()
if this:GetChecked() then
this:SetChecked(false)
_G.aux_auto_buy_filter = nil
g.aux_auto_buy_filter = nil
this.prettified = nil
m.auto_buy_validator = nil
auto_buy_validator = nil
else
StaticPopup_Show('AUX_SEARCH_AUTO_BUY_FILTER')
end
@@ -189,25 +189,25 @@ function create_frames()
auto_buy_filter_button = btn
end
do
local btn = aux.gui.button(m.controls, 25)
local btn = aux.gui.button(controls, 25)
btn:SetPoint('LEFT', 5, 0)
btn:SetWidth(30)
btn:SetHeight(25)
btn:SetText('<')
btn:SetScript('OnClick', m.previous_search)
btn:SetScript('OnClick', previous_search)
previous_button = btn
end
do
local btn = aux.gui.button(m.controls, 25)
btn:SetPoint('LEFT', m.previous_button, 'RIGHT', 4, 0)
local btn = aux.gui.button(controls, 25)
btn:SetPoint('LEFT', previous_button, 'RIGHT', 4, 0)
btn:SetWidth(30)
btn:SetHeight(25)
btn:SetText('>')
btn:SetScript('OnClick', m.next_search)
btn:SetScript('OnClick', next_search)
next_button = btn
end
do
local btn = aux.gui.button(m.controls, aux.gui.config.huge_font_size)
local btn = aux.gui.button(controls, aux.gui.config.huge_font_size)
btn:SetPoint('RIGHT', -5, 0)
btn:SetWidth(70)
btn:SetHeight(25)
@@ -215,40 +215,40 @@ function create_frames()
btn:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
btn:SetScript('OnClick', function()
if arg1 == 'RightButton' then
m.set_filter(m.current_search().filter_string)
set_filter(current_search().filter_string)
end
m.execute()
execute()
end)
start_button = btn
end
do
local btn = aux.gui.button(m.controls, aux.gui.config.huge_font_size)
local btn = aux.gui.button(controls, aux.gui.config.huge_font_size)
btn:SetPoint('RIGHT', -5, 0)
btn:SetWidth(70)
btn:SetHeight(25)
btn:SetText('Stop')
btn:SetScript('OnClick', function()
aux.scan.abort(m.search_scan_id)
aux.scan.abort(search_scan_id)
end)
stop_button = btn
end
do
local btn = aux.gui.button(m.controls, aux.gui.config.huge_font_size)
btn:SetPoint('RIGHT', m.start_button, 'LEFT', -4, 0)
local btn = aux.gui.button(controls, aux.gui.config.huge_font_size)
btn:SetPoint('RIGHT', start_button, 'LEFT', -4, 0)
btn:SetWidth(70)
btn:SetHeight(25)
btn:SetText(aux.gui.color.green 'Resume')
btn:SetScript('OnClick', function()
m.execute(true)
execute(true)
end)
resume_button = btn
end
do
local editbox = aux.gui.editbox(m.controls)
local editbox = aux.gui.editbox(controls)
editbox:SetMaxLetters(nil)
editbox:EnableMouse(1)
editbox.complete = aux.completion.complete_filter
editbox:SetPoint('RIGHT', m.start_button, 'LEFT', -4, 0)
editbox:SetPoint('RIGHT', start_button, 'LEFT', -4, 0)
editbox:SetHeight(25)
editbox:SetScript('OnChar', function()
this:complete()
@@ -256,49 +256,49 @@ function create_frames()
editbox:SetScript('OnTabPressed', function()
this:HighlightText(0, 0)
end)
editbox:SetScript('OnEnterPressed', m.execute)
editbox:SetScript('OnEnterPressed', execute)
search_box = editbox
end
do
aux.gui.horizontal_line(m.frame, -40)
aux.gui.horizontal_line(frame, -40)
end
do
local btn = aux.gui.button(m.frame, aux.gui.config.large_font_size2)
local btn = aux.gui.button(frame, aux.gui.config.large_font_size2)
btn:SetPoint('BOTTOMLEFT', aux.frame.content, 'TOPLEFT', 10, 8)
btn:SetWidth(243)
btn:SetHeight(22)
btn:SetText('Search Results')
btn:SetScript('OnClick', function() m.update_tab(m.RESULTS) end)
btn:SetScript('OnClick', function() update_tab(RESULTS) end)
search_results_button = btn
end
do
local btn = aux.gui.button(m.frame, aux.gui.config.large_font_size2)
btn:SetPoint('TOPLEFT', m.search_results_button, 'TOPRIGHT', 5, 0)
local btn = aux.gui.button(frame, aux.gui.config.large_font_size2)
btn:SetPoint('TOPLEFT', search_results_button, 'TOPRIGHT', 5, 0)
btn:SetWidth(243)
btn:SetHeight(22)
btn:SetText('Saved Searches')
btn:SetScript('OnClick', function() m.update_tab(m.SAVED) end)
btn:SetScript('OnClick', function() update_tab(SAVED) end)
saved_searches_button = btn
end
do
local btn = aux.gui.button(m.frame, aux.gui.config.large_font_size2)
btn:SetPoint('TOPLEFT', m.saved_searches_button, 'TOPRIGHT', 5, 0)
local btn = aux.gui.button(frame, aux.gui.config.large_font_size2)
btn:SetPoint('TOPLEFT', saved_searches_button, 'TOPRIGHT', 5, 0)
btn:SetWidth(243)
btn:SetHeight(22)
btn:SetText('Filter Builder')
btn:SetScript('OnClick', function() m.update_tab(m.FILTER) end)
btn:SetScript('OnClick', function() update_tab(FILTER) end)
new_filter_button = btn
end
do
local frame = CreateFrame('Frame', nil, m.frame)
local frame = CreateFrame('Frame', nil, frame)
frame:SetWidth(265)
frame:SetHeight(25)
frame:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
status_bar_frame = frame
end
do
local btn = aux.gui.button(m.frame.results, 16)
btn:SetPoint('TOPLEFT', m.status_bar_frame, 'TOPRIGHT', 5, 0)
local btn = aux.gui.button(frame.results, 16)
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
btn:SetWidth(80)
btn:SetHeight(24)
btn:SetText('Bid')
@@ -306,8 +306,8 @@ function create_frames()
bid_button = btn
end
do
local btn = aux.gui.button(m.frame.results, 16)
btn:SetPoint('TOPLEFT', m.bid_button, 'TOPRIGHT', 5, 0)
local btn = aux.gui.button(frame.results, 16)
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
btn:SetWidth(80)
btn:SetHeight(24)
btn:SetText('Buyout')
@@ -315,42 +315,42 @@ function create_frames()
buyout_button = btn
end
do
local btn = aux.gui.button(m.frame.results, 16)
btn:SetPoint('TOPLEFT', m.buyout_button, 'TOPRIGHT', 5, 0)
local btn = aux.gui.button(frame.results, 16)
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
btn:SetWidth(80)
btn:SetHeight(24)
btn:SetText('Clear')
btn:SetScript('OnClick', function()
while tremove(m.current_search().records) do end
m.current_search().table:SetDatabase()
while tremove(current_search().records) do end
current_search().table:SetDatabase()
end)
end
do
local btn = aux.gui.button(m.frame.saved, 16)
btn:SetPoint('TOPLEFT', m.status_bar_frame, 'TOPRIGHT', 5, 0)
local btn = aux.gui.button(frame.saved, 16)
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
btn:SetWidth(80)
btn:SetHeight(24)
btn:SetText('Favorite')
btn:SetScript('OnClick', function()
local filters = aux.filter.queries(m.search_box:GetText())
local filters = aux.filter.queries(search_box:GetText())
if filters then
tinsert(_G.aux_favorite_searches, 1, {
filter_string = m.search_box:GetText(),
tinsert(g.aux_favorite_searches, 1, {
filter_string = search_box:GetText(),
prettified = table.concat(aux.util.map(filters, function(filter) return filter.prettified end), ';'),
})
end
m.update_search_listings()
update_search_listings()
end)
end
do
local btn1 = aux.gui.button(m.frame.filter, 16)
btn1:SetPoint('TOPLEFT', m.status_bar_frame, 'TOPRIGHT', 5, 0)
local btn1 = aux.gui.button(frame.filter, 16)
btn1:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
btn1:SetWidth(80)
btn1:SetHeight(24)
btn1:SetText('Search')
btn1:SetScript('OnClick', function()
m.export_query_string()
m.execute()
export_query_string()
execute()
end)
local btn2 = aux.gui.button(frame.filter, 16)
@@ -369,7 +369,7 @@ function create_frames()
end
do
local editbox = aux.gui.editbox(frame.filter)
editbox.complete_item = aux.completion.complete(function() return _G.aux_auctionable_items end)
editbox.complete_item = aux.completion.complete(function() return g.aux_auctionable_items end)
editbox:SetPoint('TOPLEFT', 14, -FILTER_SPACING)
editbox:SetWidth(260)
editbox:SetScript('OnChar', function()
@@ -404,24 +404,24 @@ function create_frames()
exact_checkbox = checkbox
end
do
local editbox = aux.gui.editbox(m.frame.filter)
editbox:SetPoint('TOPLEFT', m.name_input, 'BOTTOMLEFT', 0, -m.FILTER_SPACING)
local editbox = aux.gui.editbox(frame.filter)
editbox:SetPoint('TOPLEFT', name_input, 'BOTTOMLEFT', 0, -FILTER_SPACING)
editbox:SetWidth(125)
editbox:SetNumeric(true)
editbox:SetScript('OnTabPressed', function()
if IsShiftKeyDown() then
m.name_input:SetFocus()
name_input:SetFocus()
else
m.max_level_input:SetFocus()
max_level_input:SetFocus()
end
end)
editbox:SetScript('OnEnterPressed', aux.C(editbox.ClearFocus, editbox))
editbox:SetScript('OnTextChanged', function()
local valid_level = m.valid_level(this:GetText())
local valid_level = valid_level(this:GetText())
if tostring(valid_level) ~= this:GetText() then
this:SetText(valid_level or '')
end
m.update_form()
update_form()
end)
local label = aux.gui.label(editbox, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
@@ -429,24 +429,24 @@ function create_frames()
min_level_input = editbox
end
do
local editbox = aux.gui.editbox(m.frame.filter)
editbox:SetPoint('TOPLEFT', m.min_level_input, 'TOPRIGHT', 10, 0)
local editbox = aux.gui.editbox(frame.filter)
editbox:SetPoint('TOPLEFT', min_level_input, 'TOPRIGHT', 10, 0)
editbox:SetWidth(125)
editbox:SetNumeric(true)
editbox:SetScript('OnTabPressed', function()
if IsShiftKeyDown() then
m.min_level_input:SetFocus()
min_level_input:SetFocus()
else
m.name_input:SetFocus()
name_input:SetFocus()
end
end)
editbox:SetScript('OnEnterPressed', aux.C(editbox.ClearFocus, editbox))
editbox:SetScript('OnTextChanged', function()
local valid_level = m.valid_level(this:GetText())
local valid_level = valid_level(this:GetText())
if tostring(valid_level) ~= this:GetText() then
this:SetText(valid_level or '')
end
m.update_form()
update_form()
end)
local label = aux.gui.label(editbox, aux.gui.config.medium_font_size)
label:SetPoint('RIGHT', editbox, 'LEFT', -3, 0)
@@ -454,74 +454,74 @@ function create_frames()
max_level_input = editbox
end
do
local checkbox = aux.gui.checkbox(m.frame.filter)
checkbox:SetPoint('TOPLEFT', m.max_level_input, 'TOPRIGHT', 16, 0)
checkbox:SetScript('OnClick', m.update_form)
local checkbox = aux.gui.checkbox(frame.filter)
checkbox:SetPoint('TOPLEFT', max_level_input, 'TOPRIGHT', 16, 0)
checkbox:SetScript('OnClick', update_form)
local label = aux.gui.label(checkbox, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1)
label:SetText('Usable')
usable_checkbox = checkbox
end
do
local dropdown = aux.gui.dropdown(m.frame.filter)
local dropdown = aux.gui.dropdown(frame.filter)
class_dropdown = dropdown
dropdown:SetPoint('TOPLEFT', m.min_level_input, 'BOTTOMLEFT', 0, 5 - m.FILTER_SPACING)
dropdown:SetPoint('TOPLEFT', min_level_input, 'BOTTOMLEFT', 0, 5 - FILTER_SPACING)
dropdown:SetWidth(300)
local label = aux.gui.label(dropdown, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3)
label:SetText('Item Class')
UIDropDownMenu_Initialize(dropdown, m.initialize_class_dropdown)
UIDropDownMenu_Initialize(dropdown, initialize_class_dropdown)
dropdown:SetScript('OnShow', function()
UIDropDownMenu_Initialize(this, m.initialize_class_dropdown)
UIDropDownMenu_Initialize(this, initialize_class_dropdown)
end)
end
do
local dropdown = aux.gui.dropdown(m.frame.filter)
local dropdown = aux.gui.dropdown(frame.filter)
subclass_dropdown = dropdown
dropdown:SetPoint('TOPLEFT', m.class_dropdown, 'BOTTOMLEFT', 0, 10 - m.FILTER_SPACING)
dropdown:SetPoint('TOPLEFT', class_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
dropdown:SetWidth(300)
local label = aux.gui.label(dropdown, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3)
label:SetText('Item Subclass')
UIDropDownMenu_Initialize(dropdown, m.initialize_subclass_dropdown)
UIDropDownMenu_Initialize(dropdown, initialize_subclass_dropdown)
dropdown:SetScript('OnShow', function()
UIDropDownMenu_Initialize(this, m.initialize_subclass_dropdown)
UIDropDownMenu_Initialize(this, initialize_subclass_dropdown)
end)
end
do
local dropdown = aux.gui.dropdown(m.frame.filter)
local dropdown = aux.gui.dropdown(frame.filter)
slot_dropdown = dropdown
dropdown:SetPoint('TOPLEFT', m.subclass_dropdown, 'BOTTOMLEFT', 0, 10 - m.FILTER_SPACING)
dropdown:SetPoint('TOPLEFT', subclass_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
dropdown:SetWidth(300)
local label = aux.gui.label(dropdown, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3)
label:SetText('Item Slot')
UIDropDownMenu_Initialize(dropdown, m.initialize_slot_dropdown)
UIDropDownMenu_Initialize(dropdown, initialize_slot_dropdown)
dropdown:SetScript('OnShow', function()
UIDropDownMenu_Initialize(this, m.initialize_slot_dropdown)
UIDropDownMenu_Initialize(this, initialize_slot_dropdown)
end)
end
do
local dropdown = aux.gui.dropdown(m.frame.filter)
local dropdown = aux.gui.dropdown(frame.filter)
quality_dropdown = dropdown
dropdown:SetPoint('TOPLEFT', m.slot_dropdown, 'BOTTOMLEFT', 0, 10 - m.FILTER_SPACING)
dropdown:SetPoint('TOPLEFT', slot_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
dropdown:SetWidth(300)
local label = aux.gui.label(dropdown, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3)
label:SetText('Min Quality')
UIDropDownMenu_Initialize(dropdown, m.initialize_quality_dropdown)
UIDropDownMenu_Initialize(dropdown, initialize_quality_dropdown)
dropdown:SetScript('OnShow', function()
UIDropDownMenu_Initialize(this, m.initialize_quality_dropdown)
UIDropDownMenu_Initialize(this, initialize_quality_dropdown)
end)
end
aux.gui.vertical_line(m.frame.filter, 332)
aux.gui.vertical_line(frame.filter, 332)
do
local dropdown = aux.gui.dropdown(m.frame.filter)
local dropdown = aux.gui.dropdown(frame.filter)
dropdown:SetPoint('TOPRIGHT', -174.5, -10)
dropdown:SetWidth(150)
UIDropDownMenu_Initialize(dropdown, m.initialize_filter_dropdown)
UIDropDownMenu_Initialize(dropdown, initialize_filter_dropdown)
dropdown:SetScript('OnShow', function()
UIDropDownMenu_Initialize(this, m.initialize_filter_dropdown)
UIDropDownMenu_Initialize(this, initialize_filter_dropdown)
end)
getglobal(dropdown:GetName()..'Text'):Hide()
local label = aux.gui.label(dropdown, aux.gui.config.medium_font_size)
@@ -530,11 +530,11 @@ function create_frames()
filter_dropdown = dropdown
end
do
local input = aux.gui.editbox(m.frame.filter)
input:SetPoint('CENTER', m.filter_dropdown, 'CENTER', 0, 0)
local input = aux.gui.editbox(frame.filter)
input:SetPoint('CENTER', filter_dropdown, 'CENTER', 0, 0)
input:SetWidth(150)
input:SetScript('OnTabPressed', function()
m.filter_parameter_input:SetFocus()
filter_parameter_input:SetFocus()
end)
input.complete = aux.completion.complete(function() return {'and', 'or', 'not', unpack(aux.util.keys(aux.filter.filters))} end)
input:SetScript('OnChar', function()
@@ -544,38 +544,38 @@ function create_frames()
local filter = this:GetText()
if aux.filter.filters[filter] and aux.filter.filters[filter].input_type ~= '' then
local _, _, suggestions = aux.filter.parse_query_string(filter..'/')
m.filter_parameter_input:SetNumeric(aux.filter.filters[filter].input_type == 'number')
m.filter_parameter_input.complete = aux.completion.complete(function() return suggestions or {} end)
m.filter_parameter_input:Show()
filter_parameter_input:SetNumeric(aux.filter.filters[filter].input_type == 'number')
filter_parameter_input.complete = aux.completion.complete(function() return suggestions or {} end)
filter_parameter_input:Show()
else
m.filter_parameter_input:Hide()
filter_parameter_input:Hide()
end
end)
input:SetScript('OnEnterPressed', function()
if m.filter_parameter_input:IsVisible() then
m.filter_parameter_input:SetFocus()
if filter_parameter_input:IsVisible() then
filter_parameter_input:SetFocus()
else
m.add_post_filter()
add_post_filter()
end
end)
filter_input = input
end
do
local input = aux.gui.editbox(m.frame.filter)
input:SetPoint('LEFT', m.filter_dropdown, 'RIGHT', 10, 0)
local input = aux.gui.editbox(frame.filter)
input:SetPoint('LEFT', filter_dropdown, 'RIGHT', 10, 0)
input:SetWidth(150)
input:SetScript('OnTabPressed', function()
m.filter_input:SetFocus()
filter_input:SetFocus()
end)
input:SetScript('OnChar', function()
this:complete()
end)
input:SetScript('OnEnterPressed', m.add_post_filter)
input:SetScript('OnEnterPressed', add_post_filter)
input:Hide()
filter_parameter_input = input
end
do
local scroll_frame = CreateFrame('ScrollFrame', nil, m.frame.filter)
local scroll_frame = CreateFrame('ScrollFrame', nil, frame.filter)
scroll_frame:SetWidth(395)
scroll_frame:SetHeight(270)
scroll_frame:SetPoint('TOPLEFT', 348.5, -50)
@@ -584,7 +584,7 @@ function create_frames()
scroll_frame:SetScript('OnMouseWheel', function()
local child = this:GetScrollChild()
child:SetFont('p', [[Fonts\ARIALN.TTF]], aux.util.bound(11, 23, aux.util.select(2, child:GetFont()) + arg1*2))
m.update_filter_display()
update_filter_display()
end)
scroll_frame:RegisterForDrag('LeftButton')
scroll_frame:SetScript('OnDragStart', function()
@@ -596,7 +596,7 @@ function create_frames()
local new_x_offset = this.x_offset + x - this.x
local new_y_offset = this.y_offset + y - this.y
m.set_filter_display_offset(new_x_offset - this.x_extra, new_y_offset - this.y_extra)
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)
@@ -612,7 +612,7 @@ function create_frames()
scroll_child:SetTextColor('p', aux.gui.color.label.enabled())
scroll_child:SetWidth(1)
scroll_child:SetHeight(1)
scroll_child:SetScript('OnHyperlinkClick', m.data_link_click)
scroll_child:SetScript('OnHyperlinkClick', data_link_click)
-- scroll_child:SetHyperlinkFormat("format")
scroll_child.measure = scroll_child:CreateFontString()
filter_display = scroll_child
@@ -621,60 +621,60 @@ function create_frames()
status_bars = {}
tables = {}
for _=1,5 do
local status_bar = aux.gui.status_bar(m.frame)
status_bar:SetAllPoints(m.status_bar_frame)
local status_bar = aux.gui.status_bar(frame)
status_bar:SetAllPoints(status_bar_frame)
status_bar:Hide()
tinsert(m.status_bars, status_bar)
tinsert(status_bars, status_bar)
local table = aux.auction_listing.CreateAuctionResultsTable(m.frame.results, aux.auction_listing.search_config)
local table = aux.auction_listing.CreateAuctionResultsTable(frame.results, aux.auction_listing.search_config)
table:SetHandler('OnCellClick', function(cell, button)
if IsAltKeyDown() and m.current_search().table:GetSelection().record == cell.row.data.record then
if button == 'LeftButton' and m.buyout_button:IsEnabled() then
m.buyout_button:Click()
elseif button == 'RightButton' and m.bid_button:IsEnabled() then
m.bid_button:Click()
if IsAltKeyDown() and current_search().table:GetSelection().record == cell.row.data.record then
if button == 'LeftButton' and buyout_button:IsEnabled() then
buyout_button:Click()
elseif button == 'RightButton' and bid_button:IsEnabled() then
bid_button:Click()
end
end
end)
table:SetHandler('OnSelectionChanged', function(rt, datum)
if not datum then return end
m.find_auction(datum.record)
find_auction(datum.record)
end)
table:Hide()
tinsert(m.tables, table)
tinsert(tables, table)
end
local handlers = {
OnClick = function(st, data, _, button)
if not data then return end
if button == 'LeftButton' and IsShiftKeyDown() then
m.search_box:SetText(data.search.filter_string)
search_box:SetText(data.search.filter_string)
elseif button == 'RightButton' and IsShiftKeyDown() then
m.add_filter(data.search.filter_string)
add_filter(data.search.filter_string)
elseif button == 'LeftButton' and IsControlKeyDown() then
if st == m.favorite_searches_listing and data.index > 1 then
local temp = _G.aux_favorite_searches[data.index - 1]
_G.aux_favorite_searches[data.index - 1] = data.search
_G.aux_favorite_searches[data.index] = temp
m.update_search_listings()
if st == favorite_searches_listing and data.index > 1 then
local temp = g.aux_favorite_searches[data.index - 1]
g.aux_favorite_searches[data.index - 1] = data.search
g.aux_favorite_searches[data.index] = temp
update_search_listings()
end
elseif button == 'RightButton' and IsControlKeyDown() then
if st == m.favorite_searches_listing and data.index < getn(_G.aux_favorite_searches) then
local temp = _G.aux_favorite_searches[data.index + 1]
_G.aux_favorite_searches[data.index + 1] = data.search
_G.aux_favorite_searches[data.index] = temp
m.update_search_listings()
if st == favorite_searches_listing and data.index < getn(g.aux_favorite_searches) then
local temp = g.aux_favorite_searches[data.index + 1]
g.aux_favorite_searches[data.index + 1] = data.search
g.aux_favorite_searches[data.index] = temp
update_search_listings()
end
elseif button == 'LeftButton' then
m.search_box:SetText(data.search.filter_string)
m.execute()
search_box:SetText(data.search.filter_string)
execute()
elseif button == 'RightButton' then
if st == m.recent_searches_listing then
tinsert(_G.aux_favorite_searches, 1, data.search)
elseif st == m.favorite_searches_listing then
tremove(_G.aux_favorite_searches, data.index)
if st == recent_searches_listing then
tinsert(g.aux_favorite_searches, 1, data.search)
elseif st == favorite_searches_listing then
tremove(g.aux_favorite_searches, data.index)
end
m.update_search_listings()
update_search_listings()
end
end,
OnEnter = function(st, data, self)
@@ -689,19 +689,19 @@ function create_frames()
end
}
recent_searches_listing = aux.listing.CreateScrollingTable(m.frame.saved.recent)
m.recent_searches_listing:SetColInfo{{name='Recent Searches', width=1}}
m.recent_searches_listing:EnableSorting(false)
m.recent_searches_listing:DisableSelection(true)
m.recent_searches_listing:SetHandler('OnClick', handlers.OnClick)
m.recent_searches_listing:SetHandler('OnEnter', handlers.OnEnter)
m.recent_searches_listing:SetHandler('OnLeave', handlers.OnLeave)
recent_searches_listing = aux.listing.CreateScrollingTable(frame.saved.recent)
recent_searches_listing:SetColInfo{{name='Recent Searches', width=1}}
recent_searches_listing:EnableSorting(false)
recent_searches_listing:DisableSelection(true)
recent_searches_listing:SetHandler('OnClick', handlers.OnClick)
recent_searches_listing:SetHandler('OnEnter', handlers.OnEnter)
recent_searches_listing:SetHandler('OnLeave', handlers.OnLeave)
favorite_searches_listing = aux.listing.CreateScrollingTable(m.frame.saved.favorite)
m.favorite_searches_listing:SetColInfo{{name='Favorite Searches', width=1}}
m.favorite_searches_listing:EnableSorting(false)
m.favorite_searches_listing:DisableSelection(true)
m.favorite_searches_listing:SetHandler('OnClick', handlers.OnClick)
m.favorite_searches_listing:SetHandler('OnEnter', handlers.OnEnter)
m.favorite_searches_listing:SetHandler('OnLeave', handlers.OnLeave)
favorite_searches_listing = aux.listing.CreateScrollingTable(frame.saved.favorite)
favorite_searches_listing:SetColInfo{{name='Favorite Searches', width=1}}
favorite_searches_listing:EnableSorting(false)
favorite_searches_listing:DisableSelection(true)
favorite_searches_listing:SetHandler('OnClick', handlers.OnClick)
favorite_searches_listing:SetHandler('OnEnter', handlers.OnEnter)
favorite_searches_listing:SetHandler('OnLeave', handlers.OnLeave)
end