API:ActionBarFrame Update

__NOTOC__
Usage: 
ActionBarFrame_Update(this)
== Parameters ==
=== Arguments ===
:;this
::string - uses self frame name, "ActionBarFrame"
=== Returns ===
:nil
== Example ==
ActionBarFrame_Update("ActionBarFrame")
== Related Functions ==
* ActionBar_Restoe
* ActionBarFrame_LoadIni
* ActionBarFrame_OnEvent
* ActionBarFrame_OnLoad
* ActionBarFrame_OnUpdate
== Source Code ==
function ActionBarFrame_Update(this)
	local info = ActionBarInfo[this:GetID()];
	local button;
	local column=1;
	if ( info.row < 1 ) then
		info.row = 1;
	end
	local row = 1;
	if ( info.visible==1 or info.visible==true ) then
		this:Show();
	else
		this:Hide();
	end	
	for i = 1, ACTIONBAR_NUM_BUTTONS do
		button = getglobal(this:GetName().."Button"..i);
		if ( i <= info.count ) then
			button.visible = true;
			button:Show();
			if ( i > 1 ) then
				button:ClearAllAnchors();
				if ( row < info.row) then
					row=row+1;
					button:SetAnchor("LEFT", "RIGHT", this:GetName().."Button"..(i - 1), ACTIONBUTTON_OFFSET, 0);			
				else
					row=1;
					button:SetAnchor("TOP", "BOTTOM", this:GetName().."Button"..info.row *(column-1)+1, 0, ACTIONBUTTON_OFFSET);				
					column=column+1;				
				end
			end
			
			ActionButton_Update(button);
			ActionButton_UpdateCooldown(button);
			ActionButton_UpdateHotkeys(button);
		else
			button.visible = false;
			button:Hide();
		end
	end
	
--	local column = math.floor(info.count /10);
--	if (column>10) then column=10; info.row=info.row+1; end
	local width = ACTIONBUTTON_SIZE * info.row + (info.row - 1) * ACTIONBUTTON_OFFSET + 2;
	local height = ACTIONBUTTON_SIZE * column + (column - 1) * ACTIONBUTTON_OFFSET + 2;
	this:SetSize(width, height);
 
--	this:setPos();	
end
Category:Functions