public override void OnMouseMove(System.Windows.Forms.MouseEventArgs evtArgs)
        {
            base.OnMouseMove(evtArgs);

            if (evtArgs.Button == System.Windows.Forms.MouseButtons.None)
            {
                Node n = this.GetNodeAtPoint(ConvertToModelCoordinates(evtArgs.Location));
                if (n != null)
                {
                    if (n is SlideView)
                    {
                        if (OnSlideHover != null)
                            OnSlideHover(this, new SlideEventArgs { Slide = ((SlideView)n).Slide });

                        if (ShowHints)
                        {
                            if (tooltipNode != n)
                            {
                                tooltipNode = n;
                                Slide slide = ((SlideView)n).Slide;
                                ToolTipInfo info = new ToolTipInfo();
                                info.Header.Text = slide.Name;
                                info.Header.Font = new Font(info.Header.Font, System.Drawing.FontStyle.Bold);
                                info.Body.Text = slide.Comment;

                                LockingInfo li = PresentationController.Instance.GetSlideLockingInfo(slide);
                                if (li != null)
                                    info.Footer.Text = PresentationStatusInfo.GetSlideLockingInfoDescr(li);

                                PointF pf = ConvertFromModelToClientCoordinates((new PointF(n.BoundingRectangle.Right, n.BoundingRectangle.Bottom)));
                                Point screen = new Point((int)pf.X, (int)pf.Y);

                                tip.Show(info, this.ParentControl.PointToScreen(screen), 2500);
                            }
                        }

                        return;
                    }
                }
                else
                {
                    if (ShowHints)
                        tip.Hide();

                    tooltipNode = null;
                }

                if (OnSlideHover != null)
                    OnSlideHover(this, new SlideEventArgs { Slide = null });
            }
        }
Esempio n. 2
0
        private void NextEnemyFleetCandidate(int offset)
        {
            if (_enemyFleetCandidate != null && _enemyFleetCandidate.Count != 0)
            {
                _enemyFleetCandidateIndex += offset;
                if (_enemyFleetCandidateIndex < 0)
                {
                    _enemyFleetCandidateIndex = (_enemyFleetCandidate.Count - 1) - (_enemyFleetCandidate.Count - 1) % _candidatesDisplayCount;
                }
                else if (_enemyFleetCandidateIndex >= _enemyFleetCandidate.Count)
                {
                    _enemyFleetCandidateIndex = 0;
                }


                var candidate = _enemyFleetCandidate[_enemyFleetCandidateIndex];


                TextEventDetail.Text = TextEnemyFleetName.Text = candidate.FleetName;

                if (_enemyFleetCandidate.Count > _candidatesDisplayCount)
                {
                    TextEventDetail.Text += " ▼";
                    ToolTipInfo.SetToolTip(TextEventDetail, string.Format("候補: {0} / {1}\r\n(左右クリックでページめくり)\r\n", _enemyFleetCandidateIndex + 1, _enemyFleetCandidate.Count));
                }
                else
                {
                    ToolTipInfo.SetToolTip(TextEventDetail, string.Format("候補: {0}\r\n", _enemyFleetCandidate.Count));
                }

                TableEnemyCandidate.SuspendLayout();
                for (int i = 0; i < ControlCandidates.Length; i++)
                {
                    if (i + _enemyFleetCandidateIndex >= _enemyFleetCandidate.Count || i >= _candidatesDisplayCount)
                    {
                        ControlCandidates[i].Update(null);
                        continue;
                    }

                    ControlCandidates[i].Update(_enemyFleetCandidate[i + _enemyFleetCandidateIndex]);
                }
                TableEnemyCandidate.ResumeLayout();
                TableEnemyCandidate.Visible = true;

                PanelEnemyCandidate.Visible = true;
            }
        }
            public void SetToolTip(Control parent, Control child, string toolTip)
            {
                int index = IndexOfToolTip(parent, child);

                if (index >= 0)
                {
                    ToolTipList[index].ToolTip = toolTip;
                }
                else
                {
                    ToolTipInfo toolTipInfo = new ToolTipInfo();
                    toolTipInfo.Path    = MakeToolTipPath(parent, child);
                    toolTipInfo.ToolTip = toolTip;
                    Array.Resize <ToolTipInfo>(ref ToolTipList, (ToolTipList == null) ? 1 : ToolTipList.Length + 1);
                    ToolTipList[ToolTipList.Length - 1] = toolTipInfo;
                }
            }
        private void Updated(string apiname, dynamic data)
        {
            for (int i = 0; i < ControlFleet.Count; i++)
            {
                ControlFleet[i].Update();
            }

            if (KCDatabase.Instance.Fleet.CombinedFlag > 0)
            {
                CombinedTag.Text = Constants.GetCombinedFleet(KCDatabase.Instance.Fleet.CombinedFlag);

                var fleet1 = KCDatabase.Instance.Fleet[1];
                var fleet2 = KCDatabase.Instance.Fleet[2];

                int tp = Calculator.GetTPDamage(fleet1) + Calculator.GetTPDamage(fleet2);

                ToolTipInfo.SetToolTip(CombinedTag, string.Format("ドラム缶搭載: {0}個\r\n大発動艇搭載: {1}個\r\n輸送量(TP): S {2} / A {3}\r\n\r\n制空戦力合計: {4}\r\n索敵能力合計: {5:f2}\r\n新判定式(33):\r\n 分岐点係数1: {6:f2}\r\n 分岐点係数3: {7:f2}\r\n 分岐点係数4: {8:f2}",
                                                                  fleet1.MembersWithoutEscaped.Sum(s => s == null ? 0 : s.AllSlotInstanceMaster.Count(eq => eq != null && eq.CategoryType == 30)) +
                                                                  fleet2.MembersWithoutEscaped.Sum(s => s == null ? 0 : s.AllSlotInstanceMaster.Count(eq => eq != null && eq.CategoryType == 30)),
                                                                  fleet1.MembersWithoutEscaped.Sum(s => s == null ? 0 : s.AllSlotInstanceMaster.Count(eq => eq != null && eq.CategoryType == 24)) +
                                                                  fleet2.MembersWithoutEscaped.Sum(s => s == null ? 0 : s.AllSlotInstanceMaster.Count(eq => eq != null && eq.CategoryType == 24)),
                                                                  tp,
                                                                  (int)Math.Floor(tp * 0.7),
                                                                  Calculator.GetAirSuperiority(fleet1) + Calculator.GetAirSuperiority(fleet2),
                                                                  Math.Floor(fleet1.GetSearchingAbility() * 100) / 100 + Math.Floor(fleet2.GetSearchingAbility() * 100) / 100,
                                                                  Math.Floor(Calculator.GetSearchingAbility_New33(fleet1, 1) * 100) / 100 + Math.Floor(Calculator.GetSearchingAbility_New33(fleet2, 1) * 100) / 100,
                                                                  Math.Floor(Calculator.GetSearchingAbility_New33(fleet1, 3) * 100) / 100 + Math.Floor(Calculator.GetSearchingAbility_New33(fleet2, 3) * 100) / 100,
                                                                  Math.Floor(Calculator.GetSearchingAbility_New33(fleet1, 4) * 100) / 100 + Math.Floor(Calculator.GetSearchingAbility_New33(fleet2, 4) * 100) / 100
                                                                  ));


                CombinedTag.Visible = true;
            }
            else
            {
                CombinedTag.Visible = false;
            }

            if (KCDatabase.Instance.Fleet.AnchorageRepairingTimer > DateTime.MinValue)
            {
                AnchorageRepairingTimer.Text = DateTimeHelper.ToTimeElapsedString(KCDatabase.Instance.Fleet.AnchorageRepairingTimer);
                AnchorageRepairingTimer.Tag  = KCDatabase.Instance.Fleet.AnchorageRepairingTimer;
                ToolTipInfo.SetToolTip(AnchorageRepairingTimer, "泊地修理タイマ\r\n開始: " + DateTimeHelper.TimeToCSVString(KCDatabase.Instance.Fleet.AnchorageRepairingTimer) + "\r\n回復: " + DateTimeHelper.TimeToCSVString(KCDatabase.Instance.Fleet.AnchorageRepairingTimer.AddMinutes(20)));
            }
        }
Esempio n. 5
0
        private void DisplayTooltip()
        {
            if (!ShowSuperTooltips)
            {
                HideToolTip();
                return;
            }

            int rowIndex = GetSelectedRowIndex();

            if (rowIndex == -1)
            {
                return;
            }

            lock (_lastTooltip)
            {
                _lastTooltip.Hide();
                _lastTooltip = new SuperToolTip(_grid);

                int columnCount = _grid.TableDescriptor.Columns.Count;

                var pnt = new Point
                {
                    X = _grid.TableControl.ColIndexToHScrollPixelPos(columnCount),
                    Y = _grid.TableControl.RowIndexToVScrollPixelPos(rowIndex)
                };

                pnt = _grid.PointToScreen(pnt);

                var info = new ToolTipInfo();
                var args = new ToolTipGridEventArgs(info, RowIndexToRecordIndex(rowIndex));

                FirePrepareTooltip(args);
                if (args.Cancel)
                {
                    _lastTooltip.Hide();
                    return;
                }

                info.Header.Font      = new Font(info.Header.Font, FontStyle.Bold);
                _lastTooltip.MaxWidth = ToolTipMaxWidth;
                _lastTooltip.Show(info, pnt, ToolTipDuration);
            }
        }
Esempio n. 6
0
		/// <summary>
		/// 基地航空隊フェーズの結果を設定します。
		/// </summary>
		private void SetBaseAirAttack(PhaseBaseAirAttack pd)
		{
			if (pd != null && pd.IsAvailable)
			{

				Searching.Text = "基地航空隊";
				Searching.ImageAlign = ContentAlignment.MiddleLeft;
				Searching.ImageIndex = (int)ResourceManager.EquipmentContent.LandAttacker;

				var sb = new StringBuilder();
				int index = 1;

				foreach (var phase in pd.AirAttackUnits)
				{

					sb.AppendFormat("{0} 回目 - #{1} :\r\n",
						index, phase.AirUnitID);

					if (phase.IsStage1Available)
					{
						sb.AppendFormat(" St1: 自軍 -{0}/{1} | 敵軍 -{2}/{3} | {4}\r\n",
							phase.AircraftLostStage1Friend, phase.AircraftTotalStage1Friend,
							phase.AircraftLostStage1Enemy, phase.AircraftTotalStage1Enemy,
							Constants.GetAirSuperiority(phase.AirSuperiority));
					}
					if (phase.IsStage2Available)
					{
						sb.AppendFormat(" St2: 自軍 -{0}/{1} | 敵軍 -{2}/{3}\r\n",
							phase.AircraftLostStage2Friend, phase.AircraftTotalStage2Friend,
							phase.AircraftLostStage2Enemy, phase.AircraftTotalStage2Enemy);
					}

					index++;
				}

				ToolTipInfo.SetToolTip(Searching, sb.ToString());


			}
			else
			{
				ClearBaseAirAttack();
			}

		}
Esempio n. 7
0
        private void DisplayTooltip()
        {
            lock (_lastTooltip)
            {
                _lastTooltip.Hide();

                if (!ShowSuperTooltip)
                {
                    return;
                }

                if (SelectedNode == null)
                {
                    return;
                }

                _lastTooltip = new SuperToolTip(this)
                {
                    Style       = SuperToolTip.SuperToolTipStyle.Office2013Style,
                    VisualStyle = SuperToolTip.Appearance.Metro,
                    MetroColor  = Color.White,
                    UseFading   = SuperToolTip.FadingType.System
                };

                var rect = SelectedNode.TextBounds;
                var pnt  = new Point(rect.X + rect.Width + 20, rect.Y + rect.Height);
                pnt = PointToScreen(pnt);

                var info = new ToolTipInfo();
                var args = new ToolTipEventArgs(info);

                FirePrepareTooltip(args);

                if (args.Cancel)
                {
                    _lastTooltip.Hide();
                    return;
                }

                info.Header.Font = new Font(info.Header.Font, FontStyle.Bold);

                _lastTooltip.MaxWidth = 450;
                _lastTooltip.Show(info, pnt, ToolTipDuration);
            }
        }
Esempio n. 8
0
        public static void UpdateTooltip(object sender, IRibbonItem item)
        {
            if (_toolTipManager == null)
            {
                return;
            }

            var item2 = sender as ToolStripItem;

            if (item2 == null)
            {
                return;
            }


            var  info       = _toolTipManager.GetToolTip(item2);
            bool hasToolTip = info != null;

            if (info == null)
            {
                info = new ToolTipInfo();
            }

            info.Header.Text = item.Caption;


            info.Header.Font = new Font(info.Header.Font, FontStyle.Bold);


            info.Body.Text = string.IsNullOrWhiteSpace(item.Tooltip)
                ? "目前没有进一步的提示信息"
                : item.Tooltip;

            if (AppConfig.Instance.ShowPluginInToolTip && item.PluginIdentity != PluginIdentity.Default)
            {
                info.Footer.Text = "Plugin: " + item.PluginIdentity.Name;
                info.Separator   = false;
            }

            if (!hasToolTip)
            {
                _toolTipManager.SetToolTip(item2, info);
            }
        }
Esempio n. 9
0
        /// <summary>
        /// Occurs when ToolTipStyle ComboBox's SelectedIndex is changed. To change the ToolTipStyle of the ToolTip.
        /// </summary>
        /// <param name="sender">The sender that contains the toolTipStyleComboBox.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> that contains event data.</param>
        private void toolTipStyleComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string toolTipStyle = this.toolTipStyleComboBox.GetItemText(this.toolTipStyleComboBox.SelectedItem);

            pictureBox1Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox1);
            pictureBox2Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox2);
            pictureBox3Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox3);
            pictureBox4Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox4);
            pictureBox5Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox5);
            pictureBox6Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox6);
            pictureBox7Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox7);
            pictureBox10Info = this.sfToolTip1.GetToolTipInfo(this.pictureBox10);

            if (pictureBox1Info != null)
            {
                switch (toolTipStyle)
                {
                case "Regular":
                    pictureBox1Info.ToolTipStyle  = ToolTipStyle.Regular;
                    pictureBox2Info.ToolTipStyle  = ToolTipStyle.Regular;
                    pictureBox3Info.ToolTipStyle  = ToolTipStyle.Regular;
                    pictureBox4Info.ToolTipStyle  = ToolTipStyle.Regular;
                    pictureBox5Info.ToolTipStyle  = ToolTipStyle.Regular;
                    pictureBox6Info.ToolTipStyle  = ToolTipStyle.Regular;
                    pictureBox7Info.ToolTipStyle  = ToolTipStyle.Regular;
                    pictureBox10Info.ToolTipStyle = ToolTipStyle.Regular;
                    break;

                case "Balloon":
                    pictureBox1Info.ToolTipStyle  = ToolTipStyle.Balloon;
                    pictureBox2Info.ToolTipStyle  = ToolTipStyle.Balloon;
                    pictureBox3Info.ToolTipStyle  = ToolTipStyle.Balloon;
                    pictureBox4Info.ToolTipStyle  = ToolTipStyle.Balloon;
                    pictureBox5Info.ToolTipStyle  = ToolTipStyle.Balloon;
                    pictureBox6Info.ToolTipStyle  = ToolTipStyle.Balloon;
                    pictureBox7Info.ToolTipStyle  = ToolTipStyle.Balloon;
                    pictureBox10Info.ToolTipStyle = ToolTipStyle.Balloon;
                    break;
                }
            }

            SetToolTipInfo();
        }
        private void UpdateDisplayUseItem()
        {
            var    db         = KCDatabase.Instance;
            var    itemID     = Utility.Configuration.Config.FormHeadquarters.DisplayUseItemID;
            var    item       = db.UseItems[itemID];
            var    itemMaster = db.MasterUseItems[itemID];
            string tail       = "\r\n(設定からアイテム変更可能)\r\n(右クリックで全アイテム表示)";



            switch (itemMaster?.Name)
            {
            case null:
                DisplayUseItem.Text = "???";
                ToolTipInfo.SetToolTip(DisplayUseItem, "不明なアイテム (ID: " + Utility.Configuration.Config.FormHeadquarters.DisplayUseItemID + ")" + tail);
                break;

            // '18 spring event special mode
            case "お米":
            case "梅干":
            case "海苔":
            case "お茶":
                DisplayUseItem.Text = (item?.Count ?? 0).ToString();
                ToolTipInfo.SetToolTip(DisplayUseItem,
                                       $"お米: {db.UseItems[85]?.Count ?? 0}\r\n梅干: {db.UseItems[86]?.Count ?? 0}\r\n海苔: {db.UseItems[87]?.Count ?? 0}\r\nお茶: {db.UseItems[88]?.Count ?? 0}\r\n{tail}");
                break;

            // '19 autumn event special mode
            case "秋刀魚":
            case "鰯":
                DisplayUseItem.Text = (item?.Count ?? 0).ToString();
                ToolTipInfo.SetToolTip(DisplayUseItem,
                                       $"秋刀魚: {db.UseItems[68]?.Count ?? 0}\r\n鰯: {db.UseItems[93]?.Count ?? 0}\r\n{tail}");
                break;

            default:
                DisplayUseItem.Text = (item?.Count ?? 0).ToString();
                ToolTipInfo.SetToolTip(DisplayUseItem,
                                       itemMaster.Name + tail);
                break;
            }
        }
Esempio n. 11
0
        // デフォルトのツールチップは消える時間が速すぎるので、自分で制御する
        private void QuestView_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0 || e.RowIndex >= QuestView.RowCount || e.ColumnIndex >= QuestView.ColumnCount)
            {
                ToolTipInfo.SetToolTip(QuestView, null);
                return;
            }

            if (!string.IsNullOrWhiteSpace(QuestView[e.ColumnIndex, e.RowIndex].ToolTipText))
            {
                ToolTipInfo.SetToolTip(QuestView, QuestView[e.ColumnIndex, e.RowIndex].ToolTipText);
            }
            else if (e.ColumnIndex == QuestView_Progress.Index && QuestView[e.ColumnIndex, e.RowIndex].Value != null)
            {
                ToolTipInfo.SetToolTip(QuestView, QuestView[e.ColumnIndex, e.RowIndex].Value.ToString());
            }
            else
            {
                ToolTipInfo.SetToolTip(QuestView, null);
            }
        }
        private void Updated(string apiname, dynamic data)
        {
            for (int i = 0; i < ControlFleet.Count; i++)
            {
                ControlFleet[i].Update();
            }

            if (KCDatabase.Instance.Fleet.CombinedFlag > 0)
            {
                CombinedTag.Text = Constants.GetCombinedFleet(KCDatabase.Instance.Fleet.CombinedFlag);

                if (KCDatabase.Instance.Fleet.CombinedFlag == 3)
                {
                    ToolTipInfo.SetToolTip(CombinedTag, string.Format("ドラム缶搭載: {0}個\r\n大発動艇搭載: {1}個\r\n輸送量(TP): {2}\r\n",
                                                                      KCDatabase.Instance.Fleet[1].MembersWithoutEscaped.Sum(s => s == null ? 0 : s.AllSlotInstanceMaster.Count(eq => eq != null && eq.CategoryType == 30)) +
                                                                      KCDatabase.Instance.Fleet[2].MembersWithoutEscaped.Sum(s => s == null ? 0 : s.AllSlotInstanceMaster.Count(eq => eq != null && eq.CategoryType == 30)),
                                                                      KCDatabase.Instance.Fleet[1].MembersWithoutEscaped.Sum(s => s == null ? 0 : s.AllSlotInstanceMaster.Count(eq => eq != null && eq.CategoryType == 24)) +
                                                                      KCDatabase.Instance.Fleet[2].MembersWithoutEscaped.Sum(s => s == null ? 0 : s.AllSlotInstanceMaster.Count(eq => eq != null && eq.CategoryType == 24)),
                                                                      Calculator.GetTPDamage(KCDatabase.Instance.Fleet[1]) + Calculator.GetTPDamage(KCDatabase.Instance.Fleet[2])
                                                                      ));
                }
                else
                {
                    ToolTipInfo.SetToolTip(CombinedTag, null);
                }

                CombinedTag.Visible = true;
            }
            else
            {
                CombinedTag.Visible = false;
            }

            if (KCDatabase.Instance.Fleet.AnchorageRepairingTimer > DateTime.MinValue)
            {
                AnchorageRepairingTimer.Text = DateTimeHelper.ToTimeElapsedString(KCDatabase.Instance.Fleet.AnchorageRepairingTimer);
                AnchorageRepairingTimer.Tag  = KCDatabase.Instance.Fleet.AnchorageRepairingTimer;
                ToolTipInfo.SetToolTip(AnchorageRepairingTimer, "泊地修理タイマ\r\n開始: " + DateTimeHelper.TimeToCSVString(KCDatabase.Instance.Fleet.AnchorageRepairingTimer) + "\r\n回復: " + DateTimeHelper.TimeToCSVString(KCDatabase.Instance.Fleet.AnchorageRepairingTimer.AddMinutes(20)));
            }
        }
Esempio n. 13
0
        void propertyGrid1_PropertyGridValidating(object sender, CancelEventArgs e)
        {
            ToolTipInfo t_info = new ToolTipInfo();
            t_info.Body.Image = Resources.error;
            t_info.Header.Text = "Ошибка";

            Point p = this.PointToScreen(propertyGrid1.Location);
            p.Offset(-propertyGrid1.Width, 0);

            ISupportValidation validation = propertyGrid1.SelectedObject as ISupportValidation;
            string message;
            if (validation != null)
            {
                if (!validation.EnsureValidate(out message))
                {
                    t_info.Body.Text = message;
                    superToolTip1.Show(t_info, p);
                    propertyGrid1.Focus();
                    throw new Exception();
                }
            }
        }
        private void SetToolTip(Control control, string content)
        {
            ToolTipInfo toolTipInfo1 = new ToolTipInfo();

            toolTipInfo1.MaxWidth        = 1000;
            toolTipInfo1.ToolTipStyle    = ToolTipStyle.Balloon;
            toolTipInfo1.ToolTipLocation = ToolTipLocation.BottomRight;
            toolTipInfo1.BeakBackColor   = ColorTranslator.FromHtml("#3D3D3D");
            toolTipInfo1.BorderColor     = ColorTranslator.FromHtml("#1E1E1E");
            ToolTipItem toolTipItem1 = new ToolTipItem();

            toolTipItem1.Padding         = new Padding(10);
            toolTipItem1.Style.BackColor = ColorTranslator.FromHtml("#3D3D3D");

            RichTextBox richTextBox1 = new RichTextBox();

            richTextBox1.Margin           = new Padding(0);
            richTextBox1.Location         = new Point(0, 0);
            richTextBox1.WordWrap         = true;
            richTextBox1.ScrollBars       = RichTextBoxScrollBars.None;
            richTextBox1.Width            = 500;
            richTextBox1.BackColor        = ColorTranslator.FromHtml("#3D3D3D");
            richTextBox1.ContentsResized += (ss, ee) =>
            {
                var send = ss as RichTextBox;

                send.Height = ee.NewRectangle.Height;
            };

            richTextBox1.Rtf         = content;
            richTextBox1.BorderStyle = BorderStyle.None;

            toolTipItem1.Control = richTextBox1;

            toolTipInfo1.Items.Add(toolTipItem1);

            this.sfToolTip1.SetToolTipInfo(control, toolTipInfo1);
        }
Esempio n. 15
0
        private void UpdateDisplayUseItem()
        {
            var    db         = KCDatabase.Instance;
            var    item       = db.UseItems[Utility.Configuration.Config.FormHeadquarters.DisplayUseItemID];
            var    itemMaster = db.MasterUseItems[Utility.Configuration.Config.FormHeadquarters.DisplayUseItemID];
            string tail       = "\r\n(設定から変更可能)";

            if (item != null)
            {
                DisplayUseItem.Text = item.Count.ToString();
                ToolTipInfo.SetToolTip(DisplayUseItem, itemMaster.Name + tail);
            }
            else if (itemMaster != null)
            {
                DisplayUseItem.Text = "0";
                ToolTipInfo.SetToolTip(DisplayUseItem, itemMaster.Name + tail);
            }
            else
            {
                DisplayUseItem.Text = "???";
                ToolTipInfo.SetToolTip(DisplayUseItem, "不明なアイテム (ID: " + Utility.Configuration.Config.FormHeadquarters.DisplayUseItemID + ")" + tail);
            }
        }
Esempio n. 16
0
        public override bool AcceptChanges()
        {
            nameText.Text = nameText.Text.Trim();
            
            ToolTipInfo t_info = new ToolTipInfo();
            t_info.Body.Image = Resources.error;
            t_info.Header.Text = "Ошибка";

            Point p = nameText.Location;
            p.Offset(nameText.Width, 0);


            editGroup.Name = editGroup.Name.Trim();
            if (String.IsNullOrEmpty(nameText.Text.Trim()))
            {
                nameText.Focus();
                //https://sentinel2.luxoft.com/sen/issues/browse/PMEDIAINFOVISDEV-347
                MessageBoxExt.Show("Заполните обязательное поле <Название>", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                //t_info.Body.Text = "Заполните обязательное поле <Название>";
                //superToolTip1.Show(t_info, PointToScreen(p));
                return false;
            }

            if (PresentationController.Instance.Presentation.DisplayGroupList.Except(new[] { editGroup, destGroup }).Any(d => d.Name == editGroup.Name))
            {
                nameText.Focus();
                t_info.Body.Text = String.Format("Группа с названием {0} уже существует.\r\nВведите другое название", editGroup.Name);
                superToolTip1.Show(t_info, PointToScreen(p));
                return false;
            }


            CloneGroup(editGroup, destGroup);
            DialogResult = DialogResult.OK;
            //CloseMe();

            return true;
        }
Esempio n. 17
0
 static void widget_EventToolTip(Widget _sender, ToolTipInfo _info)
 {
     Gui.Instance.Log("TestApp", LogLevel.Info, "EventToolTip  _info=" + _info.ToString());
 }
        void Updated(string apiname, dynamic data)
        {
            KCDatabase db = KCDatabase.Instance;


            FlowPanelMaster.SuspendLayout();

            //Admiral
            FlowPanelAdmiral.SuspendLayout();
            AdmiralName.Text    = string.Format("{0} {1}", db.Admiral.AdmiralName, Constants.GetAdmiralRank(db.Admiral.Rank));
            AdmiralComment.Text = db.Admiral.Comment;
            FlowPanelAdmiral.ResumeLayout();

            //HQ Level
            HQLevel.Value = db.Admiral.Level;
            {
                StringBuilder tooltip = new StringBuilder();
                if (db.Admiral.Level < ExpTable.AdmiralExp.Max(e => e.Key))
                {
                    HQLevel.TextNext  = "next:";
                    HQLevel.ValueNext = ExpTable.GetNextExpAdmiral(db.Admiral.Exp);
                    tooltip.AppendFormat("{0} / {1}\r\n", db.Admiral.Exp, ExpTable.AdmiralExp[db.Admiral.Level + 1].Total);
                }
                else
                {
                    HQLevel.TextNext  = "exp:";
                    HQLevel.ValueNext = db.Admiral.Exp;
                }

                //戦果ツールチップ
                //fixme: もっとましな書き方はなかっただろうか
                {
                    var res = RecordManager.Instance.Resource.GetRecordPrevious();
                    if (res != null)
                    {
                        int diff = db.Admiral.Exp - res.HQExp;
                        tooltip.AppendFormat(GeneralRes.ThisTime + ": +{0} exp. / " + GeneralRes.RankPoints + " {1:n2}\r\n", diff, diff * 7 / 10000.0);
                    }
                }
                {
                    var res = RecordManager.Instance.Resource.GetRecordDay();
                    if (res != null)
                    {
                        int diff = db.Admiral.Exp - res.HQExp;
                        tooltip.AppendFormat(GeneralRes.Today + ": +{0} exp. / " + GeneralRes.RankPoints + " {1:n2}\r\n", diff, diff * 7 / 10000.0);
                    }
                }
                {
                    var res = RecordManager.Instance.Resource.GetRecordMonth();
                    if (res != null)
                    {
                        int diff = db.Admiral.Exp - res.HQExp;
                        tooltip.AppendFormat(GeneralRes.ThisMonth + ": +{0} exp. / " + GeneralRes.RankPoints + " {1:n2}\r\n", diff, diff * 7 / 10000.0);
                    }
                }

                ToolTipInfo.SetToolTip(HQLevel, tooltip.ToString());
            }

            //Fleet
            FlowPanelFleet.SuspendLayout();
            {
                ShipCount.Text = string.Format("{0}/{1}", RealShipCount, db.Admiral.MaxShipCount);
                if (RealShipCount > db.Admiral.MaxShipCount - 5)
                {
                    ShipCount.BackColor = Color.LightCoral;
                }
                else
                {
                    ShipCount.BackColor = Color.Transparent;
                }
                ShipCount.Tag = RealShipCount >= db.Admiral.MaxShipCount;

                EquipmentCount.Text = string.Format("{0}/{1}", RealEquipmentCount, db.Admiral.MaxEquipmentCount);
                if (RealEquipmentCount > db.Admiral.MaxEquipmentCount + 3 - 20)
                {
                    EquipmentCount.BackColor = Color.LightCoral;
                }
                else
                {
                    EquipmentCount.BackColor = Color.Transparent;
                }
                EquipmentCount.Tag = RealEquipmentCount >= db.Admiral.MaxEquipmentCount;
            }
            FlowPanelFleet.ResumeLayout();

            //UseItems
            FlowPanelUseItem.SuspendLayout();
            InstantRepair.Text       = db.Material.InstantRepair.ToString();
            InstantConstruction.Text = db.Material.InstantConstruction.ToString();
            DevelopmentMaterial.Text = db.Material.DevelopmentMaterial.ToString();
            ModdingMaterial.Text     = db.Material.ModdingMaterial.ToString();
            FurnitureCoin.Text       = db.Admiral.FurnitureCoin.ToString();
            FlowPanelUseItem.ResumeLayout();


            //Resources
            FlowPanelResource.SuspendLayout();
            {
                Color overcolor = Color.Moccasin;

                var resday   = RecordManager.Instance.Resource.GetRecord(DateTime.Now.AddHours(-5).Date.AddHours(5));
                var resweek  = RecordManager.Instance.Resource.GetRecord(DateTime.Now.AddHours(-5).Date.AddDays(-(((int)DateTime.Now.AddHours(-5).DayOfWeek + 6) % 7)).AddHours(5));                                    //月曜日起点
                var resmonth = RecordManager.Instance.Resource.GetRecord(new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddHours(5));


                Fuel.Text      = db.Material.Fuel.ToString();
                Fuel.BackColor = db.Material.Fuel < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor;
                ToolTipInfo.SetToolTip(Fuel, string.Format("今日: {0:+##;-##;±0}\n今週: {1:+##;-##;±0}\n今月: {2:+##;-##;±0}",
                                                           resday == null ? 0 : (db.Material.Fuel - resday.Fuel),
                                                           resweek == null ? 0 : (db.Material.Fuel - resweek.Fuel),
                                                           resmonth == null ? 0 : (db.Material.Fuel - resmonth.Fuel)));

                Ammo.Text      = db.Material.Ammo.ToString();
                Ammo.BackColor = db.Material.Ammo < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor;
                ToolTipInfo.SetToolTip(Ammo, string.Format("今日: {0:+##;-##;±0}\n今週: {1:+##;-##;±0}\n今月: {2:+##;-##;±0}",
                                                           resday == null ? 0 : (db.Material.Ammo - resday.Ammo),
                                                           resweek == null ? 0 : (db.Material.Ammo - resweek.Ammo),
                                                           resmonth == null ? 0 : (db.Material.Ammo - resmonth.Ammo)));

                Steel.Text      = db.Material.Steel.ToString();
                Steel.BackColor = db.Material.Steel < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor;
                ToolTipInfo.SetToolTip(Steel, string.Format("今日: {0:+##;-##;±0}\n今週: {1:+##;-##;±0}\n今月: {2:+##;-##;±0}",
                                                            resday == null ? 0 : (db.Material.Steel - resday.Steel),
                                                            resweek == null ? 0 : (db.Material.Steel - resweek.Steel),
                                                            resmonth == null ? 0 : (db.Material.Steel - resmonth.Steel)));

                Bauxite.Text      = db.Material.Bauxite.ToString();
                Bauxite.BackColor = db.Material.Bauxite < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor;
                ToolTipInfo.SetToolTip(Bauxite, string.Format("今日: {0:+##;-##;±0}\n今週: {1:+##;-##;±0}\n今月: {2:+##;-##;±0}",
                                                              resday == null ? 0 : (db.Material.Bauxite - resday.Bauxite),
                                                              resweek == null ? 0 : (db.Material.Bauxite - resweek.Bauxite),
                                                              resmonth == null ? 0 : (db.Material.Bauxite - resmonth.Bauxite)));
            }
            FlowPanelResource.ResumeLayout();

            FlowPanelMaster.ResumeLayout();
            if (!FlowPanelMaster.Visible)
            {
                FlowPanelMaster.Visible = true;
            }
            AdmiralName.Refresh();
            AdmiralComment.Refresh();
        }
Esempio n. 19
0
        public Form1()
        {
            InitializeComponent();
            this.MetroColor = Color.White;
            this.BackColor  = Color.White;

            PopulationViewModel data = new PopulationViewModel();

            TreeMap1.ItemsSource                  = data.PopulationDetails;
            TreeMap1.WeightValuePath              = "Population";
            TreeMap1.ColorValuePath               = "Growth";
            TreeMap1.LegendSetting.LegendType     = LegendTypes.Ellipse;
            TreeMap1.LegendSetting.LegendGap      = 150;
            TreeMap1.LegendSetting.ShowLegend     = true;
            TreeMap1.LegendSetting.LegendPosition = LegendPositions.Top;
            TreeMap1.Dock = DockStyle.Fill;
            //TreeMap1.Margin = new System.Windows.Forms.Padding(10,10,10,10);
            TreeMap1.ItemsLayoutMode = Syncfusion.Windows.Forms.TreeMap.ItemsLayoutModes.SliceAndDiceAuto;
            ToolTipInfo itemInfoHead = new ToolTipInfo();

            itemInfoHead.ToolTipHeaderPattern  = "<b>{Label}</b>";
            itemInfoHead.ToolTipContentPattern = "Growth \t  :  {Growth} % ";
            TreeMap1.HeaderToolTipInfo         = itemInfoHead;
            ToolTipInfo itemInfo = new ToolTipInfo();

            itemInfo.ToolTipHeaderPattern  = "<b>{Country}</b>";
            itemInfo.ToolTipContentPattern = "Growth \t      :  {Growth} %  \nPopulation   :  {StrPopulation}  ";
            TreeMap1.ItemToolTipInfo       = itemInfo;

            #region ColorMapping

            #region Range ColorMapping

            //RangeBrushColorMapping
            RangeBrushColorMapping rangeBrushColorMapping = new RangeBrushColorMapping();
            rangeBrushColorMapping.Brushes.Add(new RangeBrush()
            {
                Color = System.Drawing.ColorTranslator.FromHtml("#77D8D8"), From = 0, To = 1, LegendLabel = "1% Growth"
            });
            rangeBrushColorMapping.Brushes.Add(new RangeBrush()
            {
                Color = System.Drawing.ColorTranslator.FromHtml("#AED960"), From = 0, To = 2, LegendLabel = "2% Growth"
            });
            rangeBrushColorMapping.Brushes.Add(new RangeBrush()
            {
                Color = System.Drawing.ColorTranslator.FromHtml("#FFAF51"), From = 0, To = 3, LegendLabel = "3% Growth"
            });
            rangeBrushColorMapping.Brushes.Add(new RangeBrush()
            {
                Color = System.Drawing.ColorTranslator.FromHtml("#F3D240"), From = 0, To = 4, LegendLabel = "4% Growth"
            });
            TreeMap1.LeafColorMapping = rangeBrushColorMapping;

            #endregion

            #endregion

            #region Level

            //Level

            TreeMapFlatLevel treeMapFlatLevel1 = new TreeMapFlatLevel();
            treeMapFlatLevel1.GroupPath = "Continent";
            TreeMap1.Levels.Add(treeMapFlatLevel1);

            TreeMap1.LeafItemSettings.LabelPath = "Country";
            TreeMap1.LeafItemDrawing           += TreeMap1_LeafItemDrawing;
            #endregion

            LegendPositionComboBox.Items.Add("Left");
            LegendPositionComboBox.Items.Add("Right");
            LegendPositionComboBox.Items.Add("Top");
            LegendPositionComboBox.Items.Add("Bottom");
            LegendPositionComboBox.SelectedIndex         = 2;
            LegendPositionComboBox.KeyDown              += LegendPositionComboBox_KeyDown;
            LegendPositionComboBox.Dock                  = DockStyle.Top;
            LegendPositionComboBox.Font                  = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            LegendPositionComboBox.SelectedValueChanged += comboBox1_SelectedValueChanged;
            userOptionsGroupBox.Controls.Add(LegendPositionComboBox);

            legendpositionLabel.Text   = "Legend Position :";
            legendpositionLabel.Height = (int)DpiAware.LogicalToDeviceUnits(legendpositionLabel.Height);
            legendpositionLabel.Dock   = DockStyle.Top;
            legendpositionLabel.Font   = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            userOptionsGroupBox.Controls.Add(legendpositionLabel);

            splitter.Dock   = DockStyle.Top;
            splitter.Height = 40;
            userOptionsGroupBox.Controls.Add(splitter);

            layoutModeComboBox.Items.Add("SliceAndDiceAuto");
            layoutModeComboBox.Items.Add("SliceAndDiceHorizontal");
            layoutModeComboBox.Items.Add("SliceAndDiceVertical");
            layoutModeComboBox.Items.Add("Squarified");
            layoutModeComboBox.SelectedIndex         = 0;
            layoutModeComboBox.KeyDown              += layoutModeComboBox_KeyDown;
            layoutModeComboBox.Dock                  = DockStyle.Top;
            layoutModeComboBox.Font                  = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            layoutModeComboBox.SelectedValueChanged += layoutModeComboBox_SelectedValueChanged;
            userOptionsGroupBox.Controls.Add(layoutModeComboBox);

            layoutModeLabel.Text   = "TreeMap Layout :";
            layoutModeLabel.Height = (int)DpiAware.LogicalToDeviceUnits(layoutModeLabel.Height);
            layoutModeLabel.Font   = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            layoutModeLabel.Dock   = DockStyle.Top;
            userOptionsGroupBox.Controls.Add(layoutModeLabel);
            userOptionsGroupBox.Dock  = DockStyle.Right;
            userOptionsGroupBox.Width = (int)DpiAware.LogicalToDeviceUnits(userOptionsGroupBox.Width);

            treeMapContainer.Name = "Population Growth FY2012";
            treeMapPanel.Dock     = DockStyle.Fill;
            treeMapPanel.Controls.Add(TreeMap1);
            treeMapPanel.Controls.Add(userOptionsGroupBox);
            this.Controls.Add(treeMapPanel);

            sampleHeader.Text      = "This sample represents various types of layout available in the TreeMap for arrangement of items";
            sampleHeader.Font      = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            sampleHeader.Location  = new Point(10, 10);
            sampleHeader.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(150)))), ((int)(((byte)(205)))));
            sampleHeader.ForeColor = System.Drawing.Color.White;
            sampleHeader.Location  = new System.Drawing.Point(0, 0);
            sampleHeader.Size      = new System.Drawing.Size(284, (int)DpiAware.LogicalToDeviceUnits(33));
            sampleHeader.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            sampleHeader.Dock      = DockStyle.Top;
            this.Controls.Add(sampleHeader);
        }
Esempio n. 20
0
        protected override void OnDragOver(DragEventArgs e)
        {
            Point clientPoint = this.PointToClient(new Point(e.X, e.Y));
            TreeNodeAdv hoveringNode = this.GetNodeAtPoint(clientPoint);

            if (hoveringNode != prevHoverNode)
            {
                this.Invalidate();
                prevHoverNode = hoveringNode;
            }

            TreeNodeAdv draggingNode = e.Data.GetData(typeof(DisplayNode)) as DisplayNode;

            if (hoveringNode != null && draggingNode != null && hoveringNode != draggingNode && (!RegroupDisabled || hoveringNode is DisplayNode))
            {
                Graphics g = this.CreateGraphics();

                //temporary removed

                //if (toolTipped != hoveringNode)
                //{
                //    superToolTip1.Hide();
                //    toolTipped = null;
                //}

                e.Effect = DragDropEffects.Move;
                bool moveToGroup = false;
                Color m_lineColor = Color.Red;
                DisplayGroupNode groupNode = null;

                if (hoveringNode is DisplayGroupNode)
                {
                    groupNode = hoveringNode as DisplayGroupNode;

                    if (!hoveringNode.Expanded)
                        hoveringNode.Expand();

                    moveToGroup = true;
                }
                else
                {
                    if (hoveringNode.Parent != null && hoveringNode.Parent is DisplayGroupNode && draggingNode.Parent != hoveringNode.Parent)
                    {
                        groupNode = hoveringNode.Parent as DisplayGroupNode;
                        moveToGroup = true;
                    }
                    else
                    {
                        this.SelectedNode = hoveringNode;
                    }
                }

                if (moveToGroup)
                {
                    if (draggingNode.Parent == hoveringNode & (clientPoint.Y - hoveringNode.Bounds.Y) < hoveringNode.Bounds.Height / 2f)
                    {
                        moveToGroup = false;
                    }
                }

                if (moveToGroup != prevMoveToGroup)
                {
                    this.Invalidate();
                }

                prevMoveToGroup = moveToGroup;

                if (moveToGroup & groupNode != null)
                {
                    g.DrawLine(new Pen(m_lineColor, 2), new Point(groupNode.Bounds.X, groupNode.Bounds.Y + groupNode.Bounds.Height), new Point(groupNode.Bounds.X + this.Bounds.Width, groupNode.Bounds.Y + groupNode.Bounds.Height));
                    g.FillPolygon(new SolidBrush(m_lineColor), new Point[] { new Point(groupNode.Bounds.X, groupNode.Bounds.Y + groupNode.Bounds.Height - 5), new Point(groupNode.Bounds.X + 5, groupNode.Bounds.Y + groupNode.Bounds.Height), new Point(groupNode.Bounds.X, groupNode.Bounds.Y + groupNode.Bounds.Height + 5) });
                    g.FillPolygon(new SolidBrush(m_lineColor), new Point[] { new Point(this.Bounds.Width, groupNode.Bounds.Y + groupNode.Bounds.Height - 5), new Point(this.Bounds.Width - 5, groupNode.Bounds.Y + groupNode.Bounds.Height), new Point(this.Bounds.Width, groupNode.Bounds.Y + groupNode.Bounds.Height + 5) });
                }
                else
                {
                    g.DrawLine(new Pen(m_lineColor, 2), new Point(hoveringNode.Bounds.X, hoveringNode.Bounds.Y), new Point(hoveringNode.Bounds.X + this.Bounds.Width, hoveringNode.Bounds.Y));
                    g.FillPolygon(new SolidBrush(m_lineColor), new Point[] { new Point(hoveringNode.Bounds.X, hoveringNode.Bounds.Y - 5), new Point(hoveringNode.Bounds.X + 5, hoveringNode.Bounds.Y), new Point(hoveringNode.Bounds.X, hoveringNode.Bounds.Y + 5) });
                    g.FillPolygon(new SolidBrush(m_lineColor), new Point[] { new Point(this.Bounds.Width, hoveringNode.Bounds.Y - 5), new Point(this.Bounds.Width - 5, hoveringNode.Bounds.Y), new Point(this.Bounds.Width, hoveringNode.Bounds.Y + 5) });
                }


                if (moveToGroup & toolTipped != groupNode & groupNode != null)
                {
                    ToolTipInfo info = new ToolTipInfo();
                    info.Header.Font = new Font(info.Header.Font, FontStyle.Bold);
                    info.Separator = true;

                    if (DisplayController.Instance.CanMoveDisplayToGroup(groupNode.DisplayGroup, ((DisplayNode)draggingNode).Display))
                    {
                        info.Header.Text = "Перемещение в группу";
                        info.Body.Image = Properties.Resources.move;
                    }
                    else
                    {
                        if (draggingNode.Parent == hoveringNode)
                        {
                            info.Header.Text = "Дисплей уже находится в этой группе";
                            info.Footer.Text = "Дисплей уже добавлен в эту группу, добавление не требуется";
                        }
                        else
                        {
                            info.Header.Text = "Перемещение в эту группу невозможно";
                            info.Footer.Text = "Возможно, параметры дисплея не соответствуют параметрам группы";
                        }

                        info.Body.Image = Properties.Resources.error;
                        e.Effect = DragDropEffects.None;
                    }

                    info.Body.TextImageRelation = ToolTipTextImageRelation.TextBeforeImage;
                    info.Body.Text = groupNode.Text;

                    Point p = this.PointToScreen(groupNode.Bounds.Location);
                    p.Offset(-superToolTip1.MaxWidth, 0);
                    superToolTip1.Show(info, p, 3000);

                    toolTipped = groupNode;
                }
                else
                {
                    //nop
                }
            }
            else
            {
                e.Effect = DragDropEffects.None;
            }
        }
Esempio n. 21
0
        public void TextAreaToolTipRequest(object sender, ToolTipRequestEventArgs e)
        {
            DebuggerGridControl toolTipControl = null;
            TextMarker marker = null;
            //RemoveMarker((sender as TextArea).Document);
            if (debuggedProcess == null) return;
            if (debuggedProcess.SelectedFunction == null || !debuggedProcess.IsPaused) return;
            try
            {
                TextArea textArea = (TextArea)sender;
                
                if (textArea != curTextArea) return;
                if (e.ToolTipShown) return;
                if (oldToolTipControl != null && !oldToolTipControl.AllowClose) return;
                if (!IsRunning) return;

                if (e.InDocument)
                {
                    ToolTipInfo ti = null;
                    int num_line = 0;
                    int start_off = 0;
                    int end_off = 0;
                    string var = GetVariable(e,textArea,out num_line, out start_off, out end_off);
                    if (var == null || var == "") return;
                    //if (debuggedProcess.SelectedFunction.LocalVariables.Count > 0)
                    {
                        //NamedValue nv = FindVarByName(var, num_line);
                        ListItem nv = FindVarByName(var, num_line);
                        if (nv != null)
                        {
                        	System.Threading.Thread.Sleep(50);
                        	DebuggerGridControl dgc = new DebuggerGridControl(new DynamicTreeDebuggerRow(nv));
                        	dgc.doc = textArea.Document;
                        	ti = new ToolTipInfo(dgc);
                        	ICSharpCode.TextEditor.TextLocation logicPos = e.LogicalPosition;
            				LineSegment seg = textArea.Document.GetLineSegment(logicPos.Y);
            				marker = new TextMarker(start_off, end_off-start_off+1, TextMarkerType.Cant, Color.Black, Color.White);
                        	textArea.Document.MarkerStrategy.AddMarker(marker);
                        	textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine,seg.LineNumber));
                        	textArea.Document.CommitUpdate();
                        }
                    }
                    if (ti != null)
                    {
                        toolTipControl = ti.ToolTipControl as DebuggerGridControl;
                        if (ti.ToolTipText != null)
                        {
                            e.ShowToolTip(ti.ToolTipText);
                        }
                    }
                    CloseOldToolTip();
                    if (toolTipControl != null)
                    {
                        toolTipControl.ShowForm(textArea, e.LogicalPosition);
                    }
                    oldToolTipControl = toolTipControl;
                    RemoveMarker(textArea.Document);
                    oldMarker = marker;

                }
            }
            catch (System.Exception ex)
            {
                //frm.WriteToOutputBox(ex.Message);// ICSharpCode.Core.MessageService.ShowError(ex);
            }
            finally
            {
                if (toolTipControl == null && CanCloseOldToolTip)
                {
                    CloseOldToolTip();
                    RemoveMarker((sender as TextArea).Document);
                }
            }
        }
Esempio n. 22
0
		/// <summary>
		/// 航空戦情報を設定します。
		/// </summary>
		/// <param name="phaseJet">噴式航空戦のデータ。発生していなければ null</param>
		/// <param name="phase1">第一次航空戦(通常航空戦)のデータ。</param>
		/// <param name="phase2">第二次航空戦のデータ。発生していなければ null</param>
		private void SetAerialWarfare(PhaseAirBattleBase phaseJet, PhaseAirBattleBase phase1, PhaseAirBattleBase phase2)
		{
			var phases = new[] {
				new AerialWarfareFormatter( phaseJet, "噴式戦: " ),
				new AerialWarfareFormatter( phase1, "第1次: "),
				new AerialWarfareFormatter( phase2, "第2次: "),
			};

			if (!phases[0].Enabled && !phases[2].Enabled)
				phases[1].PhaseName = "";


			void SetShootdown(ImageLabel label, int stage, bool isFriend, bool needAppendInfo)
			{
				var phasesEnabled = phases.Where(p => p.GetEnabled(stage));

				if (needAppendInfo)
				{
					label.Text = string.Join(",", phasesEnabled.Select(p => "-" + p.GetAircraftLost(stage, isFriend)));
					ToolTipInfo.SetToolTip(label, string.Join("", phasesEnabled.Select(p => $"{p.PhaseName}-{p.GetAircraftLost(stage, isFriend)}/{p.GetAircraftTotal(stage, isFriend)}\r\n")));
				}
				else
				{
					label.Text = $"-{phases[1].GetAircraftLost(stage, isFriend)}/{phases[1].GetAircraftTotal(stage, isFriend)}";
					ToolTipInfo.SetToolTip(label, null);
				}

				if (phasesEnabled.Any(p => p.GetAircraftTotal(stage, isFriend) > 0 && p.GetAircraftLost(stage, isFriend) == p.GetAircraftTotal(stage, isFriend)))
					label.ForeColor = Color.Red;
				else
					label.ForeColor = SystemColors.ControlText;

				label.ImageAlign = ContentAlignment.MiddleCenter;
				label.ImageIndex = -1;
			}

			void ClearAACutinLabel()
			{
				AACutin.Text = "対空砲火";
				AACutin.ImageAlign = ContentAlignment.MiddleCenter;
				AACutin.ImageIndex = -1;
				ToolTipInfo.SetToolTip(AACutin, null);
			}



			if (phases[1].Stage1Enabled)
			{
				bool needAppendInfo = phases[0].Stage1Enabled || phases[2].Stage1Enabled;
				var phases1 = phases.Where(p => p.Stage1Enabled);

				AirSuperiority.Text = Constants.GetAirSuperiority(phases[1].Air.AirSuperiority);

				ToolTipInfo.SetToolTip(AirSuperiority,
					needAppendInfo ? string.Join("", phases1.Select(p => $"{p.PhaseName}{Constants.GetAirSuperiority(p.Air.AirSuperiority)}\r\n")) : null);


				SetShootdown(AirStage1Friend, 1, true, needAppendInfo);
				SetShootdown(AirStage1Enemy, 1, false, needAppendInfo);

				void SetTouch(ImageLabel label, bool isFriend)
				{
					if (phases1.Any(p => p.GetTouchAircraft(isFriend) > 0))
					{
						label.ImageAlign = ContentAlignment.MiddleLeft;
						label.ImageIndex = (int)ResourceManager.EquipmentContent.Seaplane;

						ToolTipInfo.SetToolTip(label, ToolTipInfo.GetToolTip(label) +
							"触接中\r\n" + string.Join("\r\n", phases1.Select(p => $"{p.PhaseName}{(KCDatabase.Instance.MasterEquipments[p.GetTouchAircraft(isFriend)]?.Name ?? "(なし)")}")));
					}
					else
					{
						label.ImageAlign = ContentAlignment.MiddleCenter;
						label.ImageIndex = -1;
					}
				}
				SetTouch(AirStage1Friend, true);
				SetTouch(AirStage1Enemy, false);
			}
			else
			{
				AirSuperiority.Text = Constants.GetAirSuperiority(-1);
				ToolTipInfo.SetToolTip(AirSuperiority, null);

				ClearAircraftLabel(AirStage1Friend);
				ClearAircraftLabel(AirStage1Enemy);
			}


			if (phases[1].Stage2Enabled)
			{
				bool needAppendInfo = phases[0].Stage2Enabled || phases[2].Stage2Enabled;
				var phases2 = phases.Where(p => p.Stage2Enabled);

				SetShootdown(AirStage2Friend, 2, true, needAppendInfo);
				SetShootdown(AirStage2Enemy, 2, false, needAppendInfo);


				if (phases2.Any(p => p.Air.IsAACutinAvailable))
				{
					AACutin.Text = "#" + string.Join("/", phases2.Select(p => p.Air.IsAACutinAvailable ? (p.Air.AACutInIndex + 1).ToString() : "-"));
					AACutin.ImageAlign = ContentAlignment.MiddleLeft;
					AACutin.ImageIndex = (int)ResourceManager.EquipmentContent.HighAngleGun;

					ToolTipInfo.SetToolTip(AACutin, "対空カットイン\r\n" +
						string.Join("\r\n", phases2.Select(p => p.PhaseName + (p.Air.IsAACutinAvailable ? $"{p.Air.AACutInShip.NameWithLevel}\r\nカットイン種別: {p.Air.AACutInKind} ({Constants.GetAACutinKind(p.Air.AACutInKind)})" : "(発動せず)"))));
				}
				else
				{
					ClearAACutinLabel();
				}
			}
			else
			{
				ClearAircraftLabel(AirStage2Friend);
				ClearAircraftLabel(AirStage2Enemy);
				ClearAACutinLabel();
			}
		}
		private void Updated(string apiname, dynamic data)
		{

			Func<int, Color> getColorFromEventKind = (int kind) =>
			{
				switch (kind)
				{
					case 0:
					case 1:
					default:    //昼夜戦・その他
						return Utility.Configuration.Config.UI.ForeColor;
					case 2:
					case 3:     //夜戦・夜昼戦
						return Utility.Configuration.Config.UI.Compass_ColorTextEventKind3;
					case 4:     //航空戦
					case 6:     //長距離空襲戦
						return Utility.Configuration.Config.UI.Compass_ColorTextEventKind6;
					case 5:     // 敵連合
						return Utility.Configuration.Config.UI.Compass_ColorTextEventKind5;
					case 7:		// 夜昼戦(対連合艦隊)
						return Utility.Configuration.Config.UI.Compass_ColorTextEventKind3;
				}
			};

			if (apiname == "api_port/port")
			{

				BasePanel.Visible = false;

			}
			else if (apiname == "api_req_member/get_practice_enemyinfo")
			{

				TextMapArea.Text = "演习";
				TextDestination.Text = string.Format("{0} {1}", data.api_nickname, Constants.GetAdmiralRank((int)data.api_rank));
				TextDestination.Font = Utility.Configuration.Config.UI.JapFont;
				TextDestination.ImageAlign = ContentAlignment.MiddleCenter;
				TextDestination.ImageIndex = -1;
				ToolTipInfo.SetToolTip(TextDestination, null);
				TextEventKind.Text = data.api_cmt;
				TextEventKind.ForeColor = getColorFromEventKind(0);
				TextEventKind.ImageAlign = ContentAlignment.MiddleCenter;
				TextEventKind.ImageIndex = -1;
				TextEventKind.Font = Utility.Configuration.Config.UI.JapFont;
				ToolTipInfo.SetToolTip(TextEventKind, null);
				TextEventDetail.Text = string.Format("Lv. {0} / {1} exp.", data.api_level, data.api_experience[0]);
				TextEventDetail.Font = Utility.Configuration.Config.UI.JapFont;
				TextEventDetail.ImageAlign = ContentAlignment.MiddleCenter;
				TextEventDetail.ImageIndex = -1;
				ToolTipInfo.SetToolTip(TextEventDetail, null);
				TextEnemyFleetName.Text = data.api_deckname;
				TextEnemyFleetName.Font = Utility.Configuration.Config.UI.JapFont;

			}
			else
			{

				CompassData compass = KCDatabase.Instance.Battle.Compass;


				BasePanel.SuspendLayout();
				PanelEnemyFleet.Visible = false;
				PanelEnemyCandidate.Visible = false;

				_enemyFleetCandidate = null;
				_enemyFleetCandidateIndex = -1;


				TextMapArea.Text = string.Format("出击海域 : {0}-{1}{2}", compass.MapAreaID, compass.MapInfoID,
					compass.MapInfo.EventDifficulty > 0 ? " [" + Constants.GetDifficulty(compass.MapInfo.EventDifficulty, compass.MapAreaID) + "]" : "");
				{
					var mapinfo = compass.MapInfo;

					if (mapinfo.IsCleared)
					{
						ToolTipInfo.SetToolTip(TextMapArea, null);

					}
					else if (mapinfo.RequiredDefeatedCount != -1)
					{
						ToolTipInfo.SetToolTip(TextMapArea, string.Format("击破 : {0} / {1} 次", mapinfo.CurrentDefeatedCount, mapinfo.RequiredDefeatedCount));

					}
					else if (mapinfo.MapHPMax > 0)
					{
						int current = compass.MapHPCurrent > 0 ? compass.MapHPCurrent : mapinfo.MapHPCurrent;
						int max = compass.MapHPMax > 0 ? compass.MapHPMax : mapinfo.MapHPMax;

						ToolTipInfo.SetToolTip(TextMapArea, string.Format("{0}: {1} / {2}", mapinfo.GaugeType == 3 ? "TP" : "HP", current, max));

					}
					else
					{
						ToolTipInfo.SetToolTip(TextMapArea, null);
					}
				}


				TextDestination.Text = string.Format("下一航路 : {0}{1}", compass.Destination, (compass.IsEndPoint ? " ( 终点 )" : ""));
				TextDestination.Font = Utility.Configuration.Config.UI.MainFont;
				if (compass.LaunchedRecon != 0)
				{
					TextDestination.ImageAlign = ContentAlignment.MiddleRight;
					TextDestination.ImageIndex = (int)ResourceManager.EquipmentContent.Seaplane;

					string tiptext;
					switch (compass.CommentID)
					{
						case 1:
							tiptext = "发现敌舰队!";
							break;
						case 2:
							tiptext = "发现攻击目标!";
							break;
						case 3:
							tiptext = "針路哨戒!";
							break;
						default:
							tiptext = "索敌机离舰!";
							break;
					}
					ToolTipInfo.SetToolTip(TextDestination, tiptext);

				}
				else
				{
					TextDestination.ImageAlign = ContentAlignment.MiddleCenter;
					TextDestination.ImageIndex = -1;
					ToolTipInfo.SetToolTip(TextDestination, null);
				}

				//とりあえずリセット
				TextEventDetail.ImageAlign = ContentAlignment.MiddleCenter;
				TextEventDetail.ImageIndex = -1;
				ToolTipInfo.SetToolTip(TextEventDetail, null);


				TextEventKind.ForeColor = getColorFromEventKind(0);

				{
					string eventkind = Constants.GetMapEventID(compass.EventID);

					switch (compass.EventID)
					{

						case 0:     //初期位置
						case 1:     //不明
							TextEventDetail.Text = "どうしてこうなった";
							break;

						case 2:     //資源
						case 8:     //船団護衛成功
							TextEventDetail.Text = GetMaterialInfo(compass);
							TextEventDetail.Font = Utility.Configuration.Config.UI.MainFont;
							break;

						case 3:     //渦潮
							{
								int materialmax = KCDatabase.Instance.Fleet.Fleets.Values
									.Where(f => f != null && f.IsInSortie)
									.SelectMany(f => f.MembersWithoutEscaped)
									.Max(s =>
									{
										if (s == null) return 0;
										switch (compass.WhirlpoolItemID)
										{
											case 1:
												return s.Fuel;
											case 2:
												return s.Ammo;
											default:
												return 0;
										}
									});

								TextEventDetail.Text = string.Format("{0} x {1} ({2:p0})",
									Constants.GetMaterialName(compass.WhirlpoolItemID),
									compass.WhirlpoolItemAmount,
									(double)compass.WhirlpoolItemAmount / Math.Max(materialmax, 1));
								TextEventDetail.Font = Utility.Configuration.Config.UI.MainFont;

							}
							break;

						case 4:     //通常戦闘
							if (compass.EventKind >= 2)
							{
								eventkind += "/" + Constants.GetMapEventKind(compass.EventKind);

								TextEventKind.ForeColor = getColorFromEventKind(compass.EventKind);
							}
							UpdateEnemyFleet();
							break;

						case 5:     //ボス戦闘
							TextEventKind.ForeColor = Utility.Configuration.Config.UI.Color_Red;

							if (compass.EventKind >= 2)
							{
								eventkind += "/" + Constants.GetMapEventKind(compass.EventKind);
							}
							UpdateEnemyFleet();
							break;

						case 6:     //気のせいだった
							switch (compass.EventKind)
							{

								case 0:     //気のせいだった
								default:
									break;
								case 1:
									eventkind = "不见敌影";
									break;
								case 2:
									eventkind = "能动分歧";
									break;
								case 3:
									eventkind = "平稳的海面";
									break;
								case 4:
									eventkind = "平稳的海峡";
									break;
								case 5:
									eventkind = "需要提高警惕";
									break;
								case 6:
									eventkind = "安静的海洋";
									break;
								case 7:
									eventkind = "游击部队进击中";
									break;
								case 8:
									eventkind = "对潜警戒进击中";
									break;
								case 9:
									eventkind = "栗田舰队突入";
									break;
							}
							if (compass.RouteChoices != null) {
								TextEventDetail.Text = string.Join("/", compass.RouteChoices);
								TextEventDetail.Font = Utility.Configuration.Config.UI.MainFont;
							} else {
								TextEventDetail.Text = "";
							}

							break;

						case 7:     //航空戦or航空偵察
							TextEventKind.ForeColor = getColorFromEventKind(compass.EventKind);

							switch (compass.EventKind)
							{
								case 0:     //航空偵察
									eventkind = "航空侦察";

									switch (compass.AirReconnaissanceResult)
									{
										case 0:
										default:
											TextEventDetail.Text = "失败";
											TextEventDetail.Font = Utility.Configuration.Config.UI.MainFont;
											break;
										case 1:
											TextEventDetail.Text = "成功";
											TextEventDetail.Font = Utility.Configuration.Config.UI.MainFont;
											break;
										case 2:
											TextEventDetail.Text = "大成功";
											TextEventDetail.Font = Utility.Configuration.Config.UI.MainFont;
											break;
									}

									switch (compass.AirReconnaissancePlane)
									{
										case 0:
										default:
											TextEventDetail.ImageAlign = ContentAlignment.MiddleCenter;
											TextEventDetail.ImageIndex = -1;
											break;
										case 1:
											TextEventDetail.ImageAlign = ContentAlignment.MiddleLeft;
											TextEventDetail.ImageIndex = (int)ResourceManager.EquipmentContent.FlyingBoat;
											break;
										case 2:
											TextEventDetail.ImageAlign = ContentAlignment.MiddleLeft;
											TextEventDetail.ImageIndex = (int)ResourceManager.EquipmentContent.Seaplane;
											break;
									}

									if (compass.GetItems.Any())
									{
										TextEventDetail.Text += " " + GetMaterialInfo(compass);
										TextEventDetail.Font = Utility.Configuration.Config.UI.MainFont;
									}

									break;

								case 4:     //航空戦
								default:
									UpdateEnemyFleet();
									break;
							}
							break;

						case 9:     //揚陸地点
							TextEventDetail.Text = "";
							break;

						default:
							TextEventDetail.Text = "";
							break;

					}
					TextEventKind.Text = eventkind;
					TextEventKind.Font = Utility.Configuration.Config.UI.MainFont;
				}


				if (compass.HasAirRaid)
				{
					TextEventKind.ImageAlign = ContentAlignment.MiddleRight;
					TextEventKind.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedBomber;
					ToolTipInfo.SetToolTip(TextEventKind, "空袭 - " + Constants.GetAirRaidDamage(compass.AirRaidDamageKind));
				}
				else
				{
					TextEventKind.ImageAlign = ContentAlignment.MiddleCenter;
					TextEventKind.ImageIndex = -1;
					ToolTipInfo.SetToolTip(TextEventKind, null);
				}


				BasePanel.ResumeLayout();

				BasePanel.Visible = true;
			}


		}
Esempio n. 24
0
        private void Updated(string apiname, dynamic data)
        {
            Func <int, Color> getColorFromEventKind = ( int kind ) => {
                switch (kind)
                {
                case 0:
                case 1:
                default:                                //昼夜戦・その他
                    return(SystemColors.ControlText);

                case 2:
                case 3:                                 //夜戦・夜昼戦
                    return(Color.Navy);

                case 4:                                 //航空戦
                case 6:                                 //長距離空襲戦
                    return(Color.DarkGreen);
                }
            };

            if (apiname == "api_port/port")
            {
                BasePanel.Visible = false;
            }
            else if (apiname == "api_req_member/get_practice_enemyinfo")
            {
                TextMapArea.Text           = "演習";
                TextDestination.Text       = string.Format("{0} {1}", data.api_nickname, Constants.GetAdmiralRank((int)data.api_rank));
                TextDestination.ImageAlign = ContentAlignment.MiddleCenter;
                TextDestination.ImageIndex = -1;
                ToolTipInfo.SetToolTip(TextDestination, null);
                TextEventKind.Text       = data.api_cmt;
                TextEventKind.ForeColor  = getColorFromEventKind(0);
                TextEventKind.ImageAlign = ContentAlignment.MiddleCenter;
                TextEventKind.ImageIndex = -1;
                ToolTipInfo.SetToolTip(TextEventKind, null);
                TextEventDetail.Text       = string.Format("Lv. {0} / {1} exp.", data.api_level, data.api_experience[0]);
                TextEventDetail.ImageAlign = ContentAlignment.MiddleCenter;
                TextEventDetail.ImageIndex = -1;
                ToolTipInfo.SetToolTip(TextEventDetail, null);
                TextEnemyFleetName.Text = data.api_deckname;
            }
            else
            {
                CompassData compass = KCDatabase.Instance.Battle.Compass;


                BasePanel.SuspendLayout();
                PanelEnemyFleet.Visible     = false;
                PanelEnemyCandidate.Visible = false;

                _enemyFleetCandidate      = null;
                _enemyFleetCandidateIndex = -1;


                TextMapArea.Text = string.Format("出撃海域 : {0}-{1}{2}", compass.MapAreaID, compass.MapInfoID,
                                                 compass.MapInfo.EventDifficulty > 0 ? " [" + Constants.GetDifficulty(compass.MapInfo.EventDifficulty) + "]" : "");
                {
                    var mapinfo = compass.MapInfo;

                    if (mapinfo.IsCleared)
                    {
                        ToolTipInfo.SetToolTip(TextMapArea, null);
                    }
                    else if (mapinfo.RequiredDefeatedCount != -1)
                    {
                        ToolTipInfo.SetToolTip(TextMapArea, string.Format("撃破: {0} / {1} 回", mapinfo.CurrentDefeatedCount, mapinfo.RequiredDefeatedCount));
                    }
                    else if (mapinfo.MapHPMax > 0)
                    {
                        ToolTipInfo.SetToolTip(TextMapArea, string.Format("{0}: {1} / {2}", mapinfo.GaugeType == 3 ? "TP" : "HP", mapinfo.MapHPCurrent, mapinfo.MapHPMax));
                    }
                    else
                    {
                        ToolTipInfo.SetToolTip(TextMapArea, null);
                    }
                }


                TextDestination.Text = string.Format("次のセル : {0}{1}", compass.Destination, (compass.IsEndPoint ? " (終点)" : ""));
                if (compass.LaunchedRecon != 0)
                {
                    TextDestination.ImageAlign = ContentAlignment.MiddleRight;
                    TextDestination.ImageIndex = (int)ResourceManager.EquipmentContent.Seaplane;

                    string tiptext;
                    switch (compass.CommentID)
                    {
                    case 1:
                        tiptext = "敵艦隊発見!";
                        break;

                    case 2:
                        tiptext = "攻撃目標発見!";
                        break;

                    case 3:
                        tiptext = "針路哨戒!";
                        break;

                    default:
                        tiptext = "索敵機発艦!";
                        break;
                    }
                    ToolTipInfo.SetToolTip(TextDestination, tiptext);
                }
                else
                {
                    TextDestination.ImageAlign = ContentAlignment.MiddleCenter;
                    TextDestination.ImageIndex = -1;
                    ToolTipInfo.SetToolTip(TextDestination, null);
                }

                //とりあえずリセット
                TextEventDetail.ImageAlign = ContentAlignment.MiddleCenter;
                TextEventDetail.ImageIndex = -1;
                ToolTipInfo.SetToolTip(TextEventDetail, null);


                TextEventKind.ForeColor = getColorFromEventKind(0);

                {
                    string eventkind = Constants.GetMapEventID(compass.EventID);

                    switch (compass.EventID)
                    {
                    case 0:                                     //初期位置
                    case 1:                                     //不明
                        TextEventDetail.Text = "どうしてこうなった";
                        break;

                    case 2:                                     //資源
                    case 8:                                     //船団護衛成功
                        TextEventDetail.Text = GetMaterialInfo(compass);
                        break;

                    case 3:                                     //渦潮
                    {
                        int materialmax = KCDatabase.Instance.Fleet.Fleets.Values
                                          .Where(f => f != null && f.IsInSortie)
                                          .SelectMany(f => f.MembersWithoutEscaped)
                                          .Max(s => {
                                if (s == null)
                                {
                                    return(0);
                                }
                                switch (compass.WhirlpoolItemID)
                                {
                                case 1:
                                    return(s.Fuel);

                                case 2:
                                    return(s.Ammo);

                                default:
                                    return(0);
                                }
                            });

                        TextEventDetail.Text = string.Format("{0} x {1} ({2:p0})",
                                                             Constants.GetMaterialName(compass.WhirlpoolItemID),
                                                             compass.WhirlpoolItemAmount,
                                                             (double)compass.WhirlpoolItemAmount / Math.Max(materialmax, 1));
                    }
                    break;

                    case 4:                                     //通常戦闘
                        if (compass.EventKind >= 2)
                        {
                            eventkind += "/" + Constants.GetMapEventKind(compass.EventKind);

                            TextEventKind.ForeColor = getColorFromEventKind(compass.EventKind);
                        }
                        UpdateEnemyFleet();
                        break;

                    case 5:                                     //ボス戦闘
                        TextEventKind.ForeColor = Color.Red;
                        goto case 4;

                    case 6:                                     //気のせいだった
                        switch (compass.EventKind)
                        {
                        case 0:                                                 //気のせいだった
                        default:
                            TextEventDetail.Text = "";
                            break;

                        case 1:                                                 //敵影を見ず
                            eventkind            = "敵影を見ず";
                            TextEventDetail.Text = "";
                            break;

                        case 2:                                                 //能動分岐
                            eventkind            = "能動分岐";
                            TextEventDetail.Text = string.Join("/", compass.RouteChoices);
                            break;
                        }
                        break;

                    case 7:                                     //航空戦or航空偵察
                        TextEventKind.ForeColor = getColorFromEventKind(compass.EventKind);

                        switch (compass.EventKind)
                        {
                        case 0:                                                 //航空偵察
                            eventkind = "航空偵察";

                            switch (compass.AirReconnaissanceResult)
                            {
                            case 0:
                            default:
                                TextEventDetail.Text = "失敗";
                                break;

                            case 1:
                                TextEventDetail.Text = "成功";
                                break;

                            case 2:
                                TextEventDetail.Text = "大成功";
                                break;
                            }

                            switch (compass.AirReconnaissancePlane)
                            {
                            case 0:
                            default:
                                TextEventDetail.ImageAlign = ContentAlignment.MiddleCenter;
                                TextEventDetail.ImageIndex = -1;
                                break;

                            case 1:
                                TextEventDetail.ImageAlign = ContentAlignment.MiddleLeft;
                                TextEventDetail.ImageIndex = (int)ResourceManager.EquipmentContent.FlyingBoat;
                                break;

                            case 2:
                                TextEventDetail.ImageAlign = ContentAlignment.MiddleLeft;
                                TextEventDetail.ImageIndex = (int)ResourceManager.EquipmentContent.Seaplane;
                                break;
                            }

                            if (compass.GetItems.Any())
                            {
                                TextEventDetail.Text += " " + GetMaterialInfo(compass);
                            }

                            break;

                        case 4:                                                 //航空戦
                        default:
                            UpdateEnemyFleet();
                            break;
                        }
                        break;

                    case 9:                                     //揚陸地点
                        TextEventDetail.Text = "";
                        break;

                    default:
                        TextEventDetail.Text = "";
                        break;
                    }
                    TextEventKind.Text = eventkind;
                }


                if (compass.HasAirRaid)
                {
                    TextEventKind.ImageAlign = ContentAlignment.MiddleRight;
                    TextEventKind.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedBomber;
                    ToolTipInfo.SetToolTip(TextEventKind, Constants.GetAirRaidDamage(compass.AirRaidDamageKind));
                }
                else
                {
                    TextEventKind.ImageAlign = ContentAlignment.MiddleCenter;
                    TextEventKind.ImageIndex = -1;
                    ToolTipInfo.SetToolTip(TextEventKind, null);
                }


                BasePanel.ResumeLayout();

                BasePanel.Visible = true;
            }
        }
Esempio n. 25
0
        /// <summary>
        /// Occurs when ToolTipLocation ComboBox's SelectedIndex is changed. To change the ToolTipLocation of the ToolTip.
        /// </summary>
        /// <param name="sender">The sender that contains the toolTipLocationComboBox.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> that contains event data.</param>
        private void toolTipLocationComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string selectedValue = this.toolTipLocationComboBox.GetItemText(this.toolTipLocationComboBox.SelectedItem);

            pictureBox1Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox1);
            pictureBox2Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox2);
            pictureBox3Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox3);
            pictureBox4Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox4);
            pictureBox5Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox5);
            pictureBox6Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox6);
            pictureBox7Info  = this.sfToolTip1.GetToolTipInfo(this.pictureBox7);
            pictureBox10Info = this.sfToolTip1.GetToolTipInfo(this.pictureBox10);

            switch (selectedValue)
            {
            case "TopLeft":
                pictureBox1Info.ToolTipLocation  = ToolTipLocation.TopLeft;
                pictureBox2Info.ToolTipLocation  = ToolTipLocation.TopLeft;
                pictureBox3Info.ToolTipLocation  = ToolTipLocation.TopLeft;
                pictureBox4Info.ToolTipLocation  = ToolTipLocation.TopLeft;
                pictureBox5Info.ToolTipLocation  = ToolTipLocation.TopLeft;
                pictureBox6Info.ToolTipLocation  = ToolTipLocation.TopLeft;
                pictureBox7Info.ToolTipLocation  = ToolTipLocation.TopLeft;
                pictureBox10Info.ToolTipLocation = ToolTipLocation.TopLeft;
                break;

            case "TopRight":
                pictureBox1Info.ToolTipLocation  = ToolTipLocation.TopRight;
                pictureBox2Info.ToolTipLocation  = ToolTipLocation.TopRight;
                pictureBox3Info.ToolTipLocation  = ToolTipLocation.TopRight;
                pictureBox4Info.ToolTipLocation  = ToolTipLocation.TopRight;
                pictureBox5Info.ToolTipLocation  = ToolTipLocation.TopRight;
                pictureBox6Info.ToolTipLocation  = ToolTipLocation.TopRight;
                pictureBox7Info.ToolTipLocation  = ToolTipLocation.TopRight;
                pictureBox10Info.ToolTipLocation = ToolTipLocation.TopRight;
                break;

            case "TopCenter":
                pictureBox1Info.ToolTipLocation  = ToolTipLocation.TopCenter;
                pictureBox2Info.ToolTipLocation  = ToolTipLocation.TopCenter;
                pictureBox3Info.ToolTipLocation  = ToolTipLocation.TopCenter;
                pictureBox4Info.ToolTipLocation  = ToolTipLocation.TopCenter;
                pictureBox5Info.ToolTipLocation  = ToolTipLocation.TopCenter;
                pictureBox6Info.ToolTipLocation  = ToolTipLocation.TopCenter;
                pictureBox7Info.ToolTipLocation  = ToolTipLocation.TopCenter;
                pictureBox10Info.ToolTipLocation = ToolTipLocation.TopCenter;
                break;

            case "BottomCenter":
                pictureBox1Info.ToolTipLocation  = ToolTipLocation.BottomCenter;
                pictureBox2Info.ToolTipLocation  = ToolTipLocation.BottomCenter;
                pictureBox3Info.ToolTipLocation  = ToolTipLocation.BottomCenter;
                pictureBox4Info.ToolTipLocation  = ToolTipLocation.BottomCenter;
                pictureBox5Info.ToolTipLocation  = ToolTipLocation.BottomCenter;
                pictureBox6Info.ToolTipLocation  = ToolTipLocation.BottomCenter;
                pictureBox7Info.ToolTipLocation  = ToolTipLocation.BottomCenter;
                pictureBox10Info.ToolTipLocation = ToolTipLocation.BottomCenter;
                break;

            case "BottomLeft":
                pictureBox1Info.ToolTipLocation  = ToolTipLocation.BottomLeft;
                pictureBox2Info.ToolTipLocation  = ToolTipLocation.BottomLeft;
                pictureBox3Info.ToolTipLocation  = ToolTipLocation.BottomLeft;
                pictureBox4Info.ToolTipLocation  = ToolTipLocation.BottomLeft;
                pictureBox5Info.ToolTipLocation  = ToolTipLocation.BottomLeft;
                pictureBox6Info.ToolTipLocation  = ToolTipLocation.BottomLeft;
                pictureBox7Info.ToolTipLocation  = ToolTipLocation.BottomLeft;
                pictureBox10Info.ToolTipLocation = ToolTipLocation.BottomLeft;
                break;

            case "BottomRight":
                pictureBox1Info.ToolTipLocation  = ToolTipLocation.BottomRight;
                pictureBox2Info.ToolTipLocation  = ToolTipLocation.BottomRight;
                pictureBox3Info.ToolTipLocation  = ToolTipLocation.BottomRight;
                pictureBox4Info.ToolTipLocation  = ToolTipLocation.BottomRight;
                pictureBox5Info.ToolTipLocation  = ToolTipLocation.BottomRight;
                pictureBox6Info.ToolTipLocation  = ToolTipLocation.BottomRight;
                pictureBox7Info.ToolTipLocation  = ToolTipLocation.BottomRight;
                pictureBox10Info.ToolTipLocation = ToolTipLocation.BottomRight;
                break;

            case "LeftCenter":
                pictureBox1Info.ToolTipLocation  = ToolTipLocation.LeftCenter;
                pictureBox2Info.ToolTipLocation  = ToolTipLocation.LeftCenter;
                pictureBox3Info.ToolTipLocation  = ToolTipLocation.LeftCenter;
                pictureBox4Info.ToolTipLocation  = ToolTipLocation.LeftCenter;
                pictureBox5Info.ToolTipLocation  = ToolTipLocation.LeftCenter;
                pictureBox6Info.ToolTipLocation  = ToolTipLocation.LeftCenter;
                pictureBox7Info.ToolTipLocation  = ToolTipLocation.LeftCenter;
                pictureBox10Info.ToolTipLocation = ToolTipLocation.LeftCenter;
                break;

            case "RightCenter":
                pictureBox1Info.ToolTipLocation  = ToolTipLocation.RightCenter;
                pictureBox2Info.ToolTipLocation  = ToolTipLocation.RightCenter;
                pictureBox3Info.ToolTipLocation  = ToolTipLocation.RightCenter;
                pictureBox4Info.ToolTipLocation  = ToolTipLocation.RightCenter;
                pictureBox5Info.ToolTipLocation  = ToolTipLocation.RightCenter;
                pictureBox6Info.ToolTipLocation  = ToolTipLocation.RightCenter;
                pictureBox7Info.ToolTipLocation  = ToolTipLocation.RightCenter;
                pictureBox10Info.ToolTipLocation = ToolTipLocation.RightCenter;
                break;

            case "Default":
                pictureBox1Info.ToolTipLocation  = ToolTipLocation.Default;
                pictureBox2Info.ToolTipLocation  = ToolTipLocation.Default;
                pictureBox3Info.ToolTipLocation  = ToolTipLocation.Default;
                pictureBox4Info.ToolTipLocation  = ToolTipLocation.Default;
                pictureBox5Info.ToolTipLocation  = ToolTipLocation.Default;
                pictureBox6Info.ToolTipLocation  = ToolTipLocation.Default;
                pictureBox7Info.ToolTipLocation  = ToolTipLocation.Default;
                pictureBox10Info.ToolTipLocation = ToolTipLocation.Default;
                break;
            }

            SetToolTipInfo();
        }
Esempio n. 26
0
 static void widget_EventToolTip(Widget _sender, ToolTipInfo _info)
 {
     ExampleApplication.DebugOut("EventToolTip  _info=" + _info.ToString());
 }
Esempio n. 27
0
        bool ValidateInput(out float value)
        {
            value = 0;
            float f;
            if (float.TryParse(zoomCombo.Text, out f))
            {
                value = f;
                zoomCombo.Text = Math.Round(f, 0, MidpointRounding.AwayFromZero).ToString() + "%";
                return true;
            }
            else
            {
                //вернуть первоначальное значение
                if (diagram1.View != null)
                    zoomCombo.Text = Percent.GetTextForZoom(diagram1.View.Magnification);
                else
                    zoomCombo.SelectedIndex = Percent.GetIndexForPercentage(100);

                //show error
                ToolTipInfo t_info = new ToolTipInfo();
                t_info.Header.Text = "Ошибка";
                t_info.Body.Text = String.Format("Для масштаба требуется числовое значение (десятичный разделитель: \"{0}\")", CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator);
                t_info.Footer.Text = "Значение масштаба указывается в процентах";
                tip.Show(t_info, this.PointToScreen(new Point(zoomCombo.Bounds.Right, zoomCombo.Bounds.Bottom)), 1000);
                zoomCombo.ComboBox.Focus();

                return false;
            }
        }
Esempio n. 28
0
 static void widget_EventToolTip(Widget _sender, ToolTipInfo _info)
 {
     Gui.Instance.Log("TestApp", LogLevel.Info, "EventToolTip  _info=" + _info.ToString());
 }
Esempio n. 29
0
 static void widget_EventToolTip(Widget _sender, ToolTipInfo _info)
 {
     Export.DebugOut("EventToolTip  _info=" + _info.ToString());
 }
Esempio n. 30
0
 private void QuestView_CellMouseLeave(object sender, DataGridViewCellEventArgs e)
 {
     ToolTipInfo.SetToolTip(QuestView, null);
 }
Esempio n. 31
0
		private void Updated(string apiname, dynamic data)
		{

			KCDatabase db = KCDatabase.Instance;
			BattleManager bm = db.Battle;
			bool hideDuringBattle = Utility.Configuration.Config.FormBattle.HideDuringBattle;

			BaseLayoutPanel.SuspendLayout();
			TableTop.SuspendLayout();
			TableBottom.SuspendLayout();
			switch (apiname)
			{

				case "api_port/port":
					BaseLayoutPanel.Visible = false;
					ToolTipInfo.RemoveAll();
					break;

				case "api_req_map/start":
				case "api_req_map/next":
					if (!bm.Compass.HasAirRaid)
						goto case "api_port/port";

					SetFormation(bm);
					ClearSearchingResult();
					ClearBaseAirAttack();
					SetAerialWarfare(null, ((BattleBaseAirRaid)bm.BattleDay).BaseAirRaid);
					SetHPBar(bm.BattleDay);
					SetDamageRate(bm);

					BaseLayoutPanel.Visible = !hideDuringBattle;
					break;


				case "api_req_sortie/battle":
				case "api_req_practice/battle":
				case "api_req_sortie/ld_airbattle":
				case "api_req_sortie/ld_shooting":
					{

						SetFormation(bm);
						SetSearchingResult(bm.BattleDay);
						SetBaseAirAttack(bm.BattleDay.BaseAirAttack);
						SetAerialWarfare(bm.BattleDay.JetAirBattle, bm.BattleDay.AirBattle);
						SetHPBar(bm.BattleDay);
						SetDamageRate(bm);

						BaseLayoutPanel.Visible = !hideDuringBattle;
					}
					break;

				case "api_req_battle_midnight/battle":
				case "api_req_practice/midnight_battle":
					{

						SetNightBattleEvent(bm.BattleNight.NightInitial);
						SetHPBar(bm.BattleNight);
						SetDamageRate(bm);

						BaseLayoutPanel.Visible = !hideDuringBattle;
					}
					break;

				case "api_req_battle_midnight/sp_midnight":
					{

						SetFormation(bm);
						ClearBaseAirAttack();
						ClearAerialWarfare();
						ClearSearchingResult();
						SetNightBattleEvent(bm.BattleNight.NightInitial);
						SetHPBar(bm.BattleNight);
						SetDamageRate(bm);

						BaseLayoutPanel.Visible = !hideDuringBattle;
					}
					break;

				case "api_req_sortie/airbattle":
					{

						SetFormation(bm);
						SetSearchingResult(bm.BattleDay);
						SetBaseAirAttack(bm.BattleDay.BaseAirAttack);
						SetAerialWarfare(bm.BattleDay.JetAirBattle, bm.BattleDay.AirBattle, ((BattleAirBattle)bm.BattleDay).AirBattle2);
						SetHPBar(bm.BattleDay);
						SetDamageRate(bm);

						BaseLayoutPanel.Visible = !hideDuringBattle;
					}
					break;

				case "api_req_sortie/night_to_day":
					{
						// 暫定
						var battle = bm.BattleNight as BattleDayFromNight;

						SetFormation(bm);
						ClearAerialWarfare();
						ClearSearchingResult();
						ClearBaseAirAttack();
						SetNightBattleEvent(battle.NightInitial);

						if (battle.NextToDay)
						{
							SetSearchingResult(battle);
							SetBaseAirAttack(battle.BaseAirAttack);
							SetAerialWarfare(battle.JetAirBattle, battle.AirBattle);
						}

						SetHPBar(bm.BattleDay);
						SetDamageRate(bm);

						BaseLayoutPanel.Visible = !hideDuringBattle;
					}
					break;

				case "api_req_combined_battle/battle":
				case "api_req_combined_battle/battle_water":
				case "api_req_combined_battle/ld_airbattle":
				case "api_req_combined_battle/ec_battle":
				case "api_req_combined_battle/each_battle":
				case "api_req_combined_battle/each_battle_water":
				case "api_req_combined_battle/ld_shooting":
					{

						SetFormation(bm);
						SetSearchingResult(bm.BattleDay);
						SetBaseAirAttack(bm.BattleDay.BaseAirAttack);
						SetAerialWarfare(bm.BattleDay.JetAirBattle, bm.BattleDay.AirBattle);
						SetHPBar(bm.BattleDay);
						SetDamageRate(bm);

						BaseLayoutPanel.Visible = !hideDuringBattle;
					}
					break;

				case "api_req_combined_battle/airbattle":
					{

						SetFormation(bm);
						SetSearchingResult(bm.BattleDay);
						SetBaseAirAttack(bm.BattleDay.BaseAirAttack);
						SetAerialWarfare(bm.BattleDay.JetAirBattle, bm.BattleDay.AirBattle, ((BattleCombinedAirBattle)bm.BattleDay).AirBattle2);
						SetHPBar(bm.BattleDay);
						SetDamageRate(bm);

						BaseLayoutPanel.Visible = !hideDuringBattle;
					}
					break;

				case "api_req_combined_battle/midnight_battle":
				case "api_req_combined_battle/ec_midnight_battle":
					{

						SetNightBattleEvent(bm.BattleNight.NightInitial);
						SetHPBar(bm.BattleNight);
						SetDamageRate(bm);

						BaseLayoutPanel.Visible = !hideDuringBattle;
					}
					break;

				case "api_req_combined_battle/sp_midnight":
					{

						SetFormation(bm);
						ClearAerialWarfare();
						ClearSearchingResult();
						ClearBaseAirAttack();
						SetNightBattleEvent(bm.BattleNight.NightInitial);
						SetHPBar(bm.BattleNight);
						SetDamageRate(bm);

						BaseLayoutPanel.Visible = !hideDuringBattle;
					}
					break;

				case "api_req_combined_battle/ec_night_to_day":
					{
						var battle = bm.BattleNight as BattleDayFromNight;

						SetFormation(bm);
						ClearAerialWarfare();
						ClearSearchingResult();
						ClearBaseAirAttack();
						SetNightBattleEvent(battle.NightInitial);

						if (battle.NextToDay)
						{
							SetSearchingResult(battle);
							SetBaseAirAttack(battle.BaseAirAttack);
							SetAerialWarfare(battle.JetAirBattle, battle.AirBattle);
						}

						SetHPBar(battle);
						SetDamageRate(bm);

						BaseLayoutPanel.Visible = !hideDuringBattle;
					}
					break;

				case "api_req_sortie/battleresult":
				case "api_req_combined_battle/battleresult":
				case "api_req_practice/battle_result":
					{

						SetMVPShip(bm);

						BaseLayoutPanel.Visible = true;
					}
					break;

			}

			TableTop.ResumeLayout();
			TableBottom.ResumeLayout();

			BaseLayoutPanel.ResumeLayout();


			if (Utility.Configuration.Config.UI.IsLayoutFixed)
				TableTop.Width = TableTop.GetPreferredSize(BaseLayoutPanel.Size).Width;
			else
				TableTop.Width = TableBottom.ClientSize.Width;
			TableTop.Height = TableTop.GetPreferredSize(BaseLayoutPanel.Size).Height;

		}
Esempio n. 32
0
        private void UpdateEnemyFleetInstant(bool isPractice = false)
        {
            BattleManager bm = KCDatabase.Instance.Battle;
            BattleData    bd;

            switch (bm.BattleMode & BattleManager.BattleModes.BattlePhaseMask)
            {
            case BattleManager.BattleModes.NightOnly:
            case BattleManager.BattleModes.NightDay:
                bd = bm.BattleNight;
                break;

            default:
                bd = bm.BattleDay;
                break;
            }

            int[]   enemies    = bd.Initial.EnemyMembers;
            int[][] slots      = bd.Initial.EnemySlots;
            int[]   levels     = bd.Initial.EnemyLevels;
            int[][] parameters = bd.Initial.EnemyParameters;
            int[]   hps        = bd.Initial.MaxHPs;


            _enemyFleetCandidate      = null;
            _enemyFleetCandidateIndex = -1;



            if ((bm.BattleMode & BattleManager.BattleModes.BattlePhaseMask) != BattleManager.BattleModes.Practice)
            {
                var efcurrent = EnemyFleetRecord.EnemyFleetElement.CreateFromCurrentState();
                var efrecord  = RecordManager.Instance.EnemyFleet[efcurrent.FleetID];
                if (efrecord != null)
                {
                    TextEnemyFleetName.Text = efrecord.FleetName;
                }
                TextEventDetail.Text = "敵艦隊ID: " + efcurrent.FleetID.ToString("x8");
                ToolTipInfo.SetToolTip(TextEventDetail, null);
            }

            TextFormation.Text = Constants.GetFormationShort((int)bd.Searching.FormationEnemy);
            //TextFormation.ImageIndex = (int)ResourceManager.IconContent.BattleFormationEnemyLineAhead + bd.Searching.FormationEnemy - 1;
            TextFormation.Visible = true;
            {
                int air = Calculator.GetAirSuperiority(enemies, slots);
                TextAirSuperiority.Text = isPractice ?
                                          air.ToString() + " ~ " + Calculator.GetAirSuperiorityAtMaxLevel(enemies, slots).ToString() :
                                          air.ToString();
                ToolTipInfo.SetToolTip(TextAirSuperiority, GetAirSuperiorityString(isPractice ? 0 : air));
                TextAirSuperiority.Visible = true;
            }

            TableEnemyMember.SuspendLayout();
            for (int i = 0; i < ControlMembers.Length; i++)
            {
                int shipID = enemies[i];
                ControlMembers[i].Update(shipID, shipID != -1 ? slots[i] : null);

                if (shipID != -1)
                {
                    ControlMembers[i].UpdateEquipmentToolTip(shipID, slots[i], levels[i], hps[i + 6], parameters[i][0], parameters[i][1], parameters[i][2], parameters[i][3]);
                }
            }
            TableEnemyMember.ResumeLayout();
            TableEnemyMember.Visible = true;

            PanelEnemyFleet.Visible = true;

            PanelEnemyCandidate.Visible = false;

            BasePanel.Visible = true;                                   //checkme
        }
Esempio n. 33
0
        protected override void OnItemDrag(System.Windows.Forms.ItemDragEventArgs e)
        {
            ToolTipInfo info = new ToolTipInfo();
            info.Header.Font = new Font(info.Header.Font, FontStyle.Bold);
            info.Separator = true;
            info.Body.Image = Properties.Resources.error;
            info.Body.TextImageRelation = ToolTipTextImageRelation.TextBeforeImage;
            info.Body.Text = this.SelectedNode.Text;

            if (!PresentationController.Instance.PresentationLocked & LockBeforeReorder)
            {
                info.Header.Text = "Требуется блокировка сценария";
                info.Footer.Text = "Заблокируйте сценарий перед настройкой группировки.";
            }
            else
            {
                TreeNodeAdv[] nodes = e.Item as TreeNodeAdv[];
                if (nodes != null)
                {
                    TreeNodeAdv node = nodes[0];

                    if (node is DisplayGroupNode)
                    {
                        info.Header.Text = "Перетаскивание группы запрещено";
                        info.Footer.Text = "Вы не можете перетаскивать группы.";
                    }
                    else if (node is DisplayNode)
                    {
                        DragDropOperationActive = true;
                        this.DoDragDrop(node, DragDropEffects.All);
                        return;
                    }
                    else
                        throw new InvalidOperationException("Неизвестный элемент");
                }
            }

            Point p = this.PointToScreen(this.SelectedNode.Bounds.Location);
            p.Offset(-superToolTip1.MaxWidth, 0);
            superToolTip1.Show(info, p, 3000);
            toolTipped = this.SelectedNode;
        }
Esempio n. 34
0
		/// <summary>
		/// 夜戦における各種表示を設定します。
		/// </summary>
		/// <param name="hp">戦闘開始前のHP。</param>
		/// <param name="isCombined">連合艦隊かどうか。</param>
		/// <param name="bd">戦闘データ。</param>
		private void SetNightBattleEvent(PhaseNightInitial pd)
		{

			FleetData fleet = pd.FriendFleet;

			//味方探照灯判定
			{
				int index = pd.SearchlightIndexFriend;

				if (index != -1)
				{
					ShipData ship = fleet.MembersInstance[index];

					AirStage1Friend.Text = "#" + (index + (pd.IsFriendEscort ? 6 : 0) + 1);
					AirStage1Friend.ForeColor = SystemColors.ControlText;
					AirStage1Friend.ImageAlign = ContentAlignment.MiddleLeft;
					AirStage1Friend.ImageIndex = (int)ResourceManager.EquipmentContent.Searchlight;
					ToolTipInfo.SetToolTip(AirStage1Friend, "探照灯照射: " + ship.NameWithLevel);
				}
				else
				{
					ToolTipInfo.SetToolTip(AirStage1Friend, null);
				}
			}

			//敵探照灯判定
			{
				int index = pd.SearchlightIndexEnemy;
				if (index != -1)
				{
					AirStage1Enemy.Text = "#" + (index + (pd.IsEnemyEscort ? 6 : 0) + 1);
					AirStage1Enemy.ForeColor = SystemColors.ControlText;
					AirStage1Enemy.ImageAlign = ContentAlignment.MiddleLeft;
					AirStage1Enemy.ImageIndex = (int)ResourceManager.EquipmentContent.Searchlight;
					ToolTipInfo.SetToolTip(AirStage1Enemy, "探照灯照射: " + pd.SearchlightEnemyInstance.NameWithClass);
				}
				else
				{
					ToolTipInfo.SetToolTip(AirStage1Enemy, null);
				}
			}


			//夜間触接判定
			if (pd.TouchAircraftFriend != -1)
			{
				SearchingFriend.Text = "夜間触接";
				SearchingFriend.ImageIndex = (int)ResourceManager.EquipmentContent.Seaplane;
				SearchingFriend.ImageAlign = ContentAlignment.MiddleLeft;
				ToolTipInfo.SetToolTip(SearchingFriend, "夜間触接中: " + KCDatabase.Instance.MasterEquipments[pd.TouchAircraftFriend].Name);
			}
			else
			{
				ToolTipInfo.SetToolTip(SearchingFriend, null);
			}

			if (pd.TouchAircraftEnemy != -1)
			{
				SearchingEnemy.Text = "夜間触接";
				SearchingEnemy.ImageIndex = (int)ResourceManager.EquipmentContent.Seaplane;
				SearchingFriend.ImageAlign = ContentAlignment.MiddleLeft;
				ToolTipInfo.SetToolTip(SearchingEnemy, "夜間触接中: " + KCDatabase.Instance.MasterEquipments[pd.TouchAircraftEnemy].Name);
			}
			else
			{
				ToolTipInfo.SetToolTip(SearchingEnemy, null);
			}

			//照明弾投射判定
			{
				int index = pd.FlareIndexFriend;

				if (index != -1)
				{
					AirStage2Friend.Text = "#" + (index + 1);
					AirStage2Friend.ForeColor = SystemColors.ControlText;
					AirStage2Friend.ImageAlign = ContentAlignment.MiddleLeft;
					AirStage2Friend.ImageIndex = (int)ResourceManager.EquipmentContent.Flare;
					ToolTipInfo.SetToolTip(AirStage2Friend, "照明弾投射: " + pd.FlareFriendInstance.NameWithLevel);

				}
				else
				{
					ToolTipInfo.SetToolTip(AirStage2Friend, null);
				}
			}

			{
				int index = pd.FlareIndexEnemy;

				if (index != -1)
				{
					AirStage2Enemy.Text = "#" + (index + 1);
					AirStage2Enemy.ForeColor = SystemColors.ControlText;
					AirStage2Enemy.ImageAlign = ContentAlignment.MiddleLeft;
					AirStage2Enemy.ImageIndex = (int)ResourceManager.EquipmentContent.Flare;
					ToolTipInfo.SetToolTip(AirStage2Enemy, "照明弾投射: " + pd.FlareEnemyInstance.NameWithClass);
				}
				else
				{
					ToolTipInfo.SetToolTip(AirStage2Enemy, null);
				}
			}
		}
Esempio n. 35
0
        public Form1()
        {
            InitializeComponent();
            this.BackColor = Color.White;

            PopulationViewModel data = new PopulationViewModel();

            TreeMap1.ItemsSource              = data.PopulationDetails;
            TreeMap1.WeightValuePath          = "Population";
            TreeMap1.ColorValuePath           = "Growth"; //"Population";
            TreeMap1.LegendSetting.LegendType = LegendTypes.Ellipse;
            TreeMap1.LegendSetting.LegendGap  = 130;
            TreeMap1.LegendSetting.ShowLegend = true;
            //TreeMap1.IsLegendVisible = false;
            TreeMap1.LegendSetting.LegendPosition = LegendPositions.Top;
            TreeMap1.Dock            = DockStyle.Fill;
            TreeMap1.ItemsLayoutMode = Syncfusion.Windows.Forms.TreeMap.ItemsLayoutModes.SliceAndDiceAuto;
            ToolTipInfo itemInfoHead = new ToolTipInfo();

            itemInfoHead.ToolTipHeaderPattern  = "<b>{Label}</b>";
            itemInfoHead.ToolTipContentPattern = "Growth \t  :  {Growth} % ";
            TreeMap1.HeaderToolTipInfo         = itemInfoHead;
            ToolTipInfo itemInfo = new ToolTipInfo();

            itemInfo.ToolTipHeaderPattern  = "<b>{Country}</b>";
            itemInfo.ToolTipContentPattern = "Growth \t      :  {Growth} %  \nPopulation   :  {StrPopulation}  ";
            TreeMap1.ItemToolTipInfo       = itemInfo;
            #region ColorMapping

            #region UniColorMapping

            uniColorMapping.Color = Color.MediumSlateBlue;

            #endregion


            #region RangeColorMapping

            rangeBrushColorMapping.Brushes.Add(new RangeBrush()
            {
                Color = System.Drawing.ColorTranslator.FromHtml("#77D8D8"), From = 0, To = 1, LegendLabel = "1% Growth"
            });
            rangeBrushColorMapping.Brushes.Add(new RangeBrush()
            {
                Color = System.Drawing.ColorTranslator.FromHtml("#AED960"), From = 0, To = 2, LegendLabel = "2% Growth"
            });
            rangeBrushColorMapping.Brushes.Add(new RangeBrush()
            {
                Color = System.Drawing.ColorTranslator.FromHtml("#FFAF51"), From = 0, To = 3, LegendLabel = "3% Growth"
            });
            rangeBrushColorMapping.Brushes.Add(new RangeBrush()
            {
                Color = System.Drawing.ColorTranslator.FromHtml("#F3D240"), From = 0, To = 4, LegendLabel = "4% Growth"
            });

            #endregion


            #region DesaturationColorMapping

            desaturationColorMapping.Color        = Color.OrangeRed;
            desaturationColorMapping.From         = 220;
            desaturationColorMapping.To           = 0;
            desaturationColorMapping.RangeMinimum = 0;
            desaturationColorMapping.RangeMaximum = 80000;
            this.TreeMap1.LeafColorMapping        = desaturationColorMapping;

            #endregion

            #region PaletteColorMapping

            paletteColorMapping.Colors = new List <Brush>()
            {
                new SolidBrush(Color.MediumSeaGreen),
                new SolidBrush(Color.PaleVioletRed),
                new SolidBrush(Color.MediumSlateBlue),
            };

            #endregion


            #endregion

            TreeMap1.LeafItemSettings.LabelPath = "Country";
            splitter.Dock   = DockStyle.Top;
            splitter.Height = 40;
            userOptionsGroupBox.Controls.Add(splitter);

            layoutModeComboBox.Items.Add("UniColorMapping");
            layoutModeComboBox.Items.Add("RangeColorMapping");
            layoutModeComboBox.Items.Add("DesaturationColorMapping");
            layoutModeComboBox.Items.Add("PaletteColorMapping");
            layoutModeComboBox.SelectedIndex         = 2;
            layoutModeComboBox.KeyDown              += layoutModeComboBox_KeyDown;
            layoutModeComboBox.Dock                  = DockStyle.Top;
            layoutModeComboBox.SelectedValueChanged += layoutModeComboBox_SelectedValueChanged;
            userOptionsGroupBox.Controls.Add(layoutModeComboBox);

            layoutModeLabel.Text    = "Color Mapping:";
            layoutModeLabel.Height  = (int)DpiAware.LogicalToDeviceUnits(layoutModeLabel.Height);
            layoutModeLabel.Dock    = DockStyle.Top;
            layoutModeLabel.Font    = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            layoutModeComboBox.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            userOptionsGroupBox.Controls.Add(layoutModeLabel);
            userOptionsGroupBox.Padding = new System.Windows.Forms.Padding(20, 20, 20, 30);
            userOptionsGroupBox.Dock    = DockStyle.Right;
            userOptionsGroupBox.Width   = (int)DpiAware.LogicalToDeviceUnits(userOptionsGroupBox.Width);

            treeMapPanel.Dock = DockStyle.Fill;
            treeMapPanel.Controls.Add(TreeMap1);
            treeMapPanel.Controls.Add(userOptionsGroupBox);
            this.Controls.Add(treeMapPanel);

            sampleHeader.Text      = "This sample demonstrates the various types of  Color Mapping available in TreeMap.";
            sampleHeader.Font      = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            sampleHeader.Location  = new Point(10, 10);
            sampleHeader.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(150)))), ((int)(((byte)(205)))));
            sampleHeader.ForeColor = System.Drawing.Color.White;
            sampleHeader.Location  = new System.Drawing.Point(0, 0);
            sampleHeader.Size      = new System.Drawing.Size(284, (int)DpiAware.LogicalToDeviceUnits(33));
            sampleHeader.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            sampleHeader.Dock      = DockStyle.Top;
            this.Controls.Add(sampleHeader);
        }
Esempio n. 36
0
        public override bool AcceptChanges()
        {
            if (!(source is ResourceDescriptor))
                return true;

            ToolTipInfo t_info = new ToolTipInfo();
            t_info.Body.Image = Resources.error;
            t_info.Header.Text = "Ошибка";

            Point p = this.PointToScreen(propertyGrid.Location);
            p.Offset(propertyGrid.Width, 0);

            var res = SourcesController.Instance.GetResources((source as ResourceDescriptor).IsLocal);
            if (res.Count() > 0)
                if (res.Any(NameEquals))
                {
                    t_info.Body.Text = String.Format("Источник с названием {0} уже есть в хранилище. Укажите другое имя", (destInfo as ResourceInfo).Name);
                    superToolTip1.Show(t_info, p);
                    return false;
                }

            ISupportValidation validation = destInfo as ISupportValidation;
            string message;
            if (validation != null)
            {
                if (!validation.EnsureValidate(out message))
                {
                    t_info.Body.Text = message;
                    superToolTip1.Show(t_info, p);
                    return false;
                }
                else if (!(string.IsNullOrEmpty(message) || message.Equals("OK")) && (!_isNewSource))
                {
                    //валидация прошла но вернулось какое то предупреждающее сообщение, 
                    //надо дать выбор пользователю, продолжить или нет
                    DialogResult dRes = MessageBoxExt.Show(message, "Предупреждение", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                    if (dRes == DialogResult.Cancel)
                        return false;
                }
            }

            (source as ResourceDescriptor).ResourceInfo = destInfo as ResourceInfo;
            //ISupportCustomSaveState customObject = destInfo as ISupportCustomSaveState;
            //if (customObject!=null)
            //{
            //    ((ISupportCustomSaveState)customObject).SetState(resourceContexts);
            //}
            
            DialogResult = DialogResult.OK;

            CloseMe();
            return true;
        }
        private void UpdateAlbumPage(int equipmentID)
        {
            KCDatabase          db = KCDatabase.Instance;
            EquipmentDataMaster eq = db.MasterEquipments[equipmentID];

            if (eq == null)
            {
                return;
            }


            BasePanelEquipment.SuspendLayout();


            //header
            EquipmentID.Tag  = equipmentID;
            EquipmentID.Text = eq.EquipmentID.ToString();
            ToolTipInfo.SetToolTip(EquipmentID, string.Format("Type: [ {0} ]", string.Join(", ", eq.EquipmentType)));
            AlbumNo.Text = eq.AlbumNo.ToString();


            TableEquipmentName.SuspendLayout();

            EquipmentType.Text = eq.CategoryTypeInstance.Name;

            {
                int eqicon = eq.IconType;
                if (eqicon >= (int)ResourceManager.EquipmentContent.Locked)
                {
                    eqicon = (int)ResourceManager.EquipmentContent.Unknown;
                }
                EquipmentType.ImageIndex = eqicon;

                ToolTipInfo.SetToolTip(EquipmentType, GetEquippableShips(equipmentID));
            }
            EquipmentName.Text = eq.Name;
            ToolTipInfo.SetToolTip(EquipmentName, "(右クリックでコピー)");

            TableEquipmentName.ResumeLayout();


            //main parameter
            TableParameterMain.SuspendLayout();

            SetParameterText(Firepower, eq.Firepower);
            SetParameterText(Torpedo, eq.Torpedo);
            SetParameterText(AA, eq.AA);
            SetParameterText(Armor, eq.Armor);
            SetParameterText(ASW, eq.ASW);
            SetParameterText(Evasion, eq.Evasion);
            SetParameterText(LOS, eq.LOS);
            SetParameterText(Accuracy, eq.Accuracy);
            SetParameterText(Bomber, eq.Bomber);

            if (eq.CategoryType == EquipmentTypes.Interceptor)
            {
                TitleAccuracy.Text       = "対爆";
                TitleAccuracy.ImageIndex = (int)ResourceManager.IconContent.ParameterAntiBomber;
                TitleEvasion.Text        = "迎撃";
                TitleEvasion.ImageIndex  = (int)ResourceManager.IconContent.ParameterInterception;
            }
            else
            {
                TitleAccuracy.Text       = "命中";
                TitleAccuracy.ImageIndex = (int)ResourceManager.IconContent.ParameterAccuracy;
                TitleEvasion.Text        = "回避";
                TitleEvasion.ImageIndex  = (int)ResourceManager.IconContent.ParameterEvasion;
            }

            TableParameterMain.ResumeLayout();


            //sub parameter
            TableParameterSub.SuspendLayout();

            Speed.Text        = "なし";      //Constants.GetSpeed( eq.Speed );
            Range.Text        = Constants.GetRange(eq.Range);
            Rarity.Text       = Constants.GetEquipmentRarity(eq.Rarity);
            Rarity.ImageIndex = (int)ResourceManager.IconContent.RarityRed + Constants.GetEquipmentRarityID(eq.Rarity);                 //checkme

            TableParameterSub.ResumeLayout();


            // aircraft
            if (eq.IsAircraft)
            {
                TableAircraft.SuspendLayout();
                AircraftCost.Text = eq.AircraftCost.ToString();
                ToolTipInfo.SetToolTip(AircraftCost, "配備時のボーキ消費:" + ((eq.IsCombatAircraft ? 18 : 4) * eq.AircraftCost));
                AircraftDistance.Text = eq.AircraftDistance.ToString();
                TableAircraft.ResumeLayout();
                TableAircraft.Visible = true;
            }
            else
            {
                TableAircraft.Visible = false;
            }


            //default equipment
            DefaultSlots.BeginUpdate();
            DefaultSlots.Items.Clear();
            foreach (var ship in KCDatabase.Instance.MasterShips.Values)
            {
                if (ship.DefaultSlot != null && ship.DefaultSlot.Contains(equipmentID))
                {
                    DefaultSlots.Items.Add(ship);
                }
            }
            DefaultSlots.EndUpdate();


            Description.Text = eq.Message;


            //arsenal
            TableArsenal.SuspendLayout();

            MaterialFuel.Text    = eq.Material[0].ToString();
            MaterialAmmo.Text    = eq.Material[1].ToString();
            MaterialSteel.Text   = eq.Material[2].ToString();
            MaterialBauxite.Text = eq.Material[3].ToString();

            TableArsenal.ResumeLayout();



            //装備画像を読み込んでみる
            {
                var img =
                    KCResourceHelper.LoadEquipmentImage(equipmentID, KCResourceHelper.ResourceTypeEquipmentCard) ??
                    KCResourceHelper.LoadEquipmentImage(equipmentID, KCResourceHelper.ResourceTypeEquipmentCardSmall);

                if (img != null)
                {
                    EquipmentImage.Image?.Dispose();
                    EquipmentImage.Image = img;
                }
                else
                {
                    EquipmentImage.Image?.Dispose();
                    EquipmentImage.Image = null;
                }
            }


            BasePanelEquipment.ResumeLayout();
            BasePanelEquipment.Visible = true;


            this.Text = "装備図鑑 - " + eq.Name;
        }
Esempio n. 38
0
		/// <summary>
		/// 両軍のHPゲージを設定します。
		/// </summary>
		private void SetHPBar(BattleData bd)
		{

			KCDatabase db = KCDatabase.Instance;
			bool isPractice = bd.IsPractice;
			bool isFriendCombined = bd.IsFriendCombined;
			bool isEnemyCombined = bd.IsEnemyCombined;
			bool isBaseAirRaid = bd.IsBaseAirRaid;
			bool hasFriend7thShip = bd.Initial.FriendMaxHPs.Count(hp => hp > 0) == 7;

			var initial = bd.Initial;
			var resultHPs = bd.ResultHPs;
			var attackDamages = bd.AttackDamages;


			foreach (var bar in HPBars)
				bar.SuspendUpdate();


			void EnableHPBar(int index, int initialHP, int resultHP, int maxHP)
			{
				HPBars[index].Value = resultHP;
				HPBars[index].PrevValue = initialHP;
				HPBars[index].MaximumValue = maxHP;
				HPBars[index].BackColor = SystemColors.Control;
				HPBars[index].Visible = true;
			}

			void DisableHPBar(int index)
			{
				HPBars[index].Visible = false;
			}



			// friend main
			for (int i = 0; i < initial.FriendInitialHPs.Length; i++)
			{
				int refindex = BattleIndex.Get(BattleSides.FriendMain, i);

				if (initial.FriendInitialHPs[i] != -1)
				{
					EnableHPBar(refindex, initial.FriendInitialHPs[i], resultHPs[refindex], initial.FriendMaxHPs[i]);

					string name;
					bool isEscaped;
					bool isLandBase;

					var bar = HPBars[refindex];

					if (isBaseAirRaid)
					{
						name = string.Format("第{0}基地", i + 1);
						isEscaped = false;
						isLandBase = true;
						bar.Text = "LB";        //note: Land Base (Landing Boat もあるらしいが考えつかなかったので)

					}
					else
					{
						ShipData ship = bd.Initial.FriendFleet.MembersInstance[i];
						name = ship.NameWithLevel;
						isEscaped = bd.Initial.FriendFleet.EscapedShipList.Contains(ship.MasterID);
						isLandBase = ship.MasterShip.IsLandBase;
						bar.Text = Constants.GetShipClassClassification(ship.MasterShip.ShipType);
					}

					ToolTipInfo.SetToolTip(bar, string.Format
						("{0}\r\nHP: ({1} → {2})/{3} ({4}) [{5}]\r\n与ダメージ: {6}\r\n\r\n{7}",
						name,
						Math.Max(bar.PrevValue, 0),
						Math.Max(bar.Value, 0),
						bar.MaximumValue,
						bar.Value - bar.PrevValue,
						Constants.GetDamageState((double)bar.Value / bar.MaximumValue, isPractice, isLandBase, isEscaped),
						attackDamages[refindex],
						bd.GetBattleDetail(refindex)
						));

					if (isEscaped) bar.BackColor = Color.Silver;
					else bar.BackColor = SystemColors.Control;
				}
				else
				{
					DisableHPBar(refindex);
				}
			}


			// enemy main
			for (int i = 0; i < initial.EnemyInitialHPs.Length; i++)
			{
				int refindex = BattleIndex.Get(BattleSides.EnemyMain, i);

				if (initial.EnemyInitialHPs[i] != -1)
				{
					EnableHPBar(refindex, initial.EnemyInitialHPs[i], resultHPs[refindex], initial.EnemyMaxHPs[i]);
					ShipDataMaster ship = bd.Initial.EnemyMembersInstance[i];

					var bar = HPBars[refindex];
					bar.Text = Constants.GetShipClassClassification(ship.ShipType);

					ToolTipInfo.SetToolTip(bar,
						string.Format("{0} Lv. {1}\r\nHP: ({2} → {3})/{4} ({5}) [{6}]\r\n\r\n{7}",
							ship.NameWithClass,
							initial.EnemyLevels[i],
							Math.Max(bar.PrevValue, 0),
							Math.Max(bar.Value, 0),
							bar.MaximumValue,
							bar.Value - bar.PrevValue,
							Constants.GetDamageState((double)bar.Value / bar.MaximumValue, isPractice, ship.IsLandBase),
							bd.GetBattleDetail(refindex)
							)
						);
				}
				else
				{
					DisableHPBar(refindex);
				}
			}


			// friend escort
			if (isFriendCombined)
			{
				FleetFriendEscort.Visible = true;

				for (int i = 0; i < initial.FriendInitialHPsEscort.Length; i++)
				{
					int refindex = BattleIndex.Get(BattleSides.FriendEscort, i);

					if (initial.FriendInitialHPsEscort[i] != -1)
					{
						EnableHPBar(refindex, initial.FriendInitialHPsEscort[i], resultHPs[refindex], initial.FriendMaxHPsEscort[i]);

						ShipData ship = bd.Initial.FriendFleetEscort.MembersInstance[i];
						bool isEscaped = bd.Initial.FriendFleetEscort.EscapedShipList.Contains(ship.MasterID);

						var bar = HPBars[refindex];
						bar.Text = Constants.GetShipClassClassification(ship.MasterShip.ShipType);

						ToolTipInfo.SetToolTip(bar, string.Format(
							"{0} Lv. {1}\r\nHP: ({2} → {3})/{4} ({5}) [{6}]\r\n与ダメージ: {7}\r\n\r\n{8}",
							ship.MasterShip.NameWithClass,
							ship.Level,
							Math.Max(bar.PrevValue, 0),
							Math.Max(bar.Value, 0),
							bar.MaximumValue,
							bar.Value - bar.PrevValue,
							Constants.GetDamageState((double)bar.Value / bar.MaximumValue, isPractice, ship.MasterShip.IsLandBase, isEscaped),
							attackDamages[refindex],
							bd.GetBattleDetail(refindex)
							));

						if (isEscaped) bar.BackColor = Color.Silver;
						else bar.BackColor = SystemColors.Control;
					}
					else
					{
						DisableHPBar(refindex);
					}
				}

			}
			else
			{
				FleetFriendEscort.Visible = false;

				foreach (var i in BattleIndex.FriendEscort.Skip(Math.Max(bd.Initial.FriendFleet.Members.Count - 6, 0)))
					DisableHPBar(i);
			}

			MoveHPBar(hasFriend7thShip);



			// enemy escort
			if (isEnemyCombined)
			{
				FleetEnemyEscort.Visible = true;

				for (int i = 0; i < 6; i++)
				{
					int refindex = BattleIndex.Get(BattleSides.EnemyEscort, i);

					if (initial.EnemyInitialHPsEscort[i] != -1)
					{
						EnableHPBar(refindex, initial.EnemyInitialHPsEscort[i], resultHPs[refindex], initial.EnemyMaxHPsEscort[i]);

						ShipDataMaster ship = bd.Initial.EnemyMembersEscortInstance[i];

						var bar = HPBars[refindex];
						bar.Text = Constants.GetShipClassClassification(ship.ShipType);

						ToolTipInfo.SetToolTip(bar,
							string.Format("{0} Lv. {1}\r\nHP: ({2} → {3})/{4} ({5}) [{6}]\r\n\r\n{7}",
								ship.NameWithClass,
								bd.Initial.EnemyLevelsEscort[i],
								Math.Max(bar.PrevValue, 0),
								Math.Max(bar.Value, 0),
								bar.MaximumValue,
								bar.Value - bar.PrevValue,
								Constants.GetDamageState((double)bar.Value / bar.MaximumValue, isPractice, ship.IsLandBase),
								bd.GetBattleDetail(refindex)
								)
							);
					}
					else
					{
						DisableHPBar(refindex);
					}
				}

			}
			else
			{
				FleetEnemyEscort.Visible = false;

				foreach (var i in BattleIndex.EnemyEscort)
					DisableHPBar(i);
			}




			if ((isFriendCombined || (hasFriend7thShip && !Utility.Configuration.Config.FormBattle.Display7thAsSingleLine)) && isEnemyCombined)
			{
				foreach (var bar in HPBars)
				{
					bar.Size = SmallBarSize;
					bar.Text = null;
				}
			}
			else
			{
				bool showShipType = Utility.Configuration.Config.FormBattle.ShowShipTypeInHPBar;

				foreach (var bar in HPBars)
				{
					bar.Size = DefaultBarSize;

					if (!showShipType)
						bar.Text = "HP:";
				}
			}


			{   // support
				PhaseSupport support = null;

				if (bd is BattleDayFromNight bddn)
				{
					if (bddn.NightSupport?.IsAvailable ?? false)
						support = bddn.NightSupport;
				}
				if (support == null)
					support = bd.Support;

				if (support?.IsAvailable ?? false)
				{

					switch (support.SupportFlag)
					{
						case 1:
							FleetFriend.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedTorpedo;
							break;
						case 2:
							FleetFriend.ImageIndex = (int)ResourceManager.EquipmentContent.MainGunL;
							break;
						case 3:
							FleetFriend.ImageIndex = (int)ResourceManager.EquipmentContent.Torpedo;
							break;
						case 4:
							FleetFriend.ImageIndex = (int)ResourceManager.EquipmentContent.DepthCharge;
							break;
						default:
							FleetFriend.ImageIndex = (int)ResourceManager.EquipmentContent.Unknown;
							break;
					}

					FleetFriend.ImageAlign = ContentAlignment.MiddleLeft;
					ToolTipInfo.SetToolTip(FleetFriend, "支援攻撃\r\n" + support.GetBattleDetail());

					if ((isFriendCombined || hasFriend7thShip) && isEnemyCombined)
						FleetFriend.Text = "自軍";
					else
						FleetFriend.Text = "自軍艦隊";

				}
				else
				{
					FleetFriend.ImageIndex = -1;
					FleetFriend.ImageAlign = ContentAlignment.MiddleCenter;
					FleetFriend.Text = "自軍艦隊";
					ToolTipInfo.SetToolTip(FleetFriend, null);

				}
			}


			if (bd.Initial.IsBossDamaged)
				HPBars[BattleIndex.EnemyMain1].BackColor = Color.MistyRose;

			if (!isBaseAirRaid)
			{
				foreach (int i in bd.MVPShipIndexes)
					HPBars[BattleIndex.Get(BattleSides.FriendMain, i)].BackColor = Color.Moccasin;

				if (isFriendCombined)
				{
					foreach (int i in bd.MVPShipCombinedIndexes)
						HPBars[BattleIndex.Get(BattleSides.FriendEscort, i)].BackColor = Color.Moccasin;
				}
			}

			foreach (var bar in HPBars)
				bar.ResumeUpdate();
		}
Esempio n. 39
0
        bool ValidateInput(out float value)
        {
            value = 0;
            float f;
            if (float.TryParse(Text, out f))
            {
                value = f;
                return true;
            }
            else
            {
                //вернуть первоначальное значение
                if (_view != null)
                    Text = ZoomComboHelper.GetTextForZoom(_view.Magnification);
                else
                    base.SelectedIndex = ZoomComboHelper.GetIndexForPercentage(100);
               
                //show error
                ToolTipInfo t_info = new ToolTipInfo();
                t_info.Body.Image = Properties.Resources.error;
                t_info.Header.Text = "Ошибка";
                t_info.Body.Text = String.Format("Для масштаба требуется числовое значение (десятичный разделитель: \"{0}\")", CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator);
                t_info.Footer.Text = "Значение масштаба указывается в процентах";
                tip.Show(t_info, this.Parent.PointToScreen(new Point(this.Bounds.Right, this.Bounds.Bottom)), 1000);
                this.ComboBox.Focus();

                return false;
            }
        }
        public override bool AcceptChanges()
        {
            char[] restrict_symbols = { '/', '|', '\\', '<', '>', '"', '?', '.', ':' };

            ToolTipInfo t_info = new ToolTipInfo();
            t_info.Body.Image = Resources.error;
            t_info.Header.Text = "Ошибка";

            Point p = nameText.Location;
            p.Offset(0, nameText.Height);

            if (nameText.Text.ToCharArray().Any(restrict_symbols.Contains))
            {
                nameText.Focus();
                t_info.Body.Text = "Некорректно введенные данные";
                superToolTip1.Show(t_info, PointToScreen(p));
                return false;
            }

            info.Name = info.Name.Trim();
            if (String.IsNullOrEmpty(nameText.Text.Trim()))
            {
                nameText.Focus();
                //https://sentinel2.luxoft.com/sen/issues/browse/PMEDIAINFOVISDEV-347
                MessageBoxExt.Show("Заполните обязательное поле <Название>", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                //t_info.Body.Text = "Заполните обязательное поле <Название>";
                //superToolTip1.Show(t_info, PointToScreen(p));
                return false;
            }

            nameText.Text = nameText.Text.Trim();

            if (_isCreateNew)
            {
                Mutex presentationMutex = new Mutex(false, "Created::" + nameText.Text);
                if (!presentationMutex.WaitOne(5, true))
                {
                    //already creating
                    MessageBoxExt.Show(String.Format("Сценарий с названием \"{0}{1}\" уже создается на этом компьютере!", nameText.Text.Length > 30 ? nameText.Text.Substring(0, 30) : nameText.Text, nameText.Text.Length > 30 ? "..." : String.Empty), "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return false;
                }

                presentationMutex.ReleaseMutex();
            }
            if (PresentationListController.Instance.IsUniqueName(nameText.Text, _isCreateNew ? String.Empty : DestInfo.Name))
            {
                //https://sentinel2.luxoft.com/sen/issues/browse/PMEDIAINFOVISDEV-1305
                // тупо сохраняем, другого метода не нашел
                SaveChanges();
                PresentationListController.Instance.AcceptChangeProperties(info, DestInfo);
                this.DialogResult = DialogResult.OK;
                return true;
            }
            else
            {
                nameText.Focus();
                t_info.Body.Text = String.Format("Сценарий с названием \"{0}{1}\" уже существует! Введите другое название", nameText.Text.Length > 30 ? nameText.Text.Substring(0, 30) : nameText.Text, nameText.Text.Length > 30 ? "..." : String.Empty);
                superToolTip1.Show(t_info, PointToScreen(p));
            }

            nameText.Focus();
            nameText.SelectAll();
            return false;
        }
Esempio n. 41
0
        private void Updated(string apiname, dynamic data)
        {
            Func <int, Color> getColorFromEventKind = ( int kind ) => {
                switch (kind)
                {
                case 0:
                case 1:
                default:                                //昼夜戦・その他
                    return(SystemColors.ControlText);

                case 2:
                case 3:                                 //夜戦・夜昼戦
                    return(Color.Navy);

                case 4:                                 //航空戦
                    return(Color.DarkGreen);
                }
            };

            if (apiname == "api_port/port")
            {
                BasePanel.Visible = false;
            }
            else if (apiname == "api_req_member/get_practice_enemyinfo")
            {
                TextMapArea.Text        = "演習";
                TextDestination.Text    = string.Format("{0} {1}", data.api_nickname, Constants.GetAdmiralRank((int)data.api_rank));
                TextEventKind.Text      = data.api_cmt;
                TextEventKind.ForeColor = getColorFromEventKind(0);
                TextEventDetail.Text    = string.Format("Lv. {0} / {1} exp.", data.api_level, data.api_experience[0]);
                TextEnemyFleetName.Text = data.api_deckname;
            }
            else
            {
                CompassData compass = KCDatabase.Instance.Battle.Compass;


                BasePanel.SuspendLayout();
                PanelEnemyFleet.Visible = false;


                TextMapArea.Text = string.Format("出撃海域 : {0}-{1}", compass.MapAreaID, compass.MapInfoID);

                TextDestination.Text = string.Format("次のセル : {0}{1}", compass.Destination, (compass.IsEndPoint ? " (終点)" : ""));
                if (compass.LaunchedRecon != 0)
                {
                    TextDestination.ImageAlign = ContentAlignment.MiddleRight;
                    TextDestination.ImageIndex = (int)ResourceManager.EquipmentContent.Seaplane;

                    string tiptext;
                    switch (compass.CommentID)
                    {
                    case 1:
                        tiptext = "敵艦隊発見!";
                        break;

                    case 2:
                        tiptext = "攻撃目標発見!";
                        break;

                    default:
                        tiptext = "索敵機発艦!";
                        break;
                    }
                    ToolTipInfo.SetToolTip(TextDestination, tiptext);
                }
                else
                {
                    TextDestination.ImageAlign = ContentAlignment.MiddleCenter;
                    TextDestination.ImageIndex = -1;
                    ToolTipInfo.SetToolTip(TextDestination, null);
                }


                TextEventKind.ForeColor = getColorFromEventKind(0);

                {
                    string eventkind = Constants.GetMapEventID(compass.EventID);

                    switch (compass.EventID)
                    {
                    case 0:                                     //初期位置
                    case 1:                                     //不明
                        TextEventDetail.Text = "どうしてこうなった";
                        break;

                    case 2:                                     //資源
                    case 8:                                     //船団護衛成功
                    {
                        string materialname;
                        if (compass.GetItemID == 4)                                                     //"※" 大方資源専用ID

                        {
                            materialname = Constants.GetMaterialName(compass.GetItemIDMetadata);
                        }
                        else
                        {
                            UseItemMaster item = KCDatabase.Instance.MasterUseItems[compass.GetItemIDMetadata];
                            if (item != null)
                            {
                                materialname = item.Name;
                            }
                            else
                            {
                                materialname = "謎のアイテム";
                            }
                        }

                        TextEventDetail.Text = materialname + " x " + compass.GetItemAmount;
                    }

                    break;

                    case 3:                                     //渦潮
                    {
                        int materialmax = KCDatabase.Instance.Fleet.Fleets.Values
                                          .Where(f => f != null && f.IsInSortie)
                                          .SelectMany(f => f.MembersWithoutEscaped)
                                          .Max(s => {
                                if (s == null)
                                {
                                    return(0);
                                }
                                switch (compass.WhirlpoolItemID)
                                {
                                case 1:
                                    return(s.Fuel);

                                case 2:
                                    return(s.Ammo);

                                default:
                                    return(0);
                                }
                            });

                        TextEventDetail.Text = string.Format("{0} x {1} ({2:p0})",
                                                             Constants.GetMaterialName(compass.WhirlpoolItemID),
                                                             compass.WhirlpoolItemAmount,
                                                             (double)compass.WhirlpoolItemAmount / Math.Max(materialmax, 1));
                    }
                    break;

                    case 4:                                     //通常戦闘
                    case 5:                                     //ボス戦闘
                        if (compass.EventKind >= 2)
                        {
                            eventkind += "/" + Constants.GetMapEventKind(compass.EventKind);

                            TextEventKind.ForeColor = getColorFromEventKind(compass.EventKind);
                        }
                        UpdateEnemyFleet(compass.EnemyFleetID);
                        break;

                    case 6:                                     //気のせいだった
                        TextEventDetail.Text = "";
                        break;

                    case 7:                                     //航空戦(連合艦隊)
                        if (compass.EventKind >= 2)
                        {
                            if (compass.EventKind != 4)                                         //必ず"航空戦"のはずなので除外
                            {
                                eventkind += "/" + Constants.GetMapEventKind(compass.EventKind);
                            }
                            TextEventKind.ForeColor = getColorFromEventKind(compass.EventKind);
                        }
                        UpdateEnemyFleet(compass.EnemyFleetID);
                        break;


                    default:
                        eventkind           += "不明";
                        TextEventDetail.Text = "";
                        break;
                    }
                    TextEventKind.Text = eventkind;
                }

                BasePanel.ResumeLayout();

                BasePanel.Visible = true;
            }
        }
Esempio n. 42
0
        /// <summary>
        /// Initializes the picture boxes with the tooltip informations.
        /// </summary>
        public void InitializePictureBoxToolTips()
        {
            ToolTipInfo toolTipInfo1 = new ToolTipInfo();

            toolTipInfo1.MaxWidth      = 1000;
            toolTipInfo1.ToolTipStyle  = ToolTipStyle.Balloon;
            toolTipInfo1.BeakBackColor = ColorTranslator.FromHtml("#3D3D3D");
            toolTipInfo1.BorderColor   = ColorTranslator.FromHtml("#1E1E1E");
            ToolTipItem toolTipItem1 = new ToolTipItem();

            toolTipItem1.Padding         = new Padding(10);
            toolTipItem1.Style.BackColor = ColorTranslator.FromHtml("#3D3D3D");

            PictureBoxControl pictureBoxControl1 = new PictureBoxControl();

            PictureBox pictureBox1 = new PictureBox();

            pictureBox1.Image             = global::GettingStarted.Properties.Resources.Batman_Begins;
            pictureBox1.Size              = new Size(214, 292);
            pictureBox1.SizeMode          = PictureBoxSizeMode.StretchImage;
            pictureBoxControl1.PictureBox = pictureBox1;

            RichTextBox richTextBox1 = new RichTextBox();

            richTextBox1.Margin            = new Padding(0);
            richTextBox1.Location          = new Point(239, 0);
            richTextBox1.Size              = new Size(315, 292);
            richTextBox1.BackColor         = ColorTranslator.FromHtml("#3D3D3D");
            richTextBox1.Rtf               = "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Segoe UI;}}\r\n{\\colortbl ;\\red245\\green245\\blue245;}\r\n\\viewkind4\\uc1\\pard\\cf1\\lang1033\\b0\\fs12\\par\r\n\\b\\f0\\fs30 Batman Begins\\b0\\f0\\fs4\\par\r\n\\par\r\n\\f0\\fs18 2005 - Thriller/Action\\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18 Batman Begins is a 2005 superhero film based \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 on the DC Comics character Batman, directed\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 by Christopher Nolanand written by Nolan.\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 The film reboots the Batman film series and \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 telling the origin story of Bruce Wayne.\\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18\\b Initial Release :\\b0  31, May 2005 (Sweden)\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Director :\\b0 Christopher Nolan\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Cast : \\b0 Bruce Willis\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18Budget : \\b0 92 million USD\\par\r\n}\r\n";
            richTextBox1.BorderStyle       = BorderStyle.None;
            pictureBoxControl1.RichTextBox = richTextBox1;

            pictureBoxControl1.BackColor = ColorTranslator.FromHtml("#3D3D3D");
            pictureBoxControl1.AddControls();
            pictureBoxControl1.Size = new Size(515, 292);
            toolTipItem1.Control    = pictureBoxControl1;

            toolTipInfo1.Items.Add(toolTipItem1);

            this.sfToolTip1.SetToolTipInfo(this.pictureBox1, toolTipInfo1);

            ToolTipInfo toolTipInfo2 = new ToolTipInfo();

            toolTipInfo2.MaxWidth      = 1000;
            toolTipInfo2.ToolTipStyle  = ToolTipStyle.Balloon;
            toolTipInfo2.BeakBackColor = ColorTranslator.FromHtml("#3D3D3D");
            toolTipInfo2.BorderColor   = ColorTranslator.FromHtml("#1E1E1E");
            ToolTipItem toolTipItem2 = new ToolTipItem();

            toolTipItem2.Padding         = new Padding(10);
            toolTipItem2.Style.BackColor = ColorTranslator.FromHtml("#3D3D3D");

            PictureBoxControl pictureBoxControl2 = new PictureBoxControl();
            PictureBox        pictureBox2        = new PictureBox();

            pictureBox2.Image             = global::GettingStarted.Properties.Resources.Jurassic_World;
            pictureBox2.Size              = new Size(214, 292);
            pictureBox2.SizeMode          = PictureBoxSizeMode.StretchImage;
            pictureBoxControl2.PictureBox = pictureBox2;

            RichTextBox richTextBox2 = new RichTextBox();

            richTextBox2.Location          = new Point(239, 0);
            richTextBox2.Size              = new Size(297, 292);
            richTextBox2.Margin            = new Padding(0);
            richTextBox2.BackColor         = ColorTranslator.FromHtml("#3D3D3D");
            richTextBox2.Rtf               = "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Segoe UI;}}\r\n{\\colortbl ;\\red245\\green245\\blue245;}\r\n\\viewkind4\\uc1\\pard\\cf1\\lang1033\\b0\\fs12\\par\r\n\\b\\f0\\fs30 The Jurassic World \\b0\\f0\\fs4\\par\r\n\\par\r\n\\f0\\fs18 (Story of Jurassic World) \\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18 Jurassic World is a 2015 American science fiction\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 adventure film and the fourth installment\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 of the Jurassic Park series, as well as the first film\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 in a planned Jurassic World trilogy.\\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18\\b Initial Release : \\b0 29 May 2015 (US)\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Director \\b0 : Colin Trevorrow\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Cast :\\b0  Dwayne Johnson\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Budget :\\b0  375.7 million USD\\par\r\n}\r\n";
            richTextBox2.BorderStyle       = BorderStyle.None;
            pictureBoxControl2.RichTextBox = richTextBox2;

            pictureBoxControl2.BackColor = ColorTranslator.FromHtml("#3D3D3D");
            pictureBoxControl2.AddControls();
            pictureBoxControl2.Size = new Size(497, 292);

            toolTipItem2.Control = pictureBoxControl2;
            toolTipInfo2.Items.Add(toolTipItem2);

            this.sfToolTip1.SetToolTipInfo(this.pictureBox2, toolTipInfo2);

            ToolTipInfo toolTipInfo3 = new ToolTipInfo();

            toolTipInfo3.MaxWidth      = 1000;
            toolTipInfo3.ToolTipStyle  = ToolTipStyle.Balloon;
            toolTipInfo3.BeakBackColor = ColorTranslator.FromHtml("#3D3D3D");
            toolTipInfo3.BorderColor   = ColorTranslator.FromHtml("#1E1E1E");
            ToolTipItem toolTipItem3 = new ToolTipItem();

            toolTipItem3.Padding         = new Padding(10);
            toolTipItem3.Style.BackColor = ColorTranslator.FromHtml("#3D3D3D");

            PictureBoxControl pictureBoxControl3 = new PictureBoxControl();

            PictureBox pictureBox3 = new PictureBox();

            pictureBox3.Image             = global::GettingStarted.Properties.Resources.Minions;
            pictureBox3.Size              = new Size(214, 292);
            pictureBox3.SizeMode          = PictureBoxSizeMode.StretchImage;
            pictureBoxControl3.PictureBox = pictureBox3;

            RichTextBox richTextBox3 = new RichTextBox();

            richTextBox3.Location          = new Point(239, 0);
            richTextBox3.Size              = new Size(302, 292);
            richTextBox3.Margin            = new Padding(0);
            richTextBox3.BackColor         = ColorTranslator.FromHtml("#3D3D3D");
            richTextBox3.Rtf               = "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Segoe UI;}}\r\n{\\colortbl ;\\red245\\green245\\blue245;}\r\n\\viewkind4\\uc1\\pard\\cf1\\lang1033\\b0\\fs12\\par\r\n\\b\\f0\\fs30 The Minions\\b0\\f0\\fs4\\par\r\n\\par\r\n\\f0\\fs18 Minions film(2015)\\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18 Minions is a 2015 American 3D computer\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 comedy film,serving as a prequel to the \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 Despicable Mefranchise. It was first \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 foreshadowed in the end credits of \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 Despicable Me 2 (2013), where Kevin, Stuart\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 and Bob, three of the Minions, are seen auditioning for the film.\\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18\\b Initial Release :\\b0  22 March 2015\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Directors \\b0 : Chris Sanders, Kirk DeMicco\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18Cast :\\b0  Nicolas Cage\\par\r\n}\r\n";
            richTextBox3.BorderStyle       = BorderStyle.None;
            pictureBoxControl3.RichTextBox = richTextBox3;

            pictureBoxControl3.BackColor = ColorTranslator.FromHtml("#3D3D3D");
            pictureBoxControl3.AddControls();
            pictureBoxControl3.Size = new Size(502, 292);

            toolTipItem3.Control = pictureBoxControl3;
            toolTipInfo3.Items.Add(toolTipItem3);

            this.sfToolTip1.SetToolTipInfo(this.pictureBox3, toolTipInfo3);

            ToolTipInfo toolTipInfo4 = new ToolTipInfo();

            toolTipInfo4.MaxWidth      = 1000;
            toolTipInfo4.ToolTipStyle  = ToolTipStyle.Balloon;
            toolTipInfo4.BeakBackColor = ColorTranslator.FromHtml("#3D3D3D");
            toolTipInfo4.BorderColor   = ColorTranslator.FromHtml("#1E1E1E");
            ToolTipItem toolTipItem4 = new ToolTipItem();

            toolTipItem4.Padding         = new Padding(10);
            toolTipItem4.Style.BackColor = ColorTranslator.FromHtml("#3D3D3D");

            PictureBoxControl pictureBoxControl4 = new PictureBoxControl();

            PictureBox pictureBox4 = new PictureBox();

            pictureBox4.Image             = global::GettingStarted.Properties.Resources.Star_Wars;
            pictureBox4.Size              = new Size(214, 292);
            pictureBox4.SizeMode          = PictureBoxSizeMode.StretchImage;
            pictureBoxControl4.PictureBox = pictureBox4;

            RichTextBox richTextBox4 = new RichTextBox();

            richTextBox4.Location          = new Point(239, 0);
            richTextBox4.Size              = new Size(314, 292);
            richTextBox4.Margin            = new Padding(0);
            richTextBox4.BackColor         = ColorTranslator.FromHtml("#3D3D3D");
            richTextBox4.Rtf               = "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Segoe UI;}}\r\n{\\colortbl ;\\red245\\green245\\blue245;}\r\n\\viewkind4\\uc1\\pard\\cf1\\lang1033\\b0\\fs12\\par\r\n\\b\\f0\\fs30 The Star War\\b0\\f0\\fs4\\par\r\n\\par\r\n\\f0\\fs18 Forces of Destiny (2017–present)\\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18 The Star Wars franchise takes place in a distant\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 unnamed fictional galaxy at an undetermined \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 point in the ancient past, where many species \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 of aliens (often humanoid) co-exist. People own \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 robotic droids, who assist them in their daily routines,\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 and space travel is common. \\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18\\b Initial Release :\\b0  December 14, 2017\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Director :\\b0  George Lucas\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Cast :\\b0  James Franco\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18Budget : \\b0 493.3 million USD\\par\r\n}\r\n";
            richTextBox4.BorderStyle       = BorderStyle.None;
            pictureBoxControl4.RichTextBox = richTextBox4;

            pictureBoxControl4.BackColor = ColorTranslator.FromHtml("#3D3D3D");
            pictureBoxControl4.AddControls();
            pictureBoxControl4.Size = new Size(514, 292);

            toolTipItem4.Control = pictureBoxControl4;
            toolTipInfo4.Items.Add(toolTipItem4);

            this.sfToolTip1.SetToolTipInfo(this.pictureBox10, toolTipInfo4);

            ToolTipInfo toolTipInfo5 = new ToolTipInfo();

            toolTipInfo5.MaxWidth      = 1000;
            toolTipInfo5.ToolTipStyle  = ToolTipStyle.Balloon;
            toolTipInfo5.BeakBackColor = ColorTranslator.FromHtml("#3D3D3D");
            toolTipInfo5.BorderColor   = ColorTranslator.FromHtml("#1E1E1E");
            ToolTipItem toolTipItem5 = new ToolTipItem();

            toolTipItem5.Padding         = new Padding(10);
            toolTipItem5.Style.BackColor = ColorTranslator.FromHtml("#3D3D3D");

            PictureBoxControl pictureBoxControl5 = new PictureBoxControl();

            PictureBox pictureBox5 = new PictureBox();

            pictureBox5.Image             = global::GettingStarted.Properties.Resources.Ted;
            pictureBox5.Size              = new Size(214, 292);
            pictureBox5.SizeMode          = PictureBoxSizeMode.StretchImage;
            pictureBoxControl5.PictureBox = pictureBox5;

            RichTextBox richTextBox5 = new RichTextBox();

            richTextBox5.Location          = new Point(239, 0);
            richTextBox5.Size              = new Size(310, 292);
            richTextBox5.Margin            = new Padding(0);
            richTextBox5.BackColor         = ColorTranslator.FromHtml("#3D3D3D");
            richTextBox5.Rtf               = "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Segoe UI;}}\r\n{\\colortbl ;\\red245\\green245\\blue245;}\r\n\\viewkind4\\uc1\\pard\\cf1\\lang1033\\b0\\fs12\\par\r\n\\b\\f0\\fs30 Teddy Bear\\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18 A teddy bear is a soft toy in the form of a bear.\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 Developed apparently simultaneously by toymaker \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 Morris Michtom in the U.S in the early years of the \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 20th century.Teddy bears are among the most \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 popular gifts for children and are often given \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 to adults to signify love, congratulations or etc.. \\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18\\b \\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18\\b Introduced :\\b0  November 1902 \\par\r\n}\r\n";
            richTextBox5.BorderStyle       = BorderStyle.None;
            pictureBoxControl5.RichTextBox = richTextBox5;

            pictureBoxControl5.BackColor = ColorTranslator.FromHtml("#3D3D3D");
            pictureBoxControl5.AddControls();
            pictureBoxControl5.Size = new Size(510, 292);

            toolTipItem5.Control = pictureBoxControl5;
            toolTipInfo5.Items.Add(toolTipItem5);

            this.sfToolTip1.SetToolTipInfo(this.pictureBox4, toolTipInfo5);

            ToolTipInfo toolTipInfo6 = new ToolTipInfo();

            toolTipInfo6.MaxWidth      = 1000;
            toolTipInfo6.ToolTipStyle  = ToolTipStyle.Balloon;
            toolTipInfo6.BeakBackColor = ColorTranslator.FromHtml("#3D3D3D");
            toolTipInfo6.BorderColor   = ColorTranslator.FromHtml("#1E1E1E");
            ToolTipItem toolTipItem6 = new ToolTipItem();

            toolTipItem6.Padding         = new Padding(10);
            toolTipItem6.Style.BackColor = ColorTranslator.FromHtml("#3D3D3D");

            PictureBoxControl pictureBoxControl6 = new PictureBoxControl();

            PictureBox pictureBox6 = new PictureBox();

            pictureBox6.Image             = global::GettingStarted.Properties.Resources.Troy;
            pictureBox6.Size              = new Size(214, 292);
            pictureBox6.SizeMode          = PictureBoxSizeMode.StretchImage;
            pictureBoxControl6.PictureBox = pictureBox6;

            RichTextBox richTextBox6 = new RichTextBox();

            richTextBox6.Location          = new Point(239, 0);
            richTextBox6.Size              = new Size(280, 292);
            richTextBox6.Margin            = new Padding(0);
            richTextBox6.BackColor         = ColorTranslator.FromHtml("#3D3D3D");
            richTextBox6.Rtf               = "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Segoe UI;}}\r\n{\\colortbl ;\\red245\\green245\\blue245;}\r\n\\viewkind4\\uc1\\pard\\cf1\\lang1033\\b0\\fs12\\par\r\n\\b\\f0\\fs30 Troy\\b0\\f0\\fs4\\par\r\n\\par\r\n\\f0\\fs18 2004 - War Film\\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18 Troy is a 2004 epic period war film written by \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 David Benioff, directed by Wolfgang Petersen \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 and co-produced by units in Malta, Mexico \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 and the U.K. Shepperton Studios. The film \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 features an ensemble cast led by Brad Pitt,\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 Eric Bana, and Orlando Bloom.\\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18\\b Initial Release :\\b0  May 14, 2004 (US)\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Director : \\b0 Wolfgang Petersen\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Cast : \\b0 Tom Cruise\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18Budget : \\b0 120 million USD\\par\r\n}\r\n";
            richTextBox6.BorderStyle       = BorderStyle.None;
            pictureBoxControl6.RichTextBox = richTextBox6;

            pictureBoxControl6.BackColor = ColorTranslator.FromHtml("#3D3D3D");
            pictureBoxControl6.AddControls();
            pictureBoxControl6.Size = new Size(480, 292);

            toolTipItem6.Control = pictureBoxControl6;
            toolTipInfo6.Items.Add(toolTipItem6);

            this.sfToolTip1.SetToolTipInfo(this.pictureBox6, toolTipInfo6);

            ToolTipInfo toolTipInfo7 = new ToolTipInfo();

            toolTipInfo7.MaxWidth      = 1000;
            toolTipInfo7.ToolTipStyle  = ToolTipStyle.Balloon;
            toolTipInfo7.BeakBackColor = ColorTranslator.FromHtml("#3D3D3D");
            toolTipInfo7.BorderColor   = ColorTranslator.FromHtml("#1E1E1E");
            ToolTipItem toolTipItem7 = new ToolTipItem();

            toolTipItem7.Padding         = new Padding(10);
            toolTipItem7.Style.BackColor = ColorTranslator.FromHtml("#3D3D3D");

            PictureBoxControl pictureBoxControl7 = new PictureBoxControl();

            PictureBox pictureBox7 = new PictureBox();

            pictureBox7.Image             = global::GettingStarted.Properties.Resources.V_for_Vendetta;
            pictureBox7.Size              = new Size(214, 292);
            pictureBox7.SizeMode          = PictureBoxSizeMode.StretchImage;
            pictureBoxControl7.PictureBox = pictureBox7;

            RichTextBox richTextBox7 = new RichTextBox();

            richTextBox7.Location          = new Point(239, 0);
            richTextBox7.Size              = new Size(305, 292);
            richTextBox7.Margin            = new Padding(0);
            richTextBox7.BackColor         = ColorTranslator.FromHtml("#3D3D3D");
            richTextBox7.Rtf               = "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Segoe UI;}}\r\n{\\colortbl ;\\red245\\green245\\blue245;}\r\n\\viewkind4\\uc1\\pard\\cf1\\lang1033\\b0\\fs12\\par\r\n\\b\\f0\\fs30 V for Vendetta \\b0\\f0\\fs4\\par\r\n\\par\r\n\\f0\\fs18 Political thriller film\\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18 V for Vendetta is a 2005 dystopian political thriller \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 film directed by James McTeigue and written by\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 the wachowski brothers, based on the 1988 \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 DC/Vertigo Comics limited series of the same \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 name by Alan Moore and David Lloyd.\\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18\\b Initial Release \\b0 : December 11,2005 \\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Director \\b0 : James McTeigue\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Cast \\b0 : Robert Downer, Jr\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18Budget : \\b0 1.215 billion USD\\par\r\n}\r\n";
            richTextBox7.BorderStyle       = BorderStyle.None;
            pictureBoxControl7.RichTextBox = richTextBox7;

            pictureBoxControl7.BackColor = ColorTranslator.FromHtml("#3D3D3D");
            pictureBoxControl7.AddControls();
            pictureBoxControl7.Size = new Size(505, 292);

            toolTipItem7.Control = pictureBoxControl7;
            toolTipInfo7.Items.Add(toolTipItem7);

            this.sfToolTip1.SetToolTipInfo(this.pictureBox7, toolTipInfo7);

            ToolTipInfo toolTipInfo8 = new ToolTipInfo();

            toolTipInfo8.MaxWidth      = 1000;
            toolTipInfo8.ToolTipStyle  = ToolTipStyle.Balloon;
            toolTipInfo8.BeakBackColor = ColorTranslator.FromHtml("#3D3D3D");
            toolTipInfo8.BorderColor   = ColorTranslator.FromHtml("#1E1E1E");
            ToolTipItem toolTipItem8 = new ToolTipItem();

            toolTipItem8.Padding         = new Padding(10);
            toolTipItem8.Style.BackColor = ColorTranslator.FromHtml("#3D3D3D");

            PictureBoxControl pictureBoxControl8 = new PictureBoxControl();

            PictureBox pictureBox8 = new PictureBox();

            pictureBox8.Image             = global::GettingStarted.Properties.Resources.Wall_E;
            pictureBox8.Size              = new Size(214, 292);
            pictureBox8.SizeMode          = PictureBoxSizeMode.StretchImage;
            pictureBoxControl8.PictureBox = pictureBox8;

            RichTextBox richTextBox8 = new RichTextBox();

            richTextBox8.Location          = new Point(239, 0);
            richTextBox8.Size              = new Size(305, 292);
            richTextBox8.Margin            = new Padding(0);
            richTextBox8.BackColor         = ColorTranslator.FromHtml("#3D3D3D");
            richTextBox8.Rtf               = "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Segoe UI;}}\r\n{\\colortbl ;\\red245\\green245\\blue245;}\r\n\\viewkind4\\uc1\\pard\\cf1\\lang1033\\b0\\fs12\\par\r\n\\b\\f0\\fs30 WALL-E\\b0\\f0\\fs4\\par\r\n\\par\r\n\\f0\\fs18 computer-animated science fiction film\\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18 WALL-E (stylized with an interpunct as WALL·E)\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 is a 2008 American computer-animated science \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 fiction film produced by Pixar Animation Studios.\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 It was directed and co-written by Andrew Stanton,\\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 produced by Jim Morris, and co-written by \\b0\\f0\\fs3\\par\r\n\\par\r\n\\f0\\fs18 Jim Reardon. \\b0\\f0\\fs28\\par\r\n\\par\r\n\\f0\\fs18\\b Initial Release : \\b0 June 27, 2008(US)\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Director : \\b0 Andrew Stanton\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18 Cast :\\b0  Jason Bateman\\b0\\f0\\fs6\\par\r\n\\par\r\n\\b\\f0\\fs18Budget : \\b0 174 million USD\\par\r\n}\r\n";
            richTextBox8.BorderStyle       = BorderStyle.None;
            pictureBoxControl8.RichTextBox = richTextBox8;

            pictureBoxControl8.BackColor = ColorTranslator.FromHtml("#3D3D3D");
            pictureBoxControl8.AddControls();
            pictureBoxControl8.Size = new Size(505, 292);

            toolTipItem8.Control = pictureBoxControl8;
            toolTipInfo8.Items.Add(toolTipItem8);

            this.sfToolTip1.SetToolTipInfo(this.pictureBox5, toolTipInfo8);

            this.toolTipStyleComboBox.Text    = "Balloon";
            this.toolTipLocationComboBox.Text = "TopCenter";
            this.sfToolTip1.InitialDelay      = 50;
            this.initialDelayUpDown.Value     = this.sfToolTip1.InitialDelay;
            this.autoPopupDelayUpDown.Value   = this.sfToolTip1.AutoPopDelay;
            pictureBox3Info.ToolTipLocation   = ToolTipLocation.BottomCenter;
            sfToolTip1.Show(pictureBox3Info, this.PointToScreen(new Point(panel1.Location.X + panel1.Width / 2, panel1.Location.Y + 150)), 5000);
        }
		private void UpdateEnemyFleetInstant(bool isPractice = false)
		{

			BattleManager bm = KCDatabase.Instance.Battle;
			BattleData bd = bm.FirstBattle;

			int[] enemies = bd.Initial.EnemyMembers;
			int[][] slots = bd.Initial.EnemySlots;
			int[] levels = bd.Initial.EnemyLevels;
			int[][] parameters = bd.Initial.EnemyParameters;
			int[] hps = bd.Initial.EnemyMaxHPs;


			_enemyFleetCandidate = null;
			_enemyFleetCandidateIndex = -1;



			if (!bm.IsPractice)
			{
				var efcurrent = EnemyFleetRecord.EnemyFleetElement.CreateFromCurrentState();
				var efrecord = RecordManager.Instance.EnemyFleet[efcurrent.FleetID];
				if (efrecord != null)
				{
					TextEnemyFleetName.Text = efrecord.FleetName;
					TextEnemyFleetName.Font = Utility.Configuration.Config.UI.JapFont;
					TextEventDetail.Text = "Exp: " + efrecord.ExpShip;
				}
				ToolTipInfo.SetToolTip(TextEventDetail, "敌舰队 ID: " + efcurrent.FleetID.ToString("x16"));
			}

			TextFormation.Text = Constants.GetFormationShort((int)bd.Searching.FormationEnemy);
			//TextFormation.ImageIndex = (int)ResourceManager.IconContent.BattleFormationEnemyLineAhead + bd.Searching.FormationEnemy - 1;
			TextFormation.Visible = true;
			{
				int air = Calculator.GetAirSuperiority(enemies, slots);
				TextAirSuperiority.Text = isPractice ?
					air.ToString() + " ~ " + Calculator.GetAirSuperiorityAtMaxLevel(enemies, slots).ToString() :
					air.ToString();
				ToolTipInfo.SetToolTip(TextAirSuperiority, GetAirSuperiorityString(isPractice ? 0 : air));
				TextAirSuperiority.Visible = true;
			}

			TableEnemyMember.SuspendLayout();
			for (int i = 0; i < ControlMembers.Length; i++)
			{
				int shipID = enemies[i];
				ControlMembers[i].Update(shipID, shipID != -1 ? slots[i] : null);

				if (shipID != -1)
					ControlMembers[i].UpdateEquipmentToolTip(shipID, slots[i], levels[i], hps[i], parameters[i][0], parameters[i][1], parameters[i][2], parameters[i][3]);
			}
			TableEnemyMember.ResumeLayout();
			TableEnemyMember.Visible = true;

			PanelEnemyFleet.Visible = true;

			PanelEnemyCandidate.Visible = false;

			BasePanel.Visible = true;           //checkme

		}