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

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

?? toolbarex.cs

?? chaoshi guan li xitong
?? CS
?? 第 1 頁 / 共 3 頁
字號:
				if ( disabled ) 
					ControlPaint.DrawImageDisabled(g, image, point.X, point.Y, ColorUtil.VSNetSelectionColor);
				else if ( hot && !selected && !item.Checked )
				{
					ControlPaint.DrawImageDisabled(g, image, point.X+1, point.Y, ColorUtil.VSNetSelectionColor);
					g.DrawImage(image, point.X, point.Y-1);
				}
				else 
				{
					if ( item.Checked  )
					{
						if  ( !selected ) point.Y -= 1;
					}
					g.DrawImage(image, point.X, point.Y);
				}
			}

			// Draw Text 
			if ( hasText )
			{
				string currentText = item.Text;
				int amperSandIndex = currentText.IndexOf('&');
				if ( barType == BarType.MenuBar && amperSandIndex != -1 )
					currentText = item.Text.Remove(amperSandIndex, 1);
				Size textSize = TextUtil.GetTextSize(g, currentText, SystemInformation.MenuFont);
				Point pos;
				if ( barType == BarType.MenuBar )	
				{
					int offset = rc.left + ((rc.right - rc.left) - textSize.Width)/2;
					pos = new Point(offset, rc.top + ((rc.bottom - rc.top - textSize.Height) / 2));
				}
				else
				{
					pos = new Point(rc.left, rc.top + ((rc.bottom - rc.top - textSize.Height) / 2));
					if ( image != null )
					{
						pos.X = rc.left + MARGIN + image.Size.Width + MARGIN;
					}
				}

				StringFormat stringFormat = new StringFormat();
				stringFormat.HotkeyPrefix = HotkeyPrefix.Show;
				g.DrawString(item.Text, SystemInformation.MenuFont, Brushes.Black, pos, stringFormat); 
			}
		
			m.Result = (IntPtr) CustomDrawReturnFlags.CDRF_SKIPDEFAULT;
		
		}

		protected void DrawArrowGlyph(Graphics g, Rectangle rectangle)
		{
			// Draw arrow glyph
			Point[] pts = new Point[3];
			int leftEdge = rectangle.Left + (rectangle.Width-DROWPDOWN_ARROW_WIDTH+1);
			int middle = rectangle.Top + rectangle.Height/2-1;
			pts[0] = new Point(leftEdge + 4, middle);
			pts[1] = new Point(leftEdge + 9,  middle);
			pts[2] = new Point(leftEdge + 6, middle+3);
			g.FillPolygon(Brushes.Black, pts);

		}

		public override bool PreProcessMessage(ref Message message)
		{
			if (message.Msg == (int)Msg.WM_KEYDOWN || message.Msg == (int)Msg.WM_SYSKEYDOWN)
			{
				// Check for shortcuts in ToolBarItems in this toolbar
				Keys keys = (Keys)(int) message.WParam  | ModifierKeys;
				ToolBarItem shortcutHit = items[keys];
				if (shortcutHit != null && shortcutHit.Enabled )
				{
					shortcutHit.RaiseClick();
					return true;
				}

				// Check for shortcuts in the menuitems of the popup menu
				// currently being displayed
				if ( barType == BarType.MenuBar )
				{
					MenuItem hitItem = null;
					foreach ( ToolBarItem tbi in items ) 
					{
						hitItem = FindShortcutItem(tbi.MenuItems, keys);
						if ( hitItem != null)
							break;
					}
					if ( hitItem != null )
						hitItem.PerformClick();
				}
  
				//  Check if we have a mnemonic
				bool alt = ((keys & Keys.Alt) != 0);
				if ( alt )
				{
					Keys keyCode = keys & Keys.KeyCode;
					char key = (char)(int)keyCode;
					if ((Char.IsDigit(key) || (Char.IsLetter(key))))
					{
						ToolBarItem mnemonicsHit = items[key];        
						if ( mnemonicsHit != null ) 
						{
							if ( barType == BarType.MenuBar )
								TrackDropDown(mnemonicsHit.Index);
							else
								mnemonicsHit.RaiseClick();
							return true;
						}
					}
				}
			}
			
			return false;
		}


		private MenuItem FindShortcutItem(MenuItem[] menuItems, Keys keys)
		{
			MenuItem resultItem = null;
			foreach (MenuItem item in menuItems )
			{
				if ( ((int)item.Shortcut == (int)keys) && (item.Enabled) && (item.Visible) )
					return item;
				else
				{
					resultItem =  FindShortcutItem(item.MenuItems, keys);
					if ( resultItem != null )
						break;
				}
			}
			return resultItem;
		}

		private MenuItem FindShortcutItem(Menu.MenuItemCollection collection, Keys keys)
		{
			int count = collection.Count;
			foreach (MenuItem item in collection )
			{
				if ( ((int)item.Shortcut == (int)keys) && (item.Enabled) && (item.Visible) )
					return item;
				else
					return FindShortcutItem(item.MenuItems, keys);
			}
			return null;
		}

		protected override void OnFontChanged(EventArgs e) 
		{
			base.OnFontChanged(e);
			UpdateItems();
		}

		void Items_Changed(Object s, EventArgs e)
		{
			UpdateItems();
		}

		void Item_Changed(Object s, EventArgs e)
		{
			ToolBarItem[] handledItems = this.handledItems;
			foreach (ToolBarItem item in handledItems)
			{
				if ( item == s )
				{
					if (item == null) return;
					int index = items.IndexOf(item);
					if (index == -1) return;
					UpdateItem(index);
				}
			}
		}
	
		void BeginUpdate()
		{
			WindowsAPI.SendMessage(Handle, (int)Msg.WM_SETREDRAW, 0, 0);	
		}
	
		void EndUpdate()
		{
			WindowsAPI.SendMessage(Handle, (int)Msg.WM_SETREDRAW, 1, 0);
		}


		public void UpdateToolBarItems()
		{	
			
			UpdateImageList();	
			for (int i = 0; i < items.Count; i++)
			{
				// The toolbar handle is going to be destroy to correctly update the toolbar 
				// itself. We need to detach the toolbar as the parent of the comboboxes --otherwise the comboboxes
				// does not behave appropiately after we pull the plug on the parent
				// The combobox will again parented to the toolbar once the handle is recreated and when the
				// RealizeItem routine gets the information for the toolbaritems
				if ( items[i].Style == ToolBarItemStyle.ComboBox )
				{
					WindowsAPI.SetParent(items[i].ComboBox.Handle, IntPtr.Zero);
					items[i].ComboBox.Parent = null;
				}

			}
			UpdateItems();
		}

		void UpdateItems()
		{
			Detach();
			Attach();
			if (IsHandleCreated) RecreateHandle();
		}
	
		TBBUTTONINFO GetButtonInfo(int index)
		{
			ToolBarItem item = items[index];
			TBBUTTONINFO tbi = new TBBUTTONINFO();
			tbi.cbSize = Marshal.SizeOf(typeof(TBBUTTONINFO));
			tbi.dwMask = (int)(ToolBarButtonInfoFlags.TBIF_IMAGE | ToolBarButtonInfoFlags.TBIF_STATE | 
				 ToolBarButtonInfoFlags.TBIF_STYLE | ToolBarButtonInfoFlags.TBIF_COMMAND | ToolBarButtonInfoFlags.TBIF_SIZE);
			tbi.idCommand = index;			
			tbi.iImage = (int)ToolBarButtonInfoFlags.I_IMAGECALLBACK;
			tbi.fsState = 0;
			tbi.cx = 0;
			tbi.lParam = IntPtr.Zero;
			tbi.pszText = IntPtr.Zero;
			tbi.cchText = 0;
			
			if ( item.Style == ToolBarItemStyle.ComboBox )
			{
				tbi.fsStyle = (int)(ToolBarButtonStyles.TBSTYLE_BUTTON) ;
				tbi.cx = (short)item.ComboBox.Width;
				WindowsAPI.SetParent(item.ComboBox.Handle, Handle);
			}
			else if ( item.Text != null && item.Text != string.Empty )
			{
				tbi.fsStyle = (int)(ToolBarButtonStyles.TBSTYLE_BUTTON);
				tbi.cx = MARGIN;
				if ( item.Image != null )
					tbi.cx += (short)(item.Image.Size.Width + MARGIN);
				if ( item.Style == ToolBarItemStyle.DropDownButton )
					tbi.cx += DROWPDOWN_ARROW_WIDTH;
				Graphics g = CreateGraphics();
				string currentText = item.Text;
				int amperSandIndex = currentText.IndexOf('&');
				if ( amperSandIndex != -1 )
					currentText = item.Text.Remove(amperSandIndex, 1);
				Size size = TextUtil.GetTextSize(g, currentText, SystemInformation.MenuFont);
                g.Dispose();
				if ( barType == BarType.MenuBar)
				{
					tbi.cx += (short)(size.Width + 2*MENUTEXT_MARGIN);
				}
				else
					tbi.cx += (short)(size.Width + 2*MARGIN);
				
				tbi.dwMask |= (int)ToolBarButtonInfoFlags.TBIF_TEXT;
				tbi.pszText = Marshal.StringToHGlobalAuto(item.Text + "\0");
				tbi.cchText = item.Text.Length;

				if (  IsCommonCtrl6() && barType != BarType.MenuBar )
				{
					// If we let the operating system do the drawing
					// the DROWPDOWN_ARROW_WIDTH is slightly bigger than
					// the value we are using add some padding to compensate
					tbi.cx += 6;
				}

			}
			else 
			{
				tbi.fsStyle = (int)(ToolBarButtonStyles.TBSTYLE_BUTTON | ToolBarButtonStyles.TBSTYLE_AUTOSIZE );
				tbi.cx = 0;
			}

			if (!item.Visible)
				tbi.fsState |= (int)ToolBarButtonStates.TBSTATE_HIDDEN;
						
			if (item.Style == ToolBarItemStyle.Separator)
			{
				tbi.fsStyle |= (int)ToolBarButtonStyles.TBSTYLE_SEP;
			}			
			else
			{
				if (item.Enabled)
					tbi.fsState |= (int)ToolBarButtonStates.TBSTATE_ENABLED;

				if ( item.Style == ToolBarItemStyle.DropDownButton )
					tbi.fsStyle |= (int)ToolBarButtonStyles.TBSTYLE_DROPDOWN;

				if (item.Style == ToolBarItemStyle.PushButton)
					if (item.Checked) 
						tbi.fsState |= (int)ToolBarButtonStates.TBSTATE_CHECKED;
			}

			if (item.Style == ToolBarItemStyle.Separator )
				tbi.iImage = (int)ToolBarButtonInfoFlags.I_IMAGENONE;
			else if (item.Image != null)
				tbi.iImage = index;

			return tbi;				
		}

		void RealizeItems()
		{
			
			UpdateImageList();
						
			for (int i = 0; i < items.Count; i++)
			{
				items[i].Index = i;
				items[i].ToolBar = this;
				TBBUTTON button = new TBBUTTON();
				button.idCommand = i;
				WindowsAPI.SendMessage(Handle, (int)ToolBarMessages.TB_INSERTBUTTON, i, ref button);
	
				TBBUTTONINFO tbi = GetButtonInfo(i);
				WindowsAPI.SendMessage(Handle, (int)ToolBarMessages.TB_SETBUTTONINFOW, i, ref tbi);
				if ( items[i].Style == ToolBarItemStyle.ComboBox ) UpdateComboBoxPosition(i);
			}
						
            UpdateSize();
		}

		void UpdateComboBoxPosition(int index)
		{
			RECT rect = new RECT();
			WindowsAPI.SendMessage(Handle, (int)ToolBarMessages.TB_GETRECT, index, ref rect);
			int rectHeight = (rect.bottom-rect.top);
			int cbHeight = Items[index].ComboBox.Bounds.Height;
			int topOffset = rect.top+(rectHeight-cbHeight)/2;
			Items[index].ComboBox.Bounds = new Rectangle(rect.left+1, topOffset, 
					(rect.right-rect.left)-2, cbHeight);
			
		}


		void UpdateImageList()
		{
			Size size = new Size(16, SystemInformation.MenuFont.Height);
			for (int i = 0; i < items.Count; i++)
			{
				Image image = items[i].Image;
				if (image != null)
				{
					if (image.Width > size.Width) size.Width = image.Width;
					if (image.Height > size.Height) size.Height = image.Height;
				}
			}
	
			imageList = new ImageList();
			imageList.ImageSize = size;
			imageList.ColorDepth = ColorDepth.Depth32Bit;		

			for (int i = 0; i < items.Count; i++)
			{
				// Take combobox size into consideration too
				if ( items[i].Style == ToolBarItemStyle.ComboBox )
				{
					// update combobox to use the current system menu font
					items[i].ComboBox.Font = SystemInformation.MenuFont;
					ComboBoxBase cbb = (ComboBoxBase)items[i].ComboBox;
					int decrease = 2;
					if ( SystemInformation.MenuFont.Height >= 20)
						decrease = 5;
					cbb.SetFontHeight(SystemInformation.MenuFont.Height-decrease);
					
				}
				
				Image image = items[i].Image;
				imageList.Images.Add((image != null) ? image : new Bitmap(size.Width, size.Height));
			}

			IntPtr handle = (BarType == BarType.MenuBar) ? IntPtr.Zero : imageList.Handle;
			WindowsAPI.SendMessage(Handle, (int)ToolBarMessages.TB_SETIMAGELIST, 0, handle);
		}


		void UpdateSize()
		{
			Size size = new Size(0, 0);
			for (int i = 0; i < items.Count; i++)
			{
				RECT rect = new RECT();
				WindowsAPI.SendMessage(Handle, (int)ToolBarMessages.TB_GETRECT, i, ref rect);
				int height = rect.bottom - rect.top;
				if (height > size.Height) size.Height = height;
				size.Width += rect.right - rect.left;
			}
			Size = size;
		}

		public int GetIdealSize()
		{
			Size size = new Size(0, 0);
			for (int i = 0; i < items.Count; i++)
			{
				RECT rect = new RECT();
				WindowsAPI.SendMessage(Handle, (int)ToolBarMessages.TB_GETRECT, i, ref rect);
				int height = rect.bottom - rect.top;
				if (height > size.Height) size.Height = height;
				size.Width += rect.right - rect.left;
			}
			return size.Width;
		}

		void UpdateItem(int index)
		{
			if (!IsHandleCreated) return;

			if ( items[index].Visible == handledItemsVisible[index] )
			{
				TBBUTTONINFO tbi = GetButtonInfo(index);
				WindowsAPI.SendMessage(Handle, (int)ToolBarMessages.TB_SETBUTTONINFOW, index, ref tbi);
				if ( items[index].Style == ToolBarItemStyle.ComboBox ) UpdateComboBoxPosition(index);
			}			
			else
			{
				UpdateItems();
			}
		}
	}

	public interface IChevron
	{
		void Show(Control control, Point point);
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美人成免费网站| 欧美裸体bbwbbwbbw| 青青草97国产精品免费观看| 亚洲一区二区精品3399| 伊人色综合久久天天人手人婷| 国产精品久久久久久久浪潮网站 | 成人一道本在线| 国产乱人伦偷精品视频免下载| 国产麻豆精品theporn| 国产精品一区二区三区99| 国产99一区视频免费| 波多野结衣中文字幕一区| av在线播放一区二区三区| 色天天综合色天天久久| 欧美日韩国产首页| 日韩视频免费观看高清完整版 | 免费观看30秒视频久久| 美女www一区二区| 国产成人在线看| 99久久久久免费精品国产 | 56国语精品自产拍在线观看| 91麻豆精品国产自产在线| 日韩精品一区二区三区在线观看 | 99re这里只有精品视频首页| 欧美日韩久久一区二区| 精品久久免费看| 亚洲视频免费看| 老司机精品视频线观看86| 成人国产精品免费观看| 欧美日韩精品一区二区三区蜜桃| 日韩午夜在线观看视频| 中文字幕一区二区三区四区 | 国产午夜精品福利| 亚洲国产精品一区二区久久| 久久精品噜噜噜成人av农村| 成+人+亚洲+综合天堂| 欧美日本一道本| 国产精品久99| 麻豆91精品视频| 色欧美乱欧美15图片| 欧美精品一区二区三区蜜臀| 亚洲综合久久久| 丁香五精品蜜臀久久久久99网站| 欧美色欧美亚洲另类二区| 国产精品青草综合久久久久99| 婷婷中文字幕综合| www.成人网.com| 亚洲精品一区二区三区精华液| 亚洲午夜日本在线观看| 国产999精品久久久久久| 538prom精品视频线放| 亚洲视频网在线直播| 国产福利精品导航| 日韩视频免费观看高清在线视频| 亚洲综合色自拍一区| 99久久国产免费看| 久久久夜色精品亚洲| 日韩黄色片在线观看| 欧美亚洲动漫精品| 一区二区在线免费观看| 国产剧情一区在线| 日韩手机在线导航| 日本女人一区二区三区| 欧美巨大另类极品videosbest | 蜜臀精品久久久久久蜜臀| 欧美亚洲国产一区在线观看网站 | 国产高清亚洲一区| 久久在线观看免费| 国内精品久久久久影院薰衣草 | 91免费视频观看| 久久久蜜桃精品| 国产自产v一区二区三区c| 欧美大片免费久久精品三p| 日本女优在线视频一区二区 | 国产午夜精品福利| 国产电影一区在线| 日本一区二区三级电影在线观看| 国产一区二区三区美女| 久久久亚洲综合| 成av人片一区二区| 亚洲猫色日本管| 欧美性videosxxxxx| 午夜精品久久久久久不卡8050| 在线成人午夜影院| 麻豆91精品91久久久的内涵| 久久久久国产精品人| 国产91露脸合集magnet| 自拍av一区二区三区| 色婷婷av一区| 麻豆精品一二三| 中文字幕第一区二区| 91论坛在线播放| 三级在线观看一区二区| 精品99一区二区三区| 丁香激情综合国产| 一区二区三区中文在线| 日韩欧美在线123| 成人午夜电影网站| 一区二区三区日韩欧美精品| 正在播放亚洲一区| 国产a久久麻豆| 亚洲综合久久久久| 久久久久久久综合| 一本大道av伊人久久综合| 日韩电影在线看| 国产精品国产自产拍高清av | 国产美女视频一区| 一区二区三区在线免费观看| 日韩欧美国产综合一区| 99久久综合狠狠综合久久| 偷拍与自拍一区| 中文字幕在线免费不卡| 91精品国产入口| 99久久99精品久久久久久| 久久国产尿小便嘘嘘| 亚洲男同性视频| 久久精品一区二区三区四区| 欧美日韩视频在线一区二区| 国产麻豆精品95视频| 视频一区在线视频| 亚洲欧洲精品一区二区三区不卡 | 9色porny自拍视频一区二区| 毛片av一区二区三区| 亚洲色大成网站www久久九九| 精品乱码亚洲一区二区不卡| 在线观看成人小视频| 成人午夜在线播放| 久久99国内精品| 天堂成人免费av电影一区| 成人免费在线视频观看| 国产亚洲一区二区三区在线观看| 91精品国产福利| 欧美美女视频在线观看| 欧美在线观看18| 91免费版在线| av不卡一区二区三区| 丰满岳乱妇一区二区三区| 国内精品国产成人| 久久国产精品无码网站| 美女网站色91| 麻豆一区二区三| 久久国产精品99精品国产| 日本午夜精品一区二区三区电影| 夜夜嗨av一区二区三区四季av| 国产精品久久精品日日| 国产精品美女www爽爽爽| 国产日产精品一区| 国产精品视频九色porn| 亚洲国产精品二十页| 久久久精品国产99久久精品芒果| 欧美精品一区二区久久婷婷| 精品国产乱码久久| 久久久99久久| 国产精品无码永久免费888| 国产午夜精品理论片a级大结局 | 日韩精品专区在线| 欧美tickling挠脚心丨vk| 日韩一区二区三区av| 精品久久久久香蕉网| 国产欧美日韩一区二区三区在线观看| 久久综合久久久久88| 国产精品色在线| 亚洲视频网在线直播| 亚洲mv在线观看| 久久不见久久见免费视频7| 国产精品一区专区| 色哟哟欧美精品| 欧美一区二区在线视频| 精品美女一区二区| 国产精品成人免费在线| 一区二区理论电影在线观看| 亚洲成人av一区二区| 精品一区二区三区久久久| 成人听书哪个软件好| 欧美视频在线观看一区二区| 91精品久久久久久久91蜜桃| 久久亚洲综合色一区二区三区 | 亚洲高清视频的网址| 日韩av一区二区三区四区| 国产麻豆精品theporn| 91丨九色丨蝌蚪富婆spa| 欧美另类z0zxhd电影| 久久嫩草精品久久久精品 | 欧美在线观看你懂的| 亚洲精品在线观看网站| 一区二区三区在线影院| 久久99精品久久只有精品| 91色九色蝌蚪| 欧美精品一区二区三区高清aⅴ| 国产精品国产自产拍高清av王其| 婷婷综合在线观看| 99在线精品视频| 26uuu国产在线精品一区二区| 一级精品视频在线观看宜春院| 美女国产一区二区三区| 欧美自拍丝袜亚洲| 日本一区二区三区电影| 美国精品在线观看| 韩国三级在线一区| 欧美系列日韩一区|