Пример #1
0
        //--------------------------------------------------------------------------------------
        public MainForm()
        {
            InitializeComponent();
            this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.m_MouseWheel);


            TSPref p = new TSPref(tsGrid1);

            if (p.PrefLoad())
            {
                this.Left   = p.Left;
                this.Top    = p.Top;
                this.Height = p.Height;
                tsGrid1.tsd.SetSize(p.CellCount, p.FrameCount);
                tsGrid1.GetStatus();
            }
            else
            {
                this.Left = 100;
                this.Top  = 100;
                tsGrid1.GetStatus();
            }
            SetFrameDisp(tsGrid1.tsd.FrameDisp);
            SetLayout();
            toolStripStatusLabel1.Text = tsGrid1.SelInfo;
            ShortCutPre();

            string[] cmds;
            cmds = System.Environment.GetCommandLineArgs();
            //MessageBox.Show(System.Environment.CommandLine);
            //コマンドライン引数の表示
            if (cmds.Length > 1)
            {
                for (int i = 1; i < cmds.Length; i++)
                {
                    string cmd = cmds[i];
                    if ((cmd != "") && (cmd[0] != '-') && (cmd[0] != '/'))
                    {
                        string s = cmd;
                        string e = Path.GetExtension(s);
                        if (e == "")
                        {
                            s += ".ard";
                        }
                        if (File.Exists(s))
                        {
                            if (tsGrid1.LoadFromFile(s))
                            {
                                //MessageBox.Show("OK:" + s);
                                break;
                            }
                            else
                            {
                                //MessageBox.Show("NG:" + s);
                            }
                        }
                    }
                }
            }
        }
Пример #2
0
        //--------------------------------------------------------------------------------
        public KeySettings(TSFunctions f)
        {
            InitializeComponent();

            TSPref pf = new TSPref(null);

            m_UserPath = pf.m_UserPath;

            tsfunc.Assign(f);
            tsfuncBak.Assign(f);
            this.SuspendLayout();
            for (int i = 0; i < (int)funcCmd.Count; i++)
            {
                //インスタンス作成
                this.kb[i] = new KeyBind();
                //プロパティ設定
                this.kb[i].Name            = "kb" + i.ToString();
                this.kb[i].Size            = new Size(480, 24);
                this.kb[i].Location        = new Point(20, 10 + i * 30);
                this.kb[i].Caption         = tsfunc.funcName[i, 1];
                this.kb[i].KeyDataChanged += new System.EventHandler(this.KeyDataChanged);
            }
            FromFunc();

            //フォームにコントロールを追加
            this.panel1.Controls.AddRange(this.kb);
            this.ResumeLayout(false);
        }
Пример #3
0
        //--------------------------------------------------------------------------------------
        private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            TSPref p = new TSPref(tsGrid1);

            p.Left   = this.Left;
            p.Top    = this.Top;
            p.Height = this.Height;
            p.PrefSave();
        }