mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:50:48 +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
a9da90c382
commit
4ca71e1959
1 changed files with 58 additions and 2 deletions
|
@ -53,6 +53,7 @@
|
||||||
#include <AppKit/GSTrackingRect.h>
|
#include <AppKit/GSTrackingRect.h>
|
||||||
#include <AppKit/GSVersion.h>
|
#include <AppKit/GSVersion.h>
|
||||||
#include <AppKit/NSAffineTransform.h>
|
#include <AppKit/NSAffineTransform.h>
|
||||||
|
#include <AppKit/NSApplication.h>
|
||||||
#include <AppKit/NSDocumentController.h>
|
#include <AppKit/NSDocumentController.h>
|
||||||
#include <AppKit/NSDocument.h>
|
#include <AppKit/NSDocument.h>
|
||||||
#include <AppKit/NSClipView.h>
|
#include <AppKit/NSClipView.h>
|
||||||
|
@ -304,6 +305,9 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
_rFlags.has_subviews = 1;
|
_rFlags.has_subviews = 1;
|
||||||
[aView resetCursorRects];
|
[aView resetCursorRects];
|
||||||
[aView setNeedsDisplay: YES];
|
[aView setNeedsDisplay: YES];
|
||||||
|
[aView viewDidMoveToWindow];
|
||||||
|
[aView viewDidMoveToSuperview];
|
||||||
|
[self didAddSubview: aView];
|
||||||
RELEASE(aView);
|
RELEASE(aView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,6 +355,9 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
_rFlags.has_subviews = 1;
|
_rFlags.has_subviews = 1;
|
||||||
[aView resetCursorRects];
|
[aView resetCursorRects];
|
||||||
[aView setNeedsDisplay: YES];
|
[aView setNeedsDisplay: YES];
|
||||||
|
[aView viewDidMoveToWindow];
|
||||||
|
[aView viewDidMoveToSuperview];
|
||||||
|
[self didAddSubview: aView];
|
||||||
RELEASE(aView);
|
RELEASE(aView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -444,10 +451,15 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[self willRemoveSubview: aSubview];
|
||||||
aSubview->_super_view = nil;
|
aSubview->_super_view = nil;
|
||||||
[aSubview viewWillMoveToWindow: nil];
|
[aSubview viewWillMoveToWindow: nil];
|
||||||
[aSubview setNextResponder: nil];
|
[aSubview setNextResponder: nil];
|
||||||
|
RETAIN(aSubview);
|
||||||
[_sub_views removeObjectIdenticalTo: aSubview];
|
[_sub_views removeObjectIdenticalTo: aSubview];
|
||||||
|
[aSubview viewDidMoveToWindow];
|
||||||
|
[aSubview viewDidMoveToSuperview];
|
||||||
|
RELEASE(aSubview);
|
||||||
if ([_sub_views count] == 0)
|
if ([_sub_views count] == 0)
|
||||||
{
|
{
|
||||||
_rFlags.has_subviews = 0;
|
_rFlags.has_subviews = 0;
|
||||||
|
@ -485,6 +497,9 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
_rFlags.has_subviews = 1;
|
_rFlags.has_subviews = 1;
|
||||||
[newView resetCursorRects];
|
[newView resetCursorRects];
|
||||||
[newView setNeedsDisplay: YES];
|
[newView setNeedsDisplay: YES];
|
||||||
|
[newView viewDidMoveToWindow];
|
||||||
|
[newView viewDidMoveToSuperview];
|
||||||
|
[self didAddSubview: newView];
|
||||||
RELEASE(newView);
|
RELEASE(newView);
|
||||||
}
|
}
|
||||||
else if ([_sub_views indexOfObjectIdenticalTo: oldView] != NSNotFound)
|
else if ([_sub_views indexOfObjectIdenticalTo: oldView] != NSNotFound)
|
||||||
|
@ -523,6 +538,9 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
_rFlags.has_subviews = 1;
|
_rFlags.has_subviews = 1;
|
||||||
[newView resetCursorRects];
|
[newView resetCursorRects];
|
||||||
[newView setNeedsDisplay: YES];
|
[newView setNeedsDisplay: YES];
|
||||||
|
[newView viewDidMoveToWindow];
|
||||||
|
[newView viewDidMoveToSuperview];
|
||||||
|
[self didAddSubview: newView];
|
||||||
RELEASE(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
|
- (void) rotateByAngle: (float)angle
|
||||||
{
|
{
|
||||||
if (_coordinates_valid)
|
if (_coordinates_valid)
|
||||||
|
@ -1470,6 +1500,19 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
[self unlockFocusNeedsFlush: YES ];
|
[self unlockFocusNeedsFlush: YES ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL) lockFocusIfCanDraw
|
||||||
|
{
|
||||||
|
if ([self canDraw])
|
||||||
|
{
|
||||||
|
[self lockFocus];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL) canDraw
|
- (BOOL) canDraw
|
||||||
{ // not implemented per OS spec FIX ME
|
{ // not implemented per OS spec FIX ME
|
||||||
if (_window != nil)
|
if (_window != nil)
|
||||||
|
@ -2220,7 +2263,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
||||||
|
|
||||||
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent
|
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
for (i = 0; i < [_sub_views count]; i++)
|
for (i = 0; i < [_sub_views count]; i++)
|
||||||
if ([[_sub_views objectAtIndex: i] performKeyEquivalent: theEvent] == YES)
|
if ([[_sub_views objectAtIndex: i] performKeyEquivalent: theEvent] == YES)
|
||||||
|
@ -2228,6 +2271,16 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
||||||
return NO;
|
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
|
- (void) removeTrackingRect: (NSTrackingRectTag)tag
|
||||||
{
|
{
|
||||||
unsigned i, j;
|
unsigned i, j;
|
||||||
|
@ -2376,7 +2429,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
||||||
{
|
{
|
||||||
NSView *dragView = (NSView*)[GSCurrentContext() _dragInfo];
|
NSView *dragView = (NSView*)[GSCurrentContext() _dragInfo];
|
||||||
|
|
||||||
|
[NSApp preventWindowOrdering];
|
||||||
[dragView dragImage: anImage
|
[dragView dragImage: anImage
|
||||||
at: viewLocation
|
at: viewLocation
|
||||||
offset: initialOffset
|
offset: initialOffset
|
||||||
|
@ -3066,6 +3119,9 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
||||||
_rFlags.has_subviews = 1;
|
_rFlags.has_subviews = 1;
|
||||||
[sub resetCursorRects];
|
[sub resetCursorRects];
|
||||||
[sub setNeedsDisplay: YES];
|
[sub setNeedsDisplay: YES];
|
||||||
|
[sub viewDidMoveToWindow];
|
||||||
|
[sub viewDidMoveToSuperview];
|
||||||
|
[self didAddSubview: sub];
|
||||||
}
|
}
|
||||||
RELEASE(subs);
|
RELEASE(subs);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue