コード例 #1
0
ファイル: lwf_event.cs プロジェクト: infine8/unity3d-seva
        public void RemoveButtonEventHandler(int instId,
                                             ButtonEventHandler load        = null, ButtonEventHandler unload   = null,
                                             ButtonEventHandler enterFrame  = null, ButtonEventHandler update   = null,
                                             ButtonEventHandler render      = null, ButtonEventHandler press    = null,
                                             ButtonEventHandler release     = null, ButtonEventHandler rollOver = null,
                                             ButtonEventHandler rollOut     = null,
                                             ButtonKeyPressHandler keyPress = null)
        {
            if (instId < 0 || instId >= m_instances.Length)
            {
                return;
            }

            ButtonEventHandlers handlers = m_buttonEventHandlers[instId];

            if (handlers == null)
            {
                return;
            }

            handlers.Remove(load, unload, enterFrame, update, render,
                            press, release, rollOver, rollOut, keyPress);

            Button button = SearchButtonInstanceByInstanceId(instId);

            if (button != null)
            {
                button.SetHandlers(handlers);
            }
        }
コード例 #2
0
ファイル: lwf_event.cs プロジェクト: kevbaker/lwf-demo
        public void RemoveButtonEventHandler(string instanceName,
                                             ButtonEventHandler load        = null, ButtonEventHandler unload   = null,
                                             ButtonEventHandler enterFrame  = null, ButtonEventHandler update   = null,
                                             ButtonEventHandler render      = null, ButtonEventHandler press    = null,
                                             ButtonEventHandler release     = null, ButtonEventHandler rollOver = null,
                                             ButtonEventHandler rollOut     = null,
                                             ButtonKeyPressHandler keyPress = null)
        {
            int instId = SearchInstanceId(GetStringId(instanceName));

            if (instId >= 0)
            {
                RemoveButtonEventHandler(instId,
                                         load, unload, enterFrame, update, render,
                                         press, release, rollOver, rollOut, keyPress);
                return;
            }

            if (m_buttonEventHandlersByFullName == null)
            {
                return;
            }

            ButtonEventHandlers handlers =
                m_buttonEventHandlersByFullName[instanceName];

            if (handlers == null)
            {
                return;
            }

            handlers.Remove(load, unload, enterFrame, update, render,
                            press, release, rollOver, rollOut, keyPress);
        }
コード例 #3
0
ファイル: lwf_event.cs プロジェクト: kevbaker/lwf-demo
        public void ClearButtonEventHandler(
            string instanceName, ButtonEventHandlers.Type type)
        {
            int instId = SearchInstanceId(GetStringId(instanceName));

            if (instId >= 0)
            {
                ClearButtonEventHandler(instId, type);
                return;
            }

            if (m_buttonEventHandlersByFullName == null)
            {
                return;
            }

            ButtonEventHandlers handlers =
                m_buttonEventHandlersByFullName[instanceName];

            if (handlers == null)
            {
                return;
            }

            handlers.Clear(type);
        }
コード例 #4
0
        public void SetButtonEventHandler(int instId,
                                          ButtonEventHandler press       = null, ButtonEventHandler release    = null,
                                          ButtonEventHandler rollOver    = null, ButtonEventHandler rollOut    = null,
                                          ButtonKeyPressHandler keyPress = null, ButtonEventHandler load       = null,
                                          ButtonEventHandler unload      = null, ButtonEventHandler enterFrame = null,
                                          ButtonEventHandler update      = null, ButtonEventHandler render     = null)
        {
            if (instId < 0 || instId >= m_instances.Length)
            {
                return;
            }

            ButtonEventHandlers handlers;

            if (load != null || unload != null || enterFrame != null ||
                update != null || render != null || rollOver != null ||
                rollOut != null || press != null || release != null ||
                keyPress != null)
            {
                handlers = new ButtonEventHandlers(load, unload, enterFrame, update,
                                                   render, rollOver, rollOut, press, release, keyPress);
            }
            else
            {
                handlers = null;
            }
            m_buttonEventHandlers[instId] = handlers;
        }
コード例 #5
0
        public int AddButtonEventHandler(int instId,
                                         ButtonEventHandler load        = null, ButtonEventHandler unload   = null,
                                         ButtonEventHandler enterFrame  = null, ButtonEventHandler update   = null,
                                         ButtonEventHandler render      = null, ButtonEventHandler press    = null,
                                         ButtonEventHandler release     = null, ButtonEventHandler rollOver = null,
                                         ButtonEventHandler rollOut     = null,
                                         ButtonKeyPressHandler keyPress = null)
        {
            interactive = true;

            if (instId < 0 || instId >= m_instances.Length)
            {
                return(-1);
            }

            ButtonEventHandlers handlers = m_buttonEventHandlers[instId];

            if (handlers == null)
            {
                handlers = new ButtonEventHandlers();
                m_buttonEventHandlers[instId] = handlers;
            }

            handlers.Add(load, unload, enterFrame, update, render,
                         press, release, rollOver, rollOut, keyPress);

            Button button = SearchButtonInstanceByInstanceId(instId);

            if (button != null)
            {
                button.SetHandlers(handlers);
            }
            return(++m_eventOffset);
        }
コード例 #6
0
        public Button(LWF lwf, Movie parent, int objId, int instId,
                      int matrixId = -1, int colorTransformId = -1)
            : base(lwf, parent, Format.Object.Type.BUTTON, objId, instId)
        {
            m_matrixId         = matrixId;
            m_colorTransformId = colorTransformId;

            m_invert = new Matrix();
            m_hitX   = Int32.MinValue;
            m_hitY   = Int32.MinValue;

            if (objId >= 0)
            {
                m_data         = lwf.data.buttons[objId];
                m_dataMatrixId = m_data.matrixId;
            }

            ButtonEventHandlers handler = lwf.GetButtonEventHandlers(this);

            if (handler != null)
            {
                m_handler = new ButtonEventHandlers();
                m_handler.Add(handler);
                m_handler.Call(EventType.LOAD, this);
            }
        }
コード例 #7
0
ファイル: lwf_button.cs プロジェクト: DelSystem32/lwf
	public void SetHandlers(ButtonEventHandlers handler)
	{
		if (m_handler == null)
			m_handler = new ButtonEventHandlers();
		else
			m_handler.Clear();
		m_handler.Add(handler);
	}
コード例 #8
0
ファイル: lwf_button.cs プロジェクト: yongma/lwf-demo
 public void SetHandlers(ButtonEventHandlers handler)
 {
     if (m_handler != null)
     {
         m_handler.Add(handler);
     }
     else
     {
         m_handler = handler;
     }
 }
コード例 #9
0
 public void SetHandlers(ButtonEventHandlers handler)
 {
     if (m_handler == null)
     {
         m_handler = new ButtonEventHandlers();
     }
     else
     {
         m_handler.Clear();
     }
     m_handler.Add(handler);
 }
コード例 #10
0
        public int AddButtonEventHandler(string instanceName,
                                         ButtonEventHandler load        = null, ButtonEventHandler unload   = null,
                                         ButtonEventHandler enterFrame  = null, ButtonEventHandler update   = null,
                                         ButtonEventHandler render      = null, ButtonEventHandler press    = null,
                                         ButtonEventHandler release     = null, ButtonEventHandler rollOver = null,
                                         ButtonEventHandler rollOut     = null,
                                         ButtonKeyPressHandler keyPress = null)
        {
            interactive = true;

            int instId = SearchInstanceId(GetStringId(instanceName));

            if (instId >= 0)
            {
                return(AddButtonEventHandler(instId,
                                             load, unload, enterFrame, update, render,
                                             press, release, rollOver, rollOut, keyPress));
            }

            if (!instanceName.Contains("."))
            {
                return(-1);
            }

            if (m_buttonEventHandlersByFullName == null)
            {
                m_buttonEventHandlersByFullName =
                    new ButtonEventHandlersDictionary();
            }

            ButtonEventHandlers handlers;

            if (!m_buttonEventHandlersByFullName.TryGetValue(
                    instanceName, out handlers))
            {
                handlers = new ButtonEventHandlers();
                m_buttonEventHandlersByFullName[instanceName] = handlers;
            }

            int id = GetEventOffset();

            handlers.Add(id, load, unload, enterFrame, update, render,
                         press, release, rollOver, rollOut, keyPress);

            Button button = SearchButtonInstance(instanceName);

            if (button != null)
            {
                button.SetHandlers(handlers);
            }
            return(id);
        }
コード例 #11
0
ファイル: lwf_eventbutton.cs プロジェクト: xubingyue/lwf
        public void Add(ButtonEventHandlers handlers)
        {
            if (handlers == null)
            {
                return;
            }

            foreach (var h in handlers.load)
            {
                load.Add(h.Key, h.Value);
            }
            foreach (var h in handlers.unload)
            {
                unload.Add(h.Key, h.Value);
            }
            foreach (var h in handlers.enterFrame)
            {
                enterFrame.Add(h.Key, h.Value);
            }
            foreach (var h in handlers.update)
            {
                update.Add(h.Key, h.Value);
            }
            foreach (var h in handlers.render)
            {
                render.Add(h.Key, h.Value);
            }
            foreach (var h in handlers.press)
            {
                press.Add(h.Key, h.Value);
            }
            foreach (var h in handlers.release)
            {
                release.Add(h.Key, h.Value);
            }
            foreach (var h in handlers.rollOver)
            {
                rollOver.Add(h.Key, h.Value);
            }
            foreach (var h in handlers.rollOut)
            {
                rollOut.Add(h.Key, h.Value);
            }
            foreach (var h in handlers.keyPress)
            {
                keyPress.Add(h.Key, h.Value);
            }
        }
コード例 #12
0
ファイル: lwf_event.cs プロジェクト: kevbaker/lwf-demo
        public void AddButtonEventHandler(string instanceName,
                                          ButtonEventHandler load        = null, ButtonEventHandler unload   = null,
                                          ButtonEventHandler enterFrame  = null, ButtonEventHandler update   = null,
                                          ButtonEventHandler render      = null, ButtonEventHandler press    = null,
                                          ButtonEventHandler release     = null, ButtonEventHandler rollOver = null,
                                          ButtonEventHandler rollOut     = null,
                                          ButtonKeyPressHandler keyPress = null)
        {
            int instId = SearchInstanceId(GetStringId(instanceName));

            if (instId >= 0)
            {
                AddButtonEventHandler(instId,
                                      load, unload, enterFrame, update, render,
                                      press, release, rollOver, rollOut, keyPress);
                return;
            }

            if (!instanceName.Contains("."))
            {
                return;
            }

            if (m_buttonEventHandlersByFullName == null)
            {
                m_buttonEventHandlersByFullName =
                    new ButtonEventHandlersDictionary();
            }

            ButtonEventHandlers handlers =
                m_buttonEventHandlersByFullName[instanceName];

            if (handlers == null)
            {
                handlers = new ButtonEventHandlers();
                m_buttonEventHandlersByFullName[instanceName] = handlers;
            }

            Button button = SearchButtonInstance(instId);

            if (button != null)
            {
                button.SetHandlers(handlers);
            }

            handlers.Add(load, unload, enterFrame, update, render,
                         press, release, rollOver, rollOut, keyPress);
        }
コード例 #13
0
ファイル: lwf_button.cs プロジェクト: 99corps/lwf
        public Button(LWF lwf, Movie parent, int objId, int instId)
            : base(lwf, parent, Format.Object.Type.BUTTON, objId, instId)
        {
            m_invert = new Matrix();
            m_hitX = Int32.MinValue;
            m_hitY = Int32.MinValue;

            if (objId >= 0) {
            m_data = lwf.data.buttons[objId];
            m_dataMatrixId = m_data.matrixId;
            }

            m_handler = lwf.GetButtonEventHandlers(this);
            if (m_handler != null && m_handler.load != null)
            m_handler.load(this);
        }
コード例 #14
0
        public void ClearButtonEventHandler(int instId)
        {
            if (instId < 0 || instId >= m_instances.Length)
            {
                return;
            }

            ButtonEventHandlers handlers = m_buttonEventHandlers[instId];

            if (handlers == null)
            {
                return;
            }

            handlers.Clear();
        }
コード例 #15
0
        public void Add(ButtonEventHandlers handlers)
        {
            if (handlers == null)
            {
                return;
            }

            handlers.load.ForEach(h => load.Add(h));
            handlers.unload.ForEach(h => unload.Add(h));
            handlers.enterFrame.ForEach(h => enterFrame.Add(h));
            handlers.update.ForEach(h => update.Add(h));
            handlers.render.ForEach(h => render.Add(h));
            handlers.press.ForEach(h => press.Add(h));
            handlers.release.ForEach(h => release.Add(h));
            handlers.rollOver.ForEach(h => rollOver.Add(h));
            handlers.rollOut.ForEach(h => rollOut.Add(h));
            handlers.keyPress.ForEach(h => keyPress.Add(h));
        }
コード例 #16
0
ファイル: lwf_button.cs プロジェクト: kevbaker/lwf-demo
        public Button(LWF lwf, Movie parent, int objId, int instId)
            : base(lwf, parent, Format.Object.Type.BUTTON, objId, instId)
        {
            m_invert = new Matrix();
            m_hitX   = Int32.MinValue;
            m_hitY   = Int32.MinValue;

            if (objId >= 0)
            {
                m_data         = lwf.data.buttons[objId];
                m_dataMatrixId = m_data.matrixId;
            }

            m_handler = lwf.GetButtonEventHandlers(this);
            if (m_handler != null && m_handler.load != null)
            {
                m_handler.load(this);
            }
        }
コード例 #17
0
ファイル: lwf_button.cs プロジェクト: neojjang/lwf
        public Button(LWF lwf, Movie parent, int objId, int instId,
			int matrixId = -1, int colorTransformId = -1)
            : base(lwf, parent, Format.Object.Type.BUTTON, objId, instId)
        {
            m_matrixId = matrixId;
            m_colorTransformId = colorTransformId;

            m_invert = new Matrix();
            m_hitX = Int32.MinValue;
            m_hitY = Int32.MinValue;

            if (objId >= 0) {
            m_data = lwf.data.buttons[objId];
            m_dataMatrixId = m_data.matrixId;
            }

            m_handler = lwf.GetButtonEventHandlers(this);
            if (m_handler != null)
            m_handler.Call(EventType.LOAD, this);
        }
コード例 #18
0
        public void SetButtonEventHandler(string instanceName,
                                          ButtonEventHandler press       = null, ButtonEventHandler release    = null,
                                          ButtonEventHandler rollOver    = null, ButtonEventHandler rollOut    = null,
                                          ButtonKeyPressHandler keyPress = null, ButtonEventHandler load       = null,
                                          ButtonEventHandler unload      = null, ButtonEventHandler enterFrame = null,
                                          ButtonEventHandler update      = null, ButtonEventHandler render     = null)
        {
            int instId = SearchInstanceId(GetStringId(instanceName));

            if (instId >= 0)
            {
                SetButtonEventHandler(instId, press, release, rollOver, rollOut,
                                      keyPress, load, unload, enterFrame, update, render);
                return;
            }

            if (!instanceName.Contains("."))
            {
                return;
            }

            if (m_buttonEventHandlersByFullName == null)
            {
                m_buttonEventHandlersByFullName =
                    new ButtonEventHandlersDictionary();
            }

            if (load != null ||
                unload != null || enterFrame != null || update != null ||
                render != null || rollOver != null || rollOut != null ||
                press != null || release != null || keyPress != null)
            {
                m_buttonEventHandlersByFullName[instanceName] =
                    new ButtonEventHandlers(load, unload, enterFrame, update,
                                            render, rollOver, rollOut, press, release, keyPress);
            }
            else
            {
                m_buttonEventHandlersByFullName.Remove(instanceName);
            }
        }
コード例 #19
0
        public void ClearButtonEventHandler(int instId)
        {
            if (instId < 0 || instId >= m_instances.Length)
            {
                return;
            }

            ButtonEventHandlers handlers = m_buttonEventHandlers[instId];

            if (handlers == null)
            {
                return;
            }

            handlers.Clear();

            Button button = SearchButtonInstanceByInstanceId(instId);

            if (button != null)
            {
                button.SetHandlers(handlers);
            }
        }
コード例 #20
0
ファイル: lwf_event.cs プロジェクト: DelSystem32/lwf
	public void ClearButtonEventHandler(
		string instanceName, ButtonEventHandlers.Type type)
	{
		int instId = SearchInstanceId(GetStringId(instanceName));
		if (instId >= 0) {
			ClearButtonEventHandler(instId, type);
			return;
		}

		if (m_buttonEventHandlersByFullName == null)
			return;

		ButtonEventHandlers handlers;
		if (!m_buttonEventHandlersByFullName.TryGetValue(
				instanceName, out handlers))
			return;

		handlers.Clear(type);

		Button button = SearchButtonInstance(instanceName);
		if (button != null)
			button.SetHandlers(handlers);
	}
コード例 #21
0
ファイル: lwf_button.cs プロジェクト: Zniel/lwf-demo
 public void SetHandlers(ButtonEventHandlers handler)
 {
     if (m_handler != null)
     m_handler.Add(handler);
     else
     m_handler = handler;
 }
コード例 #22
0
ファイル: lwf_event.cs プロジェクト: neojjang/lwf
        public void ClearButtonEventHandler(
		string instanceName, ButtonEventHandlers.Type type)
        {
            int instId = SearchInstanceId(GetStringId(instanceName));
            if (instId >= 0) {
            ClearButtonEventHandler(instId, type);
            return;
            }

            if (m_buttonEventHandlersByFullName == null)
            return;

            ButtonEventHandlers handlers =
            m_buttonEventHandlersByFullName[instanceName];
            if (handlers == null)
            return;

            handlers.Clear(type);
        }
コード例 #23
0
ファイル: lwf_event.cs プロジェクト: BenoitLafont/lwf-demo
        public void ClearButtonEventHandler(
		int instId, ButtonEventHandlers.Type type)
        {
            if (instId < 0 || instId >= m_instances.Length)
            return;

            ButtonEventHandlers handlers = m_buttonEventHandlers[instId];
            if (handlers == null)
            return;

            handlers.Clear(type);
        }
コード例 #24
0
ファイル: lwf_button.cs プロジェクト: neojjang/lwf
 public void SetHandlers(ButtonEventHandlers handler)
 {
     m_handler = handler;
 }
コード例 #25
0
ファイル: lwf_core.cs プロジェクト: 99corps/lwf
        public void SetButtonEventHandler(int instId,
		ButtonEventHandler press = null, ButtonEventHandler release = null,
		ButtonEventHandler rollOver = null, ButtonEventHandler rollOut = null,
		ButtonKeyPressHandler keyPress = null, ButtonEventHandler load = null,
		ButtonEventHandler unload = null, ButtonEventHandler enterFrame = null,
		ButtonEventHandler update = null, ButtonEventHandler render = null)
        {
            if (instId < 0 || instId >= m_instances.Length)
            return;

            ButtonEventHandlers handlers;
            if (load != null || unload != null || enterFrame != null ||
                update != null || render != null || rollOver != null ||
                rollOut != null || press != null || release != null ||
                keyPress != null) {
            handlers = new ButtonEventHandlers(load, unload, enterFrame, update,
                render, rollOver, rollOut, press, release, keyPress);
            } else {
            handlers = null;
            }
            m_buttonEventHandlers[instId] = handlers;
        }
コード例 #26
0
ファイル: lwf_core.cs プロジェクト: 99corps/lwf
        public void SetButtonEventHandler(string instanceName,
		ButtonEventHandler press = null, ButtonEventHandler release = null,
		ButtonEventHandler rollOver = null, ButtonEventHandler rollOut = null,
		ButtonKeyPressHandler keyPress = null, ButtonEventHandler load = null,
		ButtonEventHandler unload = null, ButtonEventHandler enterFrame = null,
		ButtonEventHandler update = null, ButtonEventHandler render = null)
        {
            int instId = SearchInstanceId(GetStringId(instanceName));
            if (instId >= 0) {
            SetButtonEventHandler(instId, press, release, rollOver, rollOut,
                keyPress, load, unload, enterFrame, update, render);
            return;
            }

            if (!instanceName.Contains("."))
            return;

            if (m_buttonEventHandlersByFullName == null)
            m_buttonEventHandlersByFullName =
                new ButtonEventHandlersDictionary();

            if (load != null ||
                unload != null || enterFrame != null || update != null ||
                render != null || rollOver != null || rollOut != null ||
                press != null || release != null || keyPress != null) {
            m_buttonEventHandlersByFullName[instanceName] =
                new ButtonEventHandlers(load, unload, enterFrame, update,
                    render, rollOver, rollOut, press, release, keyPress);
            } else {
            m_buttonEventHandlersByFullName.Remove(instanceName);
            }
        }
コード例 #27
0
ファイル: lwf_event.cs プロジェクト: kevbaker/lwf-demo
        public void AddButtonEventHandler(int instId,
		ButtonEventHandler load = null, ButtonEventHandler unload = null,
		ButtonEventHandler enterFrame = null, ButtonEventHandler update = null,
		ButtonEventHandler render = null, ButtonEventHandler press = null,
		ButtonEventHandler release = null, ButtonEventHandler rollOver = null,
		ButtonEventHandler rollOut = null,
		ButtonKeyPressHandler keyPress = null)
        {
            if (instId < 0 || instId >= m_instances.Length)
            return;

            ButtonEventHandlers handlers = m_buttonEventHandlers[instId];
            if (handlers == null) {
            handlers = new ButtonEventHandlers();
            m_buttonEventHandlers[instId] = handlers;
            }

            Button button = SearchButtonInstanceByInstanceId(instId);
            if (button != null)
            button.SetHandlers(handlers);

            handlers.Add(load, unload, enterFrame, update, render,
            press, release, rollOver, rollOut, keyPress);
        }
コード例 #28
0
ファイル: lwf_button.cs プロジェクト: kevbaker/lwf-demo
 public void SetHandlers(ButtonEventHandlers handler)
 {
     m_handler = handler;
 }
コード例 #29
0
ファイル: lwf_eventbutton.cs プロジェクト: DelSystem32/lwf
	public void Add(ButtonEventHandlers handlers)
	{
		if (handlers == null)
			return;

		foreach (var h in handlers.load)
			load.Add(h.Key, h.Value);
		foreach (var h in handlers.unload)
			unload.Add(h.Key, h.Value);
		foreach (var h in handlers.enterFrame)
			enterFrame.Add(h.Key, h.Value);
		foreach (var h in handlers.update)
			update.Add(h.Key, h.Value);
		foreach (var h in handlers.render)
			render.Add(h.Key, h.Value);
		foreach (var h in handlers.press)
			press.Add(h.Key, h.Value);
		foreach (var h in handlers.release)
			release.Add(h.Key, h.Value);
		foreach (var h in handlers.rollOver)
			rollOver.Add(h.Key, h.Value);
		foreach (var h in handlers.rollOut)
			rollOut.Add(h.Key, h.Value);
		foreach (var h in handlers.keyPress)
			keyPress.Add(h.Key, h.Value);
	}
コード例 #30
0
ファイル: lwf_event.cs プロジェクト: DelSystem32/lwf
	public int AddButtonEventHandler(int instId,
		ButtonEventHandler load = null, ButtonEventHandler unload = null,
		ButtonEventHandler enterFrame = null, ButtonEventHandler update = null,
		ButtonEventHandler render = null, ButtonEventHandler press = null,
		ButtonEventHandler release = null, ButtonEventHandler rollOver = null,
		ButtonEventHandler rollOut = null,
		ButtonKeyPressHandler keyPress = null)
	{
		interactive = true;

		if (instId < 0 || instId >= m_instances.Length)
			return -1;

		ButtonEventHandlers handlers = m_buttonEventHandlers[instId];
		if (handlers == null) {
			handlers = new ButtonEventHandlers();
			m_buttonEventHandlers[instId] = handlers;
		}

		int id = GetEventOffset();
		handlers.Add(id, load, unload, enterFrame, update, render,
			press, release, rollOver, rollOut, keyPress);

		Button button = SearchButtonInstanceByInstanceId(instId);
		if (button != null)
			button.SetHandlers(handlers);
		return id;
	}
コード例 #31
0
ファイル: lwf_event.cs プロジェクト: DelSystem32/lwf
	public void ClearButtonEventHandler(
		int instId, ButtonEventHandlers.Type type)
	{
		if (instId < 0 || instId >= m_instances.Length)
			return;

		ButtonEventHandlers handlers = m_buttonEventHandlers[instId];
		if (handlers == null)
			return;

		handlers.Clear(type);

		Button button = SearchButtonInstanceByInstanceId(instId);
		if (button != null)
			button.SetHandlers(handlers);
	}
コード例 #32
0
ファイル: lwf_event.cs プロジェクト: kevbaker/lwf-demo
        public void AddButtonEventHandler(string instanceName,
		ButtonEventHandler load = null, ButtonEventHandler unload = null,
		ButtonEventHandler enterFrame = null, ButtonEventHandler update = null,
		ButtonEventHandler render = null, ButtonEventHandler press = null,
		ButtonEventHandler release = null, ButtonEventHandler rollOver = null,
		ButtonEventHandler rollOut = null,
		ButtonKeyPressHandler keyPress = null)
        {
            int instId = SearchInstanceId(GetStringId(instanceName));
            if (instId >= 0) {
            AddButtonEventHandler(instId,
                load, unload, enterFrame, update, render,
                press, release, rollOver, rollOut, keyPress);
            return;
            }

            if (!instanceName.Contains("."))
            return;

            if (m_buttonEventHandlersByFullName == null)
            m_buttonEventHandlersByFullName =
                new ButtonEventHandlersDictionary();

            ButtonEventHandlers handlers =
            m_buttonEventHandlersByFullName[instanceName];
            if (handlers == null) {
            handlers = new ButtonEventHandlers();
            m_buttonEventHandlersByFullName[instanceName] = handlers;
            }

            Button button = SearchButtonInstance(instId);
            if (button != null)
            button.SetHandlers(handlers);

            handlers.Add(load, unload, enterFrame, update, render,
            press, release, rollOver, rollOut, keyPress);
        }
コード例 #33
0
	public void Add(ButtonEventHandlers handlers)
	{
		if (handlers == null)
			return;

		handlers.load.ForEach(h => load.Add(h));
		handlers.unload.ForEach(h => unload.Add(h));
		handlers.enterFrame.ForEach(h => enterFrame.Add(h));
		handlers.update.ForEach(h => update.Add(h));
		handlers.render.ForEach(h => render.Add(h));
		handlers.press.ForEach(h => press.Add(h));
		handlers.release.ForEach(h => release.Add(h));
		handlers.rollOver.ForEach(h => rollOver.Add(h));
		handlers.rollOut.ForEach(h => rollOut.Add(h));
		handlers.keyPress.ForEach(h => keyPress.Add(h));
	}
コード例 #34
0
ファイル: lwf_event.cs プロジェクト: DelSystem32/lwf
	public int AddButtonEventHandler(string instanceName,
		ButtonEventHandler load = null, ButtonEventHandler unload = null,
		ButtonEventHandler enterFrame = null, ButtonEventHandler update = null,
		ButtonEventHandler render = null, ButtonEventHandler press = null,
		ButtonEventHandler release = null, ButtonEventHandler rollOver = null,
		ButtonEventHandler rollOut = null,
		ButtonKeyPressHandler keyPress = null)
	{
		interactive = true;

		int instId = SearchInstanceId(GetStringId(instanceName));
		if (instId >= 0) {
			return AddButtonEventHandler(instId,
				load, unload, enterFrame, update, render,
				press, release, rollOver, rollOut, keyPress);
		}

		if (!instanceName.Contains("."))
			return -1;

		if (m_buttonEventHandlersByFullName == null)
			m_buttonEventHandlersByFullName =
				new ButtonEventHandlersDictionary();

		ButtonEventHandlers handlers;
		if (!m_buttonEventHandlersByFullName.TryGetValue(
				instanceName, out handlers)) {
			handlers = new ButtonEventHandlers();
			m_buttonEventHandlersByFullName[instanceName] = handlers;
		}

		int id = GetEventOffset();
		handlers.Add(id, load, unload, enterFrame, update, render,
			press, release, rollOver, rollOut, keyPress);

		Button button = SearchButtonInstance(instanceName);
		if (button != null)
			button.SetHandlers(handlers);
		return id;
	}