New: added delegate method windowDidMiniaturize: windowWillMiniaturize: and windowDidDeminiaturize: in CPWindow

This commit is contained in:
Alexandre Wilhelm committed 2015-04-06 13:50:30 -07:00
1 parent 7b4365bd8a
commit 737ef583ee
1 file changed
+28
+28
View File
@@ -67,11 +67,14 @@
- (CPUndoManager)windowWillReturnUndoManager:(CPWindow)window;
- (void)windowDidBecomeKey:(CPNotification)aNotification;
- (void)windowDidBecomeMain:(CPNotification)aNotification;
- (void)windowDidDeminiaturize:(CPNotification)notification;
- (void)windowDidEndSheet:(CPNotification)aNotification;
- (void)windowDidMiniaturize:(CPNotification)notification;
- (void)windowDidMove:(CPNotification)aNotification;
- (void)windowDidResignKey:(CPNotification)aNotification;
- (void)windowDidResignMain:(CPNotification)aNotification;
- (void)windowDidResize:(CPNotification)aNotification;
- (void)windowWillMiniaturize:(CPNotification)notification;
- (void)windowWillBeginSheet:(CPNotification)aNotification;
- (void)windowWillClose:(CPWindow)aWindow;
@@ -82,6 +85,7 @@ var CPWindowDelegate_windowShouldClose_ = 1 << 1
CPWindowDelegate_windowWillClose_ = 1 << 3,
CPWindowDelegate_windowWillResize_toSize_ = 1 << 4;
var CPWindowSaveImage = nil,
CPWindowResizeTime = 0.2,
@@ -1434,6 +1438,9 @@ CPTexturedBackgroundWindowMask
[defaultCenter removeObserver:_delegate name:CPWindowDidResizeNotification object:self];
[defaultCenter removeObserver:_delegate name:CPWindowWillBeginSheetNotification object:self];
[defaultCenter removeObserver:_delegate name:CPWindowDidEndSheetNotification object:self];
[defaultCenter removeObserver:_delegate name:CPWindowDidMiniaturizeNotification object:self];
[defaultCenter removeObserver:_delegate name:CPWindowDidDeminiaturizeNotification object:self];
[defaultCenter removeObserver:_delegate name:CPWindowWillMiniaturizeNotification object:self];
_delegate = aDelegate;
_implementedDelegateMethods = 0;
@@ -1505,6 +1512,27 @@ CPTexturedBackgroundWindowMask
selector:@selector(windowDidEndSheet:)
name:CPWindowDidEndSheetNotification
object:self];
if ([_delegate respondsToSelector:@selector(windowDidMiniaturize:)])
[defaultCenter
addObserver:_delegate
selector:@selector(windowDidMiniaturize:)
name:CPWindowDidMiniaturizeNotification
object:self];
if ([_delegate respondsToSelector:@selector(windowWillMiniaturize:)])
[defaultCenter
addObserver:_delegate
selector:@selector(windowWillMiniaturize:)
name:CPWindowWillMiniaturizeNotification
object:self];
if ([_delegate respondsToSelector:@selector(windowDidDeminiaturize:)])
[defaultCenter
addObserver:_delegate
selector:@selector(windowDidDeminiaturize:)
name:CPWindowDidDeminiaturizeNotification
object:self];
}
/*!