[Carbon] Fixes for GetPreferredSize() for several controls
Original Reporter info from Mantis: jonas@freepascal.org
-
Reporter name: Jonas Maebe
Original Reporter info from Mantis: jonas@freepascal.org
- Reporter name: Jonas Maebe
Description:
GetPreferredSize() should only return the size of a control that depends on the control itself, and disregard and influences on the size of the control by its children (as explained by Mattias in comment 0036957 of #16323 (closed)).
This means that the PreferredSize() of a panel should always be 0, and the size of a groupbox should only include the size of the "title bar" part.
To see the effects, open the attached project, compile and run it. Initially, it looks like autosize3-1.png
After applying comboboxpreferredsize.patch and recompiling the LCL and the project, it looks like autosize3-2.png (the combobox is now shrunk so it only contains the contents, even though it was much larger at design time).
After applying panelpreferredsizehack.patch and recompiling, it looks like autosize3-3.png (which is how it should look, and how it looks when compiled for e.g. Qt).
As the name implies, the last patch is just a hack. It should be implemented instead in a proper way.
Maybe you can use the same technique as used for comboboxpreferredsize.patch also for some other controls (such as windows).
Mantis conversion info:
- Mantis ID: 16337
- OS: Mac OS X
- OS Build: 10.6.2
- Build: 24904
- Platform: i386
- Version: 0.9.29 (SVN)
- Target version: 0.9.30