Cocoa Internals/Forms

From Lazarus wiki
Revision as of 14:43, 13 June 2019 by Skalogryz (talk | contribs) (Created page with "Forms are based on NSWindow (or NSPanel) + a special sub-class of NSView (TCocoaContentWindow) in order to provide the ability of embedding forms one into another. ===Icons=...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Forms are based on NSWindow (or NSPanel) + a special sub-class of NSView (TCocoaContentWindow) in order to provide the ability of embedding forms one into another.

Icons

Form icon is based on NSWindowDocumentIconButton - a special form button that is used to show the document icon. The button is automatically generated and placed by Cocoa, if NSWindow has representedURL assigned (to a non-nil value). The URL doesn't have to point to an existing location. If it points to a non-existing location a button with a generic icon would still be generated.

If representedURL is not assigned, then the DocumentIcon button could be created manually by using standardWindowButton:forStyleMask: method. However, the placement of the button should also be handled manually (every time the title changes). As well as both the title and the button would not be aligned in the same manner as if they were automatically with representedURL assigned

Unused Cocoa functionality:

See Also