#include <origin.h>
#include <GetNBox.h>
#include <xfutils.h>
//put additional include files here
#include <..\Originlab\theme_utils.h>
//put your own support static functions here



void wks_update_link_table(const Worksheet& iw)
{
	if(!iw)
		return;
	
	Grid gg;
	GraphObject grTable;
	if(iw.GetLinkTable(gg, grTable))
	{
		Tree trTheme;
		if(theme_get_from_wks_grid(iw, trTheme, FPB_ALL, FOB_ALL, TH_DEL_GRID_COL_HEADING | TH_DEL_GRID_ROW_HEADING))
		{
			gg.ApplyFormat(trTheme, true, true);
			grTable.AutoSize(0,1);
			GraphLayer gl;grTable.GetParent(gl);
			if(gl)
			{
				GraphPage gp;gl.GetParent(gp);
				string strLT = ";win -a ";// leading ; to delay this until XF exit
				strLT+= gp.GetName();
				LT_execute(strLT);
			}
		}
	}
	
}

//nGetNDialog = 0,1,2, corresponding to the XF GetN dropdown, 0 = dialog is not used
//you can change nRet to be one of XFEVT_PROCEED (defualt), XFEVT_ABORT, XFEVT_PROCEED_NO_DLG or XFEVT_PROCEED_WITH_DLG(when nGetNDialog = 0)
//nGetNDialog = -1 when Ok on GetN dialog to allow handler to preocess <auto> etc variables
//dwCntrl is combination of bits
//LTXF_FROM_GUI_MENU, LTXF_FROM_GUI_PROMPT, LTXF_FROM_AUTO_UPDATE, LTXF_FROM_FUNCTION, LTXF_THEME_USED, LTXF_CHANGE_PARAM
void wks_update_link_table_before_execute(TreeNode& trGetN, int nGetNDialog, int& nRet, int dwCntrl)
{

}
