• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.InternalWindowManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.InternalWindowManager的典型用法代码示例。如果您正苦于以下问题:C# InternalWindowManager类的具体用法?C# InternalWindowManager怎么用?C# InternalWindowManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InternalWindowManager类属于System.Windows.Forms命名空间,在下文中一共展示了InternalWindowManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ManagedWindowIconWidth

		public abstract int ManagedWindowIconWidth (InternalWindowManager wm);
开发者ID:Profit0004,项目名称:mono,代码行数:1,代码来源:Theme.cs


示例2: ManagedWindowGetMenuButtonSize

		public override Size ManagedWindowGetMenuButtonSize (InternalWindowManager wm)
		{
			Size result = SystemInformation.MenuButtonSize;
			result.Width -= 2;
			result.Height -= 4;
			return result;
		}
开发者ID:ngraziano,项目名称:mono,代码行数:7,代码来源:ThemeWin32Classic.cs


示例3: ManagedWindowDrawTitleBarAndBorders

		protected virtual Rectangle ManagedWindowDrawTitleBarAndBorders (Graphics dc, Rectangle clip, InternalWindowManager wm)
		{
			Form form = wm.Form;
			int tbheight = ManagedWindowTitleBarHeight (wm);
			int bdwidth = ManagedWindowBorderWidth (wm);
			Color titlebar_color = Color.FromArgb (255, 10, 36, 106);
			Color titlebar_color2 = Color.FromArgb (255, 166, 202, 240);
			Color color = ThemeEngine.Current.ColorControlDark;
			Color color2 = Color.FromArgb (255, 192, 192, 192);

			Pen pen = ResPool.GetPen (ColorControl);
			Rectangle borders = new Rectangle (0, 0, form.Width, form.Height);
			ControlPaint.DrawBorder3D (dc, borders, Border3DStyle.Raised);
			// The 3d border is only 2 pixels wide, so we draw the innermost pixels ourselves
			borders = new Rectangle (2, 2, form.Width - 5, form.Height - 5);
			for (int i = 2; i < bdwidth; i++) {
				dc.DrawRectangle (pen, borders);
				borders.Inflate (-1, -1);
			}				


			bool draw_titlebar_enabled = false;
			if (wm.Form.Parent != null && wm.Form.Parent is Form) {
				draw_titlebar_enabled = false;
			} else if (wm.IsActive && !wm.IsMaximized) {
				draw_titlebar_enabled = true;
			}
			if (draw_titlebar_enabled) {
				color = titlebar_color;
				color2 = titlebar_color2;
			}

			Rectangle tb = new Rectangle (bdwidth, bdwidth, form.Width - (bdwidth * 2), tbheight - 1);

			// HACK: For now always draw the titlebar until we get updates better
			if (tb.Width > 0 && tb.Height > 0) {
				using (System.Drawing.Drawing2D.LinearGradientBrush gradient = new LinearGradientBrush (tb, color, color2, LinearGradientMode.Horizontal))
				{
					dc.FillRectangle (gradient, tb);
				}	
			}
			
			if (!wm.IsMinimized)
				// Draw the line just beneath the title bar
				dc.DrawLine (ResPool.GetPen (SystemColors.Control), bdwidth,
						tbheight + bdwidth - 1, form.Width - bdwidth - 1,
						tbheight + bdwidth - 1);
			return tb;
		}
开发者ID:ngraziano,项目名称:mono,代码行数:49,代码来源:ThemeWin32Classic.cs


示例4: ManagedWindowButtonSize

		public override Size ManagedWindowButtonSize (InternalWindowManager wm)
		{
			int height = ManagedWindowTitleBarHeight (wm);
			if (!wm.IsMaximized && !wm.IsMinimized) {
				if (wm.IsToolWindow)
					return new Size (SystemInformation.ToolWindowCaptionButtonSize.Width - 2,
							height - 5);
				if (wm.Form.FormBorderStyle == FormBorderStyle.None)
					return Size.Empty;
			} else
				height = SystemInformation.CaptionHeight;

			return new Size (SystemInformation.CaptionButtonSize.Width - 2,
					height - 5);
		}
开发者ID:ngraziano,项目名称:mono,代码行数:15,代码来源:ThemeWin32Classic.cs


示例5: ManagedWindowTitleBarHeight

		public override int ManagedWindowTitleBarHeight (InternalWindowManager wm)
		{
			if (wm.IsToolWindow && !wm.IsMinimized)
				return SystemInformation.ToolWindowCaptionHeight;
			if (wm.Form.FormBorderStyle == FormBorderStyle.None)
				return 0;
			return SystemInformation.CaptionHeight;
		}
开发者ID:ngraziano,项目名称:mono,代码行数:8,代码来源:ThemeWin32Classic.cs


示例6: ManagedWindowIconWidth

		public override int ManagedWindowIconWidth (InternalWindowManager wm)
		{
			return ManagedWindowTitleBarHeight (wm) - 5;
		}
开发者ID:ngraziano,项目名称:mono,代码行数:4,代码来源:ThemeWin32Classic.cs


示例7: ManagedWindowButtonSize

		public override Size ManagedWindowButtonSize (InternalWindowManager wm)
		{
			if (!render_non_client_areas)
				return base.ManagedWindowButtonSize (wm);
			VisualStyleElement element = wm.IsToolWindow && !wm.IsMinimized ?
				VisualStyleElement.Window.SmallCloseButton.Normal :
				VisualStyleElement.Window.CloseButton.Normal;
			if (!VisualStyleRenderer.IsElementDefined (element))
				return base.ManagedWindowButtonSize (wm);
			IDeviceContext dc = GetMeasurementDeviceContext ();
			Size result = new VisualStyleRenderer (element).GetPartSize (dc, ThemeSizeType.True);
			ReleaseMeasurementDeviceContext (dc);
			return result;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:14,代码来源:ThemeVisualStyles.cs


示例8: ManagedWindowDrawMenuButton

		public override void ManagedWindowDrawMenuButton (Graphics dc, TitleButton button, Rectangle clip, InternalWindowManager wm)
		{
			if (!render_non_client_areas) {
				base.ManagedWindowDrawMenuButton (dc, button, clip, wm);
				return;
			}
			VisualStyleElement element = ManagedWindowGetMenuButtonVisualStyleElement (button, wm);
			if (!VisualStyleRenderer.IsElementDefined (element)) {
				base.ManagedWindowDrawMenuButton (dc, button, clip, wm);
				return;
			}
			new VisualStyleRenderer (element).DrawBackground (dc, button.Rectangle, clip);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:13,代码来源:ThemeVisualStyles.cs


示例9: ManagedWindowDrawMenuButton

		public abstract void ManagedWindowDrawMenuButton (Graphics dc, TitleButton button, Rectangle clip, InternalWindowManager wm);
开发者ID:Profit0004,项目名称:mono,代码行数:1,代码来源:Theme.cs


示例10: DrawManagedWindowDecorations

		public abstract void DrawManagedWindowDecorations (Graphics dc, Rectangle clip, InternalWindowManager wm);
开发者ID:Profit0004,项目名称:mono,代码行数:1,代码来源:Theme.cs


示例11: ManagedWindowGetMenuButtonSize

		public abstract Size ManagedWindowGetMenuButtonSize (InternalWindowManager wm);
开发者ID:Profit0004,项目名称:mono,代码行数:1,代码来源:Theme.cs


示例12: ManagedWindowGetTitleBarIconArea

		public abstract Rectangle ManagedWindowGetTitleBarIconArea (InternalWindowManager wm);
开发者ID:Profit0004,项目名称:mono,代码行数:1,代码来源:Theme.cs


示例13: ManagedWindowSetButtonLocations

		public abstract void ManagedWindowSetButtonLocations (InternalWindowManager wm);
开发者ID:Profit0004,项目名称:mono,代码行数:1,代码来源:Theme.cs


示例14: ManagedWindowGetBorderVisualStyleElements

		static void ManagedWindowGetBorderVisualStyleElements (InternalWindowManager wm, out VisualStyleElement left, out VisualStyleElement right, out VisualStyleElement bottom)
		{
			bool active = !ManagedWindowIsDisabled (wm) && ManagedWindowIsActive (wm);
			if (wm.IsToolWindow) {
				if (active) {
					left = VisualStyleElement.Window.SmallFrameLeft.Active;
					right = VisualStyleElement.Window.SmallFrameRight.Active;
					bottom = VisualStyleElement.Window.SmallFrameBottom.Active;
				} else {
					left = VisualStyleElement.Window.SmallFrameLeft.Inactive;
					right = VisualStyleElement.Window.SmallFrameRight.Inactive;
					bottom = VisualStyleElement.Window.SmallFrameBottom.Inactive;
				}
			} else {
				if (active) {
					left = VisualStyleElement.Window.FrameLeft.Active;
					right = VisualStyleElement.Window.FrameRight.Active;
					bottom = VisualStyleElement.Window.FrameBottom.Active;
				} else {
					left = VisualStyleElement.Window.FrameLeft.Inactive;
					right = VisualStyleElement.Window.FrameRight.Inactive;
					bottom = VisualStyleElement.Window.FrameBottom.Inactive;
				}
			}
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:25,代码来源:ThemeVisualStyles.cs


示例15: ManagedWindowGetMenuButtonVisualStyleElement

		static VisualStyleElement ManagedWindowGetMenuButtonVisualStyleElement (TitleButton button, InternalWindowManager wm)
		{
			switch (button.Caption) {
			case CaptionButton.Close:
				if (ManagedWindowTitleButtonIsDisabled (button, wm))
					return VisualStyleElement.Window.MdiCloseButton.Disabled;
				if (ManagedWindowTitleButtonIsPressed (button))
					return VisualStyleElement.Window.MdiCloseButton.Pressed;
				if (button.Entered)
					return VisualStyleElement.Window.MdiCloseButton.Hot;
				return VisualStyleElement.Window.MdiCloseButton.Normal;
			case CaptionButton.Help:
				if (ManagedWindowTitleButtonIsDisabled (button, wm))
					return VisualStyleElement.Window.MdiHelpButton.Disabled;
				if (ManagedWindowTitleButtonIsPressed (button))
					return VisualStyleElement.Window.MdiHelpButton.Pressed;
				if (button.Entered)
					return VisualStyleElement.Window.MdiHelpButton.Hot;
				return VisualStyleElement.Window.MdiHelpButton.Normal;
			case CaptionButton.Minimize:
				if (ManagedWindowTitleButtonIsDisabled (button, wm))
					return VisualStyleElement.Window.MdiMinButton.Disabled;
				if (ManagedWindowTitleButtonIsPressed (button))
					return VisualStyleElement.Window.MdiMinButton.Pressed;
				if (button.Entered)
					return VisualStyleElement.Window.MdiMinButton.Hot;
				return VisualStyleElement.Window.MdiMinButton.Normal;
			default:
				if (ManagedWindowTitleButtonIsDisabled (button, wm))
					return VisualStyleElement.Window.MdiRestoreButton.Disabled;
				if (ManagedWindowTitleButtonIsPressed (button))
					return VisualStyleElement.Window.MdiRestoreButton.Pressed;
				if (button.Entered)
					return VisualStyleElement.Window.MdiRestoreButton.Hot;
				return VisualStyleElement.Window.MdiRestoreButton.Normal;
			}
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:37,代码来源:ThemeVisualStyles.cs


示例16: ManagedWindowTitleButtonIsDisabled

		static bool ManagedWindowTitleButtonIsDisabled (TitleButton button, InternalWindowManager wm)
		{
			return (button.State & ButtonState.Inactive) == ButtonState.Inactive;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:4,代码来源:ThemeVisualStyles.cs


示例17: ManagedWindowGetTitleBarRectangle

		Rectangle ManagedWindowGetTitleBarRectangle (InternalWindowManager wm)
		{
			return new Rectangle (0, 0, wm.Form.Width, ManagedWindowTitleBarHeight (wm) + ManagedWindowBorderWidth (wm) * (wm.IsMinimized ? 2 : 1));
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:4,代码来源:ThemeVisualStyles.cs


示例18: ManagedWindowBorderWidth

		public override int ManagedWindowBorderWidth (InternalWindowManager wm)
		{
			if ((wm.IsToolWindow && wm.form.FormBorderStyle == FormBorderStyle.FixedToolWindow) ||
				wm.IsMinimized)
				return 3;
			else
				return 4;
		}
开发者ID:ngraziano,项目名称:mono,代码行数:8,代码来源:ThemeWin32Classic.cs


示例19: ManagedWindowDrawTitleBarAndBorders

		protected override Rectangle ManagedWindowDrawTitleBarAndBorders (Graphics dc, Rectangle clip, InternalWindowManager wm)
		{
			if (!render_non_client_areas)
				return base.ManagedWindowDrawTitleBarAndBorders (dc, clip, wm);
			VisualStyleElement title_bar_element = ManagedWindowGetTitleBarVisualStyleElement (wm);
			VisualStyleElement left_border_element;
			VisualStyleElement right_border_element;
			VisualStyleElement bottom_border_element;
			ManagedWindowGetBorderVisualStyleElements (wm, out left_border_element, out right_border_element, out bottom_border_element);
			if (!VisualStyleRenderer.IsElementDefined (title_bar_element) ||
				(!wm.IsMinimized && (
				!VisualStyleRenderer.IsElementDefined (left_border_element) ||
				!VisualStyleRenderer.IsElementDefined (right_border_element) ||
				!VisualStyleRenderer.IsElementDefined (bottom_border_element))))
				return base.ManagedWindowDrawTitleBarAndBorders (dc, clip, wm);
			VisualStyleRenderer renderer = new VisualStyleRenderer (title_bar_element);
			Rectangle title_bar_rectangle = ManagedWindowGetTitleBarRectangle (wm);
			renderer.DrawBackground (dc, title_bar_rectangle, clip);
			if (!wm.IsMinimized) {
				int border_width = ManagedWindowBorderWidth (wm);
				renderer.SetParameters (left_border_element);
				renderer.DrawBackground (dc, new Rectangle (
					0,
					title_bar_rectangle.Bottom,
					border_width,
					wm.Form.Height - title_bar_rectangle.Bottom
					), clip);
				renderer.SetParameters (right_border_element);
				renderer.DrawBackground (dc, new Rectangle (
					wm.Form.Width - border_width,
					title_bar_rectangle.Bottom,
					border_width,
					wm.Form.Height - title_bar_rectangle.Bottom
					), clip);
				renderer.SetParameters (bottom_border_element);
				renderer.DrawBackground (dc, new Rectangle (
					0,
					wm.Form.Height - border_width,
					wm.Form.Width,
					border_width
					), clip);
			}
			return title_bar_rectangle;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:44,代码来源:ThemeVisualStyles.cs


示例20: ManagedWindowSetButtonLocations

		public override void ManagedWindowSetButtonLocations (InternalWindowManager wm)
		{
			TitleButtons buttons = wm.TitleButtons;
			Form form = wm.form;
			
			buttons.HelpButton.Visible = form.HelpButton;
			
			foreach (TitleButton button in buttons) {
				button.Visible = false;
			}
			
			switch (form.FormBorderStyle) {
			case FormBorderStyle.None:
				if (form.WindowState != FormWindowState.Normal)
					goto case FormBorderStyle.Sizable;
				break;
			case FormBorderStyle.FixedToolWindow:
			case FormBorderStyle.SizableToolWindow:
				buttons.CloseButton.Visible = true;
				if (form.WindowState != FormWindowState.Normal)
					goto case FormBorderStyle.Sizable;
				break;
			case FormBorderStyle.FixedSingle:
			case FormBorderStyle.Fixed3D:
			case FormBorderStyle.FixedDialog:
			case FormBorderStyle.Sizable:
				switch (form.WindowState) {
					case FormWindowState.Normal:
						buttons.MinimizeButton.Visible = true;
						buttons.MaximizeButton.Visible = true;
						buttons.RestoreButton.Visible = false;
						break;
					case FormWindowState.Maximized:
						buttons.MinimizeButton.Visible = true;
						buttons.MaximizeButton.Visible = false;
						buttons.RestoreButton.Visible = true;
						break;
					case FormWindowState.Minimized:
						buttons.MinimizeButton.Visible = false;
						buttons.MaximizeButton.Visible = true;
						buttons.RestoreButton.Visible = true;
						break;
				}
				buttons.CloseButton.Visible = true;
				break;
			}

			// Respect MinimizeBox/MaximizeBox
			if (form.MinimizeBox == false && form.MaximizeBox == false) {
				buttons.MinimizeButton.Visible = false;
				buttons.MaximizeButton.Visible = false;
			} else if (form.MinimizeBox == false)
				buttons.MinimizeButton.State = ButtonState.Inactive;
			else if (form.MaximizeBox == false)
				buttons.MaximizeButton.State = ButtonState.Inactive;

			int bw = ManagedWindowBorderWidth (wm);
			Size btsize = ManagedWindowButtonSize (wm);
			int btw = btsize.Width;
			int bth = btsize.Height;
			int top = bw + 2;
			int left = form.Width - bw - btw - ManagedWindowSpacingAfterLastTitleButton;
			
			if ((!wm.IsToolWindow || wm.IsMinimized) && wm.HasBorders) {
				buttons.CloseButton.Rectangle = new Rectangle (left, top, btw, bth);
				left -= 2 + btw;
				
				if (buttons.MaximizeButton.Visible) {
					buttons.MaximizeButton.Rectangle = new Rectangle (left, top, btw, bth);
					left -= 2 + btw;
				} 
				if (buttons.RestoreButton.Visible) {
					buttons.RestoreButton.Rectangle = new Rectangle (left, top, btw, bth);
					left -= 2 + btw;
				}

				buttons.MinimizeButton.Rectangle = new Rectangle (left, top, btw, bth);
				left -= 2 + btw;
			} else if (wm.IsToolWindow) {
				buttons.CloseButton.Rectangle = new Rectangle (left, top, btw, bth);
				left -= 2 + btw;
			}
		}
开发者ID:ngraziano,项目名称:mono,代码行数:83,代码来源:ThemeWin32Classic.cs



注:本文中的System.Windows.Forms.InternalWindowManager类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.InvalidateEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Forms.InputLanguage类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap