Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv4246
Added Files:
ZCDraggableView.h ZCDraggableView.m
Log Message:
Move window by dragging empty area near input field.
--- NEW FILE: ZCDraggableView.h ---
/* ZCDraggableView */
#import <Cocoa/Cocoa.h>
@interface ZCDraggableView : NSView
@end
--- NEW FILE: ZCDraggableView.m ---
#import "ZCDraggableView.h"
@implementation ZCDraggableView
- (void)mouseDown:(NSEvent *)event {
NSPoint location = [event locationInWindow];
while ([event type] != NSLeftMouseUp) {
event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask];
NSPoint newLoc = [event locationInWindow];
if ([event type] == NSLeftMouseDragged) {
[[self window] setFrameOrigin:NSMakePoint([[self window] frame].origin.x + (newLoc.x - location.x),
[[self window] frame].origin.y + (newLoc.y - location.y))];
}
}
}
- (BOOL)mouseDownCanMoveWindow {
/* We do our own window-dragging -- don't let the system do it too! */
return NO;
}
@end
|