1 /*******************************************************************************
2 * Copyright (c) 2000, 2019 IBM Corporation and others.
3 *
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
8 *
9 * SPDX-License-Identifier: EPL-2.0
10 *
11 * Contributors:
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.internal.cocoa;
15
16 public class NSPanel extends NSWindow {
17
NSPanel()18 public NSPanel() {
19 super();
20 }
21
NSPanel(long id)22 public NSPanel(long id) {
23 super(id);
24 }
25
NSPanel(id id)26 public NSPanel(id id) {
27 super(id);
28 }
29
setBecomesKeyOnlyIfNeeded(boolean becomesKeyOnlyIfNeeded)30 public void setBecomesKeyOnlyIfNeeded(boolean becomesKeyOnlyIfNeeded) {
31 OS.objc_msgSend(this.id, OS.sel_setBecomesKeyOnlyIfNeeded_, becomesKeyOnlyIfNeeded);
32 }
33
setFloatingPanel(boolean floatingPanel)34 public void setFloatingPanel(boolean floatingPanel) {
35 OS.objc_msgSend(this.id, OS.sel_setFloatingPanel_, floatingPanel);
36 }
37
setWorksWhenModal(boolean worksWhenModal)38 public void setWorksWhenModal(boolean worksWhenModal) {
39 OS.objc_msgSend(this.id, OS.sel_setWorksWhenModal_, worksWhenModal);
40 }
41
minFrameWidthWithTitle(NSString aTitle, long aStyle)42 public static double minFrameWidthWithTitle(NSString aTitle, long aStyle) {
43 return OS.objc_msgSend_fpret(OS.class_NSPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
44 }
45
windowNumberAtPoint(NSPoint point, long windowNumber)46 public static long windowNumberAtPoint(NSPoint point, long windowNumber) {
47 return OS.objc_msgSend(OS.class_NSPanel, OS.sel_windowNumberAtPoint_belowWindowWithWindowNumber_, point, windowNumber);
48 }
49
50 }
51