dialog_window = {}
dialog_window._actions = {}

dialog_window._actions.ok_modify = 
{
	pressed = function(_window) 
        user_profiles.run_modify_function(_window)
	end
}

dialog_window._actions.no_button = 
{
	pressed = function(_window) 
        _window.EndModal(0)
	end
}

dialog_window._actions.yes_button_child = 
{
	pressed = function(_window) 
		_window.AddFlags(_window.FlagDead)
	end
}

dialog_window._actions.yes_button = 
{
	pressed = function(_window) 
        _window.EndModal(1)
	end
}

dialog_window._actions.cancel_button = 
{
	pressed = function(_window) 
        _window.EndModal(2)
	end
}

function dialog_window.Show(_objects, _window)
end

function dialog_window.DoDraw(_this, _renderer)
end

function dialog_window.DoUpdate(_this)
end


function dialog_window.OnChar(_this, _char, _keyboard_state, _state, _broadcast)
	return _this.SuperOnChar(_char, _keyboard_state, _state, _broadcast)
end

function dialog_window.OnKeyDown(_this, _key, _keyboard_state, _state, _broadcast)
	return _this.SuperOnKeyDown( _key, _keyboard_state, _state, _broadcast)
end

function dialog_window.OnKeyUp(_this, _key, _keyboard_state, _state, _broadcast)
	return _this.SuperOnKeyUp( _key, _keyboard_state, _state, _broadcast)
end

function dialog_window.OnMouseMove(_this, _pos, _state, _broadcast)
	return _this.SuperOnMouseMove( _pos, _state, _broadcast) 
end

function dialog_window.OnMouseDown(_this, _pos, _button, _state, _broadcast)
	return _this.SuperOnMouseDown( _pos, _button, _state, _broadcast)
end

function dialog_window.OnMouseUp(_this, _pos, _button, _state, _broadcast)
	return _this.SuperOnMouseUp( _pos, _button, _state, _broadcast) 
end

function dialog_window.OnDoubleClick(_this, _pos, _state, _broadcast)
	return _this.SuperOnDoubleClick( _pos, _state, _broadcast) 
end

function dialog_window.OnMouseWheel(_this, _pos, _delta, _state, _broadcast)
	return _this.SuperOnMouseWheel( _pos, _delta, _state, _broadcast)
end

function dialog_window.OnChildAction(_this, _action, _child)
	if not _child then return end
	local handler = dialog_window._actions[_child.GetId().c_str()]
	if handler then handler = handler[_action.c_str()] end
	if handler then handler(_this, _child) end
end

------------------------------------------------
-- скрипт для диалоговых окон, которые добавляются как дочерние

child_dialog_window = {}

__inherite(child_dialog_window, dialog_window)

child_dialog_window._actions.ok = 
{
	pressed = function(_window) 
        _window.AddFlags(_window.FlagDead)
	end
}