Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,10 @@
<enum name='NSBelowTop' value='3'/>
<enum name='NSBevelLineJoinStyle' value='2'/>
<enum name='NSBezelBorder' value='2'/>
<enum name='NSBezelStyleFlexiblePush' value='2'/>
<enum name='NSBezelStylePush' value='1'/>
<enum name='NSBezelStylePushDisclosure' value='14'/>
<enum name='NSBezelStyleSmallSquare' value='6'/>
<enum name='NSBlueControlTint' value='1'/>
<enum name='NSBoldFontMask' value='2'/>
<enum name='NSBorderlessWindowMask' value='0'/>
Expand All @@ -1325,6 +1329,10 @@
<enum name='NSBrowserNoColumnResizing' value='0'/>
<enum name='NSBrowserUserColumnResizing' value='2'/>
<enum name='NSButtLineCapStyle' value='0'/>
<enum name='NSButtonTypeMomentaryLight' value='0'/>
<enum name='NSButtonTypePushOnPushOff' value='1'/>
<enum name='NSButtonTypeRadio' value='4'/>
<enum name='NSButtonTypeSwitch' value='3'/>
<enum name='NSCMYKColorSpaceModel' value='2'/>
<enum name='NSCMYKModeColorPanel' value='2'/>
<enum name='NSCancelButton' value='0'/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4372,12 +4372,20 @@
<enum name="NSBackspaceCharacter" swt_gen="true"></enum>
<enum name="NSBevelLineJoinStyle" swt_gen="true"></enum>
<enum name="NSBezelBorder" swt_gen="true"></enum>
<enum name="NSBezelStyleFlexiblePush" swt_gen="true"></enum>
<enum name="NSBezelStylePush" swt_gen="true"></enum>
<enum name="NSBezelStylePushDisclosure" swt_gen="true"></enum>
<enum name="NSBezelStyleSmallSquare" swt_gen="true"></enum>
<enum name="NSBoldFontMask" swt_gen="true"></enum>
<enum name="NSBorderlessWindowMask" swt_gen="true"></enum>
<enum name="NSBottomTabsBezelBorder" swt_gen="true"></enum>
<enum name="NSBoxCustom" swt_gen="true"></enum>
<enum name="NSBoxSeparator" swt_gen="true"></enum>
<enum name="NSButtLineCapStyle" swt_gen="true"></enum>
<enum name="NSButtonTypeMomentaryLight" swt_gen="true"></enum>
<enum name="NSButtonTypePushOnPushOff" swt_gen="true"></enum>
<enum name="NSButtonTypeRadio" swt_gen="true"></enum>
<enum name="NSButtonTypeSwitch" swt_gen="true"></enum>
<enum name="NSCancelButton" swt_gen="true"></enum>
<enum name="NSCarriageReturnCharacter" swt_gen="true"></enum>
<enum name="NSClockAndCalendarDatePickerStyle" swt_gen="true"></enum>
Expand Down Expand Up @@ -4454,7 +4462,6 @@
<enum name="NSMiniaturizableWindowMask" swt_gen="true"></enum>
<enum name="NSMiterLineJoinStyle" swt_gen="true"></enum>
<enum name="NSMixedState" swt_gen="true"></enum>
<enum name="NSMomentaryLightButton" swt_gen="true"></enum>
<enum name="NSMouseEntered" swt_gen="true"></enum>
<enum name="NSMouseExited" swt_gen="true"></enum>
<enum name="NSMouseMoved" swt_gen="true"></enum>
Expand Down Expand Up @@ -4486,19 +4493,14 @@
<enum name="NSPrintPanelShowsPageSetupAccessory" swt_gen="true"></enum>
<enum name="NSPrintPanelShowsPrintSelection" swt_gen="true"></enum>
<enum name="NSProgressIndicatorPreferredThickness" swt_gen="true"></enum>
<enum name="NSPushOnPushOffButton" swt_gen="true"></enum>
<enum name="NSRGBColorSpaceModel" swt_gen="true"></enum>
<enum name="NSRadioButton" swt_gen="true"></enum>
<enum name="NSRegularControlSize" swt_gen="true"></enum>
<enum name="NSRegularSquareBezelStyle" swt_gen="true"></enum>
<enum name="NSResizableWindowMask" swt_gen="true"></enum>
<enum name="NSRightMouseDown" swt_gen="true"></enum>
<enum name="NSRightMouseDragged" swt_gen="true"></enum>
<enum name="NSRightMouseUp" swt_gen="true"></enum>
<enum name="NSRoundLineCapStyle" swt_gen="true"></enum>
<enum name="NSRoundLineJoinStyle" swt_gen="true"></enum>
<enum name="NSRoundedBezelStyle" swt_gen="true"></enum>
<enum name="NSRoundedDisclosureBezelStyle" swt_gen="true"></enum>
<enum name="NSScaleNone" swt_gen="true"></enum>
<enum name="NSScrollElasticityNone" swt_gen="true"></enum>
<enum name="NSScrollWheel" swt_gen="true"></enum>
Expand All @@ -4510,14 +4512,12 @@
<enum name="NSScrollerKnobSlot" swt_gen="true"></enum>
<enum name="NSScrollerStyleLegacy" swt_gen="true"></enum>
<enum name="NSScrollerStyleOverlay" swt_gen="true"></enum>
<enum name="NSShadowlessSquareBezelStyle" swt_gen="true"></enum>
<enum name="NSShiftKeyMask" swt_gen="true"></enum>
<enum name="NSSmallControlSize" swt_gen="true"></enum>
<enum name="NSSquareLineCapStyle" swt_gen="true"></enum>
<enum name="NSStatusWindowLevel" swt_gen="true"></enum>
<enum name="NSStringDrawingUsesLineFragmentOrigin" swt_gen="true"></enum>
<enum name="NSSubmenuWindowLevel" swt_gen="true"></enum>
<enum name="NSSwitchButton" swt_gen="true"></enum>
<enum name="NSSystemDefined" swt_gen="true"></enum>
<enum name="NSTabCharacter" swt_gen="true"></enum>
<enum name="NSTableColumnNoResizing" swt_gen="true"></enum>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2179,12 +2179,20 @@ public static Selector getSelector (long value) {
public static final int NSBackspaceCharacter = 8;
public static final int NSBevelLineJoinStyle = 2;
public static final int NSBezelBorder = 2;
public static final int NSBezelStyleFlexiblePush = 2;
public static final int NSBezelStylePush = 1;
public static final int NSBezelStylePushDisclosure = 14;
public static final int NSBezelStyleSmallSquare = 6;
public static final int NSBoldFontMask = 2;
public static final int NSBorderlessWindowMask = 0;
public static final int NSBottomTabsBezelBorder = 2;
public static final int NSBoxCustom = 4;
public static final int NSBoxSeparator = 2;
public static final int NSButtLineCapStyle = 0;
public static final int NSButtonTypeMomentaryLight = 0;
public static final int NSButtonTypePushOnPushOff = 1;
public static final int NSButtonTypeRadio = 4;
public static final int NSButtonTypeSwitch = 3;
public static final int NSCancelButton = 0;
public static final int NSCarriageReturnCharacter = 13;
public static final int NSClockAndCalendarDatePickerStyle = 1;
Expand Down Expand Up @@ -2262,7 +2270,6 @@ public static Selector getSelector (long value) {
public static final int NSMiniaturizableWindowMask = 4;
public static final int NSMiterLineJoinStyle = 0;
public static final int NSMixedState = -1;
public static final int NSMomentaryLightButton = 0;
public static final int NSMouseEntered = 8;
public static final int NSMouseExited = 9;
public static final int NSMouseMoved = 5;
Expand Down Expand Up @@ -2294,19 +2301,14 @@ public static Selector getSelector (long value) {
public static final int NSPrintPanelShowsPageSetupAccessory = 256;
public static final int NSPrintPanelShowsPrintSelection = 32;
public static final int NSProgressIndicatorPreferredThickness = 14;
public static final int NSPushOnPushOffButton = 1;
public static final int NSRGBColorSpaceModel = 1;
public static final int NSRadioButton = 4;
public static final int NSRegularControlSize = 0;
public static final int NSRegularSquareBezelStyle = 2;
public static final int NSResizableWindowMask = 8;
public static final int NSRightMouseDown = 3;
public static final int NSRightMouseDragged = 7;
public static final int NSRightMouseUp = 4;
public static final int NSRoundLineCapStyle = 1;
public static final int NSRoundLineJoinStyle = 1;
public static final int NSRoundedBezelStyle = 1;
public static final int NSRoundedDisclosureBezelStyle = 14;
public static final int NSScaleNone = 2;
public static final int NSScrollElasticityNone = 1;
public static final int NSScrollWheel = 22;
Expand All @@ -2318,14 +2320,12 @@ public static Selector getSelector (long value) {
public static final int NSScrollerKnobSlot = 6;
public static final int NSScrollerStyleLegacy = 0;
public static final int NSScrollerStyleOverlay = 1;
public static final int NSShadowlessSquareBezelStyle = 6;
public static final int NSShiftKeyMask = 131072;
public static final int NSSmallControlSize = 1;
public static final int NSSquareLineCapStyle = 2;
public static final int NSStatusWindowLevel = 25;
public static final int NSStringDrawingUsesLineFragmentOrigin = 1;
public static final int NSSubmenuWindowLevel = 3;
public static final int NSSwitchButton = 3;
public static final int NSSystemDefined = 14;
public static final int NSTabCharacter = 9;
public static final int NSTableColumnNoResizing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,27 +250,27 @@ void createHandle () {
superview = superview.superview();
}
}
int type = OS.NSMomentaryLightButton;
int type = OS.NSButtonTypeMomentaryLight;
if ((style & SWT.PUSH) != 0) {
if ((style & SWT.FLAT) != 0) {
widget.setBezelStyle(OS.NSShadowlessSquareBezelStyle);
widget.setBezelStyle(OS.NSBezelStyleSmallSquare);
} else {
widget.setBezelStyle((style & SWT.WRAP) != 0 ? OS.NSRegularSquareBezelStyle : OS.NSRoundedBezelStyle);
widget.setBezelStyle((style & SWT.WRAP) != 0 ? OS.NSBezelStyleFlexiblePush : OS.NSBezelStylePush);
}
} else if ((style & SWT.CHECK) != 0) {
type = OS.NSSwitchButton;
type = OS.NSButtonTypeSwitch;
} else if ((style & SWT.RADIO) != 0) {
type = OS.NSRadioButton;
type = OS.NSButtonTypeRadio;
radioParent = (SWTView) new SWTView().alloc().init();
} else if ((style & SWT.TOGGLE) != 0) {
type = OS.NSPushOnPushOffButton;
type = OS.NSButtonTypePushOnPushOff;
if ((style & SWT.FLAT) != 0) {
widget.setBezelStyle(OS.NSShadowlessSquareBezelStyle);
widget.setBezelStyle(OS.NSBezelStyleSmallSquare);
} else {
widget.setBezelStyle((style & SWT.WRAP) != 0 ? OS.NSRegularSquareBezelStyle : OS.NSRoundedBezelStyle);
widget.setBezelStyle((style & SWT.WRAP) != 0 ? OS.NSBezelStyleFlexiblePush : OS.NSBezelStylePush);
}
} else if ((style & SWT.ARROW) != 0) {
widget.setBezelStyle(OS.NSShadowlessSquareBezelStyle);
widget.setBezelStyle(OS.NSBezelStyleSmallSquare);
}
widget.setButtonType(type);
widget.setTitle(NSString.string());
Expand Down Expand Up @@ -363,10 +363,10 @@ void drawBezelWithFrame_inView (long id, long sel, NSRect cellFrame, long viewid
lineWidth = 1f;
}
final long bezelStyle = button.bezelStyle();
if (bezelStyle == OS.NSRoundedBezelStyle) {
if (bezelStyle == OS.NSBezelStylePush) {
NSRect rect2 = smallerRect(cellFrame, 6.5f, 4.5f, 7.5f, lineWidth);
path = NSBezierPath.bezierPathWithRoundedRect(rect2, 3, 3);
} else if (bezelStyle == OS.NSRegularSquareBezelStyle) {
} else if (bezelStyle == OS.NSBezelStyleFlexiblePush) {
NSRect rect2 = smallerRect(cellFrame, 2.5f, 2.5f, 3.5f, lineWidth);
path = NSBezierPath.bezierPathWithRoundedRect(rect2, 3, 3);
} else {
Expand Down Expand Up @@ -830,9 +830,9 @@ void setBounds (int x, int y, int width, int height, boolean move, boolean resiz

NSButton button = (NSButton)view;
if (height > heightThreshold) {
button.setBezelStyle(OS.NSRegularSquareBezelStyle);
button.setBezelStyle(OS.NSBezelStyleFlexiblePush);
} else {
button.setBezelStyle(OS.NSRoundedBezelStyle);
button.setBezelStyle(OS.NSBezelStylePush);
}
}
super.setBounds(x, y, width, height, move, resize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ void createHandle () {
if ((this.style & SWT.DROP_DOWN) != 0) {
NSButton buttonWidget = (NSButton)new SWTButton().alloc();
buttonWidget.init();
buttonWidget.setButtonType(OS.NSMomentaryLightButton);
buttonWidget.setBezelStyle(OS.NSRoundedDisclosureBezelStyle);
buttonWidget.setButtonType(OS.NSButtonTypeMomentaryLight);
buttonWidget.setBezelStyle(OS.NSBezelStylePushDisclosure);
buttonWidget.setFocusRingType(OS.NSFocusRingTypeNone);
buttonWidget.setTitle(NSString.stringWith(""));
buttonWidget.setImagePosition(OS.NSNoImage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ void createHandle () {
buttonCell = new NSButtonCell (OS.class_createInstance (cls, 0));
buttonCell.init ();
checkColumn.setDataCell (buttonCell);
buttonCell.setButtonType (OS.NSSwitchButton);
buttonCell.setButtonType (OS.NSButtonTypeSwitch);
buttonCell.setControlSize(OS.NSSmallControlSize);
buttonCell.setImagePosition (OS.NSImageOnly);
buttonCell.setAllowsMixedState (true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ void createHandle () {
buttonCell = new NSButtonCell (OS.class_createInstance (cls, 0));
buttonCell.init ();
checkColumn.setDataCell (buttonCell);
buttonCell.setButtonType (OS.NSSwitchButton);
buttonCell.setButtonType (OS.NSButtonTypeSwitch);
buttonCell.setControlSize (OS.NSSmallControlSize);
buttonCell.setImagePosition (OS.NSImageOnly);
buttonCell.setAllowsMixedState (true);
Expand Down
Loading