diff --git a/AppKit/CPPopover.j b/AppKit/CPPopover.j index 760e4edab..c887fcf7c 100644 --- a/AppKit/CPPopover.j +++ b/AppKit/CPPopover.j @@ -30,6 +30,16 @@ @import "CPView.j" @import "_CPPopoverWindow.j" +@protocol CPPopoverDelegate + +@optional +- (BOOL)popoverShouldClose:(CPPopover)aPopover; +- (void)popoverWillClose:(CPPopover)aPopover; +- (void)popoverDidClose:(CPPopover)aPopover; +- (void)popoverWillShow:(CPPopover)aPopover; +- (void)popoverDidShow:(CPPopover)aPopover; + +@end CPPopoverBehaviorApplicationDefined = 0; CPPopoverBehaviorTransient = 1; @@ -60,15 +70,15 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0, */ @implementation CPPopover : CPResponder { - @outlet CPViewController _contentViewController @accessors(property=contentViewController); - @outlet id _delegate @accessors(getter=delegate); + @outlet CPViewController _contentViewController @accessors(property=contentViewController); + @outlet id _delegate @accessors(getter=delegate); - BOOL _animates @accessors(getter=animates); - int _appearance @accessors(property=appearance); - int _behavior @accessors(getter=behavior); + BOOL _animates @accessors(getter=animates); + int _appearance @accessors(property=appearance); + int _behavior @accessors(getter=behavior); - _CPPopoverWindow _popoverWindow; - int _implementedDelegateMethods; + _CPPopoverWindow _popoverWindow; + int _implementedDelegateMethods; } @@ -184,7 +194,7 @@ Set the behavior of the CPPopover. It can be: [_popoverWindow setStyleMask:[self styleMaskForBehavior]]; } -- (void)setDelegate:(id)aDelegate +- (void)setDelegate:(id )aDelegate { if (_delegate === aDelegate) return;