#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winb.h>
#include <te.h>
#include <fntb.h>
#include <gui.h>
#include <egb.h>
#include <guidbg.h>
//	部品を再描画する
int updateObj(int kobj){
	HYPER hyp ;
	WINCLIP *pwclp ;
	MMI_SendMessage(kobj, MM_GETHYPER, 1, &hyp) ;
	pwclp = WIN_getClipMemory(&(hyp.fr), NULL) ;
	pwclp = WIN_clipWindow(kobj, pwclp, FALSE ) ; 
	MMI_SendMessage(kobj, MM_UPDATE, 1, pwclp) ;
	WIN_freeClipMemory(pwclp) ; 
	return NOERR ;
}

//	部品を画面の中央に移動する
void centeringObj(int kobj){
	int		dx, dy ;
	HYPER	hyp ;
	WINCTRL	*pctrl ;

	/*	WINCTRL構造体から画面最大サイズ（現在の解像度）を取得する		*/
	MMI_GetControl(&pctrl) ;

	/*	解像度にあわせて画面中央に移動させる							*/
	MMI_SendMessage(kobj, MM_GETHYPER, 1, &hyp) ;
	dx = (pctrl->bound.rdwx - hyp.fr.lupx - hyp.fr.rdwx) / 2 ;
	dy = (pctrl->bound.rdwy - hyp.fr.lupy - hyp.fr.rdwy) / 2 ;
	MMI_SendMessage(kobj, MM_MOVE, 2, dx, dy) ;
}
