RB
 RBSplitView 
RBSplitView by
Rainer Brockerhoff
The local time is 09:32:35 Source code -> RBSplitView rainer@brockerhoff.net
Updated 27 Aug 2008 12:04:29
RBSplitView - a replacement for Cocoa's NSSplitView
RBSplitView

Universal

RBSplitView is a replacement for Cocoa's NSSplitView. There are some serious limitations with NSSplitView if you need to limit subview's sizes, expand or collapse subviews programmatically or by double-clicking, or resize the split view frequently.

RBSplitView has special content views - RBSplitSubviews - that handle details of subview limitations and properties. So there's less or no work to be done by the delegate. RBSplitView also has built-in support for nesting any number of levels, and automatically generates a two-axis thumb to resize in two dimensions.

The IB palette for RBSplitView isn't the best, as many details of writing palettes for container views aren't properly documented... still, it mostly works and gets a little better with each release. Be especially careful with Undo, Copy, and Paste. I recommend always working in outline view. This will change in Leopard, with the new Interface Builder, at the cost of backwards compatibility...

The download includes the basic RBSplitView and RBSplitSubview classes, an Interface Builder palette, full source code with Xcode project (for version 2.4.1), full documentation, Universal prebuilt library and framework in both debug and release versions, and a sample application showing most features. The latest build of Xcode 2.5 (beta) now works with the IB palette, although I believe you must rebuild it first. If you're testing out Leopard, here's a beta plugin for Interface Builder 3.

New in version 1.1.4:

  • Various small optimizations, bug and documentation fixes.
  • The Creative Commons license version was upgraded from 2.0 to 2.5.
  • The framework and library are now universal.
  • The project is now set up for optimum use with Xcode 2.4.1. Global build options are now in a .xcconfig file, and all options have been optimized and tweaked. Warnings are now more restrictive and several variable names have been changed to avoid hiding global declarations. Both debug and release versions are now prebuilt, to make it easier to include RBSplitView as a subproject within your project.
  • The sample app now shows the recommended way to restore divider settings; the logic to do so is now more robust.
  • The sample app now shows how to expand/collapse with animation when double-clicking a divider.
  • New -[RBSplitSubview canShrink] and -[RBSplitSubview canExpand] methods.
  • If you move a divider and several immediately adjacent subviews in that direction are collapsed or already at their minimum, these will now be pushed aside.
  • RBSplitViews should now behave correctly when inside an NSScrollView. There's a new -[RBSplitView isInScrollView] method to check for that.
  • The IB palette now shows proper version information.
  • Everything now behaves correctly if the RBSplitView and any scrollbar inside it overlap the window's grow box. To make that possible, the -[RBSplitSubview changeDimensionBy:mayCollapse:] method (which was previously - and incorrectly - documented as having an extra setToMinimum: argument) now has an extra leads: argument.
  • Dragging a divider by an auxiliary drag view now works even if that view is inside a nested RBSplitView.
  • Dragging a metal window by the background now works correctly; or rather, it now doesn't drag if you mouse-down on an opaque subview.

RBSplitView and the corresponding palette for Interface Builder are Copyright©2004-2006 by Rainer Brockerhoff. Some rights reserved.

You may choose whichever of the licenses below you deem more appropriate for your specific case.

This work is licensed under the Creative Commons Attribution License, version 2.5.
To view a copy of the Creative Commons Attribution License, version 2.5, visit http://creativecommons.org/licenses/by/2.5/legalcode or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, CA 94105-3013, USA.

This is a summary of the Legal Code (the full license) for your convenience, but is not itself a legal document. You are free:

  • to copy, distribute, display, and execute the work, either in source or binary form
  • to make derivative works
  • to make commercial use of the work

Under the following conditions:

  • Attribution. You must give the original author credit.
  • For any reuse or distribution, you must make clear to others the license terms of this work.
  • Any of these conditions can be waived if you get permission from the copyright holder.
  • Your fair use and other rights are in no way affected by the above.

In addition, RBSplitView is also licensed under the MIT license, approved by the Open Source Initiative.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

RBSplitView is provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

I suggest that published products - be they commercial, "shareware" or freeware - should, somewhere in the "About Box" or its equivalent, say "RBSplitView by Rainer Brockerhoff", with a link to http://www.brockerhoff.net/ if possible. A copy of the software itself would also be appreciated, and/or an e-mail telling me where you used it. If you make a significant modification to the source code, or find some bug, please e-mail me or post it in the Source Forum.

Some Adopters of RBSplitView (in, roughly, chronological order of notification)
 

CocoaTech's Path Finder.

Bill Bumgarner's ReSTEdit.

Karelia Software's Sandvox and iMedia Browser.

Dominic Yu's Phoenix Slides.

Advenio's MacGourmet.

Elliot Glaysher's VitaminSEE.

From Concentrate Software's Considera and SiteTagger.

ThinkMac Software's NewsMacPro.

The Little App Factory's Connoisseur.

Triage Software's Cuisine.

The Blue Technology Group's Ulysses.

T-Squared Software's FootTrack.

Linotype's FontExplorer X.

SuperMegaUltraGroovy's FuzzMeasure.

Hannes Juutilainen's Ohjelmaopas X.

Kent Software's Beer Alchemy.

Zengobi's Curio.

Wuffwuffware's AnalyzeText and CoverScout.

GroupSmart's MemoryMiner.

infiniteNIL's PackRat.

Reinvented Software's Feeder and Keep It Together.

NewsGator's NetNewsWire.

SIPphone's Gizmo Project.

Healthware's iDental and iMedical.

invers Software's iCalamus.

MacStudySoft's iStudy Flashcards.

Like Thought's Lexicon.

Happy Apps' WebNoteHappy.

Yahoo's Yahoo Messenger for Mac (3.0).

Peter Borg's Smultron.

Cynical Peak's Scorecard and Cyndicate.

Adium.

Unsanity's Chat Transcript Manager.

Algoriddim's djay.

LQ Graphics's Motion Pictures HD.

LANrev's LANrev Client Management.

Clickable Bliss' Billable.

C-Command's EagleFiler.

1Passwd.

Marko Karppinen & Co.'s BaseTen.

Druide's Antidote RX.

Outerlevel's LicenseKeeper.

Dejal Systems' Simon and Caboodle.

Treeinspired's Luscious SMS.

Boinx Software's FotoMagico 2 and iStopMotion, as well as the upcoming iStopMotion 2.

Lucerne Systems' Horizon.

Stephen Booth's Play.

Bitcartel's ComicBookLover.

Travis Rose's MacVisSTA.

ThinkMac Software's NewsLife.

Return Self Software's Avenir.

Xplain Corporation's InkViewer (used on the MacTech CD).

MalcolmHardie Solutions' SQLEditor.

Potion Factory's Voice Candy and Tangerine.

NovaMind Software's NovaMind.

Storyist Software's Storyist.

Pomoto.

FunkeeMonk Technology's Phone Journal.

Pracx Software's BarGenie.

Deep Prose Software's Booxter.

Patrick Meirmans' GenoDive.

Twin Forces' Frictionless.

Patrik Weiskircher's Theremin.

Clarkwood Software's Multisite for iWeb.

M Cubed Software's Code Collector Pro and Lighthouse Keeper.

Please tell me if you're using RBSplitView in a shipping application (or public beta) and I'll include it in this list!

Belo Horizonte, Brazil All times are GMT - 3 Hours

Page generated in 0.003 seconds, no queries executed