//-------------------------------------------------------------------------------
//
//	FILE: testcode.c
//
//	IMenuCtl interfaceのサブプログラム 
//
//-------------------------------------------------------------------------------

#include "MenuCtl.h"
#include "menu_res.h"
#include "main_res.h"

void SetItem_Test1( MyApp *pApp )
{
	// 作業変数の定義
	int			nindex = TEST_ID;
	int			nf = TEST_FONT;
	CtlAddItem	pcai;
// chg sta  05.04.08 t.morishita #001
#if 0
//	char		cTitle[MAX_LENGTH] = "タイトルﾀｲﾄﾙ""\xF6\xD4""";
//	char		cItem[MAX_LENGTH] = "メニュー１(AddItem)";
#endif
	char		cTitle[MAX_LENGTH] = "アｱ""\xF6\xD4""";
	char		cItem[MAX_LENGTH] = "AddItem";
// chg end  05.04.08 t.morishita #001
	boolean		bRet;
	int			nLoop;
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	// 初期化
	MEMSET( pApp->m_szHtmlBufWk, NULL, BUFSIZE_HTML );
	MEMSET( pApp->m_szHtmlBuf, NULL, BUFSIZE_HTML );
	MEMSET( &pcai, NULL, sizeof(CtlAddItem) );
	
	// 処理中･･･
	disp_mng( pApp );
	
	// テスト開始
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	LogOutMake( pApp, TRUE, FALSE, "==Item==" );
	
	// クラスID表示
	Dispclsid( pApp );
	
	// メニューコントロールのリセット
	test_Reset( pApp );
	
	// IMENUCTL_SetRect()の試験
	test_SetRect( pApp, &pApp->arect );
	
	// IMENUCTL_GetRect()の試験
	test_GetRect( pApp );
	
	// タイトル設定
	test_SetTitle( pApp, MENU_RES_FILE, TEST_TITLE, cTitle );
	
	// IMENUCTL_AddItem()の試験
	bRet = test_AddItem( pApp, NULL, NULL, nindex, cItem, nindex );
	
	// IMENUCTL_GetItem()の試験
	bRet= test_GetItem( pApp, nindex );
	
	// IMENUCTL_AddItemEx(),IMENUCTL_GetItem()の試験
	pcai.pszResText = MENU_RES_FILE;
	pcai.pszResImage = MENU_RES_FILE;
	pcai.wText = TEST1;
	pcai.wImage = TEST_IMAGE1;
	pcai.wFont = (uint16)nf;
	nindex++;
	
	for ( nLoop = 0; nLoop < 10; nLoop++ )
	{
		pcai.wText = TEST1 + nLoop;
		pcai.wItemID = (uint16)nindex + nLoop;
		pcai.dwData = (uint32)nindex + nLoop;
		
		// IMENUCTL_AddItemEx()の試験
		bRet = test_AddItemEx( pApp, &pcai );
		if ( bRet != TRUE )
		{
			break;
		}
		// IMENUCTL_GetItem()の試験
		bRet= test_GetItem( pApp, nindex + nLoop );
		if ( bRet != TRUE )
		{
			break;
		}
		
	}
	
	// メニュー画面アクティブ化
	test_SetActive( pApp, TRUE );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

void SetItem_Test2( MyApp *pApp )
{
	int			nLoop;
	int			nindex = TEST_ID+1;
	char		cItem1[MAX_LENGTH] = {"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほ"};
// chg sta  05.04.08 t.morishita #001
#if 0
//	char		cItem2[MAX_LENGTH] = {"メニュー改行n\nNG"};
//	char		cItem3[MAX_LENGTH] = {"メニュー改行r\rNG"};
//	char		cItem4[MAX_LENGTH] = {"メニュー改行rn\r\nNG"};
#endif
	char		cItem2[MAX_LENGTH] = {"改行n\nNG"};
	char		cItem3[MAX_LENGTH] = {"改行r\rNG"};
	char		cItem4[MAX_LENGTH] = {"改行rn\r\nNG"};
// chg end  05.04.08 t.morishita #001
	char		*pBuf;
	boolean		bRet;
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	// 処理中･･･
	disp_mng( pApp );
	
	
	// テスト開始
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	LogOutMake( pApp, TRUE, FALSE, "==SetRect==" );
	// IMENUCTL_SetRect()の試験
	test_SetRect( pApp, &pApp->arect );
	
	// IMENUCTL_SetItem(MSIF_TEXT)の試験
	for ( nLoop = 0; nLoop < 4; nLoop++,nindex++ )
	{
		switch( nLoop )
		{
		case 0:
			pBuf = cItem1;
			break;
		case 1:
			pBuf = cItem2;
			break;
		case 2:
			pBuf = cItem3;
			break;
		case 3:
			pBuf = cItem4;
			break;
		default:
			pBuf = NULL;
			break;
		}
		
		// IMENUCTL_SetItem()の試験
		bRet = test_SetItemTXT( pApp, nindex, pBuf );
		if ( bRet != TRUE )
		{
			break;
		}
		// 設定データ確認
		test_GetItem( pApp, nindex );
	}
	
	// IMENUCTL_SetItem(MSIF_DATA)の試験
// chg sta  05.04.08 t.morishita #002
#if 0
//	bRet = test_SetItemDATA( pApp, nindex+2 );
#endif
	bRet = test_SetItemDATA( pApp, nindex );
// chg end  05.04.08 t.morishita #002

	// 設定データ確認
	test_GetItem( pApp, nindex );
	nindex++;

	// IMENUCTL_SetItem(MSIF_IMAGE)の試験
	bRet = test_SetItemIMG( pApp, nindex );
	// 設定データ確認
	test_GetItem( pApp, nindex );
	nindex++;
	
	// IMENUCTL_SetItem(MSIF_FONT)の試験
	bRet = test_SetItemFNT( pApp, nindex );
	// 設定データ確認
	test_GetItem( pApp, nindex );
	
	// メニュー画面アクティブ化
	test_SetActive( pApp, TRUE );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

void SetItem_Test3( MyApp *pApp )
{
	char		cTitle[MAX_LENGTH] = {"Title11Byte"};
	int			nLen;
	int			nindex = TEST_ID;
// chg sta  05.04.08 t.morishita #001
#if 0
//	char		cItem[MAX_LENGTH] = "メニュー１(AddItem)";
#endif
	char		cItem[MAX_LENGTH] = "AddItem";
// chg end  05.04.08 t.morishita #001
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	// 処理中･･･
	disp_mng( pApp );
	
	// テスト開始
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	LogOutMake( pApp, TRUE, FALSE, "==SetTitle(11byte)==" );
	
	// メニューコントロールのリセット
	test_Reset( pApp );
	
	// IMENUCTL_SetRect()の試験
	test_SetRect( pApp, &pApp->arect );
	
	// IMENUCTL_SetTitle()の試験
	test_SetTitle( pApp, NULL, NULL, cTitle );
	
	// ログ表示
	nLen = STRLEN( cTitle );
	LogOutMake( pApp, TRUE, FALSE, "Length::%d", nLen );
	
	// IMENUCTL_AddItem()の試験
	test_AddItem( pApp, NULL, NULL, nindex, cItem, nindex );
	
	// メニュー画面アクティブ化
	test_SetActive( pApp, TRUE );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

void SetItem_Test4( MyApp *pApp )
{
	boolean		bRet;
	int			nindex = TEST_ID;
	int			nf = TEST_FONT;
// chg sta  05.04.08 t.morishita #001
#if 0
//	char		cTitlen[MAX_LENGTH] = {"タイトル(SetTitle)改行n\nNG"};
//	char		cItemn[MAX_LENGTH] = {"メニュー１(AddItem)改行n\nNG"};
//	char		cItem2n[MAX_LENGTH] = {"メニュー２(AddItemEx)改行n\nNG"};
#endif
	char		cTitlen[MAX_LENGTH] = {"改行n\nNG"};
	char		cItemn[MAX_LENGTH] = {"Item改行n\nNG"};
	char		cItem2n[MAX_LENGTH] = {"ItemEx改行n\nNG"};
// chg end  05.04.08 t.morishita #001
	CtlAddItem	pcai;
	AECHAR		wszDisp[MAX_LENGTH];
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	// 初期化
	MEMSET( &pcai, NULL, sizeof(CtlAddItem) );
	
	// 処理中･･･
	disp_mng( pApp );
	
	// テスト開始
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	LogOutMake( pApp, TRUE, TRUE, "==改行コード確認(n)==" );
	
	// メニューコントロールのリセット
	test_Reset( pApp );
	
	// IMENUCTL_SetRect()の試験
	test_SetRect( pApp, &pApp->arect );
	
	// IMENUCTL_SetTitle()の試験
	test_SetTitle( pApp, NULL, NULL, cTitlen );
	
	// IMENUCTL_AddItem()の試験
	bRet = test_AddItem( pApp, NULL, NULL, nindex, cItemn, nindex );
	nindex++;
	
	// IMENUCTL_AddItemEx()の試験
	pcai.pszResImage = MENU_RES_FILE;
	pcai.wImage = TEST_IMAGE1;
	pcai.wFont = (uint16)nf;
	pcai.wItemID = (uint16)nindex;
	pcai.dwData = (uint32)nindex;
	
	STRTOWSTR( cItem2n, wszDisp, sizeof(wszDisp) );
	pcai.pText = wszDisp;
	
	bRet = test_AddItemEx( pApp, &pcai );

	// メニュー画面アクティブ化
	test_SetActive( pApp, TRUE );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

void SetItem_Test5( MyApp *pApp )
{
	boolean		bRet;
	int			nindex = TEST_ID;
	int			nf = TEST_FONT;
// chg sta  05.04.08 t.morishita #001
#if 0
//	char		cTitler[MAX_LENGTH] = {"タイトル(SetTitle)改行r\rNG"};
//	char		cItemr[MAX_LENGTH] = {"メニュー１(AddItem)改行r\rNG"};
//	char		cItem2r[MAX_LENGTH] = {"メニュー２(AddItemEx)改行r\rNG"};
#endif
	char		cTitler[MAX_LENGTH] = {"改行r\rNG"};
	char		cItemr[MAX_LENGTH] = {"Item改行r\rNG"};
	char		cItem2r[MAX_LENGTH] = {"ItemEx改行r\rNG"};
// chg end  05.04.08 t.morishita #001

	CtlAddItem	pcai;
	AECHAR		wszDisp[MAX_LENGTH];
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	// 初期化
	MEMSET( &pcai, NULL, sizeof(CtlAddItem) );

	// 処理中･･･
	disp_mng( pApp );
	
	// テスト開始
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	LogOutMake( pApp, TRUE, TRUE, "==改行コード確認(r)==" );
	
	// メニューコントロールのリセット
	test_Reset( pApp );
	
	// IMENUCTL_SetRect()の試験
	test_SetRect( pApp, &pApp->arect );
	

	// IMENUCTL_SetTitle()の試験
	test_SetTitle( pApp, NULL, NULL, cTitler );
	

	// IMENUCTL_AddItem()の試験
	bRet = test_AddItem( pApp, NULL, NULL, nindex, cItemr, nindex );
	nindex++;
	
	// IMENUCTL_AddItemEx()の試験
	pcai.pszResImage = MENU_RES_FILE;
	pcai.wImage = TEST_IMAGE1;
	pcai.wFont = (uint16)nf;
	pcai.wItemID = (uint16)nindex;
	pcai.dwData = (uint32)nindex;
	
	STRTOWSTR( cItem2r, wszDisp, sizeof(wszDisp) );
	pcai.pText = wszDisp;
	
	bRet = test_AddItemEx( pApp, &pcai );

	// メニュー画面アクティブ化
	test_SetActive( pApp, TRUE );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

void SetItem_Test6( MyApp *pApp )
{
	boolean		bRet;
	int			nindex = TEST_ID;
	int			nf = TEST_FONT;
// chg sta  05.04.08 t.morishita #001
#if 0
//	char		cTitlern[MAX_LENGTH] = {"タイトル(SetTitle)改行rn\r\nNG"};
//	char		cItemrn[MAX_LENGTH] = {"メニュー１(AddItem)改行rn\r\nNG"};
//	char		cItem2rn[MAX_LENGTH] = {"メニュー２(AddItemEx)改行rn\r\nNG"};
#endif
	char		cTitlern[MAX_LENGTH] = {"改行rn\r\nNG"};
	char		cItemrn[MAX_LENGTH] = {"Item改行rn\r\nNG"};
	char		cItem2rn[MAX_LENGTH] = {"ItemEx改行rn\r\nNG"};
// chg end  05.04.08 t.morishita #001
	CtlAddItem	pcai;
	AECHAR		wszDisp[MAX_LENGTH];
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	// 初期化
	MEMSET( &pcai, NULL, sizeof(CtlAddItem) );

	// 処理中･･･
	disp_mng( pApp );
	
	// テスト開始
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	LogOutMake( pApp, TRUE, TRUE, "==改行コード確認(rn)==" );
	
	// メニューコントロールのリセット
	test_Reset( pApp );
	
	// IMENUCTL_SetRect()の試験
	test_SetRect( pApp, &pApp->arect );
	

	// IMENUCTL_SetTitle()の試験
	test_SetTitle( pApp, NULL, NULL, cTitlern );
	

	// IMENUCTL_AddItem()の試験
	bRet = test_AddItem( pApp, NULL, NULL, nindex, cItemrn, nindex );
	nindex++;
	
	// IMENUCTL_AddItemEx()の試験
	pcai.pszResImage = MENU_RES_FILE;
	pcai.wImage = TEST_IMAGE1;
	pcai.wFont = (uint16)nf;
	pcai.wItemID = (uint16)nindex;
	pcai.dwData = (uint32)nindex;
	
	STRTOWSTR( cItem2rn, wszDisp, sizeof(wszDisp) );
	pcai.pText = wszDisp;
	
	bRet = test_AddItemEx( pApp, &pcai );

	// メニュー画面アクティブ化
	test_SetActive( pApp, TRUE );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

void SetItem_Test7( MyApp *pApp )
{
	AEERect		aSetRect;
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	// 処理中･･･
	disp_mng( pApp );
	
	// テスト開始
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	LogOutMake( pApp, TRUE, TRUE, "==SetRect(1,1)==" );
	
	// 画面初期化
	IDISPLAY_ClearScreen( pApp->app.m_pIDisplay );
	
	// (1,1)設定
	SETAEERECT( &aSetRect, 0, 0, 1, 1 );
	
	// IMENUCTL_SetRect()の試験
	test_SetRect( pApp, &aSetRect );
	
	// IMENUCTL_GetRect()の試験
	test_GetRect( pApp );
	
	// メニュー画面アクティブ化
	test_SetActive( pApp, TRUE );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

//	Active_TEST :: IMENUCTL_Set(Is)Active関数のテスト
void Active_TEST( MyApp *pApp, boolean Flag )
{
	char			szBuf[MAX_LENGTH] = {"Active Test"};
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	// 初期化
	MEMSET( pApp->m_szHtmlBuf, NULL, BUFSIZE_HTML );
	
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	Dispclsid( pApp );
	LogOutMake( pApp, TRUE, FALSE, "==Active==" );
	
	if ( Flag == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "==TRUE==" );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "==FALSE==" );
	}
	
	// ステータス変更
	
	pApp->ncon = CON_DEFAULT;
	
	// タイトル設定
	test_SetTitle( pApp, NULL, NULL, szBuf );
	
	// メニュー画面アクティブ化
	test_SetActive( pApp, Flag );
	
	// IMENUCTL_IsActive()の試験
	test_IsActive( pApp );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

//	Move_Test :: IMENUCTL_MoveItem関数のテスト
void Move_Test( MyApp *pApp )
{
	// 作業変数の定義
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	Dispclsid( pApp );
	LogOutMake( pApp, TRUE, FALSE, "==Move==" );
	
	return;
}

void Move_Test1( MyApp *pApp ,boolean Flag )
{
	// 作業変数の定義
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	if ( Flag == TRUE )
	{
		// down
		test_MoveItem( pApp, (uint16)TEST2_ID, 1 );
	}
	else
	{
		// up
		test_MoveItem( pApp, (uint16)TEST2_ID, -1 );
	}
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

boolean test_MoveItem( MyApp *pApp, uint16 unId, int nDir )
{
	boolean		bRet = TRUE;
	
	// IMENUCTL_MoveItem()の試験
	IMENUCTL_MoveItem( pApp->pimc, unId, nDir );
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_MoveItem 実行" );
	if ( nDir == 1 )
	{
		LogOutMake( pApp, TRUE, FALSE, "ID::%d is 1 down", TEST2_ID );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "ID::%d is 1 up", TEST2_ID );
	}
	
	return bRet;
}


//	GetCDI_Test :: IMENUCTL_GetItemCount関数とIMENUCTL_GetItemData関数と
//				   IMENUCTL_GetItemID関数のテスト
void GetCDI_Test( MyApp *pApp )
{
	// 作業変数の定義
	int			nCnt = 0;
	int			nindex;
	boolean		bRet;
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	// 初期化
	MEMSET( pApp->m_szHtmlBuf, NULL, BUFSIZE_HTML );
	
	// ログ表示
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	Dispclsid( pApp );
	LogOutMake( pApp, TRUE, FALSE, "==GetItem==" );
	
	// IMENUCTL_GetItemCount()の試験
	test_GetItemCount( pApp, &nCnt );
	
	for ( nindex = MENU_ID; nindex < nCnt; nindex++ )
	{
		// IMENUCTL_GetItemData()の試験
		bRet = test_GetItemData( pApp, nindex );
		if ( bRet == TRUE )
		{
			// IMENUCTL_GetItemID()の試験
			test_GetItemID( pApp, nindex );
		}
	}
	
	return;
}


//	SetColors_Test :: IMENUCTL_SetColors関数のテスト
void SetColors_Test( MyApp *pApp )
{
	// 作業変数の定義
	boolean			bRet;
	uint16			unMask = 0xffff;
	int				nindex = TEST2_ID;
	AEEItemStyle	aisNormal;
	AEEItemStyle	aisSel;
	AEEMenuColors	amc;
	AEEMenuColors	*pamc;
	AEEDeviceInfo	di;
// chg sta  05.04.08 t.morishita #001
#if 0
//	char			cText[MAX_LENGTH] = {"テキストﾃｷｽﾄ""\xF6\xD4"""};
//	char			cTextn[MAX_LENGTH] = {"メニュー改行n\nNG"};
//	char			cTextr[MAX_LENGTH] = {"メニュー改行r\rNG"};
//	char			cTextrn[MAX_LENGTH] = {"メニュー改行rn\r\nNG"};
#endif
	char			cText[MAX_LENGTH] = {"アｱ""\xF6\xD4"""};
	char			cTextn[MAX_LENGTH] = {"改行n\nNG"};
	char			cTextr[MAX_LENGTH] = {"改行r\rNG"};
	char			cTextrn[MAX_LENGTH] = {"改行rn\r\nNG"};
// chg end  05.04.08 t.morishita #001
	uint16			unIndex;
	char			*pBuf;
	int				nLoop;
	const char*		pResFile;
	uint16			unResID;

	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	// 初期化
	MEMSET( &aisNormal, 0, sizeof(AEEItemStyle) );
	MEMSET( &aisSel, 0, sizeof(AEEItemStyle) );
	MEMSET( &amc, 0, sizeof(AEEMenuColors) );
	MEMSET( &di, 0, sizeof(AEEDeviceInfo) );
	
	// メニューコントロールのリセット
	test_Reset( pApp );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	// 領域設定
	pApp->arect.x += 20;
	pApp->arect.y += 20;
	pApp->arect.dx -= 40; 
	pApp->arect.dy = ( pApp->arect.dy / 3 ) * 2;
	
	bRet = Test_Menu( pApp, MP_MULTI_SEL );
	if ( bRet == TRUE )
	{
		MEMSET(pApp->m_szHtmlBuf,NULL,BUFSIZE_HTML);
		LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
		Dispclsid( pApp );
		LogOutMake( pApp, TRUE, FALSE, "==SetColors==" );
		
		// 表示領域の設定値を元に戻す
		ISHELL_GetDeviceInfo( pApp->app.m_pIShell, &di );
		SETAEERECT( &pApp->arect, 0, 0, di.cxScreen, di.cyScreen );
		
		// IMENUCTL_SetItemText()の試験
		for ( nLoop = 0; nLoop < 8; nLoop++ )
		{
			
			switch ( nLoop )
			{
			case 0:
				pResFile = NULL;
				unResID = NULL;
				pBuf = cText;
				break;
			case 1:
				pResFile = NULL;
				unResID = NULL;
				pBuf = cTextn;
				break;
			case 2:
				pResFile = NULL;
				unResID = NULL;
				pBuf = cTextr;
				break;
			case 3:
				pResFile = NULL;
				unResID = NULL;
				pBuf = cTextrn;
				break;
			case 4:
				pResFile = MENU_RES_FILE;
				unResID = CON3;
				pBuf = NULL;
				break;
			case 5:
				pResFile = MENU_RES_FILE;
				unResID = CON4;
				pBuf = NULL;
				break;
			case 6:
				pResFile = MENU_RES_FILE;
				unResID = CON5;
				pBuf = NULL;
				break;
			case 7:
				pResFile = MENU_RES_FILE;
				unResID = CON6;
				pBuf = NULL;
				break;
			default:
				pResFile = NULL;
				unResID = NULL;
				pBuf = NULL;
				break;
			}
			// IMENUCTL_SetItemText()の試験
			test_SetItemText( pApp, nindex+nLoop, pResFile, unResID, pBuf );
			
		}
		
		if ( (pApp->ctype == MENUCTL) || 
		     (pApp->ctype == ICONVIEWCTL) )
		{
			aisNormal.ft = AEE_FT_BOX;
			aisNormal.xOffset = 3;
			aisNormal.yOffset = 3;
			aisNormal.roImage = AEE_RO_OR;
			aisSel.ft = AEE_FT_RAISED;
			aisSel.xOffset = 10;
			aisSel.yOffset = 10;
			aisSel.roImage = AEE_RO_XOR;
			
			// IMENUCTL_SetStyle()の試験
			test_SetStyle( pApp, &aisNormal, &aisSel );
			
			// IMENUCTL_GetStyle()の試験
			test_GetStyle( pApp );
		}
		
		if ( pApp->apl_state == DRW_SETC1 )
		{
			// SetFocus パラメータ設定
			unIndex = (uint16)-1;
			
			// SetColor パラメータ設定
			pamc = NULL;
		}
		else
		{
			// SetFocus パラメータ設定
			unIndex = nindex+1;
			
			// SetColor パラメータ設定
			amc.wMask = unMask;
			amc.cBack = RGB_PURPLE;
			amc.cText = RGB_GREEN;
			amc.cSelBack = RGB_RED;
			amc.cSelText = RGB_BLUE;
			amc.cFrame = RGB_BLACK;
			amc.cScrollbar = RGB_BLACK;
			amc.cScrollbarFill = RGB_WHITE;
			amc.cTitle = RGB_YELLOW;
			amc.cTitleText = RGB_BLACK;
			
			pamc = &amc;
		}
		// IMENUCTL_SetFocus()の試験
		test_SetFocus( pApp, unIndex );
		
		// IMENUCTL_GetFocus()の試験
		test_GetFocus( pApp );
		
		// IMENUCTL_SetColors()の試験
		test_SetColor( pApp, pamc );
		
		// IMENUCTL_GetColors()の試験
		test_GetColor( pApp );
		
		// メニュー画面アクティブ化
		test_SetActive( pApp, TRUE );
		
		// IMENUCTL_Redraw()の試験
		test_Redraw( pApp );
		
	}
	
	return;
}


//	CustomSort :: メニューに関連付けられたデータで昇順でソート
int CustomSort( void *pUser, uint32 dwData1, uint32 dwData2 )
{
	int		bRet;
	
	// 初期化
	bRet = 0;
	
	if ( dwData1 > dwData2 )
	{
		bRet = -1;
	}
	else if ( dwData1 < dwData2 )
	{
		bRet = 1;
	}
	
	return bRet;
}

boolean menuMain_item1( MyApp* pApp )
{
	boolean bRet=FALSE;
	
	MEMSET( pApp->m_szHtmlBuf, NULL,BUFSIZE_HTML );
	
	// AddRef/Releaseテスト
	bRet = test_Add_Rele( pApp );
	
	// ログ出力
	LogDispUpdate( pApp );
	
	return bRet;
}
// ログ表示以下
boolean menuMain_item9( MyApp* pApp )
{
	boolean bRet = TRUE;
	
	LogDisp( pApp );
	LogDispUpdate( pApp );
	
	return bRet;
}
// ログクリア以下
boolean menuMain_item10( MyApp* pApp )
{
	boolean bRet = TRUE;
	
	LogClear( pApp );
	LogDispUpdate( pApp );
	
	return bRet;
}
//
boolean test_Add_Rele( MyApp* pApp )
{
	IMenuCtl	*pim;
	int			iRet;
	boolean		bRet;
	int			nLoop;
	
	//	Null ﾁｪｯｸ
	if ( pApp == NULL )
	{
		return FALSE;
	}
	
	// 初期化
	bRet = FALSE;
	pim = NULL;
	
	iRet = ISHELL_CreateInstance( pApp->app.m_pIShell, AEECLSID_MENUCTL, (void**)&pim );
	if ( SUCCESS != iRet )
	{
		DBGPRINTF( "IMENUCTL CreateInstance AddRef_Rele FAILED" );
		return FALSE;
	}
	else
	{
		// テスト開始
		LogOutMake( pApp, TRUE, TRUE, "***基本動作確認 START***" );
		
		// インクリメント
		for ( nLoop = 0; nLoop < 2; nLoop++ )
		{
			test_Addref( pApp, pim );
		}
		
		// デクリメント(ここで作成した分のみ）
		for ( nLoop = 0; nLoop < 3; nLoop++ )
		{
			test_Release( pApp, pim );
		}
		
		bRet = TRUE;
	}
	
	return bRet;
}

boolean test_Addref( MyApp* pApp, IMenuCtl *pIm )
{
	boolean		bRet = TRUE;
	uint32		unCount;
	
	unCount = IMENUCTL_AddRef( pIm );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_AddRef 実行" );
	LogOutMake( pApp, TRUE, FALSE, "Cnt::%u",unCount );
	
	return bRet;
}

boolean test_Release( MyApp* pApp, IMenuCtl *pIm )
{
	boolean		bRet = TRUE;
	uint32		unCount;
	
	unCount = IMENUCTL_Release( pIm );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_Release 実行" );
	LogOutMake( pApp, TRUE, FALSE, "Cnt::%u",unCount );
	
	return bRet;
}

void LogDispUpdate( MyApp*  pApp )
{
	// ログ出力処理
	IHTMLVIEWER_SetRect( pApp->m_pihv, &pApp->arect );
	IHTMLVIEWER_SetActive( pApp->m_pihv, TRUE );
	IHTMLVIEWER_ParseBuffer( pApp->m_pihv , pApp->m_szHtmlBuf );
	IHTMLVIEWER_Redraw( pApp->m_pihv );
	MEMSET( pApp->m_szHtmlBuf, NULL, BUFSIZE_HTML );
}

//ステート設定関数
boolean MoveState( MyApp* pApp, enAplState apiSt )
{

	switch ( apiSt )
	{
	case MENU_MAIN:
		 pApp->apl_state = MENU_MAIN;
		 break;
	case MENU_CTLSEL:
		 pApp->apl_state = MENU_CTLSEL;
		 break;
	case MENU_CTL:
		 pApp->apl_state = MENU_CTL;
		 break;
	case MENU_CTL_PRO:
		 pApp->apl_state = MENU_CTL_PRO;
		 break;
	case MENU_CTL_YN:
		 pApp->apl_state = MENU_CTL_YN;
		 break;
	case MENU_CTL_SORT:
		 pApp->apl_state = MENU_CTL_SORT;
		 break;
	case MENU_RECT:
		 pApp->apl_state = MENU_RECT;
		 break;
	case MENU_DRAW:
		 pApp->apl_state = MENU_DRAW;
		 break;
	case LOG_ADDREF_REL:
		 pApp->apl_state = LOG_ADDREF_REL;
		 break;
	case LOG_SET_GET_PROPERTY:
		 pApp->apl_state = LOG_SET_GET_PROPERTY;
		 break;
	case LOG_LINE:
		 pApp->apl_state = LOG_LINE;
		 break;
	case LOG_RECT:
		 pApp->apl_state = LOG_RECT;
		 break;
	case LOG_ACTIVE:
		 pApp->apl_state = LOG_ACTIVE;
		 break;
	case LOG_TEXT:
		 pApp->apl_state = LOG_TEXT;
		 break;
	case LOG_FONT:
		 pApp->apl_state = LOG_FONT;
		 break;
	case LOG_ALL_DISP:
		 pApp->apl_state = LOG_ALL_DISP;
		 break;
	case LOG_ALL_CLEAR:
		 pApp->apl_state = LOG_ALL_CLEAR;
		 break;
	case DRW_ITEM1:
		 pApp->apl_state = DRW_ITEM1;
		 break;
	case DRW_ITEM2:
		 pApp->apl_state = DRW_ITEM2;
		 break;
	case DRW_ITEM3:
		 pApp->apl_state = DRW_ITEM3;
		 break;
	case DRW_ITEM4:
		 pApp->apl_state = DRW_ITEM4;
		 break;
	case DRW_ITEM5:
		 pApp->apl_state = DRW_ITEM5;
		 break;
	case DRW_ITEM6:
		 pApp->apl_state = DRW_ITEM6;
		 break;
	case DRW_ITEM7:
		 pApp->apl_state = DRW_ITEM7;
		 break;
	case DRW_END:
		 pApp->apl_state = DRW_END;
		 break;
	case DRW_PRO:
		 pApp->apl_state = DRW_PRO;
		 break;
	case DRW_DELI:
		 pApp->apl_state = DRW_DELI;
		 break;
	case DRW_DELI1:
		 pApp->apl_state = DRW_DELI1;
		 break;
	case DRW_DELA:
		 pApp->apl_state = DRW_DELA;
		 break;
	case DRW_DELA1:
		 pApp->apl_state = DRW_DELA1;
		 break;
	case DRW_ENA:
		 pApp->apl_state = DRW_ENA;
		 break;
	case DRW_SETS1:
		 pApp->apl_state = DRW_SETS1;
		 break;
	case DRW_SETS2:
		 pApp->apl_state = DRW_SETS2;
		 break;
	case DRW_SELEX1:
		 pApp->apl_state = DRW_SELEX1;
		 break;
	case DRW_SELEX2:
		 pApp->apl_state = DRW_SELEX2;
		 break;
	case DRW_SELEX3:
		 pApp->apl_state = DRW_SELEX3;
		 break;
	case DRW_MOVE1:
		 pApp->apl_state = DRW_MOVE1;
		 break;
	case DRW_MOVE2:
		 pApp->apl_state = DRW_MOVE2;
		 break;
	case DRW_MOVE3:
		 pApp->apl_state = DRW_MOVE3;
		 break;
	case DRW_MOVE4:
		 pApp->apl_state = DRW_MOVE4;
		 break;
	case DRW_MOVE5:
		 pApp->apl_state = DRW_MOVE5;
		 break;
	case DRW_SETC1:
		 pApp->apl_state = DRW_SETC1;
		 break;
	case DRW_SETC2:
		 pApp->apl_state = DRW_SETC2;
		 break;
	case DRW_SORT:
		 pApp->apl_state = DRW_SORT;
		 break;
	case DRW_RESET1:
		 pApp->apl_state = DRW_RESET1;
		 break;
	case DRW_RESET2:
		 pApp->apl_state = DRW_RESET2;
		 break;
	case DRW_PRO_ENABLE_INACTIVE:
		 pApp->apl_state = DRW_PRO_ENABLE_INACTIVE;
		 break;
	case DRW_PRO_SCROLL:
		 pApp->apl_state = DRW_PRO_SCROLL;
		 break;
	case DRW_LINE1:
		 pApp->apl_state = DRW_LINE1;
		 break;
	case DRW_LINE0:
		 pApp->apl_state = DRW_LINE0;
		 break;
	case DRW_LINE_1:
		 pApp->apl_state = DRW_LINE_1;
		 break;
	case DRW_LINEOVER:
		 pApp->apl_state = DRW_LINEOVER;
		 break;
	case DRW_RECT:
		 pApp->apl_state = DRW_RECT;
		 break;
	case DRW_RECT_MIN:
		 pApp->apl_state = DRW_RECT_MIN;
		 break;
	case DRW_RECT_AUTO:
		 pApp->apl_state = DRW_RECT_AUTO;
		 break;
	case DRW_ACTIVE:
		 pApp->apl_state = DRW_ACTIVE;
		 break;
	case DRW_TEXT_HALF:
		 pApp->apl_state = DRW_TEXT_HALF;
		 break;
	case DRW_TEXT_ALL:
		 pApp->apl_state = DRW_TEXT_ALL;
		 break;
	case DRW_TEXT_PICTURE:
		 pApp->apl_state = DRW_TEXT_PICTURE;
		 break;
	case DRW_TEXT_ADD_CHANGE:
		 pApp->apl_state = DRW_TEXT_ADD_CHANGE;
		 break;
	case DRW_TEXT_RESET:
		 pApp->apl_state = DRW_TEXT_RESET;
		 break;
	case DRW_FONT1:
		 pApp->apl_state = DRW_FONT1;
		 break;
	case DRW_FONT2:
		 pApp->apl_state = DRW_FONT2;
		 break;
	case DRW_FONT3:
		 pApp->apl_state = DRW_FONT3;
		 break;
	case DRW_FONT4:
		 pApp->apl_state = DRW_FONT4;
		 break;
	case DRW_DISP:
		 pApp->apl_state = DRW_DISP;
		 break;
	default:
		break;
	}

	return TRUE;
}
void Dispclsid( MyApp* pApp )
{
	switch ( pApp->ctype )
	{
	case MENUCTL:
		LogOutMake( pApp, TRUE, FALSE, "CLSID::MENUCTL" );
		break;
	case LISTCTL:
		LogOutMake( pApp, TRUE, FALSE, "CLSID::LISTCTL" );
		break;
	case ICONVIEWCTL:
		LogOutMake( pApp, TRUE, FALSE, "CLSID::ICONVIEWCTL" );
		break;
	default:
		break;
	}
	
	return;
}

void test_Reset( MyApp *pApp )
{
	IMENUCTL_Reset( pApp->pimc );
	//ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_Reset 実行" );
	
	return;
}
	

boolean test_SetTitle( MyApp *pApp, const char* pszResFile, uint16 wResID, char* pText )
{
	AECHAR		wszDisp[MAX_LENGTH] = {0};
	AECHAR		*pszDisp;
	boolean		bRet;
	
	// 初期化
	pszDisp = NULL;
	
	if ( pText != NULL )
	{
		// タイトル文字列変換(char →AECHAR)
		STRTOWSTR( pText, wszDisp, sizeof(wszDisp) );
		pszDisp = wszDisp;
	}
	
	// IMENUCTL_SetTitle()の試験
	bRet = IMENUCTL_SetTitle( pApp->pimc, pszResFile, wResID, pszDisp );
	
	//ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetTitle 実行" );
	if ( pText != NULL )
	{
		LogOutMake( pApp, TRUE, FALSE, "TEXT::%s", pText );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "ID::%d", wResID );
	}
	
	if ( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:TRUE" );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:FALSE" );
	}
	
	return bRet;
}

void test_SetRect( MyApp *pApp, const AEERect *pARect )
{
	// IMENUCTL_SetRect()の試験
	IMENUCTL_SetRect( pApp->pimc, pARect );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetRect 実行" );
	LogOutMake( pApp, TRUE, FALSE, "x::%d", pARect->x );
	LogOutMake( pApp, TRUE, FALSE, "y::%d", pARect->y );
	LogOutMake( pApp, TRUE, FALSE, "dx::%d", pARect->dx );
	LogOutMake( pApp, TRUE, FALSE, "dy::%d", pARect->dy );
	
	return;
}

void test_GetRect( MyApp *pApp )
{
	AEERect		aGetRect;
	
	// 初期化
	MEMSET( &aGetRect, 0x00, sizeof(AEERect) );
	
	// IMENUCTL_GetRect()の試験
	IMENUCTL_GetRect( pApp->pimc, &aGetRect );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_GetRect 実行" );
	LogOutMake( pApp, TRUE, FALSE, "x::%d", aGetRect.x );
	LogOutMake( pApp, TRUE, FALSE, "y::%d", aGetRect.y );
	LogOutMake( pApp, TRUE, FALSE, "dx::%d", aGetRect.dx );
	LogOutMake( pApp, TRUE, FALSE, "dy::%d", aGetRect.dy );
	
	return;
}


boolean test_AddItem( MyApp *pApp, const char* pszResFile, uint16 wResID, uint16 nItemID, char* pText, uint32 lData )
{
	AECHAR		wszDisp[MAX_LENGTH];
	AECHAR		*pszDisp;
	boolean		bRet;
	
	// 初期化
	pszDisp = NULL;
	
	if ( pText != NULL )
	{
		// タイトル文字列変換(char →AECHAR)
		STRTOWSTR( pText, wszDisp, sizeof(wszDisp) );
		pszDisp = wszDisp;
	}
	
	// IMENUCTL_AddItem()の試験
	bRet = IMENUCTL_AddItem( pApp->pimc,
							 pszResFile,
							 wResID,
							 nItemID,
							 pszDisp,
							 lData );
							 
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_AddItem 実行" );
	if( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:TRUE" );
		LogOutMake( pApp, TRUE, FALSE, "TEXT::%s", pText );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:FALSE" );
	}
	
	return bRet;
}

boolean test_AddItemEx( MyApp *pApp, CtlAddItem *pCai )
{
	boolean		bRet;
	char		aszBuf[MAX_LENGTH] ={""};
	
	// IMENUCTL_AddItemEx()の試験
	bRet = IMENUCTL_AddItemEx( pApp->pimc, pCai );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_AddItemEx 実行" );
	if( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:TRUE" );
		// 表示文字列
		if ( pCai->pText != NULL )
		{
// chg sta 05.06.17 N.Kanagawa #006
//			WSTRTOSTR( pCai->pText, aszBuf, sizeof(aszBuf) );
			WSTRCOMPRESS( pCai->pText, WSTRLEN(pCai->pText), (byte*)aszBuf, sizeof(aszBuf));
// chg end 05.06.17 N.Kanagawa #006
			LogOutMake( pApp, TRUE, FALSE, "TEXT::%s", aszBuf );
		}
		// ファイル名
		if ( pCai->wImage == TEST_IMAGE1 )
		{
			LogOutMake( pApp, TRUE, FALSE, "IMAGE FILE t1.bmp" );
		}
		else
		{
			LogOutMake( pApp, TRUE, FALSE, "IMAGE FILE t2.bmp" );
		}
		LogOutMake( pApp, TRUE, FALSE, "ID::%d", pCai->wItemID );
		LogOutMake( pApp, TRUE, FALSE, "DATA::%d", pCai->dwData );
		LogOutMake( pApp, TRUE, FALSE, "FONT::0x%08x", pCai->wFont );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:FALSE" );
	}
	
	
	return bRet;
}

boolean test_GetItem( MyApp *pApp, uint16 nIndexID )
{
	boolean		bRet;
	CtlAddItem	cai;
	char		szText[MAX_LENGTH] = {""};
	char		szImage[MAX_LENGTH] = {""};
	
	// 初期化
	MEMSET( &cai, NULL, sizeof(CtlAddItem) );
	
	// IMENUCTL_GetItem()の試験
	bRet = IMENUCTL_GetItem( pApp->pimc, nIndexID, &cai );
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_GetItem 実行" );
	
	if ( bRet == TRUE )
	{
		// ログ表示
		LogOutMake( pApp, TRUE, FALSE, "Return:TRUE" );
		if ( cai.wImage == TEST_IMAGE1 )
		{
			SPRINTF( szImage, "NAME::t1.bmp" );
		}
		else
		{
			SPRINTF( szImage, "ID::%d", cai.wImage );
		}
		LogOutMake( pApp, TRUE, FALSE, "IMAGE FILE %s",szImage );
		if ( cai.pText != NULL )
		{
// chg sta 05.06.17 N.Kanagawa #006
//			WSTRTOSTR( cai.pText, szText, TEXT_BUF );
			WSTRCOMPRESS( cai.pText, WSTRLEN(cai.pText), (byte*)szText, sizeof(szText));
// chg end 05.06.17 N.Kanagawa #006
			LogOutMake( pApp, TRUE, FALSE, "TEXT::%s", szText );
		}
		
		LogOutMake( pApp, TRUE, FALSE, "ID::%d", cai.wItemID );
		LogOutMake( pApp, TRUE, FALSE, "DATA::%d", cai.dwData );
		LogOutMake( pApp, TRUE, FALSE, "FONT::0x%08x", cai.wFont );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:FALSE" );
	}
	
	return bRet;
}

boolean test_Redraw( MyApp *pApp )
{
	boolean		bRet;
	
	bRet = IMENUCTL_Redraw( pApp->pimc );
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_Redraw 実行" );
	if ( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:TRUE" );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:FALSE" );
	}
	
	return bRet;
}

boolean test_SetItemTXT( MyApp *pApp, uint16 Index, char *pszBuf )
{
	CtlAddItem	Cai;
	AECHAR		wszDisp[MAX_LENGTH];
	boolean		bRet;
	
	// 初期化
	MEMSET( &Cai, NULL, sizeof(CtlAddItem) );
	
	if ( pszBuf != NULL )
	{
		STRTOWSTR( pszBuf, wszDisp, sizeof(wszDisp) );
		Cai.pText = wszDisp;
	}
	
	// IMENUCTL_SetItem()の試験
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetItem 実行" );
	bRet = test_SetItem( pApp, Index, MSIF_TEXT, &Cai );
	
	// ログ表示
	if( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Param::MSIF_TEXT" );
		if ( pszBuf != NULL )
		{
			LogOutMake( pApp, TRUE, FALSE, "TEXT::%s", pszBuf );
		}
	}
	
	return bRet;
}

boolean test_SetItemDATA( MyApp *pApp, uint16 Index )
{
	CtlAddItem	Cai;
	boolean		bRet;
	
	// 初期化
	MEMSET( &Cai, NULL, sizeof(CtlAddItem) );
	
// chg sta  05.04.08 t.morishita #002
#if 0
//	Cai.dwData = Index;
#endif
	Cai.dwData = Index+10;
// chg end  05.04.08 t.morishita #002
	
	// IMENUCTL_SetItem()の試験
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetItem 実行" );
	bRet = test_SetItem( pApp, Index, MSIF_DATA, &Cai );
	
	// ログ表示
	if( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Param::MSIF_DATA" );
		LogOutMake( pApp, TRUE, FALSE, "IDATA::%d", Cai.dwData );
	}
	
	return bRet;
}

boolean test_SetItemIMG( MyApp *pApp, uint16 Index )
{
	CtlAddItem	Cai;
	boolean		bRet;
	
	// 初期化
	MEMSET( &Cai, NULL, sizeof(CtlAddItem) );
	
	Cai.pszResImage = MENU_RES_FILE;
	Cai.wImage = TEST_IMAGE2;
	
	// IMENUCTL_SetItem()の試験
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetItem 実行" );
	bRet = test_SetItem( pApp, Index, MSIF_IMAGE, &Cai );
	
	// ログ表示
	if( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Param::MSIF_IMAGE" );
		LogOutMake( pApp, TRUE, FALSE, "IMAGE FILE t2.bmp" );
	}
	
	return bRet;
}

boolean test_SetItemFNT( MyApp *pApp, uint16 Index )
{
	CtlAddItem	Cai;
	boolean		bRet;
	
	// 初期化
	MEMSET( &Cai, NULL, sizeof(CtlAddItem) );
	
	// データ設定
	Cai.wFont = (uint16)(TEST_FONT+1);
	
	// IMENUCTL_SetItem()の試験
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetItem 実行" );
	bRet = test_SetItem( pApp, Index, MSIF_FONT, &Cai );
	
	// ログ表示
	if( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Param::MSIF_FONT" );
		LogOutMake( pApp, TRUE, FALSE, "FONT::0x%08x", Cai.wFont );
	}
	
	return bRet;
}

boolean test_SetItem( MyApp *pApp, uint16 Index, uint16 uFlag, CtlAddItem *pCai )
{
	boolean		bRet;
	
	// IMENUCTL_SetItem()の試験
	bRet = IMENUCTL_SetItem( pApp->pimc, Index, uFlag, pCai );
	
	if ( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:TRUE" );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:FALSE" );
	}
	
	return bRet;
}


boolean test_SetActive( MyApp *pApp, boolean bActive )
{
	boolean		bRet = TRUE;
	
	// IMENUCTL_SetActive()の試験
	IMENUCTL_SetActive( pApp->pimc, bActive );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetActive 実行" );
	
	if ( bActive == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Active:TRUE" );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Active:FALSE" );
	}
	
	return bRet;
}

void disp_mng( MyApp *pApp )
{
	AECHAR	wszABuf[TEXT_BUF];
	
	// バッファ初期化
	MEMSET( wszABuf, NULL, TEXT_BUF );
	
	// 画面初期化
	IDISPLAY_ClearScreen( pApp->app.m_pIDisplay );
	
	
	STREXPAND( (const byte*)STR_MNG , STRLEN(STR_MNG), wszABuf , TEXT_BUF );
	
	// 文字列描画
	IDISPLAY_DrawText(	pApp->app.m_pIDisplay,
						AEE_FONT_NORMAL,
						wszABuf,
						-1,
						0,
						20,
						NULL,
						IDF_ALIGN_CENTER );
	
	// 画面更新
	IDISPLAY_UpdateEx( pApp->app.m_pIDisplay, FALSE );

	return;
}

boolean test_SetProperties( MyApp *pApp, uint32 flag )
{
	boolean		bRet = TRUE;
	
	IMENUCTL_SetProperties( pApp->pimc, flag );
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetProperties 実行" );
	LogOutMake( pApp, TRUE, FALSE, "PRO::0x%08x", flag );
	
	return bRet;
}

boolean test_GetProperties( MyApp *pApp, uint32 *punProp )
{
	boolean		bRet = TRUE;
	
	// IMENUCTL_GetProperties()の試験
	*punProp = IMENUCTL_GetProperties( pApp->pimc );
	
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_GetProperties 実行" );
	LogOutMake( pApp, TRUE, FALSE, "PRO::0x%08x", *punProp );
	
	return bRet;
}


void SetDelItem_Test1( MyApp *pApp )
{
	// 初期化
	MEMSET( pApp->m_szHtmlBuf, NULL, BUFSIZE_HTML );
	
	// メニュー項目作成
	Test_Menu( pApp, (uint32)0 );
	
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	Dispclsid( pApp );
	LogOutMake( pApp, TRUE, FALSE, "==DeleteItem==" );
	
	return;
}

void SetDelItem_Test2( MyApp *pApp )
{
	// IMENUCTL_DeleteItem()の試験
	test_DelItem( pApp, TEST2_ID );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

boolean test_DelItem( MyApp *pApp, uint16 nItemID )
{
	boolean		bRet;
	
	// IMENUCTL_DeleteItem()の試験
	bRet = IMENUCTL_DeleteItem( pApp->pimc, nItemID );
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_DeleteItem 実行" );
	
	if ( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:TRUE" );
		LogOutMake( pApp, TRUE, FALSE, "ID::%d", nItemID );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:FALSE" );
	}
	
	return bRet;
}


void SetDelAll_Test1( MyApp *pApp )
{
	// 初期化
	MEMSET( pApp->m_szHtmlBuf, NULL, BUFSIZE_HTML );

	// メニュー項目表示
	Test_Menu( pApp, (uint32)0 );
	
	// ログ表示
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	Dispclsid( pApp );
	LogOutMake( pApp, TRUE, FALSE, "==DeleteAll==" );
	
	return;
}

void SetDelAll_Test2( MyApp *pApp )
{
	// IMENUCTL_DeleteAll()の試験
	test_DelAll( pApp );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

boolean test_DelAll( MyApp *pApp )
{
	boolean		bRet;
	
	// IMENUCTL_DeleteAll()の試験
	bRet = IMENUCTL_DeleteAll( pApp->pimc );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_DeleteAll 実行" );
	
	if ( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:TRUE" );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:FALSE" );
	}
	
	return bRet;
}

boolean test_SetItemTime( MyApp *pApp, CtlAddItem *pCai, uint16 unStartTime, uint16 unDuration, uint32 unFlag )
{
	boolean		bRet = TRUE;
	
	// IMENUCTL_SetItemTime()の試験
	if ( unStartTime >= TIME_24 )
	{
		unStartTime -= TIME_24;
	}
	IMENUCTL_SetItemTime( pApp->pimc, pCai->wItemID, unStartTime, unDuration );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetItemTime 実行" );
	
	if( unFlag == MP_CALENDAR )
	{
		LogOutMake( pApp, TRUE, FALSE, "Start Time = %d:00", (unStartTime / 60) );
		LogOutMake( pApp, TRUE, FALSE, "Duration = %d", unDuration );
	}
	
	return bRet;
}

boolean test_GetItemTime( MyApp *pApp, uint16 nIndex )
{
	boolean			bRet = TRUE;
	uint16			unDuration;
	int				nGetStartTime;
	
	// IMENUCTL_GetItemTime()の試験
	nGetStartTime = IMENUCTL_GetItemTime( pApp->pimc, nIndex, &unDuration );
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_GetItemTime 実行" );
	if ( nGetStartTime == -1 )
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:-1" );
	}
	else
	{
		nGetStartTime = nGetStartTime / 60;
		LogOutMake( pApp, TRUE, FALSE, "Start Time = %d:00", nGetStartTime );
		LogOutMake( pApp, TRUE, FALSE, "Duration = %d", unDuration );
	}
	
	return bRet;
}

boolean set_ProMenuMENU( MyApp *pApp, CtlAddItem *pCai )
{
	int			nindex = PRO_ID;
	boolean		bRet;
	uint16		unIdTbl[2][CNT_PRO_MENU] = { { PRO1, PRO3, PRO6, PRO10, PRO11, PRO15, PRO16 },
											 { 0,    2,    5,    9,     10,    14,    15 } };
	int			nLoop;
	
	// 表示メニュー設定
	for ( nLoop = 0; nLoop < CNT_PRO_MENU; nLoop++ )
	{
		pCai->wText = unIdTbl[0][nLoop];
		pCai->wImage = IMAGE1 + nLoop;
		pCai->wItemID = (uint16)nindex+unIdTbl[1][nLoop];
		pCai->dwData = (uint32)nindex+unIdTbl[1][nLoop];
		
		bRet = test_AddItemEx( pApp, pCai );
	}
	
	return bRet;
}

boolean set_ProMenuLIST( MyApp *pApp, CtlAddItem *pCai )
{
	int			nindex = PRO_ID;
	boolean		bRet;
	uint16		unIdTbl[2][CNT_PRO_LIST] = { { PRO1, PRO3, PRO16 },
											 { 0,    2,    15 } };
	int			nLoop;
	
	// 表示メニュー設定
	for ( nLoop = 0; nLoop < CNT_PRO_LIST; nLoop++ )
	{
		pCai->wText = unIdTbl[0][nLoop];
		pCai->wImage = IMAGE1 + nLoop;
		pCai->wItemID = (uint16)nindex+unIdTbl[1][nLoop];
		pCai->dwData = (uint32)nindex+unIdTbl[1][nLoop];
		
		bRet = test_AddItemEx( pApp, pCai );
	}
	
	return bRet;
}

boolean set_ProMenuICON( MyApp *pApp, CtlAddItem *pCai )
{
	int			nindex = PRO_ID;
	boolean		bRet;
	uint16		unIdTbl[2][CNT_PRO_ICON] = { { PRO2, PRO3, PRO4, PRO5, PRO7, PRO8, PRO9, PRO16 },
											 { 1,    2,    3,    4,    6,    7,    8,    15 } };
	int			nLoop;
	
	// 表示メニュー設定
	for ( nLoop = 0; nLoop < CNT_PRO_ICON; nLoop++ )
	{
		pCai->wText = unIdTbl[0][nLoop];
		pCai->wImage = IMAGE1 + nLoop;
		pCai->wItemID = (uint16)nindex+unIdTbl[1][nLoop];
		pCai->dwData = (uint32)nindex+unIdTbl[1][nLoop];
		
		bRet = test_AddItemEx( pApp, pCai );
	}
	
	return bRet;
}


boolean test_SetSelEx1( MyApp *pApp, uint16 unIndex )
{
	boolean		bRet;
	
	// 初期化
	MEMSET( pApp->m_szHtmlBuf, NULL, BUFSIZE_HTML );
	
	// ログ表示
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	LogOutMake( pApp, TRUE, TRUE, "==SetSelEx(TRUE)==" );
	Dispclsid( pApp );
	
	// IMENUCTL_SetSelEx()の試験
	bRet = test_SetSelEx( pApp, unIndex, TRUE );
	LogOutMake( pApp, TRUE, TRUE, "Param::TRUE" );
	LogOutMake( pApp, TRUE, TRUE, "ID::%d", unIndex );
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return bRet;
}

boolean test_SetSelEx2( MyApp *pApp, uint16 unIndex )
{
	boolean		bRet;
	
	
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	LogOutMake( pApp, TRUE, TRUE, "==SetSelEx(FALSE)==" );
	Dispclsid( pApp );
	
	// IMENUCTL_SetSelEx()の試験
	bRet = test_SetSelEx( pApp, unIndex, FALSE );
	LogOutMake( pApp, TRUE, TRUE, "Param::FALSE" );
	LogOutMake( pApp, TRUE, TRUE, "ID::%d", unIndex );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return bRet;
}

boolean test_SetSelEx( MyApp *pApp, uint16 unId, boolean bSelected )
{
	boolean		bRet = TRUE;
	
	// IMENUCTL_SetSelEx()の試験
	IMENUCTL_SetSelEx( pApp->pimc, unId, bSelected );
	
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetSelEx 実行" );
	
	return bRet;
}


boolean Disp_NoArraws( MyApp *pApp )
{
	AEERect			adummy;
	boolean			bRet = TRUE;
	
	// 表示領域の設定
	SETAEERECT( &adummy, 0, 0, (pApp->arect.dx * 3 / 10), (pApp->arect.dy * 2 / 10 ) );
	
	IDISPLAY_ClearScreen( pApp->app.m_pIDisplay );
	
	// IMENUCTL_SetRect()の試験
	test_SetRect( pApp, &adummy );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return bRet;
}

void EnableCommand_Test( MyApp *pApp, boolean bFlg )
{
	char			szBuf[MAX_LENGTH] = {"EnableCommand Test"};
	
	// 初期化
	MEMSET( pApp->m_szHtmlBuf, NULL, BUFSIZE_HTML );
	
	// ログ表示
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	Dispclsid( pApp );
	
	LogOutMake( pApp, TRUE, FALSE, "==EnableCommand==" );
	
	// ステータス変更
	pApp->ncon = CON_DEFAULT;
	
	// タイトル設定
	test_SetTitle( pApp, NULL, NULL, szBuf );
	
	// IMENUCTL_EnableCommand()の試験
	test_EnableCommand ( pApp, bFlg );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

boolean test_EnableCommand( MyApp *pApp, boolean bFlg )
{
	boolean		bRet = TRUE;
	
	// IMENUCTL_EnableCommand()の試験
	IMENUCTL_EnableCommand( pApp->pimc, bFlg );
	
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_EnableCommand 実行" );
	if ( bFlg == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "==TRUE==" );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "==FALSE==" );
	}
	
	return bRet;
}

boolean test_Enum( MyApp *pApp )
{
	boolean		bRet;
	int			nindex = TEST2_ID;
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return FALSE;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return FALSE;
	}
	
	 bRet = Test_Menu( pApp, MP_MULTI_SEL );
	 if ( bRet == TRUE )
	 {
		// 初期化
		MEMSET( pApp->m_szHtmlBuf, NULL, BUFSIZE_HTML );
		
		// ログ表示
		LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
		Dispclsid( pApp );
		LogOutMake( pApp, TRUE, FALSE, "==Enum==" );
		
		if ( pApp->ctype == MENUCTL )
		{
			// 初期化
			bRet = test_EnumInit( pApp );
			
			// 全選択
			test_SetSelEx1( pApp, (uint16)-1 );
			
			// 選択項目列挙
			test_EnumNextSel( pApp );
			
			// 全選択解除
			test_SetSelEx2( pApp, (uint16)-1 );
			
			// 初期化
			bRet = test_EnumInit( pApp );
			
			// 複数項目選択
			test_SetSelEx1( pApp, nindex+2 );
			test_SetSelEx1( pApp, nindex+4 );
			
			// 選択項目列挙
			test_EnumNextSel( pApp );
		}
	}
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return bRet;
}
		
boolean test_EnumInit( MyApp *pApp )
{
	boolean		bRet;
	
	// IMENUCTL_EnumSelInit()の試験
	bRet = IMENUCTL_EnumSelInit( pApp->pimc );
	
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_EnumSelInit 実行" );
	if ( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:TRUE" );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:FALSE" );
	}
	
	return bRet;
}

boolean test_EnumNextSel( MyApp *pApp )
{
	boolean		bRet = TRUE;
	uint16		unIndex;
	
	for ( ; ; )
	{
		// IMENUCTL_EnumNextSel()の試験
		unIndex = IMENUCTL_EnumNextSel( pApp->pimc );
		LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_EnumNextSel 実行" );
		LogOutMake( pApp, TRUE, FALSE, "ID::%d", unIndex );
		if ( unIndex == (uint16)-1 )
		{
			break;
		}
	}
	
	return bRet;
}

boolean test_GetItemCount( MyApp *pApp, int *pCnt )
{
	boolean		bRet = TRUE;
	
	// IMENUCTL_GetItemCount()の試験
	*pCnt = IMENUCTL_GetItemCount( pApp->pimc );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_GetItemCount 実行" );
	LogOutMake( pApp, TRUE, FALSE, "Count::%d", *pCnt );
	
	return bRet;
}

boolean test_GetItemData( MyApp *pApp, uint16 unIndex )
{
	boolean		bRet;
	uint32		undata = NULL;
	
	// IMENUCTL_GetItemData()の試験
	bRet = IMENUCTL_GetItemData( pApp->pimc, unIndex, &undata );
	
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_GetItemData 実行" );
	if ( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:TRUE" );
		LogOutMake( pApp, TRUE, FALSE, "DATA::%d", undata );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Return:FALSE" );
	}
	
	return bRet;
}

boolean test_GetItemID( MyApp *pApp, uint16 unIndex )
{
	boolean		bRet = TRUE;
	uint16		unID;
	
	// IMENUCTL_GetItemID()の試験
	unID = IMENUCTL_GetItemID( pApp->pimc, unIndex );
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_GetItemID 実行" );
	LogOutMake( pApp, TRUE, FALSE, "ID::%d", unID );
	
	return bRet;
}

boolean test_SetFocus( MyApp *pApp, uint16 unIndex )
{
	boolean		bRet = TRUE;
	
	// IMENUCTL_SetFocus()の試験
	IMENUCTL_SetFocus( pApp->pimc, unIndex );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetFocus 実行" );
	LogOutMake( pApp, TRUE, FALSE, "ID::%d", unIndex );
	
	return bRet;
}

boolean test_GetFocus( MyApp *pApp )
{
	boolean		bRet = TRUE;
	uint16		unId;
	
	// IMENUCTL_GetFocus()の試験
	unId = IMENUCTL_GetFocus( pApp->pimc );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_GetFocus 実行" );
	LogOutMake( pApp, TRUE, FALSE, "ID::%d", unId );
	
	return bRet;
}

boolean test_SetItemText( MyApp *pApp, uint16 unIndex, const char* pszResFile, uint16 wResID, char *pBuf )
{
	boolean		bRet = TRUE;
	AECHAR		wszDisp[MAX_LENGTH] = {0};
	AECHAR		*pwszDisp;
	
	// 文字列変換(char →AECHAR)
	pwszDisp = NULL;
	if ( pBuf != NULL )
	{
		STRTOWSTR( pBuf, wszDisp, sizeof(wszDisp) );
		pwszDisp = wszDisp;
	}
	
	// IMENUCTL_SetItemText()の試験
	IMENUCTL_SetItemText( pApp->pimc, unIndex, pszResFile, wResID, pwszDisp );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetItemText 実行" );
	LogOutMake( pApp, TRUE, FALSE, "ID::%d", unIndex );
	if ( pBuf != NULL )
	{
		LogOutMake( pApp, TRUE, FALSE, "TEXT::%s", pBuf );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "ID::%d", wResID );
	}
	
	return bRet;
}

boolean test_SetStyle( MyApp *pApp, AEEItemStyle *paisNormal, AEEItemStyle *paisSel )
{
	boolean		bRet = TRUE;
	
	// IMENUCTL_GetStyle()の試験
	IMENUCTL_SetStyle( pApp->pimc, paisNormal, paisSel );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetStyle 実行" );
	
	LogOutMake( pApp, TRUE, FALSE, "==NO SELECT==");
	LogOutMake( pApp, TRUE, FALSE, "FrameType::%d", paisNormal->ft );
	LogOutMake( pApp, TRUE, FALSE, "xOffset::%d", paisNormal->xOffset );
	LogOutMake( pApp, TRUE, FALSE, "yOffset::%d", paisNormal->yOffset );
	LogOutMake( pApp, TRUE, FALSE, "RasterOp::%d", paisNormal->roImage );
	
	LogOutMake( pApp, TRUE, FALSE, "==SELECT==");
	LogOutMake( pApp, TRUE, FALSE, "FrameType::%d", paisSel->ft );
	LogOutMake( pApp, TRUE, FALSE, "xOffset::%d", paisSel->xOffset );
	LogOutMake( pApp, TRUE, FALSE, "yOffset::%d", paisSel->yOffset );
	LogOutMake( pApp, TRUE, FALSE, "RasterOp::%d", paisSel->roImage );
	
	return bRet;
}

boolean test_GetStyle( MyApp *pApp )
{
	boolean			bRet = TRUE;
	AEEItemStyle	aisNormal;
	AEEItemStyle	aisSel;
	
	// IMENUCTL_GetStyle()の試験
	IMENUCTL_GetStyle( pApp->pimc, &aisNormal, &aisSel );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_GetStyle 実行" );
	
	LogOutMake( pApp, TRUE, FALSE, "==NO SELECT==");
	LogOutMake( pApp, TRUE, FALSE, "FrameType::%d", aisNormal.ft );
	LogOutMake( pApp, TRUE, FALSE, "xOffset::%d", aisNormal.xOffset );
	LogOutMake( pApp, TRUE, FALSE, "yOffset::%d", aisNormal.yOffset );
	LogOutMake( pApp, TRUE, FALSE, "RasterOp::%d", aisNormal.roImage );
	
	LogOutMake( pApp, TRUE, FALSE, "==SELECT==");
	LogOutMake( pApp, TRUE, FALSE, "FrameType::%d", aisSel.ft );
	LogOutMake( pApp, TRUE, FALSE, "xOffset::%d", aisSel.xOffset );
	LogOutMake( pApp, TRUE, FALSE, "yOffset::%d", aisSel.yOffset );
	LogOutMake( pApp, TRUE, FALSE, "RasterOp::%d", aisSel.roImage );
	
	return bRet;
}

boolean test_SetColor( MyApp *pApp, AEEMenuColors *pamc )
{
	boolean		bRet = TRUE;
	
	// IMENUCTL_SetColors()の試験
	IMENUCTL_SetColors( pApp->pimc, pamc );
	
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetColors 実行" );
	if ( pamc != NULL )
	{
		// Back
		LogOutMake( pApp, TRUE, FALSE, "wMask::%d", pamc->wMask );
		LogOutMake( pApp, TRUE, FALSE, "cBack(R)::%d", ((pamc->cBack&MASK_R)>>COL_R) );
		LogOutMake( pApp, TRUE, FALSE, "cBack(G)::%d", ((pamc->cBack&MASK_G)>>COL_G) );
		LogOutMake( pApp, TRUE, FALSE, "cBack(B)::%d", ((pamc->cBack&MASK_B)>>COL_B) );
		
		// Text
		LogOutMake( pApp, TRUE, FALSE, "cText(R)::%d", ((pamc->cText&MASK_R)>>COL_R) );
		LogOutMake( pApp, TRUE, FALSE, "cText(G)::%d", ((pamc->cText&MASK_G)>>COL_G) );
		LogOutMake( pApp, TRUE, FALSE, "cText(B)::%d", ((pamc->cText&MASK_B)>>COL_B) );
		
		// SelBack
		LogOutMake( pApp, TRUE, FALSE, "cSelBack(R)::%d", ((pamc->cSelBack&MASK_R)>>COL_R) );
		LogOutMake( pApp, TRUE, FALSE, "cSelBack(G)::%d", ((pamc->cSelBack&MASK_G)>>COL_G) );
		LogOutMake( pApp, TRUE, FALSE, "cSelBack(B)::%d", ((pamc->cSelBack&MASK_B)>>COL_B));
		
		// SelText
		LogOutMake( pApp, TRUE, FALSE, "cSelText(R)::%d", ((pamc->cSelText&MASK_R)>>COL_R) );
		LogOutMake( pApp, TRUE, FALSE, "cSelText(G)::%d", ((pamc->cSelText&MASK_G)>>COL_G) );
		LogOutMake( pApp, TRUE, FALSE, "cSelText(B)::%d", ((pamc->cSelText&MASK_B)>>COL_B) );
		
		// Frame
		LogOutMake( pApp, TRUE, FALSE, "cFrame(R)::%d", ((pamc->cFrame&MASK_R)>>COL_R) );
		LogOutMake( pApp, TRUE, FALSE, "cFrame(G)::%d", ((pamc->cFrame&MASK_G)>>COL_G) );
		LogOutMake( pApp, TRUE, FALSE, "cFrame(B)::%d", ((pamc->cFrame&MASK_B)>>COL_B) );
		
		// ScrollBar
		LogOutMake( pApp, TRUE, FALSE, "cScrollbar(R)::%d", ((pamc->cScrollbar&MASK_R)>>COL_R) );
		LogOutMake( pApp, TRUE, FALSE, "cScrollbar(G)::%d", ((pamc->cScrollbar&MASK_G)>>COL_G) );
		LogOutMake( pApp, TRUE, FALSE, "cScrollbar(B)::%d", ((pamc->cScrollbar&MASK_B)>>COL_B) );
		
		// ScrollBarFill
		LogOutMake( pApp, TRUE, FALSE, "cScrollbarFill(R)::%d", ((pamc->cScrollbarFill&MASK_R)>>COL_R) );
		LogOutMake( pApp, TRUE, FALSE, "cScrollbarFill(G)::%d", ((pamc->cScrollbarFill&MASK_G)>>COL_G) );
		LogOutMake( pApp, TRUE, FALSE, "cScrollbarFill(B)::%d", ((pamc->cScrollbarFill&MASK_B)>>COL_B) );
		
		// Title
		LogOutMake( pApp, TRUE, FALSE, "cTitle(R)::%d", ((pamc->cTitle&MASK_R)>>COL_R) );
		LogOutMake( pApp, TRUE, FALSE, "cTitle(G)::%d", ((pamc->cTitle&MASK_G)>>COL_G) );
		LogOutMake( pApp, TRUE, FALSE, "cTitle(B)::%d", ((pamc->cTitle&MASK_B)>>COL_B) );
		
		// TitleText
		LogOutMake( pApp, TRUE, FALSE, "cTitleText(R)::%d", ((pamc->cTitleText&MASK_R)>>COL_R) );
		LogOutMake( pApp, TRUE, FALSE, "cTitleText(G)::%d", ((pamc->cTitleText&MASK_G)>>COL_G) );
		LogOutMake( pApp, TRUE, FALSE, "cTitleText(B)::%d", ((pamc->cTitleText&MASK_B)>>COL_B) );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Colors::NULL" );
	}
	
	return bRet;
}

boolean test_GetColor( MyApp *pApp )
{
	boolean			bRet = TRUE;
	AEEMenuColors	amc;
	
	// 初期化
	MEMSET( &amc, 0, sizeof(AEEMenuColors) );
	
	// IMENUCTL_GetColors()の試験
	IMENUCTL_GetColors( pApp->pimc, &amc );
	
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_GetColors 実行" );
	
	// Back
	LogOutMake( pApp, TRUE, FALSE, "wMask::%d", amc.wMask );
	LogOutMake( pApp, TRUE, FALSE, "cBack(R)::%d",((amc.cBack&MASK_R)>>COL_R) );
	LogOutMake( pApp, TRUE, FALSE, "cBack(G)::%d",((amc.cBack&MASK_G)>>COL_G) );
	LogOutMake( pApp, TRUE, FALSE, "cBack(B)::%d",((amc.cBack&MASK_B)>>COL_B) );
	
	// Text
	LogOutMake( pApp, TRUE, FALSE, "cText(R)::%d",((amc.cText&MASK_R)>>COL_R) );
	LogOutMake( pApp, TRUE, FALSE, "cText(G)::%d",((amc.cText&MASK_G)>>COL_G) );
	LogOutMake( pApp, TRUE, FALSE, "cText(B)::%d",((amc.cText&MASK_B)>>COL_B) );
	
	// SelBack
	LogOutMake( pApp, TRUE, FALSE, "cSelBack(R)::%d",((amc.cSelBack&MASK_R)>>COL_R) );
	LogOutMake( pApp, TRUE, FALSE, "cSelBack(G)::%d",((amc.cSelBack&MASK_G)>>COL_G) );
	LogOutMake( pApp, TRUE, FALSE, "cSelBack(B)::%d",((amc.cSelBack&MASK_B)>>COL_B) );
	
	// SelText
	LogOutMake( pApp, TRUE, FALSE, "cSelText(R)::%d",((amc.cSelText&MASK_R)>>COL_R) );
	LogOutMake( pApp, TRUE, FALSE, "cSelText(G)::%d",((amc.cSelText&MASK_G)>>COL_G) );
	LogOutMake( pApp, TRUE, FALSE, "cSelText(B)::%d",((amc.cSelText&MASK_B)>>COL_B) );
	
	// Frame
	LogOutMake( pApp, TRUE, FALSE, "cFrame(R)::%d",((amc.cFrame&MASK_R)>>COL_R) );
	LogOutMake( pApp, TRUE, FALSE, "cFrame(G)::%d",((amc.cFrame&MASK_G)>>COL_G) );
	LogOutMake( pApp, TRUE, FALSE, "cFrame(B)::%d",((amc.cFrame&MASK_B)>>COL_B) );
	
	// ScrollBar
	LogOutMake( pApp, TRUE, FALSE, "cScrollbar(R)::%d",((amc.cScrollbar&MASK_R)>>COL_R) );
	LogOutMake( pApp, TRUE, FALSE, "cScrollbar(G)::%d",((amc.cScrollbar&MASK_G)>>COL_G) );
	LogOutMake( pApp, TRUE, FALSE, "cScrollbar(B)::%d",((amc.cScrollbar&MASK_B)>>COL_B) );
	
	// ScrollBarFill
	LogOutMake( pApp, TRUE, FALSE, "cScrollbarFill(R)::%d",((amc.cScrollbarFill&MASK_R)>>COL_R) );
	LogOutMake( pApp, TRUE, FALSE, "cScrollbarFill(G)::%d",((amc.cScrollbarFill&MASK_G)>>COL_G) );
	LogOutMake( pApp, TRUE, FALSE, "cScrollbarFill(B)::%d",((amc.cScrollbarFill&MASK_B)>>COL_B) );
	
	// Title
	LogOutMake( pApp, TRUE, FALSE, "cTitle(R)::%d",((amc.cTitle&MASK_R)>>COL_R) );
	LogOutMake( pApp, TRUE, FALSE, "cTitle(G)::%d",((amc.cTitle&MASK_G)>>COL_G) );
	LogOutMake( pApp, TRUE, FALSE, "cTitle(B)::%d",((amc.cTitle&MASK_B)>>COL_B) );
	
	// TitleText
	LogOutMake( pApp, TRUE, FALSE, "cTitleText(R)::%d",((amc.cTitleText&MASK_R)>>COL_R) );
	LogOutMake( pApp, TRUE, FALSE, "cTitleText(G)::%d",((amc.cTitleText&MASK_G)>>COL_G) );
	LogOutMake( pApp, TRUE, FALSE, "cTitleText(B)::%d",((amc.cTitleText&MASK_B)>>COL_B) );
	
	return bRet;
}

void Reset_Test( MyApp *pApp )
{
	// 初期化
	MEMSET( pApp->m_szHtmlBuf, NULL, BUFSIZE_HTML);
	
	// ログ表示
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	Dispclsid( pApp );
	LogOutMake( pApp, TRUE, FALSE, "==Reset==" );
	
	// メニューコントロールのリセット
	test_Reset( pApp );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

void Sort_Test( MyApp *pApp, AEEMenuSortType aSortType )
{
	char		aszBuf[TEXT_BUF] = {""};
	
	// SORT種別文字列取得
	set_SortType( aSortType, aszBuf );
	LogOutMake( pApp, TRUE, FALSE, "==%s==", aszBuf );
	
	IMENUCTL_Sort( pApp->pimc, aSortType );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_Sort 実行" );
	LogOutMake( pApp, TRUE, FALSE, "SortType = %s", aszBuf );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );

	return;
}

void set_SortType( AEEMenuSortType aSortType, char *pBuf )
{
	switch ( aSortType )
	{
	case MCS_CUSTOM:
		SPRINTF( pBuf, "MCS_CUSTOM" );
		break;
	case MCS_NAME_DESCENDING:
		SPRINTF( pBuf, "MCS_NAME_DESCENDING" );
		break;
	case MCS_NAME_ASCENDING:
		SPRINTF( pBuf, "MCS_NAME_ASCENDING" );
		break;
	case MCS_PARAM_DESCENDING:
		SPRINTF( pBuf, "MCS_PARAM_DESCENDING" );
		break;
	case MCS_PARAM_ASCENDING:
		SPRINTF( pBuf, "MCS_PARAM_ASCENDING" );
		break;
	default:
		SPRINTF( pBuf, "UNKNOWN" );
		break;
	}
	
	return;
}

boolean test_IsActive( MyApp *pApp )
{
	boolean		bRet = TRUE;
	boolean		bActive;
	
	// IMENUCTL_IsActive()の試験
	bActive = IMENUCTL_IsActive( pApp->pimc );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_IsActive 実行" );
	if ( bActive == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "Active:TRUE" );
	}
	else
	{
		LogOutMake( pApp, TRUE, FALSE, "Active:FALSE" );
	}
	return bRet;
}

void SetSel_Test1( MyApp *pApp )
{
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	// 初期化
	MEMSET( pApp->m_szHtmlBuf, NULL, BUFSIZE_HTML );
	
	// ログ表示
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	Dispclsid( pApp );
	LogOutMake( pApp, TRUE, FALSE, "==SetSel==" );
	LogOutMake( pApp, TRUE, FALSE, "==MP_NO_REDRAWなし==" );
	pApp->ncon = CON_DEFAULT;
	
	// メニュー項目表示
	test_makeSetSel( pApp, TRUE );
	
	return;
}

void SetSel_Test2( MyApp *pApp )
{
	// 作業変数の定義
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	LogOutMake( pApp, TRUE, FALSE, "==MP_NO_REDRAWあり==" );
	
	test_makeSetSel( pApp, FALSE );
	return;
}

void test_makeSetSel( MyApp *pApp, boolean bFlg )
{
	// 作業変数の定義
	int				nindex = CON_ID;
	CtlAddItem		pcai;
	int				nf = TEST_FONT;
	int				nLoop;
	
	// NULLチェック
	if ( pApp == NULL )
	{
		DBGPRINTF( "pApp is NULL" );
		return;
	}
	if ( pApp->pimc == NULL )
	{
		DBGPRINTF( "IMenuCtl Ins is NULL" );
		return;
	}
	
	// 処理中･･･
	disp_mng( pApp );
	
	// メニューコントロールのリセット
	test_Reset( pApp );
	
	// IMENUCTL_SetRect()の試験
	test_SetRect( pApp, &pApp->arect );
	
	// タイトル設定
	test_SetTitle( pApp, MENU_RES_FILE, CON_TITLE, NULL );
	
	pcai.pText = NULL;
	pcai.pImage = NULL;
	pcai.wFont = nf;
	pcai.pszResImage = MAIN_RES_FILE;
	pcai.pszResText = MENU_RES_FILE;
	
	for ( nLoop = 0; nLoop < 8; nLoop++ )
	{
		pcai.wText = TEST1+nLoop;
		pcai.wImage = IMAGE1+nLoop;
		pcai.wItemID = (uint16)nindex+nLoop;
		pcai.dwData = (uint32)nindex+nLoop;
		// IMENUCTL_AddItemEx()の試験
		test_AddItemEx( pApp, &pcai );
	}
	
	if ( bFlg == FALSE )
	{
		// "MP_NO_REDRAW"設定
		test_SetProperties( pApp, MP_NO_REDRAW );
		nindex += 4;
	}
	
	// IMENUCTL_SetSel()の試験
	test_SetSel( pApp, nindex );
	
	// IMENUCTL_GetSel()の試験
	test_GetSel( pApp );
	
	// メニュー画面アクティブ化
	test_SetActive( pApp, TRUE );
	
	return;
}

boolean test_SetSel( MyApp *pApp, uint16 unIndex )
{
	boolean		bRet = TRUE;
	
	// IMENUCTL_SetSel()の試験
	IMENUCTL_SetSel( pApp->pimc, unIndex );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SetSel 実行" );
	LogOutMake( pApp, TRUE, FALSE, "ItemID::%d", unIndex );
	
	return bRet;
}

boolean test_GetSel( MyApp *pApp )
{
	boolean		bRet = TRUE;
	uint16		unIndex;
	
	// IMENUCTL_GetSel()の試験
	unIndex = IMENUCTL_GetSel( pApp->pimc );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_GetSel 実行" );
	LogOutMake( pApp, TRUE, FALSE, "ItemID::%d", unIndex );
	
	return bRet;
}

void SortCustom_Test( MyApp *pApp )
{
	// 初期化
	MEMSET( pApp->m_szHtmlBuf, NULL, BUFSIZE_HTML );
	
	LogOutMake( pApp, TRUE, TRUE, "***コントロール確認 START***" );
	Dispclsid( pApp );
	LogOutMake( pApp, TRUE, FALSE, "==SortCustom==" );
	
	// IMENUCTL_SortCustom()の試験
	test_SortCustom( pApp );
	
	return;
}

boolean test_SortCustom( MyApp *pApp )
{
	boolean		bRet = TRUE;
	
	// IMENUCTL_SortCustom()の試験
	IMENUCTL_SortCustom( pApp->pimc, CustomSort, (void*)pApp );
	
	// ログ表示
	LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_SortCustom 実行" );
	
	return bRet;
}

void SetProp_Test_NoCenter( MyApp *pApp )
{
	AEERect			adummy;
	
	// 表示領域を設定
	SETAEERECT( &adummy, 0, 0, (pApp->arect.dx * 3 / 10), (pApp->arect.dy * 2 / 10 ) );
	
	IDISPLAY_ClearScreen( pApp->app.m_pIDisplay );
	
	// IMENUCTL_SetRect()の試験
	test_SetRect( pApp, &adummy );
	
	// IMENUCTL_Redraw()の試験
	test_Redraw( pApp );
	
	return;
}

boolean test_HandleEvent( MyApp *pApp, AEEEvent eCode, uint16 wParam, uint32 dwParam )
{
	boolean		bRet;
	
	// IMENUCTL_HandleEvent()の試験
	bRet = IMENUCTL_HandleEvent( pApp->pimc, eCode, wParam, dwParam );
	
	// イベントチェック
	if ( bRet == TRUE )
	{
		LogOutMake( pApp, TRUE, FALSE, "<br>IMENUCTL_HandleEvent 実行" );
	
		LogOutMake( pApp, TRUE, FALSE, "Return:TRUE" );
		if ( wParam == AVK_SELECT )
		{
			LogOutMake( pApp, TRUE, FALSE, "KEY:AVK_SELECT" );
		}
	}
	
	return bRet;
}
