mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Implemented those new methods. Call new methods from the subview
handling methods. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11511 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
af65642575
commit
c45289573b
1 changed files with 58 additions and 2 deletions
|
@ -53,6 +53,7 @@
|
|||
#include <AppKit/GSTrackingRect.h>
|
||||
#include <AppKit/GSVersion.h>
|
||||
#include <AppKit/NSAffineTransform.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSDocumentController.h>
|
||||
#include <AppKit/NSDocument.h>
|
||||
#include <AppKit/NSClipView.h>
|
||||
|
@ -304,6 +305,9 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
_rFlags.has_subviews = 1;
|
||||
[aView resetCursorRects];
|
||||
[aView setNeedsDisplay: YES];
|
||||
[aView viewDidMoveToWindow];
|
||||
[aView viewDidMoveToSuperview];
|
||||
[self didAddSubview: aView];
|
||||
RELEASE(aView);
|
||||
}
|
||||
|
||||
|
@ -351,6 +355,9 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
_rFlags.has_subviews = 1;
|
||||
[aView resetCursorRects];
|
||||
[aView setNeedsDisplay: YES];
|
||||
[aView viewDidMoveToWindow];
|
||||
[aView viewDidMoveToSuperview];
|
||||
[self didAddSubview: aView];
|
||||
RELEASE(aView);
|
||||
}
|
||||
|
||||
|
@ -444,10 +451,15 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
break;
|
||||
}
|
||||
}
|
||||
[self willRemoveSubview: aSubview];
|
||||
aSubview->_super_view = nil;
|
||||
[aSubview viewWillMoveToWindow: nil];
|
||||
[aSubview setNextResponder: nil];
|
||||
RETAIN(aSubview);
|
||||
[_sub_views removeObjectIdenticalTo: aSubview];
|
||||
[aSubview viewDidMoveToWindow];
|
||||
[aSubview viewDidMoveToSuperview];
|
||||
RELEASE(aSubview);
|
||||
if ([_sub_views count] == 0)
|
||||
{
|
||||
_rFlags.has_subviews = 0;
|
||||
|
@ -485,6 +497,9 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
_rFlags.has_subviews = 1;
|
||||
[newView resetCursorRects];
|
||||
[newView setNeedsDisplay: YES];
|
||||
[newView viewDidMoveToWindow];
|
||||
[newView viewDidMoveToSuperview];
|
||||
[self didAddSubview: newView];
|
||||
RELEASE(newView);
|
||||
}
|
||||
else if ([_sub_views indexOfObjectIdenticalTo: oldView] != NSNotFound)
|
||||
|
@ -523,6 +538,9 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
_rFlags.has_subviews = 1;
|
||||
[newView resetCursorRects];
|
||||
[newView setNeedsDisplay: YES];
|
||||
[newView viewDidMoveToWindow];
|
||||
[newView viewDidMoveToSuperview];
|
||||
[self didAddSubview: newView];
|
||||
RELEASE(newView);
|
||||
}
|
||||
}
|
||||
|
@ -593,6 +611,18 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
}
|
||||
}
|
||||
|
||||
- (void) didAddSubview: (NSView *)subview
|
||||
{}
|
||||
|
||||
- (void) viewDidMoveToSuperview
|
||||
{}
|
||||
|
||||
- (void) viewDidMoveToWindow
|
||||
{}
|
||||
|
||||
- (void) willRemoveSubview: (NSView *)subview
|
||||
{}
|
||||
|
||||
- (void) rotateByAngle: (float)angle
|
||||
{
|
||||
if (_coordinates_valid)
|
||||
|
@ -1470,6 +1500,19 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
|||
[self unlockFocusNeedsFlush: YES ];
|
||||
}
|
||||
|
||||
- (BOOL) lockFocusIfCanDraw
|
||||
{
|
||||
if ([self canDraw])
|
||||
{
|
||||
[self lockFocus];
|
||||
return YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) canDraw
|
||||
{ // not implemented per OS spec FIX ME
|
||||
if (_window != nil)
|
||||
|
@ -2220,7 +2263,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
|
||||
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent
|
||||
{
|
||||
unsigned i;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < [_sub_views count]; i++)
|
||||
if ([[_sub_views objectAtIndex: i] performKeyEquivalent: theEvent] == YES)
|
||||
|
@ -2228,6 +2271,16 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) performMnemonic: (NSString *)aString
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < [_sub_views count]; i++)
|
||||
if ([[_sub_views objectAtIndex: i] performMnemonic: aString] == YES)
|
||||
return YES;
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) removeTrackingRect: (NSTrackingRectTag)tag
|
||||
{
|
||||
unsigned i, j;
|
||||
|
@ -2376,7 +2429,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
{
|
||||
NSView *dragView = (NSView*)[GSCurrentContext() _dragInfo];
|
||||
|
||||
|
||||
[NSApp preventWindowOrdering];
|
||||
[dragView dragImage: anImage
|
||||
at: viewLocation
|
||||
offset: initialOffset
|
||||
|
@ -3066,6 +3119,9 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
_rFlags.has_subviews = 1;
|
||||
[sub resetCursorRects];
|
||||
[sub setNeedsDisplay: YES];
|
||||
[sub viewDidMoveToWindow];
|
||||
[sub viewDidMoveToSuperview];
|
||||
[self didAddSubview: sub];
|
||||
}
|
||||
RELEASE(subs);
|
||||
|
||||
|
|
Loading…
Reference in a new issue