WindActionScrollSize = {
	{37, 55},
	{55, 37}
}

function WindActionScroll_OnLoad()
	WindCommon_setParentPoint(ActionBarUpButton, WindActionScroll, "TOPLEFT", WindActionScroll, "TOPLEFT", 3, -2);	
	ActionBarUpButton:SetParent(WindActionScroll);
	ActionBarDownButton:SetParent(WindActionScroll);
	WindActionScroll:RegisterEvent("VARIABLES_LOADED");
end

function WindActionScroll_OnEvent()
	if (event == "VARIABLES_LOADED") then
		WindActionScroll_initConfig();
		WindActionScroll_setPoint();
		WindActionScroll_setScale();
		WindActionScroll_setSize();
		WindActionScroll_setBorder();
		WindActionScroll_setView();
	end
end

function WindActionScroll_initConfig()
	if (not WindActionScrollConfig) then WindActionScrollConfig = WindActionDefault["Scroll"]; end

	if (IsAddOnLoaded("WindConfig")) then 
		WindActionConfigScroll_show();
		WindActionConfigScroll_setColor(color); 
	end
end

function WindActionScroll_setPoint()
	WindCommon_setPoint(WindActionScroll, WindActionScrollConfig[1], UIParent, WindActionScrollConfig[1], WindActionScrollConfig[2], WindActionScrollConfig[3]);
end

function WindActionScroll_setScale()
	WindActionScroll:SetScale(WindActionScrollConfig[4]);
end

function WindActionScroll_setSize()
	local index = WindActionScrollConfig[5];
	WindCommon_setSize(WindActionScroll, WindActionScrollSize[index][1], WindActionScrollSize[index][2]);
	WindActionScroll_setAnchor(index);
end

function WindActionScroll_setAnchor(index)
	if (index == 1) then
		WindCommon_setPoint(ActionBarDownButton, "TOPLEFT", ActionBarUpButton, "BOTTOMLEFT", 0, 12);
	elseif (index == 2) then
		WindCommon_setPoint(ActionBarDownButton, "BOTTOMLEFT", ActionBarUpButton, "BOTTOMRIGHT", -12, 0);
	end
end

function WindActionScroll_setBorder()
	if (WindActionScrollConfig[6]) then 
		WindActionScroll:SetBackdrop(WindCommon_ColorBorder);
		WindActionScroll_setColor();
	else 
		WindActionScroll:SetBackdrop(nil); 
	end
end

function WindActionScroll_setColor()
	WindActionScroll:SetBackdropBorderColor(WindActionScrollConfig[7][1].r, WindActionScrollConfig[7][1].g, WindActionScrollConfig[7][1].b, WindActionScrollConfig[7][1].a);
	WindActionScroll:SetBackdropColor(WindActionScrollConfig[7][2].r, WindActionScrollConfig[7][2].g, WindActionScrollConfig[7][2].b, WindActionScrollConfig[7][2].a);
end

function WindActionScroll_resetColor()
	WindActionScrollConfig[7] = WindActionDefault["Scroll"][7];
	WindActionScroll_setColor();
end

function WindActionScroll_setView()
	if (WindActionScrollConfig[8]) then 
		WindActionScroll:Show();
	else 
		WindActionScroll:Hide(); 
	end
end