Difference between revisions of "Cocoa Internals/Buttons"

From Lazarus wiki
Jump to navigationJump to search
m
Line 14: Line 14:
  
 
The approach similar to Carbon implementation could be used - after a certain hight the button changes its bezel.  
 
The approach similar to Carbon implementation could be used - after a certain hight the button changes its bezel.  
 +
|-
 +
|TBitBtn
 +
|Image Button
 +
 +
NSRegularSquareBezelStyle
 +
|TBitBtn is a button that could hold an image in it's body.
 +
The closest (not deprecated) to such tasks is NSRegularSquareBezelStyle in macOS
 
|}
 
|}
 
==See Also==
 
==See Also==
 
*[[Cocoa Internals]]
 
*[[Cocoa Internals]]
 
* https://developer.apple.com/macos/human-interface-guidelines/buttons/checkboxes/ - the official guide to macOS button styles
 
* https://developer.apple.com/macos/human-interface-guidelines/buttons/checkboxes/ - the official guide to macOS button styles
 +
* [https://developer.apple.com/documentation/appkit/nsbezelstyle https://developer.apple.com/documentation/appkit/nsbezelstyle?language=objc] - bezel constants descriptions
 
* https://mackuba.eu/2014/10/06/a-guide-to-nsbutton-styles/ - a non-official guide to macOS button styles
 
* https://mackuba.eu/2014/10/06/a-guide-to-nsbutton-styles/ - a non-official guide to macOS button styles
 
[[Category:Cocoa]]
 
[[Category:Cocoa]]

Revision as of 06:06, 17 December 2017

Despite of being a very basic control, buttons are complicated topic on macOS.

LCL Button OSX Button / Bezel Description
TButton Push Button

NSRoundedBezelStyle

Per macOS design guidelines, Push buttons should only have labels on them, and no Icons. This is exactly, how LCL TButton behaves.

The biggest issue, is that macOS Push Buttons are of the fixed height. While LCL buttons can be any height.

The approach similar to Carbon implementation could be used - after a certain hight the button changes its bezel.

TBitBtn Image Button

NSRegularSquareBezelStyle

TBitBtn is a button that could hold an image in it's body.

The closest (not deprecated) to such tasks is NSRegularSquareBezelStyle in macOS

See Also