New: Added CPPopoverDelegate protocole

Added CPPopopverDelegate protocole
This commit is contained in:
Alexandre Wilhelm
2014-03-25 21:03:00 -07:00
parent 23f04b3d09
commit cc9d896cf8
+18 -8
View File
@@ -30,6 +30,16 @@
@import "CPView.j"
@import "_CPPopoverWindow.j"
@protocol CPPopoverDelegate <CPObject>
@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 <CPPopoverDelegate> _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 <CPPopoverDelegate>)aDelegate
{
if (_delegate === aDelegate)
return;