private void StrList_SelectedIndexChanged(object sender, EventArgs e) { if (ZModoDianmico.Checked && StrList.SelectedIndex >= 0) { Index = StrList.SelectedIndex; TLBox.Focus(); } ZContinue.Enabled = Index != StrList.Items.Count - 1; ZReturn.Enabled = Index > 0; }
private void Sroll_ValueChanged(object sender, EventArgs e) { //Update TextCursor ~ Force the cursor jump to end of the text if the scroll value is the max int i = 0; while (i < TLBox.Text.Length && Engine.TextWidth(TLBox.Text.Substring(0, i++), TLBox.Font) < Scroll.Value) { continue; } int ni = 0; while (ni < TLBox.Text.Length && Engine.TextWidth(TLBox.Text.Substring(0, ni++), TLBox.Font) < Scroll.Value + Scroll.LargeChange) { continue; } if (ni == TLBox.Text.Length) { i = ni; } TLBox.Select(i, 0); TLBox.Focus(); }
internal StyleProgram() { InitializeComponent(); #region SpeelTextBox //Create TLBox TLBox = new SpellTextBox(); ZSKN.Controls.Add(TLBox); TLBox.Anchor = ((AnchorStyles.Bottom | AnchorStyles.Left) | AnchorStyles.Right); TLBox.BorderStyle = BorderStyle.None; TLBox.Location = new System.Drawing.Point(13, 296); TLBox.Name = "TLBox"; TLBox.Size = new System.Drawing.Size(620, 20); TLBox.TabIndex = 13; TLBox.Visible = true; TLBox.Enabled = false; TLBox.Multiline = false; TLBox.BringToFront(); //Initialize Events Engine.Append(ref TLBox.TextChanged, TLBox_TextChanged); TLBox.KeyDown += new KeyEventHandler(TLBox_KeyDown); TLBox.Anchor = ((AnchorStyles.Bottom | AnchorStyles.Left) | AnchorStyles.Right); ZTextBox.GotFocus += (sender, e) => { TLBox.Focus(); }; #endregion #region RadioToolStrip //Initialize RadioToolStrip Engine ToolStripMenuItem[] BackupItems = new ToolStripMenuItem[] { ZAoSalvar, Z200Dialogos, Z100Dialogos, Z50Dialogos, Z25Dialogos, Z10Dialogos, ZNunca }; RadioEngine = new Engine.RadioToolStrip(ref BackupItems, 2); ToolStripMenuItem[] ThemeItems = new ToolStripMenuItem[] { ZBasico, ZModerno }; ThemeEngine = new Engine.RadioToolStrip(ref ThemeItems, 1); ThemeEngine.CheckedChange += ChangeTheme; ToolStripMenuItem[] TLCLients = new ToolStripMenuItem[] { ZLEC, ZGoogle, ZBing }; TLEngine = new Engine.RadioToolStrip(ref TLCLients, 1); TLEngine.CheckedChange += TLEngine_CheckedChange; ToolStripMenuItem[] SelItems = new ToolStripMenuItem[] { ZAutoSelMode, ZAsianSel, ZLatimSel }; SelEngine = new Engine.RadioToolStrip(ref SelItems, 0); SelEngine.CheckedChange += SelEngine_CheckedChange; //Initialize DeleyedMouseOver Event OVE = new Engine.OverTimerEvent() { sender = StrList }; OVE.MouseStopOver += StrList_MouseStopOver; OVE.Initialize(); #endregion //Set File Filter OpenScript.Filter = Engine.Filter; SaveScript.Filter = Engine.Filter; //Initalize TLBox TLBox.Font = ZTextBox.Font; TLBox.LoadDictionary(AppDomain.CurrentDomain.BaseDirectory + "Dictionary"); TLBox.BootUP(); //Initialize Config ZVerificacao.Checked = Engine.GetConfig("VNXTLP", "SpellCheck", false).ToLower() == "true"; TLBox.SpellCheckEnable = ZVerificacao.Checked; ZValidar.Checked = Engine.GetConfig("VNXTLP", "AutoJump", false).ToLower() == "true"; ZAltaRel.Checked = Engine.GetConfig("VNXTLP", "HighFont", false).ToLower() == "true"; ZAltoContraste.Checked = Engine.GetConfig("VNXTLP", "BlackTheme", false).ToLower() == "true"; ZLimiteAvanco.Checked = Engine.GetConfig("VNXTLP", "SkipDelay", false).ToLower() == "true"; ZModoDianmico.Checked = Engine.GetConfig("VNXTLP", "DynamicMode", false).ToLower() == "true"; //get int string cfg = Engine.GetConfig("VNXTLP", "BackupSpeed", false); int Val = 0; if (int.TryParse(cfg, out Val)) { RadioEngine.SelectedIndex = Val; } //get int cfg = Engine.GetConfig("VNXTLP", "SelMode", false); if (int.TryParse(cfg, out Val)) { SelEngine.SelectedIndex = Val; } //get int cfg = Engine.GetConfig("VNXTLP", "TLClient", false); if (int.TryParse(cfg, out Val)) { TLEngine.SelectedIndex = Val; } else if (cfg == "off") { ZTLClient.Visible = false; } //Load Translation ZContinue.Text = Engine.LoadTranslation(Engine.TLID.Next); ZReturn.Text = Engine.LoadTranslation(Engine.TLID.Back); ZArquivo.Text = Engine.LoadTranslation(Engine.TLID.File); ZAbrir.Text = Engine.LoadTranslation(Engine.TLID.Open); ZSaveAsItem.Text = Engine.LoadTranslation(Engine.TLID.SaveAs); ZMinhaConta.Text = Engine.LoadTranslation(Engine.TLID.MyAccount); ZSelecao.Text = Engine.LoadTranslation(Engine.TLID.Selection); ZSelecionarTodos.Text = Engine.LoadTranslation(Engine.TLID.SelectAll); ZDesselecionarTodos.Text = Engine.LoadTranslation(Engine.TLID.UnselectAll); ZSelecaoAutomatica.Text = Engine.LoadTranslation(Engine.TLID.AutoSelect); ZOpcoes.Text = Engine.LoadTranslation(Engine.TLID.Options); ZTema.Text = Engine.LoadTranslation(Engine.TLID.Theme); ZBasico.Text = Engine.LoadTranslation(Engine.TLID.Basic); ZModerno.Text = Engine.LoadTranslation(Engine.TLID.Modern); ZPeriodo.Text = Engine.LoadTranslation(Engine.TLID.BackupFrequence); ZAoSalvar.Text = Engine.LoadTranslation(Engine.TLID.OnSave); Z50Dialogos.Text = Engine.LoadTranslation(Engine.TLID.BackOn50); Z25Dialogos.Text = Engine.LoadTranslation(Engine.TLID.BackOn25); Z10Dialogos.Text = Engine.LoadTranslation(Engine.TLID.BackOn10); ZNunca.Text = Engine.LoadTranslation(Engine.TLID.Never); ZVerificacao.Text = Engine.LoadTranslation(Engine.TLID.SpellChecking); ZValidar.Text = Engine.LoadTranslation(Engine.TLID.ValidateIndex); OpenScript.Title = Engine.LoadTranslation(Engine.TLID.SelectAScript); SaveScript.Title = Engine.LoadTranslation(Engine.TLID.SelectAScript); ZPesquisa.Text = Engine.LoadTranslation(Engine.TLID.SearchOrReplace); ZTLClient.Text = Engine.LoadTranslation(Engine.TLID.TranslationSystem); ZLEC.Text = Engine.LoadTranslation(Engine.TLID.LEC); ZGoogle.Text = Engine.LoadTranslation(Engine.TLID.Google); ZScriptRef.Text = Engine.LoadTranslation(Engine.TLID.ReferenceScript); ZAltoContraste.Text = Engine.LoadTranslation(Engine.TLID.HighContrast); ZAltaRel.Text = Engine.LoadTranslation(Engine.TLID.HighResolution); ZSelMode.Text = Engine.LoadTranslation(Engine.TLID.SelectMode); ZAutoSelMode.Text = Engine.LoadTranslation(Engine.TLID.AutoDetect); ZAsianSel.Text = Engine.LoadTranslation(Engine.TLID.Asian); ZLatimSel.Text = Engine.LoadTranslation(Engine.TLID.Latim); ZSaveAsItem.Text = Engine.LoadTranslation(Engine.TLID.SaveAs); ZLimiteAvanco.Text = Engine.LoadTranslation(Engine.TLID.LimitSkip); ZModoDianmico.Text = Engine.LoadTranslation(Engine.TLID.DynamicMode); ZOtherOptions.Text = Engine.LoadTranslation(Engine.TLID.MoreOptions); ZSaveWindowState.Text = Engine.LoadTranslation(Engine.TLID.SaveWindowState); //Load Custom Resources from a VNXTL Build foreach (ToolStripMenuItem item in Engine.CustomResources(ref TLBox)) { ZMenu.Items.Add(item); } Engine.LoadWindowState(this); }