x3c41176af7e54b01.cs
上传用户:xlxx0122
上传日期:2015-04-24
资源大小:3904k
文件大小:87k
- namespace Sunisoft.IrisSkin.InternalControls
- {
- using Microsoft.Win32;
- using Sunisoft.IrisSkin;
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Drawing.Text;
- using System.Runtime.CompilerServices;
- using System.Windows.Forms;
- [ToolboxItem(false)]
- internal class x3c41176af7e54b01 : ContainerControl, IMessageFilter
- {
- protected Form activeChild;
- protected x6fd23f8bad2f3ced animate;
- protected bool animateFirst;
- protected x1f5697535eab37b9 animateStyle;
- protected int animateTime;
- protected const int BoxExpandSides = 2;
- protected const int BoxExpandUpper = 1;
- protected int breadthGap;
- protected const int ButtonLength = 0x10;
- protected const int ChevronIndex = 3;
- protected const int ChevronLength = 12;
- protected x5f4b657f68f87baa chevronStartCommand;
- protected x3c41176af7e54b01 childMenu;
- protected x5d3356d9dffccb60 closeButton;
- protected const int CloseIndex = 2;
- protected bool defaultFont;
- protected bool deselectReset;
- protected xdbfa333b4cd503e0 direction;
- protected bool dismissTransfer;
- protected ArrayList drawCommands;
- protected bool drawUpwards;
- protected bool exitLoop;
- protected bool expandAllTogether;
- protected xc69458cec0f3af75 glyphFading;
- protected bool highlightInfrequent;
- protected bool ignoreMouseMove;
- protected const int LengthGap = 3;
- protected bool manualFocus;
- protected Form mdiContainer;
- protected xd53b20b7b4b2a08a menuCommands;
- protected static ImageList menuImages = x58dd58a96343fde0.LoadBitmapStrip(System.Type.GetType("Sunisoft.IrisSkin.SkinEngine"), "Sunisoft.IrisSkin.ImagesMenuControl.bmp", new Size(0x10, 0x10), new Point(0, 0));
- protected x5d3356d9dffccb60 minButton;
- protected const int MinIndex = 0;
- protected bool mouseOver;
- protected bool multiLine;
- protected IntPtr oldFocus;
- protected const int PendantLength = 0x30;
- protected const int PendantOffset = 3;
- protected bool plainAsBlock;
- protected x902c4aee45bfd906 popupMenu;
- protected bool rememberExpansion;
- protected x5d3356d9dffccb60 restoreButton;
- protected const int RestoreIndex = 1;
- protected int rowHeight;
- protected int rowWidth;
- protected bool selected;
- protected const int SeparatorWidth = 15;
- protected const int ShadowGap = 4;
- protected const int ShadowYOffset = 4;
- protected const int SubMenuBorderAdjust = 2;
- protected static bool supportsLayered = (OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows) != null);
- protected int trackItem;
- protected readonly uint WM_OPERATEMENU = 0x401;
- private x5f4b657f68f87baa[] x4dedac25f8166fb5;
- private x5f4b657f68f87baa x54f4e17b11b07b8c = new x5f4b657f68f87baa("-");
- private SkinEngine xcab6a0e662ada486;
- public event x26569a56dfbc2c6d Deselected;
- public event x26569a56dfbc2c6d Selected;
- public x3c41176af7e54b01(SkinEngine engine)
- {
- this.x54f4e17b11b07b8c.xb2504b89d66feca9 = true;
- this.Engine = engine;
- this.trackItem = -1;
- this.oldFocus = IntPtr.Zero;
- this.minButton = null;
- this.popupMenu = null;
- this.activeChild = null;
- this.closeButton = null;
- this.mdiContainer = null;
- this.restoreButton = null;
- this.chevronStartCommand = null;
- this.animateFirst = true;
- this.exitLoop = false;
- this.selected = false;
- this.multiLine = false;
- this.mouseOver = false;
- this.defaultFont = true;
- this.manualFocus = false;
- this.drawUpwards = false;
- this.plainAsBlock = false;
- this.ignoreMouseMove = false;
- this.deselectReset = true;
- this.expandAllTogether = true;
- this.rememberExpansion = true;
- this.highlightInfrequent = true;
- this.dismissTransfer = false;
- this.direction = xdbfa333b4cd503e0.Horizontal;
- this.menuCommands = new xd53b20b7b4b2a08a();
- this.glyphFading = xc69458cec0f3af75.Default;
- this.Dock = DockStyle.Top;
- this.Cursor = Cursors.Arrow;
- this.animateTime = 100;
- this.animate = x6fd23f8bad2f3ced.System;
- this.animateStyle = x1f5697535eab37b9.System;
- base.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
- base.SetStyle(ControlStyles.Selectable, false);
- this.menuCommands.Cleared += new x66edf89974942dab(this.x4d43bed1b4aede85);
- this.menuCommands.Inserted += new x2f6aff803d60b50c(this.x6b08695ba39cf4ca);
- this.menuCommands.Removed += new x2f6aff803d60b50c(this.x5cb0c63a7cf35b53);
- SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(this.x288bea726e7cd27e);
- if (this.Engine.MenuFont == null)
- {
- this.x21498b72da0020ba(SystemInformation.MenuFont);
- }
- else
- {
- this.x21498b72da0020ba(this.Engine.MenuFont);
- }
- base.TabStop = false;
- base.Height = this.rowHeight;
- Application.AddMessageFilter(this);
- this.Engine.CurrentSkinChanged += new SkinChanged(this.x273cbe3cfa28ea94);
- }
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- SystemEvents.UserPreferenceChanged -= new UserPreferenceChangedEventHandler(this.x288bea726e7cd27e);
- if (this.mdiContainer != null)
- {
- this.mdiContainer.MdiChildActivate -= new EventHandler(this.x23daf02978257d54);
- }
- if (this.activeChild != null)
- {
- this.activeChild.SizeChanged -= new EventHandler(this.xfbce0f1d6df984cd);
- }
- }
- base.Dispose(disposing);
- }
- public virtual void OnDeselected(x5f4b657f68f87baa mc)
- {
- if (this.xd42ce0324cbc114a != null)
- {
- this.xd42ce0324cbc114a(mc);
- }
- }
- protected override void OnEnabledChanged(EventArgs e)
- {
- base.OnEnabledChanged(e);
- if (!base.Enabled && this.selected)
- {
- if (this.popupMenu != null)
- {
- this.popupMenu.Dismiss();
- this.popupMenu = null;
- }
- this.xcb97d93f0d5ce4a8();
- this.drawUpwards = false;
- this.xa23d095e6e52c5f3();
- }
- this.x51ce8d251f940283();
- base.Invalidate();
- }
- protected override void OnMouseDown(MouseEventArgs e)
- {
- this.xbcc99f3d02a70fe7(e.X, e.Y);
- base.OnMouseDown(e);
- }
- protected override void OnMouseLeave(EventArgs e)
- {
- this.mouseOver = false;
- if ((!this.manualFocus && (this.trackItem != -1)) && !this.selected)
- {
- this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, -1);
- }
- base.OnMouseLeave(e);
- }
- protected override void OnMouseMove(MouseEventArgs e)
- {
- if (this.ignoreMouseMove)
- {
- this.ignoreMouseMove = false;
- }
- else
- {
- this.xdd922e6d558c59d4(e.X, e.Y);
- }
- base.OnMouseMove(e);
- }
- protected override void OnMouseUp(MouseEventArgs e)
- {
- if (((this.trackItem != -1) && this.selected) && (this.popupMenu == null))
- {
- this.xcb97d93f0d5ce4a8();
- this.drawUpwards = false;
- this.x2cc390e9409b0f3f(this.trackItem, true);
- this.xa23d095e6e52c5f3();
- }
- base.OnMouseUp(e);
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- if ((base.Width != 0) || (base.Height != 0))
- {
- Rectangle destRect = new Rectangle(0, 0, base.Width, base.Height);
- Bitmap image = this.Engine.Res.Bitmaps.SKIN2_MENUBAR;
- using (Bitmap bitmap2 = new Bitmap(base.Width, base.Height))
- {
- using (Graphics graphics = Graphics.FromImage(bitmap2))
- {
- if (image != null)
- {
- graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, x448fd9ab43628c71.DrawImageAttrTileY);
- }
- else
- {
- if (this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR != this.Engine.Res.Colors.SKIN2_MENUBARENDCOLOR)
- {
- using (LinearGradientBrush brush = new LinearGradientBrush(destRect, this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR, this.Engine.Res.Colors.SKIN2_MENUBARENDCOLOR, LinearGradientMode.Vertical))
- {
- graphics.FillRectangle(brush, destRect);
- goto Label_011C;
- }
- }
- graphics.FillRectangle(this.Engine.Res.Brushes.SKIN2_MENUBARSTARTCOLOR, destRect);
- }
- }
- Label_011C:
- e.Graphics.DrawImageUnscaled(bitmap2, 0, 0);
- }
- this.x05a10b378cdf8119(e.Graphics);
- base.OnPaint(e);
- }
- }
- protected override void OnResize(EventArgs e)
- {
- this.x39e008704a72ea56();
- base.Invalidate();
- base.OnResize(e);
- }
- public virtual void OnSelected(x5f4b657f68f87baa mc)
- {
- if (this.xaa7558c320af04eb != null)
- {
- this.xaa7558c320af04eb(mc);
- }
- }
- protected override void OnSystemColorsChanged(EventArgs e)
- {
- this.x39e008704a72ea56();
- base.Invalidate();
- base.OnSystemColorsChanged(e);
- }
- public bool PreFilterMessage(ref Message msg)
- {
- Form form = base.FindForm();
- if (((form != null) && (form == Form.ActiveForm)) && form.ContainsFocus)
- {
- switch (((uint) msg.Msg))
- {
- case 260:
- {
- if (!base.Enabled || (((int) msg.WParam) == 0x12))
- {
- break;
- }
- Shortcut shortcut2 = (Shortcut) (0x40000 + ((int) msg.WParam));
- if (!this.x4d7a264852c9d2f3(shortcut2, this.menuCommands))
- {
- if (this.x65c1cc54cc8b0e75((char) ((int) msg.WParam)))
- {
- if (!this.manualFocus)
- {
- this.x60cdc457bc0610f8();
- }
- return true;
- }
- break;
- }
- return true;
- }
- case 0x105:
- if (!base.Enabled || (((int) msg.WParam) != 0x12))
- {
- break;
- }
- if (this.drawCommands.Count > 0)
- {
- if (this.trackItem == -1)
- {
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[i] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- if (!xccebff.Separator && (xccebff.Chevron || xccebff.MenuCommand.Enabled))
- {
- this.trackItem = this.xa7cbddf1ec7a27e7(-1, i);
- break;
- }
- }
- }
- this.x60cdc457bc0610f8();
- }
- return true;
- case 0x100:
- {
- if (!base.Enabled)
- {
- break;
- }
- ushort keyState = x61467fe65a98f20c.GetKeyState(0x10);
- ushort num2 = x61467fe65a98f20c.GetKeyState(0x11);
- int wParam = (int) msg.WParam;
- if ((keyState & 0x8000) != 0)
- {
- wParam += 0x10000;
- }
- if ((num2 & 0x8000) != 0)
- {
- wParam += 0x20000;
- }
- Shortcut shortcut = (Shortcut) wParam;
- return this.x4d7a264852c9d2f3(shortcut, this.menuCommands);
- }
- }
- }
- return false;
- }
- protected override void WndProc(ref Message m)
- {
- if (m.Msg == this.WM_OPERATEMENU)
- {
- this.xa9f9739090793818(ref m);
- }
- else if (m.Msg == 0x87)
- {
- this.x92bcd6bad6f29e72(ref m);
- return;
- }
- base.WndProc(ref m);
- }
- protected void x05a10b378cdf8119(Graphics x4b101060f4767186)
- {
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[i] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- this.xb5a5bdae3ba8936b(x4b101060f4767186, xccebff, i == this.trackItem);
- }
- }
- internal void x0760506d6abf77a2(Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xd2a8bb4342ab4ef6, bool xacc37ebdd71fcc44, bool xec106df5fe2fbc8e)
- {
- if (!base.IsDisposed)
- {
- Point point;
- Point point2;
- int num;
- Rectangle drawRect = xd2a8bb4342ab4ef6.DrawRect;
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- point = base.PointToScreen(new Point(xd2a8bb4342ab4ef6.DrawRect.Left + 1, (drawRect.Bottom - 3) - 2));
- }
- else
- {
- point = base.PointToScreen(new Point(xd2a8bb4342ab4ef6.DrawRect.Right - this.breadthGap, (drawRect.Top + 2) - 1));
- }
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- point2 = base.PointToScreen(new Point(xd2a8bb4342ab4ef6.DrawRect.Left + 1, ((drawRect.Top + this.breadthGap) + 3) - 1));
- }
- else
- {
- point2 = base.PointToScreen(new Point(xd2a8bb4342ab4ef6.DrawRect.Right - this.breadthGap, (drawRect.Bottom + 3) + 1));
- }
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- num = xd2a8bb4342ab4ef6.DrawRect.Width - 2;
- }
- else
- {
- num = xd2a8bb4342ab4ef6.DrawRect.Height - 2;
- }
- this.popupMenu = new x902c4aee45bfd906(this.Engine);
- int num2 = 0;
- x5f4b657f68f87baa xfbffbaa = null;
- this.popupMenu.RememberExpansion = this.rememberExpansion;
- this.popupMenu.HighlightInfrequent = this.highlightInfrequent;
- this.popupMenu.Font = base.Font;
- this.popupMenu.Animate = this.animate;
- this.popupMenu.AnimateStyle = this.animateStyle;
- this.popupMenu.AnimateTime = this.animateTime;
- if (xd2a8bb4342ab4ef6.Chevron)
- {
- xd53b20b7b4b2a08a xdbbbbaa = new xd53b20b7b4b2a08a();
- bool flag = false;
- foreach (x5f4b657f68f87baa xfbffbaa2 in this.menuCommands)
- {
- if (!flag && (xfbffbaa2 == this.chevronStartCommand))
- {
- flag = true;
- }
- if (flag)
- {
- xdbbbbaa.Add(xfbffbaa2);
- }
- }
- xfbffbaa = this.popupMenu.x6192996f26aa9421(point, point2, this.direction, xdbbbbaa, num, xacc37ebdd71fcc44, this, this.animateFirst, ref num2);
- }
- else
- {
- xd2a8bb4342ab4ef6.MenuCommand.OnPopupStart();
- this.popupMenu.ShowInfrequent = xd2a8bb4342ab4ef6.MenuCommand.MenuCommands.ShowInfrequent;
- xfbffbaa = this.popupMenu.x6192996f26aa9421(point, point2, this.direction, xd2a8bb4342ab4ef6.MenuCommand.MenuCommands, num, xacc37ebdd71fcc44, this, this.animateFirst, ref num2);
- }
- this.animateFirst = false;
- if (this.expandAllTogether && this.x35a6958370d758dd(this.menuCommands))
- {
- this.xe8febcf8320c4113(this.menuCommands, true);
- }
- if (num2 == 0)
- {
- this.mouseOver = false;
- if (!this.dismissTransfer)
- {
- this.xcb97d93f0d5ce4a8();
- this.drawUpwards = false;
- if (!base.IsDisposed)
- {
- if (xec106df5fe2fbc8e)
- {
- this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, -1);
- }
- else if (this.trackItem != -1)
- {
- this.x2cc390e9409b0f3f(this.trackItem, true);
- }
- }
- }
- else
- {
- this.dismissTransfer = false;
- }
- }
- if (!xd2a8bb4342ab4ef6.Chevron)
- {
- xd2a8bb4342ab4ef6.MenuCommand.OnPopupEnd();
- }
- Application.DoEvents();
- this.popupMenu = null;
- if (num2 != 0)
- {
- if (num2 < 0)
- {
- this.x58049cd54e5ca4e3(true);
- }
- else
- {
- this.x14014e142c6b152c(true);
- }
- this.ignoreMouseMove = true;
- }
- else if (xfbffbaa != null)
- {
- if (this.manualFocus)
- {
- this.xa23d095e6e52c5f3();
- }
- xfbffbaa.OnClick(EventArgs.Empty);
- }
- }
- }
- protected void x0b912a2b95b630ba(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
- {
- if (this.activeChild != null)
- {
- this.activeChild.Close();
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- }
- internal void x136735fdfe6d04ea(x555516122dcc901e.POINT x0ce73f6cbd7d5515)
- {
- x61467fe65a98f20c.ScreenToClient(base.Handle, ref x0ce73f6cbd7d5515);
- this.xdd922e6d558c59d4(x0ce73f6cbd7d5515.x, x0ce73f6cbd7d5515.y);
- }
- protected void x14014e142c6b152c(bool x651d82357ffa4398)
- {
- if (this.popupMenu == null)
- {
- int trackItem = this.trackItem;
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- trackItem++;
- if (trackItem >= this.drawCommands.Count)
- {
- trackItem = 0;
- }
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- if ((!xccebff.Separator && (xccebff.Chevron || xccebff.MenuCommand.Enabled)) && (trackItem != this.trackItem))
- {
- this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, trackItem);
- if (this.selected && (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0)))
- {
- x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 0, (uint) 1);
- return;
- }
- break;
- }
- }
- }
- }
- protected void x199464e739d66b0b(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
- {
- if (this.activeChild != null)
- {
- this.activeChild.WindowState = FormWindowState.Minimized;
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- }
- private void x1996f82940a97595()
- {
- string text = "";
- bool flag = false;
- if (this.mdiContainer != null)
- {
- this.x4dedac25f8166fb5 = new x5f4b657f68f87baa[this.mdiContainer.MdiChildren.Length];
- for (int i = 0; i < this.mdiContainer.MdiChildren.Length; i++)
- {
- text = "";
- flag = false;
- try
- {
- text = this.mdiContainer.MdiChildren[i].Text;
- flag = this.mdiContainer.MdiChildren[i] == this.mdiContainer.ActiveMdiChild;
- }
- catch
- {
- }
- this.x4dedac25f8166fb5[i] = new x5f4b657f68f87baa(string.Format("&{0} {1}", i + 1, text), new EventHandler(this.x43d97dcf909b3bd3));
- this.x4dedac25f8166fb5[i].Checked = flag;
- this.x4dedac25f8166fb5[i].xb7d28b7a6d50662f = this.mdiContainer.MdiChildren[i];
- this.x4dedac25f8166fb5[i].xb2504b89d66feca9 = true;
- }
- }
- ArrayList list = new ArrayList();
- foreach (x5f4b657f68f87baa xfbffbaa2 in this.MenuCommands)
- {
- if (xfbffbaa2.MdiList)
- {
- this.xa76c42f3062c6f11(xfbffbaa2);
- }
- if (xfbffbaa2.MenuCommands.Count > 0)
- {
- list.Add(xfbffbaa2);
- }
- }
- while (list.Count > 0)
- {
- x5f4b657f68f87baa xfbffbaa = (x5f4b657f68f87baa) list[0];
- list.RemoveAt(0);
- foreach (x5f4b657f68f87baa xfbffbaa3 in xfbffbaa.MenuCommands)
- {
- if (xfbffbaa3.MdiList)
- {
- this.xa76c42f3062c6f11(xfbffbaa3);
- }
- if (xfbffbaa3.MenuCommands.Count > 0)
- {
- list.Add(xfbffbaa3);
- }
- }
- }
- }
- protected void x21498b72da0020ba(System.Drawing.Font x978809f7734a0f16)
- {
- base.Font = x978809f7734a0f16;
- this.breadthGap = (this.Font.Height / 3) + 1;
- this.rowWidth = this.rowHeight = (this.Font.Height + (this.breadthGap * 2)) + 1;
- }
- protected void x23daf02978257d54(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
- {
- if (this.activeChild != null)
- {
- this.activeChild.SizeChanged -= new EventHandler(this.xfbce0f1d6df984cd);
- }
- this.activeChild = this.mdiContainer.ActiveMdiChild;
- if (this.activeChild != null)
- {
- this.activeChild.SizeChanged += new EventHandler(this.xfbce0f1d6df984cd);
- }
- this.x1996f82940a97595();
- this.x39e008704a72ea56();
- base.Invalidate();
- if (this.MenuCommands.Count == 0)
- {
- if (this.activeChild != null)
- {
- if (this.activeChild.WindowState == FormWindowState.Maximized)
- {
- base.Visible = true;
- }
- else
- {
- base.Visible = false;
- }
- }
- else
- {
- base.Visible = false;
- }
- }
- else
- {
- base.Visible = true;
- }
- }
- private void x273cbe3cfa28ea94(object xe0292b9ed559da7d, SkinChangedEventArgs xfbf34718e704c6bc)
- {
- if (this.Engine.RealActive)
- {
- if (this.minButton != null)
- {
- this.minButton.BackColor = this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR;
- }
- if (this.restoreButton != null)
- {
- this.restoreButton.BackColor = this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR;
- }
- if (this.closeButton != null)
- {
- this.closeButton.BackColor = this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR;
- }
- }
- }
- protected void x288bea726e7cd27e(object xe0292b9ed559da7d, UserPreferenceChangedEventArgs xfbf34718e704c6bc)
- {
- if (this.defaultFont)
- {
- if (this.Engine.MenuFont == null)
- {
- this.x21498b72da0020ba(SystemInformation.MenuFont);
- }
- else
- {
- this.x21498b72da0020ba(this.Engine.MenuFont);
- }
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- }
- protected void x2b1f4f4697e5ae02(x5f4b657f68f87baa xccb63ca5f63dc470, x5f4b657f68f87baa.x879a106b0501b9dc x5ca6b6e12a4d9043)
- {
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- protected void x2cc390e9409b0f3f(int x22f50445643d053e, bool x4b9cb2187c13edda)
- {
- using (Graphics graphics = base.CreateGraphics())
- {
- this.xb5a5bdae3ba8936b(graphics, this.drawCommands[x22f50445643d053e] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f, x4b9cb2187c13edda);
- }
- }
- internal void x2ea07c3ab5d970d4(x555516122dcc901e.POINT x0ce73f6cbd7d5515)
- {
- x61467fe65a98f20c.ScreenToClient(base.Handle, ref x0ce73f6cbd7d5515);
- this.xbcc99f3d02a70fe7(x0ce73f6cbd7d5515.x, x0ce73f6cbd7d5515.y);
- }
- protected void x34de1c54143aa5c7()
- {
- if (((this.popupMenu == null) && (this.trackItem != -1)) && !this.selected)
- {
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count >= 0))
- {
- this.selected = true;
- this.drawUpwards = false;
- this.x2cc390e9409b0f3f(this.trackItem, true);
- if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0))
- {
- x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 0, (uint) 1);
- }
- }
- }
- }
- protected bool x35a6958370d758dd(xd53b20b7b4b2a08a x20e3b25d6d144908)
- {
- foreach (x5f4b657f68f87baa xfbffbaa in x20e3b25d6d144908)
- {
- if (xfbffbaa.MenuCommands.ShowInfrequent)
- {
- return true;
- }
- if (this.x35a6958370d758dd(xfbffbaa.MenuCommands))
- {
- return true;
- }
- }
- return false;
- }
- internal void x39e008704a72ea56()
- {
- try
- {
- int width;
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- width = base.Width;
- }
- else
- {
- width = base.Height;
- }
- if (width <= 0)
- {
- return;
- }
- int num2 = 0;
- int num3 = 0;
- this.drawCommands = new ArrayList();
- int num4 = 6;
- int height = base.Height;
- int x = 0;
- width -= num4 + 12;
- bool flag = (num2 == 0) && (this.activeChild != null);
- if ((flag && !this.multiLine) && (this.activeChild.WindowState != FormWindowState.Maximized))
- {
- flag = false;
- }
- int num6 = 0;
- int y = 0;
- int num8 = 0;
- int num9 = 0;
- if (flag && (this.minButton != null))
- {
- width -= 0x37;
- bool flag2 = true;
- int num10 = 1;
- this.minButton.PopupStyle = flag2;
- this.restoreButton.PopupStyle = flag2;
- this.closeButton.PopupStyle = flag2;
- this.minButton.BorderWidth = num10;
- this.restoreButton.BorderWidth = num10;
- this.closeButton.BorderWidth = num10;
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- num6 = (base.Width - 3) - 0x10;
- y = 3;
- num8 = -16;
- }
- else
- {
- num6 = 3;
- y = (base.Height - 3) - 0x10;
- num9 = -16;
- }
- }
- this.chevronStartCommand = null;
- using (Graphics graphics = base.CreateGraphics())
- {
- int num11 = 0;
- foreach (x5f4b657f68f87baa xfbffbaa in this.menuCommands)
- {
- xfbffbaa.OnUpdate(EventArgs.Empty);
- if (xfbffbaa.Visible)
- {
- Rectangle rectangle;
- int num12 = 0;
- if (xfbffbaa.Text == "-")
- {
- num12 = 15;
- }
- else
- {
- SizeF ef = graphics.MeasureString(xfbffbaa.Text, this.Font);
- num12 = (num4 + ((int) ef.Width)) + 1;
- }
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- rectangle = new Rectangle(x, this.rowHeight * num2, num12, this.rowHeight);
- }
- else
- {
- rectangle = new Rectangle(this.rowWidth * num2, x, this.rowWidth, num12);
- }
- x += num12;
- num3++;
- if ((x > width) && (num3 > 1))
- {
- if (this.multiLine)
- {
- num2++;
- num3 = 1;
- x = num12;
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- rectangle.X = 0;
- rectangle.Y += this.rowHeight;
- }
- else
- {
- rectangle.X += this.rowWidth;
- rectangle.Y = 0;
- }
- if (flag && (num2 == 1))
- {
- width += 0x33;
- }
- }
- else
- {
- if (num11 <= this.trackItem)
- {
- this.x51ce8d251f940283();
- }
- this.chevronStartCommand = xfbffbaa;
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- rectangle.Y = 0;
- rectangle.Width = num4 + 12;
- rectangle.X = base.Width - rectangle.Width;
- rectangle.Height = this.rowHeight;
- num6 -= rectangle.Width;
- }
- else
- {
- rectangle.X = 0;
- rectangle.Height = num4 + 12;
- rectangle.Y = base.Height - (num4 + 12);
- rectangle.Width = this.rowWidth;
- y -= rectangle.Height;
- }
- if ((this.RightToLeft & RightToLeft.Yes) == RightToLeft.Yes)
- {
- this.drawCommands.Add(new Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f(new Rectangle(width - rectangle.Right, rectangle.Y, rectangle.Width, rectangle.Height)));
- }
- else
- {
- this.drawCommands.Add(new Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f(rectangle));
- }
- goto Label_044F;
- }
- }
- Rectangle selectRect = rectangle;
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- selectRect.Height -= 5;
- }
- else
- {
- selectRect.Width -= this.breadthGap;
- }
- if ((this.RightToLeft & RightToLeft.Yes) == RightToLeft.Yes)
- {
- this.drawCommands.Add(new Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f(xfbffbaa, new Rectangle(width - rectangle.Right, rectangle.Y, rectangle.Width, rectangle.Height), new Rectangle(width - selectRect.Right, selectRect.Y, selectRect.Width, selectRect.Height)));
- }
- else
- {
- this.drawCommands.Add(new Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f(xfbffbaa, rectangle, selectRect));
- }
- num11++;
- }
- }
- }
- Label_044F:
- if (flag && (this.minButton != null))
- {
- if (this.activeChild.WindowState == FormWindowState.Maximized)
- {
- if (!this.minButton.Visible)
- {
- this.minButton.Show();
- this.restoreButton.Show();
- this.closeButton.Show();
- }
- this.minButton.Enabled = this.activeChild.MinimizeBox;
- this.closeButton.Location = new Point(num6, y);
- num6 += num8;
- y += num9;
- this.restoreButton.Location = new Point(num6, y);
- num6 += num8;
- y += num9;
- this.minButton.Location = new Point(num6, y);
- }
- else if (this.minButton.Visible)
- {
- this.minButton.Hide();
- this.restoreButton.Hide();
- this.closeButton.Hide();
- }
- }
- else if ((this.minButton != null) && this.minButton.Visible)
- {
- this.minButton.Hide();
- this.restoreButton.Hide();
- this.closeButton.Hide();
- }
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- int num13 = (num2 + 1) * this.rowHeight;
- if (base.Height != num13)
- {
- base.Height = num13;
- }
- }
- else
- {
- int num14 = (num2 + 1) * this.rowWidth;
- if (base.Width != num14)
- {
- base.Width = num14;
- }
- }
- }
- catch
- {
- }
- }
- private void x43d97dcf909b3bd3(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
- {
- if (xe0292b9ed559da7d is x5f4b657f68f87baa)
- {
- try
- {
- ((x5f4b657f68f87baa) xe0292b9ed559da7d).xb7d28b7a6d50662f.Activate();
- }
- catch
- {
- }
- }
- }
- protected void x4d43bed1b4aede85()
- {
- this.xcb97d93f0d5ce4a8();
- this.x51ce8d251f940283();
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- protected bool x4d7a264852c9d2f3(Shortcut x10364107371ea04e, xd53b20b7b4b2a08a x20e3b25d6d144908)
- {
- foreach (x5f4b657f68f87baa xfbffbaa in x20e3b25d6d144908)
- {
- if (xfbffbaa.Enabled && (xfbffbaa.Shortcut == x10364107371ea04e))
- {
- xfbffbaa.OnClick(EventArgs.Empty);
- return true;
- }
- if ((xfbffbaa.MenuCommands.Count > 0) && this.x4d7a264852c9d2f3(x10364107371ea04e, xfbffbaa.MenuCommands))
- {
- return true;
- }
- }
- return false;
- }
- protected void x51ce8d251f940283()
- {
- if (this.trackItem != -1)
- {
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- if (xccebff.MenuCommand != null)
- {
- this.OnDeselected(xccebff.MenuCommand);
- }
- this.trackItem = -1;
- }
- }
- protected void x58049cd54e5ca4e3(bool x651d82357ffa4398)
- {
- if (this.popupMenu == null)
- {
- int trackItem = this.trackItem;
- int num2 = trackItem;
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- trackItem--;
- if (trackItem == num2)
- {
- return;
- }
- if (trackItem < 0)
- {
- trackItem = this.drawCommands.Count - 1;
- }
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- if ((!xccebff.Separator && (xccebff.Chevron || xccebff.MenuCommand.Enabled)) && (trackItem != this.trackItem))
- {
- this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, trackItem);
- if (this.selected && (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0)))
- {
- x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 0, (uint) 1);
- return;
- }
- break;
- }
- }
- }
- }
- protected bool x58b2784e55b43ddd(ref x40255b11ef821fa3.MSG x8a41fbc87a3fb305)
- {
- Point point;
- bool flag = false;
- uint message = x8a41fbc87a3fb305.message;
- if (message <= 0x105)
- {
- if (message <= 0xa4)
- {
- switch (message)
- {
- case 0xa1:
- case 0xa4:
- goto Label_009E;
- }
- return flag;
- }
- switch (message)
- {
- case 0x100:
- {
- ushort keyState = x61467fe65a98f20c.GetKeyState(0x10);
- ushort num2 = x61467fe65a98f20c.GetKeyState(0x11);
- int wParam = (int) x8a41fbc87a3fb305.wParam;
- int num4 = wParam;
- if ((keyState & 0x8000) != 0)
- {
- num4 += 0x10000;
- }
- if ((num2 & 0x8000) != 0)
- {
- num4 += 0x20000;
- }
- if (num4 != 0x1b)
- {
- switch (num4)
- {
- case 0x25:
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- this.x58049cd54e5ca4e3(false);
- }
- if (this.selected)
- {
- this.ignoreMouseMove = true;
- }
- return true;
- case 0x27:
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- this.x14014e142c6b152c(false);
- }
- else
- {
- this.x34de1c54143aa5c7();
- }
- if (this.selected)
- {
- this.ignoreMouseMove = true;
- }
- return true;
- case 13:
- this.x830edbe776f7cc9f();
- return true;
- case 40:
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- this.x34de1c54143aa5c7();
- }
- else
- {
- this.x14014e142c6b152c(false);
- }
- return true;
- case 0x26:
- this.x58049cd54e5ca4e3(false);
- return true;
- }
- Shortcut shortcut = (Shortcut) num4;
- if (!this.x4d7a264852c9d2f3(shortcut, this.menuCommands))
- {
- this.x65c1cc54cc8b0e75((char) ((int) x8a41fbc87a3fb305.wParam));
- if (this.selected)
- {
- this.ignoreMouseMove = true;
- }
- }
- else
- {
- this.xa23d095e6e52c5f3();
- }
- return true;
- }
- if ((this.trackItem != -1) && (this.popupMenu == null))
- {
- this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, -1);
- }
- this.xa23d095e6e52c5f3();
- return true;
- }
- case 0x101:
- return true;
- case 0x102:
- case 0x103:
- return flag;
- case 260:
- {
- if (((int) x8a41fbc87a3fb305.wParam) == 0x12)
- {
- return flag;
- }
- Shortcut shortcut2 = (Shortcut) (0x40000 + ((int) x8a41fbc87a3fb305.wParam));
- if (this.x4d7a264852c9d2f3(shortcut2, this.menuCommands))
- {
- this.xa23d095e6e52c5f3();
- }
- else
- {
- this.x65c1cc54cc8b0e75((char) ((int) x8a41fbc87a3fb305.wParam));
- if (this.selected)
- {
- this.ignoreMouseMove = true;
- }
- }
- return true;
- }
- case 0x105:
- if (((int) x8a41fbc87a3fb305.wParam) != 0x12)
- {
- return flag;
- }
- if ((this.trackItem != -1) && (this.popupMenu == null))
- {
- this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, -1);
- }
- this.xa23d095e6e52c5f3();
- return true;
- case 0xa7:
- goto Label_009E;
- }
- return flag;
- }
- if (message <= 0x204)
- {
- switch (message)
- {
- case 0x201:
- case 0x204:
- goto Label_009E;
- }
- return flag;
- }
- if ((message != 0x207) && (message != 0x20b))
- {
- return flag;
- }
- Label_009E:
- point = new Point(((int) x8a41fbc87a3fb305.lParam) & 0xffff, (((int) x8a41fbc87a3fb305.lParam) & -65536) >> 0x10);
- if (!base.ClientRectangle.Contains(point))
- {
- this.xa23d095e6e52c5f3();
- }
- return flag;
- }
- protected void x5cb0c63a7cf35b53(int xc0c4c459c6ccbd00, object xbcea506a33cf9111)
- {
- this.xcb97d93f0d5ce4a8();
- this.x51ce8d251f940283();
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- protected void x60cdc457bc0610f8()
- {
- if (!this.manualFocus)
- {
- this.manualFocus = true;
- this.animateFirst = true;
- Form form = base.FindForm();
- form.Deactivate += new EventHandler(this.x92abb6992cd92749);
- bool flag = x61467fe65a98f20c.HideCaret(IntPtr.Zero);
- x40255b11ef821fa3.MSG msg = new x40255b11ef821fa3.MSG();
- this.exitLoop = false;
- while (!this.exitLoop)
- {
- if (x61467fe65a98f20c.WaitMessage())
- {
- while (!this.exitLoop && x61467fe65a98f20c.PeekMessage(ref msg, 0, 0, 0, 0))
- {
- if (x61467fe65a98f20c.GetMessage(ref msg, IntPtr.Zero, 0, 0) && !this.x58b2784e55b43ddd(ref msg))
- {
- x61467fe65a98f20c.TranslateMessage(ref msg);
- x61467fe65a98f20c.DispatchMessage(ref msg);
- }
- }
- }
- }
- form.Deactivate -= new EventHandler(this.x92abb6992cd92749);
- if (flag)
- {
- x61467fe65a98f20c.ShowCaret(IntPtr.Zero);
- }
- this.manualFocus = false;
- }
- }
- protected bool x65c1cc54cc8b0e75(char xba08ce632055a1d9)
- {
- if (!this.selected)
- {
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[i] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- if (((xccebff.MenuCommand != null) && xccebff.MenuCommand.Enabled) && (xccebff.MenuCommand.Visible && (xba08ce632055a1d9 == xccebff.Mnemonic)))
- {
- this.selected = true;
- this.drawUpwards = false;
- if (this.trackItem != i)
- {
- this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, i);
- }
- else
- {
- this.x2cc390e9409b0f3f(this.trackItem, true);
- }
- if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count >= 0))
- {
- if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0))
- {
- x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 0, (uint) 1);
- }
- return true;
- }
- xccebff.MenuCommand.OnClick(EventArgs.Empty);
- int trackItem = this.trackItem;
- this.x51ce8d251f940283();
- this.xcb97d93f0d5ce4a8();
- this.x2cc390e9409b0f3f(trackItem, false);
- this.xa23d095e6e52c5f3();
- return false;
- }
- }
- }
- return false;
- }
- protected void x6b08695ba39cf4ca(int xc0c4c459c6ccbd00, object xbcea506a33cf9111)
- {
- x5f4b657f68f87baa xfbffbaa = xbcea506a33cf9111 as x5f4b657f68f87baa;
- xfbffbaa.PropertyChanged += new x5f4b657f68f87baa.x5282b9c42ea1abce(this.x2b1f4f4697e5ae02);
- this.xcb97d93f0d5ce4a8();
- this.x51ce8d251f940283();
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- protected void x6b3bc391561e756b(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
- {
- if (this.activeChild != null)
- {
- this.activeChild.WindowState = FormWindowState.Normal;
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- }
- protected void x830edbe776f7cc9f()
- {
- if ((this.popupMenu == null) && (this.trackItem != -1))
- {
- if (!this.selected)
- {
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- if (!xccebff.Chevron && (xccebff.MenuCommand.MenuCommands.Count < 0))
- {
- xccebff.MenuCommand.OnClick(EventArgs.Empty);
- int trackItem = this.trackItem;
- this.x51ce8d251f940283();
- this.x2cc390e9409b0f3f(trackItem, false);
- this.xa23d095e6e52c5f3();
- }
- else
- {
- this.selected = true;
- this.drawUpwards = false;
- this.x2cc390e9409b0f3f(this.trackItem, true);
- if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0))
- {
- x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 0, (uint) 1);
- }
- }
- }
- else
- {
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff2 = this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- xccebff2.MenuCommand.OnClick(EventArgs.Empty);
- int num2 = this.trackItem;
- this.x51ce8d251f940283();
- this.xcb97d93f0d5ce4a8();
- this.x2cc390e9409b0f3f(num2, false);
- this.xa23d095e6e52c5f3();
- }
- }
- }
- private bool x8b3f8f5d533e5ee1()
- {
- return (this.BackColor != SystemColors.Control);
- }
- protected void x92abb6992cd92749(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
- {
- this.xa23d095e6e52c5f3();
- }
- protected void x92bcd6bad6f29e72(ref Message x6088325dec1baa2a)
- {
- x6088325dec1baa2a.Result = (IntPtr) 4L;
- }
- protected void x9954cbb39675570d()
- {
- this.minButton = new x5d3356d9dffccb60(menuImages, 0);
- this.restoreButton = new x5d3356d9dffccb60(menuImages, 1);
- this.closeButton = new x5d3356d9dffccb60(menuImages, 2);
- this.minButton.BackColor = this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR;
- this.restoreButton.BackColor = this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR;
- this.closeButton.BackColor = this.Engine.Res.Colors.SKIN2_MENUBARSTARTCOLOR;
- this.minButton.Size = new Size(0x10, 0x10);
- this.restoreButton.Size = new Size(0x10, 0x10);
- this.closeButton.Size = new Size(0x10, 0x10);
- this.minButton.Location = new Point(-16, -16);
- this.restoreButton.Location = new Point(-16, -16);
- this.closeButton.Location = new Point(-16, -16);
- this.minButton.Click += new EventHandler(this.x199464e739d66b0b);
- this.restoreButton.Click += new EventHandler(this.x6b3bc391561e756b);
- this.closeButton.Click += new EventHandler(this.x0b912a2b95b630ba);
- base.Controls.AddRange(new Control[] { this.minButton, this.restoreButton, this.closeButton });
- }
- protected void xa23d095e6e52c5f3()
- {
- if (this.manualFocus)
- {
- this.exitLoop = true;
- }
- if (this.trackItem != -1)
- {
- this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, -1);
- }
- }
- private void xa76c42f3062c6f11(x5f4b657f68f87baa x61b060a94340c4fc)
- {
- for (int i = x61b060a94340c4fc.MenuCommands.Count - 1; i >= 0; i--)
- {
- if (x61b060a94340c4fc.MenuCommands[i].xb2504b89d66feca9)
- {
- x61b060a94340c4fc.MenuCommands.RemoveAt(i);
- }
- }
- if (x61b060a94340c4fc.MenuCommands.Count > 0)
- {
- x61b060a94340c4fc.MenuCommands.Add(this.x54f4e17b11b07b8c);
- }
- foreach (x5f4b657f68f87baa xfbffbaa in this.x4dedac25f8166fb5)
- {
- x61b060a94340c4fc.MenuCommands.Add(xfbffbaa);
- }
- }
- protected int xa7cbddf1ec7a27e7(int x5360a38cdebd0e93, int x169940ac3300e3e7)
- {
- using (Graphics graphics = base.CreateGraphics())
- {
- if (x5360a38cdebd0e93 != -1)
- {
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[x5360a38cdebd0e93] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- this.xb5a5bdae3ba8936b(graphics, this.drawCommands[x5360a38cdebd0e93] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f, false);
- if (xccebff.MenuCommand != null)
- {
- this.OnDeselected(xccebff.MenuCommand);
- }
- }
- this.trackItem = x169940ac3300e3e7;
- if (this.trackItem != -1)
- {
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff2 = this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- this.xb5a5bdae3ba8936b(graphics, this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f, true);
- if (xccebff2.MenuCommand != null)
- {
- this.OnSelected(xccebff2.MenuCommand);
- }
- }
- base.Invalidate();
- }
- return this.trackItem;
- }
- protected void xa9f9739090793818(ref Message x6088325dec1baa2a)
- {
- if (this.trackItem != -1)
- {
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[this.trackItem] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- this.x0760506d6abf77a2(xccebff, x6088325dec1baa2a.LParam != IntPtr.Zero, x6088325dec1baa2a.WParam != IntPtr.Zero);
- }
- }
- internal void xb5a5bdae3ba8936b(Graphics x4b101060f4767186, Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xd2a8bb4342ab4ef6, bool x4b9cb2187c13edda)
- {
- Rectangle drawRect = xd2a8bb4342ab4ef6.DrawRect;
- x5f4b657f68f87baa menuCommand = xd2a8bb4342ab4ef6.MenuCommand;
- Rectangle rectangle2 = drawRect;
- rectangle2.Width += 4;
- rectangle2.Height += 4;
- if (!xd2a8bb4342ab4ef6.Separator)
- {
- Brush brush;
- Rectangle rectangle3;
- if (xd2a8bb4342ab4ef6.Chevron)
- {
- rectangle3 = new Rectangle(drawRect.Left + 3, drawRect.Top + 1, drawRect.Width - 6, drawRect.Height - 2);
- }
- else
- {
- rectangle3 = new Rectangle(drawRect.Left + 3, drawRect.Top + 3, drawRect.Width - 6, drawRect.Height - 6);
- }
- if (xd2a8bb4342ab4ef6.Enabled && x4b9cb2187c13edda)
- {
- Rectangle rectangle4;
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- rectangle4 = new Rectangle(rectangle3.Left - 2, rectangle3.Top - 1, rectangle3.Width + 4, rectangle3.Height + 1);
- }
- else if (!xd2a8bb4342ab4ef6.Chevron)
- {
- rectangle4 = new Rectangle(rectangle3.Left, rectangle3.Top - 2, rectangle3.Width - 2, rectangle3.Height + 4);
- }
- else
- {
- rectangle4 = rectangle3;
- }
- if (this.selected)
- {
- brush = this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUCOLOR;
- x4b101060f4767186.FillRectangle(brush, rectangle4);
- System.Drawing.Color color = System.Drawing.Color.FromArgb(0x40, 0, 0, 0);
- System.Drawing.Color color2 = System.Drawing.Color.FromArgb(0x30, 0, 0, 0);
- System.Drawing.Color color3 = System.Drawing.Color.FromArgb(0, 0, 0, 0);
- int x = rectangle4.Right + 1;
- int bottom = rectangle4.Bottom;
- if (this.drawUpwards && (this.direction == xdbfa333b4cd503e0.Horizontal))
- {
- using (Pen pen = new Pen(this.Engine.Res.Colors.SKIN2_TOPSELECTEDMENUBORDERCOLOR))
- {
- x4b101060f4767186.DrawRectangle(pen, rectangle4);
- }
- if (xd2a8bb4342ab4ef6.SubMenu)
- {
- Brush brush2;
- Brush brush3;
- Brush brush4;
- Brush brush5;
- int top = rectangle4.Top;
- int left = rectangle4.Left;
- int y = rectangle4.Bottom + 1;
- int num5 = rectangle4.Left + 4;
- int num6 = rectangle4.Width + 1;
- int height = 4;
- if (supportsLayered)
- {
- brush2 = new LinearGradientBrush(new Point(x, 0x270f), new Point(x + 4, 0x270f), color2, color3);
- brush3 = new LinearGradientBrush(new Point(num5 + 4, y - 4), new Point(num5, y + height), color, color3);
- brush5 = new LinearGradientBrush(new Point(((num5 + num6) - 4) - 2, (y - 4) - 2), new Point(num5 + num6, y + height), color, color3);
- brush4 = new LinearGradientBrush(new Point(0x270f, y), new Point(0x270f, y + height), color2, color3);
- }
- else
- {
- brush2 = new SolidBrush(SystemColors.ControlDark);
- brush3 = brush2;
- brush4 = brush2;
- brush5 = brush2;
- }
- x4b101060f4767186.FillRectangle(brush2, new Rectangle(x, top, 4, (bottom - top) + 1));
- x4b101060f4767186.FillRectangle(brush3, num5, y, 4, height);
- x4b101060f4767186.FillRectangle(brush5, (num5 + num6) - 4, y, 4, height);
- x4b101060f4767186.FillRectangle(brush4, num5 + 4, y, num6 - 8, height);
- if (supportsLayered)
- {
- brush2.Dispose();
- brush3.Dispose();
- brush4.Dispose();
- brush5.Dispose();
- }
- else
- {
- brush2.Dispose();
- }
- }
- }
- else
- {
- using (Pen pen2 = new Pen(this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUBORDERCOLOR))
- {
- x4b101060f4767186.DrawRectangle(pen2, rectangle4);
- }
- if (xd2a8bb4342ab4ef6.SubMenu)
- {
- if (this.direction == xdbfa333b4cd503e0.Horizontal)
- {
- Brush brush6;
- x4b101060f4767186.DrawLine(Pens.White, rectangle4.Left, rectangle4.Bottom, rectangle4.Right, rectangle4.Bottom);
- using (Pen pen3 = new Pen(this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUFONTCOLOR))
- {
- x4b101060f4767186.DrawLine(pen3, rectangle4.Left, rectangle4.Bottom, rectangle4.Right, rectangle4.Bottom);
- }
- int num8 = rectangle4.Top + 4;
- if (supportsLayered)
- {
- using (LinearGradientBrush brush7 = new LinearGradientBrush(new Point(x - 4, num8 + 4), new Point(x + 4, num8), color, color3))
- {
- x4b101060f4767186.FillRectangle(brush7, new Rectangle(x, num8, 4, 4));
- num8 += 4;
- }
- brush6 = new LinearGradientBrush(new Point(x, 0x270f), new Point(x + 4, 0x270f), color2, color3);
- }
- else
- {
- brush6 = new SolidBrush(SystemColors.ControlDark);
- }
- x4b101060f4767186.FillRectangle(brush6, new Rectangle(x, num8, 4, bottom - num8));
- brush6.Dispose();
- }
- else
- {
- Brush brush8;
- x4b101060f4767186.DrawLine(Pens.White, rectangle4.Right, rectangle4.Top, rectangle4.Right, rectangle4.Bottom);
- using (Pen pen4 = new Pen(this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUFONTCOLOR))
- {
- x4b101060f4767186.DrawLine(pen4, rectangle4.Right, rectangle4.Top, rectangle4.Right, rectangle4.Bottom);
- }
- int num9 = rectangle4.Left + 4;
- if (supportsLayered)
- {
- using (LinearGradientBrush brush9 = new LinearGradientBrush(new Point(num9 + 4, (bottom + 1) - 4), new Point(num9, (bottom + 1) + 4), color, color3))
- {
- x4b101060f4767186.FillRectangle(brush9, new Rectangle(num9, bottom + 1, 4, 4));
- num9 += 4;
- }
- brush8 = new LinearGradientBrush(new Point(0x270f, bottom + 1), new Point(0x270f, (bottom + 1) + 4), color2, color3);
- }
- else
- {
- brush8 = new SolidBrush(SystemColors.ControlDark);
- }
- x4b101060f4767186.FillRectangle(brush8, new Rectangle(num9, bottom + 1, (bottom - num9) - 4, 4));
- brush8.Dispose();
- }
- }
- }
- }
- else
- {
- x4b101060f4767186.FillRectangle(this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUCOLOR, rectangle4);
- using (Pen pen5 = new Pen(this.Engine.Res.Colors.SKIN2_TOPSELECTEDMENUBORDERCOLOR))
- {
- x4b101060f4767186.DrawRectangle(pen5, rectangle4);
- }
- }
- }
- if (xd2a8bb4342ab4ef6.Chevron)
- {
- int num10 = drawRect.Top;
- int num11 = drawRect.X + ((drawRect.Width - 12) / 2);
- if (this.selected)
- {
- num11++;
- num10++;
- }
- x4b101060f4767186.DrawImage(menuImages.Images[3], num11, num10);
- }
- else
- {
- StringFormat format = new StringFormat();
- format.FormatFlags = StringFormatFlags.NoClip | StringFormatFlags.NoWrap;
- format.Alignment = StringAlignment.Center;
- format.LineAlignment = StringAlignment.Center;
- format.HotkeyPrefix = HotkeyPrefix.Show;
- if (this.direction == xdbfa333b4cd503e0.Vertical)
- {
- format.FormatFlags |= StringFormatFlags.DirectionVertical;
- }
- if (xd2a8bb4342ab4ef6.Enabled && base.Enabled)
- {
- if (this.selected && x4b9cb2187c13edda)
- {
- brush = this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUFONTCOLOR;
- x4b101060f4767186.DrawString(menuCommand.Text, this.Font, brush, rectangle3, format);
- }
- else if (x4b9cb2187c13edda)
- {
- brush = this.Engine.Res.Brushes.SKIN2_TOPSELECTEDMENUFONTCOLOR;
- x4b101060f4767186.DrawString(menuCommand.Text, this.Font, brush, rectangle3, format);
- }
- else
- {
- brush = this.Engine.Res.Brushes.SKIN2_TOPMENUFONTCOLOR;
- x4b101060f4767186.DrawString(menuCommand.Text, this.Font, brush, rectangle3, format);
- }
- }
- else
- {
- Rectangle layoutRectangle = rectangle3;
- layoutRectangle.Offset(1, 1);
- x4b101060f4767186.DrawString(menuCommand.Text, this.Font, Brushes.White, layoutRectangle, format);
- using (SolidBrush brush10 = new SolidBrush(SystemColors.GrayText))
- {
- x4b101060f4767186.DrawString(menuCommand.Text, this.Font, brush10, rectangle3, format);
- }
- }
- }
- }
- }
- protected void xb73b905145ee3f9f()
- {
- this.minButton.Click -= new EventHandler(this.x199464e739d66b0b);
- this.restoreButton.Click -= new EventHandler(this.x6b3bc391561e756b);
- this.closeButton.Click -= new EventHandler(this.x0b912a2b95b630ba);
- x448fd9ab43628c71.RemoveControl(base.Controls, this.minButton);
- x448fd9ab43628c71.RemoveControl(base.Controls, this.restoreButton);
- x448fd9ab43628c71.RemoveControl(base.Controls, this.closeButton);
- this.minButton.Dispose();
- this.restoreButton.Dispose();
- this.closeButton.Dispose();
- this.minButton = null;
- this.restoreButton = null;
- this.closeButton = null;
- }
- protected void xbcc99f3d02a70fe7(int x75cf7df8c59ffa4d, int xc13ed6de98262a2d)
- {
- Point pt = new Point(x75cf7df8c59ffa4d, xc13ed6de98262a2d);
- for (int i = 0; i < this.drawCommands.Count; i++)
- {
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[i] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- if (xccebff.SelectRect.Contains(pt) && xccebff.Enabled)
- {
- if ((xccebff.MenuCommand != null) && (xccebff.MenuCommand.MenuCommands.Count == 0))
- {
- xccebff.MenuCommand.PerformClick();
- }
- if (!this.selected)
- {
- this.selected = true;
- this.drawUpwards = false;
- if (this.trackItem != i)
- {
- this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, i);
- }
- else
- {
- this.x2cc390e9409b0f3f(this.trackItem, true);
- }
- if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0))
- {
- x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 1, (uint) 0);
- return;
- }
- }
- else if ((this.trackItem == i) && (this.popupMenu != null))
- {
- this.popupMenu.Dismiss();
- this.popupMenu = null;
- return;
- }
- break;
- }
- }
- }
- protected void xcb97d93f0d5ce4a8()
- {
- this.animateFirst = true;
- this.selected = false;
- if (this.deselectReset)
- {
- this.xe8febcf8320c4113(this.menuCommands, false);
- }
- }
- internal void xd502a472a14a9c04()
- {
- if ((this.trackItem != -1) && this.selected)
- {
- this.drawUpwards = true;
- this.x2cc390e9409b0f3f(this.trackItem, true);
- }
- }
- protected void xdd922e6d558c59d4(int x75cf7df8c59ffa4d, int xc13ed6de98262a2d)
- {
- if (this.ignoreMouseMove)
- {
- this.ignoreMouseMove = false;
- }
- else
- {
- if (!this.mouseOver)
- {
- x40255b11ef821fa3.TRACKMOUSEEVENTS tme = new x40255b11ef821fa3.TRACKMOUSEEVENTS();
- tme.cbSize = 0x10;
- tme.dwFlags = 2;
- tme.hWnd = base.Handle;
- tme.dwHoverTime = 0;
- x61467fe65a98f20c.TrackMouseEvent(ref tme);
- this.mouseOver = true;
- }
- Form form = base.FindForm();
- if ((form != null) && form.ContainsFocus)
- {
- Point pt = new Point(x75cf7df8c59ffa4d, xc13ed6de98262a2d);
- int num = 0;
- num = 0;
- while (num < this.drawCommands.Count)
- {
- Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f xccebff = this.drawCommands[num] as Sunisoft.IrisSkin.InternalControls.x2cc390e9409b0f3f;
- if (xccebff.SelectRect.Contains(pt) && xccebff.Enabled)
- {
- if (this.trackItem != num)
- {
- if (this.selected)
- {
- if (this.popupMenu != null)
- {
- this.dismissTransfer = true;
- this.popupMenu.Dismiss();
- this.drawUpwards = false;
- }
- this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, num);
- if (xccebff.Chevron || (xccebff.MenuCommand.MenuCommands.Count > 0))
- {
- x61467fe65a98f20c.PostMessage(base.Handle, this.WM_OPERATEMENU, (uint) 1, (uint) 0);
- }
- }
- else
- {
- this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, num);
- }
- }
- break;
- }
- num++;
- }
- if ((!this.selected && (num == this.drawCommands.Count)) && !this.manualFocus)
- {
- this.trackItem = this.xa7cbddf1ec7a27e7(this.trackItem, -1);
- }
- }
- }
- }
- protected void xe8febcf8320c4113(xd53b20b7b4b2a08a x20e3b25d6d144908, bool x789c645a15deb49b)
- {
- foreach (x5f4b657f68f87baa xfbffbaa in x20e3b25d6d144908)
- {
- xfbffbaa.MenuCommands.ShowInfrequent = x789c645a15deb49b;
- this.xe8febcf8320c4113(xfbffbaa.MenuCommands, x789c645a15deb49b);
- }
- }
- protected void xfbce0f1d6df984cd(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
- {
- Form tag = null;
- if (this.childMenu != null)
- {
- foreach (x5f4b657f68f87baa xfbffbaa in this.childMenu.MenuCommands)
- {
- if (this.MenuCommands.Contains(xfbffbaa))
- {
- this.MenuCommands.Remove(xfbffbaa);
- }
- }
- if (this.childMenu.Tag is Form)
- {
- tag = (Form) this.childMenu.Tag;
- if (!tag.IsDisposed)
- {
- tag.Controls.Add(this.childMenu);
- }
- }
- this.childMenu = null;
- }
- if (this.activeChild.WindowState == FormWindowState.Maximized)
- {
- foreach (Control control in this.activeChild.Controls)
- {
- if (control is x3c41176af7e54b01)
- {
- this.childMenu = (x3c41176af7e54b01) control;
- this.childMenu.Tag = this.activeChild;
- this.activeChild.Controls.Remove(control);
- break;
- }
- this.childMenu = null;
- }
- if (this.childMenu != null)
- {
- foreach (x5f4b657f68f87baa xfbffbaa2 in this.childMenu.MenuCommands)
- {
- this.MenuCommands.Add(xfbffbaa2);
- }
- }
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- if (this.MenuCommands.Count == 0)
- {
- if (this.activeChild != null)
- {
- if (this.activeChild.WindowState == FormWindowState.Maximized)
- {
- base.Visible = true;
- }
- else
- {
- base.Visible = false;
- }
- }
- else
- {
- base.Visible = false;
- }
- }
- else
- {
- base.Visible = true;
- }
- }
- public x6fd23f8bad2f3ced Animate
- {
- get
- {
- return this.animate;
- }
- set
- {
- this.animate = value;
- }
- }
- public x1f5697535eab37b9 AnimateStyle
- {
- get
- {
- return this.animateStyle;
- }
- set
- {
- this.animateStyle = value;
- }
- }
- public int AnimateTime
- {
- get
- {
- return this.animateTime;
- }
- set
- {
- this.animateTime = value;
- }
- }
- public bool DeselectReset
- {
- get
- {
- return this.deselectReset;
- }
- set
- {
- this.deselectReset = value;
- }
- }
- public xdbfa333b4cd503e0 Direction
- {
- get
- {
- return this.direction;
- }
- set
- {
- if (this.direction != value)
- {
- this.direction = value;
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- }
- }
- public override DockStyle Dock
- {
- get
- {
- return base.Dock;
- }
- set
- {
- base.Dock = value;
- switch (value)
- {
- case DockStyle.None:
- this.direction = xdbfa333b4cd503e0.Horizontal;
- break;
- case DockStyle.Top:
- case DockStyle.Bottom:
- base.Height = 0;
- this.direction = xdbfa333b4cd503e0.Horizontal;
- break;
- case DockStyle.Left:
- case DockStyle.Right:
- base.Width = 0;
- this.direction = xdbfa333b4cd503e0.Vertical;
- break;
- }
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- }
- public SkinEngine Engine
- {
- get
- {
- return this.xcab6a0e662ada486;
- }
- set
- {
- this.xcab6a0e662ada486 = value;
- }
- }
- public bool ExpandAllTogether
- {
- get
- {
- return this.expandAllTogether;
- }
- set
- {
- this.expandAllTogether = value;
- }
- }
- public override System.Drawing.Font Font
- {
- get
- {
- return base.Font;
- }
- set
- {
- if (value != base.Font)
- {
- this.defaultFont = value == SystemInformation.MenuFont;
- this.x21498b72da0020ba(value);
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- }
- }
- public xc69458cec0f3af75 GlyphFading
- {
- get
- {
- return this.glyphFading;
- }
- set
- {
- this.glyphFading = value;
- }
- }
- public bool HighlightInfrequent
- {
- get
- {
- return this.highlightInfrequent;
- }
- set
- {
- this.highlightInfrequent = value;
- }
- }
- public Form MdiContainer
- {
- get
- {
- return this.mdiContainer;
- }
- set
- {
- if (this.mdiContainer != value)
- {
- if (this.mdiContainer != null)
- {
- this.mdiContainer.MdiChildActivate -= new EventHandler(this.x23daf02978257d54);
- this.xb73b905145ee3f9f();
- }
- this.mdiContainer = value;
- if (this.mdiContainer != null)
- {
- this.x9954cbb39675570d();
- this.mdiContainer.MdiChildActivate += new EventHandler(this.x23daf02978257d54);
- this.x23daf02978257d54(null, null);
- }
- }
- }
- }
- public xd53b20b7b4b2a08a MenuCommands
- {
- get
- {
- return this.menuCommands;
- }
- }
- public bool MultiLine
- {
- get
- {
- return this.multiLine;
- }
- set
- {
- if (this.multiLine != value)
- {
- this.multiLine = value;
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- }
- }
- public bool PlainAsBlock
- {
- get
- {
- return this.plainAsBlock;
- }
- set
- {
- if (this.plainAsBlock != value)
- {
- this.plainAsBlock = value;
- this.x39e008704a72ea56();
- base.Invalidate();
- }
- }
- }
- public bool RememberExpansion
- {
- get
- {
- return this.rememberExpansion;
- }
- set
- {
- this.rememberExpansion = value;
- }
- }
- }
- }