Oolite 1.91.0.7668-250429-8542c40
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
RBSplitSubview Class Reference

#include <RBSplitSubview.h>

+ Inheritance diagram for RBSplitSubview:
+ Collaboration diagram for RBSplitSubview:

Instance Methods

(id) - initWithFrame:
 
(RBSplitView *) - splitView
 
(RBSplitView *) - couplingSplitView
 
(RBSplitView *) - outermostSplitView
 
(RBSplitView *) - asSplitView
 
(RBSplitView *) - coupledSplitView
 
(void) - setCoupled:
 
(BOOL) - isCoupled
 
(BOOL) - splitViewIsHorizontal
 
(NSUInteger) - numberOfSubviews
 
(void) - setTag:
 
(NSInteger) - tag
 
(void) - setIdentifier:
 
(NSString *) - identifier
 
(NSUInteger) - position
 
(void) - setPosition:
 
(BOOL) - isCollapsed
 
(RBSSubviewStatus- status
 
(BOOL) - canCollapse
 
(void) - setCanCollapse:
 
(BOOL) - canShrink
 
(BOOL) - canExpand
 
(CGFloat) - minDimension
 
(CGFloat) - maxDimension
 
(void) - setMinDimension:andMaxDimension:
 
(CGFloat) - expand
 
(CGFloat) - collapse
 
(BOOL) - collapseWithAnimation
 
(BOOL) - expandWithAnimation
 
(BOOL) - collapseWithAnimation:withResize:
 
(BOOL) - expandWithAnimation:withResize:
 
(CGFloat) - dimension
 
(void) - setDimension:
 
(CGFloat) - changeDimensionBy:mayCollapse:move:
 
(void) - dealloc [implementation]
 
(BOOL) - isFlipped [implementation]
 
(BOOL) - isOpaque [implementation]
 
(void) - setHidden: [implementation]
 
(BOOL) - acceptsFirstResponder [implementation]
 
(NSString *) - description [implementation]
 
(void) - drawRect: [implementation]
 
(void) - display [implementation]
 
(BOOL) - autoresizesSubviews [implementation]
 
(void) - setAutoresizesSubviews: [implementation]
 
(void) - resizeSubviewsWithOldSize: [implementation]
 
(NSView *) - hitTest: [implementation]
 
(void) - mouseDown: [implementation]
 
(void) - encodeWithCoder: [implementation]
 
(id) - initWithCoder: [implementation]
 
(void) - RB___setHidden: [implementation]
 
(animationData *) - RB___animationData:resize: [implementation]
 
(void) - RB___stepAnimation [implementation]
 
(BOOL) - RB___stopAnimation [implementation]
 
(CGFloat) - RB___visibleDimension [implementation]
 
(CGFloat) - RB___setMinAndMaxTo:savingMin:andMax: [implementation]
 
(CGFloat) - RB___collapse [implementation]
 
(CGFloat) - RB___expandAndSetToMinimum: [implementation]
 
(void) - RB___finishCollapse:withFraction: [implementation]
 
(void) - RB___finishExpand:withFraction: [implementation]
 
(void) - RB___setFrameSize:withFraction: [implementation]
 
(void) - RB___setFrame:withFraction:notify: [implementation]
 
(double) - RB___fraction [implementation]
 
(void) - RB___copyIntoCache: [implementation]
 
(void) - RB___updateFromCache:withTotalDimension: [implementation]
 
(BOOL) - RB___clearResponder [implementation]
 

Class Methods

(BOOL) + animating
 

Protected Attributes

NSString * identifier
 
NSInteger tag
 
CGFloat minDimension
 
CGFloat maxDimension
 
double fraction
 
NSRect previous
 
NSSize savedSize
 
NSUInteger actDivider
 
BOOL canDragWindow
 
BOOL canCollapse
 
BOOL notInLimits
 

Detailed Description

Definition at line 22 of file RBSplitSubview.h.

Method Documentation

◆ acceptsFirstResponder

- (BOOL) acceptsFirstResponder
implementation

Definition at line 92 of file RBSplitSubview.m.

92 {
93 return NO;
94}

References acceptsFirstResponder.

Referenced by acceptsFirstResponder.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ animating

+ (BOOL) animating

Definition at line 21 of file RBSplitSubview.m.

21 {
22 return currentAnimation!=NULL;
23}
static animationData * currentAnimation

References animating, and currentAnimation.

Referenced by animating.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asSplitView

- (RBSplitView *) asSplitView

Reimplemented in RBSplitView.

Definition at line 51 of file RBSplitSubview.m.

51 {
52 return nil;
53}
return nil

References asSplitView, and nil.

Referenced by asSplitView.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ autoresizesSubviews

- (BOOL) autoresizesSubviews
implementation

Reimplemented in RBSplitView.

Definition at line 374 of file RBSplitSubview.m.

374 {
375 return YES;
376}

References autoresizesSubviews.

Referenced by autoresizesSubviews.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ canCollapse

- (BOOL) canCollapse

References canCollapse, canExpand, and canShrink.

+ Here is the call graph for this function:

◆ canExpand

- (BOOL) canExpand

Definition at line 189 of file RBSplitSubview.m.

189 {
190 return [self RB___visibleDimension]<maxDimension;
191}

References canExpand, maxDimension, and RB___visibleDimension.

Referenced by canCollapse, and canExpand.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ canShrink

- (BOOL) canShrink

Definition at line 184 of file RBSplitSubview.m.

184 {
185 return [self RB___visibleDimension]>([self canCollapse]?0.0:minDimension);
186}

References canCollapse, canShrink, and RB___visibleDimension.

Referenced by canCollapse, and canShrink.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeDimensionBy:mayCollapse:move:

- (CGFloat) changeDimensionBy: (CGFloat) increment
mayCollapse: (BOOL) mayCollapse
move: (BOOL) move 

Definition at line 410 of file RBSplitSubview.m.

410 :(CGFloat)increment mayCollapse:(BOOL)mayCollapse move:(BOOL)move {
411 RBSplitView* sv = [self splitView];
412 if (!sv||(fabs(increment)<1.0)) {
413 return 0.0;
414 }
415 BOOL ishor = [sv isHorizontal];
416 NSRect frame = [self frame];
417 CGFloat olddim = DIM(frame.size);
418 CGFloat newdim = MAX(0.0,olddim+increment);
419 if (newdim<olddim) {
420 if (newdim<minDimension) {
421// Collapse if needed
422 if (mayCollapse&&[self canCollapse]&&(newdim<MAX(1.0,minDimension*(0.5-HYSTERESIS)))) {
423 return [self RB___collapse];
424 }
425 newdim = minDimension;
426 }
427 } else if (newdim>olddim) {
428 if (olddim<1.0) {
429// Expand if needed.
430 if (newdim>(minDimension*(0.5+HYSTERESIS))) {
431 newdim = MAX(newdim,[self RB___expandAndSetToMinimum:YES]);
432 } else {
433 return 0.0;
434 }
435 }
436 if (newdim>maxDimension) {
437 newdim = maxDimension;
438 }
439 }
440 if ((int)newdim!=(int)olddim) {
441// The dimension has changed.
442 increment = newdim-olddim;
443 DIM(frame.size) = newdim;
444 if (move) {
445 DIM(frame.origin) -= increment;
446 }
447// We call super instead of self here to postpone adjusting subviews for nested splitviews.
448// [super setFrameSize:frame.size];
449 [super setFrame:frame];
450 [sv RB___setMustClearFractions];
451 [sv setMustAdjust];
452 }
453 return newdim-olddim;
454}
#define MAX(A, B)
Definition OOMaths.h:114
return self
#define DIM(x)
#define HYSTERESIS
RBSplitView * splitView()

References canCollapse, DIM, HYSTERESIS, RBSplitView::isHorizontal, MAX, maxDimension, minDimension, RB___collapse, RBSplitView::RB___setMustClearFractions, RBSplitView::setMustAdjust, and splitView.

Referenced by RBSplitView(RB___ViewAdditions)::RB___tryToExpandLeading:divider:trailing:delta:, RBSplitView(RB___ViewAdditions)::RB___tryToExpandTrailing:leading:delta:, RBSplitView(RB___ViewAdditions)::RB___tryToShortenLeading:divider:trailing:delta:always:, and RBSplitView(RB___ViewAdditions)::RB___tryToShortenTrailing:divider:leading:delta:always:.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ collapse

- (CGFloat) collapse

Definition at line 237 of file RBSplitSubview.m.

237 {
238 return [self RB___collapse];
239}

References collapse, and RB___collapse.

Referenced by collapse, and maxDimension.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ collapseWithAnimation

- (BOOL) collapseWithAnimation

Definition at line 243 of file RBSplitSubview.m.

243 {
244 return [self collapseWithAnimation:YES withResize:YES];
245}

References collapseWithAnimation, and collapseWithAnimation:withResize:.

Referenced by collapseWithAnimation, collapseWithAnimation:withResize:, and maxDimension.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ collapseWithAnimation:withResize:

- (BOOL) collapseWithAnimation: (BOOL) animate
withResize: (BOOL) resize 

Definition at line 256 of file RBSplitSubview.m.

256 :(BOOL)animate withResize:(BOOL)resize {
258 if ([self canCollapse]) {
259 if (animate&&[self RB___animationData:YES resize:resize]) {
260 [self RB___clearResponder];
261 [self RB___stepAnimation];
262 return YES;
263 } else {
264 [self RB___collapse];
265 }
266 }
267 }
268 return NO;
269}
@ RBSSubviewNormal
RBSSubviewStatus status()

References canCollapse, collapseWithAnimation, RB___clearResponder, RB___collapse, RB___stepAnimation, RBSSubviewNormal, and status.

Referenced by collapseWithAnimation.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ coupledSplitView

- (RBSplitView *) coupledSplitView

Reimplemented in RBSplitView.

Definition at line 55 of file RBSplitSubview.m.

55 {
56 return nil;
57}

References coupledSplitView, and nil.

Referenced by coupledSplitView.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ couplingSplitView

- (RBSplitView *) couplingSplitView

Reimplemented in RBSplitView.

Definition at line 108 of file RBSplitSubview.m.

108 {
109 id result = [self superview];
110 if ([result isKindOfClass:[RBSplitView class]]) {
111 return (RBSplitView*)result;
112 }
113 return nil;
114}

References couplingSplitView, and nil.

Referenced by couplingSplitView, RBSplitView::couplingSplitView, isOpaque, and mouseDown:.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dealloc

- (void) dealloc
implementation

Reimplemented in RBSplitView.

Definition at line 45 of file RBSplitSubview.m.

45 {
46 [identifier release];
47 [super dealloc];
48}

References dealloc.

Referenced by dealloc, and RBSplitView::dealloc.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ description

- (NSString *) description
implementation

Reimplemented in RBSplitView.

Definition at line 152 of file RBSplitSubview.m.

152 {
153 return [identifier length]>0?[NSString stringWithFormat:@"%@(%@)",[super description],identifier]:[super description];
154}

References description.

Referenced by description, and RBSplitView::description.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dimension

- (CGFloat) dimension

Definition at line 309 of file RBSplitSubview.m.

309 {
310 CGFloat dim = [self RB___visibleDimension];
311 if (dim<=0.0) {
312 dim = [[self splitView] RB___dimensionWithoutDividers]*fraction;
313 if (dim<minDimension) {
314 dim = minDimension;
315 } else if (dim>maxDimension) {
316 dim = maxDimension;
317 }
318 }
319 return dim;
320}

References dimension, fraction, maxDimension, minDimension, RBSplitView::RB___dimensionWithoutDividers, RB___visibleDimension, and splitView.

Referenced by dimension, maxDimension, RBSplitView::mouseDown:, RBSplitSubview(RB___SubviewAdditions)::RB___animationData:resize:, RBSplitView(RB___ViewAdditions)::RB___tryToExpandLeading:divider:trailing:delta:, RBSplitView(RB___ViewAdditions)::RB___tryToExpandTrailing:leading:delta:, RBSplitView(RB___ViewAdditions)::RB___tryToShortenLeading:divider:trailing:delta:always:, RBSplitView(RB___ViewAdditions)::RB___tryToShortenTrailing:divider:leading:delta:always:, and setMinDimension:andMaxDimension:.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ display

- (void) display
implementation

Reimplemented in RBSplitView.

Definition at line 362 of file RBSplitSubview.m.

362 {
363 RBSplitView* sv = [self splitView];
364 if (sv) {
365 if ([sv mustAdjust]) {
366 [sv display];
367 } else {
368 [super display];
369 }
370 }
371}

References display, RBSplitView::display, and splitView.

Referenced by display, RBSplitView::display, RBSplitView::mouseDown:, RBSplitSubview(RB___SubviewAdditions)::RB___finishCollapse:withFraction:, RBSplitSubview(RB___SubviewAdditions)::RB___finishExpand:withFraction:, and RBSplitSubview(RB___SubviewAdditions)::RB___stepAnimation.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drawRect:

- (void) drawRect: (NSRect) rect
implementation

Reimplemented in RBSplitView.

Definition at line 347 of file RBSplitSubview.m.

347 :(NSRect)rect {
348 RBSplitView* sv = [self splitView];
349 NSColor* bg = [sv background];
350 if (bg) {
351 [bg set];
352 NSRectFillUsingOperation(rect,NSCompositeSourceOver);
353 }
354 id del = [sv delegate];
355 if ([del respondsToSelector:@selector(splitView:willDrawSubview:inRect:)]) {
356 [del splitView:sv willDrawSubview:self inRect:rect];
357 }
358}
IBOutlet id delegate
NSColor * background

References RBSplitView::background, RBSplitView::delegate, and splitView.

Referenced by RBSplitView::drawRect:.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ encodeWithCoder:

- (void) encodeWithCoder: (NSCoder*) coder
implementation

Reimplemented in RBSplitView.

Definition at line 545 of file RBSplitSubview.m.

545 :(NSCoder*)coder {
546 NSRect frame;
547 BOOL coll = [self isCollapsed];
548 if (coll) {
549// We can't encode a collapsed subview as-is, so we correct the frame size first and add WAYOUT
550// to the origin to signal it was collapsed.
551 NSRect newf = frame = [self frame];
552 newf.origin.x += WAYOUT;
553 [super setFrameOrigin:newf.origin];
554 newf.size = savedSize;
555 [super setFrameSize:newf.size];
556 }
557 [super encodeWithCoder:coder];
558 if (coll) {
559 [super setFrame:frame];
560 }
561 if ([coder allowsKeyedCoding]) {
562 [coder encodeObject:identifier forKey:@"identifier"];
563 [coder encodeInteger:tag forKey:@"tag"];
564 [coder encodeDouble:minDimension forKey:@"minDimension"];
565 [coder encodeDouble:maxDimension forKey:@"maxDimension"];
566 [coder encodeDouble:fraction forKey:@"fraction"];
567 [coder encodeBool:canCollapse forKey:@"canCollapse"];
568 } else {
569 [coder encodeObject:identifier];
570 [coder encodeValueOfObjCType:@encode(typeof(tag)) at:&tag];
571 [coder encodeValueOfObjCType:@encode(typeof(minDimension)) at:&minDimension];
572 [coder encodeValueOfObjCType:@encode(typeof(maxDimension)) at:&maxDimension];
573 [coder encodeValueOfObjCType:@encode(typeof(fraction)) at:&fraction];
574 [coder encodeValueOfObjCType:@encode(typeof(canCollapse)) at:&canCollapse];
575 }
576}
#define WAYOUT

References isCollapsed, savedSize, and WAYOUT.

Referenced by RBSplitView::encodeWithCoder:.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expand

- (CGFloat) expand

Definition at line 228 of file RBSplitSubview.m.

228 {
229 return [self RB___expandAndSetToMinimum:NO];
230}

References expand, and RB___expandAndSetToMinimum:.

Referenced by expand, and maxDimension.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expandWithAnimation

- (BOOL) expandWithAnimation

Definition at line 249 of file RBSplitSubview.m.

249 {
250 return [self expandWithAnimation:YES withResize:YES];
251}

References expandWithAnimation, and expandWithAnimation:withResize:.

Referenced by expandWithAnimation, expandWithAnimation:withResize:, and maxDimension.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expandWithAnimation:withResize:

- (BOOL) expandWithAnimation: (BOOL) animate
withResize: (BOOL) resize 

Definition at line 271 of file RBSplitSubview.m.

271 :(BOOL)animate withResize:(BOOL)resize {
273 if (animate&&[self RB___animationData:YES resize:resize]) {
274 [self RB___stepAnimation];
275 return YES;
276 } else {
277 [self RB___expandAndSetToMinimum:NO];
278 }
279 }
280 return NO;
281}
@ RBSSubviewCollapsed

References expandWithAnimation, RB___expandAndSetToMinimum:, RB___stepAnimation, RBSSubviewCollapsed, and status.

Referenced by expandWithAnimation.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hitTest:

- (NSView *) hitTest: (NSPoint) aPoint
implementation

Definition at line 463 of file RBSplitSubview.m.

463 :(NSPoint)aPoint {
464 if ([self mouse:aPoint inRect:[self frame]]) {
465 RBSplitView* sv = [self splitView];
466 id delegate = [sv delegate];
467 if ([delegate respondsToSelector:@selector(splitView:dividerForPoint:inSubview:)]) {
468 actDivider = [delegate splitView:sv dividerForPoint:aPoint inSubview:self];
469 if ((actDivider+1)<[sv RB___numberOfSubviews]) {
470 return self;
471 }
472 }
473 actDivider = NSNotFound;
474 NSView* result = [super hitTest:aPoint];
475 canDragWindow = ![[result opaqueAncestor] isDescendantOf:[[result window] contentView]];
476 return result;
477 }
478 return nil;
479}
NSUInteger actDivider

References actDivider, canDragWindow, RBSplitView::delegate, nil, and splitView.

+ Here is the call graph for this function:

◆ identifier

- (NSString *) identifier

References identifier, isCollapsed, position, and status.

+ Here is the call graph for this function:

◆ initWithCoder:

- (id) initWithCoder: (NSCoder*) coder
implementation

Reimplemented in RBSplitView.

Definition at line 578 of file RBSplitSubview.m.

578 :(NSCoder*)coder {
579 if ((self = [super initWithCoder:coder])) {
580 fraction = 0.0;
581 canCollapse = NO;
582 notInLimits = NO;
583 minDimension = 1.0;
585 identifier = @"";
586 actDivider = NSNotFound;
587 canDragWindow = NO;
588 previous = [self frame];
589 savedSize = previous.size;
590 if (previous.origin.x>=WAYOUT) {
591// The subview was collapsed when encoded, so we correct the origin and collapse it.
592 BOOL ishor = [self splitViewIsHorizontal];
593 previous.origin.x -= WAYOUT;
594 DIM(previous.size) = 0.0;
595 [self setFrameOrigin:previous.origin];
596 [self setFrameSize:previous.size];
597 }
598 previous = NSZeroRect;
599 if ([coder allowsKeyedCoding]) {
600 [self setIdentifier:[coder decodeObjectForKey:@"identifier"]];
601 tag = [coder decodeIntegerForKey:@"tag"];
602 minDimension = [coder decodeDoubleForKey:@"minDimension"];
603 maxDimension = [coder decodeDoubleForKey:@"maxDimension"];
604 fraction = [coder decodeDoubleForKey:@"fraction"];
605 canCollapse = [coder decodeBoolForKey:@"canCollapse"];
606 } else {
607 [self setIdentifier:[coder decodeObject]];
608 [coder decodeValueOfObjCType:@encode(typeof(tag)) at:&tag];
609 [coder decodeValueOfObjCType:@encode(typeof(minDimension)) at:&minDimension];
610 [coder decodeValueOfObjCType:@encode(typeof(maxDimension)) at:&maxDimension];
611 [coder decodeValueOfObjCType:@encode(typeof(fraction)) at:&fraction];
612 [coder decodeValueOfObjCType:@encode(typeof(canCollapse)) at:&canCollapse];
613 }
614 }
615 return self;
616}
NSString * identifier

References actDivider, canCollapse, canDragWindow, DIM, fraction, identifier, maxDimension, minDimension, notInLimits, previous, savedSize, setIdentifier:, splitViewIsHorizontal, tag, and WAYOUT.

+ Here is the call graph for this function:

◆ initWithFrame:

- (id) initWithFrame: (NSRect) frame

Reimplemented in RBSplitView.

Definition at line 27 of file RBSplitSubview.m.

27 :(NSRect)frame {
28 self = [super initWithFrame:frame];
29 if (self) {
30 fraction = 0.0;
31 canCollapse = NO;
32 notInLimits = NO;
33 minDimension = 1.0;
35 identifier = @"";
36 previous = NSZeroRect;
37 savedSize = frame.size;
38 actDivider = NSNotFound;
39 canDragWindow = NO;
40 }
41 return self;
42}

References actDivider, canCollapse, canDragWindow, fraction, identifier, maxDimension, minDimension, notInLimits, previous, savedSize, and WAYOUT.

Referenced by RBSplitView::initWithFrame:.

+ Here is the caller graph for this function:

◆ isCollapsed

- (BOOL) isCollapsed

Definition at line 179 of file RBSplitSubview.m.

179 {
180 return [self RB___visibleDimension]<=0.0;
181}

References isCollapsed, and RB___visibleDimension.

Referenced by RBSplitView::adjustSubviewsExcepting:, RBSplitView::drawRect:, encodeWithCoder:, identifier, isCollapsed, RBSplitView::mouseDown:, RBSplitSubview(RB___SubviewAdditions)::RB___animationData:resize:, and RBSplitView::stringWithSavedState.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCoupled

- (BOOL) isCoupled

Definition at line 64 of file RBSplitSubview.m.

64 {
65 return NO;
66}

References isCoupled.

Referenced by isCoupled.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFlipped

- (BOOL) isFlipped
implementation

Reimplemented in RBSplitView.

Definition at line 69 of file RBSplitSubview.m.

69 {
70 return NO;
71}

References isFlipped.

Referenced by isFlipped.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isOpaque

- (BOOL) isOpaque
implementation

Reimplemented in RBSplitView.

Definition at line 74 of file RBSplitSubview.m.

74 {
75 return [[self couplingSplitView] isOpaque];
76}

References couplingSplitView, isOpaque, and RBSplitView::isOpaque.

Referenced by isOpaque.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maxDimension

- (CGFloat) maxDimension

References collapse, collapseWithAnimation, dimension, expand, expandWithAnimation, and maxDimension.

+ Here is the call graph for this function:

◆ minDimension

- (CGFloat) minDimension

References minDimension.

◆ mouseDown:

- (void) mouseDown: (NSEvent*) theEvent
implementation

Reimplemented in RBSplitView.

Definition at line 483 of file RBSplitSubview.m.

483 :(NSEvent*)theEvent {
484 NSWindow* window = [self window];
485 NSPoint where = [theEvent locationInWindow];
486 if (actDivider<NSNotFound) {
487 // Cache divider# here for the loop
488 NSUInteger thediv = actDivider;
489// The mouse down was inside an alternate drag view; actDivider was just set in hitTest.
490 RBSplitView* sv = [self splitView];
491 NSPoint point = [sv convertPoint:where fromView:nil];
492 [[RBSplitView cursor:RBSVDragCursor] push];
493 NSPoint base = NSZeroPoint;
494// Record the current divider coordinate.
495 CGFloat divc = [sv RB___dividerOrigin:thediv];
496 BOOL ishor = [sv isHorizontal];
497 [sv RB___setDragging:YES];
498// Loop while the button is down.
499 while ((theEvent = [NSApp nextEventMatchingMask:NSLeftMouseDownMask|NSLeftMouseDraggedMask|NSLeftMouseUpMask untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:YES])&&([theEvent type]!=NSLeftMouseUp)) {
500// Set up a local autorelease pool for the loop to prevent buildup of temporary objects.
501 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
502 NSDisableScreenUpdates();
503// This does the actual movement.
504 [sv RB___trackMouseEvent:theEvent from:point withBase:base inDivider:thediv];
505 if ([sv mustAdjust]) {
506// If something changed, we clear fractions and redisplay.
508 [sv display];
509 }
510// Change the drag point by the actual amount moved.
511 CGFloat newc = [sv RB___dividerOrigin:thediv];
512 DIM(point) += newc-divc;
513 divc = newc;
514 NSEnableScreenUpdates();
515 [pool drain];
516 }
517 [sv RB___setDragging:NO];
518 [NSCursor pop];
519 actDivider = NSNotFound;
520 return;
521 }
522 if (canDragWindow&&[window isMovableByWindowBackground]&&![[self couplingSplitView] background]) {
523// If we get here, it's a textured (metal) window, the mouse has gone down on an non-opaque portion
524// of the subview, and our RBSplitView has a transparent background. RBSplitView returns NO to
525// mouseDownCanMoveWindow, but the window should move here - after all, the window background
526// is visible right here! So we fake it and move the window as intended. Mwahahaha!
527 where = [window convertBaseToScreen:where];
528 NSPoint origin = [window frame].origin;
529// Now we loop handling mouse events until we get a mouse up event.
530 while ((theEvent = [NSApp nextEventMatchingMask:NSLeftMouseDownMask|NSLeftMouseDraggedMask|NSLeftMouseUpMask untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:YES])&&([theEvent type]!=NSLeftMouseUp)) {
531// Set up a local autorelease pool for the loop to prevent buildup of temporary objects.
532 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
533 NSPoint now = [window convertBaseToScreen:[theEvent locationInWindow]];
534 origin.x += now.x-where.x;
535 origin.y += now.y-where.y;
536// Move the window by the mouse displacement since the last event.
537 [window setFrameOrigin:origin];
538 where = now;
539 [pool drain];
540 }
541 }
542}
float y
float x
RBSplitView * couplingSplitView()
void RB___trackMouseEvent:from:withBase:inDivider:(NSEvent *theEvent,[from] NSPoint where,[withBase] NSPoint base,[inDivider] NSUInteger indx)
CGFloat RB___dividerOrigin:(NSUInteger indx)
void RB___setDragging:(BOOL flag)
NSCursor * cursor:(RBSVCursorType type)
Definition RBSplitView.m:33
void RB___setMustClearFractions()
BOOL isHorizontal
voidpf uLong int origin
Definition ioapi.h:140

References actDivider, canDragWindow, couplingSplitView, RBSplitView::cursor:, DIM, RBSplitView::display, RBSplitView::isHorizontal, RBSplitView::RB___dividerOrigin:, RBSplitView::RB___setDragging:, RBSplitView::RB___setMustClearFractions, RBSplitView::RB___trackMouseEvent:from:withBase:inDivider:, and splitView.

Referenced by RBSplitView::mouseDown:.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ numberOfSubviews

- (NSUInteger) numberOfSubviews

Definition at line 457 of file RBSplitSubview.m.

457 {
458 return [[self subviews] count];
459}

References numberOfSubviews.

Referenced by numberOfSubviews.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outermostSplitView

- (RBSplitView *) outermostSplitView

Definition at line 117 of file RBSplitSubview.m.

117 {
118 id result = nil;
119 id sv = self;
120 while ((sv = [sv superview])&&[sv isKindOfClass:[RBSplitView class]]) {
121 result = sv;
122 }
123 return result;
124}

References nil, and outermostSplitView.

Referenced by outermostSplitView.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ position

- (NSUInteger) position

Definition at line 158 of file RBSplitSubview.m.

158 {
159 RBSplitView* sv = [self splitView];
160 return sv?[[sv subviews] indexOfObjectIdenticalTo:self]:0;
161}

References position, and splitView.

Referenced by identifier, position, and RBSplitView::subviewAtPosition:.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RB___animationData:resize:

- (animationData *) RB___animationData: (BOOL) start
resize: (BOOL) resize 
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 631 of file RBSplitSubview.m.

631 :(BOOL)start resize:(BOOL)resize {
632 if (currentAnimation&&(currentAnimation->owner!=self)) {
633// There already is an animation in progress on some other subview.
634 return nil;
635 }
636 if (start) {
637// We want to start (or restart) an animation.
638 RBSplitView* sv = [self splitView];
639 if (sv) {
640 CGFloat dim = [self dimension];
641// First assume the default time, then ask the delegate.
642 NSTimeInterval total = dim*(0.2/150.0);
643 id delegate = [sv delegate];
644 if ([delegate respondsToSelector:@selector(splitView:willAnimateSubview:withDimension:)]) {
645 total = [delegate splitView:sv willAnimateSubview:self withDimension:dim];
646 }
647// No use animating anything shorter than the frametime.
648 if (total>FRAMETIME) {
649 if (!currentAnimation) {
650 currentAnimation = (animationData*)malloc(sizeof(animationData));
651 }
652 if (currentAnimation) {
653 currentAnimation->owner = self;
657 currentAnimation->collapsing = ![self isCollapsed];
659 currentAnimation->finishTime = [NSDate timeIntervalSinceReferenceDate]+total;
660 currentAnimation->resizing = resize;
661 [sv RB___setDragging:YES];
662 }
663 } else if (currentAnimation) {
664 free(currentAnimation);
665 currentAnimation = NULL;
666 }
667 }
668 }
669 return currentAnimation;
670}
#define FRAMETIME
struct animationData animationData

Referenced by RBSplitSubview(RB___SubviewAdditions)::RB___stepAnimation, resizeSubviewsWithOldSize:, and status.

+ Here is the caller graph for this function:

◆ RB___clearResponder

- (BOOL) RB___clearResponder
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 796 of file RBSplitSubview.m.

796 {
797 NSWindow* window = [self window];
798 if (window) {
799 NSView* responder = (NSView*)[window firstResponder];
800 if (responder&&[responder respondsToSelector:@selector(isDescendantOf:)]) {
801 if ([responder isDescendantOf:self]) {
802 if ([window makeFirstResponder:nil]) {
803 [responder display];
804 return YES;
805 }
806 }
807 }
808 }
809 return NO;
810}

Referenced by collapseWithAnimation:withResize:, RBSplitSubview(RB___SubviewAdditions)::RB___collapse, and RBSplitSubview(RB___SubviewAdditions)::RB___updateFromCache:withTotalDimension:.

+ Here is the caller graph for this function:

◆ RB___collapse

- (CGFloat) RB___collapse
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 814 of file RBSplitSubview.m.

814 {
815 CGFloat result = 0.0;
816 if (![self isCollapsed]) {
817 RBSplitView* sv = [self splitView];
818 if (sv&&[self canCollapse]) {
819 [self RB___clearResponder];
820 NSRect frame = [self frame];
821 BOOL ishor = [sv isHorizontal];
822 result = DIM(frame.size);
823// For collapsed views, fraction will contain the fraction of the dimension previously occupied
824 DIM(frame.size) = 0.0;
825 [self RB___finishCollapse:frame withFraction:result/[sv RB___dimensionWithoutDividers]];
826 }
827 }
828 return -result;
829}
CGFloat RB___dimensionWithoutDividers()

Referenced by changeDimensionBy:mayCollapse:move:, collapse, collapseWithAnimation:withResize:, RBSplitView(RB___ViewAdditions)::RB___tryToExpandLeading:divider:trailing:delta:, RBSplitView(RB___ViewAdditions)::RB___tryToExpandTrailing:leading:delta:, and RBSplitView::setStateFromString:.

+ Here is the caller graph for this function:

◆ RB___copyIntoCache:

- (void) RB___copyIntoCache: (subviewCache*) cache
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 746 of file RBSplitSubview.m.

746 :(subviewCache*)cache {
747 cache->sub = self;
748 cache->rect = [self frame];
749 cache->size = [self RB___visibleDimension];
750 cache->fraction = fraction;
751 cache->constrain = NO;
752}
struct subviewCache subviewCache

◆ RB___expandAndSetToMinimum:

- (CGFloat) RB___expandAndSetToMinimum: (BOOL) setToMinimum
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 849 of file RBSplitSubview.m.

849 :(BOOL)setToMinimum {
850 CGFloat result = 0.0;
851 RBSplitView* sv = [self splitView];
852 if (sv&&[self isCollapsed]) {
853 NSRect frame = [super frame];
854 double frac = fraction;
855 BOOL ishor = [sv isHorizontal];
856 if (setToMinimum) {
857 result = DIM(frame.size) = minDimension;
858 } else {
859 result = [sv RB___dimensionWithoutDividers]*frac;
860// We need to apply a compensation factor for proportional resizing in adjustSubviews.
861 CGFloat newdim = floor((frac>=1.0)?result:result/(1.0-frac));
862 DIM(frame.size) = newdim;
863 result = floor(result);
864 }
865 [self RB___finishExpand:frame withFraction:0.0];
866 }
867 return result;
868}

Referenced by expand, and expandWithAnimation:withResize:.

+ Here is the caller graph for this function:

◆ RB___finishCollapse:withFraction:

- (void) RB___finishCollapse: (NSRect) rect
withFraction: (double) value 
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 833 of file RBSplitSubview.m.

833 :(NSRect)rect withFraction:(double)value {
834 RBSplitView* sv = [self splitView];
835 BOOL finish = [self RB___stopAnimation];
836 [self RB___setFrame:rect withFraction:value notify:YES];
837 [sv RB___setMustClearFractions];
838 if (finish) {
839 [self display];
840 }
841 id delegate = [sv delegate];
842 if ([delegate respondsToSelector:@selector(splitView:didCollapse:)]) {
843 [delegate splitView:sv didCollapse:self];
844 }
845}

Referenced by RBSplitSubview(RB___SubviewAdditions)::RB___collapse, RBSplitSubview(RB___SubviewAdditions)::RB___stepAnimation, and RBSplitSubview(RB___SubviewAdditions)::RB___updateFromCache:withTotalDimension:.

+ Here is the caller graph for this function:

◆ RB___finishExpand:withFraction:

- (void) RB___finishExpand: (NSRect) rect
withFraction: (double) value 
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 872 of file RBSplitSubview.m.

872 :(NSRect)rect withFraction:(double)value {
873 RBSplitView* sv = [self splitView];
874 BOOL finish = [self RB___stopAnimation];
875 [self RB___setFrame:rect withFraction:value notify:YES];
876 [sv RB___setMustClearFractions];
877 if (finish) {
878 [self display];
879 }
880 id delegate = [sv delegate];
881 if ([delegate respondsToSelector:@selector(splitView:didExpand:)]) {
882 [delegate splitView:sv didExpand:self];
883 }
884}

Referenced by RBSplitSubview(RB___SubviewAdditions)::RB___expandAndSetToMinimum:, RBSplitSubview(RB___SubviewAdditions)::RB___stepAnimation, and RBSplitSubview(RB___SubviewAdditions)::RB___updateFromCache:withTotalDimension:.

+ Here is the caller graph for this function:

◆ RB___fraction

- (double) RB___fraction
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 917 of file RBSplitSubview.m.

917 {
918 return fraction;
919}

Referenced by RBSplitView(RB___ViewAdditions)::RB___adjustSubviewsExcepting:.

+ Here is the caller graph for this function:

◆ RB___setFrame:withFraction:notify:

- (void) RB___setFrame: (NSRect) rect
withFraction: (double) value
notify: (BOOL) notify 
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 888 of file RBSplitSubview.m.

888 :(NSRect)rect withFraction:(double)value notify:(BOOL)notify {
889 RBSplitView* sv = [self splitView];
890 id delegate = nil;
891 if (notify) {
892 delegate = [sv delegate];
893// If the delegate method isn't implemented, we ignore the delegate altogether.
894 if ([delegate respondsToSelector:@selector(splitView:changedFrameOfSubview:from:to:)]) {
895// If the rects are equal, the delegate isn't called.
896 if (NSEqualRects(previous,rect)) {
897 delegate = nil;
898 }
899 } else {
900 delegate = nil;
901 }
902 }
903 [sv setMustAdjust];
904 [self setFrame:rect];
905 fraction = value;
906 [delegate splitView:sv changedFrameOfSubview:self from:previous to:rect];
907 previous = delegate?rect:NSZeroRect;
908}

Referenced by RBSplitSubview(RB___SubviewAdditions)::RB___finishCollapse:withFraction:, RBSplitSubview(RB___SubviewAdditions)::RB___finishExpand:withFraction:, RBSplitSubview(RB___SubviewAdditions)::RB___stepAnimation, RBSplitSubview(RB___SubviewAdditions)::RB___updateFromCache:withTotalDimension:, and RBSplitView::setStateFromString:.

+ Here is the caller graph for this function:

◆ RB___setFrameSize:withFraction:

- (void) RB___setFrameSize: (NSSize) size
withFraction: (double) value 
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 910 of file RBSplitSubview.m.

910 :(NSSize)size withFraction:(double)value {
911 [[self splitView] setMustAdjust];
912 [self setFrameSize:size];
913 fraction = value;
914}
voidpf void uLong size
Definition ioapi.h:134

Referenced by RBSplitView(RB___ViewAdditions)::RB___adjustSubviewsExcepting:.

+ Here is the caller graph for this function:

◆ RB___setHidden:

- (void) RB___setHidden: (BOOL) flag
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 623 of file RBSplitSubview.m.

623 :(BOOL)flag {
624 [super setHidden:flag];
625}

Referenced by setHidden:, and RBSplitView::setStateFromString:.

+ Here is the caller graph for this function:

◆ RB___setMinAndMaxTo:savingMin:andMax:

- (CGFloat) RB___setMinAndMaxTo: (CGFloat) value
savingMin: (CGFloat*) oldmin
andMax: (CGFloat*) oldmax 
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 780 of file RBSplitSubview.m.

780 :(CGFloat)value savingMin:(CGFloat*)oldmin andMax:(CGFloat*)oldmax {
781 *oldmin = [self minDimension];
782 *oldmax = [self maxDimension];
783 if (value<*oldmin) {
784 value = *oldmin;
785 }
786 if (value>*oldmax) {
787 value = *oldmax;
788 }
789 minDimension = maxDimension = value;
790 return value;
791}

Referenced by RBSplitSubview(RB___SubviewAdditions)::RB___stepAnimation.

+ Here is the caller graph for this function:

◆ RB___stepAnimation

- (void) RB___stepAnimation
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 673 of file RBSplitSubview.m.

673 {
674 NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];
675 animationData* anim = [self RB___animationData:NO resize:NO];
676 if (anim) {
677 RBSplitView* sv = [self splitView];
678 NSTimeInterval remain = anim->finishTime-now;
679 NSRect frame = [self frame];
680 BOOL ishor = [sv isHorizontal];
681// Continuing animation only makes sense if we still have at least FRAMETIME available.
682 if (remain>=FRAMETIME) {
683 CGFloat avg = anim->elapsedTime;
684// We try to keep a record of how long it takes, on the average, to resize and adjust
685// one animation frame.
686 if (anim->stepsDone) {
687 avg /= anim->stepsDone;
688 }
689 NSTimeInterval delay = MIN(0.0,FRAMETIME-avg);
690// We adjust the new dimension proportionally to how much of the designated time has passed.
691 CGFloat dim = floor(anim->dimension*(remain-avg)/anim->totalTime);
692 if (dim>4.0) {
693 if (!anim->collapsing) {
694 dim = anim->dimension-dim;
695 }
696 DIM(frame.size) = dim;
697 [self RB___setFrame:frame withFraction:0.0 notify:NO];
698 [sv adjustSubviews];
699 [self display];
700 anim->elapsedTime += [NSDate timeIntervalSinceReferenceDate]-now;
701 ++anim->stepsDone;
702// Schedule a timer to do the next animation step.
703 [self performSelector:@selector(RB___stepAnimation) withObject:nil afterDelay:delay inModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode,NSModalPanelRunLoopMode,
704 NSEventTrackingRunLoopMode,nil]];
705 return;
706 }
707 }
708// We're finished, either collapse or expand entirely now.
709 if (anim->collapsing) {
710 DIM(frame.size) = 0.0;
711 [self RB___finishCollapse:frame withFraction:anim->dimension/[sv RB___dimensionWithoutDividers]];
712 } else {
713 CGFloat savemin,savemax;
714 CGFloat dim = [self RB___setMinAndMaxTo:anim->dimension savingMin:&savemin andMax:&savemax];
715 DIM(frame.size) = dim;
716 [self RB___finishExpand:frame withFraction:0.0];
717 minDimension = savemin;
718 maxDimension = savemax;
719 }
720 }
721}
#define MIN(A, B)
Definition OOMaths.h:111
void adjustSubviews()

Referenced by collapseWithAnimation:withResize:, and expandWithAnimation:withResize:.

+ Here is the caller graph for this function:

◆ RB___stopAnimation

- (BOOL) RB___stopAnimation
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 725 of file RBSplitSubview.m.

725 {
727 [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(RB___stepAnimation) object:nil];
728 free(currentAnimation);
729 currentAnimation = NULL;
730 [[self splitView] RB___setDragging:NO];
731 return YES;
732 }
733 return NO;
734}

Referenced by RBSplitSubview(RB___SubviewAdditions)::RB___finishCollapse:withFraction:, RBSplitSubview(RB___SubviewAdditions)::RB___finishExpand:withFraction:, and RBSplitView::willRemoveSubview:.

+ Here is the caller graph for this function:

◆ RB___updateFromCache:withTotalDimension:

- (void) RB___updateFromCache: (subviewCache*) cache
withTotalDimension: (CGFloat) value 
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 754 of file RBSplitSubview.m.

754 :(subviewCache*)cache withTotalDimension:(CGFloat)value {
755 CGFloat dim = [self RB___visibleDimension];
756 if (cache->size>=1.0) {
757// New state is not collapsed.
758 if (dim>=1.0) {
759// Old state was not collapsed, so we just change the frame.
760 [self RB___setFrame:cache->rect withFraction:cache->fraction notify:YES];
761 } else {
762// Old state was collapsed, so we expand it.
763 [self RB___finishExpand:cache->rect withFraction:cache->fraction];
764 }
765 } else {
766// New state is collapsed.
767 if (dim>=1.0) {
768// Old state was not collapsed, so we clear first responder and change the frame.
769 [self RB___clearResponder];
770 [self RB___finishCollapse:cache->rect withFraction:dim/value];
771 } else {
772// It was collapsed already, but the frame may have changed, so we set it.
773 [self RB___setFrame:cache->rect withFraction:cache->fraction notify:YES];
774 }
775 }
776}
CGFloat RB___visibleDimension()

◆ RB___visibleDimension

- (CGFloat) RB___visibleDimension
implementation

Provided by category RBSplitSubview(RB___SubviewAdditions).

Definition at line 738 of file RBSplitSubview.m.

738 {
739 BOOL ishor = [self splitViewIsHorizontal];
740 NSRect frame = [self frame];
741 return MAX(0.0,DIM(frame.size));
742}

Referenced by canExpand, canShrink, dimension, isCollapsed, RBSplitSubview(RB___SubviewAdditions)::RB___copyIntoCache:, RBSplitSubview(RB___SubviewAdditions)::RB___updateFromCache:withTotalDimension:, and status.

+ Here is the caller graph for this function:

◆ resizeSubviewsWithOldSize:

- (void) resizeSubviewsWithOldSize: (NSSize) oldBoundsSize
implementation

Definition at line 383 of file RBSplitSubview.m.

383 :(NSSize)oldBoundsSize {
384 RBSplitView* sv = [self splitView];
385 if (sv) {
386 BOOL ishor = [sv isHorizontal];
387 NSRect frame = [self frame];
388 CGFloat dim = DIM(frame.size);
389 CGFloat other = OTHER(frame.size);
390// We resize subviews only when we're inside the subview's limits and the containing splitview's limits.
391 animationData* anim = [self RB___animationData:NO resize:NO];
392 if ((dim>=(anim&&!anim->resizing?anim->dimension:minDimension))&&(dim<=maxDimension)&&(other>=[sv minDimension])&&(other<=[sv maxDimension])) {
393 if (notInLimits) {
394// The subviews can be resized, so we restore the saved size.
395 oldBoundsSize = savedSize;
396 }
397// We save the size every time the subview's subviews are resized within the limits.
398 notInLimits = NO;
399 savedSize = frame.size;
400 [super resizeSubviewsWithOldSize:oldBoundsSize];
401 } else {
402 notInLimits = YES;
403 }
404 }
405}
#define OTHER(x)

References DIM, animationData::dimension, RBSplitView::isHorizontal, maxDimension, minDimension, notInLimits, OTHER, RB___animationData:resize:, animationData::resizing, savedSize, and splitView.

+ Here is the call graph for this function:

◆ setAutoresizesSubviews:

- (void) setAutoresizesSubviews: (BOOL) flag
implementation

Definition at line 379 of file RBSplitSubview.m.

379 :(BOOL)flag {
380}

◆ setCanCollapse:

- (void) setCanCollapse: (BOOL) flag

Definition at line 219 of file RBSplitSubview.m.

219 :(BOOL)flag {
220 canCollapse = flag;
221}

References canCollapse.

◆ setCoupled:

- (void) setCoupled: (BOOL) flag

Reimplemented in RBSplitView.

Definition at line 61 of file RBSplitSubview.m.

61 :(BOOL)flag {
62}

◆ setDimension:

- (void) setDimension: (CGFloat) value

Definition at line 324 of file RBSplitSubview.m.

324 :(CGFloat)value {
325 if (value<minDimension) {
326 value = minDimension;
327 } else if (value>maxDimension) {
328 value = maxDimension;
329 }
330 RBSplitView* sv = [self splitView];
331 NSSize size = [self frame].size;
332 BOOL ishor = [sv isHorizontal];
333 if (DIM(size)>0.0) {
334// We're not collapsed, set the size and adjust other subviews.
335 DIM(size) = value;
336 [self setFrameSize:size];
337 [sv adjustSubviewsExcepting:self];
338 } else {
339// We're collapsed, adjust the fraction so that we'll have the (approximately) correct
340// dimension after expanding.
342 }
343}
void adjustSubviewsExcepting:(RBSplitSubview *excepting)

References RBSplitView::adjustSubviewsExcepting:, DIM, fraction, RBSplitView::isHorizontal, maxDimension, minDimension, RBSplitView::RB___dimensionWithoutDividers, and splitView.

Referenced by OOJavaScriptConsoleController::awakeFromNib.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setHidden:

- (void) setHidden: (BOOL) flag
implementation

Definition at line 79 of file RBSplitSubview.m.

79 :(BOOL)flag {
80 if ([self isHidden]!=flag) {
81 RBSplitView* sv = [self splitView];
82 [self RB___setHidden:flag];
83 if (flag) {
84 [sv adjustSubviews];
85 } else {
87 }
88 }
89}

References RBSplitView::adjustSubviews, RBSplitView::adjustSubviewsExcepting:, RB___setHidden:, and splitView.

+ Here is the call graph for this function:

◆ setIdentifier:

- (void) setIdentifier: (NSString*) aString

Definition at line 141 of file RBSplitSubview.m.

141 :(NSString*)aString {
142 [identifier autorelease];
143 identifier = aString?[aString retain]:@"";
144}

References identifier.

Referenced by initWithCoder:.

+ Here is the caller graph for this function:

◆ setMinDimension:andMaxDimension:

- (void) setMinDimension: (CGFloat) newMinDimension
andMaxDimension: (CGFloat) newMaxDimension 

Definition at line 295 of file RBSplitSubview.m.

295 :(CGFloat)newMinDimension andMaxDimension:(CGFloat)newMaxDimension {
296 minDimension = MAX(1.0,floor(newMinDimension));
297 if (newMaxDimension<1.0) {
298 newMaxDimension = WAYOUT;
299 }
300 maxDimension = MAX(minDimension,floor(newMaxDimension));
301 CGFloat dim = [self dimension];
302 if ((dim<minDimension)||(dim>maxDimension)) {
303 [[self splitView] setMustAdjust];
304 }
305}

References dimension, MAX, maxDimension, minDimension, RBSplitView::setMustAdjust, splitView, and WAYOUT.

Referenced by OOJavaScriptConsoleController::awakeFromNib.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPosition:

- (void) setPosition: (NSUInteger) newPosition

Definition at line 163 of file RBSplitSubview.m.

163 :(NSUInteger)newPosition {
164 RBSplitView* sv = [self splitView];
165 if (sv) {
166 [self retain];
167 [self removeFromSuperviewWithoutNeedingDisplay];
168 NSArray* subviews = [sv subviews];
169 if (newPosition>=[subviews count]) {
170 [sv addSubview:self positioned:NSWindowAbove relativeTo:nil];
171 } else {
172 [sv addSubview:self positioned:NSWindowBelow relativeTo:[subviews objectAtIndex:newPosition]];
173 }
174 [self release];
175 }
176}
unsigned count
void addSubview:positioned:relativeTo:(NSView *aView, [positioned] NSWindowOrderingMode place, [relativeTo] NSView *otherView)

References RBSplitView::addSubview:positioned:relativeTo:, count, and splitView.

+ Here is the call graph for this function:

◆ setTag:

- (void) setTag: (NSInteger) theTag

Definition at line 133 of file RBSplitSubview.m.

133 :(NSInteger)theTag {
134 tag = theTag;
135}

References tag.

◆ splitView

- (RBSplitView *) splitView

Definition at line 99 of file RBSplitSubview.m.

99 {
100 id result = [self superview];
101 if ([result isKindOfClass:[RBSplitView class]]) {
102 return (RBSplitView*)result;
103 }
104 return nil;
105}

References nil, and splitView.

Referenced by RBSplitView::awakeFromNib, changeDimensionBy:mayCollapse:move:, dimension, display, RBSplitView::drawDivider:inRect:betweenView:andView:, drawRect:, hitTest:, mouseDown:, RBSplitView::mouseDown:, position, RBSplitView(RB___ViewAdditions)::RB___adjustOutermostIfNeeded, RBSplitSubview(RB___SubviewAdditions)::RB___animationData:resize:, RBSplitSubview(RB___SubviewAdditions)::RB___collapse, RBSplitSubview(RB___SubviewAdditions)::RB___expandAndSetToMinimum:, RBSplitSubview(RB___SubviewAdditions)::RB___finishCollapse:withFraction:, RBSplitSubview(RB___SubviewAdditions)::RB___finishExpand:withFraction:, RBSplitSubview(RB___SubviewAdditions)::RB___setFrame:withFraction:notify:, RBSplitSubview(RB___SubviewAdditions)::RB___setFrameSize:withFraction:, RBSplitSubview(RB___SubviewAdditions)::RB___stepAnimation, RBSplitSubview(RB___SubviewAdditions)::RB___stopAnimation, resizeSubviewsWithOldSize:, RBSplitView::setCoupled:, setDimension:, RBSplitView::setFrameSize:, setHidden:, RBSplitView::setHorizontal:, setMinDimension:andMaxDimension:, setPosition:, splitView, and splitViewIsHorizontal.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ splitViewIsHorizontal

- (BOOL) splitViewIsHorizontal

Definition at line 127 of file RBSplitSubview.m.

127 {
128 return [[self splitView] isHorizontal];
129}

References RBSplitView::isHorizontal, splitView, and splitViewIsHorizontal.

Referenced by initWithCoder:, RBSplitSubview(RB___SubviewAdditions)::RB___visibleDimension, and splitViewIsHorizontal.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ status

- (RBSSubviewStatus) status

Definition at line 194 of file RBSplitSubview.m.

194 {
195 animationData* anim = [self RB___animationData:NO resize:NO];
196 if (anim) {
198 }
199 return [self RB___visibleDimension]<=0.0?RBSSubviewCollapsed:RBSSubviewNormal;
200}
@ RBSSubviewCollapsing
@ RBSSubviewExpanding

References animationData::collapsing, RB___animationData:resize:, RB___visibleDimension, RBSSubviewCollapsed, RBSSubviewCollapsing, RBSSubviewExpanding, RBSSubviewNormal, and status.

Referenced by collapseWithAnimation:withResize:, expandWithAnimation:withResize:, identifier, and status.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tag

- (NSInteger) tag

References tag.

Member Data Documentation

◆ actDivider

- (NSUInteger) actDivider
protected

Definition at line 38 of file RBSplitSubview.h.

Referenced by hitTest:, initWithCoder:, initWithFrame:, mouseDown:, and RBSplitView::mouseDown:.

◆ canCollapse

- (BOOL) canCollapse
protected

Definition at line 204 of file RBSplitSubview.m.

204 {
205 BOOL result = canCollapse;
206 RBSplitView* sv = [self splitView];
207 if ([sv RB___numberOfSubviews]<2) {
208 return NO;
209 }
210 id delegate = [sv delegate];
211 if ([delegate respondsToSelector:@selector(splitView:canCollapse:)]) {
212 result = [delegate splitView:sv canCollapse:self];
213 }
214 return result;
215}

Referenced by canCollapse, canShrink, changeDimensionBy:mayCollapse:move:, collapseWithAnimation:withResize:, initWithCoder:, initWithFrame:, RBSplitView::mouseDown:, and setCanCollapse:.

◆ canDragWindow

- (BOOL) canDragWindow
protected

Definition at line 39 of file RBSplitSubview.h.

Referenced by hitTest:, initWithCoder:, initWithFrame:, and mouseDown:.

◆ fraction

- (double) fraction
protected

Definition at line 31 of file RBSplitSubview.h.

Referenced by dimension, initWithCoder:, initWithFrame:, and setDimension:.

◆ identifier

- (NSString *) identifier
protected

Definition at line 146 of file RBSplitSubview.m.

146 {
147 return identifier;
148}

Referenced by identifier, initWithCoder:, initWithFrame:, setIdentifier:, and RBSplitView::subviewWithIdentifier:.

◆ maxDimension

◆ minDimension

◆ notInLimits

- (BOOL) notInLimits
protected

Definition at line 41 of file RBSplitSubview.h.

Referenced by initWithCoder:, initWithFrame:, and resizeSubviewsWithOldSize:.

◆ previous

- (NSRect) previous
protected

Definition at line 35 of file RBSplitSubview.h.

Referenced by initWithCoder:, and initWithFrame:.

◆ savedSize

- (NSSize) savedSize
protected

◆ tag

- (NSInteger) tag
protected

Definition at line 137 of file RBSplitSubview.m.

137 {
138 return tag;
139}

Referenced by initWithCoder:, setTag:, and tag.


The documentation for this class was generated from the following files: