System.Windows.Forms.XplatUICarbon.TranslateQuartzWindowSizeToWindowSize C# (CSharp) Method

TranslateQuartzWindowSizeToWindowSize() static private method

static private TranslateQuartzWindowSizeToWindowSize ( CreateParams cp, int width, int height ) : Size
cp CreateParams
width int
height int
return System.Drawing.Size
		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;
		}
		#endregion
XplatUICarbon