示例#1
0
 private void BtnConvert_Click(object sender, EventArgs e)
 {
     if (DlgFileOpen.ShowDialog() == DialogResult.OK)
     {
         TxtBox.AppendText("Converting : " + DlgFileOpen.FileName);
         Convert(DlgFileOpen.FileName);
     }
 }
示例#2
0
文件: Form1.cs 项目: sven82/HFCS
 private void BtnOpen_Click(object sender, EventArgs e)
 {
     if (OpenFileDlg.ShowDialog() == DialogResult.OK)
     {
         string fileName = OpenFileDlg.FileName;
         TxtBox.Clear();
         TxtBox.Text = File.ReadAllText(fileName);
     }
 }
   private void RtClickButton_ClickImpl(object sender, EventArgs e, ref StoryBoard SB)
   {
       string TBT = TxtBox.Text;
       switch(Counter)
       {
         case 0:
             TextBoxes[Counter] = TBT;
             break;
        }
        SB.Counter++; // Adds 1 to the counter.
        LtClickButton.Enabled = true;
        TxtBox.Clear(); // Clears the text box.
 }
示例#4
0
        private void Button_Click(object sender, EventArgs e)
        {
            if (!_infinityCheck)
            {
                if ((TxtBox.Text == Constants.ZeroValue) || (_boloperatorPerf))
                {
                    TxtBox.Clear();
                }
                _boloperatorPerf = false;
                Button output = (Button)sender;

                if (output.Text == Constants.BulletOperator)
                {
                    if (!TxtBox.Text.Contains(Constants.BulletOperator))
                    {
                        TxtBox.Text = TxtBox.Text + output.Text;
                    }
                }
                else if (_equalclick)
                {
                    Global_Clr.PerformClick();
                    _resultValue    = 0;
                    _firstValue     = 0;
                    Label_Show.Text = string.Empty;
                    TxtBox.Text     = output.Text;
                    _equalclick     = false;
                }
                else if (_equalclick && _resultValue <= 0 && _resultValue >= 0)
                {
                    _resultValue    = _firstValue;
                    _firstValue     = double.Parse(TxtBox.Text);
                    TxtBox.Text     = output.Text;
                    Label_Show.Text = $"{_firstValue} {_operatorPerf}";
                    TxtBox.Text     = output.Text;
                    _equalclick     = false;
                }
                else
                {
                    TxtBox.Text = TxtBox.Text + output.Text;
                }
            }
            else
            {
                Global_Clr.PerformClick();
            }
        }
示例#5
0
 public static void Limpar(string[] textBoxes, string[] comboBoxes)
 {
     for (int m = 0; m < textBoxes.Count(); m++)
     {
         TxtBox it = V.txtBoxes.Find(item => item.id == textBoxes[m]);
         if (it != null)
         {
             it.txt = "";
         }
     }
     for (int m = 0; m < comboBoxes.Count(); m++)
     {
         CmbBox it = V.comboBoxes.Find(item => item.id == comboBoxes[m]);
         if (it != null)
         {
             it.valor      = it.valores[0];
             it.valorIndex = 0;
         }
     }
 }
        private void ComponentGroup(Control ctr)
        {
            #region Button

            if (ctr is Button)
            {
                Btn btn = new Btn((Button)ctr);

                byte[] btnPara = btn.ParaToByte();
                btnByteList.Add(btnPara);
                strSendByte += ByteHelper.ByteToString(btnPara);
            }
            #endregion

            #region textBox
            if (ctr is TextBox)
            {
                TxtBox txtBox = new TxtBox((TextBox)ctr);

                textByteList.Add(txtBox.ParaToByte());
                strSendByte += ByteHelper.ByteToString(textPara);
            }
            #endregion
        }
示例#7
0
        private void Convert(string FileName)
        {
            ushort[,] ClientMap = new ushort[3072, 3072];
            ushort[] TmpUnpack = new ushort[128 * 128];

            string ShortName = Path.GetFileNameWithoutExtension(FileName);

            FileStream   MapFile = File.OpenRead(FileName);
            BinaryReader Br      = new BinaryReader(MapFile);

            TxtBox.AppendText("Unpacking Map...");

            long Index1, Index2;
            int  Num = 0;

            for (int NumY = 0; NumY < 24; NumY++)
            {
                for (int NumX = 0; NumX < 24; NumX++)
                {
                    Index1 = Num * 4;
                    MapFile.Seek(Index1, SeekOrigin.Begin);
                    Index2 = MapFile.Position + Br.ReadUInt32();
                    MapFile.Seek(Index2, SeekOrigin.Begin);
                    Decomp(Br, TmpUnpack);
                    Num++;

                    uint TmpIdx = 0;
                    for (int y = 0; y < 128; y++)
                    {
                        for (int x = 0; x < 128; x++)
                        {
                            ClientMap[NumX << 7 + x, NumY << 7 + y] = TmpUnpack[TmpIdx];
                            TmpIdx++;
                        }
                    }
                }
            }

            ushort[] MapId = new ushort[8192];
            for (int i = 0; i < 8192; i++)
            {
                MapId[i] = 0;
            }

            for (int j = 0; j < 3072; j++)
            {
                for (int i = 0; i < 3072; i++)
                {
                    MapId[ClientMap[i, j]]++;
                }
            }

            int IdCount = 0;

            for (int i = 0; i < 8192; i++)
            {
                if (MapId[i] > 0)
                {
                    IdCount++;
                }
            }

            TxtBox.AppendText("There is " + IdCount + " Unique Id on that map.");

            TxtBox.AppendText("Computing .dat");
            ComputeMultiDat(ShortName, ClientMap);

            TxtBox.AppendText("GZip Compress....");

            FileStream Fs = new FileStream(ShortName + ".zlb", FileMode.Create, FileAccess.Write);

            using (GZipStream gzStream = new GZipStream(Fs, CompressionMode.Compress))
            {
                BinaryWriter Bw = new BinaryWriter(gzStream);
                for (int j = 0; j < 3072; j++)
                {
                    for (int i = 0; i < 3072; i++)
                    {
                        Bw.Write(ClientMap[i, j]);
                    }
                }
            }
            TxtBox.AppendText("Zlb Map Saved....");
        }
        public void Search()
        {
            string mode = string.Empty;

            Control[] ctlmode = this.TopLevelControl.Controls.Find("cboMode", true);
            if (ctlmode.Length > 0)
            {
                Control cbo = this.TopLevelControl.Controls.Find("cboMode", true)[0];
                mode = cbo.Text;
            }
            Control[] ctrlArr = this.TopLevelControl.Controls.Find("BtnF9", true);
            if (DepandOnMode == false || (DepandOnMode == true && mode != "新規"))
            {
                MultiPorposeSearch msearch = new MultiPorposeSearch();


                switch (this.SearchType)
                {
                case Entity.SearchType.ScType.Souko:

                    SoukoSearch soukoSearch = new SoukoSearch();
                    soukoSearch.ShowDialog();
                    CD = soukoSearch.soukoCD;
                    //CDate = soukoSearch.soukoName;
                    break;

                case Entity.SearchType.ScType.Staff:
                    StaffSearch staffSearch = new StaffSearch();
                    staffSearch.changeDate_Access = ChangeDate.Text;
                    staffSearch.ShowDialog();
                    CD    = staffSearch.staffCD;
                    CDate = staffSearch.changeDate;
                    name  = staffSearch.staffName;
                    break;

                case Entity.SearchType.ScType.Denpyou:
                    DenpyouNoSearch denpyouSearch = new DenpyouNoSearch();
                    denpyouSearch.ShowDialog();
                    //Combo.SelectedIndex = Convert.ToInt32(denpyouSearch.renban);
                    if (!string.IsNullOrWhiteSpace(denpyouSearch.renban))    // ktp no 181
                    {
                        Combo.SelectedValue = denpyouSearch.renban;
                        if (this.Name == "txtSEQNO")
                        {
                            TxtBox.Text = denpyouSearch.prefix;
                            TxtBox.Focus();
                            CD = denpyouSearch.seqno;
                        }
                        else
                        {
                            TxtBox.Text = denpyouSearch.seqno;
                            CD          = denpyouSearch.prefix;
                        }
                    }
                    break;

                case Entity.SearchType.ScType.Siiresaki:
                    SiiresakiSearch siiresakiSearch = new SiiresakiSearch();
                    siiresakiSearch.Date_Access_Siiresaki = ChangeDate.Text;
                    siiresakiSearch.ShowDialog();
                    CD    = siiresakiSearch.SiiresakiCD;
                    CDate = siiresakiSearch.changeDate;
                    break;

                case Entity.SearchType.ScType.Tokuisaki:
                    TokuisakiSearch tokuisakiSearch = new TokuisakiSearch();
                    tokuisakiSearch.Date_Access_Tokuisaki = ChangeDate.Text;
                    tokuisakiSearch.ShowDialog();
                    CD    = tokuisakiSearch.Tokuisaki;
                    CDate = tokuisakiSearch.ChangeDate;
                    name  = tokuisakiSearch.TokuisakiRyakuName;
                    break;

                case Entity.SearchType.ScType.multiporpose:
                    msearch.Access_Type = string.Empty;
                    msearch.ShowDialog();
                    if (this.Name == "txtID" || this.Name == "txtCopyID")
                    {
                        CD = msearch.Id;
                    }
                    else
                    {
                        CD = msearch.Key;
                    }
                    if (CDate != null)
                    {
                        CDate = msearch.Key;
                    }
                    if (lblName != null)
                    {
                        name = msearch.Char1;
                    }
                    break;

                case Entity.SearchType.ScType.Brand:
                    msearch.Access_Type = "103";
                    msearch.ShowDialog();
                    if (this.Name == "txtID" || this.Name == "txtCopyID")
                    {
                        CD = msearch.Id;
                    }
                    else
                    {
                        CD = msearch.Key;
                    }
                    if (CDate != null)
                    {
                        CDate = msearch.Key;
                    }
                    if (lblName != null)
                    {
                        name = msearch.Char1;
                    }
                    break;

                case Entity.SearchType.ScType.Partition:
                    msearch.Access_Type = "101";
                    msearch.ShowDialog();
                    if (this.Name == "txtID" || this.Name == "txtCopyID")
                    {
                        CD = msearch.Id;
                    }
                    else
                    {
                        CD = msearch.Key;
                    }
                    if (CDate != null)
                    {
                        CDate = msearch.Key;
                    }
                    if (lblName != null)
                    {
                        name = msearch.Char1;
                    }
                    break;

                case Entity.SearchType.ScType.Tani:
                    msearch.Access_Type = "102";
                    msearch.ShowDialog();
                    if (this.Name == "txtID" || this.Name == "txtCopyID")
                    {
                        CD = msearch.Id;
                    }
                    else
                    {
                        CD = msearch.Key;
                    }
                    if (CDate != null)
                    {
                        CDate = msearch.Key;
                    }
                    if (lblName != null)
                    {
                        name = msearch.Char1;
                    }
                    break;

                case Entity.SearchType.ScType.Color:
                    msearch.Access_Type = "104";
                    msearch.ShowDialog();
                    if (this.Name == "txtID" || this.Name == "txtCopyID")
                    {
                        CD = msearch.Id;
                    }
                    else
                    {
                        CD = msearch.Key;
                    }
                    if (CDate != null)
                    {
                        CDate = msearch.Key;
                    }
                    if (lblName != null)
                    {
                        name = msearch.Char1;
                    }
                    break;

                case Entity.SearchType.ScType.Size:
                    msearch.Access_Type = "105";
                    msearch.ShowDialog();
                    if (this.Name == "txtID" || this.Name == "txtCopyID")
                    {
                        CD = msearch.Id;
                    }
                    else
                    {
                        CD = msearch.Key;
                    }
                    if (CDate != null)
                    {
                        CDate = msearch.Key;
                    }
                    if (lblName != null)
                    {
                        name = msearch.Char1;
                    }
                    break;

                case Entity.SearchType.ScType.FileImport:
                    if (this.Name == "txtImportFolder")
                    {
                        using (OpenFileDialog openFileDialog = new OpenFileDialog())
                        {
                            openFileDialog.InitialDirectory = "C:\\Excel\\";
                            openFileDialog.Title            = "Browse CSV Files";
                            openFileDialog.Filter           = "csv files (*.csv)|*.csv";
                            openFileDialog.FilterIndex      = 2;
                            openFileDialog.RestoreDirectory = true;
                            openFileDialog.ShowDialog();

                            //CD = openFileDialog.InitialDirectory;
                            if (!string.IsNullOrEmpty(openFileDialog.FileName))
                            {
                                CD = openFileDialog.FileName.Remove(openFileDialog.FileName.LastIndexOf("\\") + 1);
                            }
                        }
                    }
                    else if (this.Name == "txtImportFileName")
                    {
                        using (OpenFileDialog openFileDialog = new OpenFileDialog())
                        {
                            if (!string.IsNullOrEmpty(TxtBox.Text) && Directory.Exists(TxtBox.Text))
                            {
                                openFileDialog.InitialDirectory = TxtBox.Text;
                            }
                            else
                            {
                                openFileDialog.InitialDirectory = "C:\\";
                            }
                            openFileDialog.Title            = "Browse CSV Files";
                            openFileDialog.Filter           = "csv files (*.csv)|*.csv";
                            openFileDialog.FilterIndex      = 2;
                            openFileDialog.RestoreDirectory = true;
                            openFileDialog.ShowDialog();

                            if (!string.IsNullOrEmpty(openFileDialog.FileName))
                            {
                                CD = openFileDialog.SafeFileName;
                            }
                        }
                    }
                    break;

                case Entity.SearchType.ScType.TaxRate:
                    msearch.Access_Type = "221";
                    msearch.ShowDialog();
                    if (this.Name == "txtID" || this.Name == "txtCopyID")
                    {
                        CD = msearch.Id;
                    }
                    else
                    {
                        CD = msearch.Key;
                    }
                    if (CDate != null)
                    {
                        CDate = msearch.Key;
                    }
                    if (lblName != null)
                    {
                        name = msearch.Char1;
                    }
                    break;

                case Entity.SearchType.ScType.Evaluation:
                    msearch.Access_Type = "106";
                    msearch.ShowDialog();
                    if (this.Name == "txtID" || this.Name == "txtCopyID")
                    {
                        CD = msearch.Id;
                    }
                    else
                    {
                        CD = msearch.Key;
                    }
                    if (CDate != null)
                    {
                        CDate = msearch.Key;
                    }
                    if (lblName != null)
                    {
                        name = msearch.Char1;
                    }
                    break;

                case Entity.SearchType.ScType.Management:
                    msearch.Access_Type = "107";
                    msearch.ShowDialog();
                    if (this.Name == "txtID" || this.Name == "txtCopyID")
                    {
                        CD = msearch.Id;
                    }
                    else
                    {
                        CD = msearch.Key;
                    }
                    if (CDate != null)
                    {
                        CDate = msearch.Key;
                    }
                    if (lblName != null)
                    {
                        name = msearch.Char1;
                    }
                    break;

                case Entity.SearchType.ScType.Kubun:
                    msearch.Access_Type = "109";
                    msearch.ShowDialog();
                    if (this.Name == "txtID" || this.Name == "txtCopyID")
                    {
                        CD = msearch.Id;
                    }
                    else
                    {
                        CD = msearch.Key;
                    }
                    if (CDate != null)
                    {
                        CDate = msearch.Key;
                    }
                    if (lblName != null)
                    {
                        name = msearch.Char1;
                    }
                    break;

                case Entity.SearchType.ScType.Kouriten:
                    KouritenSearch kSearch = new KouritenSearch();
                    kSearch.Date_Access_Kouriten = ChangeDate.Text;
                    if (this.TxtBox != null)
                    {
                        kSearch.tokuisakiCD = TxtBox.Text;
                    }
                    kSearch.ShowDialog();
                    CD    = kSearch.KouritenCD;
                    CDate = kSearch.changeDate;
                    name  = kSearch.KouritenRyakuName;
                    break;

                case Entity.SearchType.ScType.ShippingNO:
                    ShippingNoSearch snSearch = new ShippingNoSearch();
                    snSearch.ShowDialog();
                    CD = snSearch.ShippingNo;
                    break;

                case Entity.SearchType.ScType.Shouhin:
                    Shouhin_Search shsearch = new Shouhin_Search();
                    shsearch.parent_changeDate = ChangeDate.Text;
                    shsearch.ShowDialog();
                    //if(this.Name == "txtCopyProduct")
                    //{
                    //    //CD = shsearch.shouhinCD;
                    //    CD = shsearch.hinbanCD;
                    //    TxtBox.Text = shsearch.colorNO;
                    //    TxtBox.Focus();
                    //}
                    //else
                    //{
                    //CD = shsearch.shouhinCD;ses
                    CD      = shsearch.hinbanCD;
                    colorNO = shsearch.colorNO;
                    name    = shsearch.colorName;
                    sizeNO  = shsearch.sizeNO;
                    colName = shsearch.sizeName;
                    CDate   = shsearch.changeDate;
                    //}
                    break;

                case Entity.SearchType.ScType.ArrivalNo:
                    ArrivalNOSearch search = new ArrivalNOSearch();
                    search.ShowDialog();
                    CD = search.ChakuniNO;
                    break;

                case Entity.SearchType.ScType.ChakuniYoteiNyuuryoku:
                    ChakuniYoteiNyuuryokuSearch cysearch = new ChakuniYoteiNyuuryokuSearch();
                    cysearch.ShowDialog();
                    CD = cysearch.ChakuniYoteiNO;
                    break;

                case Entity.SearchType.ScType.JuchuuNo:
                    JuchuuNyuuryokuSearch obj_search = new JuchuuNyuuryokuSearch();
                    obj_search.ShowDialog();
                    CD = obj_search.JuchuuNo;
                    break;

                case Entity.SearchType.ScType.ShukkaNo:
                    ShukkaNoSearch shukkaNoSearch = new ShukkaNoSearch();
                    shukkaNoSearch.ShowDialog();
                    CD = shukkaNoSearch.ShukkaNo;
                    break;

                case Entity.SearchType.ScType.IdouNyuuryoku:
                    IdouNyuuryokuSearch idou_search = new IdouNyuuryokuSearch();
                    idou_search.ShowDialog();
                    CD = idou_search.IdouNo;
                    break;

                case Entity.SearchType.ScType.HacchuuNyuuryoku:
                    HacchuuNyuuryokuSearch hacc_search = new HacchuuNyuuryokuSearch();
                    hacc_search.ShowDialog();
                    CD = hacc_search.HacchuuNo;
                    break;
                }

                if (!string.IsNullOrWhiteSpace(CD))
                {
                    this.Text = CD;

                    if (lblName != null)
                    {
                        lblName.Text = name;
                    }

                    if (this.Parent.Name.Equals("PanelTitle"))
                    {
                        if (TxtBox != null && TxtBox1 != null)
                        {
                            TxtBox.Text   = colorNO;
                            lblName.Text  = name;
                            TxtBox1.Text  = sizeNO;
                            lblName1.Text = colName;
                        }
                        if (ChangeDate != null)
                        {
                            ChangeDate.Text = CDate;
                            ChangeDate.Focus();
                        }
                        SendKeys.Send("{ENTER}");
                    }
                    else
                    {
                        SendKeys.Send("{ENTER}");
                    }
                }

                CD = string.Empty;            // For enter case to show search screen


                ////for combo box
                //if (Combo != null)
                //{
                //    ChangeDate.Text = CDate;
                //    //SendKeys.Send("{ENTER}");
                //}
                ////for textbox
                //if (lblName != null)
                //{
                //    lblName.Text = name;
                //    //SendKeys.Send("{ENTER}");
                //}
                //else if (ChangeDate != null)
                //{
                //    if (ChangeDate.Name == this.NextControlName)
                //        ChangeDate.Text = CDate;
                //    if (string.IsNullOrEmpty(this.Text))
                //    {
                //        this.Focus();
                //    }
                //    else
                //    {
                //        //comment 2020-12-28
                //        //ChangeDate.Focus();
                //        //SendKeys.Send("{ENTER}");
                //        //add 2020-12-28
                //        //CD and change date is not located(top,down) in form design
                //        if (this.NextControlName != ChangeDate.Name)
                //        {
                //            this.Focus();
                //        }
                //        else
                //        {
                //            ChangeDate.Focus();
                //        }
                //        SendKeys.Send("{ENTER}");
                //    }
                //}
                //else
                //{
                //    if(this.Text=="")
                //    {
                //        this.Focus();
                //    }
                //    else
                //    {
                //        Control control = this.TopLevelControl.Controls.Find(this.NextControlName, true)[0];
                //        control.Focus();
                //    }
                //}
            }
        }
示例#9
0
        public static void TextArea(string id, string txt, float x, float y, float width, float height, byte r, byte g, byte b, float op)
        {
            string barra_ = barra;

            if (MouseIn(x, y, width, height))
            {
                Cursor(0, 0, 0.5f);
                if (V.mouseButton == "Left")
                {
                    Configuracoes.textBoxId = id;
                }
            }

            DesenharShape(x, y, width, height, r, g, b, op, 185, 185, 185, 255, 1);

            TxtBox it = V.txtBoxes.Find(item => item.id == id);

            if (it == null)
            {
                V.txtBoxes.Add(new TxtBox(id, txt));
            }

            else
            {
                if (id == Configuracoes.textBoxId)
                {
                    if (Key("backspace") && !TeclaDesativada("backspace") && it.txt.Length > 0)
                    {
                        it.txt = it.txt.Substring(0, it.txt.Length - 1);
                        DesativarTecla("backspace", 100);
                    }
                    else if (TxtWidth(it.txt + V.textEntered, 24, false) < width * (height / 25))
                    {
                        it.txt += V.textEntered;
                    }

                    V.textEntered = "";
                }
                else
                {
                    barra_ = "";
                }

                float o         = 0;
                float sumHeight = 0;
                int   br        = 0;

                int n = it.txt.Length;
                for (int m = 0; m < n; m++)
                {
                    o = TxtWidth(it.txt.Substring(br, (m + 1) - br), 24, false);

                    if (o >= width)
                    {
                        o  = 0;
                        br = m;
                        sumHeight++;
                    }

                    barra_ = (m != n - 1 || id != Configuracoes.textBoxId) ? "" : barra;
                    Escrever(it.txt.Substring(br, (m + 1) - br) + barra_, false, x + 2, y - 5 + (25 * sumHeight), 24, 000, 000, 000, 255);
                }
                if (n == 0)
                {
                    Escrever(barra_, false, x + 2, y - 5 + (25 * sumHeight), 24, 000, 000, 000, 255);
                }
            }
        }
示例#10
0
        public static void TextBox(string id, string filtro, string txt, float x, float y, float width, float height, byte r, byte g, byte b, float op)
        {
            string barra_ = barra;

            if (MouseIn(x, y, width, height))
            {
                Cursor(0, 0, 0.5f);
                if (V.mouseButton == "Left")
                {
                    Configuracoes.textBoxId = id;
                }
            }

            TxtBox it = V.txtBoxes.Find(item => item.id == id);

            if (it == null)
            {
                V.txtBoxes.Add(new TxtBox(id, txt));
            }

            else
            {
                if (id == Configuracoes.textBoxId)
                {
                    if (Key("backspace") && !TeclaDesativada("backspace") && it.txt.Length > 0)
                    {
                        it.txt = it.txt.Substring(0, it.txt.Length - 1);
                        DesativarTecla("backspace", 100);
                    }
                    else
                    {
                        if (filtro == "Numeros")
                        {
                            Regex word = new Regex(@"^[0-9]*$");
                            Match m    = word.Match(V.textEntered);
                            it.txt += m;
                        }
                        else
                        {
                            it.txt += V.textEntered;
                        }
                    }


                    V.textEntered = "";
                }
                else
                {
                    barra_ = "";
                }

                View txtBoxView = new View(new FloatRect(0, 0, width, height));
                txtBoxView.Viewport = new FloatRect(x / Screen.width, y / Screen.height, width / Screen.width, height / Screen.height);

                if (TxtWidth(it.txt, 24, false) > width)
                {
                    txtBoxView.Move(new Vector2f(TxtWidth(it.txt, 24, false) - width + 5, 0));
                }

                V.window.SetView(txtBoxView);

                float  addTxtWidth;
                string textBoxValue;

                textBoxValue = filtro == "password" ? new Regex(".").Replace(it.txt, "*") : it.txt;
                addTxtWidth  = TxtWidth(textBoxValue, 24, false) > width?TxtWidth(textBoxValue, 24, false) - width : 0;

                DesenharShape(0, 0, width + addTxtWidth + 5, height, r, g, b, op, 185, 185, 185, 255, 1);
                Escrever(textBoxValue + barra_, false, 2, -5, 24, 000, 000, 000, 255);
            }

            V.window.SetView(V.view);
        }
示例#11
0
        private async void Timer_counter(object sender, EventArgs e)
        {
            TxtBox.Text += await GetDataAsync();

            TxtBox.ScrollToEnd();
        }