Beispiel #1
0
        private void VoidMenuItem_Click(object sender, EventArgs e)

        {
            // System.Diagnostics.Process.Start("https://github.com/alexliyu7352/keshi");
            // System.Diagnostics.Process.Start("https://steamcommunity.com/sharedfiles/filedetails/?id=1780887485");
            // ShellExecute(0, @"open", @"https://github.com/alexliyu7352/keshi", null, null, (int)ShowWindowCommands.SW_NORMAL);
            NativeTranslte.ShellExecute(0, @"open", @"https://steamcommunity.com/sharedfiles/filedetails/?id=1780887485", null, null, (int)NativeTranslte.ShowWindowCommands.SW_NORMAL);
        }
Beispiel #2
0
 public void SetTipMessage(string strTip, DrawItemEventArgs e)
 {
     //  transTip.SetToolTip(this.mList, strTip);
     // Check if the ToolTip's text isn't already the one
     // we are now processing.
     if (oldTrans != strTip)
     {
         oldTrans = strTip;
         string newTrans = NativeTranslte.getTransValue(strTip);
         if (transTip.GetToolTip(this) != newTrans)
         {
             // If it isn't, then a new item needs to be
             // displayed on the toolTip. Update it.
             transTip.Show(newTrans, this, e.Bounds.X + e.Bounds.Width, e.Bounds.Y + e.Bounds.Height);
         }
     }
 }
 public void SetTipMessage(string strTip)
 {
     //  transTip.SetToolTip(this.mList, strTip);
     // Check if the ToolTip's text isn't already the one
     // we are now processing.
     if (oldTrans != strTip)
     {
         oldTrans = strTip;
         string newTrans = NativeTranslte.getTransValue(strTip);
         if (transTip.GetToolTip(mList) != newTrans)
         {
             // If it isn't, then a new item needs to be
             // displayed on the toolTip. Update it.
             transTip.SetToolTip(mList, newTrans);
         }
     }
 }
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            int  y     = base.AutoScrollPosition.Y;
            int  width = e.ClipRectangle.Width;
            bool flag  = this.hasFocus();

            e.Graphics.Clear(Color.White);
            System.Drawing.Font font       = new System.Drawing.Font(this.Font, FontStyle.Bold);
            SolidBrush          solidBrush = new SolidBrush(Color.White);
            Pen pen  = new Pen(this.LineColour);
            Pen pen1 = new Pen(Color.Black);
            Pen pen2 = new Pen(Color.Black)
            {
                DashStyle = DashStyle.Dot
            };

            Point[] point      = new Point[] { new Point(this.MarginSize / 2 - 3, this.LineHeight / 2 + 3), new Point(this.MarginSize / 2 + 3, this.LineHeight / 2 - 3), new Point(this.MarginSize / 2 + 3, this.LineHeight / 2 + 3) };
            Point[] pointArray = new Point[] { new Point(this.MarginSize / 2 - 1, this.LineHeight / 2 - 3), new Point(this.MarginSize / 2 - 1, this.LineHeight / 2 + 3), new Point(this.MarginSize / 2 + 2, this.LineHeight / 2) };
            int     x          = e.ClipRectangle.X;

            e.Graphics.TranslateTransform(0f, (float)base.AutoScrollPosition.Y);
            foreach (PropertyGrid.Section section in this.Sections)
            {
                solidBrush.Color = section.MarginColor;
                e.Graphics.FillRectangle(solidBrush, x, 0, width, this.LineHeight);
                if (this.DrawLines)
                {
                    e.Graphics.DrawLine(pen, x, 0, width + x, 0);
                    e.Graphics.DrawLine(pen, x, this.LineHeight, width + x, this.LineHeight);
                }
                solidBrush.Color = pen1.Color;
                if (!section.Collapsed)
                {
                    e.Graphics.FillPolygon(solidBrush, point);
                }
                else
                {
                    e.Graphics.DrawPolygon(pen1, pointArray);
                }
                int marginSize = this.MarginSize + 4;
                int num        = 1;
                if ((this.mFocusedSection != section ? false : this.mFocusedItem == null) & flag)
                {
                    System.Drawing.Size size = TextRenderer.MeasureText(section.Name, font);
                    e.Graphics.DrawRectangle(pen2, marginSize, num, size.Width, size.Height);
                }
                solidBrush.Color = section.TextColour;
                TextRenderer.DrawText(e.Graphics, NativeTranslte.getTransSection(section.Name), font, new Point(marginSize, num + (int)e.Graphics.Transform.OffsetY), section.TextColour);
                e.Graphics.TranslateTransform(0f, (float)this.LineHeight);
                if (!section.Collapsed)
                {
                    int num1 = 0;
                    foreach (PropertyGrid.Item item in section.Items)
                    {
                        if (e.Graphics.Transform.OffsetY > (float)(-this.LineHeight))
                        {
                            solidBrush.Color = section.MarginColor;
                            e.Graphics.FillRectangle(solidBrush, x, 0, this.MarginSize, this.LineHeight + 1);
                            if (!(this.mFocusedItem == item & flag))
                            {
                                solidBrush.Color = ((num1 & 1) == 0 ? section.BackColour1 : section.BackColour2);
                                e.Graphics.FillRectangle(solidBrush, this.MarginSize, 1, width - this.MarginSize + x, this.LineHeight - 1);
                            }
                            else
                            {
                                solidBrush.Color = this.FocusColour;
                                e.Graphics.FillRectangle(solidBrush, this.MarginSize, 1, this.DividerPosition - this.MarginSize, this.LineHeight - 1);
                                solidBrush.Color = ((num1 & 1) == 0 ? section.BackColour1 : section.BackColour2);
                                e.Graphics.FillRectangle(solidBrush, this.DividerPosition, 1, width - this.DividerPosition + x, this.LineHeight - 1);
                            }
                            if (this.DrawLines)
                            {
                                e.Graphics.DrawLine(pen, this.MarginSize, this.LineHeight, width + x, this.LineHeight);
                            }
                            e.Graphics.DrawLine(pen, this.DividerPosition, 0, this.DividerPosition, this.LineHeight);
                            Color     color     = (this.mFocusedItem == item & flag ? this.FocusText : item.TextColour);
                            Rectangle rectangle = new Rectangle(this.MarginSize, (int)e.Graphics.Transform.OffsetY + 1, this.DividerPosition - this.MarginSize, this.LineHeight - 1);
                            TextRenderer.DrawText(e.Graphics, item.Name, this.Font, rectangle, color, TextFormatFlags.Default);
                            CustomProperty property = item.Property ?? this.DefaultType;
                            property.Paint(this, item, e.Graphics, new Rectangle(this.DividerPosition + 1, 0, base.Width - this.DividerPosition - 1, this.LineHeight));
                        }
                        e.Graphics.TranslateTransform(0f, (float)this.LineHeight);
                        if (e.Graphics.Transform.OffsetY <= (float)base.Height)
                        {
                            num1++;
                        }
                        else
                        {
                            return;
                        }
                    }
                }
            }
        }
Beispiel #5
0
 private void SourceLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     NativeTranslte.ShellExecute(0, @"open", @"https://github.com/alexliyu7352/kenshi_editor", null, null, (int)NativeTranslte.ShowWindowCommands.SW_NORMAL);
 }