HIViewGetBounds (handle, ref bounds);
}
- Driver.AddExpose (hwnd, client, bounds, false);
-
if (!hwnd.visible) {
if (client) {
hwnd.expose_pending = false;
return false;
}
- if (client) {
- if (!hwnd.expose_pending) {
- return false;
- }
- msg.message = Msg.WM_PAINT;
- } else {
- if (!hwnd.nc_expose_pending) {
- return false;
- }
- //DrawBackground here
+ if (!client) {
DrawBorders (hwnd);
- Region region = new Region (hwnd.Invalid);
- IntPtr hrgn = region.GetHrgn (null); // Graphics object isn't needed
- msg.message = Msg.WM_NCPAINT;
- msg.wParam = hrgn == IntPtr.Zero ? (IntPtr)1 : hrgn;
- msg.refobject = region;
-
}
+
+ Driver.AddExpose (hwnd, client, bounds);
+
return true;
}
case kEventControlVisibilityChanged: {
return false;
}
- private void DrawBackground (Hwnd hwnd, IntPtr eventref, HIRect bounds) {
- if (XplatUICarbon.WindowBackgrounds [hwnd] != null) {
- IntPtr context = IntPtr.Zero;
- Color color = (Color) XplatUICarbon.WindowBackgrounds [hwnd];
-
- GetEventParameter (eventref, kEventParamCGContextRef, typeCGContextRef, IntPtr.Zero, (uint) Marshal.SizeOf (typeof (IntPtr)), IntPtr.Zero, ref context);
-
- CGContextSetRGBFillColor (context, (float) color.R / 255, (float) color.G / 255, (float) color.B / 255, (float) color.A / 255);
- CGContextFillRect (context, bounds);
- }
- }
-
private void DrawBorders (Hwnd hwnd) {
switch (hwnd.border_style) {
case FormBorderStyle.Fixed3D: {
static extern int HIViewGetFrame (IntPtr handle, ref HIRect rect);
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
extern static bool HIViewIsVisible (IntPtr vHnd);
-
- [DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
- static extern int CGContextSetRGBFillColor (IntPtr cgContext, float r, float g, float b, float alpha);
- [DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
- static extern int CGContextFillRect (IntPtr context, HIRect rect);
}
}