private void SetCarbonWindowState() { CarbonPoint idealSize; switch (windowState) { case WindowState.Fullscreen: window.GoFullScreenHack = true; break; case WindowState.Maximized: // hack because mac os has no concept of maximized. Instead windows are "zoomed" // meaning they are maximized up to their reported ideal size. So we report a // large ideal size. idealSize = new CarbonPoint(9000, 9000); API.ZoomWindowIdeal(window.WindowRef, WindowPartCode.inZoomOut, ref idealSize); break; case WindowState.Normal: if (WindowState == WindowState.Maximized) { idealSize = new CarbonPoint(); API.ZoomWindowIdeal(window.WindowRef, WindowPartCode.inZoomIn, ref idealSize); } break; case WindowState.Minimized: API.CollapseWindow(window.WindowRef, true); break; } OnWindowStateChanged(); OnResize(); }
private void SetCarbonWindowState() { switch (this.windowState) { case WindowState.Normal: if (this.WindowState == WindowState.Maximized) { CarbonPoint toIdealSize = new CarbonPoint(); API.ZoomWindowIdeal(this.window.WindowRef, WindowPartCode.inZoomIn, ref toIdealSize); break; } else { break; } case WindowState.Minimized: API.CollapseWindow(this.window.WindowRef, true); break; case WindowState.Maximized: CarbonPoint toIdealSize1 = new CarbonPoint(9000, 9000); API.ZoomWindowIdeal(this.window.WindowRef, WindowPartCode.inZoomOut, ref toIdealSize1); break; case WindowState.Fullscreen: this.window.GoFullScreenHack = true; break; } this.WindowStateChanged((object)this, EventArgs.Empty); this.LoadSize(); this.Resize((object)this, EventArgs.Empty); }
void SetCarbonWindowState() { CarbonPoint idealSize; OSStatus result; switch (windowState) { case WindowState.Fullscreen: goFullScreenHack = true; break; case WindowState.Maximized: // hack because mac os has no concept of maximized. Instead windows are "zoomed" // meaning they are maximized up to their reported ideal size. So we report a // large ideal size. idealSize = new CarbonPoint(9000, 9000); result = API.ZoomWindowIdeal(WinHandle, (short)WindowPartCode.inZoomOut, ref idealSize); API.CheckReturn(result); break; case WindowState.Normal: if (WindowState == WindowState.Maximized) { idealSize = new CarbonPoint(); result = API.ZoomWindowIdeal(WinHandle, (short)WindowPartCode.inZoomIn, ref idealSize); API.CheckReturn(result); } break; case WindowState.Minimized: result = API.CollapseWindow(WinHandle, true); API.CheckReturn(result); break; } RaiseWindowStateChanged(); OnResize(); }
public static extern OSStatus ZoomWindowIdeal(IntPtr windowRef, short inPartCode, ref CarbonPoint toIdealSize);