public CommandResult Exec(Commands.Entry ent)
 {
     if(ent.Category==Commands.Category.Fixed) {
         int n = (int)(ent.CID - CID.ActivateConnection0);
         if(n < GEnv.Connections.Count)
             return ActivateConnection2(GEnv.Connections.TagAt(n));
         else
             return CommandResult.Ignored;
     }
     else if(ent.Category==Commands.Category.Macro)
         return ExecMacro(((Commands.MacroEntry)ent).Index);
     else
         return Exec(ent.CID);
 }
示例#2
0
 public object Clone()
 {
     Commands cm = new Commands();
     IEnumerator ie = EnumEntries();
     while(ie.MoveNext()) {
         Entry  e = (Entry)ie.Current;
         Entry ne = e.Clone();
         cm.AddEntry(ne);
     }
     return cm;
 }
示例#3
0
        private void ApplyHotKeys(Commands km, Menu.MenuItemCollection items)
        {
            foreach(GMenuItemBase mib in items) {
                GMenuItem mi = mib as GMenuItem;
                if(mi!=null) {
                    CID cid = (CID)mi.CID;
                    mi.ShortcutKey = km.FindKey(cid);

                }
                if(mib.MenuItems.Count>0) ApplyHotKeys(km, mib.MenuItems);
            }
        }
示例#4
0
 public void ApplyHotKeys(Commands cmds)
 {
     ApplyHotKeys(cmds, _menu.MenuItems);
     AdjustMacroMenu();
 }
示例#5
0
 public override void InitUI(ContainerOptions options)
 {
     _commands = (Commands)options.Commands.Clone();
     InitKeyConfigUI();
 }
示例#6
0
        public override sealed void Load(ConfigNode parent)
        {
            ConfigNode node = parent.FindChildConfigNode("poderosa-container");
            if(node!=null) {
                //��{�̃A�g���r���[�g
                foreach(ConfigElementAttribute attr in _configAttributes) {
                    attr.ImportFrom(this, node);
                }
            }

            //frame state�͕ʂ̈���
            string frame_pos = node==null? null : node.GetValue("framePosition", null);
            bool frame_filled = false;
            if(_frameState==FormWindowState.Normal && frame_pos!=null) {
                string[] t = frame_pos.Split(',');
                if(t.Length==4) {
                    _framePosition.X = GUtil.ParseInt(t[0], 0);
                    _framePosition.Y = GUtil.ParseInt(t[1], 0);
                    _framePosition.Width = GUtil.ParseInt(t[2], 640);
                    _framePosition.Height = GUtil.ParseInt(t[3], 480);

                    frame_filled = true;
                }
            }

            if(!frame_filled) {
                if(_frameState==FormWindowState.Minimized) _frameState = FormWindowState.Normal; //�ŏ����ŋN�����Ă�d���Ȃ��̂Ńm�[�}���ɂ���
                Rectangle r = Screen.PrimaryScreen.Bounds;
                _framePosition.X = r.Width / 6;
                _framePosition.Y = r.Height / 6;
                _framePosition.Width = r.Width*2 / 3;
                _framePosition.Height = r.Height*2 / 3;
            }

            _commands = new Commands();
            _commands.Load(parent);

            base.Load(parent);
        }
示例#7
0
        public override void Init()
        {
            foreach(ConfigElementAttribute attr in _configAttributes) {
                attr.Reset(this);
            }

            Rectangle r = Screen.PrimaryScreen.Bounds;
            _framePosition.X = r.Width / 6;
            _framePosition.Y = r.Height / 6;
            _framePosition.Width = r.Width*2 / 3;
            _framePosition.Height = r.Height*2 / 3;

            _commands = new Commands();
            _commands.Init();
            base.Init();
        }