Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 256950

Summary: SWT controls: size and position applied differently (from Carbon)
Product: [Eclipse Project] Platform Reporter: Judy van Aswegen <judy>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: cocoakevin, grant_gayed, pali, skovatch
Version: 3.5Keywords: triaged
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard: stalebug

Description Judy van Aswegen CLA 2008-11-28 17:52:19 EST
Builds: Eclipse SDK Mac OSX Cocoa N20081126-2000 (compared to Carbon N20081126-2000)

In the context of the SWT Controls Example, re the Button, Combo, Scale, and Labels (image) controls:
 
I'm seeing a difference in the way Size impacts the size and position of these controls.
 
For Carbon: 
1) In general, increasing the size of the control (10 x 10  to  50 x 50  to  100 x 100) results in the control growing in both dimensions. A 50 x 50 push button is square in shape. 
2) The control is top-left aligned in the specified area.

This means:
1) The control fills the area specified by the size.
2) An increase in size does not change the x y position of the control – the control simply grows downwards and towards the right.
 

For Cocoa: 
1) In general, increasing the size of a control (10 x 10  to  50 x 50  to  100 x 100) results in the control growing in the horizontal dimension only. A 50 x 50 push button is rectangular with a width of 50 and a "preferred" height.
2) The control appears center-left aligned in the specified area.

This means:
1) The control does not fill the area specified by the size.
2) An increase in size changes the vertical position of the control – it grows towards the right, but migrates downwards.


Note:
1) I say in general because, for some controls, it does not make sense to do anything other than add white space in some dimensions, which one can see if Border or Background Image are on (and working, which is often not the case). E.g. the combo control: one expects it to grow horizontally, but not vertically. 
2) The problem may be related to the use of skins. I notice that a 50 x 50 push button is 50 x "preferred" when not "Flat", but becomes the expected 50 x 50 if one sets Flat on (and the skin falls away).
Comment 1 Judy van Aswegen CLA 2008-11-28 18:07:24 EST
*** Bug 256351 has been marked as a duplicate of this bug. ***
Comment 2 Judy van Aswegen CLA 2008-11-28 18:25:34 EST
An exception: I notice that for Carbon, Button controls appear to be center-left aligned.
Comment 3 Judy van Aswegen CLA 2008-11-28 20:51:32 EST
This also applies to the DateTime control for styles Date and Time.
Comment 4 Pavol Vaskovic CLA 2009-02-20 15:33:52 EST
The default preferred height of buttons is too small. Is that a separate bug or it's this one? 
Comment 5 Grant Gayed CLA 2009-02-20 15:59:14 EST
see bug 262758
Comment 6 Pavol Vaskovic CLA 2009-02-20 16:12:27 EST
(In reply to comment #5)
> see bug 262758
> 

Thanks... I was searching only on Hardware: Macintosh. That one is filed as PC. I find that distinction in Bugzilla really confusing :-( Sorry for rant/spam.
Comment 7 Lakshmi P Shanmugam CLA 2017-07-04 07:41:44 EDT
Bug triaged, visit https://wiki.eclipse.org/SWT/Devel/Triage for more
information.
Comment 8 Eclipse Genie CLA 2019-12-11 13:14:10 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.