ETScrollableAreaItem

Authors

Quentin Mathe (qmathe@club-internet.fr)
ETDecoratorItem subclass which makes content scrollable.

Copyright: (C) 2009 Quentin Mathe

Software documentation for the ETScrollableAreaItem class

ETScrollableAreaItem : ETDecoratorItem

Declared in:
ETScrollableAreaItem.h

A decorator which can be used to make content scrollable.

With the AppKit widget backend, the underlying view is an NSScrollView object.

You must not alter the underlying NSScrollView object with -setContentView: .

Non-flipped coordinates are untested with ETScrollableAreaItem i.e. when the decorated item returns NO to -isFlipped .

Method summary

itemWithScrollView: objectGraphContext: 

+ (ETScrollableAreaItem*) itemWithScrollView: (NSScrollView*)scrollView objectGraphContext: (COObjectGraphContext*)aContext;

Returns a new scrollable area item to which the given concrete scroll view gets bound.

The returned item can be used as a decorator to wrap an existing layout item into a scrollable area.


ensuresContentFillsVisibleArea 

- (BOOL) ensuresContentFillsVisibleArea;

Returns whether the decorated item size should be always be kept equal or superior to the visible content size.

Returns YES by default.


hasHorizontalScroller 

- (BOOL) hasHorizontalScroller;

Returns YES when the horizontal scroller of the current scrollable area view is visible, otherwise returns NO.


hasVerticalScroller 

- (BOOL) hasVerticalScroller;

Returns YES when the vertical scroller of the current scrollable area is visible, otherwise returns NO.


initWithScrollView: objectGraphContext: 

- (id) initWithScrollView: (NSScrollView*)aScrollView objectGraphContext: (COObjectGraphContext*)aContext;
Description forthcoming.

setEnsuresContentFillsVisibleArea: 

- (void) setEnsuresContentFillsVisibleArea: (BOOL)flag;

Sets whether the decorated item size should be always be kept equal or superior to the visible content size.

You might want to disable this behavior when you decorate a layout item whose size must remain fixed. A layout item that presents an image must probably never be resized when the scrollable area item is resized.


setHasHorizontalScroller: 

- (void) setHasHorizontalScroller: (BOOL)scroll;

Sets the horizontal scroller visibility of the current scrollable area.

For additional notes, see also -setHasVerticalScroller: .


setHasVerticalScroller: 

- (void) setHasVerticalScroller: (BOOL)scroll;

Sets the vertical scroller visibility of the current scrollable area.

Even if both vertical and horizontal scroller are made invisible, this method won't remove the receiver from the decorator chain it currently belongs to.


visibleContentRect 

- (NSRect) visibleContentRect;

Returns the rect that corresponds to the visible part of the content and expressed in the receiver coordinate space (relative to the decoration rect).

For now, this area corresponds to the scrollable area or clip rect and can extend beyond the content rect when the whole content is visible (in other words when scrollers are disabled). This is subject to change though.


visibleRect 

- (NSRect) visibleRect;

Returns the rect that corresponds to the visible part of the content and expressed in the receiver content coordinate space (relative to the content rect).