x902c4aee45bfd906.cs
上传用户:xlxx0122
上传日期:2015-04-24
资源大小:3904k
文件大小:109k
- namespace Sunisoft.IrisSkin.InternalControls
- {
- using Sunisoft.IrisSkin;
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Drawing.Imaging;
- using System.Drawing.Text;
- using System.Runtime.CompilerServices;
- using System.Threading;
- using System.Windows.Forms;
- [ToolboxItem(false)]
- internal class x902c4aee45bfd906 : NativeWindow
- {
- protected static readonly int[,] _position = new int[,] { {
- 2, 1, 0, 1, 2, 3, 3, 5, 4, 4, 2, 6, 5, 5, 1, 10,
- 4, 4, 2, 2, 0, 0
- }, {
- 1, 0, 1, 2, 2, 1, 3, 4, 3, 3, 2, 8, 5, 5, 5, 10,
- 0, 0, 2, 2, 2, 5
- } };
- protected Point aboveScreenPosition;
- protected bool animateFirst;
- protected bool animateIn;
- protected x6fd23f8bad2f3ced animateItem;
- protected x1f5697535eab37b9 animateStyle;
- protected int animateTime;
- protected static int blendSteps = 6;
- protected int borderGap;
- protected x902c4aee45bfd906 childMenu;
- protected Point currentPoint;
- protected Size currentSize;
- protected xdbfa333b4cd503e0 direction;
- protected ArrayList drawCommands;
- protected int excludeOffset;
- protected bool excludeTop;
- protected bool exitLoop;
- protected static int expansionDelay = 0x44c;
- protected int extraSize;
- protected bool highlightInfrequent;
- protected static int imageHeight = 0x10;
- protected static int imageWidth = 0x10;
- protected Point lastMousePosition;
- protected bool layered;
- protected Point leftScreenPosition;
- protected xd53b20b7b4b2a08a menuCommands;
- protected static ImageList menuImages = null;
- protected bool mouseOver;
- protected x3c41176af7e54b01 parentControl;
- protected x902c4aee45bfd906 parentMenu;
- protected bool popupDown;
- protected int popupItem;
- protected bool popupRight;
- protected bool rememberExpansion;
- protected x5f4b657f68f87baa returnCommand;
- protected int returnDir;
- protected Point screenPosition;
- protected static int selectionDelay = 400;
- protected static Bitmap shadowCache = null;
- protected static int shadowCacheHeight = 0;
- protected static int shadowCacheWidth = 0;
- protected static int shadowHalf = 2;
- protected static int shadowLength = 4;
- protected bool showInfrequent;
- protected static bool supportsLayered = false;
- protected System.Drawing.Font textFont;
- protected System.Windows.Forms.Timer timer;
- protected int trackItem;
- protected readonly uint WM_DISMISS = 0x401;
- protected readonly uint WM_OPERATE_SUBMENU = 0x402;
- internal RightToLeft x94975a4c4f1d71c4;
- private SkinEngine xcab6a0e662ada486;
- public event x26569a56dfbc2c6d Deselected;
- public event x26569a56dfbc2c6d Selected;
- static x902c4aee45bfd906()
- {
- menuImages = x58dd58a96343fde0.LoadBitmapStrip(System.Type.GetType("Sunisoft.IrisSkin.SkinEngine"), "Sunisoft.IrisSkin.ImagesPopupMenu.bmp", new Size(0x10, 0x10), new Point(0, 0));
- supportsLayered = OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows) != null;
- }
- public x902c4aee45bfd906(SkinEngine engine)
- {
- this.Engine = engine;
- this.drawCommands = new ArrayList();
- this.menuCommands = new xd53b20b7b4b2a08a();
- this.returnDir = 0;
- this.extraSize = 0;
- this.borderGap = 0;
- this.popupItem = -1;
- this.trackItem = -1;
- this.childMenu = null;
- this.exitLoop = false;
- this.popupDown = true;
- this.mouseOver = false;
- this.excludeTop = true;
- this.popupRight = true;
- this.parentMenu = null;
- this.excludeOffset = 0;
- this.parentControl = null;
- this.returnCommand = null;
- this.highlightInfrequent = false;
- this.showInfrequent = false;
- this.rememberExpansion = true;
- this.lastMousePosition = new Point(-1, -1);
- this.direction = xdbfa333b4cd503e0.Horizontal;
- this.textFont = SystemInformation.MenuFont;
- this.animateTime = 100;
- this.animateItem = x6fd23f8bad2f3ced.System;
- this.animateStyle = x1f5697535eab37b9.System;
- this.animateFirst = true;
- this.animateIn = true;
- this.timer = new System.Windows.Forms.Timer();
- this.timer.Interval = selectionDelay;
- this.timer.Tick += new EventHandler(this.x07cc1c177f7b41bd);
- }
- public void Dismiss()
- {
- if (base.Handle != IntPtr.Zero)
- {
- this.timer.Stop();
- if (this.childMenu != null)
- {
- this.childMenu.Dismiss();
- }
- this.exitLoop = true;
- this.x4139e66e6dfaac52();
- x61467fe65a98f20c.PostMessage(base.Handle, this.WM_DISMISS, (uint) 0, (uint) 0);
- }
- }
- public virtual void OnDeselected(x5f4b657f68f87baa mc)
- {
- if (this.parentControl != null)
- {
- this.parentControl.OnDeselected(mc);
- }
- else if (this.xd42ce0324cbc114a != null)
- {
- this.xd42ce0324cbc114a(mc);
- }
- else if (this.parentMenu != null)
- {
- this.parentMenu.OnDeselected(mc);
- }
- }
- public virtual void OnSelected(x5f4b657f68f87baa mc)
- {
- if (this.parentControl != null)
- {
- this.parentControl.OnSelected(mc);
- }
- else if (this.xaa7558c320af04eb != null)
- {
- this.xaa7558c320af04eb(mc);
- }
- else if (this.parentMenu != null)
- {
- this.parentMenu.OnSelected(mc);
- }
- }
- public x5f4b657f68f87baa TrackPopup(Point screenPos)
- {
- return this.TrackPopup(screenPos, false);
- }
- public x5f4b657f68f87baa TrackPopup(Point screenPos, bool selectFirst)
- {
- if (this.menuCommands.VisibleItems())
- {
- this.direction = xdbfa333b4cd503e0.Horizontal;
- this.screenPosition = screenPos;
- this.aboveScreenPosition = screenPos;
- this.leftScreenPosition = screenPos;
- return this.x6e4244e25732db7d(selectFirst);
- }
- return null;
- }
- public x5f4b657f68f87baa TrackPopupTaskBar(Point screenPos)
- {
- if (this.menuCommands.VisibleItems())
- {
- this.direction = xdbfa333b4cd503e0.Horizontal;
- this.screenPosition = screenPos;
- this.aboveScreenPosition = screenPos;
- this.leftScreenPosition = screenPos;
- return this.xf1c4e2176aec0ad6(false);
- }
- return null;
- }
- protected override void WndProc(ref Message m)
- {
- if (m.Msg == this.WM_DISMISS)
- {
- this.xb97e8a8020dddaac();
- }
- else if (m.Msg == this.WM_OPERATE_SUBMENU)
- {
- this.xbcf8eb07b7e76a62(ref m);
- }
- else
- {
- switch (((uint) m.Msg))
- {
- case 0x20:
- this.x773209141f430902();
- return;
- case 0x21:
- this.x20a824d899eb6cd8(ref m);
- return;
- case 0x84:
- if (this.xddec9c21ef58186c(ref m))
- {
- break;
- }
- base.WndProc(ref m);
- return;
- case 15:
- this.x038e1503810e39c7(ref m);
- return;
- case 0x1c:
- this.xa68b9c37c0ff7fc5(ref m);
- return;
- default:
- base.WndProc(ref m);
- break;
- }
- }
- }
- protected void x038e1503810e39c7(ref Message x6088325dec1baa2a)
- {
- x40255b11ef821fa3.PAINTSTRUCT lpPaint = new x40255b11ef821fa3.PAINTSTRUCT();
- IntPtr hdc = x61467fe65a98f20c.BeginPaint(x6088325dec1baa2a.HWnd, out lpPaint);
- xae4dd1cafd2eb77c.RECT lpRect = new xae4dd1cafd2eb77c.RECT();
- x61467fe65a98f20c.GetWindowRect(base.Handle, ref lpRect);
- Rectangle rectangle = new Rectangle(0, 0, lpRect.right - lpRect.left, lpRect.bottom - lpRect.top);
- using (Graphics graphics = Graphics.FromHdc(hdc))
- {
- Bitmap image = new Bitmap(rectangle.Width, rectangle.Height);
- using (Graphics graphics2 = Graphics.FromImage(image))
- {
- this.x4af0f9e5d7ac184a(graphics2, rectangle);
- this.x05a10b378cdf8119(graphics2);
- }
- graphics.DrawImageUnscaled(image, 0, 0);
- }
- x61467fe65a98f20c.EndPaint(x6088325dec1baa2a.HWnd, ref lpPaint);
- }
- protected void x057464a452da34b7()
- {
- this.drawCommands.Clear();
- this.showInfrequent = true;
- if (this.rememberExpansion)
- {
- this.menuCommands.ShowInfrequent = true;
- }
- Size size = this.x4e2849ed170f5bc2();
- Point point = this.x6e375ee3ca34b13b(size);
- this.currentPoint = point;
- this.currentSize = size;
- if (!this.layered)
- {
- this.x1803d70928e3ae9b(size);
- x61467fe65a98f20c.MoveWindow(base.Handle, point.X, point.Y, size.Width, size.Height, true);
- xae4dd1cafd2eb77c.RECT lpRect = new xae4dd1cafd2eb77c.RECT();
- lpRect.left = 0;
- lpRect.top = 0;
- lpRect.right = size.Width;
- lpRect.bottom = size.Height;
- x61467fe65a98f20c.InvalidateRect(base.Handle, ref lpRect, true);
- }
- else
- {
- this.x9119fce83e4631ad();
- this.x95f5f55ee201fb8f();
- }
- }
- protected void x05a10b378cdf8119(Graphics x4b101060f4767186)
- {
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- x2cc390e9409b0f3f xccebff = this.drawCommands[i] as x2cc390e9409b0f3f;
- this.xb5a5bdae3ba8936b(x4b101060f4767186, xccebff, i == this.trackItem);
- }
- }
- protected void x0760506d6abf77a2(int xf624f8e86c5ae5f1, bool xacc37ebdd71fcc44)
- {
- x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATE_SUBMENU, (uint) xf624f8e86c5ae5f1, xacc37ebdd71fcc44 ? 1 : 0);
- }
- protected void x07cc1c177f7b41bd(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
- {
- this.timer.Stop();
- bool flag = true;
- if (this.childMenu != null)
- {
- if (this.popupItem != this.trackItem)
- {
- x61467fe65a98f20c.PostMessage(this.childMenu.Handle, this.WM_DISMISS, (uint) 0, (uint) 0);
- }
- else
- {
- flag = false;
- }
- }
- if (flag && (this.trackItem != -1))
- {
- x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as x2cc390e9409b0f3f;
- if (xccebff.SubMenu)
- {
- this.x0760506d6abf77a2(this.trackItem, false);
- }
- else if (xccebff.Expansion)
- {
- this.x057464a452da34b7();
- }
- }
- }
- protected void x0e37e200024f43ba()
- {
- bool flag = (this.parentMenu != null) || (this.parentControl != null);
- bool flag2 = false;
- if (this.trackItem != -1)
- {
- x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as x2cc390e9409b0f3f;
- int col = xccebff.Col;
- int row = xccebff.Row;
- if (col > 0)
- {
- int num3 = -1;
- int num4 = -1;
- int num5 = col - 1;
- x2cc390e9409b0f3f xccebff2 = null;
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- x2cc390e9409b0f3f xccebff3 = this.drawCommands[i] as x2cc390e9409b0f3f;
- if ((((xccebff3.Col == num5) && (xccebff3.Row <= row)) && ((xccebff3.Row > num4) && !xccebff3.Separator)) && xccebff3.Enabled)
- {
- num4 = xccebff3.Row;
- xccebff2 = xccebff3;
- num3 = i;
- }
- }
- if (xccebff2 != null)
- {
- this.xeb515a5b77846afe(this.trackItem, num3, false, false);
- }
- else
- {
- flag2 = true;
- }
- }
- else
- {
- flag2 = true;
- }
- }
- else if (this.parentMenu != null)
- {
- if (!this.x5437d760e9a6340b())
- {
- flag2 = true;
- }
- }
- else
- {
- flag2 = true;
- }
- if (flag && flag2)
- {
- this.returnCommand = null;
- this.timer.Stop();
- this.exitLoop = true;
- if (this.parentMenu == null)
- {
- this.returnDir = -1;
- }
- }
- }
- protected Point x1339f634e34e0e03(Size x001544edc57babc2)
- {
- Screen.GetWorkingArea(this.screenPosition);
- Point screenPosition = this.screenPosition;
- this.excludeTop = true;
- this.excludeOffset = 0;
- x001544edc57babc2.Width -= _position[0, 0x10];
- screenPosition.Y = (screenPosition.Y - x001544edc57babc2.Height) + 3;
- return screenPosition;
- }
- protected void x136735fdfe6d04ea(int x75cf7df8c59ffa4d, int xc13ed6de98262a2d)
- {
- x75cf7df8c59ffa4d -= this.currentPoint.X;
- xc13ed6de98262a2d -= this.currentPoint.Y;
- if (this.parentMenu != null)
- {
- this.parentMenu.x76a103c0a87eb01c();
- }
- this.mouseOver = true;
- Point pt = new Point(x75cf7df8c59ffa4d, xc13ed6de98262a2d);
- if (this.lastMousePosition != pt)
- {
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- x2cc390e9409b0f3f xccebff = this.drawCommands[i] as x2cc390e9409b0f3f;
- if (xccebff.DrawRect.Contains(pt) && (this.trackItem != i))
- {
- this.xeb515a5b77846afe(this.trackItem, i, true, false);
- }
- }
- this.lastMousePosition = pt;
- }
- }
- protected void x1803d70928e3ae9b(Size x001544edc57babc2)
- {
- int height = _position[0, 0x11];
- int width = _position[0, 0x10];
- Region region = new Region();
- region.MakeInfinite();
- region.Xor(new Rectangle(x001544edc57babc2.Width - width, 0, width, height));
- if ((this.direction != xdbfa333b4cd503e0.Vertical) || this.excludeTop)
- {
- region.Xor(new Rectangle(0, x001544edc57babc2.Height - height, width, height));
- }
- using (Graphics graphics = Graphics.FromHwnd(base.Handle))
- {
- x61467fe65a98f20c.SetWindowRgn(base.Handle, region.GetHrgn(graphics), false);
- }
- }
- protected void x20a824d899eb6cd8(ref Message x6088325dec1baa2a)
- {
- x6088325dec1baa2a.Result = (IntPtr) 3;
- }
- protected bool x277ff37e12aff68b(x555516122dcc901e.POINT x0ce73f6cbd7d5515, ref x40255b11ef821fa3.MSG x8a41fbc87a3fb305)
- {
- if ((x8a41fbc87a3fb305.message == 0x200) && (this.parentControl != null))
- {
- xae4dd1cafd2eb77c.RECT lpRect = new xae4dd1cafd2eb77c.RECT();
- x61467fe65a98f20c.GetWindowRect(this.parentControl.Handle, ref lpRect);
- if (((x0ce73f6cbd7d5515.x >= lpRect.left) && (x0ce73f6cbd7d5515.x <= lpRect.right)) && ((x0ce73f6cbd7d5515.y >= lpRect.top) && (x0ce73f6cbd7d5515.y <= lpRect.bottom)))
- {
- return true;
- }
- }
- return false;
- }
- internal x902c4aee45bfd906 x3c6f7570c20e3f7d(x555516122dcc901e.POINT x0ce73f6cbd7d5515, ref x40255b11ef821fa3.MSG x8a41fbc87a3fb305)
- {
- if (this.parentMenu != null)
- {
- return this.parentMenu.xcb534454d6825379(x0ce73f6cbd7d5515);
- }
- return null;
- }
- protected void x4139e66e6dfaac52()
- {
- x61467fe65a98f20c.ShowWindow(base.Handle, 0);
- }
- protected void x4af0f9e5d7ac184a(Graphics x4b101060f4767186, Rectangle x3821770539095b42)
- {
- Rectangle rect = new Rectangle(0, 0, (x3821770539095b42.Width - 1) - _position[0, 0x10], (x3821770539095b42.Height - 1) - _position[0, 0x11]);
- int width = (_position[0, 5] + imageWidth) + _position[0, 7];
- int x = _position[0, 1];
- int y = _position[0, 0];
- int height = ((rect.Height - y) - _position[0, 2]) - 1;
- Brush brush = this.Engine.Res.Brushes.SKIN2_MENUITEMCOLOR;
- x4b101060f4767186.FillRectangle(brush, rect);
- brush = this.Engine.Res.Brushes.SKIN2_LEFTBARSTARTCOLOR;
- using (Pen pen = new Pen(ControlPaint.Dark(this.Engine.Res.Colors.SKIN2_MENUITEMCOLOR)))
- {
- x4b101060f4767186.DrawRectangle(pen, rect);
- if (this.borderGap > 0)
- {
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- if (this.excludeTop)
- {
- x4b101060f4767186.FillRectangle(Brushes.White, (rect.Left + 1) + this.excludeOffset, rect.Top, this.borderGap - 1, 1);
- x4b101060f4767186.FillRectangle(brush, (rect.Left + 1) + this.excludeOffset, rect.Top, this.borderGap - 1, 1);
- }
- else
- {
- x4b101060f4767186.FillRectangle(Brushes.White, (rect.Left + 1) + this.excludeOffset, rect.Bottom, this.borderGap - 1, 1);
- x4b101060f4767186.FillRectangle(brush, (rect.Left + 1) + this.excludeOffset, rect.Bottom, this.borderGap - 1, 1);
- }
- }
- else if (this.excludeTop)
- {
- x4b101060f4767186.FillRectangle(Brushes.White, rect.Left, (rect.Top + 1) + this.excludeOffset, 1, this.borderGap - 1);
- x4b101060f4767186.FillRectangle(brush, rect.Left, (rect.Top + 1) + this.excludeOffset, 1, this.borderGap - 1);
- }
- else if (this.popupDown)
- {
- x4b101060f4767186.FillRectangle(Brushes.White, rect.Left, (rect.Bottom - 1) - this.excludeOffset, 1, this.borderGap - 1);
- x4b101060f4767186.FillRectangle(brush, rect.Left, (rect.Bottom - 1) - this.excludeOffset, 1, this.borderGap - 1);
- }
- else
- {
- x4b101060f4767186.FillRectangle(Brushes.White, rect.Left, (rect.Bottom - this.borderGap) + 1, 1, this.borderGap - 1);
- x4b101060f4767186.FillRectangle(brush, rect.Left, (rect.Bottom - this.borderGap) + 1, 1, this.borderGap - 1);
- }
- }
- }
- Rectangle rectangle2 = new Rectangle(x, y, width, height);
- x4b101060f4767186.FillRectangle(Brushes.White, rectangle2);
- x4b101060f4767186.FillRectangle(brush, rectangle2);
- foreach (x2cc390e9409b0f3f xccebff in this.drawCommands)
- {
- if (xccebff.Separator && xccebff.VerticalSeparator)
- {
- rectangle2.X = xccebff.DrawRect.Right;
- x4b101060f4767186.FillRectangle(Brushes.White, rectangle2);
- x4b101060f4767186.FillRectangle(brush, rectangle2);
- }
- }
- int num5 = rect.Right + 1;
- int num6 = rect.Top + _position[0, 0x11];
- int num7 = rect.Bottom + 1;
- int num8 = rect.Left + _position[0, 0x10];
- int num9 = rect.Left + this.excludeOffset;
- int num10 = (rect.Left + this.excludeOffset) + this.borderGap;
- if (((this.borderGap > 0) && !this.excludeTop) && (this.direction == xdbfa333b4cd503e0.Horizontal))
- {
- int num11 = x3821770539095b42.Width;
- if (num9 >= num8)
- {
- this.xcea282a46787878f(x4b101060f4767186, num8, num7, num9 - num8, _position[0, 0x11], xf398ffaf32ffe055.Left);
- }
- if (num10 <= num11)
- {
- this.xcea282a46787878f(x4b101060f4767186, num10, num7, num11 - num10, _position[0, 0x11], xf398ffaf32ffe055.Right);
- }
- }
- else
- {
- if ((this.direction == xdbfa333b4cd503e0.Vertical) && !this.excludeTop)
- {
- num8 = 0;
- }
- this.xcea282a46787878f(x4b101060f4767186, num8, num7, num5, _position[0, 0x11], xf398ffaf32ffe055.All);
- }
- this.xe75f29bc258e83bf(x4b101060f4767186, num5, num6, _position[0, 0x10], (num7 - num6) - 1);
- if (this.menuCommands.ExtraText.Length > 0)
- {
- this.xe145f7beb24da7f5(x4b101060f4767186, rect);
- }
- }
- protected x555516122dcc901e.POINT x4b688849d80162f6(x40255b11ef821fa3.MSG x8a41fbc87a3fb305)
- {
- x555516122dcc901e.POINT point;
- point.x = (short) (((int) x8a41fbc87a3fb305.lParam) & 0xffff);
- point.y = (short) ((((int) x8a41fbc87a3fb305.lParam) & -65536) >> 0x10);
- if ((((x8a41fbc87a3fb305.message != 0xa2) && (x8a41fbc87a3fb305.message != 0xa8)) && ((x8a41fbc87a3fb305.message != 0xa5) && (x8a41fbc87a3fb305.message != 0xac))) && (((x8a41fbc87a3fb305.message != 0xa1) && (x8a41fbc87a3fb305.message != 0xa7)) && ((x8a41fbc87a3fb305.message != 0xa4) && (x8a41fbc87a3fb305.message != 0xab))))
- {
- x61467fe65a98f20c.ClientToScreen(x8a41fbc87a3fb305.hwnd, ref point);
- }
- return point;
- }
- protected Size x4e2849ed170f5bc2()
- {
- this.drawCommands = new ArrayList();
- int height = (_position[0, 4] + imageHeight) + _position[0, 6];
- int width = ((((((_position[0, 5] + imageWidth) + _position[0, 7]) + _position[0, 8]) + _position[0, 9]) + _position[0, 10]) + _position[0, 11]) + _position[0, 12];
- int num3 = this.textFont.Height;
- if (num3 < height)
- {
- num3 = height;
- }
- int num4 = SystemInformation.WorkingArea.Height;
- int x = _position[0, 1];
- int y = _position[0, 0];
- int num7 = y;
- int num8 = width;
- int extraSize = 0;
- int num10 = 0;
- int row = 0;
- int col = 0;
- bool flag = false;
- bool infrequent = false;
- IntPtr dC = x61467fe65a98f20c.GetDC(IntPtr.Zero);
- ArrayList list = new ArrayList();
- using (Graphics graphics = Graphics.FromHdc(dC))
- {
- if (this.menuCommands.ExtraText.Length > 0)
- {
- int num13 = ((int) graphics.MeasureString(this.menuCommands.ExtraText, this.menuCommands.ExtraFont).Height) + 1;
- this.extraSize = (num13 + _position[0, 20]) + (_position[0, 0x12] * 2);
- x += this.extraSize;
- extraSize = this.extraSize;
- }
- foreach (x5f4b657f68f87baa xfbffbaa in this.menuCommands)
- {
- xfbffbaa.OnUpdate(EventArgs.Empty);
- if (xfbffbaa.Visible && ((xfbffbaa.MenuCommands.Count <= 0) || xfbffbaa.MenuCommands.VisibleItems()))
- {
- if (xfbffbaa.Infrequent && !this.showInfrequent)
- {
- flag = true;
- continue;
- }
- int num14 = 0;
- int num15 = 0;
- if (xfbffbaa.Break)
- {
- row = 0;
- col++;
- this.xfbe050c2d5b2be39(list, num8);
- x += num8;
- int num16 = _position[0, 14];
- x2cc390e9409b0f3f xccebff = new x2cc390e9409b0f3f(new Rectangle(x, 0, num16, 0), false);
- this.drawCommands.Add(xccebff);
- x += num16;
- num7 = y;
- extraSize += num8 + num16;
- num8 = width;
- }
- if (xfbffbaa.Text == "-")
- {
- num14 = width;
- num15 = _position[0, 13];
- }
- else
- {
- num15 = num3;
- SizeF ef2 = graphics.MeasureString(xfbffbaa.Text, this.textFont);
- num14 = (width + ((int) ef2.Width)) + 1;
- if (xfbffbaa.Shortcut != Shortcut.None)
- {
- ef2 = graphics.MeasureString(this.x8cf43133d25d686a(xfbffbaa.Shortcut), this.textFont);
- num14 += (_position[0, 15] + ((int) ef2.Width)) + 1;
- }
- }
- if ((num7 + num15) >= num4)
- {
- row = 0;
- col++;
- this.xfbe050c2d5b2be39(list, num8);
- x += num8;
- int num17 = _position[0, 14];
- x2cc390e9409b0f3f xccebff2 = new x2cc390e9409b0f3f(new Rectangle(x, y, num17, 0), false);
- this.drawCommands.Add(xccebff2);
- x += num17;
- num7 = y;
- extraSize += num8 + num17;
- num8 = width;
- xccebff2.Infrequent = infrequent;
- }
- Rectangle drawRect = new Rectangle(x, num7, num14, num15);
- x2cc390e9409b0f3f xccebff3 = new x2cc390e9409b0f3f(xfbffbaa, drawRect, row, col);
- if (infrequent != xfbffbaa.Infrequent)
- {
- if (xfbffbaa.Infrequent)
- {
- xccebff3.TopBorder = true;
- }
- else if (this.drawCommands.Count > 0)
- {
- for (int i = this.drawCommands.Count - 1; i >= 0; i--)
- {
- if (!(this.drawCommands[i] as x2cc390e9409b0f3f).Separator)
- {
- (this.drawCommands[i] as x2cc390e9409b0f3f).BottomBorder = true;
- break;
- }
- }
- }
- }
- if (!xccebff3.Separator)
- {
- infrequent = xfbffbaa.Infrequent;
- }
- this.drawCommands.Add(xccebff3);
- list.Add(xccebff3);
- if (num14 > num8)
- {
- num8 = num14;
- }
- num7 += num15;
- if (num7 > num10)
- {
- num10 = num7;
- }
- row++;
- }
- }
- if (flag)
- {
- Rectangle rectangle2 = new Rectangle(x, num7, width, height);
- x2cc390e9409b0f3f xccebff4 = new x2cc390e9409b0f3f(rectangle2, true);
- this.drawCommands.Add(xccebff4);
- list.Add(xccebff4);
- num7 += height;
- if (num7 > num10)
- {
- num10 = num7;
- }
- }
- this.xfbe050c2d5b2be39(list, num8);
- }
- x61467fe65a98f20c.ReleaseDC(IntPtr.Zero, dC);
- int num19 = ((_position[0, 1] + extraSize) + num8) + _position[0, 3];
- int num20 = (_position[0, 0] + num10) + _position[0, 2];
- this.x5796c1a518d308ac(num10);
- int num21 = _position[0, 0x11];
- int num22 = _position[0, 0x10];
- return new Size(num19 + num21, num20 + num22);
- }
- protected bool x5437d760e9a6340b()
- {
- int trackItem = this.trackItem;
- int num2 = trackItem;
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- trackItem--;
- if (trackItem == num2)
- {
- return false;
- }
- if (trackItem < 0)
- {
- trackItem = this.drawCommands.Count - 1;
- }
- x2cc390e9409b0f3f xccebff = this.drawCommands[trackItem] as x2cc390e9409b0f3f;
- if ((!xccebff.Separator && xccebff.Enabled) && (trackItem != this.trackItem))
- {
- this.xeb515a5b77846afe(this.trackItem, trackItem, false, false);
- return true;
- }
- }
- return false;
- }
- protected void x5796c1a518d308ac(int x3b2a52f70523c25a)
- {
- foreach (x2cc390e9409b0f3f xccebff in this.drawCommands)
- {
- if (xccebff.VerticalSeparator)
- {
- Rectangle drawRect = xccebff.DrawRect;
- xccebff.DrawRect = new Rectangle(drawRect.Left, drawRect.Top, drawRect.Width, x3b2a52f70523c25a);
- }
- }
- }
- protected bool x5b2e42a68d835b31()
- {
- int trackItem = this.trackItem;
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- trackItem++;
- if (trackItem >= this.drawCommands.Count)
- {
- trackItem = 0;
- }
- x2cc390e9409b0f3f xccebff = this.drawCommands[trackItem] as x2cc390e9409b0f3f;
- if ((!xccebff.Separator && xccebff.Enabled) && (trackItem != this.trackItem))
- {
- this.xeb515a5b77846afe(this.trackItem, trackItem, false, false);
- return true;
- }
- }
- return false;
- }
- internal x5f4b657f68f87baa x6192996f26aa9421(Point x0ce73f6cbd7d5515, Point xd682fa060330cf55, xdbfa333b4cd503e0 x23e85093ba3a7d1d, xd53b20b7b4b2a08a x2ac8fd3ce3986cdc, int xb2c6baf52a3ff3eb, bool xacc37ebdd71fcc44, x3c41176af7e54b01 x37f2fc2a7f30f790, bool x0a7391c99fcdc469, ref int x0cd2bb383a46f073)
- {
- this.direction = x23e85093ba3a7d1d;
- this.parentControl = x37f2fc2a7f30f790;
- this.borderGap = xb2c6baf52a3ff3eb;
- this.animateIn = x0a7391c99fcdc469;
- xd53b20b7b4b2a08a menuCommands = this.menuCommands;
- this.menuCommands = x2ac8fd3ce3986cdc;
- this.screenPosition = x0ce73f6cbd7d5515;
- this.aboveScreenPosition = xd682fa060330cf55;
- this.leftScreenPosition = x0ce73f6cbd7d5515;
- x5f4b657f68f87baa xfbffbaa = this.x6e4244e25732db7d(xacc37ebdd71fcc44);
- this.menuCommands = menuCommands;
- this.parentControl = null;
- this.returnDir = x0cd2bb383a46f073;
- return xfbffbaa;
- }
- protected int x65c1cc54cc8b0e75(char xba08ce632055a1d9)
- {
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- x2cc390e9409b0f3f xccebff = this.drawCommands[i] as x2cc390e9409b0f3f;
- if (xccebff.Enabled && (xba08ce632055a1d9 == xccebff.Mnemonic))
- {
- if (!xccebff.SubMenu)
- {
- return i;
- }
- if (this.trackItem != i)
- {
- this.xeb515a5b77846afe(this.trackItem, i, true, false);
- }
- return -1;
- }
- }
- return -1;
- }
- protected Point x6e375ee3ca34b13b(Size x001544edc57babc2)
- {
- Rectangle workingArea = Screen.GetWorkingArea(this.screenPosition);
- Point screenPosition = this.screenPosition;
- int width = workingArea.Width;
- int left = workingArea.Left;
- int right = workingArea.Right;
- int height = workingArea.Height;
- int bottom = workingArea.Bottom;
- int top = workingArea.Top;
- this.excludeTop = true;
- this.excludeOffset = 0;
- x001544edc57babc2.Width -= _position[0, 0x10];
- if (this.popupDown)
- {
- if ((screenPosition.Y + x001544edc57babc2.Height) > bottom)
- {
- if (((this.parentControl != null) && (this.parentMenu == null)) && ((this.aboveScreenPosition.Y - x001544edc57babc2.Height) > top))
- {
- screenPosition.Y = this.aboveScreenPosition.Y - x001544edc57babc2.Height;
- this.popupDown = false;
- this.excludeTop = false;
- this.parentControl.xd502a472a14a9c04();
- }
- if ((screenPosition.Y + x001544edc57babc2.Height) > bottom)
- {
- if (this.parentMenu != null)
- {
- this.popupDown = false;
- if ((this.aboveScreenPosition.Y - x001544edc57babc2.Height) > top)
- {
- screenPosition.Y = this.aboveScreenPosition.Y - x001544edc57babc2.Height;
- }
- else
- {
- screenPosition.Y = top;
- }
- }
- else
- {
- screenPosition.Y = (bottom - x001544edc57babc2.Height) - 1;
- }
- }
- }
- }
- else if ((screenPosition.Y - x001544edc57babc2.Height) < top)
- {
- this.popupDown = true;
- if ((screenPosition.Y + x001544edc57babc2.Height) > bottom)
- {
- screenPosition.Y = (bottom - x001544edc57babc2.Height) - 1;
- }
- }
- else
- {
- screenPosition.Y -= x001544edc57babc2.Height;
- }
- if (this.popupRight)
- {
- if ((screenPosition.X + x001544edc57babc2.Width) > right)
- {
- if (this.parentMenu != null)
- {
- this.popupRight = false;
- screenPosition.X = this.leftScreenPosition.X - x001544edc57babc2.Width;
- if (screenPosition.X < left)
- {
- screenPosition.X = left;
- }
- return screenPosition;
- }
- int num5 = (right - x001544edc57babc2.Width) - 1;
- this.excludeOffset = screenPosition.X - num5;
- screenPosition.X = num5;
- }
- return screenPosition;
- }
- screenPosition.X = this.leftScreenPosition.X;
- if ((screenPosition.X - x001544edc57babc2.Width) < left)
- {
- this.popupRight = true;
- if ((this.screenPosition.X + x001544edc57babc2.Width) > right)
- {
- screenPosition.X = (right - x001544edc57babc2.Width) - 1;
- return screenPosition;
- }
- screenPosition.X = this.screenPosition.X;
- return screenPosition;
- }
- screenPosition.X -= x001544edc57babc2.Width;
- return screenPosition;
- }
- protected x5f4b657f68f87baa x6e4244e25732db7d(bool xacc37ebdd71fcc44)
- {
- try
- {
- this.returnCommand = null;
- this.trackItem = -1;
- this.exitLoop = false;
- this.mouseOver = false;
- this.returnDir = 0;
- bool flag = false;
- this.animateFirst = true;
- this.xb3525a0e7d2fd376();
- x40255b11ef821fa3.MSG msg = new x40255b11ef821fa3.MSG();
- if (xacc37ebdd71fcc44)
- {
- this.x5b2e42a68d835b31();
- }
- x61467fe65a98f20c.SetCursor(x61467fe65a98f20c.LoadCursor(IntPtr.Zero, 0x7f00));
- bool flag2 = x61467fe65a98f20c.HideCaret(IntPtr.Zero);
- while (!this.exitLoop)
- {
- if (!x61467fe65a98f20c.WaitMessage())
- {
- continue;
- }
- while (!this.exitLoop && x61467fe65a98f20c.PeekMessage(ref msg, 0, 0, 0, 0))
- {
- int num3;
- bool flag3 = false;
- int num = this.currentSize.Width - _position[0, 0x10];
- int num2 = this.currentSize.Height - _position[0, 0x11];
- if ((((msg.message == 0x202) || (msg.message == 520)) || ((msg.message == 0x205) || (msg.message == 0x20c))) || (((msg.message == 0xa2) || (msg.message == 0xa8)) || ((msg.message == 0xa5) || (msg.message == 0xac))))
- {
- x555516122dcc901e.POINT point = this.x4b688849d80162f6(msg);
- if (((point.x >= this.currentPoint.X) && (point.x <= (this.currentPoint.X + num))) && ((point.y >= this.currentPoint.Y) && (point.y <= (this.currentPoint.Y + num2))))
- {
- this.xd6cfa3f3f3125e82(point.x, point.y);
- flag3 = true;
- }
- else
- {
- x902c4aee45bfd906 xcaeebfd = this.x3c6f7570c20e3f7d(point, ref msg);
- if (xcaeebfd != null)
- {
- xcaeebfd.xd6cfa3f3f3125e82(point.x, point.y);
- flag3 = true;
- }
- }
- }
- if ((((msg.message == 0x201) || (msg.message == 0x207)) || ((msg.message == 0x204) || (msg.message == 0x20b))) || (((msg.message == 0xa1) || (msg.message == 0xa7)) || ((msg.message == 0xa4) || (msg.message == 0xab))))
- {
- x555516122dcc901e.POINT point2 = this.x4b688849d80162f6(msg);
- if (((point2.x >= this.currentPoint.X) && (point2.x <= (this.currentPoint.X + num))) && ((point2.y >= this.currentPoint.Y) && (point2.y <= (this.currentPoint.Y + num2))))
- {
- flag3 = true;
- }
- else if (this.x3c6f7570c20e3f7d(point2, ref msg) == null)
- {
- if (this.x277ff37e12aff68b(point2, ref msg))
- {
- this.parentControl.x2ea07c3ab5d970d4(point2);
- flag3 = true;
- }
- else
- {
- this.exitLoop = true;
- flag = true;
- if ((this.parentControl != null) && (msg.hwnd == this.parentControl.Handle))
- {
- flag = false;
- }
- }
- }
- else
- {
- flag3 = true;
- }
- }
- if (msg.message == 0x200)
- {
- x555516122dcc901e.POINT point3 = this.x4b688849d80162f6(msg);
- if (((point3.x >= this.currentPoint.X) && (point3.x <= (this.currentPoint.X + num))) && ((point3.y >= this.currentPoint.Y) && (point3.y <= (this.currentPoint.Y + num2))))
- {
- this.x136735fdfe6d04ea(point3.x, point3.y);
- }
- else
- {
- if (this.mouseOver)
- {
- this.xa84c74b103039157();
- }
- x902c4aee45bfd906 xcaeebfd2 = this.x3c6f7570c20e3f7d(point3, ref msg);
- if (xcaeebfd2 != null)
- {
- xcaeebfd2.x136735fdfe6d04ea(point3.x, point3.y);
- }
- else if (this.x277ff37e12aff68b(point3, ref msg))
- {
- this.parentControl.x136735fdfe6d04ea(point3);
- }
- }
- flag3 = true;
- }
- if (msg.message == 0x20)
- {
- this.x773209141f430902();
- flag3 = true;
- }
- if (msg.message == 260)
- {
- if (((int) msg.wParam) == 0x12)
- {
- this.exitLoop = true;
- }
- else
- {
- msg.message = 0x100;
- }
- }
- if (msg.message == 0x100)
- {
- int wParam = (int) msg.wParam;
- if (wParam != 13)
- {
- switch (wParam)
- {
- case 0x25:
- this.x0e37e200024f43ba();
- goto Label_0543;
- case 0x26:
- this.x5437d760e9a6340b();
- goto Label_0543;
- case 0x27:
- if (this.xb2aa7fc859b3d5b7())
- {
- flag = true;
- }
- goto Label_0543;
- case 40:
- this.x5b2e42a68d835b31();
- goto Label_0543;
- case 0x1b:
- goto Label_04F6;
- }
- goto Label_04FF;
- }
- if (this.trackItem != -1)
- {
- x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as x2cc390e9409b0f3f;
- if (xccebff.SubMenu)
- {
- this.x0760506d6abf77a2(this.trackItem, false);
- flag = true;
- }
- else if (xccebff.Expansion)
- {
- this.x057464a452da34b7();
- }
- else
- {
- this.returnCommand = xccebff.MenuCommand;
- this.exitLoop = true;
- }
- }
- }
- goto Label_0543;
- Label_04F6:
- this.exitLoop = true;
- goto Label_0543;
- Label_04FF:
- num3 = this.x65c1cc54cc8b0e75((char) ((int) msg.wParam));
- if (num3 != -1)
- {
- x2cc390e9409b0f3f xccebff2 = this.drawCommands[num3] as x2cc390e9409b0f3f;
- this.returnCommand = xccebff2.MenuCommand;
- this.exitLoop = true;
- flag = true;
- }
- Label_0543:
- if (((msg.message == 0x100) || (msg.message == 0x101)) || ((msg.message == 260) || (msg.message == 0x105)))
- {
- flag3 = true;
- }
- if (flag3)
- {
- x40255b11ef821fa3.MSG lpMsg = new x40255b11ef821fa3.MSG();
- x61467fe65a98f20c.GetMessage(ref lpMsg, IntPtr.Zero, 0, 0);
- }
- else
- {
- if (!flag)
- {
- if (x61467fe65a98f20c.GetMessage(ref msg, IntPtr.Zero, 0, 0))
- {
- x61467fe65a98f20c.TranslateMessage(ref msg);
- x61467fe65a98f20c.DispatchMessage(ref msg);
- }
- continue;
- }
- flag = false;
- }
- }
- }
- if (flag2)
- {
- x61467fe65a98f20c.ShowCaret(IntPtr.Zero);
- }
- this.xeb515a5b77846afe(this.trackItem, -1, false, false);
- this.x4139e66e6dfaac52();
- this.DestroyHandle();
- if (((this.parentMenu == null) && (this.returnCommand != null)) && (this.parentControl == null))
- {
- this.returnCommand.OnClick(EventArgs.Empty);
- }
- return this.returnCommand;
- }
- catch (Exception)
- {
- return null;
- }
- }
- protected x5f4b657f68f87baa x6e4244e25732db7d(Point x9348d50e682f780a, Point xf361a72b1913ee9f, xd53b20b7b4b2a08a x2ac8fd3ce3986cdc, x902c4aee45bfd906 xb13f2de377f27597, bool xacc37ebdd71fcc44, x3c41176af7e54b01 x37f2fc2a7f30f790, bool xc8609d9b3214b3e7, bool x8e0eb9fe60b28fae, bool x0a7391c99fcdc469, ref int x0cd2bb383a46f073)
- {
- this.direction = xdbfa333b4cd503e0.Horizontal;
- this.parentControl = x37f2fc2a7f30f790;
- this.parentMenu = xb13f2de377f27597;
- this.animateIn = x0a7391c99fcdc469;
- xd53b20b7b4b2a08a menuCommands = this.menuCommands;
- this.menuCommands = x2ac8fd3ce3986cdc;
- this.screenPosition = x9348d50e682f780a;
- this.aboveScreenPosition = x9348d50e682f780a;
- this.leftScreenPosition = xf361a72b1913ee9f;
- this.popupRight = xc8609d9b3214b3e7;
- this.popupDown = x8e0eb9fe60b28fae;
- x5f4b657f68f87baa xfbffbaa = this.x6e4244e25732db7d(xacc37ebdd71fcc44);
- this.menuCommands = menuCommands;
- this.parentControl = null;
- this.parentMenu = null;
- this.returnDir = x0cd2bb383a46f073;
- return xfbffbaa;
- }
- protected void x76a103c0a87eb01c()
- {
- this.timer.Stop();
- if (this.popupItem != this.trackItem)
- {
- this.xeb515a5b77846afe(this.trackItem, this.popupItem, false, true);
- }
- if (this.parentMenu != null)
- {
- this.parentMenu.x76a103c0a87eb01c();
- }
- }
- protected void x773209141f430902()
- {
- x61467fe65a98f20c.SetCursor(x61467fe65a98f20c.LoadCursor(IntPtr.Zero, 0x7f00));
- }
- protected static unsafe Bitmap x7ca9c34ba153ef81(int x9b0739496f8b5475, int x4d5aabc7a55b12ba)
- {
- if (((shadowCacheWidth != x9b0739496f8b5475) || (shadowCacheHeight != x4d5aabc7a55b12ba)) || (shadowCache == null))
- {
- if (shadowCache != null)
- {
- shadowCache.Dispose();
- }
- Bitmap bitmap = new Bitmap(x9b0739496f8b5475, x4d5aabc7a55b12ba, PixelFormat.Format32bppArgb);
- BitmapData bitmapdata = bitmap.LockBits(new Rectangle(0, 0, x9b0739496f8b5475, x4d5aabc7a55b12ba), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
- uint* numPtr = (uint*) bitmapdata.Scan0;
- for (int i = 0; i < x4d5aabc7a55b12ba; i++)
- {
- int num2 = (bitmapdata.Stride * i) / 4;
- int num3 = (0x40 * (x4d5aabc7a55b12ba - i)) / (x4d5aabc7a55b12ba + 1);
- for (int j = 0; j < x9b0739496f8b5475; j++)
- {
- int num5 = (num3 * (x9b0739496f8b5475 - j)) / (x9b0739496f8b5475 + 1);
- numPtr[num2 + j] = (uint) (num5 << 0x18);
- }
- }
- bitmap.UnlockBits(bitmapdata);
- shadowCache = bitmap;
- shadowCacheWidth = x9b0739496f8b5475;
- shadowCacheHeight = x4d5aabc7a55b12ba;
- }
- return shadowCache;
- }
- protected Color x898c3842f8dd56e5(Color xfe9df16f7e7c346d, Color x753506715ee62862, int x6ad505c7ef981b0e)
- {
- Color color = Color.FromArgb(0xff, xfe9df16f7e7c346d);
- Color color2 = Color.FromArgb(0xff, x753506715ee62862);
- float r = color.R;
- float g = color.G;
- float b = color.B;
- float num4 = color2.R;
- float num5 = color2.G;
- float num6 = color2.B;
- float num7 = ((r * x6ad505c7ef981b0e) / 255f) + (num4 * (((float) (0xff - x6ad505c7ef981b0e)) / 255f));
- float num8 = ((g * x6ad505c7ef981b0e) / 255f) + (num5 * (((float) (0xff - x6ad505c7ef981b0e)) / 255f));
- float num9 = ((b * x6ad505c7ef981b0e) / 255f) + (num6 * (((float) (0xff - x6ad505c7ef981b0e)) / 255f));
- byte red = (byte) num7;
- byte green = (byte) num8;
- byte blue = (byte) num9;
- return Color.FromArgb(0xff, red, green, blue);
- }
- protected string x8cf43133d25d686a(Shortcut xc0de55fd2ca182a4)
- {
- char ch = (char) ((ushort) (xc0de55fd2ca182a4 & ((Shortcut) 0xffff)));
- if ((ch < '0') || (ch > '9'))
- {
- return TypeDescriptor.GetConverter(typeof(Keys)).ConvertToString((Keys) xc0de55fd2ca182a4);
- }
- string str = "";
- int num = (int) (((long) xc0de55fd2ca182a4) & 0xffff0000L);
- if ((num & 0x10000) != 0)
- {
- str = str + "Shift+";
- }
- if ((num & 0x20000) != 0)
- {
- str = str + "Ctrl+";
- }
- if ((num & 0x40000) != 0)
- {
- str = str + "Alt+";
- }
- return (str + ch);
- }
- protected void x9119fce83e4631ad()
- {
- this.x9119fce83e4631ad(this.currentPoint, this.currentSize, 0xff);
- }
- protected void x9119fce83e4631ad(byte x6ad505c7ef981b0e)
- {
- this.x9119fce83e4631ad(this.currentPoint, this.currentSize, x6ad505c7ef981b0e);
- }
- protected void x9119fce83e4631ad(Point x2f7096dac971d6ec, Size x0ceec69a97f73617, byte x6ad505c7ef981b0e)
- {
- Bitmap image = new Bitmap(x0ceec69a97f73617.Width, x0ceec69a97f73617.Height, PixelFormat.Format32bppArgb);
- using (Graphics graphics = Graphics.FromImage(image))
- {
- x555516122dcc901e.SIZE size;
- x555516122dcc901e.POINT point;
- x555516122dcc901e.POINT point2;
- Rectangle rectangle = new Rectangle(0, 0, x0ceec69a97f73617.Width, x0ceec69a97f73617.Height);
- this.x4af0f9e5d7ac184a(graphics, rectangle);
- this.x05a10b378cdf8119(graphics);
- IntPtr dC = x61467fe65a98f20c.GetDC(IntPtr.Zero);
- IntPtr hDC = x31775329b2a4ff52.CreateCompatibleDC(dC);
- IntPtr hbitmap = image.GetHbitmap(Color.FromArgb(0));
- IntPtr hObject = x31775329b2a4ff52.SelectObject(hDC, hbitmap);
- size.cx = x0ceec69a97f73617.Width;
- size.cy = x0ceec69a97f73617.Height;
- point.x = x2f7096dac971d6ec.X;
- point.y = x2f7096dac971d6ec.Y;
- point2.x = 0;
- point2.y = 0;
- x1439a41cfa24189f.BLENDFUNCTION pblend = new x1439a41cfa24189f.BLENDFUNCTION();
- pblend.BlendOp = 0;
- pblend.BlendFlags = 0;
- pblend.SourceConstantAlpha = x6ad505c7ef981b0e;
- pblend.AlphaFormat = 1;
- x61467fe65a98f20c.UpdateLayeredWindow(base.Handle, dC, ref point, ref size, hDC, ref point2, 0, ref pblend, 2);
- x31775329b2a4ff52.SelectObject(hDC, hObject);
- x61467fe65a98f20c.ReleaseDC(IntPtr.Zero, dC);
- x31775329b2a4ff52.DeleteObject(hbitmap);
- x31775329b2a4ff52.DeleteDC(hDC);
- }
- }
- protected void x95f5f55ee201fb8f()
- {
- xae4dd1cafd2eb77c.RECT lpRect = new xae4dd1cafd2eb77c.RECT();
- x61467fe65a98f20c.GetWindowRect(base.Handle, ref lpRect);
- Rectangle rectangle = new Rectangle(0, 0, lpRect.right - lpRect.left, lpRect.bottom - lpRect.top);
- using (Graphics graphics = Graphics.FromHwnd(base.Handle))
- {
- this.x4af0f9e5d7ac184a(graphics, rectangle);
- this.x05a10b378cdf8119(graphics);
- }
- }
- protected void xa1715c5212ff8a33()
- {
- this.layered = supportsLayered;
- Size size = this.x4e2849ed170f5bc2();
- Point point = this.x1339f634e34e0e03(size);
- if (this.menuCommands.Count == 0)
- {
- size = new Size(0, 0);
- }
- CreateParams cp = new CreateParams();
- cp.Caption = "NativeSkinContextMenu";
- cp.X = point.X;
- cp.Y = point.Y;
- cp.Height = size.Height;
- cp.Width = size.Width;
- cp.Parent = IntPtr.Zero;
- cp.Style = -2147483648;
- cp.ExStyle = 0x88;
- if (this.layered)
- {
- cp.ExStyle += 0x80000;
- }
- this.CreateHandle(cp);
- if (!this.layered)
- {
- this.x1803d70928e3ae9b(size);
- }
- this.currentSize = size;
- this.currentPoint = point;
- bool flag = false;
- if (this.layered)
- {
- this.x9119fce83e4631ad();
- bool flag2 = false;
- switch (this.animateItem)
- {
- case x6fd23f8bad2f3ced.No:
- flag2 = false;
- break;
- case x6fd23f8bad2f3ced.Yes:
- flag2 = true;
- break;
- case x6fd23f8bad2f3ced.System:
- {
- int bRetValue = 0;
- x61467fe65a98f20c.SystemParametersInfoA(0x1002, 0, ref bRetValue, 0);
- flag2 = bRetValue != 0;
- break;
- }
- }
- if (flag2 && this.animateIn)
- {
- uint animateStyle = (uint) this.animateStyle;
- if (this.animateStyle == x1f5697535eab37b9.System)
- {
- int num3 = 0;
- x61467fe65a98f20c.SystemParametersInfoA(0x1012, 0, ref num3, 0);
- if (num3 != 0)
- {
- animateStyle = 0x80000;
- }
- else
- {
- animateStyle = 0x40005;
- }
- }
- if ((animateStyle & 0x80000) != 0)
- {
- this.xf1420593eaecc724(true);
- }
- else
- {
- x61467fe65a98f20c.AnimateWindow(base.Handle, (uint) this.animateTime, animateStyle);
- }
- flag = true;
- }
- }
- if (!flag)
- {
- x61467fe65a98f20c.ShowWindow(base.Handle, 4);
- }
- }
- protected void xa68b9c37c0ff7fc5(ref Message x6088325dec1baa2a)
- {
- this.timer.Stop();
- this.exitLoop = true;
- }
- protected void xa84c74b103039157()
- {
- if ((this.trackItem != -1) && (this.childMenu == null))
- {
- this.xeb515a5b77846afe(this.trackItem, -1, false, false);
- }
- this.mouseOver = false;
- this.lastMousePosition = new Point(-1, -1);
- }
- protected bool xb2aa7fc859b3d5b7()
- {
- bool flag = this.parentControl != null;
- bool flag2 = false;
- bool flag3 = false;
- if (this.trackItem != -1)
- {
- x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as x2cc390e9409b0f3f;
- if (xccebff.SubMenu)
- {
- this.x0760506d6abf77a2(this.trackItem, true);
- flag3 = true;
- }
- else
- {
- int col = xccebff.Col;
- int row = xccebff.Row;
- int num3 = -1;
- int num4 = -1;
- int num5 = col + 1;
- x2cc390e9409b0f3f xccebff2 = null;
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- x2cc390e9409b0f3f xccebff3 = this.drawCommands[i] as x2cc390e9409b0f3f;
- if ((((xccebff3.Col == num5) && (xccebff3.Row <= row)) && ((xccebff3.Row > num4) && !xccebff3.Separator)) && xccebff3.Enabled)
- {
- num4 = xccebff3.Row;
- xccebff2 = xccebff3;
- num3 = i;
- }
- }
- if (xccebff2 != null)
- {
- this.xeb515a5b77846afe(this.trackItem, num3, false, false);
- }
- else
- {
- flag2 = true;
- }
- }
- }
- else if (this.parentMenu != null)
- {
- if (!this.x5b2e42a68d835b31())
- {
- flag2 = true;
- }
- }
- else
- {
- flag2 = true;
- }
- if (flag && flag2)
- {
- this.returnCommand = null;
- this.timer.Stop();
- this.exitLoop = true;
- this.returnDir = 1;
- }
- return flag3;
- }
- protected void xb3525a0e7d2fd376()
- {
- this.layered = supportsLayered;
- Size size = this.x4e2849ed170f5bc2();
- Point point = this.x6e375ee3ca34b13b(size);
- if (this.menuCommands.Count == 0)
- {
- size = new Size(0, 0);
- }
- CreateParams cp = new CreateParams();
- cp.Caption = "NativeSkinContextMenu";
- cp.X = point.X;
- cp.Y = point.Y;
- cp.Height = size.Height;
- cp.Width = size.Width;
- cp.Parent = IntPtr.Zero;
- cp.Style = -2147483648;
- cp.ExStyle = 0x88;
- if (this.layered)
- {
- cp.ExStyle += 0x80000;
- }
- this.CreateHandle(cp);
- if (!this.layered)
- {
- this.x1803d70928e3ae9b(size);
- }
- this.currentSize = size;
- this.currentPoint = point;
- bool flag = false;
- if (this.layered)
- {
- this.x9119fce83e4631ad();
- bool flag2 = false;
- switch (this.animateItem)
- {
- case x6fd23f8bad2f3ced.No:
- flag2 = false;
- break;
- case x6fd23f8bad2f3ced.Yes:
- flag2 = true;
- break;
- case x6fd23f8bad2f3ced.System:
- {
- int bRetValue = 0;
- x61467fe65a98f20c.SystemParametersInfoA(0x1002, 0, ref bRetValue, 0);
- flag2 = bRetValue != 0;
- break;
- }
- }
- if (flag2 && this.animateIn)
- {
- uint animateStyle = (uint) this.animateStyle;
- if (this.animateStyle == x1f5697535eab37b9.System)
- {
- int num3 = 0;
- x61467fe65a98f20c.SystemParametersInfoA(0x1012, 0, ref num3, 0);
- if (num3 != 0)
- {
- animateStyle = 0x80000;
- }
- else
- {
- animateStyle = 0x40005;
- }
- }
- if ((animateStyle & 0x80000) != 0)
- {
- this.xf1420593eaecc724(true);
- }
- else
- {
- x61467fe65a98f20c.AnimateWindow(base.Handle, (uint) this.animateTime, animateStyle);
- }
- flag = true;
- }
- }
- if (!flag)
- {
- x61467fe65a98f20c.ShowWindow(base.Handle, 4);
- }
- }
- internal void xb5a5bdae3ba8936b(Graphics x4b101060f4767186, x2cc390e9409b0f3f xd2a8bb4342ab4ef6, bool x15a0329046fb799f)
- {
- Brush brush;
- int num10;
- Rectangle rectangle7;
- SolidBrush brush9;
- Rectangle drawRect = xd2a8bb4342ab4ef6.DrawRect;
- x5f4b657f68f87baa menuCommand = xd2a8bb4342ab4ef6.MenuCommand;
- Color color1 = this.Engine.Res.Colors.SKIN2_SELECTEDMENUCOLOR;
- Color color = this.Engine.Res.Colors.SKIN2_SELECTEDMENUBORDERCOLOR;
- Color color2 = this.Engine.Res.Colors.SKIN2_SELECTEDMENUCOLOR;
- int num = _position[0, 8];
- int num2 = _position[0, 5];
- int num3 = _position[0, 7];
- int x = drawRect.Left + num2;
- int width = (num2 + imageWidth) + num3;
- int num1 = _position[0, 10];
- int num17 = _position[0, 11];
- int num18 = _position[0, 12];
- int num6 = (drawRect.Right - _position[0, 12]) - _position[0, 11];
- int num7 = (num6 - _position[0, 10]) - _position[0, 9];
- if (!xd2a8bb4342ab4ef6.Expansion)
- {
- if (!xd2a8bb4342ab4ef6.Separator)
- {
- goto Label_0449;
- }
- if (xd2a8bb4342ab4ef6.VerticalSeparator)
- {
- using (Pen pen2 = new Pen(ControlPaint.Dark(this.Engine.Res.Colors.SKIN2_MENUITEMCOLOR)))
- {
- x4b101060f4767186.DrawLine(pen2, drawRect.Left, drawRect.Top, drawRect.Left, drawRect.Bottom);
- return;
- }
- }
- Rectangle rectangle4 = new Rectangle(drawRect.Left, drawRect.Top, width, drawRect.Height);
- x4b101060f4767186.FillRectangle(Brushes.White, rectangle4);
- if (this.Engine.Res.Colors.SKIN2_LEFTBARSTARTCOLOR != this.xcab6a0e662ada486.Res.Colors.SKIN2_LEFTBARENDCOLOR)
- {
- using (LinearGradientBrush brush4 = new LinearGradientBrush(rectangle4, this.xcab6a0e662ada486.Res.Colors.SKIN2_LEFTBARSTARTCOLOR, this.xcab6a0e662ada486.Res.Colors.SKIN2_LEFTBARENDCOLOR, LinearGradientMode.Horizontal))
- {
- x4b101060f4767186.FillRectangle(brush4, rectangle4);
- goto Label_03E7;
- }
- }
- brush = this.Engine.Res.Brushes.SKIN2_LEFTBARSTARTCOLOR;
- x4b101060f4767186.FillRectangle(brush, rectangle4);
- goto Label_03E7;
- }
- Rectangle rectangle2 = drawRect;
- rectangle2.X += width;
- rectangle2.Width -= width;
- int num8 = rectangle2.Left + ((rectangle2.Width - imageHeight) / 2);
- int y = rectangle2.Top + ((rectangle2.Height - imageHeight) / 2);
- if (x15a0329046fb799f)
- {
- Rectangle rectangle3 = new Rectangle(drawRect.Left + 1, drawRect.Top, drawRect.Width - 3, drawRect.Height - 1);
- using (Pen pen = new Pen(color))
- {
- using (SolidBrush brush2 = new SolidBrush(Color.White))
- {
- x4b101060f4767186.FillRectangle(brush2, rectangle3);
- }
- using (SolidBrush brush3 = new SolidBrush(color2))
- {
- x4b101060f4767186.FillRectangle(brush3, rectangle3);
- x4b101060f4767186.DrawRectangle(pen, rectangle3);
- }
- goto Label_029C;
- }
- }
- brush = this.Engine.Res.Brushes.SKIN2_MENUITEMCOLOR;
- x4b101060f4767186.FillRectangle(brush, new Rectangle(drawRect.Left + 1, drawRect.Top, drawRect.Width - 1, drawRect.Height));
- x4b101060f4767186.FillRectangle(Brushes.White, new Rectangle(drawRect.Left, drawRect.Top, width, drawRect.Height));
- brush = this.Engine.Res.Brushes.SKIN2_LEFTBARSTARTCOLOR;
- x4b101060f4767186.FillRectangle(brush, new Rectangle(drawRect.Left, drawRect.Top, width, drawRect.Height));
- Label_029C:
- x4b101060f4767186.DrawImage(menuImages.Images[6], num8, y);
- return;
- Label_03E7:
- using (Pen pen3 = new Pen(Color.FromArgb(0x4b, this.Engine.Res.Colors.SKIN2_MENUITEMFONTCOLOR)))
- {
- x4b101060f4767186.DrawLine(pen3, (drawRect.Left + width) + num, drawRect.Top + 2, drawRect.Right, drawRect.Top + 2);
- return;
- }
- Label_0449:
- num10 = (drawRect.Left + width) + num;
- if (x15a0329046fb799f)
- {
- Rectangle rectangle5 = new Rectangle(drawRect.Left + 1, drawRect.Top, drawRect.Width - 3, drawRect.Height - 1);
- using (Pen pen4 = new Pen(color))
- {
- using (SolidBrush brush5 = new SolidBrush(Color.White))
- {
- x4b101060f4767186.FillRectangle(brush5, rectangle5);
- }
- using (SolidBrush brush6 = new SolidBrush(color2))
- {
- x4b101060f4767186.FillRectangle(brush6, rectangle5);
- x4b101060f4767186.DrawRectangle(pen4, rectangle5);
- }
- goto Label_069E;
- }
- }
- brush = this.Engine.Res.Brushes.SKIN2_MENUITEMCOLOR;
- x4b101060f4767186.FillRectangle(brush, new Rectangle(drawRect.Left + 1, drawRect.Top, drawRect.Width - 1, drawRect.Height));
- if (xd2a8bb4342ab4ef6.Infrequent && this.highlightInfrequent)
- {
- x4b101060f4767186.FillRectangle(Brushes.White, new Rectangle(num10, drawRect.Top, (drawRect.Right - num10) - num, drawRect.Height));
- using (Brush brush7 = new SolidBrush(x448fd9ab43628c71.CalculateColor(this.Engine.Res.Colors.SKIN2_MENUITEMCOLOR, Color.White, 150)))
- {
- x4b101060f4767186.FillRectangle(brush7, new Rectangle(num10, drawRect.Top, (drawRect.Right - num10) - num, drawRect.Height));
- }
- }
- Rectangle rect = new Rectangle(drawRect.Left, drawRect.Top, width, drawRect.Height);
- x4b101060f4767186.FillRectangle(Brushes.White, rect);
- if (this.Engine.Res.Colors.SKIN2_LEFTBARSTARTCOLOR != this.Engine.Res.Colors.SKIN2_LEFTBARENDCOLOR)
- {
- using (LinearGradientBrush brush8 = new LinearGradientBrush(rect, this.xcab6a0e662ada486.Res.Colors.SKIN2_LEFTBARSTARTCOLOR, this.xcab6a0e662ada486.Res.Colors.SKIN2_LEFTBARENDCOLOR, LinearGradientMode.Horizontal))
- {
- x4b101060f4767186.FillRectangle(brush8, rect);
- goto Label_069E;
- }
- }
- brush = this.Engine.Res.Brushes.SKIN2_LEFTBARSTARTCOLOR;
- x4b101060f4767186.FillRectangle(brush, rect);
- Label_069E:
- rectangle7 = new Rectangle(num10, drawRect.Top, num7 - num10, drawRect.Height);
- StringFormat format = new StringFormat();
- format.FormatFlags = StringFormatFlags.NoClip | StringFormatFlags.NoWrap;
- if ((this.parentControl != null) && ((this.parentControl.RightToLeft & RightToLeft.Yes) == RightToLeft.Yes))
- {
- format.FormatFlags |= StringFormatFlags.DirectionRightToLeft;
- }
- if ((this.x94975a4c4f1d71c4 & RightToLeft.Yes) == RightToLeft.Yes)
- {
- format.FormatFlags |= StringFormatFlags.DirectionRightToLeft;
- }
- format.Alignment = StringAlignment.Near;
- format.LineAlignment = StringAlignment.Center;
- format.HotkeyPrefix = HotkeyPrefix.Show;
- if (x15a0329046fb799f)
- {
- brush9 = new SolidBrush(this.Engine.Res.Colors.SKIN2_SELECTEDMENUFONTCOLOR);
- }
- else if (menuCommand.Enabled)
- {
- brush9 = new SolidBrush(this.Engine.Res.Colors.SKIN2_MENUITEMFONTCOLOR);
- }
- else
- {
- brush9 = new SolidBrush(SystemColors.GrayText);
- }
- rectangle7.Offset(1, 1);
- x4b101060f4767186.DrawString(menuCommand.Text, this.textFont, brush9, rectangle7, format);
- if (menuCommand.Shortcut != Shortcut.None)
- {
- format.Alignment = StringAlignment.Far;
- if (menuCommand.Enabled)
- {
- x4b101060f4767186.DrawString(this.x8cf43133d25d686a(menuCommand.Shortcut), this.textFont, brush9, rectangle7, format);
- }
- else
- {
- x4b101060f4767186.DrawString(this.x8cf43133d25d686a(menuCommand.Shortcut), this.textFont, brush9, rectangle7, format);
- }
- }
- int num11 = drawRect.Top + ((drawRect.Height - imageHeight) / 2);
- Image image = null;
- if (menuCommand.Checked)
- {
- Pen pen5;
- Brush brush10;
- if (menuCommand.Enabled)
- {
- pen5 = new Pen(color);
- brush10 = new SolidBrush(Color.FromArgb(20, this.Engine.Res.Colors.SKIN2_SELECTEDMENUBORDERCOLOR));
- }
- else
- {
- pen5 = new Pen(SystemColors.GrayText);
- brush10 = new SolidBrush(Color.FromArgb(20, SystemColors.GrayText));
- }
- Rectangle rectangle9 = new Rectangle(x - 1, num11 - 1, imageHeight + 2, imageWidth + 2);
- x4b101060f4767186.FillRectangle(brush10, rectangle9);
- x4b101060f4767186.DrawRectangle(pen5, rectangle9);
- pen5.Dispose();
- brush10.Dispose();
- if (menuCommand.RadioCheck)
- {
- image = menuImages.Images[1];
- }
- else
- {
- image = this.Engine.Res.Bitmaps.SKIN2_CHECKEDMENUICON;
- }
- }
- else
- {
- try
- {
- if (menuCommand.Image != null)
- {
- image = menuCommand.Image;
- }
- else if ((menuCommand.ImageList != null) && (menuCommand.ImageIndex >= 0))
- {
- image = menuCommand.ImageList.Images[menuCommand.ImageIndex];
- }
- }
- catch (Exception)
- {
- image = menuImages.Images[7];
- }
- }
- if (image != null)
- {
- if (menuCommand.Enabled)
- {
- if (x15a0329046fb799f && !menuCommand.Checked)
- {
- Bitmap bitmap = new Bitmap((Bitmap) image);
- Color color3 = Color.FromArgb(0x9a, 0x9c, 0x92);
- Color color4 = Color.FromArgb(0, 0, 0, 0);
- for (int i = 0; i < image.Width; i++)
- {
- for (int j = 0; j < image.Height; j++)
- {
- if (bitmap.GetPixel(i, j) != color4)
- {
- bitmap.SetPixel(i, j, color3);
- }
- }
- }
- x4b101060f4767186.DrawImage(bitmap, (int) (x + 1), (int) (num11 + 1));
- x4b101060f4767186.DrawImage(image, (int) (x - 1), (int) (num11 - 1));
- }
- else
- {
- Bitmap bitmap2 = new Bitmap(image);
- Color color5 = Color.FromArgb(0, 0, 0, 0);
- for (int k = 0; k < image.Width; k++)
- {
- for (int m = 0; m < image.Height; m++)
- {
- Color pixel = bitmap2.GetPixel(k, m);
- if (pixel != color5)
- {
- Color color7 = Color.FromArgb((pixel.R + 0x4c) - (((pixel.R + 0x20) / 0x40) * 0x13), (pixel.G + 0x4c) - (((pixel.G + 0x20) / 0x40) * 0x13), (pixel.B + 0x4c) - (((pixel.B + 0x20) / 0x40) * 0x13));
- bitmap2.SetPixel(k, m, color7);
- }
- }
- }
- x4b101060f4767186.DrawImage(bitmap2, x, num11);
- }
- }
- else
- {
- ControlPaint.DrawImageDisabled(x4b101060f4767186, image, x, num11, SystemColors.HighlightText);
- }
- }
- if (xd2a8bb4342ab4ef6.SubMenu)
- {
- if (menuCommand.Enabled)
- {
- int num16 = 2;
- x4b101060f4767186.DrawImage(menuImages.Images[num16], num6, num11);
- }
- else
- {
- ControlPaint.DrawImageDisabled(x4b101060f4767186, menuImages.Images[2], num6, num11, this.Engine.Res.Colors.SKIN2_SELECTEDMENUFONTCOLOR);
- }
- }
- }
- protected void xb97e8a8020dddaac()
- {
- if (this.childMenu != null)
- {
- x61467fe65a98f20c.PostMessage(this.childMenu.Handle, this.WM_DISMISS, (uint) 0, (uint) 0);
- }
- this.returnCommand = null;
- this.timer.Stop();
- this.exitLoop = true;
- this.x4139e66e6dfaac52();
- this.DestroyHandle();
- }
- protected void xbcf8eb07b7e76a62(ref Message x6088325dec1baa2a)
- {
- x555516122dcc901e.POINT point;
- x555516122dcc901e.POINT point2;
- int wParam = (int) x6088325dec1baa2a.WParam;
- bool flag = x6088325dec1baa2a.LParam != IntPtr.Zero;
- this.popupItem = wParam;
- this.childMenu = new x902c4aee45bfd906(this.Engine);
- x2cc390e9409b0f3f xccebff = this.drawCommands[wParam] as x2cc390e9409b0f3f;
- point.x = xccebff.DrawRect.Right;
- point.y = xccebff.DrawRect.Top;
- x61467fe65a98f20c.ClientToScreen(base.Handle, ref point);
- point2.x = xccebff.DrawRect.Left;
- point2.y = xccebff.DrawRect.Top;
- x61467fe65a98f20c.ClientToScreen(base.Handle, ref point2);
- this.childMenu.Font = this.Font;
- this.childMenu.Animate = this.Animate;
- this.childMenu.AnimateStyle = this.AnimateStyle;
- this.childMenu.AnimateTime = this.AnimateTime;
- int num2 = 0;
- this.childMenu.RememberExpansion = this.rememberExpansion;
- this.childMenu.showInfrequent = xccebff.MenuCommand.MenuCommands.ShowInfrequent;
- this.childMenu.HighlightInfrequent = this.highlightInfrequent;
- xccebff.MenuCommand.OnPopupStart();
- this.returnCommand = this.childMenu.x6e4244e25732db7d(new Point(point.x, point.y), new Point(point2.x, point2.y), xccebff.MenuCommand.MenuCommands, this, flag, this.parentControl, this.popupRight, this.popupDown, this.animateFirst, ref num2);
- xccebff.MenuCommand.OnPopupEnd();
- wParam = -1;
- this.childMenu = null;
- this.animateFirst = false;
- if ((this.returnCommand != null) || (num2 != 0))
- {
- this.timer.Stop();
- this.exitLoop = true;
- this.returnDir = num2;
- }
- }
- protected x902c4aee45bfd906 xcb534454d6825379(x555516122dcc901e.POINT x0ce73f6cbd7d5515)
- {
- xae4dd1cafd2eb77c.RECT lpRect = new xae4dd1cafd2eb77c.RECT();
- x61467fe65a98f20c.GetWindowRect(base.Handle, ref lpRect);
- if (((x0ce73f6cbd7d5515.x >= lpRect.left) && (x0ce73f6cbd7d5515.x <= lpRect.right)) && ((x0ce73f6cbd7d5515.y >= lpRect.top) && (x0ce73f6cbd7d5515.y <= lpRect.bottom)))
- {
- return this;
- }
- if (this.parentMenu != null)
- {
- return this.parentMenu.xcb534454d6825379(x0ce73f6cbd7d5515);
- }
- return null;
- }
- protected void xcea282a46787878f(Graphics x4b101060f4767186, int xa447fc54e41dfe06, int xc941868c59399d3e, int x9b0739496f8b5475, int x4d5aabc7a55b12ba, xf398ffaf32ffe055 x9c9eac3a36336680)
- {
- if (this.layered)
- {
- Color color = Color.FromArgb(0x40, 0, 0, 0);
- Color color2 = Color.FromArgb(0x30, 0, 0, 0);
- Color color3 = Color.FromArgb(0, 0, 0, 0);
- if ((x9c9eac3a36336680 != xf398ffaf32ffe055.Right) && (x9b0739496f8b5475 >= shadowLength))
- {
- using (LinearGradientBrush brush = new LinearGradientBrush(new Point(xa447fc54e41dfe06 + shadowLength, xc941868c59399d3e - shadowLength), new Point(xa447fc54e41dfe06, xc941868c59399d3e + x4d5aabc7a55b12ba), color, color3))
- {
- x4b101060f4767186.FillRectangle(brush, xa447fc54e41dfe06, xc941868c59399d3e, shadowLength, x4d5aabc7a55b12ba);
- xa447fc54e41dfe06 += shadowLength;
- x9b0739496f8b5475 -= shadowLength;
- }
- }
- if ((x9c9eac3a36336680 != xf398ffaf32ffe055.Left) && (x9b0739496f8b5475 >= shadowLength))
- {
- try
- {
- x4b101060f4767186.DrawImageUnscaled(x7ca9c34ba153ef81(shadowLength, x4d5aabc7a55b12ba), (xa447fc54e41dfe06 + x9b0739496f8b5475) - shadowLength, xc941868c59399d3e);
- }
- catch
- {
- }
- x9b0739496f8b5475 -= shadowLength;
- }
- using (LinearGradientBrush brush2 = new LinearGradientBrush(new Point(0x270f, xc941868c59399d3e), new Point(0x270f, xc941868c59399d3e + x4d5aabc7a55b12ba), color2, color3))
- {
- x4b101060f4767186.FillRectangle(brush2, xa447fc54e41dfe06, xc941868c59399d3e, x9b0739496f8b5475, x4d5aabc7a55b12ba);
- return;
- }
- }
- using (SolidBrush brush3 = new SolidBrush(ControlPaint.Dark(this.Engine.Res.Colors.SKIN2_MENUITEMCOLOR)))
- {
- x4b101060f4767186.FillRectangle(brush3, xa447fc54e41dfe06, xc941868c59399d3e, x9b0739496f8b5475, x4d5aabc7a55b12ba);
- }
- }
- protected void xd6cfa3f3f3125e82(int x75cf7df8c59ffa4d, int xc13ed6de98262a2d)
- {
- x75cf7df8c59ffa4d -= this.currentPoint.X;
- xc13ed6de98262a2d -= this.currentPoint.Y;
- Point pt = new Point(x75cf7df8c59ffa4d, xc13ed6de98262a2d);
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- x2cc390e9409b0f3f xccebff = this.drawCommands[i] as x2cc390e9409b0f3f;
- if (xccebff.DrawRect.Contains(pt) && (this.trackItem != i))
- {
- this.xeb515a5b77846afe(this.trackItem, i, false, false);
- }
- }
- if (this.trackItem != -1)
- {
- x2cc390e9409b0f3f xccebff2 = this.drawCommands[this.trackItem] as x2cc390e9409b0f3f;
- if (xccebff2.SubMenu)
- {
- if (this.popupItem != this.trackItem)
- {
- if (this.childMenu != null)
- {
- x61467fe65a98f20c.PostMessage(this.childMenu.Handle, this.WM_DISMISS, (uint) 0, (uint) 0);
- }
- this.x0760506d6abf77a2(this.trackItem, false);
- }
- }
- else if (xccebff2.Expansion)
- {
- this.x057464a452da34b7();
- }
- else
- {
- if (this.childMenu != null)
- {
- x61467fe65a98f20c.PostMessage(this.childMenu.Handle, this.WM_DISMISS, (uint) 0, (uint) 0);
- }
- this.returnCommand = xccebff2.MenuCommand;
- this.timer.Stop();
- this.exitLoop = true;
- }
- }
- }
- protected bool xddec9c21ef58186c(ref Message x6088325dec1baa2a)
- {
- x555516122dcc901e.POINT point;
- x555516122dcc901e.POINT point2;
- point.x = (short) (((int) x6088325dec1baa2a.LParam) & 0xffff);
- point.y = (short) ((((int) x6088325dec1baa2a.LParam) & -65536) >> 0x10);
- point2.x = this.currentSize.Width - _position[0, 0x10];
- point2.y = this.currentSize.Height - _position[0, 0x11];
- x61467fe65a98f20c.ClientToScreen(base.Handle, ref point2);
- if ((point.x <= point2.x) && (point.y <= point2.y))
- {
- return false;
- }
- x6088325dec1baa2a.Result = (IntPtr) (-1);
- return true;
- }
- protected void xe145f7beb24da7f5(Graphics x4b101060f4767186, Rectangle x04a925412b1bb508)
- {
- Rectangle rect = new Rectangle(x04a925412b1bb508.Left, x04a925412b1bb508.Top, this.extraSize - _position[0, 20], x04a925412b1bb508.Height);
- Brush extraBackBrush = null;
- bool flag = true;
- if (this.menuCommands.ExtraBackBrush != null)
- {
- extraBackBrush = this.menuCommands.ExtraBackBrush;
- flag = false;
- rect.Width++;
- }
- else
- {
- extraBackBrush = new SolidBrush(this.menuCommands.ExtraBackColor);
- }
- x4b101060f4767186.FillRectangle(extraBackBrush, rect);
- if (flag)
- {
- extraBackBrush.Dispose();
- }
- rect.X += _position[0, 0x12];
- rect.Y += _position[0, 0x13];
- rect.Width -= _position[0, 0x12] * 2;
- rect.Height -= _position[0, 0x13] * 2;
- StringFormat drawFormat = new StringFormat();
- drawFormat.FormatFlags = StringFormatFlags.NoClip | StringFormatFlags.NoWrap | StringFormatFlags.DirectionVertical;
- drawFormat.Alignment = StringAlignment.Near;
- drawFormat.LineAlignment = StringAlignment.Center;
- Brush drawBrush = null;
- bool flag2 = true;
- if (this.menuCommands.ExtraTextBrush != null)
- {
- drawBrush = this.menuCommands.ExtraTextBrush;
- flag2 = false;
- }
- else
- {
- drawBrush = new SolidBrush(this.menuCommands.ExtraTextColor);
- }
- x957e371151765ec5.DrawReverseString(x4b101060f4767186, this.menuCommands.ExtraText, this.menuCommands.ExtraFont, rect, drawBrush, drawFormat);
- if (flag2)
- {
- drawBrush.Dispose();
- }
- }
- protected void xe75f29bc258e83bf(Graphics x4b101060f4767186, int xa447fc54e41dfe06, int xc941868c59399d3e, int x9b0739496f8b5475, int x4d5aabc7a55b12ba)
- {
- if (this.layered)
- {
- Color color = Color.FromArgb(0x40, 0, 0, 0);
- Color color2 = Color.FromArgb(0x30, 0, 0, 0);
- Color color3 = Color.FromArgb(0, 0, 0, 0);
- if (x4d5aabc7a55b12ba >= shadowLength)
- {
- using (LinearGradientBrush brush = new LinearGradientBrush(new Point(xa447fc54e41dfe06 - shadowLength, xc941868c59399d3e + shadowLength), new Point(xa447fc54e41dfe06 + shadowLength, xc941868c59399d3e), color, color3))
- {
- x4b101060f4767186.FillRectangle(brush, xa447fc54e41dfe06, xc941868c59399d3e, shadowLength, shadowLength);
- xc941868c59399d3e += shadowLength;
- x4d5aabc7a55b12ba -= shadowLength;
- }
- }
- using (LinearGradientBrush brush2 = new LinearGradientBrush(new Point(xa447fc54e41dfe06, 0), new Point(xa447fc54e41dfe06 + x9b0739496f8b5475, 0), color2, color3))
- {
- x4b101060f4767186.FillRectangle(brush2, xa447fc54e41dfe06, xc941868c59399d3e, x9b0739496f8b5475, x4d5aabc7a55b12ba + 1);
- return;
- }
- }
- using (SolidBrush brush3 = new SolidBrush(ControlPaint.Dark(this.Engine.Res.Colors.SKIN2_MENUITEMCOLOR)))
- {
- x4b101060f4767186.FillRectangle(brush3, xa447fc54e41dfe06, xc941868c59399d3e, x9b0739496f8b5475, x4d5aabc7a55b12ba + 1);
- }
- }
- protected void xeb515a5b77846afe(int x5360a38cdebd0e93, int x169940ac3300e3e7, bool xaca68b9c5e07af12, bool xb2ad27288bcb93e7)
- {
- bool flag = false;
- using (Graphics graphics = Graphics.FromHwnd(base.Handle))
- {
- if (x5360a38cdebd0e93 != -1)
- {
- x2cc390e9409b0f3f xccebff = this.drawCommands[x5360a38cdebd0e93] as x2cc390e9409b0f3f;
- if (this.layered)
- {
- flag = true;
- }
- else
- {
- this.xb5a5bdae3ba8936b(graphics, this.drawCommands[x5360a38cdebd0e93] as x2cc390e9409b0f3f, false);
- }
- if (xccebff.MenuCommand != null)
- {
- this.OnDeselected(xccebff.MenuCommand);
- }
- }
- if (x169940ac3300e3e7 != -1)
- {
- this.timer.Stop();
- if (!xb2ad27288bcb93e7 && (this.childMenu != null))
- {
- this.timer.Interval = selectionDelay;
- this.timer.Start();
- }
- x2cc390e9409b0f3f xccebff2 = this.drawCommands[x169940ac3300e3e7] as x2cc390e9409b0f3f;
- if (!xccebff2.Separator && xccebff2.Enabled)
- {
- if (this.layered)
- {
- flag = true;
- }
- else
- {
- this.xb5a5bdae3ba8936b(graphics, xccebff2, true);
- }
- if (!xb2ad27288bcb93e7 && xaca68b9c5e07af12)
- {
- if (xccebff2.Expansion)
- {
- this.timer.Interval = expansionDelay;
- }
- else
- {
- this.timer.Interval = selectionDelay;
- }
- this.timer.Start();
- }
- if (xccebff2.MenuCommand != null)
- {
- this.OnSelected(xccebff2.MenuCommand);
- }
- }
- else
- {
- x169940ac3300e3e7 = -1;
- }
- }
- this.trackItem = x169940ac3300e3e7;
- if (this.layered && flag)
- {
- this.x9119fce83e4631ad();
- }
- }
- }
- protected void xf1420593eaecc724(bool x789c645a15deb49b)
- {
- this.x9119fce83e4631ad(0);
- x61467fe65a98f20c.ShowWindow(base.Handle, 4);
- int num = this.animateTime / blendSteps;
- for (int i = 0; i < blendSteps; i++)
- {
- byte num3 = (byte) (0x3f + ((0xc0 / blendSteps) * (i + 1)));
- DateTime now = DateTime.Now;
- this.x9119fce83e4631ad(num3);
- TimeSpan span = DateTime.Now.Subtract(now);
- if ((this.animateTime > 0) && (span.Milliseconds < num))
- {
- Thread.Sleep((int) (num - span.Milliseconds));
- }
- }
- }
- protected x5f4b657f68f87baa xf1c4e2176aec0ad6(bool xacc37ebdd71fcc44)
- {
- try
- {
- this.returnCommand = null;
- this.trackItem = -1;
- this.exitLoop = false;
- this.mouseOver = false;
- this.returnDir = 0;
- bool flag = false;
- this.animateFirst = true;
- this.xa1715c5212ff8a33();
- x40255b11ef821fa3.MSG msg = new x40255b11ef821fa3.MSG();
- if (xacc37ebdd71fcc44)
- {
- this.x5b2e42a68d835b31();
- }
- x61467fe65a98f20c.SetCursor(x61467fe65a98f20c.LoadCursor(IntPtr.Zero, 0x7f00));
- bool flag2 = x61467fe65a98f20c.HideCaret(IntPtr.Zero);
- while (!this.exitLoop)
- {
- if (!x61467fe65a98f20c.WaitMessage())
- {
- continue;
- }
- while (!this.exitLoop && x61467fe65a98f20c.PeekMessage(ref msg, 0, 0, 0, 0))
- {
- int num3;
- bool flag3 = false;
- int num = this.currentSize.Width - _position[0, 0x10];
- int num2 = this.currentSize.Height - _position[0, 0x11];
- if ((((msg.message == 0x202) || (msg.message == 520)) || ((msg.message == 0x205) || (msg.message == 0x20c))) || (((msg.message == 0xa2) || (msg.message == 0xa8)) || ((msg.message == 0xa5) || (msg.message == 0xac))))
- {
- x555516122dcc901e.POINT point = this.x4b688849d80162f6(msg);
- if (((point.x >= this.currentPoint.X) && (point.x <= (this.currentPoint.X + num))) && ((point.y >= this.currentPoint.Y) && (point.y <= (this.currentPoint.Y + num2))))
- {
- this.xd6cfa3f3f3125e82(point.x, point.y);
- flag3 = true;
- }
- else
- {
- x902c4aee45bfd906 xcaeebfd = this.x3c6f7570c20e3f7d(point, ref msg);
- if (xcaeebfd != null)
- {
- xcaeebfd.xd6cfa3f3f3125e82(point.x, point.y);
- flag3 = true;
- }
- }
- }
- if ((((msg.message == 0x201) || (msg.message == 0x207)) || ((msg.message == 0x204) || (msg.message == 0x20b))) || (((msg.message == 0xa1) || (msg.message == 0xa7)) || ((msg.message == 0xa4) || (msg.message == 0xab))))
- {
- x555516122dcc901e.POINT point2 = this.x4b688849d80162f6(msg);
- if (((point2.x >= this.currentPoint.X) && (point2.x <= (this.currentPoint.X + num))) && ((point2.y >= this.currentPoint.Y) && (point2.y <= (this.currentPoint.Y + num2))))
- {
- flag3 = true;
- }
- else if (this.x3c6f7570c20e3f7d(point2, ref msg) == null)
- {
- if (this.x277ff37e12aff68b(point2, ref msg))
- {
- this.parentControl.x2ea07c3ab5d970d4(point2);
- flag3 = true;
- }
- else
- {
- this.exitLoop = true;
- flag = true;
- if ((this.parentControl != null) && (msg.hwnd == this.parentControl.Handle))
- {
- flag = false;
- }
- }
- }
- else
- {
- flag3 = true;
- }
- }
- if (msg.message == 0x200)
- {
- x555516122dcc901e.POINT point3 = this.x4b688849d80162f6(msg);
- if (((point3.x >= this.currentPoint.X) && (point3.x <= (this.currentPoint.X + num))) && ((point3.y >= this.currentPoint.Y) && (point3.y <= (this.currentPoint.Y + num2))))
- {
- this.x136735fdfe6d04ea(point3.x, point3.y);
- }
- else
- {
- if (this.mouseOver)
- {
- this.xa84c74b103039157();
- }
- x902c4aee45bfd906 xcaeebfd2 = this.x3c6f7570c20e3f7d(point3, ref msg);
- if (xcaeebfd2 != null)
- {
- xcaeebfd2.x136735fdfe6d04ea(point3.x, point3.y);
- }
- else if (this.x277ff37e12aff68b(point3, ref msg))
- {
- this.parentControl.x136735fdfe6d04ea(point3);
- }
- }
- flag3 = true;
- }
- if (msg.message == 0x20)
- {
- this.x773209141f430902();
- flag3 = true;
- }
- if (msg.message == 260)
- {
- if (((int) msg.wParam) == 0x12)
- {
- this.exitLoop = true;
- }
- else
- {
- msg.message = 0x100;
- }
- }
- if (msg.message == 0x100)
- {
- int wParam = (int) msg.wParam;
- if (wParam != 13)
- {
- switch (wParam)
- {
- case 0x25:
- this.x0e37e200024f43ba();
- goto Label_0543;
- case 0x26:
- this.x5437d760e9a6340b();
- goto Label_0543;
- case 0x27:
- if (this.xb2aa7fc859b3d5b7())
- {
- flag = true;
- }
- goto Label_0543;
- case 40:
- this.x5b2e42a68d835b31();
- goto Label_0543;
- case 0x1b:
- goto Label_04F6;
- }
- goto Label_04FF;
- }
- if (this.trackItem != -1)
- {
- x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as x2cc390e9409b0f3f;
- if (xccebff.SubMenu)
- {
- this.x0760506d6abf77a2(this.trackItem, false);
- flag = true;
- }
- else if (xccebff.Expansion)
- {
- this.x057464a452da34b7();
- }
- else
- {
- this.returnCommand = xccebff.MenuCommand;
- this.exitLoop = true;
- }
- }
- }
- goto Label_0543;
- Label_04F6:
- this.exitLoop = true;
- goto Label_0543;
- Label_04FF:
- num3 = this.x65c1cc54cc8b0e75((char) ((int) msg.wParam));
- if (num3 != -1)
- {
- x2cc390e9409b0f3f xccebff2 = this.drawCommands[num3] as x2cc390e9409b0f3f;
- this.returnCommand = xccebff2.MenuCommand;
- this.exitLoop = true;
- flag = true;
- }
- Label_0543:
- if (((msg.message == 0x100) || (msg.message == 0x101)) || ((msg.message == 260) || (msg.message == 0x105)))
- {
- flag3 = true;
- }
- if (flag3)
- {
- x40255b11ef821fa3.MSG lpMsg = new x40255b11ef821fa3.MSG();
- x61467fe65a98f20c.GetMessage(ref lpMsg, IntPtr.Zero, 0, 0);
- }
- else
- {
- if (!flag)
- {
- if (x61467fe65a98f20c.GetMessage(ref msg, IntPtr.Zero, 0, 0))
- {
- x61467fe65a98f20c.TranslateMessage(ref msg);
- x61467fe65a98f20c.DispatchMessage(ref msg);
- }
- continue;
- }
- flag = false;
- }
- }
- }
- if (flag2)
- {
- x61467fe65a98f20c.ShowCaret(IntPtr.Zero);
- }
- this.xeb515a5b77846afe(this.trackItem, -1, false, false);
- this.x4139e66e6dfaac52();
- this.DestroyHandle();
- if (((this.parentMenu == null) && (this.returnCommand != null)) && (this.parentControl == null))
- {
- this.returnCommand.OnClick(EventArgs.Empty);
- }
- return this.returnCommand;
- }
- catch (Exception)
- {
- return null;
- }
- }
- protected void xfbe050c2d5b2be39(ArrayList x607ab5024f65c83d, int xc529a6810c5d3b0c)
- {
- foreach (x2cc390e9409b0f3f xccebff in x607ab5024f65c83d)
- {
- Rectangle drawRect = xccebff.DrawRect;
- xccebff.DrawRect = new Rectangle(drawRect.Left, drawRect.Top, xc529a6810c5d3b0c, drawRect.Height);
- }
- x607ab5024f65c83d.Clear();
- }
- public x6fd23f8bad2f3ced Animate
- {
- get
- {
- return this.animateItem;
- }
- set
- {
- this.animateItem = value;
- }
- }
- public x1f5697535eab37b9 AnimateStyle
- {
- get
- {
- return this.animateStyle;
- }
- set
- {
- this.animateStyle = value;
- }
- }
- public int AnimateTime
- {
- get
- {
- return this.animateTime;
- }
- set
- {
- this.animateTime = value;
- }
- }
- public SkinEngine Engine
- {
- get
- {
- return this.xcab6a0e662ada486;
- }
- set
- {
- this.xcab6a0e662ada486 = value;
- }
- }
- public System.Drawing.Font Font
- {
- get
- {
- return this.textFont;
- }
- set
- {
- this.textFont = value;
- }
- }
- public bool HighlightInfrequent
- {
- get
- {
- return this.highlightInfrequent;
- }
- set
- {
- this.highlightInfrequent = value;
- }
- }
- public xd53b20b7b4b2a08a MenuCommands
- {
- get
- {
- return this.menuCommands;
- }
- }
- public bool RememberExpansion
- {
- get
- {
- return this.rememberExpansion;
- }
- set
- {
- this.rememberExpansion = value;
- }
- }
- public bool ShowInfrequent
- {
- get
- {
- return this.showInfrequent;
- }
- set
- {
- this.showInfrequent = value;
- }
- }
- internal enum xaa7785f730d8dd15
- {
- Check,
- Radio,
- SubMenu,
- CheckSelected,
- RadioSelected,
- SubMenuSelected,
- Expansion,
- ImageError
- }
- internal enum xd1ffc28f5c092301
- {
- BorderTop,
- BorderLeft,
- BorderBottom,
- BorderRight,
- ImageGapTop,
- ImageGapLeft,
- ImageGapBottom,
- ImageGapRight,
- TextGapLeft,
- TextGapRight,
- SubMenuGapLeft,
- SubMenuWidth,
- SubMenuGapRight,
- SeparatorHeight,
- SeparatorWidth,
- ShortcutGap,
- ShadowWidth,
- ShadowHeight,
- ExtraWidthGap,
- ExtraHeightGap,
- ExtraRightGap,
- ExtraReduce
- }
- internal enum xf398ffaf32ffe055
- {
- Left,
- Right,
- All
- }
- }
- }