/// <summary> /// On load, we update the controls. /// </summary> /// <param name="e"></param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (this.DesignMode) { return; } // Force an update tsddbPlans.DropDownItems.Add("<New Plan>"); // Compatibility mode : Mac OS if (Settings.Compatibility == CompatibilityMode.Wine) { // Under Wine, the upper toolbar is not displayed // We move it at the top of the first tab this.Controls.Remove(this.upperToolStrip); this.tabControl.TabPages[0].Controls.Add(this.upperToolStrip); this.tabControl.TabPages[0].Controls.SetChildIndex(this.upperToolStrip, 0); } // Show the hint tip TipWindow.ShowTip(this, "planner", "Welcome to the Skill Planner", "Select skills to add to your plan using the list on the left. To " + "view the list of skills you've added to your plan, choose " + "\"View Plan\" from the dropdown in the upper left."); UpdateStatusBar(); }
private void OnMouseHover(object sender, System.EventArgs e) { if (tipWindow != null) { tipWindow.Close(); } if (settings.GetSetting("Gui.ResultTabs.ErrorsTab.ToolTipsEnabled", false) && hoverIndex >= 0 && hoverIndex < detailList.Items.Count) { Graphics g = Graphics.FromHwnd(detailList.Handle); Rectangle itemRect = detailList.GetItemRectangle(hoverIndex); string text = detailList.Items[hoverIndex].ToString(); SizeF sizeNeeded = g.MeasureString(text, detailList.Font); bool expansionNeeded = itemRect.Width < (int)sizeNeeded.Width || itemRect.Height < (int)sizeNeeded.Height; if (expansionNeeded) { tipWindow = new TipWindow(detailList, hoverIndex); tipWindow.ItemBounds = itemRect; tipWindow.TipText = text; tipWindow.Expansion = TipWindow.ExpansionStyle.Both; tipWindow.Overlay = true; tipWindow.WantClicks = true; tipWindow.Closed += new EventHandler(tipWindow_Closed); tipWindow.Show(); } } }
/// <summary> /// Updates the plan controls. /// </summary> private void UpdatePlanControls() { // Set the upper toolstrip visibility upperToolStrip.Visible = m_plan != null; // Update the status bar UpdateStatusBar(); if (m_plan != null) { if (!tabControl.TabPages.Contains(tpPlanEditor)) { tabControl.TabPages.Insert(0, tpPlanEditor); } // Show the hint tip TipWindow.ShowTip(this, "planner", "Welcome to the Skill Planner", "Select skills to add to your plan using the list on the left." + " To view the list of skills you've added to your plan," + " choose \"Select Plan\" from the drop down in the upper left."); return; } // If we got this far we want to show the plan window as a Data Browser // Remove the Plan Editor if it exists if (tabControl.TabPages.Contains(tpPlanEditor)) { tabControl.TabPages.Remove(tpPlanEditor); } Text = $"{(m_character == null ? string.Empty : $"{m_character.Name} - ")}EVEMon Data Browser";
/// <summary> /// Autonomously updates the status bar with the plan's training time. /// </summary> public void UpdateStatusBar() { // Training time TimeSpan totalTime = planEditor.DisplayPlan.GetTotalTime(null, true); slblStatusText.Text = String.Format("{0} Skill{1} Planned ({2} Unique Skill{3}). Total training time: {4}. ", m_plan.Count, m_plan.Count == 1 ? "" : "s", m_plan.UniqueSkillsCount, m_plan.UniqueSkillsCount == 1 ? "" : "s", Skill.TimeSpanToDescriptiveText(totalTime, DescriptiveTextOptions.IncludeCommas)); // Books cost long totalcost = m_plan.TotalBooksCost; long cost = m_plan.NotKnownSkillBooksCost; if (totalcost > 0) { slblStatusText.Text += String.Format("Total skill book{0} cost : {1:0,0,0} ISK. ", m_plan.UniqueSkillsCount == 1 ? "" : "s", totalcost); } if (cost > 0) { slblStatusText.Text += String.Format("Not known skill book{0} cost : {1:0,0,0} ISK. ", m_plan.NotKnownSkillsCount == 1 ? "" : "s", cost); } // Suggestions var suggestions = m_plan.GetSuggestions(); if (suggestions.Count != 0) { if (this.Visible && !tslSuggestion.Visible) { tslSuggestion.Visible = true; TipWindow.ShowTip(this, "suggestion", "Plan Suggestion", "EVEMon found learning skills that would lower " + "the overall training time of the plan. To view those " + "suggestions and the resulting change in plan time, click the " + "\"Suggestion\" link in the planner status bar."); } } else { tslSuggestion.Visible = false; } }
private void IdCardDetected(HardWare.CardReader.IDCard idCard) { Logger.Debug("开始读卡"); if (idCard != null) { loginVM.Name = idCard.Name; loginVM.Sex = idCard.Sex; loginVM.Nation = idCard.Nation; loginVM.Address = idCard.Address; loginVM.IDCode = idCard.IDCode; Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { imgPhoto.Source = GetMemoryBmp("{AppDomain.CurrentDomain.BaseDirectory}{zp.bmp}"); })); Thread.Sleep(2000); string examineeId; //TODO 暂注释 (查询数据库判断是否有可以考试) //var canExam = CanExam(idCard.IDCode, out examineeId); var canExam = true; if (canExam) { //loginVM.ExamineeID = examineeId; loginVM.ExamineeID = String.Empty;//考生号 Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => this.ParentWindow().StepToExamIntroductionPage())); } else { Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { TipWindow.ShowTip("未安排在此考试\n请联系考务人员解决", ClearPage); })); StartDetect(); } } }
public override void OnUpdate() { if (Application.platform == RuntimePlatform.Android && (Input.GetKeyDown(KeyCode.Escape)) || Input.GetKeyDown(KeyCode.Q)) { if (m_exitCount == 1) { Application.Quit(); } else { TipWindow ui = UIManager.OpenUIWindow <TipWindow>(); ui.SetContent("UI", "QuitTips"); m_exitCount++; } } }
/// <summary> /// Show a "tip of the day"-like message on the top right corner of the given window. /// </summary> /// <param name="form">The owner window.</param> /// <param name="key">The key used to store informations about messages the user already saw. Every messages is only displayed once.</param> /// <param name="title">The title of the tip window.</param> /// <param name="tiptext">The text of the tip window.</param> public static void ShowTip(Form form, string key, string title, string tiptext) { lock (m_lockObject) { if (!Settings.UI.ConfirmedTips.Contains(key)) { TipWindow tw = new TipWindow(title, tiptext, key); form.Controls.Add(tw); // Aligns the top right corner of the tip window with the top right corner of the owner's client rectangle. tw.Location = new Point(form.ClientRectangle.Left + form.ClientSize.Width - tw.Width, form.ClientRectangle.Top); tw.Anchor = AnchorStyles.Top | AnchorStyles.Right; tw.BringToFront(); tw.Show(); Settings.Save(); } } }
/// <summary> /// On load, we update the controls. /// </summary> /// <param name="e"></param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (DesignMode) { return; } // Global events (unsubscribed on window closing) EveClient.PlanChanged += EveClient_PlanChanged; EveClient.SettingsChanged += EveClient_SettingsChanged; ResizeEnd += PlanWindow_ResizeEnd; // Force an update tsddbPlans.DropDownItems.Add("<New Plan>"); // Compatibility mode : Mac OS if (Settings.Compatibility == CompatibilityMode.Wine) { // Under Wine, the upper tool bar is not displayed // We move it at the top of the first tab Controls.Remove(upperToolStrip); tabControl.TabPages[0].Controls.Add(upperToolStrip); tabControl.TabPages[0].Controls.SetChildIndex(upperToolStrip, 0); } // Show the hint tip TipWindow.ShowTip(this, "planner", "Welcome to the Skill Planner", "Select skills to add to your plan using the list on the left. To " + "view the list of skills you've added to your plan, choose " + "\"View Plan\" from the drop down in the upper left."); //Update the controls EveClient_SettingsChanged(null, EventArgs.Empty); //Update the status bar UpdateStatusBar(); }
protected void OnMouseHover(object sender, System.EventArgs e) { if (tipWindow != null) { tipWindow.Close(); } if (hoverIndex >= 0) { Graphics g = Graphics.FromHwnd(Handle); Rectangle itemRect = GetItemRectangle(hoverIndex); // itemRect.Offset( 17, 0 ); // itemRect.Width -= 17; string text = Items[hoverIndex] as string; SizeF sizeNeeded = g.MeasureString(text, Font); bool expansionNeeded = itemRect.Width < (int)sizeNeeded.Width || itemRect.Height < (int)sizeNeeded.Height; if (expansionNeeded) { tipWindow = new TipWindow(this, hoverIndex); tipWindow.ItemBounds = itemRect; tipWindow.TipText = text; tipWindow.Expansion = TipWindow.ExpansionStyle.Horizontal; tipWindow.Overlay = true; tipWindow.WantClicks = true; tipWindow.AutoCloseDelay = this.AutoCloseDelay; tipWindow.MouseLeaveDelay = this.MouseLeaveDelay; tipWindow.Closed += new EventHandler(tipWindow_Closed); tipWindow.Show(); } } }
private void tipWindow_Closed(object sender, System.EventArgs e) { tipWindow = null; hoverIndex = -1; ClearTimer(); }