#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winb.h>
#include <te.h>
#include <fntb.h>
#include <gui.h>
#include "banx.h"
#include "kifuctrl.h"

extern int  textcommentId[8] ;
extern int  title_dispdialogId ;

int	commentdialogId = -1 ;
int	commentId = -1 ;
int	commentbtnId[2] = -1 ;
int	comment_messageId[3] = -1 ;

/*	initDataMICOMMNT:commentbtnId[0]:MJ_DBUTTONL40の呼び出し関数	*/
int	igo_commentset(kobj, messId, argc, pev, trigger)
int		kobj ;
int		messId ;
int		argc ;
EVENT	*pev ;
int		trigger ;
{
	char tptr[256];

	MMI_SendMessage( commentId, MM_GETTEXT, 3, tptr, 256, FALSE);
	tptr[255] = '\0';
	kifu_commentset( tptr);
	title_fsave_on();

	/*	commentdialogIdで示されるオブジェクトを消す		*/
	MMI_SendMessage( commentdialogId , MM_ERASE , 0 ) ;

	/*	オブジェクトをダイアログから取り外す	*/
	MMI_SendMessage( commentdialogId , MM_DETACH , 0 ) ;

	MMI_SendMessage( textcommentId[7], MM_SETTEXT, 3, tptr, 256, FALSE);
	
	MMI_SendMessage( title_dispdialogId , MM_SHOW , 0 ) ; 

	retunrInitMenuFunc();

	return NOERR ;
}

/*	initDataMICOMMNT:commentbtnId[1]:MJ_DBUTTONL40の呼び出し関数	*/
int	igo_commentcancel(kobj, messId, argc, pev, trigger)
int		kobj ;
int		messId ;
int		argc ;
EVENT	*pev ;
int		trigger ;
{
	/*	commentdialogIdで示されるオブジェクトを消す		*/
	MMI_SendMessage( commentdialogId , MM_ERASE , 0 ) ;

	/*	オブジェクトをダイアログから取り外す	*/
	MMI_SendMessage( commentdialogId , MM_DETACH , 0 ) ;

	retunrInitMenuFunc();

	return NOERR ;
}

