Added feature to allow the scroll frames columns to be adjusted in width.
To implement this in any addon making use of scrollframes .. make the following changes.
http://www.nogdev.pastey.net/82799
frame.imageview.sheet = ScrollSheet:Create(frame.imageview, {
{ "Item", "TEXT", 105 },
}, nil, nil, nil, private.onResize) --nils are place holders for teh optional onEnter, onLeave, onClick scripts used with teh "TOOLTIP" style
--add this function into the module
function private.onResize(column, name, frame)
local originalScript = frame.labels[column].button:GetScript("OnMouseDown") --store the original Sort onclick script will reset it when we are done resizing
local point, relativeTo, relativePoint, xOfs, yOfs = frame.labels[column].button:GetPoint() --Store the anchor point since its niled when resizing the button
--limit the size we will allow buttons to get
local width = frame.labels[column].button:GetWidth()
local height = frame.labels[column].button:GetHeight()
frame.labels[column].button:SetResizable(true)
frame.labels[column].button:SetMaxResize(400, height)
frame.labels[column].button:SetMinResize(10, height)
--set the resize script
frame.labels[column].button:SetScript("OnMouseDown", function() frame.labels[column].button:StartSizing(frame.labels[column].button) end)
--resets the original onclick as well as setting new anchor points for our buttons
frame.labels[column].button:SetScript("OnMouseUp", function()
frame.labels[column].button:StopMovingOrSizing()
frame.labels[column].button:SetScript("OnMouseDown", originalScript)
frame.labels[column].button:ClearAllPoints()
frame.labels[column].button:SetPoint(point, relativeTo, relativePoint, xOfs,yOfs)
end)
--start resizing frame
frame.labels[column].button:StartSizing(frame.labels[column].button)
end
--This is a per session change unless teh module stores the new widths to be applied on the next startup