Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        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;

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

            handlers.Remove(load, unload, enterFrame, update, render,
                            press, release, rollOver, rollOut, keyPress);
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        public int AddEventHandler(string eventName, ButtonKeyPressHandler handler)
        {
            int id = -1;

            if (string.Compare(eventName, "keyPress") == 0)
            {
                id = m_lwf.GetEventOffset();
                m_handler.Add(id, k: handler);
            }
            return(id);
        }
Ejemplo n.º 6
0
 public int SetButtonEventHandler(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)
 {
     ClearButtonEventHandler(instId);
     return(AddButtonEventHandler(instId, load, unload, enterFrame, update,
                                  render, press, release, rollOver, rollOut, keyPress));
 }
Ejemplo n.º 7
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);
        }
Ejemplo n.º 8
0
 public void SetButtonEventHandler(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)
 {
     ClearButtonEventHandler(instanceName);
     AddButtonEventHandler(instanceName,
                           load, unload, enterFrame, update, render,
                           press, release, rollOver, rollOut, keyPress);
 }
Ejemplo n.º 9
0
 public void Add(int key,
                 ButtonEventHandler l    = null, ButtonEventHandler u     = null,
                 ButtonEventHandler e    = null, ButtonEventHandler up    = null,
                 ButtonEventHandler r    = null, ButtonEventHandler p     = null,
                 ButtonEventHandler rl   = null, ButtonEventHandler rOver = null,
                 ButtonEventHandler rOut = null, ButtonKeyPressHandler k  = null)
 {
     if (l != null)
     {
         load.Add(key, l);
     }
     if (u != null)
     {
         unload.Add(key, u);
     }
     if (e != null)
     {
         enterFrame.Add(key, e);
     }
     if (up != null)
     {
         update.Add(key, up);
     }
     if (r != null)
     {
         render.Add(key, r);
     }
     if (p != null)
     {
         press.Add(key, p);
     }
     if (rl != null)
     {
         release.Add(key, rl);
     }
     if (rOver != null)
     {
         rollOver.Add(key, rOver);
     }
     if (rOut != null)
     {
         rollOut.Add(key, rOut);
     }
     if (k != null)
     {
         keyPress.Add(key, k);
     }
 }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
 public void Remove(
     ButtonEventHandler l    = null, ButtonEventHandler u     = null,
     ButtonEventHandler e    = null, ButtonEventHandler up    = null,
     ButtonEventHandler r    = null, ButtonEventHandler p     = null,
     ButtonEventHandler rl   = null, ButtonEventHandler rOver = null,
     ButtonEventHandler rOut = null, ButtonKeyPressHandler k  = null)
 {
     if (l != null)
     {
         load.RemoveAll(h => h == l);
     }
     if (u != null)
     {
         unload.RemoveAll(h => h == u);
     }
     if (e != null)
     {
         enterFrame.RemoveAll(h => h == e);
     }
     if (up != null)
     {
         update.RemoveAll(h => h == up);
     }
     if (r != null)
     {
         render.RemoveAll(h => h == r);
     }
     if (p != null)
     {
         press.RemoveAll(h => h == p);
     }
     if (rl != null)
     {
         release.RemoveAll(h => h == rl);
     }
     if (rOver != null)
     {
         rollOver.RemoveAll(h => h == rOver);
     }
     if (rOut != null)
     {
         rollOut.RemoveAll(h => h == rOut);
     }
     if (k != null)
     {
         keyPress.RemoveAll(h => h == k);
     }
 }
Ejemplo n.º 12
0
 public ButtonEventHandlers(ButtonEventHandler l, ButtonEventHandler u,
                            ButtonEventHandler e, ButtonEventHandler up, ButtonEventHandler r,
                            ButtonEventHandler rOver, ButtonEventHandler rOut, ButtonEventHandler p,
                            ButtonEventHandler rl, ButtonKeyPressHandler k)
 {
     load       = l;
     unload     = u;
     enterFrame = e;
     update     = up;
     render     = r;
     rollOver   = rOver;
     rollOut    = rOut;
     press      = p;
     release    = rl;
     keyPress   = k;
 }
Ejemplo n.º 13
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);
            }
        }
Ejemplo n.º 14
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;
	}
Ejemplo n.º 15
0
	public void SetButtonEventHandler(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)
	{
		ClearButtonEventHandler(instanceName);
		AddButtonEventHandler(instanceName,
			load, unload, enterFrame, update, render,
			press, release, rollOver, rollOut, keyPress);
	}
Ejemplo n.º 16
0
	public int AddEventHandler(string eventName, ButtonKeyPressHandler handler)
	{
		int id = -1;
		if (string.Compare(eventName, "keyPress") == 0) {
			id = m_lwf.GetEventOffset();
			m_handler.Add(id, k:handler);
		}
		return id;
	}
Ejemplo n.º 17
0
	public int SetButtonEventHandler(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)
	{
		ClearButtonEventHandler(instId);
		return AddButtonEventHandler(instId, load, unload, enterFrame, update,
			render, press, release, rollOver, rollOut, keyPress);
	}
Ejemplo n.º 18
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;
		}

		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;
	}
Ejemplo n.º 19
0
	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);
	}
Ejemplo n.º 20
0
	public void Add(
		ButtonEventHandler l = null, ButtonEventHandler u = null,
		ButtonEventHandler e = null, ButtonEventHandler up = null,
		ButtonEventHandler r = null, ButtonEventHandler p = null,
		ButtonEventHandler rl = null, ButtonEventHandler rOver = null,
		ButtonEventHandler rOut = null, ButtonKeyPressHandler k = null)
	{
		if (l != null)
			load.Add(l);
		if (u != null)
			unload.Add(u);
		if (e != null)
			enterFrame.Add(e);
		if (up != null)
			update.Add(up);
		if (r != null)
			render.Add(r);
		if (p != null)
			press.Add(p);
		if (rl != null)
			release.Add(rl);
		if (rOver != null)
			rollOver.Add(rOver);
		if (rOut != null)
			rollOut.Add(rOut);
		if (k != null)
			keyPress.Add(k);
	}
Ejemplo n.º 21
0
	public void Remove(
		ButtonEventHandler l = null, ButtonEventHandler u = null,
		ButtonEventHandler e = null, ButtonEventHandler up = null,
		ButtonEventHandler r = null, ButtonEventHandler p = null,
		ButtonEventHandler rl = null, ButtonEventHandler rOver = null,
		ButtonEventHandler rOut = null, ButtonKeyPressHandler k = null)
	{
		if (l != null)
			load.RemoveAll(h => h == l);
		if (u != null)
			unload.RemoveAll(h => h == u);
		if (e != null)
			enterFrame.RemoveAll(h => h == e);
		if (up != null)
			update.RemoveAll(h => h == up);
		if (r != null)
			render.RemoveAll(h => h == r);
		if (p != null)
			press.RemoveAll(h => h == p);
		if (rl != null)
			release.RemoveAll(h => h == rl);
		if (rOver != null)
			rollOver.RemoveAll(h => h == rOver);
		if (rOut != null)
			rollOut.RemoveAll(h => h == rOut);
		if (k != null)
			keyPress.RemoveAll(h => h == k);
	}
Ejemplo n.º 22
0
	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;
		if (!m_buttonEventHandlersByFullName.TryGetValue(
				instanceName, out handlers))
			return;

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

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