当前位置: 首页>>代码示例>>C#>>正文


C# CreateParams.IsSet方法代码示例

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


在下文中一共展示了CreateParams.IsSet方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TranslateXWindowSizeToWindowSize

		internal static Size TranslateXWindowSizeToWindowSize (CreateParams cp, int xWidth, int xHeight)
		{
			/* 
			 * If this is a form with no window manager, X is handling all the border and caption painting
			 * so remove that from the area (since the area we set of the window here is the part of the window 
			 * we're painting in only)
			 */
			Size rect = new Size (xWidth, xHeight);
			Form form = cp.control as Form;
			if (form != null && (form.window_manager == null && !cp.IsSet (WindowExStyles.WS_EX_TOOLWINDOW))) {
				Hwnd.Borders borders = Hwnd.GetBorders (cp, null);
				Size xrect = rect;

				xrect.Width += borders.left + borders.right;
				xrect.Height += borders.top + borders.bottom;

				rect = xrect;
			}
			return rect;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:20,代码来源:XplatUIX11.cs

示例2: TranslateWindowSizeToXWindowSize

		internal static Size TranslateWindowSizeToXWindowSize (CreateParams cp, Size size)
		{
			/* 
			 * If this is a form with no window manager, X is handling all the border and caption painting
			 * so remove that from the area (since the area we set of the window here is the part of the window 
			 * we're painting in only)
			 */
			Form form = cp.control as Form;
			if (form != null && (form.window_manager == null && !cp.IsSet (WindowExStyles.WS_EX_TOOLWINDOW))) {
				Hwnd.Borders borders = Hwnd.GetBorders (cp, null);
				Size xrect = size;

				xrect.Width -= borders.left + borders.right;
				xrect.Height -= borders.top + borders.bottom;

				size = xrect;
			}
			if (size.Height == 0)
				size.Height = 1;
			if (size.Width == 0)
				size.Width = 1;
			return size;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:23,代码来源:XplatUIX11.cs

示例3: SetWMStyles

		void SetWMStyles(Hwnd hwnd, CreateParams cp) {
			MotifWmHints		mwmHints;
			MotifFunctions		functions;
			MotifDecorations	decorations;
			int[]			atoms;
			int			atom_count;
			Rectangle		client_rect;
			Form			form;
			IntPtr			window_type;
			bool			hide_from_taskbar;
			IntPtr			transient_for_parent;
			
			// Windows we manage ourselves don't need WM window styles.
			if (cp.HasWindowManager && !cp.IsSet (WindowExStyles.WS_EX_TOOLWINDOW)) {
				return;
			}

			atoms = new int[8];
			mwmHints = new MotifWmHints();
			functions = 0;
			decorations = 0;
			window_type = _NET_WM_WINDOW_TYPE_NORMAL;
			transient_for_parent = IntPtr.Zero;

			mwmHints.flags = (IntPtr)(MotifFlags.Functions | MotifFlags.Decorations);
			mwmHints.functions = (IntPtr)0;
			mwmHints.decorations = (IntPtr)0;

			form = cp.control as Form;

			if (ExStyleSet (cp.ExStyle, WindowExStyles.WS_EX_TOOLWINDOW)) {
				/* tool windows get no window manager
				   decorations.
				*/

				/* just because the window doesn't get any decorations doesn't
				   mean we should disable the functions.  for instance, without
				   MotifFunctions.Maximize, changing the windowstate to Maximized
				   is ignored by metacity. */
				functions |= MotifFunctions.Move | MotifFunctions.Resize | MotifFunctions.Minimize | MotifFunctions.Maximize;
			} else if (form != null && form.FormBorderStyle == FormBorderStyle.None) {
				/* allow borderless window to be maximized */
				functions |= MotifFunctions.All | MotifFunctions.Resize;
			} else {
				if (StyleSet (cp.Style, WindowStyles.WS_CAPTION)) {
					functions |= MotifFunctions.Move;
					decorations |= MotifDecorations.Title | MotifDecorations.Menu;
				}

				if (StyleSet (cp.Style, WindowStyles.WS_THICKFRAME)) {
					functions |= MotifFunctions.Move | MotifFunctions.Resize;
					decorations |= MotifDecorations.Border | MotifDecorations.ResizeH;
				}

				if (StyleSet (cp.Style, WindowStyles.WS_MINIMIZEBOX)) {
					functions |= MotifFunctions.Minimize;
					decorations |= MotifDecorations.Minimize;
				}

				if (StyleSet (cp.Style, WindowStyles.WS_MAXIMIZEBOX)) {
					functions |= MotifFunctions.Maximize;
					decorations |= MotifDecorations.Maximize;
				}

				if (StyleSet (cp.Style, WindowStyles.WS_SIZEBOX)) {
					functions |= MotifFunctions.Resize;
					decorations |= MotifDecorations.ResizeH;
				}

				if (ExStyleSet (cp.ExStyle, WindowExStyles.WS_EX_DLGMODALFRAME)) {
					decorations |= MotifDecorations.Border;
				}

				if (StyleSet (cp.Style, WindowStyles.WS_BORDER)) {
					decorations |= MotifDecorations.Border;
				}
			
				if (StyleSet (cp.Style, WindowStyles.WS_DLGFRAME)) {
					decorations |= MotifDecorations.Border;
				}

				if (StyleSet (cp.Style, WindowStyles.WS_SYSMENU)) {
					functions |= MotifFunctions.Close;
				}
				else {
					functions &= ~(MotifFunctions.Maximize | MotifFunctions.Minimize | MotifFunctions.Close);
					decorations &= ~(MotifDecorations.Menu | MotifDecorations.Maximize | MotifDecorations.Minimize);
					if (cp.Caption == "") {
						functions &= ~MotifFunctions.Move;
						decorations &= ~(MotifDecorations.Title | MotifDecorations.ResizeH);
					}
				}
			}

			if ((functions & MotifFunctions.Resize) == 0) {
				hwnd.fixed_size = true;
				Rectangle fixed_rectangle = new Rectangle (cp.X, cp.Y, cp.Width, cp.Height);
				SetWindowMinMax(hwnd.Handle, fixed_rectangle, fixed_rectangle.Size, fixed_rectangle.Size, cp);
			} else {
				hwnd.fixed_size = false;
//.........这里部分代码省略.........
开发者ID:nlhepler,项目名称:mono,代码行数:101,代码来源:XplatUIX11.cs

示例4: TranslateQuartzWindowSizeToWindowSize

		internal static Size TranslateQuartzWindowSizeToWindowSize (CreateParams cp, int width, int height) {
			/* From XplatUIX11
			 * If this is a form with no window manager, X is handling all the border and caption painting
			 * so remove that from the area (since the area we set of the window here is the part of the window 
			 * we're painting in only)
			 */
			Size size = new Size (width, height);
			Form form = cp.control as Form;
			if (form != null && (form.window_manager == null || cp.IsSet (WindowExStyles.WS_EX_TOOLWINDOW))) {
				Hwnd.Borders borders = Hwnd.GetBorders (cp, null);
				Size qsize = size;

				qsize.Width += borders.left + borders.right;
				qsize.Height += borders.top + borders.bottom;
				
				size = qsize;
			}

			return size;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:20,代码来源:XplatUICarbon.cs

示例5: GetBorders

		public static Borders GetBorders (CreateParams cp, Menu menu)
		{

			Borders borders = new Borders ();

			if (menu != null) {
				int menu_height = menu.Rect.Height;
				if (menu_height == 0)
					menu_height = ThemeEngine.Current.CalcMenuBarSize (GraphicsContext, menu, cp.Width);
				borders.top += menu_height;
			}
			
			if (cp.IsSet (WindowStyles.WS_CAPTION)) {
				int caption_height;
				if (cp.IsSet (WindowExStyles.WS_EX_TOOLWINDOW)) {
					caption_height = ThemeEngine.Current.ToolWindowCaptionHeight;
				} else {
					caption_height = ThemeEngine.Current.CaptionHeight;
				}
				borders.top += caption_height;
			}

			Borders border_width = GetBorderWidth (cp);

			borders.left += border_width.left;
			borders.right += border_width.right;
			borders.top += border_width.top;
			borders.bottom += border_width.bottom;
			
			return borders;
		}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:31,代码来源:Hwnd.cs

示例6: GetBorderWidth

		public static Borders GetBorderWidth (CreateParams cp)
		{
			Borders border_size = new Borders ();

			Size windowborder = ThemeEngine.Current.BorderSize; /*new Size (1, 1);*/ // This is the only one that can be changed from the display properties in windows.
			Size border = ThemeEngine.Current.BorderStaticSize; /*new Size (1, 1);*/
			Size clientedge = ThemeEngine.Current.Border3DSize; /*new Size (2, 2);*/
			Size thickframe = new Size (2 + windowborder.Width, 2 + windowborder.Height);
			Size dialogframe = ThemeEngine.Current.BorderSizableSize; /* new Size (3, 3);*/
			
			if (cp.IsSet (WindowStyles.WS_CAPTION)) {
				border_size.Inflate (dialogframe);
			} else if (cp.IsSet (WindowStyles.WS_BORDER)) {
				if (cp.IsSet (WindowExStyles.WS_EX_DLGMODALFRAME)) {
					if (cp.IsSet (WindowStyles.WS_THICKFRAME) && (cp.IsSet (WindowExStyles.WS_EX_STATICEDGE) || cp.IsSet (WindowExStyles.WS_EX_CLIENTEDGE))) {
						border_size.Inflate (border);
					}
				} else {
					border_size.Inflate (border);
				}
			} else if (cp.IsSet (WindowStyles.WS_DLGFRAME)) {
				border_size.Inflate (dialogframe);
			}

			if (cp.IsSet (WindowStyles.WS_THICKFRAME)) {
				if (cp.IsSet (WindowStyles.WS_DLGFRAME)) {
					border_size.Inflate (border);
				} else {
					border_size.Inflate (thickframe);
				}
			}

			bool only_small_border;
			Size small_border = Size.Empty;

			only_small_border = cp.IsSet (WindowStyles.WS_THICKFRAME) || cp.IsSet (WindowStyles.WS_DLGFRAME);
			if (only_small_border && cp.IsSet (WindowStyles.WS_THICKFRAME) && !cp.IsSet (WindowStyles.WS_BORDER) && !cp.IsSet (WindowStyles.WS_DLGFRAME)) {
				small_border = border;
			}

			if (cp.IsSet (WindowExStyles.WS_EX_CLIENTEDGE | WindowExStyles.WS_EX_DLGMODALFRAME)) {
				border_size.Inflate (clientedge + (only_small_border ? small_border : dialogframe));
			} else if (cp.IsSet (WindowExStyles.WS_EX_STATICEDGE | WindowExStyles.WS_EX_DLGMODALFRAME)) {
				border_size.Inflate (only_small_border ? small_border : dialogframe);
			} else if (cp.IsSet (WindowExStyles.WS_EX_STATICEDGE | WindowExStyles.WS_EX_CLIENTEDGE)) {
				border_size.Inflate (border + (only_small_border ? Size.Empty : clientedge));
			} else {
				if (cp.IsSet (WindowExStyles.WS_EX_CLIENTEDGE)) {
					border_size.Inflate (clientedge);
				}
				if (cp.IsSet (WindowExStyles.WS_EX_DLGMODALFRAME) && !cp.IsSet (WindowStyles.WS_DLGFRAME)) {
					border_size.Inflate (cp.IsSet (WindowStyles.WS_THICKFRAME) ? border : dialogframe);
				}
				if (cp.IsSet (WindowExStyles.WS_EX_STATICEDGE)) {
					if (cp.IsSet (WindowStyles.WS_THICKFRAME) || cp.IsSet (WindowStyles.WS_DLGFRAME)) {
						border_size.Inflate (new Size (-border.Width, -border.Height));
					} else {
						border_size.Inflate (border);
					}
				}
			}
			
			return border_size;
		}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:64,代码来源:Hwnd.cs


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