#define DEBUG 0
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winb.h>
#include <te.h>
#include <fntb.h>
#include <gui.h>
#include "igo.h"
#include "banx.h"
#include "kifuctrl.h"
#include "kiffile.h"
#include "title.h"

int	lineset_dialogId = -1 ;
int	lineset_numbox = -1 ;
int	lineset_bottonId[2] = -1 ;

/*	initDataMILINE:lineset_bottonId[0]:MJ_DBUTTONL40の呼び出し関数	*/
int	igo_lineset(kobj, messId, argc, pev, trigger)
int		kobj ;
int		messId ;
int		argc ;
EVENT	*pev ;
int		trigger ;
{
BAN_TYPE ban_type;
int bansize;
int min, max, delta, ptColum; /* 使用していない */
	
	/*	数値入力パネルの読み取り	*/
	MMI_SendMessage(lineset_numbox, MM_GETNUMBOX, 5,
							&bansize, &min, &max, &delta, &ptColum) ;

	/*	lineset_dialogIdで示されるオブジェクトを消す		*/
	MMI_SendMessage( lineset_dialogId , MM_ERASE , 0 ) ;

	/*	オブジェクトをダイアログから取り外す	*/
	MMI_SendMessage( lineset_dialogId , MM_DETACH , 0 ) ;


	ban_type.type = NORMAL;
	ban_type.size = bansize;
	Debugprint("igo_lineset title_bantype_set \n");
	title_bantype_set( ban_type);
	Debugprint("igo_lineset title_fname_clear \n");
	title_fname_clear();
	/*  ここで実行しないとゴミが残る  */
	Debugprint("igo_lineset title_handy_set \n");
	title_handy_set( 0);
	Debugprint("igo_lineset kifu_init \n");
	kifu_init();
	Debugprint("igo_lineset disp_init \n");
	disp_init();
	Debugprint("igo_lineset title_dispFunc \n");
	title_dispFunc();
	
	retunrInitMenuFunc();

	return NOERR ;
}

/*	initDataMILINE:lineset_bottonId[1]:MJ_DBUTTONL40の呼び出し関数	*/
int	igo_linecancel(kobj, messId, argc, pev, trigger)
int		kobj ;
int		messId ;
int		argc ;
EVENT	*pev ;
int		trigger ;
{
	/*	lineset_dialogIdで示されるオブジェクトを消す		*/
	MMI_SendMessage( lineset_dialogId , MM_ERASE , 0 ) ;

	/*	オブジェクトをダイアログから取り外す	*/
	MMI_SendMessage( lineset_dialogId , MM_DETACH , 0 ) ;

	retunrInitMenuFunc();

	return NOERR ;
}

