Пример #1
0
        public static MEvent ButtonPressEvent(ConsoleKeyInfo keyInfo, MWidget sender)
        {
            MEventType t = MEventType.ButtonPress;
            List <int> p = new List <int>();

            p.Add(IO.KeyAvailable.IndexOf(keyInfo.Key));
            p.Add((int)keyInfo.Modifiers);
            return(new MEvent(t, p, sender));
        }
Пример #2
0
        public static MEvent ButtonPressEvent(ConsoleKey key, MWidget sender)
        {
            MEventType t = MEventType.ButtonPress;
            List <int> p = new List <int>();

            // -1 wrong,
            // 0 = ESC, 1 = SPACE, 2 = <-   3 = ^   4 = ->   5 = v
            p.Add(IO.KeyAvailable.IndexOf(key));
            return(new MEvent(t, p, sender));
        }
Пример #3
0
 public MEvent(MEventType Type, List <int> Params, MWidget sender)
 {
     this.Type            = Type;
     this.Params          = Params;
     this.Sender          = sender;
     listedParamsOnCreate = "";
     for (int i = 0; i < Params.Count; ++i)
     {
         listedParamsOnCreate += Params[i] + ";";
     }
 }
Пример #4
0
 public void RepeatForChildren(MEventType typ, List <int> param)
 {
     ExecuteForAllChildren(ME(typ, param));
 }
Пример #5
0
 private MEvent ME(MEventType typ, List <int> param)
 {
     return(new MEvent(typ, param, this.Widget));
 }
Пример #6
0
 public void SetAction(MEventType type, EventAction action)
 {
     actions[(int)type] = action;
 }