亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? popupmenu.cs

?? chaoshi guan li xitong
?? CS
?? 第 1 頁 / 共 5 頁
字號:
using System;
using System.IO;
using System.Drawing;
using System.Reflection;
using System.Drawing.Text;
using System.Collections;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Text;
using UtilityLibrary.Menus;
using UtilityLibrary.Win32;
using UtilityLibrary.Collections;
using UtilityLibrary.General;


namespace UtilityLibrary.Menus
{
	internal class FocusCatcher : NativeWindow
	{
		public FocusCatcher(IntPtr hParent)
		{
			CreateParams cp = new CreateParams();

			// Any old title will do as it will not be shown
			cp.Caption = "NativeFocusCatcher";
			
			// Set the position off the screen so it will not be seen
			cp.X = -1;
			cp.Y = -1;
			cp.Height = 0;
			cp.Width = 0;

			// As a top-level window it has no parent
			cp.Parent = hParent;
			
			// Create as a child of the specified parent
			cp.Style = unchecked((int)(uint)Win32.WindowStyles.WS_CHILD +
				(int)(uint)Win32.WindowStyles.WS_VISIBLE);

			// Create the actual window
			this.CreateHandle(cp);
		}		
	}

	[ToolboxItem(false)]
	[DefaultProperty("MenuCommands")]
	public class PopupMenu : NativeWindow
	{
		// Enumeration of Indexes into positioning constants array
		protected enum PI
		{
			BorderTop		= 0,
			BorderLeft		= 1,
			BorderBottom	= 2, 
			BorderRight		= 3,
			ImageGapTop		= 4,
			ImageGapLeft	= 5,
			ImageGapBottom	= 6,
			ImageGapRight	= 7,
			TextGapLeft		= 8,
			TextGapRight	= 9,
			SubMenuGapLeft	= 10,
			SubMenuWidth	= 11,
			SubMenuGapRight	= 12,
			SeparatorHeight	= 13,
			SeparatorWidth	= 14,
			ShortcutGap		= 15,
			ShadowWidth		= 16,
			ShadowHeight	= 17,
			ExtraWidthGap	= 18,
			ExtraHeightGap	= 19,
			ExtraRightGap	= 20,
			ExtraReduce		= 21
		}

		// Class constants for sizing/positioning each style
		protected static readonly int[,] _position = { 
														{2, 1, 0, 1, 4, 3, 4, 5, 4, 4, 2, 6, 5, 3, 1, 10, 3, 3, 2, 2, 0, 0},	// IDE
														{1, 0, 1, 2, 2, 1, 3, 4, 3, 3, 2, 8, 5, 4, 5, 10, 0, 0, 2, 2, 2, 5}		// Plain
													 };
		// Other class constants
		protected static readonly int _selectionDelay = 400;
		
		// Class fields
		protected static ImageList _menuImages = null;
		protected static bool _supportsLayered = false;
		
		// Indexes into the menu images strip
		protected enum ImageIndex
		{
			Check			= 0,
			Radio			= 1,
			SubMenu			= 2,
			CheckSelected	= 3,
			RadioSelected	= 4,
			SubMenuSelected	= 5,
			Expansion		= 6,
			ImageError		= 7
		}

		// Class constants that are marked as 'readonly' are allowed computed initialization
		protected readonly int WM_DISMISS = (int)Msg.WM_USER + 1;
		protected readonly int _imageWidth = SystemInformation.SmallIconSize.Width;
		protected readonly int _imageHeight = SystemInformation.SmallIconSize.Height;

		// Instance fields
		protected Timer _timer;
		protected bool _layered;
		protected Font _textFont;
		protected int _popupItem;
		protected int _trackItem;
		protected int _borderGap;
		protected int _returnDir;
		protected int _extraSize;
		protected bool _exitLoop;
		protected bool _mouseOver;
		protected bool _grabFocus;
		protected bool _popupDown;
		protected bool _popupRight;
		protected bool _excludeTop;
		protected Point _screenPos;
		protected IntPtr _oldFocus;
		protected VisualStyle _style;
		protected Size _currentSize;
		protected int _excludeOffset;
		protected Point _lastMousePos;
		protected Point _currentPoint;
		protected bool _showInfrequent;
		protected PopupMenu _childMenu;
		protected Point _leftScreenPos;
		protected Direction _direction;
		protected Point _aboveScreenPos;
		protected PopupMenu _parentMenu;
		protected ArrayList _drawCommands;
		internal FocusCatcher _focusCatcher;
		protected MenuControl _parentControl;
		protected MenuCommand _returnCommand;
		protected MenuCommandCollection _menuCommands;

		static PopupMenu()
		{
			// Create a strip of images by loading an embedded bitmap resource
			_menuImages = ResourceUtil.LoadImageListResource(Type.GetType("UtilityLibrary.Menus.PopupMenu"),
														 "Resources.ImagesMenu",
														 "MenuControlImages",
														 new Size(16,16),
														 true,
														 new Point(0,0));

			// We need to know if the OS supports layered windows
			_supportsLayered = (OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows) != null);
		}

		public PopupMenu()
		{
			// Create collection objects
			_drawCommands = new ArrayList();
			_menuCommands = new MenuCommandCollection(); 

			// Default the properties
			_returnDir = 0;
			_extraSize = 0;
			_popupItem = -1;
			_trackItem = -1;
			_childMenu = null;
			_exitLoop = false;
			_popupDown = true;
			_mouseOver = false;
			_grabFocus = false;
			_excludeTop = true;
			_popupRight = true;
			_parentMenu = null;
			_excludeOffset = 0;
			_focusCatcher = null;
			_parentControl = null;
			_returnCommand = null;
			_oldFocus = IntPtr.Zero;
			_showInfrequent = false;
			_style = VisualStyle.IDE;
			_lastMousePos = new Point(-1,-1);
			_direction = Direction.Horizontal;
			_textFont = SystemInformation.MenuFont;

			// Create and initialise the timer object (but do not start it running!)
			_timer = new Timer();
			_timer.Interval = _selectionDelay;
			_timer.Tick += new EventHandler(OnTimerExpire);
		}

		[Category("Appearance")]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
		public MenuCommandCollection MenuCommands
		{
			get { return _menuCommands; }

			set
			{
				_menuCommands.Clear();
				_menuCommands = value;
			}
		} 

		[Category("Appearance")]
		[DefaultValue(VisualStyle.IDE)]
		public VisualStyle Style
		{
			get { return _style; }
			
			set
			{
				if (_style != value)
					_style = value;
			}
		}

		[Category("Appearance")]
		public Font Font
		{
			get { return _textFont; }
			
			set
			{
				if (_textFont != value)
					_textFont = value;
			}
		}

		[Category("Behaviour")]
		[DefaultValue(false)]
		public bool ShowInfrequent
		{
			get { return _showInfrequent; }
			
			set
			{
				if (_showInfrequent != value)
					_showInfrequent = value;
			}
		}

		public MenuCommand TrackPopup(Point screenPos)
		{
			return TrackPopup(screenPos, false);
		}

		public MenuCommand TrackPopup(Point screenPos, bool selectFirst)
		{
			// No point in showing PopupMenu if there are no entries
			if (_menuCommands.VisibleItems())
			{
				// We are being called as a popup window and not from a MenuControl instance
				// and so we need to the focus during the lifetime of the popup and then return
				// focus back again when we are dismissed. Otherwise keyboard input will still go
				// to the control that has it when the popup is created.
				_grabFocus = true;

				// Default the drawing direction
				_direction = Direction.Horizontal;

				// Remember screen positions
				_screenPos = screenPos;
				_aboveScreenPos = screenPos;
				_leftScreenPos = screenPos;

				return InternalTrackPopup(selectFirst);
			}
			else
				return null;
		}

		internal MenuCommand TrackPopup(Point screenPos, Point aboveScreenPos, 
										Direction direction,
										MenuCommandCollection menuCollection, 
										int borderGap, 
										bool selectFirst, 
										MenuControl parentControl,
									    ref int returnDir)
		{
			// Remember which direction the MenuControl is drawing in
			_direction = direction;

			// Remember the MenuControl that initiated us
			_parentControl = parentControl;

			// Remember the gap in drawing the top border
			_borderGap = borderGap;

			// Remember any currect menu item collection
			MenuCommandCollection oldCollection = _menuCommands;

			// Use the passed in collection of menu commands
			_menuCommands = menuCollection;

			// Remember screen positions
			_screenPos = screenPos;
			_aboveScreenPos = aboveScreenPos;
			_leftScreenPos = screenPos;

			MenuCommand ret = InternalTrackPopup(selectFirst);

			// Restore to original collection
			_menuCommands = oldCollection;

			// Remove reference no longer required
			_parentControl = null;

			// Return the direction key that caused dismissal
			returnDir = _returnDir;

			return ret;
		}

		protected MenuCommand InternalTrackPopup(Point screenPosTR, Point screenPosTL, 
												 MenuCommandCollection menuCollection, 
												 PopupMenu parentMenu, bool selectFirst, 
												 MenuControl parentControl, bool popupRight,
												 bool popupDown, ref int returnDir)
		{
			// Default the drawing direction
			_direction = Direction.Horizontal;

			// Remember the MenuControl that initiated us
			_parentControl = parentControl;

			// We have a parent popup menu that should be consulted about operation
			_parentMenu = parentMenu;

			// Remember any currect menu item collection
			MenuCommandCollection oldCollection = _menuCommands;

			// Use the passed in collection of menu commands
			_menuCommands = menuCollection;

			// Remember screen positions
			_screenPos = screenPosTR;
			_aboveScreenPos = screenPosTR;
			_leftScreenPos = screenPosTL;

			// Remember display directions
			_popupRight = popupRight;
			_popupDown = popupDown;

			MenuCommand ret = InternalTrackPopup(selectFirst);

			// Restore to original collection
			_menuCommands = oldCollection;

			// Remove references no longer required
			_parentControl = null;
			_parentMenu = null;

			// Return the direction key that caused dismissal
			returnDir = _returnDir;

			return ret;
		}

		protected MenuCommand InternalTrackPopup(bool selectFirst)
		{
			// MenuCommand to return as method result
			_returnCommand = null;

			// No item is being tracked
			_trackItem = -1;

			// Flag to indicate when to exit the message loop
			_exitLoop = false;
			
			// Assume the mouse does not start over our window
			_mouseOver = false;

			// Direction of key press if this caused dismissal
			_returnDir = 0;

			// Flag to indicate if the message should be dispatched
			bool leaveMsg = false;

			// Create and show the popup window (without taking the focus)
			CreateAndShowWindow();
		
			// Create an object for storing windows message information
			Win32.MSG msg = new Win32.MSG();

			// Draw everything now...
			//RefreshAllCommands();

			// Pretend user pressed key down to get the first valid item selected
			if (selectFirst)
				ProcessKeyDown();

			// Process messages until exit condition recognised
			while(!_exitLoop)
			{
				// Suspend thread until a windows message has arrived
				if (WindowsAPI.WaitMessage())
				{
					// Take a peek at the message details without removing from queue
					while(!_exitLoop && WindowsAPI.PeekMessage(ref msg, 0, 0, 0, (int)Win32.PeekMessageFlags.PM_NOREMOVE))
					{
						//Console.WriteLine("Track {0} {1}", this.Handle, ((Msg)msg.message).ToString());
						//Console.WriteLine("Message is for {0 }", msg.hwnd); 

						// Leave messages for children
						IntPtr hParent = WindowsAPI.GetParent(msg.hwnd);
						bool child = hParent == Handle;
						bool combolist = IsComboBoxList(msg.hwnd);

						// Mouse was pressed in a window of this application
						if ((msg.message == (int)Msg.WM_LBUTTONDOWN) ||
							(msg.message == (int)Msg.WM_MBUTTONDOWN) ||
							(msg.message == (int)Msg.WM_RBUTTONDOWN) ||
							(msg.message == (int)Msg.WM_NCLBUTTONDOWN) ||
							(msg.message == (int)Msg.WM_NCMBUTTONDOWN) ||
							(msg.message == (int)Msg.WM_NCRBUTTONDOWN))

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩三级一区二区| 色综合视频在线观看| 日韩午夜激情电影| 日本少妇一区二区| 欧美va天堂va视频va在线| 国产一区二区三区精品欧美日韩一区二区三区 | 亚洲一区av在线| 欧美三级资源在线| 久久国产精品露脸对白| 亚洲国产中文字幕| 日韩午夜av一区| 处破女av一区二区| 一区二区日韩电影| 欧美不卡一区二区| 91在线观看下载| 日韩福利视频导航| 欧美国产精品v| 欧美日韩免费不卡视频一区二区三区| 香蕉乱码成人久久天堂爱免费| 日韩精品一区二区三区四区视频 | 中文字幕日韩一区二区| 欧美视频一区二| 国产精品一区二区无线| 亚洲三级在线观看| 日韩欧美的一区二区| 91影视在线播放| 久久99精品久久久久久国产越南 | 精品免费一区二区三区| av网站一区二区三区| 婷婷丁香久久五月婷婷| 国产日韩精品视频一区| 欧美最猛性xxxxx直播| 国产一区二区三区免费播放| 亚洲精品老司机| 国产亚洲一区二区三区四区| 欧洲视频一区二区| 成人精品在线视频观看| 看电视剧不卡顿的网站| 亚洲另类春色国产| 久久久99久久| 91精品国产综合久久久蜜臀粉嫩 | 欧美视频日韩视频在线观看| 国产精品18久久久久久vr| 亚洲mv在线观看| 亚洲人成亚洲人成在线观看图片| 精品久久一区二区| 欧美区视频在线观看| 成人av资源下载| 国产麻豆91精品| 蜜臀99久久精品久久久久久软件| 一区二区三区欧美日韩| 国产精品福利电影一区二区三区四区| 日韩一区二区在线看| 欧美亚州韩日在线看免费版国语版| 大陆成人av片| 国产在线观看免费一区| 免费在线视频一区| 亚洲国产精品久久艾草纯爱| 亚洲欧洲av在线| 国产喷白浆一区二区三区| 欧美电视剧免费全集观看| 91精品国产综合久久久蜜臀图片 | aaa国产一区| 欧美日韩一区中文字幕| 91免费看视频| 91免费观看在线| 色综合婷婷久久| 91社区在线播放| 91色综合久久久久婷婷| 波波电影院一区二区三区| 国产iv一区二区三区| 国产精品66部| 国产精品99久| 成人影视亚洲图片在线| 成人中文字幕在线| www..com久久爱| 99精品在线免费| 色乱码一区二区三区88| 色系网站成人免费| 欧美三级中文字幕在线观看| 欧美年轻男男videosbes| 欧美一区二区福利视频| 日韩欧美高清一区| 久久这里只有精品首页| 国产欧美一区二区三区网站| 国产精品人成在线观看免费| 亚洲丝袜精品丝袜在线| 亚洲精品菠萝久久久久久久| 亚洲一区二区综合| 免费不卡在线观看| 国产一区二区三区免费| 不卡电影一区二区三区| 日本韩国欧美一区| 欧美日韩精品一区二区天天拍小说| 337p亚洲精品色噜噜狠狠| 欧美刺激午夜性久久久久久久| 国产亚洲污的网站| 亚洲免费色视频| 免费人成网站在线观看欧美高清| 精品无码三级在线观看视频| 成人免费看片app下载| 91高清视频免费看| 日韩视频免费观看高清完整版 | 色欧美片视频在线观看| 欧美日韩黄色一区二区| 久久综合久久久久88| 亚洲欧美综合色| 成人少妇影院yyyy| 在线免费观看日本一区| 欧美一级片在线| 国产精品欧美一区喷水| 视频在线观看91| 成人精品小蝌蚪| 日韩一区二区在线看| 中文字幕色av一区二区三区| 日本麻豆一区二区三区视频| 成人污污视频在线观看| 欧美日韩国产免费一区二区 | 日日夜夜精品视频免费 | 91在线观看免费视频| 欧美一区二区三区四区高清| 国产精品无圣光一区二区| 日韩影院在线观看| 99精品1区2区| 精品免费视频一区二区| 亚洲一区二区美女| 成人午夜在线免费| 日韩限制级电影在线观看| 亚洲欧美日韩国产一区二区三区 | 亚洲 欧美综合在线网络| 国产伦精品一区二区三区免费| 欧美在线视频全部完| 亚洲国产电影在线观看| 蜜桃视频在线一区| 欧美在线观看视频一区二区三区| 久久影院午夜论| 日韩成人精品在线| 在线免费亚洲电影| 中文字幕成人在线观看| 精品一区二区三区蜜桃| 欧美日韩国产精品成人| 亚洲另类春色校园小说| 成人激情动漫在线观看| 精品福利av导航| 伦理电影国产精品| 欧美一区二区三区性视频| 亚洲一区二区在线免费看| 99精品热视频| 国产精品毛片a∨一区二区三区| 久久99精品国产.久久久久 | 色综合天天综合狠狠| 国产欧美精品区一区二区三区| 麻豆免费看一区二区三区| 欧美日韩高清一区二区三区| 亚洲综合另类小说| 91麻豆产精品久久久久久 | 99r国产精品| 国产精品不卡一区| 成人黄页在线观看| 日本一区二区不卡视频| 国产丶欧美丶日本不卡视频| 欧美精品一区二区三区高清aⅴ | 国产成a人亚洲精品| 26uuu国产在线精品一区二区| 久久精品免费观看| 欧美sm极限捆绑bd| 欧美最猛黑人xxxxx猛交| 亚洲欧美日韩在线| 色婷婷久久久综合中文字幕| 亚洲欧美偷拍另类a∨色屁股| 99re免费视频精品全部| 自拍偷拍亚洲激情| 色综合久久久久网| 亚洲国产毛片aaaaa无费看| 欧美日韩亚洲综合在线| 日本成人在线网站| 精品久久久网站| 国产成人免费网站| 亚洲人成电影网站色mp4| 在线观看亚洲精品| 日韩av在线播放中文字幕| 精品国产乱码久久久久久蜜臀| 国产乱子轮精品视频| 中文字幕第一区| 在线精品视频免费观看| 石原莉奈在线亚洲二区| 精品国产一二三| 成人av网址在线观看| 亚洲视频免费在线| 欧美精品日韩一区| 国产一区二三区| 亚洲婷婷在线视频| 7777精品伊人久久久大香线蕉| 精品一区二区国语对白| 成人欧美一区二区三区黑人麻豆 | 国产在线精品免费| 国产精品毛片a∨一区二区三区| 欧美亚洲一区三区| 久久99国内精品| 亚洲品质自拍视频网站|