added the last missing ui elements to the tsm style: dropdown and checkbox. also many other style changes and lots of things made larger

This commit is contained in:
Manuel Simon Hirsig
2016-08-07 02:00:49 +02:00
parent b94cabfc08
commit c0db070798
10 changed files with 249 additions and 254 deletions
+5 -5
View File
@@ -281,8 +281,8 @@ function private.update_item_configuration()
m.item.name:SetTextColor(unpack(aux.gui.color.label.enabled))
m.item.name:SetText('No item selected')
m.unit_start_price:Hide()
m.unit_buyout_price:Hide()
m.start_price_frame:Hide()
m.buyout_price_frame:Hide()
m.stack_size_slider:Hide()
m.stack_count_slider:Hide()
m.deposit:Hide()
@@ -290,8 +290,8 @@ function private.update_item_configuration()
m.historical_value_button:Hide()
m.hide_checkbox:Hide()
else
m.unit_start_price:Show()
m.unit_buyout_price:Show()
m.start_price_frame:Show()
m.buyout_price_frame:Show()
m.stack_size_slider:Show()
m.stack_count_slider:Show()
m.deposit:Show()
@@ -396,7 +396,7 @@ function private.set_item(item)
m.selected_item = item
UIDropDownMenu_Initialize(m.duration_dropdown, m.initialize_duration_dropdown) -- TODO, wtf, why is this needed
-- UIDropDownMenu_Initialize(m.duration_dropdown, m.initialize_duration_dropdown) -- TODO, wtf, why is this needed
UIDropDownMenu_SetSelectedValue(m.duration_dropdown, settings.duration)
m.hide_checkbox:SetChecked(settings.hidden)
+53 -38
View File
@@ -65,10 +65,10 @@ aux.post_tab.FRAMES(function(m, public, private)
{ name='Auctions', width=.12, align='CENTER' },
{ name='Left', width=.1, align='CENTER' },
{ name='Qty', width=.08, align='CENTER' },
{ name='Bid/ea', width=.23, align='RIGHT' },
{ name='Bid Pct', width=.12, align='CENTER' },
{ name='Buy/ea', width=.23, align='RIGHT' },
{ name='Buy Pct', width=.12, align='CENTER' }
{ name='Bid/ea', width=.22, align='RIGHT' },
{ name='Bid Pct', width=.13, align='CENTER' },
{ name='Buy/ea', width=.22, align='RIGHT' },
{ name='Buy Pct', width=.13, align='CENTER' }
})
m.auction_listing:EnableSorting(false)
m.auction_listing:DisableSelection(true)
@@ -117,7 +117,7 @@ aux.post_tab.FRAMES(function(m, public, private)
end
do
local item = aux.gui.item(m.frame.parameters)
item:SetPoint('TOPLEFT', 10, -8)
item:SetPoint('TOPLEFT', 6, -6)
item:EnableMouse()
item:SetScript('OnReceiveDrag', function()
local item_info = aux.cursor_item()
@@ -153,7 +153,7 @@ aux.post_tab.FRAMES(function(m, public, private)
do
local slider = aux.gui.slider(m.frame.parameters)
slider:SetValueStep(1)
slider:SetPoint('TOPLEFT', 16, -73)
slider:SetPoint('TOPLEFT', 13, -73)
slider:SetWidth(190)
slider:SetScript('OnValueChanged', function()
m.quantity_update(true)
@@ -208,9 +208,8 @@ aux.post_tab.FRAMES(function(m, public, private)
local dropdown = aux.gui.dropdown(m.frame.parameters)
dropdown:SetPoint('TOPLEFT', m.stack_count_slider, 'BOTTOMLEFT', 0, -21)
dropdown:SetWidth(90)
dropdown:SetHeight(10)
local label = aux.gui.label(dropdown, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -4)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -1)
label:SetText('Duration')
UIDropDownMenu_Initialize(dropdown, m.initialize_duration_dropdown)
dropdown:SetScript('OnShow', function()
@@ -236,10 +235,16 @@ aux.post_tab.FRAMES(function(m, public, private)
private.hide_checkbox = checkbox
end
do
local editbox = aux.gui.editbox(m.frame.parameters)
editbox:SetPoint('TOPRIGHT', -65, -66)
editbox:SetJustifyH('RIGHT')
editbox:SetWidth(150)
local frame = CreateFrame('Frame', nil, m.frame.parameters)
private.start_price_frame = frame
aux.gui.set_content_style(frame)
frame:SetPoint('TOPRIGHT', -71, -50)
frame:SetWidth(180)
frame:SetHeight(22)
local editbox = aux.gui.editbox(frame)
editbox:SetAllPoints()
editbox:SetJustifyH('RIGHT')
editbox:SetFont(aux.gui.config.font, 17)
editbox:SetScript('OnTextChanged', function()
this.pretty:SetText(aux.money.to_string(m.get_unit_start_price(), true, nil, 3))
m.refresh = true
@@ -253,28 +258,29 @@ aux.post_tab.FRAMES(function(m, public, private)
m.unit_buyout_price:SetFocus()
end
end)
editbox:SetScript('OnEnterPressed', function()
this:ClearFocus()
end)
editbox:SetScript('OnEditFocusGained', function()
this:HighlightText()
this.pretty:Hide()
this:HighlightText()
this.pretty:Hide()
this:SetAlpha(1)
end)
editbox:SetScript('OnEditFocusLost', function()
this:SetText(aux.money.to_string(m.get_unit_start_price(), true, nil, 3, nil, true))
this.pretty:Show()
this:SetText(aux.money.to_string(m.get_unit_start_price(), true, nil, 3, nil, true))
this.pretty:Show()
this:SetAlpha(0)
end)
editbox.pretty = aux.gui.label(editbox, aux.gui.config.medium_font_size)
editbox.pretty:SetAllPoints()
editbox:SetAlpha(0)
editbox.pretty = aux.gui.label(frame, 17)
editbox.pretty:SetPoint('LEFT', 1, 0)
editbox.pretty:SetPoint('RIGHT', -2, 0)
editbox.pretty:SetJustifyH('RIGHT')
do
local label = aux.gui.label(editbox, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
local label = aux.gui.label(frame, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', frame, 'TOPLEFT', -2, 1)
label:SetText('Unit Starting Price')
end
do
local label = aux.gui.label(editbox, aux.gui.config.small_font_size)
label:SetPoint('LEFT', editbox, 'RIGHT', 3, 0)
local label = aux.gui.label(frame, 14)
label:SetPoint('LEFT', frame, 'RIGHT', 8, 0)
label:SetWidth(50)
label:SetJustifyH('CENTER')
private.start_price_percentage = label
@@ -282,10 +288,16 @@ aux.post_tab.FRAMES(function(m, public, private)
private.unit_start_price = editbox
end
do
local editbox = aux.gui.editbox(m.frame.parameters)
editbox:SetPoint('TOPRIGHT', m.unit_start_price, 'BOTTOMRIGHT', 0, -18)
editbox:SetJustifyH('RIGHT')
editbox:SetWidth(150)
local frame = CreateFrame('Frame', nil, m.frame.parameters)
private.buyout_price_frame = frame
aux.gui.set_content_style(frame)
frame:SetPoint('TOPRIGHT', m.unit_start_price, 'BOTTOMRIGHT', 0, -19)
frame:SetWidth(180)
frame:SetHeight(22)
local editbox = aux.gui.editbox(frame)
editbox:SetAllPoints()
editbox:SetJustifyH('RIGHT')
editbox:SetFont(aux.gui.config.font, 17)
editbox:SetScript('OnTextChanged', function()
this.pretty:SetText(aux.money.to_string(m.get_unit_buyout_price(), true, nil, 3))
m.refresh = true
@@ -303,22 +315,26 @@ aux.post_tab.FRAMES(function(m, public, private)
editbox:SetScript('OnEditFocusGained', function()
this:HighlightText()
this.pretty:Hide()
this:SetAlpha(1)
end)
editbox:SetScript('OnEditFocusLost', function()
this:SetText(aux.money.to_string(m.get_unit_buyout_price(), true, nil, 3, nil, true))
this.pretty:Show()
this:SetAlpha(0)
end)
editbox.pretty = aux.gui.label(editbox, aux.gui.config.medium_font_size)
editbox.pretty:SetAllPoints()
editbox:SetAlpha(0)
editbox.pretty = aux.gui.label(frame, 17)
editbox.pretty:SetPoint('LEFT', 1, 0)
editbox.pretty:SetPoint('RIGHT', -2, 0)
editbox.pretty:SetJustifyH('RIGHT')
do
local label = aux.gui.label(editbox, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
local label = aux.gui.label(frame, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', frame, 'TOPLEFT', -2, 1)
label:SetText('Unit Buyout Price')
end
do
local label = aux.gui.label(editbox, aux.gui.config.small_font_size)
label:SetPoint('LEFT', editbox, 'RIGHT', 3, 0)
local label = aux.gui.label(frame, 14)
label:SetPoint('LEFT', frame, 'RIGHT', 8, 0)
label:SetWidth(50)
label:SetJustifyH('CENTER')
private.buyout_price_percentage = label
@@ -326,11 +342,10 @@ aux.post_tab.FRAMES(function(m, public, private)
private.unit_buyout_price = editbox
end
do
local btn = aux.gui.button(m.frame.parameters, 16)
btn:SetPoint('TOPRIGHT', -15, -143)
local btn = aux.gui.button(m.frame.parameters, 14)
btn:SetPoint('TOPRIGHT', -14, -146)
btn:SetWidth(150)
btn:SetHeight(20)
btn:GetFontString():SetTextHeight(15)
btn:GetFontString():SetJustifyH('RIGHT')
btn:GetFontString():SetPoint('RIGHT', 0, 0)
btn:SetScript('OnClick', function()
+18 -9
View File
@@ -630,11 +630,14 @@ end
function private.initialize_class_dropdown()
local function on_click()
if this.value ~= UIDropDownMenu_GetSelectedValue(m.class_dropdown) then
local old_value = UIDropDownMenu_GetSelectedValue(m.class_dropdown)
UIDropDownMenu_SetSelectedValue(m.class_dropdown, this.value)
if this.value ~= old_value then
UIDropDownMenu_ClearAll(m.subclass_dropdown)
UIDropDownMenu_Initialize(m.subclass_dropdown, m.initialize_subclass_dropdown)
UIDropDownMenu_ClearAll(m.slot_dropdown)
UIDropDownMenu_Initialize(m.slot_dropdown, m.initialize_slot_dropdown)
end
UIDropDownMenu_SetSelectedValue(m.class_dropdown, this.value)
end
UIDropDownMenu_AddButton{
@@ -655,15 +658,19 @@ end
function private.initialize_subclass_dropdown()
local function on_click()
if this.value ~= UIDropDownMenu_GetSelectedValue(m.subclass_dropdown) then
local old_value = UIDropDownMenu_GetSelectedValue(m.subclass_dropdown)
UIDropDownMenu_SetSelectedValue(m.subclass_dropdown, this.value)
if this.value ~= old_value then
UIDropDownMenu_ClearAll(m.slot_dropdown)
UIDropDownMenu_Initialize(m.slot_dropdown, m.initialize_slot_dropdown)
end
UIDropDownMenu_SetSelectedValue(m.subclass_dropdown, this.value)
end
local class_index = UIDropDownMenu_GetSelectedValue(m.class_dropdown)
if class_index and GetAuctionItemSubClasses(class_index) then
m.subclass_dropdown.button:Enable()
UIDropDownMenu_AddButton{
text = ALL,
value = 0,
@@ -677,6 +684,8 @@ function private.initialize_subclass_dropdown()
func = on_click,
}
end
else
m.subclass_dropdown.button:Disable()
end
end
@@ -690,6 +699,8 @@ function private.initialize_slot_dropdown()
local subclass_index = UIDropDownMenu_GetSelectedValue(m.subclass_dropdown)
if class_index and subclass_index and GetAuctionInvTypes(class_index, subclass_index) then
m.slot_dropdown.button:Enable()
UIDropDownMenu_AddButton{
text = ALL,
value = 0,
@@ -704,6 +715,8 @@ function private.initialize_slot_dropdown()
func = on_click,
}
end
else
m.slot_dropdown.button:Disable()
end
end
@@ -825,17 +838,13 @@ function private.set_form(components)
m.usable_checkbox:SetChecked(true)
elseif filter[1] == 'class' then
class_index = aux.info.item_class_index(filter[2])
UIDropDownMenu_Initialize(m.class_dropdown, m.initialize_class_dropdown) -- TODO, wtf, why is this needed
UIDropDownMenu_SetSelectedValue(m.class_dropdown, class_index)
elseif filter[1] == 'subclass' then
subclass_index = aux.info.item_subclass_index(class_index, filter[2])
UIDropDownMenu_Initialize(m.subclass_dropdown, m.initialize_subclass_dropdown) -- TODO, wtf, why is this needed
UIDropDownMenu_SetSelectedValue(m.subclass_dropdown, subclass_index)
elseif filter[1] == 'slot' then
UIDropDownMenu_Initialize(m.slot_dropdown, m.initialize_slot_dropdown) -- TODO, wtf, why is this needed
UIDropDownMenu_SetSelectedValue(m.slot_dropdown, ({GetAuctionInvTypes(class_index, subclass_index)})[aux.info.item_slot_index(class_index, subclass_index, filter[2])])
elseif filter[1] == 'quality' then
UIDropDownMenu_Initialize(m.quality_dropdown, m.initialize_quality_dropdown) -- TODO, wtf, why is this needed
UIDropDownMenu_SetSelectedValue(m.quality_dropdown, aux.info.item_quality_index(filter[2]))
end
end
@@ -903,7 +912,7 @@ end
function private.update_filter_display()
local lines = aux.util.size(aux.util.filter(m.post_components, function(component) return component[1] == 'operator' and component[2] ~= 'not' end))
local width_scale = max(200/m.filter_display:GetStringWidth())
local width_scale = max(260/m.filter_display:GetStringWidth())
local height_scale = min((200 / lines) / 18)
m.filter_display.scale_frame:SetScale(min(1, width_scale, height_scale))
m.filter_display:SetText(aux.filter.indented_post_query_string(m.post_components))
+16 -21
View File
@@ -84,7 +84,7 @@ aux.search_tab.FRAMES(function(m, public, private)
this:SetBackdropColor(unpack(aux.gui.color.state.disabled))
end
end)
local label = aux.gui.label(editbox, aux.gui.config.medium_font_size)
local label = aux.gui.label(editbox, 14)
label:SetPoint('RIGHT', editbox, 'LEFT', -6, 0)
label:SetText('Pages')
label:SetTextColor(unpack(aux.gui.color.text.enabled))
@@ -365,7 +365,7 @@ aux.search_tab.FRAMES(function(m, public, private)
do
local editbox = aux.gui.editbox(m.frame.filter)
editbox.complete_item = aux.completion.complete(function() return aux_auctionable_items end)
editbox:SetPoint('TOPLEFT', 14, -26)
editbox:SetPoint('TOPLEFT', 14, -25)
editbox:SetWidth(260)
editbox:SetScript('OnChar', function()
if m.exact_checkbox:GetChecked() then
@@ -395,7 +395,7 @@ aux.search_tab.FRAMES(function(m, public, private)
end
do
local editbox = aux.gui.editbox(m.frame.filter)
editbox:SetPoint('TOPLEFT', m.name_input, 'BOTTOMLEFT', 0, -28)
editbox:SetPoint('TOPLEFT', m.name_input, 'BOTTOMLEFT', 0, -26)
editbox:SetWidth(125)
editbox:SetNumeric(true)
editbox:SetMaxLetters(2)
@@ -441,11 +441,10 @@ aux.search_tab.FRAMES(function(m, public, private)
end
do
local dropdown = aux.gui.dropdown(m.frame.filter)
dropdown:SetPoint('TOPLEFT', m.min_level_input, 'BOTTOMLEFT', 0, -26)
dropdown:SetPoint('TOPLEFT', m.min_level_input, 'BOTTOMLEFT', 0, -24)
dropdown:SetWidth(300)
dropdown:SetHeight(10)
local label = aux.gui.label(dropdown, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -4)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -1)
label:SetText('Item Class')
UIDropDownMenu_Initialize(dropdown, m.initialize_class_dropdown)
dropdown:SetScript('OnShow', function()
@@ -455,52 +454,49 @@ aux.search_tab.FRAMES(function(m, public, private)
end
do
local dropdown = aux.gui.dropdown(m.frame.filter)
dropdown:SetPoint('TOPLEFT', m.class_dropdown, 'BOTTOMLEFT', 0, -22)
private.subclass_dropdown = dropdown
dropdown:SetPoint('TOPLEFT', m.class_dropdown, 'BOTTOMLEFT', 0, -23)
dropdown:SetWidth(300)
dropdown:SetHeight(10)
local label = aux.gui.label(dropdown, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -4)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -1)
label:SetText('Item Subclass')
UIDropDownMenu_Initialize(dropdown, m.initialize_subclass_dropdown)
dropdown:SetScript('OnShow', function()
UIDropDownMenu_Initialize(this, m.initialize_subclass_dropdown)
end)
private.subclass_dropdown = dropdown
end
do
local dropdown = aux.gui.dropdown(m.frame.filter)
dropdown:SetPoint('TOPLEFT', m.subclass_dropdown, 'BOTTOMLEFT', 0, -22)
private.slot_dropdown = dropdown
dropdown:SetPoint('TOPLEFT', m.subclass_dropdown, 'BOTTOMLEFT', 0, -23)
dropdown:SetWidth(300)
dropdown:SetHeight(10)
local label = aux.gui.label(dropdown, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -4)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -1)
label:SetText('Item Slot')
UIDropDownMenu_Initialize(dropdown, m.initialize_slot_dropdown)
dropdown:SetScript('OnShow', function()
UIDropDownMenu_Initialize(this, m.initialize_slot_dropdown)
end)
private.slot_dropdown = dropdown
end
do
local dropdown = aux.gui.dropdown(m.frame.filter)
dropdown:SetPoint('TOPLEFT', m.slot_dropdown, 'BOTTOMLEFT', 0, -22)
private.quality_dropdown = dropdown
dropdown:SetPoint('TOPLEFT', m.slot_dropdown, 'BOTTOMLEFT', 0, -23)
dropdown:SetWidth(300)
dropdown:SetHeight(10)
local label = aux.gui.label(dropdown, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -4)
label:SetText('Min Rarity')
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -1)
label:SetText('Min Quality')
UIDropDownMenu_Initialize(dropdown, m.initialize_quality_dropdown)
dropdown:SetScript('OnShow', function()
UIDropDownMenu_Initialize(this, m.initialize_quality_dropdown)
end)
private.quality_dropdown = dropdown
end
aux.gui.vertical_line(m.frame.filter, 332)
do
local dropdown = aux.gui.dropdown(m.frame.filter)
dropdown:SetPoint('TOPRIGHT', -177, -10)
dropdown:SetWidth(150)
dropdown:SetHeight(10)
UIDropDownMenu_Initialize(dropdown, m.initialize_filter_dropdown)
dropdown:SetScript('OnShow', function()
UIDropDownMenu_Initialize(this, m.initialize_filter_dropdown)
@@ -530,7 +526,6 @@ aux.search_tab.FRAMES(function(m, public, private)
local input = aux.gui.editbox(m.frame.filter)
input:SetPoint('LEFT', m.filter_dropdown, 'RIGHT', 10, 0)
input:SetWidth(150)
input:SetHeight(25)
input:SetScript('OnChar', function()
this:complete()
end)