NSSplitView divider position

2014-11-08 Thread Luther Baker
Is there a direct way to determine the positions of the dividers in
NSSplitView. I'm implementing

splitView:additionalEffectiveRectOfDividerAtIndex:

and would like to create a rect relative to the current position of the
divider.

If not, are most people calculating this by adding the widths of all the
visible child/container views to the left of the divider index? (I've
noticed the the widths of collapsed views in the split view still have
the original size).

Also, it seems that the NSRect returned from this method is interpreted
more like an iOS rect ... that is, Y and the height seem to be top down and
not bottom up. Is that because the NSSplitView's internal coordinate system
is managed as such since the docs say ...

The rectangle should be expressed in the coordinate system defined by
*splitView*.

Thanks,
-Luther
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSSplitView divider position

2014-11-08 Thread Ken Thomases
On Nov 8, 2014, at 8:19 AM, Luther Baker lutherba...@gmail.com wrote:

 Is there a direct way to determine the positions of the dividers in
 NSSplitView.

No.

 If not, are most people calculating this by adding the widths of all the
 visible child/container views to the left of the divider index? (I've
 noticed the the widths of collapsed views in the split view still have
 the original size).

Well, you can do that, although you also need to account for the 
dividerThickness for any intervening dividers.  You could also query the 
NSMaxY() or NSMaxX() of the preceding visible view.  (Actually, be careful of 
the user interface direction.  Vertical split views that use auto layout 
respect the user interface direction, so the views may be laid out right to 
left.)

 Also, it seems that the NSRect returned from this method is interpreted
 more like an iOS rect ... that is, Y and the height seem to be top down and
 not bottom up. Is that because the NSSplitView's internal coordinate system
 is managed as such since the docs say ...
 
 The rectangle should be expressed in the coordinate system defined by
 *splitView*.

You should not assume either way.  You should either a) consult the -isFlipped 
method on the split view, or b) construct a rect in the coordinate system of 
one of your own views and then convert to the split view's coordinate system 
using [theSubview convertRect:theRect toView:theSplitView] or [theSplitView 
convertRect:theRect fromView:theSubView].

Regards,
Ken


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSSplitView divider position

2014-11-08 Thread Luther Baker
Thanks Ken.

On Sat, Nov 8, 2014 at 9:02 AM, Ken Thomases k...@codeweavers.com wrote:

 On Nov 8, 2014, at 8:19 AM, Luther Baker lutherba...@gmail.com wrote:

  Is there a direct way to determine the positions of the dividers in
  NSSplitView.

 No.

  If not, are most people calculating this by adding the widths of all the
  visible child/container views to the left of the divider index? (I've
  noticed the the widths of collapsed views in the split view still have
  the original size).

 Well, you can do that, although you also need to account for the
 dividerThickness for any intervening dividers.  You could also query the
 NSMaxY() or NSMaxX() of the preceding visible view.  (Actually, be careful
 of the user interface direction.  Vertical split views that use auto layout
 respect the user interface direction, so the views may be laid out right to
 left.)

  Also, it seems that the NSRect returned from this method is interpreted
  more like an iOS rect ... that is, Y and the height seem to be top down
 and
  not bottom up. Is that because the NSSplitView's internal coordinate
 system
  is managed as such since the docs say ...
 
  The rectangle should be expressed in the coordinate system defined by
  *splitView*.

 You should not assume either way.  You should either a) consult the
 -isFlipped method on the split view, or b) construct a rect in the
 coordinate system of one of your own views and then convert to the split
 view's coordinate system using [theSubview convertRect:theRect
 toView:theSplitView] or [theSplitView convertRect:theRect
 fromView:theSubView].

 Regards,
 Ken


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com