5 // Created by Evan Schoenberg on 12/26/05.
8 #import "AIMessageWindow.h"
9 #import "AIClickThroughThemeDocumentButton.h"
10 #import <AIUtilities/AIApplicationAdditions.h>
13 * @class AIMessageWindow
14 * @brief This AIDockingWindow subclass serves message windows.
16 * It overrides the standardWindowButton:forStyleMask: class method to provide
17 * AIClickThroughThemeDocumentButton objects for NSWindowDocumentIconButton requests on 10.4 and earlier.
18 * Delegate methods in 10.5+ handle what we need.
20 @implementation AIMessageWindow
23 * @brief Return the standard window button for a mask
25 * We return AIClickThroughThemeDocumentButton instead of NSThemeDocumentButton to provide
26 * click-through dragging behavior on 10.4 and earlier.
28 + (NSButton *)standardWindowButton:(NSWindowButton)button forStyleMask:(unsigned int)styleMask
30 NSButton *standardWindowButton = [super standardWindowButton:button forStyleMask:styleMask];
32 if (![NSApp isOnLeopardOrBetter]) {
33 if (button == NSWindowDocumentIconButton) {
34 [NSKeyedArchiver setClassName:@"AIClickThroughThemeDocumentButton" forClass:[NSThemeDocumentButton class]];
35 standardWindowButton = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:standardWindowButton]];
37 [[standardWindowButton retain] autorelease];
41 return standardWindowButton;