
DECLARE CONSTANT n_BtnExpandRecTrans 	AS  QUANTITY	50000
DECLARE VARIABLE n_FormExpanded			AS 	QUANTITY

#########################################################
PROCEDURE OnInitForm DO
{
	[n_FormExpanded] := 0;
}

#########################################################
PROCEDURE OnPress
        DECLARE PARAMETER nButtonID as QUANTITY
        DECLARE PARAMETER sButtonName as TEXT DO
{
	IF ( [nButtonID] = n_BtnExpandRecTrans ) DO
	{
		IF ( [n_FormExpanded] = 0 ) THEN
		{
			[n_FormExpanded] := 1;
			ChangeControlName(n_BtnExpandRecTrans, "<<");
		}
		ELSE
		{
			[n_FormExpanded] := 0;
			ChangeControlName(n_BtnExpandRecTrans, ">>");
		}
		
		DECLARE VARIABLE nID 				AS QUANTITY
		DECLARE VARIABLE sWndID				AS TEXT 20
		DECLARE VARIABLE sLayoutCtrlID		AS TEXT 20				
		DECLARE VARIABLE sBtnID				AS TEXT 20
		DECLARE VARIABLE sExpandState		AS TEXT 20
		
		[nID] 			:= GetWndID();
		[sBtnID]		:= IntToString( n_BtnExpandRecTrans );		
		[sWndID] 		:= IntToString( [nID] );
		[sLayoutCtrlID] := IntToString( GetCtrlIDByName("OrderEntry") );
		[sExpandState]  := IntToString( [n_FormExpanded] );
		
		ExecExtSrciptProc("OnExpandButtonClicked", [sWndID], [sLayoutCtrlID], [sBtnID], [sExpandState]);	
	}
}

PROCEDURE SetPreferenceOptions DO 
{
	CALL OnPress n_BtnExpandRecTrans, "" ; 
}

##########################################################
PROCEDURE SetBkgColor
		 DECLARE PARAMETER sRVal AS TEXT
		 DECLARE PARAMETER sGVal AS TEXT 
		 DECLARE PARAMETER sBVal AS TEXT DO
{
	DECLARE VARIABLE nRed	AS QUANTITY
	DECLARE VARIABLE nGreen	AS QUANTITY
	DECLARE VARIABLE nBlue	AS QUANTITY
	
	[nRed]   := StringToInt([sRVal]);
	[nGreen] := StringToInt([sGVal]);
	[nBlue]  := StringToInt([sBVal]);
	
	SetBackColor([nRed], [nGreen], [nBlue], 1);
}

PROCEDURE ResetPane DO
{
	IF ( [n_FormExpanded] = 1 ) DO
	{
		[n_FormExpanded] := 0;
		#SLogLine("ResetPane");
		ChangeControlName(n_BtnExpandRecTrans, ">>");
	}
}




