mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 18:50:48 +00:00
Reverted previous change. Added comments in NSWindow.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23384 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a5a0ff01d8
commit
176822d74e
4 changed files with 105 additions and 17 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2006-09-03 12:12-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* Source/GSStandardWindowDecorationView.m: Put back RELEASE to
|
||||||
|
prevent memory leak.
|
||||||
|
* Source/NSControl.m: Reverted last change.
|
||||||
|
* Source/NSWindow.m: Added autogsdoc comments to methods.
|
||||||
|
|
||||||
2006-08-31 00:21-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
2006-08-31 00:21-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* Source/GSStandardWindowDecorationView.m: Correct issue in
|
* Source/GSStandardWindowDecorationView.m: Correct issue in
|
||||||
|
|
|
@ -177,7 +177,7 @@ static NSColor *titleColor[3];
|
||||||
different method here. */
|
different method here. */
|
||||||
[closeButton setAction: @selector(performClose:)];
|
[closeButton setAction: @selector(performClose:)];
|
||||||
[self addSubview: closeButton];
|
[self addSubview: closeButton];
|
||||||
// RELEASE(closeButton); // FIXME... causes crash when closing.
|
RELEASE(closeButton);
|
||||||
}
|
}
|
||||||
if ([w styleMask] & NSMiniaturizableWindowMask)
|
if ([w styleMask] & NSMiniaturizableWindowMask)
|
||||||
{
|
{
|
||||||
|
|
|
@ -726,16 +726,15 @@ static Class actionCellClass;
|
||||||
return [[self selectedCell] acceptsFirstResponder];
|
return [[self selectedCell] acceptsFirstResponder];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** <p>This method is invoked when the user click into the NSControl.</p>
|
|
||||||
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
- (void) mouseDown: (NSEvent *)theEvent
|
- (void) mouseDown: (NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
unsigned int event_mask = NSLeftMouseDownMask | NSLeftMouseUpMask
|
unsigned int event_mask = NSLeftMouseDownMask | NSLeftMouseUpMask
|
||||||
| NSMouseMovedMask | NSLeftMouseDraggedMask | NSOtherMouseDraggedMask
|
| NSMouseMovedMask | NSLeftMouseDraggedMask | NSOtherMouseDraggedMask
|
||||||
| NSRightMouseDraggedMask;
|
| NSRightMouseDraggedMask;
|
||||||
BOOL mouseUp = NO;
|
BOOL mouseUp = NO;
|
||||||
|
int oldActionMask = 0;
|
||||||
|
NSEvent *e = nil;
|
||||||
|
|
||||||
// If not enabled ignore mouse clicks
|
// If not enabled ignore mouse clicks
|
||||||
if (![self isEnabled])
|
if (![self isEnabled])
|
||||||
|
@ -748,11 +747,15 @@ static Class actionCellClass;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// stop cell from sending action while tracking the mouse...
|
||||||
|
oldActionMask = [_cell sendActionOn: ([_cell isContinuous]?NSPeriodicMask:0)];
|
||||||
|
|
||||||
// loop until mouse goes up
|
// loop until mouse goes up
|
||||||
|
e = theEvent;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
NSPoint location = [self convertPoint: [theEvent locationInWindow]
|
NSPoint location = [self convertPoint: [e locationInWindow]
|
||||||
fromView: nil];
|
fromView: nil];
|
||||||
|
|
||||||
// ask the cell to track the mouse only,
|
// ask the cell to track the mouse only,
|
||||||
// if the mouse is within the cell
|
// if the mouse is within the cell
|
||||||
|
@ -762,28 +765,34 @@ static Class actionCellClass;
|
||||||
|
|
||||||
[_cell setHighlighted: YES];
|
[_cell setHighlighted: YES];
|
||||||
[self setNeedsDisplay: YES];
|
[self setNeedsDisplay: YES];
|
||||||
done = [_cell trackMouse: theEvent
|
done = [_cell trackMouse: e
|
||||||
inRect: _bounds
|
inRect: _bounds
|
||||||
ofView: self
|
ofView: self
|
||||||
untilMouseUp: [[_cell class] prefersTrackingUntilMouseUp]];
|
untilMouseUp: [[_cell class] prefersTrackingUntilMouseUp]];
|
||||||
[_cell setHighlighted: NO];
|
[_cell setHighlighted: NO];
|
||||||
[self setNeedsDisplay: YES];
|
[self setNeedsDisplay: YES];
|
||||||
|
|
||||||
if (done)
|
if (done)
|
||||||
break;
|
{
|
||||||
|
mouseUp = YES;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
theEvent = [NSApp nextEventMatchingMask: event_mask
|
e = [NSApp nextEventMatchingMask: event_mask
|
||||||
untilDate: nil
|
untilDate: nil
|
||||||
inMode: NSEventTrackingRunLoopMode
|
inMode: NSEventTrackingRunLoopMode
|
||||||
dequeue: YES];
|
dequeue: YES];
|
||||||
if ([theEvent type] == NSLeftMouseUp)
|
if ([e type] == NSLeftMouseUp)
|
||||||
{
|
{
|
||||||
mouseUp = YES;
|
mouseUp = YES;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// allow the cell to send actions again...
|
||||||
|
[_cell sendActionOn: oldActionMask];
|
||||||
|
|
||||||
// Mouse went up inside the control but not inside the cell
|
// Mouse went up inside the control but not inside the cell
|
||||||
if (mouseUp)
|
if (mouseUp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2490,11 +2490,18 @@ resetCursorRectsForView(NSView *theView)
|
||||||
[self _didDeminiaturize: sender];
|
[self _didDeminiaturize: sender];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns YES, if the document has been changed.
|
||||||
|
*/
|
||||||
- (BOOL) isDocumentEdited
|
- (BOOL) isDocumentEdited
|
||||||
{
|
{
|
||||||
return _f.is_edited;
|
return _f.is_edited;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns YES, if the window is released when it is closed.
|
||||||
|
*/
|
||||||
- (BOOL) isReleasedWhenClosed
|
- (BOOL) isReleasedWhenClosed
|
||||||
{
|
{
|
||||||
return _f.is_released_when_closed;
|
return _f.is_released_when_closed;
|
||||||
|
@ -2564,6 +2571,11 @@ resetCursorRectsForView(NSView *theView)
|
||||||
object: self];
|
object: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Causes the window to close. Calls the windowShouldClose: method
|
||||||
|
on the delegate to determine if it should close and calls
|
||||||
|
shouldCloseWindowController on the controller for the receiver.
|
||||||
|
*/
|
||||||
- (void) performClose: (id)sender
|
- (void) performClose: (id)sender
|
||||||
{
|
{
|
||||||
/* Don't close if a modal session is running and we are not the
|
/* Don't close if a modal session is running and we are not the
|
||||||
|
@ -2620,6 +2632,9 @@ resetCursorRectsForView(NSView *theView)
|
||||||
[self close];
|
[self close];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Performs the key equivalent represented by theEvent.
|
||||||
|
*/
|
||||||
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent
|
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent
|
||||||
{
|
{
|
||||||
if (_contentView)
|
if (_contentView)
|
||||||
|
@ -2654,6 +2669,11 @@ resetCursorRectsForView(NSView *theView)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Set document edit status. If YES, then, if the receiver has a close
|
||||||
|
button, the close button will show a broken X. If NO, then, if the reciever
|
||||||
|
has a close button, the close button will show a solid X.
|
||||||
|
*/
|
||||||
- (void) setDocumentEdited: (BOOL)flag
|
- (void) setDocumentEdited: (BOOL)flag
|
||||||
{
|
{
|
||||||
if (_f.is_edited != flag)
|
if (_f.is_edited != flag)
|
||||||
|
@ -2667,6 +2687,9 @@ resetCursorRectsForView(NSView *theView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
If YES, then the window is released when the close method is called.
|
||||||
|
*/
|
||||||
- (void) setReleasedWhenClosed: (BOOL)flag
|
- (void) setReleasedWhenClosed: (BOOL)flag
|
||||||
{
|
{
|
||||||
_f.is_released_when_closed = flag;
|
_f.is_released_when_closed = flag;
|
||||||
|
@ -2691,16 +2714,26 @@ resetCursorRectsForView(NSView *theView)
|
||||||
[NSApp discardEventsMatchingMask: mask beforeEvent: lastEvent];
|
[NSApp discardEventsMatchingMask: mask beforeEvent: lastEvent];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the first responder of the window.
|
||||||
|
*/
|
||||||
- (NSResponder*) firstResponder
|
- (NSResponder*) firstResponder
|
||||||
{
|
{
|
||||||
return _firstResponder;
|
return _firstResponder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns YES, if the window can accept first responder. The default
|
||||||
|
implementation of this method returns YES.
|
||||||
|
*/
|
||||||
- (BOOL) acceptsFirstResponder
|
- (BOOL) acceptsFirstResponder
|
||||||
{
|
{
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Makes aResponder the first responder within the receiver.
|
||||||
|
*/
|
||||||
- (BOOL) makeFirstResponder: (NSResponder*)aResponder
|
- (BOOL) makeFirstResponder: (NSResponder*)aResponder
|
||||||
{
|
{
|
||||||
if (_firstResponder == aResponder)
|
if (_firstResponder == aResponder)
|
||||||
|
@ -2738,6 +2771,9 @@ resetCursorRectsForView(NSView *theView)
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the initial first responder of the receiver.
|
||||||
|
*/
|
||||||
- (void) setInitialFirstResponder: (NSView*)aView
|
- (void) setInitialFirstResponder: (NSView*)aView
|
||||||
{
|
{
|
||||||
if ([aView isKindOfClass: viewClass])
|
if ([aView isKindOfClass: viewClass])
|
||||||
|
@ -2746,11 +2782,18 @@ resetCursorRectsForView(NSView *theView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
returns the initial first responder of the receiver.
|
||||||
|
*/
|
||||||
- (NSView*) initialFirstResponder
|
- (NSView*) initialFirstResponder
|
||||||
{
|
{
|
||||||
return _initialFirstResponder;
|
return _initialFirstResponder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Processes theEvent when a key is pressed while within
|
||||||
|
the window.
|
||||||
|
*/
|
||||||
- (void) keyDown: (NSEvent*)theEvent
|
- (void) keyDown: (NSEvent*)theEvent
|
||||||
{
|
{
|
||||||
NSString *characters = [theEvent characters];
|
NSString *characters = [theEvent characters];
|
||||||
|
@ -4024,11 +4067,19 @@ resetCursorRectsForView(NSView *theView)
|
||||||
[_wv convertRect: aRect fromView: nil]];
|
[_wv convertRect: aRect fromView: nil]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Opens the fax panel to allow the user to fax the contents of
|
||||||
|
the window view.
|
||||||
|
*/
|
||||||
- (void) fax: (id)sender
|
- (void) fax: (id)sender
|
||||||
{
|
{
|
||||||
[_wv fax: sender];
|
[_wv fax: sender];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Opens the print panel to allow the user to print the contents of
|
||||||
|
the window view.
|
||||||
|
*/
|
||||||
- (void) print: (id)sender
|
- (void) print: (id)sender
|
||||||
{
|
{
|
||||||
[_wv print: sender];
|
[_wv print: sender];
|
||||||
|
@ -4038,12 +4089,18 @@ resetCursorRectsForView(NSView *theView)
|
||||||
* Zooming
|
* Zooming
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns yes, if the receiver is zoomed.
|
||||||
|
*/
|
||||||
- (BOOL) isZoomed
|
- (BOOL) isZoomed
|
||||||
{
|
{
|
||||||
// FIXME: Method is missing
|
// FIXME: Method is missing
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Performs the zoom method on the receiver.
|
||||||
|
*/
|
||||||
- (void) performZoom: (id)sender
|
- (void) performZoom: (id)sender
|
||||||
{
|
{
|
||||||
// FIXME: We should check for the style and highlight the button
|
// FIXME: We should check for the style and highlight the button
|
||||||
|
@ -4052,6 +4109,11 @@ resetCursorRectsForView(NSView *theView)
|
||||||
|
|
||||||
#define DIST 3
|
#define DIST 3
|
||||||
|
|
||||||
|
/**
|
||||||
|
Zooms the receiver. This method calls the delegate method
|
||||||
|
windowShouldZoom:toFrame: to determine if the window should
|
||||||
|
be allowed to zoom to full screen.
|
||||||
|
*/
|
||||||
- (void) zoom: (id)sender
|
- (void) zoom: (id)sender
|
||||||
{
|
{
|
||||||
NSRect maxRect = [[self screen] visibleFrame];
|
NSRect maxRect = [[self screen] visibleFrame];
|
||||||
|
@ -4132,11 +4194,18 @@ resetCursorRectsForView(NSView *theView)
|
||||||
/*
|
/*
|
||||||
* Assigning a delegate
|
* Assigning a delegate
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the delegate.
|
||||||
|
*/
|
||||||
- (id) delegate
|
- (id) delegate
|
||||||
{
|
{
|
||||||
return _delegate;
|
return _delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the delegate to anObject.
|
||||||
|
*/
|
||||||
- (void) setDelegate: (id)anObject
|
- (void) setDelegate: (id)anObject
|
||||||
{
|
{
|
||||||
if (_delegate)
|
if (_delegate)
|
||||||
|
@ -4327,6 +4396,9 @@ resetCursorRectsForView(NSView *theView)
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns all drawers associated with this window.
|
||||||
|
*/
|
||||||
- (NSArray *) drawers
|
- (NSArray *) drawers
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue