示例#1
0
        private void ImportButton_Click(object sender, EventArgs e)
        {
            if (this.SearchChar.Text.Length <= 0)
            {
                return;
            }
            Color  bgcolor     = GetFontColor(this.FontType.SelectedIndex == 0);
            Bitmap paletteHint = ImageUtil.ByteToImage4(16, 16, new byte[64], 0, bgcolor);
            Bitmap bitmap      = ImageUtil.LoadAndCheckPaletteUI(this
                                                                 , paletteHint
                                                                 , 2 * 8, 2 * 8);

            if (bitmap == null)
            {
                return;
            }

            //画像
            this.SelectFontBitmapByte = ImageUtil.Image4ToByte(bitmap);
            U.ForceUpdate(this.FontWidth, 9);

            //画像等データの書き込み
            WriteButton.PerformClick();
            //即検索
            SearchButton.PerformClick();
        }
示例#2
0
 private void KeywordTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SearchButton.PerformClick();
     }
 }
 private void keypressed(Object o, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         e.Handled = true;
         SearchButton.PerformClick();
     }
 }
示例#4
0
 //------------------------------------------------------------------------------------
 private void Title_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SearchButton.PerformClick();
         MovieListBox.Focus();
     }
 }
示例#5
0
 private void ObjectSearch_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SearchButton.PerformClick();
         e.SuppressKeyPress = true;
     }
 }
示例#6
0
 private void SearchBar_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         e.Handled = true;
         SearchButton.PerformClick();
     }
 }
示例#7
0
        private void FilterListBox(string search, bool avaCheck, bool favCheck)
        {
            SearchBar.Text            = search;
            AvailableCheckBox.Checked = avaCheck;
            FavouriteCheckBox.Checked = favCheck;

            SearchButton.PerformClick();
        }
示例#8
0
        void AlertTheFlowLayoutPanelSongs()
        {
            EditPanel.Visible    = false;
            SearchPanel.Visible  = true;
            SearchPanel.Location = new Point(4, 8);
            this.Size            = SearchFormSize;

            SearchButton.PerformClick();
        }
 private void SearchBox_KeyDown(object sender, KeyEventArgs e)
 {
     //if (e.KeyCode == Keys.Enter)
     //{
     //    e.Handled = true;
     //    SearchButton_Click(sender, e);
     //}
     if ((int)e.KeyCode == 13)
     {
         SearchButton.PerformClick();
     }
 }
示例#10
0
 void FindMoreClick(object sender, EventArgs e)
 {
     if (SearchOption == 1)
     {
         More = true;
         SearchButton.PerformClick();
     }
     if (SearchOption == 2)
     {
         More = true;
         RegExSearchButton.PerformClick();
     }
 }
示例#11
0
        private void ImportButton_Click(object sender, EventArgs e)
        {
            if (this.SearchChar.Text.Length <= 0)
            {
                return;
            }

            bool IsItemFont = (this.FontType.SelectedIndex == 0);
            int  w          = (int)FontWidth.Value;

            Color  bgcolor = GetFontColor(IsItemFont);
            Bitmap paletteHint;

            if (IsItemFont)
            {
                paletteHint = ImageUtil.ByteToImage4ZH(w + 1, 0xD, new byte[64], 0, bgcolor);
            }
            else
            {
                paletteHint = ImageUtil.ByteToImage4ZH(w, 0xD, new byte[64], 0, bgcolor);
            }

            Bitmap bitmap = ImageUtil.LoadAndCheckPaletteUI(this
                                                            , paletteHint
                                                            , 0, 0);

            if (bitmap == null)
            {
                return;
            }

            uint width = (uint)bitmap.Width;

            //画像
            if (IsItemFont)
            {
                this.SelectFontBitmapByte = ImageUtil.Image4ToByteZH(bitmap, (int)width + 1);
            }
            else
            {
                this.SelectFontBitmapByte = ImageUtil.Image4ToByteZH(bitmap, (int)width);
            }
            U.ForceUpdate(this.FontWidth, width);

            //画像等データの書き込み
            WriteButton.PerformClick();
            //即検索
            SearchButton.PerformClick();
        }
示例#12
0
 private void QueryForm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Control == true && e.KeyCode == Keys.S)
     {
         SearchButton.PerformClick();
     }
     if (e.Control == true && e.KeyCode == Keys.U)
     {
         updateButton.PerformClick();
     }
     if (e.Control == true && e.KeyCode == Keys.D)
     {
         displayTableButton.PerformClick();
     }
 }
示例#13
0
        private void AutoGenbutton_Click(object sender, EventArgs e)
        {//フォントの自動生成.
            string mojiText = SearchChar.Text;

            mojiText = mojiText.Trim();
            if (mojiText.Length <= 0)
            {
                return;
            }

            bool   isItemFont   = this.FontType.SelectedIndex == 0;
            bool   isSquareFont = true;
            int    font_width;
            Bitmap autogen = ImageUtil.AutoGenerateFont(mojiText, UseFontNameTextEdit.Font, isItemFont, isSquareFont, out font_width);

            if (autogen == null)
            {
                R.ShowStopError("フォントの自動生成に失敗しました。対応する日本語フォントがありません。");
                return;
            }

            DialogResult dr = R.ShowQ("フォントを自動生成しました。\r\nROMに書き込みますか?\r\n\r\n「はい」ならば、ROMに書き込みます。\r\n「いいえ」ならば、画像ファイルとして保存します。\r\n");

            if (dr == System.Windows.Forms.DialogResult.Yes)
            {
                //画像
                this.SelectFontBitmapByte = ImageUtil.Image4ToByteZH(autogen, font_width);
                U.ForceUpdate(this.FontWidth, font_width);

                //画像等データの書き込み
                WriteButton.PerformClick();
                //即検索
                SearchButton.PerformClick();
            }
            else if (dr == System.Windows.Forms.DialogResult.No)
            {
                if (this.FontType.SelectedIndex == 0)
                {
                    //アイテム
                    ImageFormRef.ExportImage(this, autogen, InputFormRef.MakeSaveImageFilename(this, "Item_" + mojiText), font_width);
                }
                else
                {
                    //セリフ
                    ImageFormRef.ExportImage(this, autogen, InputFormRef.MakeSaveImageFilename(this, "Serif_" + mojiText), font_width);
                }
            }
        }
示例#14
0
        private void AddSigButton_Click(object sender, EventArgs e)
        {
            var sigMask       = SigMaskTextBox.Text;
            var sigPattern    = SigPatternTextBox.Text;
            var sigModuleName = ModuleNameTextBox.Text;

            SigMaskTextBox.Clear();
            SigPatternTextBox.Clear();

            if (sigPattern.Length < 5 || (SigMaskTextBox.Enabled && sigMask.Length < 5))
            {
                Logger.ShowError("Pattern or mask is too small");
                return;
            }

            var sigListObj = _sigList.FirstOrDefault(x => string.Compare(x.Pattern, sigPattern, StringComparison.OrdinalIgnoreCase) == 0);

            if (sigListObj != null)
            {
                if (sigListObj.Offsets.Keys.Contains(sigModuleName))
                {
                    Logger.ShowError("Sig with this pattern already exists for this module");
                    return;
                }

                //sigListObj.Offsets.Add(sigModuleName, new List<IntPtr>());
            }
            else
            {
                var sigInfo = new Signature(sigModuleName, sigPattern, sigMask);
                if (!sigInfo.IsValid())
                {
                    return;
                }

                //sigInfo.Offsets.Add(sigModuleName, new List<IntPtr>());

                _sigList.Add(sigInfo);
            }

            this.UpdateTreeView();

            if (InstantSearchCheckBox.Checked)
            {
                SearchButton.PerformClick();
            }
        }
示例#15
0
        private void FavouritePictureBox_Click(object sender, EventArgs e)
        {
            if (CocktailsListBox.SelectedItems.Count > 0)
            {
                Favourite = !Favourite;

                var select = CocktailsListBox.SelectedValue;

                DataAccess.FavouriteCocktail(select.ToString(), Favourite);

                SearchButton.PerformClick();

                if (FavouriteCheckBox.Checked)
                {
                    ClearTextBoxes();
                }
                else
                {
                    CocktailsListBox.SelectedValue = select;
                }

                SwitchFavouriteImage();
            }
        }
示例#16
0
        private void Form1_Load(object sender, EventArgs e)
        {
            InitializeSettings();

            ToolTip.SetToolTip(this.RSearch, "Search for a random element.");
            ToolTip.SetToolTip(this.SearchButton, "Search for a element.");
            ToolTip.SetToolTip(this.pBox, "Image for element " + elementString.ToUpper() + ".");
            ToolTip.SetToolTip(this.AtomicTreeView, "Atomic tree-view.");

            this.FormClosing += delegate
            {
                try
                {
                    if (!File.Exists("log.element"))
                    {
                        File.Create("log.element");
                    }

                    if (Logger.GetLogData() != null)
                    {
                        using (StreamWriter sr = new StreamWriter("log.element"))
                        {
                            sr.WriteLine(("=============== " + DateTime.Now + " ===============").PadRight(20));
                            foreach (string l in Logger.GetLogData().Split(new char[] { '\n' }))
                            {
                                sr.WriteLine(l);
                            }

                            sr.Close();
                        }
                    }
                }
                catch
                {
                    return;
                }
            };

            foreach (Control c in this.groupBox2.Controls.OfType <Label>())
            {
                if (c.Name.Contains("Label"))
                {
                    c.Visible = false;
                }
            }

            foreach (Control c in this.groupBox1.Controls.OfType <RadioButton>())
            {
                RadioButton cb = c as RadioButton;
                cb.CheckedChanged += (object s, EventArgs args) =>
                {
                    if (this.numberCB.Checked)
                    {
                        SearchByName = false;
                    }
                    else
                    {
                        SearchByName = true;
                    }
                };
            }

            this.IsotopesButton.Enabled = false;

            this.BGWorker.ProgressChanged += (object sndr, ProgressChangedEventArgs args) =>
            {
                this.pBar.Value       = args.ProgressPercentage;
                this.StatusLabel.Text = (string)args.UserState;
            };

            // TOOLSTRIP MENU ITEMS

            this.aboutGuilhermeAlmeidaToolStripMenuItem.Click += delegate
            {
                // abriria um site se eu tivesse um, haha... triste vida
                MessageBox.Show("Hi, I'm Guilherme, most people just go by 'Gui' so... go the way you wish.\nI am the guy who spent 2 days developing this program using C# and a Web Scraper.", "Hello, Olá", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
            };

            this.fontToolStripMenuItem.Click += delegate
            {
                FontDialog f = new FontDialog();
                if (f.ShowDialog() != DialogResult.Cancel && f.Font.Size < 15)
                {
                    foreach (Control ctrl in this.Controls)
                    {
                        ctrl.Font = f.Font;
                    }

                    foreach (Control ctrl in this.groupBox1.Controls)
                    {
                        ctrl.Font = f.Font;
                    }

                    foreach (Control ctrl in this.groupBox2.Controls)
                    {
                        ctrl.Font = f.Font;
                    }
                }

                Logger.LogData("Changed current font to " + Font.Name);
                Scrapper.Properties.Settings.Default.font_custom = f.Font;
            };

            this.colorToolStripMenuItem.Click += delegate
            {
                ColorDialog c = new ColorDialog();
                if (c.ShowDialog() != DialogResult.Cancel)
                {
                    foreach (Control ctrl in this.Controls)
                    {
                        ctrl.ForeColor = c.Color;
                    }

                    foreach (Control ctrl in this.groupBox1.Controls)
                    {
                        ctrl.ForeColor = c.Color;
                    }

                    foreach (Control ctrl in this.groupBox2.Controls)
                    {
                        ctrl.ForeColor = c.Color;
                    }
                }

                Logger.LogData("Changed current color to to " + c.Color.ToArgb().ToString());
                Scrapper.Properties.Settings.Default.color_custom = c.Color;
            };

            this.saveToolStripMenuItem.Click += delegate
            {
                Scrapper.Properties.Settings.Default.Save();
                this.StatusLabel.Text = "Settings Saved";
                Logger.LogData("Settings Saved.");
            };

            this.resetToolStripMenuItem.Click += delegate
            {
                Scrapper.Properties.Settings.Default.color_custom  = Scrapper.Properties.Settings.Default.color_default;
                Scrapper.Properties.Settings.Default.font_custom   = Scrapper.Properties.Settings.Default.font_default_normal;
                Scrapper.Properties.Settings.Default.server_custom = Scrapper.Properties.Settings.Default.server_default;

                Scrapper.Properties.Settings.Default.Save();
                ResetUI();

                Logger.LogData("Setting Reset");
                this.StatusLabel.Text = "Settings Reset";
            };

            TBSearch.KeyDown += (object a, KeyEventArgs b) =>
            {
                if (b.KeyCode == Keys.Enter)
                {
                    SearchButton.PerformClick();
                }
            };

            TBSearch.LostFocus += (object a, EventArgs b) =>
            {
                TBSearch.Focus();
            };

            this.logToolStripMenuItem.Click += delegate
            {
                MessageBox.Show(Logger.GetLogData());
            };

            this.serverToolStripMenuItem.Click += delegate
            {
                ChangeServerForm svr = new ChangeServerForm();
                svr.ShowDialog();

                if (svr.serverResultString == "Invalid Server")
                {
                    return;
                }
            };

            this.getVariablesToolStripMenuItem.Click += delegate
            {
                string vars = "";

                foreach (System.Configuration.SettingsProperty p in Scrapper.Properties.Settings.Default.Properties)
                {
                    vars += string.Format("{0} = {1}**", p.Name, p.DefaultValue);
                }

                MessageBox.Show(vars.Replace("**", "\n"));
            };

            this.getVariablesToolStripMenuItem.Click += (object a, EventArgs b) =>
            {
            };
        }
示例#17
0
 private void FindElementTSMI_Click(object sender, EventArgs e)
 {
     SearchButton.PerformClick();
 }
示例#18
0
 private void LaderTypeGridView_DoubleClick(object sender, EventArgs e)
 {
     SearchButton.PerformClick();
 }
示例#19
0
 private void PlateCityGridView_DoubleClick(object sender, EventArgs e)
 {
     SearchButton.PerformClick();
 }