|
Lines 39-44
Link Here
|
| 39 |
public class ToolItem extends Item { |
39 |
public class ToolItem extends Item { |
| 40 |
NSView view; |
40 |
NSView view; |
| 41 |
NSButton button; |
41 |
NSButton button; |
|
|
42 |
NSToolbarItem nsItem; |
| 43 |
NSString id; |
| 42 |
int width = DEFAULT_SEPARATOR_WIDTH; |
44 |
int width = DEFAULT_SEPARATOR_WIDTH; |
| 43 |
ToolBar parent; |
45 |
ToolBar parent; |
| 44 |
Image hotImage, disabledImage; |
46 |
Image hotImage, disabledImage; |
|
Lines 49-54
Link Here
|
| 49 |
static final int DEFAULT_WIDTH = 24; |
51 |
static final int DEFAULT_WIDTH = 24; |
| 50 |
static final int DEFAULT_HEIGHT = 22; |
52 |
static final int DEFAULT_HEIGHT = 22; |
| 51 |
static final int DEFAULT_SEPARATOR_WIDTH = 6; |
53 |
static final int DEFAULT_SEPARATOR_WIDTH = 6; |
|
|
54 |
|
| 55 |
static final int UNIFIED_SMALL_SIZE = 36; |
| 56 |
static final int UNIFIED_SMALL_IMAGE_SIZE = 24; |
| 57 |
static final int UNIFIED_SMALL_DROPDOWN_WIDTH = 48; |
| 58 |
|
| 59 |
static final int UNIFIED_REGULAR_SIZE = 44; |
| 60 |
static final int UNIFIED_REGULAR_IMAGE_SIZE = 32; |
| 61 |
static final int UNIFIED_REGULAR_DROPDOWN_WIDTH = 54; |
| 52 |
/* |
62 |
/* |
| 53 |
* An inset of 5, instead of 3, makes for less cramped toolbars and balances |
63 |
* An inset of 5, instead of 3, makes for less cramped toolbars and balances |
| 54 |
* well with the height imposed by the search control, if such is hosted in |
64 |
* well with the height imposed by the search control, if such is hosted in |
|
Lines 232-239
Link Here
|
| 232 |
} |
242 |
} |
| 233 |
} else { |
243 |
} else { |
| 234 |
if (text.length () != 0 || image != null) { |
244 |
if (text.length () != 0 || image != null) { |
| 235 |
NSButton widget = (NSButton)button; |
245 |
NSSize size = new NSSize(); |
| 236 |
NSSize size = widget.cell().cellSize(); |
246 |
if (nsItem == null) { |
|
|
247 |
NSButton widget = (NSButton)button; |
| 248 |
size = widget.cell().cellSize(); |
| 249 |
} else { |
| 250 |
size.width = DEFAULT_WIDTH; |
| 251 |
size.height = DEFAULT_HEIGHT; |
| 252 |
} |
| 237 |
width = (int)Math.ceil(size.width); |
253 |
width = (int)Math.ceil(size.width); |
| 238 |
height = (int)Math.ceil(size.height); |
254 |
height = (int)Math.ceil(size.height); |
| 239 |
} else { |
255 |
} else { |
|
Lines 249-285
Link Here
|
| 249 |
return new Point (width, height); |
265 |
return new Point (width, height); |
| 250 |
} |
266 |
} |
| 251 |
|
267 |
|
|
|
268 |
void createDropdown () { |
| 269 |
if ((parent.toolbar != null) && (style & SWT.DROP_DOWN) != 0) { |
| 270 |
final Combo combo = new Combo(parent, SWT.READ_ONLY | SWT.SMOOTH); |
| 271 |
if (parent.toolbar.sizeMode() == NSToolbar.NSToolbarSizeModeSmall) { |
| 272 |
setWidth(UNIFIED_SMALL_DROPDOWN_WIDTH); |
| 273 |
} else { |
| 274 |
setWidth(UNIFIED_REGULAR_DROPDOWN_WIDTH); |
| 275 |
} |
| 276 |
setControl(combo); |
| 277 |
combo.setToolItem(this); |
| 278 |
} |
| 279 |
} |
| 252 |
void createHandle () { |
280 |
void createHandle () { |
| 253 |
if ((style & SWT.SEPARATOR) != 0) { |
281 |
if (parent.isUnified()) { |
| 254 |
NSBox widget = (NSBox)new SWTBox().alloc(); |
282 |
id = NSString.stringWith(String.valueOf(++ToolBar.NEXT_ID)); |
| 255 |
widget.init(); |
283 |
id.retain(); |
| 256 |
widget.setBoxType(OS.NSBoxSeparator); |
284 |
nsItem = ((NSToolbarItem)new NSToolbarItem().alloc()).initWithItemIdentifier(id); |
| 257 |
widget.setBorderWidth(0); |
285 |
nsItem.setTarget(parent.toolbar); |
| 258 |
view = widget; |
286 |
nsItem.setAction(OS.sel_sendSelection_); |
| 259 |
} else { |
287 |
} else { |
| 260 |
NSView widget = (NSView)new SWTView().alloc(); |
288 |
if ((style & SWT.SEPARATOR) != 0) { |
| 261 |
widget.init(); |
289 |
NSBox widget = (NSBox)new SWTBox().alloc(); |
| 262 |
button = (NSButton)new SWTButton().alloc(); |
290 |
widget.init(); |
| 263 |
button.init(); |
291 |
widget.setBoxType(OS.NSBoxSeparator); |
| 264 |
/* |
292 |
widget.setBorderWidth(0); |
| 265 |
* Feature in Cocoa. NSButtons without borders do not leave any margin |
293 |
view = widget; |
| 266 |
* between their edge and their image. The workaround is to provide a |
294 |
} else { |
| 267 |
* custom cell that displays the image in a better position. |
295 |
NSView widget = (NSView)new SWTView().alloc(); |
| 268 |
*/ |
296 |
widget.init(); |
| 269 |
NSButtonCell cell = (NSButtonCell)new SWTButtonCell ().alloc ().init (); |
297 |
button = (NSButton)new SWTButton().alloc(); |
| 270 |
button.setCell (cell); |
298 |
button.init(); |
| 271 |
cell.release(); |
299 |
/* |
| 272 |
button.setBordered(false); |
300 |
* Feature in Cocoa. NSButtons without borders do not leave any margin |
| 273 |
button.setAction(OS.sel_sendSelection); |
301 |
* between their edge and their image. The workaround is to provide a |
| 274 |
button.setTarget(button); |
302 |
* custom cell that displays the image in a better position. |
| 275 |
Font font = parent.font != null ? parent.font : parent.defaultFont (); |
303 |
*/ |
| 276 |
button.setFont(font.handle); |
304 |
NSButtonCell cell = (NSButtonCell)new SWTButtonCell ().alloc ().init (); |
| 277 |
button.setImagePosition(OS.NSImageOverlaps); |
305 |
button.setCell (cell); |
| 278 |
NSString emptyStr = NSString.stringWith(""); |
306 |
button.setBordered(false); |
| 279 |
button.setTitle(emptyStr); |
307 |
button.setAction(OS.sel_sendSelection); |
| 280 |
button.setEnabled(parent.getEnabled()); |
308 |
button.setTarget(button); |
| 281 |
widget.addSubview(button); |
309 |
Font font = parent.font != null ? parent.font : parent.defaultFont (); |
| 282 |
view = widget; |
310 |
button.setFont(font.handle); |
|
|
311 |
button.setImagePosition(OS.NSImageOverlaps); |
| 312 |
button.setTitle(NSString.stringWith("")); |
| 313 |
button.setEnabled(parent.getEnabled()); |
| 314 |
widget.addSubview(button); |
| 315 |
view = widget; |
| 316 |
} |
| 283 |
} |
317 |
} |
| 284 |
} |
318 |
} |
| 285 |
|
319 |
|
|
Lines 354-361
Link Here
|
| 354 |
} |
388 |
} |
| 355 |
|
389 |
|
| 356 |
void enableWidget(boolean enabled) { |
390 |
void enableWidget(boolean enabled) { |
| 357 |
if ((style & SWT.SEPARATOR) == 0) { |
391 |
if (parent.isUnified()) { |
| 358 |
((NSButton)button).setEnabled(enabled); |
392 |
nsItem.setEnabled(enabled); |
|
|
393 |
} else { |
| 394 |
if ((style & SWT.SEPARATOR) == 0) { |
| 395 |
((NSButton)button).setEnabled(enabled); |
| 396 |
} |
| 359 |
} |
397 |
} |
| 360 |
} |
398 |
} |
| 361 |
|
399 |
|
|
Lines 372-379
Link Here
|
| 372 |
*/ |
410 |
*/ |
| 373 |
public Rectangle getBounds () { |
411 |
public Rectangle getBounds () { |
| 374 |
checkWidget(); |
412 |
checkWidget(); |
| 375 |
NSRect rect = view.frame(); |
413 |
if (parent.isUnified()) { |
| 376 |
return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height); |
414 |
if ((style & SWT.DROP_DOWN) != 0) { |
|
|
415 |
NSRect rect = control.topView().frame(); |
| 416 |
/* |
| 417 |
* Convert the toolitem rect from toolitem-relative coordinates to its |
| 418 |
* parent, the toolbar, relative coordinates. |
| 419 |
*/ |
| 420 |
Point position = getDisplay().map(control, parent, (int)rect.x, (int)rect.y); |
| 421 |
return new Rectangle((int)position.x, (int)rect.y, (int)rect.width, (int)rect.height); |
| 422 |
} else { |
| 423 |
if (parent.toolbar.sizeMode() == NSToolbar.NSToolbarSizeModeSmall) { |
| 424 |
return new Rectangle(0, 0, UNIFIED_SMALL_SIZE, UNIFIED_SMALL_SIZE); |
| 425 |
} else { |
| 426 |
return new Rectangle(0, 0, UNIFIED_REGULAR_SIZE, UNIFIED_REGULAR_SIZE); |
| 427 |
} |
| 428 |
} |
| 429 |
} else { |
| 430 |
NSRect rect = view.frame(); |
| 431 |
return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height); |
| 432 |
} |
| 377 |
} |
433 |
} |
| 378 |
|
434 |
|
| 379 |
void setClipRegion (float /*double*/ x, float /*double*/ y) { |
435 |
void setClipRegion (float /*double*/ x, float /*double*/ y) { |
|
Lines 656-667
Link Here
|
| 656 |
if (view != null) view.release (); |
712 |
if (view != null) view.release (); |
| 657 |
if (button != null) button.release (); |
713 |
if (button != null) button.release (); |
| 658 |
view = button = null; |
714 |
view = button = null; |
|
|
715 |
if (nsItem != null) { |
| 716 |
nsItem.release(); |
| 717 |
nsItem = null; |
| 718 |
} |
| 719 |
if (id != null) { |
| 720 |
id.release(); |
| 721 |
id = null; |
| 722 |
} |
| 659 |
parent = null; |
723 |
parent = null; |
| 660 |
} |
724 |
} |
| 661 |
|
725 |
|
| 662 |
void releaseWidget () { |
726 |
void releaseWidget () { |
| 663 |
super.releaseWidget (); |
727 |
super.releaseWidget (); |
| 664 |
control = null; |
728 |
if (control != null) { |
|
|
729 |
control.dispose(); |
| 730 |
control = null; |
| 731 |
} |
| 665 |
toolTipText = null; |
732 |
toolTipText = null; |
| 666 |
image = disabledImage = hotImage = null; |
733 |
image = disabledImage = hotImage = null; |
| 667 |
} |
734 |
} |
|
Lines 688-693
Link Here
|
| 688 |
} |
755 |
} |
| 689 |
|
756 |
|
| 690 |
void setBounds (int x, int y, int width, int height) { |
757 |
void setBounds (int x, int y, int width, int height) { |
|
|
758 |
if (view == null) return; |
| 691 |
NSRect rect = new NSRect(); |
759 |
NSRect rect = new NSRect(); |
| 692 |
rect.x = x; |
760 |
rect.x = x; |
| 693 |
rect.y = y; |
761 |
rect.y = y; |
|
Lines 725-742
Link Here
|
| 725 |
if (control.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT); |
793 |
if (control.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT); |
| 726 |
if (control.parent != parent) error (SWT.ERROR_INVALID_PARENT); |
794 |
if (control.parent != parent) error (SWT.ERROR_INVALID_PARENT); |
| 727 |
} |
795 |
} |
| 728 |
if ((style & SWT.SEPARATOR) == 0) return; |
796 |
if (this.control == control) return; |
| 729 |
if (this.control == control) return; |
797 |
Control oldControl = this.control; |
| 730 |
NSBox widget = (NSBox)view; |
|
|
| 731 |
if (control == null) { |
| 732 |
widget.setBoxType(OS.NSBoxSeparator); |
| 733 |
} else { |
| 734 |
widget.setBoxType(OS.NSBoxCustom); |
| 735 |
} |
| 736 |
this.control = control; |
798 |
this.control = control; |
| 737 |
view.setHidden(control != null); |
799 |
if (parent.isUnified()) { |
| 738 |
if (control != null && !control.isDisposed ()) { |
800 |
/* Unified toolbar case */ |
| 739 |
control.moveAbove (null); |
801 |
NSToolbar toolbar = parent.toolbar; |
|
|
802 |
int index = parent.indexOf(this); |
| 803 |
toolbar.removeItemAtIndex(index); |
| 804 |
NSString itemId = null; |
| 805 |
if (control != null) { |
| 806 |
itemId = id; |
| 807 |
} else if ((style & SWT.SEPARATOR) != 0){ |
| 808 |
itemId = OS.NSToolbarSeparatorItemIdentifier; |
| 809 |
} else if ((style & SWT.SPACER) != 0) { |
| 810 |
itemId = OS.NSToolbarSpaceItemIdentifier; |
| 811 |
} else if ((style & SWT.FLEX_SPACER) != 0) { |
| 812 |
itemId = OS.NSToolbarFlexibleSpaceItemIdentifier; |
| 813 |
} |
| 814 |
|
| 815 |
toolbar.insertItemWithItemIdentifier(itemId, index); |
| 816 |
nsItem.setView(control != null ? control.topView() : null); |
| 817 |
if (control != null) { |
| 818 |
NSSize size = new NSSize(); |
| 819 |
if ((style & SWT.DROP_DOWN) == 0){ |
| 820 |
//TODO should not computeSize |
| 821 |
size.height = control.computeSize(SWT.DEFAULT, SWT.DEFAULT).y; |
| 822 |
} else { |
| 823 |
if (parent.toolbar.sizeMode() == NSToolbar.NSToolbarSizeModeSmall) { |
| 824 |
size.height = UNIFIED_SMALL_IMAGE_SIZE; |
| 825 |
} else { |
| 826 |
size.height = UNIFIED_REGULAR_IMAGE_SIZE; |
| 827 |
} |
| 828 |
} |
| 829 |
size.width = width; |
| 830 |
nsItem.setMinSize(size); |
| 831 |
nsItem.setMaxSize(size); |
| 832 |
} |
| 833 |
if (oldControl != null && !oldControl.isDisposed()) { |
| 834 |
oldControl.dispose(); |
| 835 |
} |
| 836 |
} else { |
| 837 |
if ((style & SWT.SEPARATOR) == 0) return; |
| 838 |
NSBox widget = (NSBox)view; |
| 839 |
if (control == null) { |
| 840 |
widget.setBoxType(OS.NSBoxSeparator); |
| 841 |
} else { |
| 842 |
widget.setBoxType(OS.NSBoxCustom); |
| 843 |
} |
| 844 |
view.setHidden(control != null); |
| 845 |
if (control != null && !control.isDisposed ()) { |
| 846 |
control.moveAbove (null); |
| 847 |
} |
| 740 |
} |
848 |
} |
| 741 |
parent.relayout (); |
849 |
parent.relayout (); |
| 742 |
} |
850 |
} |
|
Lines 789-796
Link Here
|
| 789 |
checkWidget(); |
897 |
checkWidget(); |
| 790 |
if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT); |
898 |
if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT); |
| 791 |
if ((style & SWT.SEPARATOR) != 0) return; |
899 |
if ((style & SWT.SEPARATOR) != 0) return; |
| 792 |
disabledImage = image; |
900 |
if ((disabledImage != null) || (image != null)) { |
| 793 |
updateImage (true); |
901 |
disabledImage = image; |
|
|
902 |
updateImage (true); |
| 903 |
} |
| 794 |
} |
904 |
} |
| 795 |
|
905 |
|
| 796 |
/** |
906 |
/** |
|
Lines 823-828
Link Here
|
| 823 |
if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT); |
933 |
if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT); |
| 824 |
if ((style & SWT.SEPARATOR) != 0) return; |
934 |
if ((style & SWT.SEPARATOR) != 0) return; |
| 825 |
super.setImage (image); |
935 |
super.setImage (image); |
|
|
936 |
if ((control instanceof Combo) && (control.isDisposed() == false) |
| 937 |
&& ((control.getStyle() & SWT.SMOOTH) != 0)) { |
| 938 |
Combo combo = (Combo)control; |
| 939 |
/* |
| 940 |
* In a Unified toolbar, an NSComboBox will behave like a tool item with an icon |
| 941 |
* and a dropdown arrow if it has an image and its first string needs to be an empty |
| 942 |
* string. |
| 943 |
*/ |
| 944 |
combo.setImage(image); |
| 945 |
combo.removeAll(); |
| 946 |
if (image != null) { |
| 947 |
combo.add(""); |
| 948 |
} |
| 949 |
} |
| 826 |
updateImage (true); |
950 |
updateImage (true); |
| 827 |
} |
951 |
} |
| 828 |
|
952 |
|
|
Lines 887-902
Link Here
|
| 887 |
if (string == null) error (SWT.ERROR_NULL_ARGUMENT); |
1011 |
if (string == null) error (SWT.ERROR_NULL_ARGUMENT); |
| 888 |
if ((style & SWT.SEPARATOR) != 0) return; |
1012 |
if ((style & SWT.SEPARATOR) != 0) return; |
| 889 |
super.setText (string); |
1013 |
super.setText (string); |
| 890 |
NSButton widget = (NSButton)button; |
1014 |
if (parent.isUnified()) { |
| 891 |
widget.setAttributedTitle(createString()); |
1015 |
char [] chars = new char [text.length ()]; |
| 892 |
if (text.length() != 0 && image != null) { |
1016 |
text.getChars (0, chars.length, chars, 0); |
| 893 |
if ((parent.style & SWT.RIGHT) != 0) { |
1017 |
int length = fixMnemonic (chars); |
| 894 |
widget.setImagePosition(OS.NSImageLeft); |
1018 |
nsItem.setLabel(NSString.stringWithCharacters(chars, length)); |
| 895 |
} else { |
|
|
| 896 |
widget.setImagePosition(OS.NSImageAbove); |
| 897 |
} |
| 898 |
} else { |
1019 |
} else { |
| 899 |
widget.setImagePosition(text.length() != 0 ? OS.NSNoImage : OS.NSImageOnly); |
1020 |
NSButton widget = (NSButton)button; |
|
|
1021 |
widget.setAttributedTitle(createString()); |
| 1022 |
if (text.length() != 0 && image != null) { |
| 1023 |
if ((parent.style & SWT.RIGHT) != 0) { |
| 1024 |
widget.setImagePosition(OS.NSImageLeft); |
| 1025 |
} else { |
| 1026 |
widget.setImagePosition(OS.NSImageAbove); |
| 1027 |
} |
| 1028 |
} else { |
| 1029 |
widget.setImagePosition(text.length() != 0 ? OS.NSNoImage : OS.NSImageOnly); |
| 1030 |
} |
| 900 |
} |
1031 |
} |
| 901 |
parent.relayout (); |
1032 |
parent.relayout (); |
| 902 |
} |
1033 |
} |
|
Lines 923-930
Link Here
|
| 923 |
*/ |
1054 |
*/ |
| 924 |
public void setToolTipText (String string) { |
1055 |
public void setToolTipText (String string) { |
| 925 |
checkWidget(); |
1056 |
checkWidget(); |
| 926 |
toolTipText = string; |
1057 |
if (string == null) { |
| 927 |
parent.checkToolTip (this); |
1058 |
return; |
|
|
1059 |
} |
| 1060 |
|
| 1061 |
if (parent.isUnified()) { |
| 1062 |
char[] chars = new char [string.length ()]; |
| 1063 |
string.getChars (0, chars.length, chars, 0); |
| 1064 |
int length = fixMnemonic (chars); |
| 1065 |
nsItem.setToolTip(NSString.stringWithCharacters (chars, length)); |
| 1066 |
} else { |
| 1067 |
toolTipText = string; |
| 1068 |
parent.checkToolTip (this); |
| 1069 |
} |
| 928 |
} |
1070 |
} |
| 929 |
|
1071 |
|
| 930 |
void setVisible (boolean visible) { |
1072 |
void setVisible (boolean visible) { |
|
Lines 950-958
Link Here
|
| 950 |
*/ |
1092 |
*/ |
| 951 |
public void setWidth (int width) { |
1093 |
public void setWidth (int width) { |
| 952 |
checkWidget(); |
1094 |
checkWidget(); |
| 953 |
if ((style & SWT.SEPARATOR) == 0) return; |
|
|
| 954 |
if (width < 0 || this.width == width) return; |
1095 |
if (width < 0 || this.width == width) return; |
| 955 |
this.width = width; |
1096 |
if (parent.isUnified()) { |
|
|
1097 |
NSSize size = new NSSize(); |
| 1098 |
//TODO should not computeSize |
| 1099 |
size.height = control != null ? control.computeSize(SWT.DEFAULT, SWT.DEFAULT).y : 0; |
| 1100 |
size.width = width; |
| 1101 |
nsItem.setMinSize(size); |
| 1102 |
nsItem.setMaxSize(size); |
| 1103 |
} else { |
| 1104 |
if ((style & SWT.SEPARATOR) == 0) return; |
| 1105 |
} |
| 1106 |
this.width = width; |
| 956 |
parent.relayout(); |
1107 |
parent.relayout(); |
| 957 |
} |
1108 |
} |
| 958 |
|
1109 |
|
|
Lines 972-995
Link Here
|
| 972 |
image = disabledImage; |
1123 |
image = disabledImage; |
| 973 |
} |
1124 |
} |
| 974 |
} |
1125 |
} |
| 975 |
NSButton widget = (NSButton)button; |
1126 |
if (parent.isUnified()) { |
| 976 |
/* |
1127 |
nsItem.setImage(image != null ? image.handle : null); |
| 977 |
* Feature in Cocoa. If the NSImage object being set into the button is |
|
|
| 978 |
* the same NSImage object that is already there then the button does not |
| 979 |
* redraw itself. This results in the button's image not visually updating |
| 980 |
* if the NSImage object's content has changed since it was last set |
| 981 |
* into the button. The workaround is to explicitly redraw the button. |
| 982 |
*/ |
| 983 |
widget.setImage(image != null ? image.handle : null); |
| 984 |
widget.setNeedsDisplay(true); |
| 985 |
if (text.length() != 0 && image != null) { |
| 986 |
if ((parent.style & SWT.RIGHT) != 0) { |
| 987 |
widget.setImagePosition(OS.NSImageLeft); |
| 988 |
} else { |
| 989 |
((NSButton)button).setImagePosition(OS.NSImageAbove); |
| 990 |
} |
| 991 |
} else { |
1128 |
} else { |
| 992 |
widget.setImagePosition(text.length() != 0 ? OS.NSNoImage : OS.NSImageOnly); |
1129 |
NSButton widget = (NSButton)button; |
|
|
1130 |
/* |
| 1131 |
* Feature in Cocoa. If the NSImage object being set into the button is |
| 1132 |
* the same NSImage object that is already there then the button does not |
| 1133 |
* redraw itself. This results in the button's image not visually updating |
| 1134 |
* if the NSImage object's content has changed since it was last set |
| 1135 |
* into the button. The workaround is to explicitly redraw the button. |
| 1136 |
*/ |
| 1137 |
widget.setImage(image != null ? image.handle : null); |
| 1138 |
widget.setNeedsDisplay(true); |
| 1139 |
if (text.length() != 0 && image != null) { |
| 1140 |
if ((parent.style & SWT.RIGHT) != 0) { |
| 1141 |
widget.setImagePosition(OS.NSImageLeft); |
| 1142 |
} else { |
| 1143 |
((NSButton)button).setImagePosition(OS.NSImageAbove); |
| 1144 |
} |
| 1145 |
} else { |
| 1146 |
widget.setImagePosition(text.length() != 0 ? OS.NSNoImage : OS.NSImageOnly); |
| 1147 |
} |
| 993 |
} |
1148 |
} |
| 994 |
parent.relayout(); |
1149 |
parent.relayout(); |
| 995 |
} |
1150 |
} |