/**********************************************************************
 
	Copyright (C) 2003-2004
	Hirohisa MORI <joshua@nichibun.ac.jp>
	Tomoki SEKIYAMA <sekiyama@yahoo.co.jp>
 
	This program is free software; you can redistribute it 
	and/or modify it under the terms of the GLOBALBASE 
	Library General Public License (G-LGPL) as published by 

	http://www.globalbase.org/
 
	This program is distributed in the hope that it will be 
	useful, but WITHOUT ANY WARRANTY; without even the 
	implied warranty of MERCHANTABILITY or FITNESS FOR A 
	PARTICULAR PURPOSE.

**********************************************************************/



#include "v/VEditable.h"

VEditable *	VEditable::focused_object = 0;


VEditable::VEditable()
{
	focused_event_handler = 0;
}

void
VEditable::focus_event(bool in)
{
	if ( in )
		focused_object = this;
	else
		focused_object = 0;
	if ( focused_event_handler )
		vq_insert_callback(dynamic_cast<VObject*>(this),
			focused_event_handler, focused_eh_arg, &in, sizeof(in));
}

void
VEditable::set_focused_event_handler(V_CALLBACK(handler), void *user_arg)
{
	focused_event_handler = handler;
	focused_eh_arg = user_arg;
}

