/**
Returns whether the NSPanel is a floating panel, e.g. the window level is NSFloatingWindowLevel instead of NSNormalWindowLevel.
See Also: -setFloatingPanel:
*/ - (BOOL) isFloatingPanel { return _isFloatingPanel; } /**Sets whether the NSPanel is a floating panel, e.g. the window level is NSFloatingWindowLevel instead of NSNormalWindowLevel.
See Also: -isFloatingPanel [NSWindow-setLevel:]
*/ - (void) setFloatingPanel: (BOOL)flag { if (_isFloatingPanel != flag) { _isFloatingPanel = flag; if (flag == YES) { [self setLevel: NSFloatingWindowLevel]; } else { [self setLevel: NSNormalWindowLevel]; } } } /**Returns whether the NSPanel can receive events when another window/panel runs modally.
See Also: -setWorksWhenModal: [NSApplication-runModalSession:]
*/ - (BOOL) worksWhenModal { return _worksWhenModal; } /**Sets whether the NSPanel can receive events when another window/panel runs modally.
See Also: -worksWhenModal [NSApplication-runModalSession:] */ - (void) setWorksWhenModal: (BOOL)flag { _worksWhenModal = flag; } /**Returns whether if the NSPanel becomes key window only when a view require to be the first responder.
See Also: -setBecomesKeyOnlyIfNeeded: [NSView-needsPanelToBecomeKey] [NSWindow-sendEvent:]
*/ - (BOOL) becomesKeyOnlyIfNeeded { return _becomesKeyOnlyIfNeeded; } /**Sets whether if the NSPanel becomes key window only when a view require to be the first responder.
See Also: -setBecomesKeyOnlyIfNeeded: [NSView-needsPanelToBecomeKey] [NSWindow-sendEvent:]
*/ - (void) setBecomesKeyOnlyIfNeeded: (BOOL)flag { _becomesKeyOnlyIfNeeded = flag; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { BOOL flag; [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { // Nothing to do here, for keyed coding this is handled by NSWindowTemplate. // Calling the above method should throw an NSInvalidArgumentException. } else { flag = _becomesKeyOnlyIfNeeded; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _isFloatingPanel; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _worksWhenModal; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; } } - (id) initWithCoder: (NSCoder*)aDecoder { BOOL flag; self = [super initWithCoder: aDecoder]; if (nil == self) return nil; if ([aDecoder allowsKeyedCoding]) { // Nothing to do here, for keyed coding this is handled by NSWindowTemplate. // Calling the above method should throw an NSInvalidArgumentException. } else { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setBecomesKeyOnlyIfNeeded: flag]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setFloatingPanel: flag]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setWorksWhenModal: flag]; } return self; } @end /* NSPanel */