class ImageSwappingController extends inkLogicController
{
	editable var ImageWidgetPath : String;
	const editable var ButtonsPaths : array< CName >;
	const editable var ButtonsNames : array< String >;
	const editable var ButtonsValues : array< String >;
	private var Buttons : array< weak< inkCanvas > >;

	protected event OnInitialize()
	{
		FillButtons();
	}

	private function FillButtons()
	{
		var i : Int32;
		var button : inkCanvas;
		var controller : weak< TechQA_ImageSwappingButtonController >;
		for( i = 0; i < ButtonsPaths.Size(); i += 1 )
		{
			button = ( ( inkCanvas )( GetWidget( ButtonsPaths[ i ] ) ) );
			if( button )
			{
				Buttons.PushBack( button );
				controller = ( ( TechQA_ImageSwappingButtonController )( button.GetController() ) );
				if( controller )
				{
					controller.SetDescription( ButtonsNames[ i ] );
				}
			}
		}
	}

}

class TechQA_ImageSwappingButtonController extends inkLogicController
{
	editable var textWidgetPath : CName;
	var textWidget : weak< inkText >;

	protected event OnInitialize()
	{
		textWidget = ( ( inkText )( GetWidget( textWidgetPath ) ) );
	}

	public function SetDescription( const newDescription : ref< String > )
	{
		textWidget.SetText( newDescription );
	}

}

