├── .gitignore ├── Documentation ├── Programming Topics.rtfd │ ├── 1__#$!@%!#__Pasted Graphic.tiff │ ├── Pasted Graphic 2.tiff │ ├── Pasted Graphic 3.tiff │ ├── Pasted Graphic.tiff │ └── TXT.rtf ├── RBSplitSubview.rtf └── RBSplitView.rtf ├── Plugin ├── English.lproj │ ├── RBSplitSubviewInspector.xib │ ├── RBSplitSubviewSizeInspector.xib │ ├── RBSplitViewInspector.xib │ ├── RBSplitViewPlugin.xib │ └── RBSplitViewPreferences.xib ├── Plugin-Info.plist ├── RBSplitSubview.classdescription ├── RBSplitView.classdescription ├── RBSplitView.png ├── RBSplitViewPlugin.h ├── RBSplitViewPlugin.icns ├── RBSplitViewPlugin.m ├── Thumb8.png └── Thumb9.png ├── RB.xcconfig ├── RBSplitView.xcodeproj └── project.pbxproj ├── README.markdown ├── Read Me.rtfd ├── TXT.rtf └── rb.png ├── Sample App ├── Drag.png ├── English.lproj │ └── SampleApp.nib │ │ ├── designable.nib │ │ └── keyedobjects.nib ├── SampleApp-Info.plist ├── main.h └── main.m └── Source ├── Framework-Info.plist ├── RBSplitSubview.h ├── RBSplitSubview.m ├── RBSplitView.h ├── RBSplitView.m └── RBSplitViewPrivateDefines.h /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore the build directory 2 | build 3 | 4 | ## Ignore user-specific Xcode files 5 | *.mode1v3 6 | *.pbxuser 7 | 8 | ## Ignore incredibly annoying .DS_Store files 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /Documentation/Programming Topics.rtfd/1__#$!@%!#__Pasted Graphic.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Documentation/Programming Topics.rtfd/1__#$!@%!#__Pasted Graphic.tiff -------------------------------------------------------------------------------- /Documentation/Programming Topics.rtfd/Pasted Graphic 2.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Documentation/Programming Topics.rtfd/Pasted Graphic 2.tiff -------------------------------------------------------------------------------- /Documentation/Programming Topics.rtfd/Pasted Graphic 3.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Documentation/Programming Topics.rtfd/Pasted Graphic 3.tiff -------------------------------------------------------------------------------- /Documentation/Programming Topics.rtfd/Pasted Graphic.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Documentation/Programming Topics.rtfd/Pasted Graphic.tiff -------------------------------------------------------------------------------- /Documentation/Programming Topics.rtfd/TXT.rtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Documentation/Programming Topics.rtfd/TXT.rtf -------------------------------------------------------------------------------- /Documentation/RBSplitSubview.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf110 2 | {\fonttbl\f0\froman\fcharset0 Times-Roman;\f1\fswiss\fcharset0 Helvetica;\f2\fnil\fcharset0 Monaco; 3 | \f3\fmodern\fcharset0 Courier;} 4 | {\colortbl;\red255\green255\blue255;\red0\green0\blue255;} 5 | \pard\ql\qnatural 6 | 7 | \f0\fs24 \cf0 Version 1.2 Copyright \'a92004-2009 by Rainer Brockerhoff. Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License.\ 8 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 9 | 10 | \fs16 \cf0 \ 11 | \ 12 | \ 13 | \ 14 | \pard\tx4880\li4880\fi-2780\ql\qnatural 15 | \cf0 \ 16 | \pard\li2100\ql\qnatural 17 | 18 | \f1\b\fs56 \cf0 RBSplitSubview\ 19 | \pard\tx4880\li4880\fi-2780\ql\qnatural 20 | 21 | \f0\b0\fs16 \cf0 \ 22 | \ 23 | \ 24 | \pard\tx4880\li4880\fi-2780\ql\qnatural 25 | 26 | \fs28 \cf0 \ 27 | 28 | \f1\b Inherits From:\ 29 | 30 | \f0\b0 NSView : NSResponder : NSObject\ 31 | 32 | \fs20 \ 33 | 34 | \f1\b\fs28 Conforms To: 35 | \f0\b0 \ 36 | NSCoding (NSResponder)\ 37 | NSObject (NSObject)\ 38 | 39 | \fs20 \ 40 | 41 | \f1\b\fs28 Declared In: 42 | \f0\b0 \ 43 | RBSplitSubview.h\ 44 | \pard\li1360\ql\qnatural 45 | 46 | \f1\b\fs16 \cf0 \ 47 | \ 48 | \ 49 | 50 | \fs36 Class Description\ 51 | 52 | \fs16 \ 53 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 54 | 55 | \f0\b0\fs28 \cf0 RBSplitSubview is the basic view used for containing each \'93split\'94 of a RBSplitView. RBSplitView itself is a subclass of RBSplitSubview, to allow for direct nesting, so you must read the descriptions of both classes recursively ;-).\ 56 | You should never use RBSplitSubviews outside of a RBSplitView; conversely, a RBSplitView will accept only RBSplitSubviews as direct subviews, or other RBSplitViews. In the latter case, the nested RBSplitView will usually be \'93coupled\'94 to the containing RBSplitView, but you can choose to turn coupling off. See more details about coupling in the RBSplitView description.\ 57 | Normally, you will set up size constraints and other attributes for a RBSplitSubview in Interface Builder and never change these programmatically, although you can do so.\ 58 | RBSplitSubviews are different from normal NSViews in that, instead of height and width, they have a \'93dimension\'94 which is measured along the containing RBSplitView\'92s orientation. The \'93other\'94 size is always set automatically to cover the entire RBSplitView, so there\'92s no way to manipulate it. For that reason, there\'92s no sense using the automatic view resizing facilities; it\'92s all handled by the containing RBSplitView.\ 59 | You can set size constraints \'97\'a0minimum and maximum dimensions, in pixels \'97\'a0and allow or not the RBSplitSubview to \'93collapse\'94 to zero dimension. A collapsed RBSplitSubview is actually shrunk beyond its minimum dimension, but without affecting its own subviews. Collapsing and expanding can be done programmatically or with mouse gestures. You can usually count on RBSplitSubviews staying within the size constraints as far as their own subviews are concerned.\ 60 | Subclassing either RBSplitSubview or RBSplitView should never be necessary, as most special behavior should be achievable either by delegate methods or by modifying the source code directly. Read the header comments for more details.\ 61 | RBSplitSubviews are not flipped, although RBSplitViews are. This shouldn\'92t affect you at all.\ 62 | Some common NSView method calls \'97 mostly those related to resizing \'97 make no sense for RBSplitSubviews, and so you should avoid calling them. In particular, 63 | \f2\fs22 \cf2 - setFrame: 64 | \f0\fs28 \cf0 , 65 | \f2\fs22 \cf2 - setFrameOrigin: 66 | \f0\fs28 \cf0 , 67 | \f2\fs22 \cf2 - setFrameSize: 68 | \f0\fs28 \cf0 , 69 | \f2\fs22 \cf2 - setAutoresizingMask: 70 | \f0\fs28 \cf0 , and related methods will either have no effect or mess things up. Always rely on the containing RBSplitView to do the right thing.\ 71 | \pard\tx4880\li4880\fi-2780\ql\qnatural 72 | \cf0 \ 73 | \pard\li1360\ql\qnatural 74 | 75 | \f1\b\fs16 \cf0 \ 76 | 77 | \fs36 Instance Variables\ 78 | \pard\tx2480\tx8000\tx10140\li2100\ql\qnatural 79 | 80 | \f0\b0\fs28 \cf0 \ 81 | \pard\tx2700\tx3240\tx3780\tx4320\tx4860\tx5400\tx5940\tx6480\li2100\ql\qnatural 82 | \cf0 All instance variables should be considered private; subclasses should use the corresponding accessor methods.\ 83 | \pard\tx6120\li5940\fi-3840\ql\qnatural 84 | 85 | \f1\b\fs16 \cf0 \ 86 | \pard\tx4880\li4880\fi-2780\ql\qnatural 87 | 88 | \f0\b0\fs28 \cf0 \ 89 | \pard\li1360\ql\qnatural 90 | 91 | \f1\b\fs16 \cf0 \ 92 | 93 | \fs36 Constants\ 94 | \pard\tx2480\tx8000\tx10140\li2100\ql\qnatural 95 | 96 | \f0\b0\fs28 \cf0 \ 97 | \pard\tx2700\tx3240\tx3780\tx4320\tx4860\tx5400\tx5940\tx6480\li2100\ql\qnatural 98 | \cf0 The following constants of type 99 | \f3\fs26 RBSSubviewStatus 100 | \f0\fs28 are used to return the status of a RBSplitSubview:\ 101 | \pard\tx2700\tx3240\tx3780\tx4320\tx4860\tx5400\tx5940\tx6480\li2100\ql\qnatural 102 | 103 | \f3\fs26 \cf0 RBSSubviewExpanding 104 | \f0\fs28 the subview is being expanded with animation 105 | \f3\fs26 \ 106 | RBSSubviewCollapsing 107 | \f0\fs28 the subview is being collapsed with animation 108 | \f3\fs26 \ 109 | RBSSubviewNormal 110 | \f0\fs28 the subview is not collapsed 111 | \f3\fs26 \ 112 | RBSSubviewCollapsed 113 | \f0\fs28 the subview is collapsed.\ 114 | See 115 | \f2\fs22 \cf2 - status 116 | \f0\fs28 \cf0 . 117 | \f1\b\fs16 \ 118 | \pard\li1360\ql\qnatural 119 | \cf0 \ 120 | \ 121 | 122 | \fs36 Method Types\ 123 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 124 | 125 | \f0\b0\fs16 \cf0 \ 126 | \pard\tx6120\li5940\fi-3840\ql\qnatural 127 | 128 | \fs28 \cf0 Creating instances\ 129 | 130 | \f2\fs22 \cf2 - initWithFrame: 131 | \f0\fs28 \cf0 \ 132 | \pard\tx6120\tx9000\li5940\fi-3840\ql\qnatural 133 | \cf0 \ 134 | \pard\tx6120\li5940\fi-3840\ql\qnatural 135 | \cf0 Identifying instances\ 136 | 137 | \f2\fs22 \cf2 - setTag:\ 138 | - tag\ 139 | - setIdentifier:\ 140 | - identifier 141 | \f0\fs28 \cf0 \ 142 | \ 143 | Relating to RBSplitView\ 144 | 145 | \f2\fs22 \cf2 - splitView\ 146 | - asSplitView\ 147 | - couplingSplitView\ 148 | - coupledSplitView\ 149 | - outermostSplitView\ 150 | - isCoupled\ 151 | - setCoupled: 152 | \f0\fs28 \cf0 \ 153 | 154 | \f2\fs22 \cf2 - splitViewIsHorizontal\ 155 | 156 | \f0\fs28 \cf0 \ 157 | Counting and positioning\ 158 | 159 | \f2\fs22 \cf2 - numberOfSubviews\ 160 | - setPosition:\ 161 | - position\ 162 | 163 | \f0\fs28 \cf0 \ 164 | Dimensions and constraints\ 165 | 166 | \f2\fs22 \cf2 - dimension\ 167 | - setDimension\ 168 | - changeDimensionBy:mayCollapse:move: 169 | \f0\fs28 \cf0 \ 170 | 171 | \f2\fs22 \cf2 - minDimension\ 172 | - maxDimension\ 173 | - setMinDimension:andMaxDimension:\ 174 | 175 | \f0\fs28 \cf0 \ 176 | Collapsing, expanding and hiding\ 177 | 178 | \f2\fs22 \cf2 - isCollapsed\ 179 | \pard\tx2700\tx3240\tx3780\tx4320\tx4860\tx5400\tx5940\tx6480\li2100\ql\qnatural 180 | \cf2 - status\ 181 | \pard\tx6120\li5940\fi-3840\ql\qnatural 182 | \cf2 - canCollapse\ 183 | - setCanCollapse:\ 184 | - collapse\ 185 | - expand\ 186 | - canShrink\ 187 | - canExpand\ 188 | - collapseWithAnimation\ 189 | - expandWithAnimation\ 190 | - collapseWithAnimation:withResize:\ 191 | - expandWithAnimation:withResize:\ 192 | - setHidden: 193 | \f0\fs28 \cf0 \ 194 | \pard\li1360\ql\qnatural 195 | 196 | \f1\b\fs16 \cf0 \ 197 | \ 198 | 199 | \fs36 Instance Methods\ 200 | 201 | \fs16 \ 202 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 203 | 204 | \fs28 \cf0 asSplitView\ 205 | \pard\li3240\fi-760\ql\qnatural 206 | 207 | \f0\b0 \cf0 - (RBSplitView*) 208 | \b asSplitView 209 | \b0 \ 210 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 211 | 212 | \fs16 \cf0 \ 213 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 214 | 215 | \fs28 \cf0 Returns self if the receiver is a RBSplitView, nil if not. Convenient for testing or calling methods.\ 216 | \pard\tx7140\li2480\fi-380\ql\qnatural 217 | 218 | \f1\b\fs16 \cf0 \ 219 | \ 220 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 221 | 222 | \fs28 \cf0 canCollapse\ 223 | \pard\li3240\fi-760\ql\qnatural 224 | 225 | \f0\b0 \cf0 - (BOOL) 226 | \b canCollapse 227 | \b0 \ 228 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 229 | 230 | \fs16 \cf0 \ 231 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 232 | 233 | \fs28 \cf0 Returns YES if the receiver can be collapsed, NO otherwise. However, even if this returns YES, you still may be unable to collapse the receiver if all other views already are collapsed. See 234 | \f2\fs22 \cf2 - collapse 235 | \f0\fs28 \cf0 , 236 | \f2\fs22 \cf2 - expand 237 | \f0\fs28 \cf0 , 238 | \f2\fs22 \cf2 - isCollapsed 239 | \f0\fs28 \cf0 , 240 | \f2\fs22 \cf2 - setCanCollapse: 241 | \f0\fs28 \cf0 .\ 242 | \pard\tx7140\li2480\fi-380\ql\qnatural 243 | 244 | \f1\b\fs16 \cf0 \ 245 | \ 246 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 247 | 248 | \fs28 \cf0 canExpand\ 249 | \pard\li3240\fi-760\ql\qnatural 250 | 251 | \f0\b0 \cf0 - (BOOL) 252 | \b canExpand 253 | \b0 \ 254 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 255 | 256 | \fs16 \cf0 \ 257 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 258 | 259 | \fs28 \cf0 Returns YES if the receiver can still expand, meaning that its dimension is below the set maximum. However, even if this returns YES, you still may be unable to expand the receiver because of constraints on other subviews. See 260 | \f2\fs22 \cf2 - collapse 261 | \f0\fs28 \cf0 , 262 | \f2\fs22 \cf2 - expand 263 | \f0\fs28 \cf0 , 264 | \f2\fs22 \cf2 - canExpand 265 | \f0\fs28 \cf0 , 266 | \f2\fs22 \cf2 - canShrink 267 | \f0\fs28 \cf0 , 268 | \f2\fs22 \cf2 - isCollapsed 269 | \f0\fs28 \cf0 , 270 | \f2\fs22 \cf2 - setCanCollapse: 271 | \f0\fs28 \cf0 .\ 272 | \pard\tx7140\li2480\fi-380\ql\qnatural 273 | 274 | \f1\b\fs16 \cf0 \ 275 | \ 276 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 277 | 278 | \fs28 \cf0 canShrink\ 279 | \pard\li3240\fi-760\ql\qnatural 280 | 281 | \f0\b0 \cf0 - (BOOL) 282 | \b canShrink 283 | \b0 \ 284 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 285 | 286 | \fs16 \cf0 \ 287 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 288 | 289 | \fs28 \cf0 Returns YES if the receiver can still shrink, meaning that its dimension is above the set minimum, or that it can be collapsed. However, even if this returns YES, you still may be unable to shrink or collapse the receiver because of constraints on other subviews. See 290 | \f2\fs22 \cf2 - collapse 291 | \f0\fs28 \cf0 , 292 | \f2\fs22 \cf2 - expand 293 | \f0\fs28 \cf0 , 294 | \f2\fs22 \cf2 - canExpand 295 | \f0\fs28 \cf0 , 296 | \f2\fs22 \cf2 - canShrink 297 | \f0\fs28 \cf0 , 298 | \f2\fs22 \cf2 - isCollapsed 299 | \f0\fs28 \cf0 , 300 | \f2\fs22 \cf2 - setCanCollapse: 301 | \f0\fs28 \cf0 .\ 302 | \pard\tx7140\li2480\fi-380\ql\qnatural 303 | 304 | \f1\b\fs16 \cf0 \ 305 | \ 306 | \pard\tx7140\li2480\fi-380\ql\qnatural 307 | 308 | \fs28 \cf0 changeDimensionBy:mayCollapse:move:\ 309 | \pard\li3240\fi-760\ql\qnatural 310 | 311 | \f0\b0 \cf0 - (float) 312 | \b changeDimensionBy: 313 | \b0 (float) 314 | \i increment 315 | \i0\b mayCollapse: 316 | \b0 (BOOL) 317 | \i mayCollapse 318 | \i0\b move: 319 | \b0 (BOOL) 320 | \i move 321 | \i0 \ 322 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 323 | 324 | \fs16 \cf0 \ 325 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 326 | 327 | \fs28 \cf0 Tries to change the receiver\'92s dimension by 328 | \i increment 329 | \i0 , which can be positive or negative. This is usually called on pairs of subviews whenever Pass YES in 330 | \i mayCollapse 331 | \i0 to allow collapsing of the receiver if the change is large enough; pass YES in 332 | \i move 333 | \i0 only when you're resizing the trailing (that is, right- or bottommost) subview of the pair. (This will reposition the subview so its trailing edge remains fixed). However, constraints on the receiver or on neighboring subviews may alter the actual change, so it will return the actual amount the receiver\'92s dimension changed.\ 334 | Usually, this call should be balanced by changing another subview\'92s dimension by the negative of the returned value, or by changing the containing RBSplitView\'92s size (you should pass NO in 335 | \i move 336 | \i0 in the latter case). Otherwise, the actual dimension of the receiver will probably change after calling 337 | \f2\fs22 \cf2 - adjustSubviews 338 | \f0\fs28 \cf0 on the containing RBSplitView. See 339 | \f2\fs22 \cf2 - setDimension: 340 | \f0\fs28 \cf0 , 341 | \f2\fs22 \cf2 - collapse 342 | \f0\fs28 \cf0 , 343 | \f2\fs22 \cf2 - dimension 344 | \f0\fs28 \cf0 .\ 345 | \pard\tx7140\li2480\fi-380\ql\qnatural 346 | 347 | \f1\b \cf0 \ 348 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 349 | \cf0 collapse\ 350 | \pard\li3240\fi-760\ql\qnatural 351 | 352 | \f0\b0 \cf0 - (float) 353 | \b collapse 354 | \b0 \ 355 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 356 | 357 | \fs16 \cf0 \ 358 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 359 | 360 | \fs28 \cf0 Will collapse the receiver, if it can be collapsed and was expanded. As a convenience, it returns the negative of the receiver\'92s dimension before collapsing (or zero, if it couldn\'92t be collapsed). If any subview of the receiver is the first responder, it will be asked to resign and redraw itself before collapsing.\ 361 | If the containing RBSplitView\'92s delegate implements 362 | \f2\fs22 \cf2 - splitView:didCollapse: 363 | \f0\fs28 \cf0 , it will call that method after collapsing. See 364 | \f2\fs22 \cf2 - canCollapse 365 | \f0\fs28 \cf0 , 366 | \f2\fs22 \cf2 - collapseWithAnimation 367 | \f0\fs28 \cf0 , 368 | \f2\fs22 \cf2 - collapseWithAnimation:withResize: 369 | \f0\fs28 \cf0 , 370 | \f2\fs22 \cf2 - expand 371 | \f0\fs28 \cf0 , 372 | \f2\fs22 \cf2 - expandWithAnimation 373 | \f0\fs28 \cf0 , 374 | \f2\fs22 \cf2 - expandWithAnimation:withResize 375 | \f0\fs28 \cf0 , 376 | \f2\fs22 \cf2 - isCollapsed 377 | \f0\fs28 \cf0 , 378 | \f2\fs22 \cf2 - setCanCollapse: 379 | \f0\fs28 \cf0 .\ 380 | \pard\tx7140\li2480\fi-380\ql\qnatural 381 | 382 | \f1\b \cf0 \ 383 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 384 | \cf0 collapseWithAnimation\ 385 | \pard\li3240\fi-760\ql\qnatural 386 | 387 | \f0\b0 \cf0 - (BOOL) 388 | \b collapseWithAnimation 389 | \b0 \ 390 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 391 | 392 | \fs16 \cf0 \ 393 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 394 | 395 | \fs28 \cf0 Will collapse the receiver, if it can be collapsed and was expanded, with animation. Returns YES if the animation was started successfully; only one RBSplitSubview can be animated at a time. The receiver\'92s subviews will be resized during animation. The actual animation time will depend on the value returned by the containing RBSplitView\'92s delegate method 396 | \f2\fs22 \cf2 - splitView:willAnimateSubview:withDimension: 397 | \f0\fs28 \cf0 , if that is implemented, or on the receiver\'92s dimension, if it\'92s not. If any subview of the receiver is the first responder, it will be asked to resign and redraw itself before collapsing.\ 398 | If the containing RBSplitView\'92s delegate implements 399 | \f2\fs22 \cf2 - splitView:didCollapse: 400 | \f0\fs28 \cf0 , it will call that method after finishing the animation. See 401 | \f2\fs22 \cf2 - canCollapse 402 | \f0\fs28 \cf0 , 403 | \f2\fs22 \cf2 - expand 404 | \f0\fs28 \cf0 , 405 | \f2\fs22 \cf2 - collapseWithAnimation:withResize: 406 | \f0\fs28 \cf0 , 407 | \f2\fs22 \cf2 - expandWithAnimation 408 | \f0\fs28 \cf0 , 409 | \f2\fs22 \cf2 - expandWithAnimation:withResize 410 | \f0\fs28 \cf0 , 411 | \f2\fs22 \cf2 - isCollapsed 412 | \f0\fs28 \cf0 , 413 | \f2\fs22 \cf2 - setCanCollapse: 414 | \f0\fs28 \cf0 .\ 415 | \pard\tx7140\li2480\fi-380\ql\qnatural 416 | 417 | \f1\b \cf0 \ 418 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 419 | \cf0 collapseWithAnimation:withResize:\ 420 | \pard\li3240\fi-760\ql\qnatural 421 | 422 | \f0\b0 \cf0 - (BOOL) 423 | \b collapseWithAnimation: 424 | \b0 (BOOL) 425 | \i animate 426 | \i0\b withResize: 427 | \b0 (BOOL) 428 | \i resize 429 | \i0 \ 430 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 431 | 432 | \fs16 \cf0 \ 433 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 434 | 435 | \fs28 \cf0 Will collapse the receiver, if it can be collapsed and was expanded. If 436 | \i animate 437 | \i0 is NO, the receiver is collapsed immediately and NO is returned; 438 | \i resize 439 | \i0 is ignored.\ 440 | If 441 | \i animate 442 | \i0 is YES, the collapse will be animated and YES will be returned if the animation was started successfully; only one RBSplitSubview can be animated at a time. The receiver\'92s subviews will be resized during animation only if 443 | \i resize 444 | \i0 is YES.\ 445 | The actual animation time will depend on the value returned by the containing RBSplitView\'92s delegate method 446 | \f2\fs22 \cf2 - splitView:willAnimateSubview:withDimension: 447 | \f0\fs28 \cf0 , if that is implemented, or on the receiver\'92s dimension, if it\'92s not. If any subview of the receiver is the first responder, it will be asked to resign and redraw itself before collapsing.\ 448 | If the containing RBSplitView\'92s delegate implements 449 | \f2\fs22 \cf2 - splitView:didCollapse: 450 | \f0\fs28 \cf0 , it will call that method after finishing the animation. See 451 | \f2\fs22 \cf2 - canCollapse 452 | \f0\fs28 \cf0 , 453 | \f2\fs22 \cf2 - collapse 454 | \f0\fs28 \cf0 , 455 | \f2\fs22 \cf2 - collapseWithAnimation 456 | \f0\fs28 \cf0 , 457 | \f2\fs22 \cf2 - expand 458 | \f0\fs28 \cf0 , 459 | \f2\fs22 \cf2 - expandWithAnimation 460 | \f0\fs28 \cf0 , 461 | \f2\fs22 \cf2 - expandWithAnimation:withResize 462 | \f0\fs28 \cf0 , 463 | \f2\fs22 \cf2 - isCollapsed 464 | \f0\fs28 \cf0 , 465 | \f2\fs22 \cf2 - setCanCollapse: 466 | \f0\fs28 \cf0 .\ 467 | \pard\tx7140\li2480\fi-380\ql\qnatural 468 | 469 | \f1\b \cf0 \ 470 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 471 | \cf0 coupledSplitView\ 472 | \pard\li3240\fi-760\ql\qnatural 473 | 474 | \f0\b0 \cf0 - (RBSplitView*) 475 | \b coupledSplitView 476 | \b0 \ 477 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 478 | 479 | \fs16 \cf0 \ 480 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 481 | 482 | \fs28 \cf0 Returns self if the receiver is a RBSplitView that is nested inside, and coupled to, another RBSplitView, and nil if not. Convenient for testing or calling methods.\ 483 | This differs from 484 | \f2\fs22 \cf2 - asSplitView 485 | \f0\fs28 \cf0 since it tests for coupling. See also 486 | \f2\fs22 \cf2 - couplingSplitView 487 | \f0\fs28 \cf0 , 488 | \f2\fs22 \cf2 - isCoupled 489 | \f0\fs28 \cf0 , 490 | \f2\fs22 \cf2 - setCoupled: 491 | \f0\fs28 \cf0 . 492 | \f1\b\fs16 \ 493 | \ 494 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 495 | 496 | \fs28 \cf0 couplingSplitView\ 497 | \pard\li3240\fi-760\ql\qnatural 498 | 499 | \f0\b0 \cf0 - (RBSplitView*) 500 | \b couplingSplitView 501 | \b0 \ 502 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 503 | 504 | \fs16 \cf0 \ 505 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 506 | 507 | \fs28 \cf0 Returns the containing RBSplitView if the receiver is a RBSplitView that is nested inside, and coupled to, that RBSplitView, and nil if not. Convenient for testing or calling methods.\ 508 | This differs from 509 | \f2\fs22 \cf2 - splitView 510 | \f0\fs28 \cf0 since it also tests for coupling. See also 511 | \f2\fs22 \cf2 - coupledSplitView 512 | \f0\fs28 \cf0 , 513 | \f2\fs22 \cf2 - isCoupled 514 | \f0\fs28 \cf0 , 515 | \f2\fs22 \cf2 - setCoupled: 516 | \f0\fs28 \cf0 . 517 | \f1\b\fs16 \ 518 | \ 519 | \pard\tx7140\li2480\fi-380\ql\qnatural 520 | 521 | \fs28 \cf0 dimension\ 522 | \pard\li3240\fi-760\ql\qnatural 523 | 524 | \f0\b0 \cf0 - (float) 525 | \b dimension 526 | \b0 \ 527 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 528 | 529 | \fs16 \cf0 \ 530 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 531 | 532 | \fs28 \cf0 Returns the receiver\'92s dimension, the measure in pixels along the containing RBSplitView\'92s orientation. Will always be an integer value. If the receiver is collapsed this will return the dimension it would have upon expanding. See 533 | \f2\fs22 \cf2 - setDimension: 534 | \f0\fs28 \cf0 , 535 | \f2\fs22 \cf2 - changeDimensionBy:mayCollapse:move: 536 | \f0\fs28 \cf0 .\ 537 | \pard\tx7140\li2480\fi-380\ql\qnatural 538 | 539 | \f1\b \cf0 \ 540 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 541 | \cf0 expand\ 542 | \pard\li3240\fi-760\ql\qnatural 543 | 544 | \f0\b0 \cf0 - (float) 545 | \b expand 546 | \b0 \ 547 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 548 | 549 | \fs16 \cf0 \ 550 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 551 | 552 | \fs28 \cf0 Will expand the receiver, if it was collapsed. As a convenience, it returns the receiver\'92s dimension after expanding (or zero, if it wasn\'92t collapsed). The view will return to the original dimension it had before being collapsed.\ 553 | If the containing RBSplitView\'92s delegate implements 554 | \f2\fs22 \cf2 - splitView:didExpand: 555 | \f0\fs28 \cf0 , it will call that method after expanding. See 556 | \f2\fs22 \cf2 - collapse 557 | \f0\fs28 \cf0 , 558 | \f2\fs22 \cf2 - canCollapse 559 | \f0\fs28 \cf0 , 560 | \f2\fs22 \cf2 - isCollapsed 561 | \f0\fs28 \cf0 , 562 | \f2\fs22 \cf2 - setCanCollapse: 563 | \f0\fs28 \cf0 .\ 564 | \pard\tx7140\li2480\fi-380\ql\qnatural 565 | 566 | \f1\b \cf0 \ 567 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 568 | \cf0 expandWithAnimation\ 569 | \pard\li3240\fi-760\ql\qnatural 570 | 571 | \f0\b0 \cf0 - (BOOL) 572 | \b expandWithAnimation 573 | \b0 \ 574 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 575 | 576 | \fs16 \cf0 \ 577 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 578 | 579 | \fs28 \cf0 Will expand the receiver, if it was collapsed, with animation. Returns YES if the animation was started successfully; only one RBSplitSubview can be animated at a time. The receiver\'92s subviews will be resized during animation. The actual animation time will depend on the value returned by the containing RBSplitView\'92s delegate method 580 | \f2\fs22 \cf2 - splitView:willAnimateSubview:withDimension: 581 | \f0\fs28 \cf0 , if that is implemented, or on the receiver\'92s dimension, if it\'92s not.\ 582 | If the containing RBSplitView\'92s delegate implements 583 | \f2\fs22 \cf2 - splitView:didExpand: 584 | \f0\fs28 \cf0 , it will call that method after finishing the animation. See 585 | \f2\fs22 \cf2 - canCollapse 586 | \f0\fs28 \cf0 , 587 | \f2\fs22 \cf2 - collapse 588 | \f0\fs28 \cf0 , 589 | \f2\fs22 \cf2 - collapseWithAnimation 590 | \f0\fs28 \cf0 , 591 | \f2\fs22 \cf2 - expand 592 | \f0\fs28 \cf0 , 593 | \f2\fs22 \cf2 - isCollapsed 594 | \f0\fs28 \cf0 , 595 | \f2\fs22 \cf2 - setCanCollapse: 596 | \f0\fs28 \cf0 .\ 597 | \pard\tx7140\li2480\fi-380\ql\qnatural 598 | 599 | \f1\b\fs16 \cf0 \ 600 | \ 601 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 602 | 603 | \fs28 \cf0 expandWithAnimation:withResize:\ 604 | \pard\li3240\fi-760\ql\qnatural 605 | 606 | \f0\b0 \cf0 - (BOOL) 607 | \b expandWithAnimation: 608 | \b0 (BOOL) 609 | \i animate 610 | \i0\b withResize: 611 | \b0 (BOOL) 612 | \i resize 613 | \i0 \ 614 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 615 | 616 | \fs16 \cf0 \ 617 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 618 | 619 | \fs28 \cf0 Will expand the receiver, if it was collapsed. If 620 | \i animate 621 | \i0 is NO, the receiver is expanded immediately and NO is returned; 622 | \i resize 623 | \i0 is ignored.\ 624 | If 625 | \i animate 626 | \i0 is YES, the expansion will be animated and YES will be returned if the animation was started successfully; only one RBSplitSubview can be animated at a time. The receiver\'92s subviews will be resized during animation only if 627 | \i resize 628 | \i0 is YES.\ 629 | The actual animation time will depend on the value returned by the containing RBSplitView\'92s delegate method 630 | \f2\fs22 \cf2 - splitView:willAnimateSubview:withDimension: 631 | \f0\fs28 \cf0 , if that is implemented, or on the receiver\'92s dimension, if it\'92s not.\ 632 | If the containing RBSplitView\'92s delegate implements 633 | \f2\fs22 \cf2 - splitView:didExpand: 634 | \f0\fs28 \cf0 , it will call that method after finishing the animation. See 635 | \f2\fs22 \cf2 - canCollapse 636 | \f0\fs28 \cf0 , 637 | \f2\fs22 \cf2 - collapse 638 | \f0\fs28 \cf0 , 639 | \f2\fs22 \cf2 - collapseWithAnimation 640 | \f0\fs28 \cf0 , 641 | \f2\fs22 \cf2 - collapseWithAnimation:withResize 642 | \f0\fs28 \cf0 , 643 | \f2\fs22 \cf2 - expand 644 | \f0\fs28 \cf0 , 645 | \f2\fs22 \cf2 - expandWithAnimation 646 | \f0\fs28 \cf0 , 647 | \f2\fs22 \cf2 - isCollapsed 648 | \f0\fs28 \cf0 , 649 | \f2\fs22 \cf2 - setCanCollapse: 650 | \f0\fs28 \cf0 .\ 651 | \pard\tx7140\li2480\fi-380\ql\qnatural 652 | 653 | \f1\b \cf0 \ 654 | identifier\ 655 | \pard\li3240\fi-760\ql\qnatural 656 | 657 | \f0\b0 \cf0 - (NSString*) 658 | \b identifier 659 | \b0 \ 660 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 661 | 662 | \fs16 \cf0 \ 663 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 664 | 665 | \fs28 \cf0 Returns the receiver\'92s identifier, a string that you can use to identify RBSplitSubviews. Will never be nil. See 666 | \f2\fs22 \cf2 - setIdentifier: 667 | \f0\fs28 \cf0 .\ 668 | \pard\tx7140\li2480\fi-380\ql\qnatural 669 | 670 | \f1\b \cf0 \ 671 | initWithFrame:\ 672 | \pard\li3240\fi-760\ql\qnatural 673 | 674 | \f0\b0 \cf0 - (id) 675 | \b initWithFrame: 676 | \b0 (NSRect) 677 | \i rect 678 | \i0 \ 679 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 680 | 681 | \fs16 \cf0 \ 682 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 683 | 684 | \fs28 \cf0 Initializes a newly allocated RBSplitSubview with 685 | \i rect 686 | \i0 as its frame rectangle. The new view object must be inserted into a RBSplitView before it can be used. This method is the designated initializer for the RBSplitSubview class. Returns an initialized object.\ 687 | The origin of 688 | \i rect 689 | \i0 isn\'92t used, and the size will be used only for relative resizing of the other subviews when inserted into a RBSplitView.\ 690 | \pard\tx7140\li2480\fi-380\ql\qnatural 691 | 692 | \f1\b \cf0 \ 693 | isCollapsed:\ 694 | \pard\li3240\fi-760\ql\qnatural 695 | 696 | \f0\b0 \cf0 - (BOOL) 697 | \b isCollapsed 698 | \b0 \ 699 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 700 | 701 | \fs16 \cf0 \ 702 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 703 | 704 | \fs28 \cf0 Returns YES if the receiver is collapsed, NO otherwise. See 705 | \f2\fs22 \cf2 - canCollapse 706 | \f0\fs28 \cf0 , 707 | \f2\fs22 \cf2 - setCanCollapse: 708 | \f0\fs28 \cf0 , 709 | \f2\fs22 \cf2 -collapse 710 | \f0\fs28 \cf0 , 711 | \f2\fs22 \cf2 - expand 712 | \f0\fs28 \cf0 .\ 713 | \pard\tx7140\li2480\fi-380\ql\qnatural 714 | 715 | \f1\b \cf0 \ 716 | isCoupled\ 717 | \pard\li3240\fi-760\ql\qnatural 718 | 719 | \f0\b0 \cf0 - (BOOL) 720 | \b isCoupled 721 | \b0 \ 722 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 723 | 724 | \fs16 \cf0 \ 725 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 726 | 727 | \fs28 \cf0 Returns YES if the receiver is a RBSplitView that is nested inside, and coupled to, another RBSplitView, NO otherwise. Normal RBSplitSubviews will always return NO. See 728 | \f2\fs22 \cf2 - coupledSplitView 729 | \f0\fs28 \cf0 , 730 | \f2\fs22 \cf2 - couplingSplitView 731 | \f0\fs28 \cf0 , 732 | \f2\fs22 \cf2 -setCoupled: 733 | \f0\fs28 \cf0 .\ 734 | \pard\tx7140\li2480\fi-380\ql\qnatural 735 | 736 | \f1\b \cf0 \ 737 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 738 | \cf0 minDimension\ 739 | \pard\li3240\fi-760\ql\qnatural 740 | 741 | \f0\b0 \cf0 - (float) 742 | \b minDimension 743 | \b0 \ 744 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 745 | 746 | \fs16 \cf0 \ 747 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 748 | 749 | \fs28 \cf0 Returns the receiver\'92s current minimum dimension constraint. This will alway be at least 1.0, and despite being a float, will have only integer values. See 750 | \f2\fs22 \cf2 - maxDimension 751 | \f0\fs28 \cf0 , 752 | \f2\fs22 \cf2 - setMinDimension:andMaxDimension: 753 | \f0\fs28 \cf0 .\ 754 | \pard\tx7140\li2480\fi-380\ql\qnatural 755 | 756 | \f1\b\fs16 \cf0 \ 757 | \ 758 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 759 | 760 | \fs28 \cf0 maxDimension\ 761 | \pard\li3240\fi-760\ql\qnatural 762 | 763 | \f0\b0 \cf0 - (float) 764 | \b maxDimension 765 | \b0 \ 766 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 767 | 768 | \fs16 \cf0 \ 769 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 770 | 771 | \fs28 \cf0 Returns the receiver\'92s current maximum dimension constraint. This will alway be equal to, or greater than, 772 | \f2\fs22 \cf2 - minDimension 773 | \f0\fs28 \cf0 , and despite being a float, will have only integer values. If there\'92s no maximum constraint, this method will return 1,000,000.0. See 774 | \f2\fs22 \cf2 - minDimension 775 | \f0\fs28 \cf0 , 776 | \f2\fs22 \cf2 - setMinDimension:andMaxDimension: 777 | \f0\fs28 \cf0 .\ 778 | \pard\tx7140\li2480\fi-380\ql\qnatural 779 | 780 | \f1\b\fs16 \cf0 \ 781 | \ 782 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 783 | 784 | \fs28 \cf0 numberOfSubviews\ 785 | \pard\li3240\fi-760\ql\qnatural 786 | 787 | \f0\b0 \cf0 - (unsigned) 788 | \b numberOfSubviews 789 | \b0 \ 790 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 791 | 792 | \fs16 \cf0 \ 793 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 794 | 795 | \fs28 \cf0 A convenience method to return the receiver\'92s number of subviews.\ 796 | \ 797 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 798 | 799 | \f1\b \cf0 outermostSplitView\ 800 | \pard\li3240\fi-760\ql\qnatural 801 | 802 | \f0\b0 \cf0 - (RBSplitView*) 803 | \b outermostSplitView 804 | \b0 \ 805 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 806 | 807 | \fs16 \cf0 \ 808 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 809 | 810 | \fs28 \cf0 Returns the outermost directly containing RBSplitView or nil if there is none. See also 811 | \f2\fs22 \cf2 - splitView 812 | \f0\fs28 \cf0 , 813 | \f2\fs22 \cf2 - couplingSplitView 814 | \f0\fs28 \cf0 .\ 815 | \pard\tx7140\li2480\fi-380\ql\qnatural 816 | 817 | \f1\b\fs16 \cf0 \ 818 | \ 819 | \pard\tx7140\li2480\fi-380\ql\qnatural 820 | 821 | \fs28 \cf0 position:\ 822 | \pard\li3240\fi-760\ql\qnatural 823 | 824 | \f0\b0 \cf0 - (unsigned) 825 | \b position 826 | \b0 \ 827 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 828 | 829 | \fs16 \cf0 \ 830 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 831 | 832 | \fs28 \cf0 Returns the receiver\'92s current position in the containing RBSplitView, counting from zero, left to right or top to bottom, depending on the orientation of the RBSplitView. Will return zero if there\'92s no containing RBSplitView. See 833 | \f2\fs22 \cf2 - setPosition: 834 | \f0\fs28 \cf0 .\ 835 | \pard\tx7140\li2480\fi-380\ql\qnatural 836 | 837 | \f1\b \cf0 \ 838 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 839 | \cf0 setCanCollapse\ 840 | \pard\li3240\fi-760\ql\qnatural 841 | 842 | \f0\b0 \cf0 - (void) 843 | \b setCanCollapse: 844 | \b0 (BOOL) 845 | \i flag 846 | \i0 \ 847 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 848 | 849 | \fs16 \cf0 \ 850 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 851 | 852 | \fs28 \cf0 Set a flag to indicate if the receiver can be collapsed. See 853 | \f2\fs22 \cf2 - collapse 854 | \f0\fs28 \cf0 , 855 | \f2\fs22 \cf2 - expand 856 | \f0\fs28 \cf0 , 857 | \f2\fs22 \cf2 - isCollapsed 858 | \f0\fs28 \cf0 , 859 | \f2\fs22 \cf2 - canCollapse: 860 | \f0\fs28 \cf0 . However, be aware that the RBSplitView\'92s delegate can override all subviews\'92 settings of 861 | \f2\fs22 \cf2 - setCanCollapse: 862 | \f0\fs28 \cf0 by implementing 863 | \f2\fs22 \cf2 - splitView:canCollapse: 864 | \f0\fs28 \cf0 .\ 865 | \pard\tx7140\li2480\fi-380\ql\qnatural 866 | 867 | \f1\b\fs16 \cf0 \ 868 | \ 869 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 870 | 871 | \fs28 \cf0 setCoupled:\ 872 | \pard\li3240\fi-760\ql\qnatural 873 | 874 | \f0\b0 \cf0 - (void) 875 | \b setCoupled: 876 | \b0 (BOOL) 877 | \i flag 878 | \i0 \ 879 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 880 | 881 | \fs16 \cf0 \ 882 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 883 | 884 | \fs28 \cf0 Ignored for RBSplitSubviews. If the receiver is a RBSplitView directly nested inside another RBSplitView, turns coupling on or off. Also see 885 | \f2\fs22 \cf2 - coupledSplitView 886 | \f0\fs28 \cf0 , 887 | \f2\fs22 \cf2 - couplingSplitView 888 | \f0\fs28 \cf0 , 889 | \f2\fs22 \cf2 - isCoupled: 890 | \f0\fs28 \cf0 .\ 891 | \pard\tx7140\li2480\fi-380\ql\qnatural 892 | 893 | \f1\b\fs16 \cf0 \ 894 | \ 895 | \pard\tx7140\li2480\fi-380\ql\qnatural 896 | 897 | \fs28 \cf0 setDimension:\ 898 | \pard\li3240\fi-760\ql\qnatural 899 | 900 | \f0\b0 \cf0 - (void) 901 | \b setDimension: 902 | \b0 (float) 903 | \i value 904 | \i0 \ 905 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 906 | 907 | \fs16 \cf0 \ 908 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 909 | 910 | \fs28 \cf0 Sets the receiver\'92s dimension, subject to the size constraints of the receiver and of sibling subviews. If the receiver is collapsed the effects will manifest only when it\'92s reexpanded. This will call 911 | \f2\fs22 \cf2 - adjustSubviews 912 | \f0\fs28 \cf0 on the receiver\'92s RBSplitView. See 913 | \f2\fs22 \cf2 - dimension 914 | \f0\fs28 \cf0 , 915 | \f2\fs22 \cf2 - changeDimensionBy:mayCollapse:move: 916 | \f0\fs28 \cf0 .\ 917 | \pard\tx7140\li2480\fi-380\ql\qnatural 918 | 919 | \f1\b\fs16 \cf0 \ 920 | \ 921 | \pard\tx6140\tx9660\tx10180\li6140\fi-4040\ql\qnatural 922 | 923 | \fs28 \cf0 setHidden:\ 924 | \pard\li3240\fi-760\ql\qnatural 925 | 926 | \f0\b0 \cf0 - (void) 927 | \b setHidden: 928 | \b0 (BOOL) 929 | \i flag 930 | \i0 \ 931 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 932 | 933 | \fs16 \cf0 \ 934 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 935 | 936 | \fs28 \cf0 Hiding a RBSplitSubview by passing YES makes the containing RBSplitView be adjusted so no gaps are visible. This differs from collapsing in that the subview\'92s frame isn\'92t changed. Unhiding it will restore it to the previous size, and will also readjust the containing RBSplitView. 937 | \f2\fs22 \cf2 938 | \f0\fs28 \cf0 \ 939 | \pard\tx7140\li2480\fi-380\ql\qnatural 940 | 941 | \f1\b \cf0 \ 942 | setIdentifier:\ 943 | \pard\li3240\fi-760\ql\qnatural 944 | 945 | \f0\b0 \cf0 - (void) 946 | \b setIdentifier: 947 | \b0 (NSString*) 948 | \i aString 949 | \i0 \ 950 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 951 | 952 | \fs16 \cf0 \ 953 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 954 | 955 | \fs28 \cf0 Sets the receiver\'92s identifier, a string that you can use to identify RBSplitSubviews. See 956 | \f2\fs22 \cf2 - identifier 957 | \f0\fs28 \cf0 .\ 958 | If you pass nil in 959 | \i aString 960 | \i0 , 961 | \f2\fs22 \cf2 - identifier 962 | \f0\fs28 \cf0 will return @"" (the empty string) instead of nil.\ 963 | \ 964 | \pard\tx7140\li2480\fi-380\ql\qnatural 965 | 966 | \f1\b \cf0 setMinDimension:andMaxDimension:\ 967 | \pard\li3240\fi-760\ql\qnatural 968 | 969 | \f0\b0 \cf0 - (void) 970 | \b setMinDimension:( 971 | \b0 float) 972 | \i newMinDimension 973 | \i0\b andMaxDimension:( 974 | \b0 float) 975 | \i newMaxDimension 976 | \i0 \ 977 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 978 | 979 | \fs16 \cf0 \ 980 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 981 | 982 | \fs28 \cf0 Sets the receiver\'92s minimum and maximum dimension constraints. See 983 | \f2\fs22 \cf2 - minDimension 984 | \f0\fs28 \cf0 , 985 | \f2\fs22 \cf2 - maxDimension 986 | \f0\fs28 \cf0 .\ 987 | Both parameters will be rounded down to integers, the minimum will be set to at least 1.0, and the maximum to at least the minimum. As a convenience, you can pass 0.0 in 988 | \i newMaxDimension 989 | \i0 to indicate that no maximum constraint is to be set \'97 it will be set to 1,000,000 internally.\ 990 | \ 991 | \pard\tx7140\li2480\fi-380\ql\qnatural 992 | 993 | \f1\b \cf0 setPosition:\ 994 | \pard\li3240\fi-760\ql\qnatural 995 | 996 | \f0\b0 \cf0 - (void) 997 | \b setPosition: 998 | \b0 (unsigned) 999 | \i newPosition 1000 | \i0 \ 1001 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1002 | 1003 | \fs16 \cf0 \ 1004 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1005 | 1006 | \fs28 \cf0 Moves the receiver to the 1007 | \i newPosition 1008 | \i0 in the containing RBSplitView, if it exists. See 1009 | \f2\fs22 \cf2 - position 1010 | \f0\fs28 \cf0 .\ 1011 | Other subviews from that position on are moved left or down; pass some huge number in 1012 | \i newPosition 1013 | \i0 to move the receiver to last place. 1014 | \f2\fs22 \cf2 - adjustSubviews 1015 | \f0\fs28 \cf0 should be called soon afterwards to recalculate the divider and cursor rects.\ 1016 | \ 1017 | \pard\tx7140\li2480\fi-380\ql\qnatural 1018 | 1019 | \f1\b \cf0 setTag:\ 1020 | \pard\li3240\fi-760\ql\qnatural 1021 | 1022 | \f0\b0 \cf0 - (void) 1023 | \b setTag: 1024 | \b0 (NSInteger) 1025 | \i newTag 1026 | \i0 \ 1027 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1028 | 1029 | \fs16 \cf0 \ 1030 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1031 | 1032 | \fs28 \cf0 Sets the receiver\'92s tag, an integer that you can use to identify view objects in your application, to a new value. See 1033 | \f2\fs22 \cf2 - tag: 1034 | \f0\fs28 \cf0 .\ 1035 | \ 1036 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1037 | 1038 | \f1\b \cf0 splitView\ 1039 | \pard\li3240\fi-760\ql\qnatural 1040 | 1041 | \f0\b0 \cf0 - (RBSplitView*) 1042 | \b splitView 1043 | \b0 \ 1044 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1045 | 1046 | \fs16 \cf0 \ 1047 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1048 | 1049 | \fs28 \cf0 Returns the containing RBSplitView or nil if there is none. Differs from 1050 | \f2\fs22 \cf2 -[NSView superview] 1051 | \f0\fs28 \cf0 in that it will return nil if the superview isn\'92t a RBSplitView. Notice that you should avoid having \'93orphan\'94 RBSplitSubviews, or at least manipulating them while they\'92re not inserted into a RBSplitView. See also 1052 | \f2\fs22 \cf2 - couplingSplitView 1053 | \f0\fs28 \cf0 .\ 1054 | \ 1055 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1056 | 1057 | \f1\b \cf0 splitViewIsHorizontal\ 1058 | \pard\li3240\fi-760\ql\qnatural 1059 | 1060 | \f0\b0 \cf0 - (BOOL) 1061 | \b splitViewIsHorizontal 1062 | \b0 \ 1063 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1064 | 1065 | \fs16 \cf0 \ 1066 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1067 | 1068 | \fs28 \cf0 A convenience method that returns YES if the containing RBSplitView is horizontal.\ 1069 | \pard\tx7140\li2480\fi-380\ql\qnatural 1070 | 1071 | \f1\b\fs16 \cf0 \ 1072 | \pard\tx7140\li2480\fi-380\ql\qnatural 1073 | 1074 | \fs28 \cf0 status\ 1075 | \pard\li3240\fi-760\ql\qnatural 1076 | 1077 | \f0\b0 \cf0 - (RBSSubviewStatus) 1078 | \b status 1079 | \b0 \ 1080 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1081 | 1082 | \fs16 \cf0 \ 1083 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1084 | 1085 | \fs28 \cf0 Returns the receiver\'92s current status. Will return one of 1086 | \f3\fs26 RBSSubviewExpanding 1087 | \f0\fs28 , 1088 | \f3\fs26 RBSSubviewCollapsing 1089 | \f0\fs28 , 1090 | \f3\fs26 RBSSubviewNormal 1091 | \f0\fs28 or 1092 | \f3\fs26 RBSSubviewCollapsed 1093 | \f0\fs28 .\ 1094 | The first two are negative, so getting a negative value means the subview is being animated.\ 1095 | 1096 | \f1\b\fs16 \ 1097 | \pard\tx7140\li2480\fi-380\ql\qnatural 1098 | 1099 | \fs28 \cf0 tag\ 1100 | \pard\li3240\fi-760\ql\qnatural 1101 | 1102 | \f0\b0 \cf0 - (NSInteger) 1103 | \b tag 1104 | \b0 \ 1105 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1106 | 1107 | \fs16 \cf0 \ 1108 | \pard\tx2480\tx2860\tx3240\li2100\ql\qnatural 1109 | 1110 | \fs28 \cf0 Returns the receiver\'92s tag, an integer that you can use to identify view objects in your application. See 1111 | \f2\fs22 \cf2 - setTag: 1112 | \f0\fs28 \cf0 .\ 1113 | \pard\tx7140\li2480\fi-380\ql\qnatural 1114 | 1115 | \f1\b\fs16 \cf0 \ 1116 | \ 1117 | \ 1118 | \pard\tx7140\li2480\fi-380\ql\qnatural 1119 | 1120 | \f0\b0\fs28 \cf0 \ 1121 | \ 1122 | \pard\tx7140\li2480\fi-380\ql\qnatural 1123 | 1124 | \f1\b\fs16 \cf0 \ 1125 | } -------------------------------------------------------------------------------- /Plugin/English.lproj/RBSplitSubviewInspector.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1060 5 | 10B504 6 | 732 7 | 1038.2 8 | 437.00 9 | 10 | com.apple.InterfaceBuilder.CocoaPlugin 11 | 732 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.CocoaPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | RBSplitSubviewInspector 34 | 35 | 36 | FirstResponder 37 | 38 | 39 | NSApplication 40 | 41 | 42 | 43 | 256 44 | 45 | YES 46 | 47 | 48 | 268 49 | {{8, 57}, {70, 14}} 50 | 51 | YES 52 | 53 | 67239488 54 | 4326400 55 | Identifier 56 | 57 | LucidaGrande-Bold 58 | 11 59 | 16 60 | 61 | 62 | 63 | 6 64 | System 65 | controlColor 66 | 67 | 3 68 | MC42NjY2NjY2NjY3AA 69 | 70 | 71 | 72 | 6 73 | System 74 | controlTextColor 75 | 76 | 3 77 | MAA 78 | 79 | 80 | 81 | 82 | 83 | 84 | 268 85 | {{84, 55}, {180, 19}} 86 | 87 | YES 88 | 89 | -1804468671 90 | 272761856 91 | 92 | 93 | LucidaGrande 94 | 11 95 | 3100 96 | 97 | 98 | YES 99 | 100 | 6 101 | System 102 | textBackgroundColor 103 | 104 | 3 105 | MQA 106 | 107 | 108 | 109 | 6 110 | System 111 | textColor 112 | 113 | 114 | 115 | 116 | 117 | 118 | 268 119 | {{84, 30}, {86, 19}} 120 | 121 | YES 122 | 123 | -1804468671 124 | -1874721792 125 | 126 | 127 | 128 | 129 | YES 130 | 131 | YES 132 | allowsFloats 133 | attributedStringForZero 134 | decimalSeparator 135 | formatterBehavior 136 | groupingSeparator 137 | locale 138 | negativeFormat 139 | negativeInfinitySymbol 140 | nilSymbol 141 | positiveFormat 142 | positiveInfinitySymbol 143 | usesGroupingSeparator 144 | 145 | 146 | YES 147 | 148 | 149 | 0 150 | 151 | YES 152 | 153 | 154 | YES 155 | 156 | 157 | 158 | . 159 | 160 | , 161 | 162 | 163 | 164 | -0 165 | -∞ 166 | 167 | 0 168 | +∞ 169 | 170 | 171 | 172 | 0 173 | -0 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | NaN 182 | 183 | 184 | 185 | 0 186 | 0 187 | YES 188 | NO 189 | 1 190 | AAAAAAAAAAAAAAAAAAAAAA 191 | 192 | 193 | 194 | 3 195 | YES 196 | YES 197 | YES 198 | 199 | . 200 | , 201 | NO 202 | NO 203 | NO 204 | 205 | 206 | YES 207 | 208 | 209 | 210 | 211 | 212 | 213 | 268 214 | {{8, 32}, {70, 14}} 215 | 216 | YES 217 | 218 | 67239488 219 | 4326400 220 | Tag 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 268 230 | {{84, 5}, {86, 19}} 231 | 232 | YES 233 | 234 | -1804468671 235 | 4195328 236 | 237 | 0 238 | 0 239 | NO 240 | NO 241 | 1 242 | AAAAAAAAAAAAAAAAAAAAAA 243 | 244 | 245 | 246 | 247 | YES 248 | 249 | YES 250 | allowsFloats 251 | attributedStringForZero 252 | formatterBehavior 253 | groupingSeparator 254 | locale 255 | maximum 256 | minimum 257 | negativeFormat 258 | positiveFormat 259 | usesGroupingSeparator 260 | 261 | 262 | YES 263 | 264 | 265 | 0 266 | 267 | 268 | 269 | , 270 | 271 | 272 | 273 | -0 274 | 0 275 | 276 | 277 | 278 | 0 279 | -0 280 | 281 | 282 | 283 | 284 | 285 | NaN 286 | 287 | 288 | 289 | 290 | 291 | 3 292 | YES 293 | YES 294 | YES 295 | 296 | . 297 | , 298 | NO 299 | NO 300 | NO 301 | 302 | 303 | YES 304 | 305 | 306 | 307 | 308 | 309 | 310 | 268 311 | {{177, 3}, {15, 22}} 312 | 313 | YES 314 | 315 | 68025888 316 | 131072 317 | 318 | 319 | 99 320 | 1 321 | YES 322 | 323 | 324 | 325 | 326 | 268 327 | {{8, 7}, {70, 14}} 328 | 329 | YES 330 | 331 | 67239488 332 | 4326400 333 | Position 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | {272, 78} 342 | 343 | NSView 344 | NSResponder 345 | 346 | 347 | 348 | 349 | YES 350 | 351 | 352 | inspectorView 353 | 354 | 355 | 356 | 32 357 | 358 | 359 | 360 | value: inspectedObjectsController.selection.position 361 | 362 | 363 | 364 | 365 | 366 | value: inspectedObjectsController.selection.position 367 | value 368 | inspectedObjectsController.selection.position 369 | 370 | YES 371 | 372 | YES 373 | NSAllowsEditingMultipleValuesSelection 374 | NSConditionallySetsEnabled 375 | 376 | 377 | YES 378 | 379 | 380 | 381 | 382 | 2 383 | 384 | 385 | 86 386 | 387 | 388 | 389 | enabled: inspectedObjectsController.selection.hasSplitView 390 | 391 | 392 | 393 | 394 | 395 | enabled: inspectedObjectsController.selection.hasSplitView 396 | enabled 397 | inspectedObjectsController.selection.hasSplitView 398 | 2 399 | 400 | 401 | 88 402 | 403 | 404 | 405 | value: inspectedObjectsController.selection.position 406 | 407 | 408 | 409 | 410 | 411 | value: inspectedObjectsController.selection.position 412 | value 413 | inspectedObjectsController.selection.position 414 | 415 | NSAllowsEditingMultipleValuesSelection 416 | 417 | 418 | 2 419 | 420 | 421 | 91 422 | 423 | 424 | 425 | enabled: inspectedObjectsController.selection.hasSplitView 426 | 427 | 428 | 429 | 430 | 431 | enabled: inspectedObjectsController.selection.hasSplitView 432 | enabled 433 | inspectedObjectsController.selection.hasSplitView 434 | 2 435 | 436 | 437 | 93 438 | 439 | 440 | 441 | value: inspectedObjectsController.selection.identifier 442 | 443 | 444 | 445 | 446 | 447 | value: inspectedObjectsController.selection.identifier 448 | value 449 | inspectedObjectsController.selection.identifier 450 | 451 | NSAllowsEditingMultipleValuesSelection 452 | 453 | 454 | 2 455 | 456 | 457 | 103 458 | 459 | 460 | 461 | value: inspectedObjectsController.selection.tag 462 | 463 | 464 | 465 | 466 | 467 | value: inspectedObjectsController.selection.tag 468 | value 469 | inspectedObjectsController.selection.tag 470 | 471 | NSAllowsEditingMultipleValuesSelection 472 | 473 | 474 | 2 475 | 476 | 477 | 106 478 | 479 | 480 | 481 | 482 | YES 483 | 484 | 0 485 | 486 | 487 | 488 | 489 | 490 | -2 491 | 492 | 493 | File's Owner 494 | 495 | 496 | -1 497 | 498 | 499 | First Responder 500 | 501 | 502 | -3 503 | 504 | 505 | Application 506 | 507 | 508 | 17 509 | 510 | 511 | YES 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | Inspector View 522 | 523 | 524 | 18 525 | 526 | 527 | YES 528 | 529 | 530 | 531 | 532 | 533 | 31 534 | 535 | 536 | 537 | 538 | 33 539 | 540 | 541 | YES 542 | 543 | 544 | 545 | 546 | 547 | 37 548 | 549 | 550 | YES 551 | 552 | 553 | 554 | 555 | 556 | 44 557 | 558 | 559 | 560 | 561 | 48 562 | 563 | 564 | YES 565 | 566 | 567 | 568 | 569 | 570 | 54 571 | 572 | 573 | 574 | 575 | 57 576 | 577 | 578 | YES 579 | 580 | 581 | 582 | 583 | 584 | 58 585 | 586 | 587 | YES 588 | 589 | 590 | 591 | 592 | 593 | 59 594 | 595 | 596 | YES 597 | 598 | 599 | 600 | 601 | 602 | 60 603 | 604 | 605 | YES 606 | 607 | 608 | 609 | 610 | 611 | 61 612 | 613 | 614 | 615 | 616 | 62 617 | 618 | 619 | 620 | 621 | 63 622 | 623 | 624 | YES 625 | 626 | 627 | 628 | 629 | 630 | 64 631 | 632 | 633 | 634 | 635 | 73 636 | 637 | 638 | 639 | 640 | 641 | 642 | YES 643 | 644 | YES 645 | -3.IBPluginDependency 646 | 17.GUserGuides 647 | 17.IBEditorWindowLastContentRect 648 | 17.IBPluginDependency 649 | 17.IBUserGuides 650 | 17.IBViewEditorWindowController.showingLayoutRectangles 651 | 17.ImportedFromIB2 652 | 17.WindowOrigin 653 | 17.editorWindowContentRectSynchronizationRect 654 | 18.IBPluginDependency 655 | 31.IBPluginDependency 656 | 33.IBPluginDependency 657 | 33.ImportedFromIB2 658 | 37.IBPluginDependency 659 | 37.Palette 660 | 44.IBPluginDependency 661 | 48.IBPluginDependency 662 | 54.IBNumberFormatterBehaviorMetadataKey 663 | 54.IBPluginDependency 664 | 57.IBPluginDependency 665 | 58.IBPluginDependency 666 | 59.IBPluginDependency 667 | 60.IBPluginDependency 668 | 61.IBPluginDependency 669 | 62.IBPluginDependency 670 | 63.IBPluginDependency 671 | 64.IBPluginDependency 672 | 73.IBNumberFormatterBehaviorMetadataKey 673 | 73.IBNumberFormatterLocalizesFormatMetadataKey 674 | 73.IBPluginDependency 675 | 676 | 677 | YES 678 | com.apple.InterfaceBuilder.CocoaPlugin 679 | 680 | YES 681 | 682 | 683 | 90 684 | 0 685 | 686 | 687 | 688 | 227 689 | 0 690 | 691 | 692 | {{360, 453}, {272, 78}} 693 | com.apple.InterfaceBuilder.CocoaPlugin 694 | 695 | YES 696 | 697 | 698 | 84 699 | 0 700 | 701 | 702 | 703 | 264 704 | 0 705 | 706 | 707 | 708 | 4 709 | 3 710 | 711 | 712 | 713 | 11 714 | 0 715 | 716 | 717 | 718 | 4 719 | 1 720 | 721 | 722 | 723 | 170 724 | 0 725 | 726 | 727 | 728 | 178 729 | 0 730 | 731 | 732 | 733 | 734 | {155, 478} 735 | {{399, 796}, {272, 170}} 736 | com.apple.InterfaceBuilder.CocoaPlugin 737 | com.apple.InterfaceBuilder.CocoaPlugin 738 | com.apple.InterfaceBuilder.CocoaPlugin 739 | 740 | com.apple.InterfaceBuilder.CocoaPlugin 741 | com.yourcompany.AppKitPalettes 742 | com.apple.InterfaceBuilder.CocoaPlugin 743 | com.apple.InterfaceBuilder.CocoaPlugin 744 | 745 | com.apple.InterfaceBuilder.CocoaPlugin 746 | com.apple.InterfaceBuilder.CocoaPlugin 747 | com.apple.InterfaceBuilder.CocoaPlugin 748 | com.apple.InterfaceBuilder.CocoaPlugin 749 | com.apple.InterfaceBuilder.CocoaPlugin 750 | com.apple.InterfaceBuilder.CocoaPlugin 751 | com.apple.InterfaceBuilder.CocoaPlugin 752 | com.apple.InterfaceBuilder.CocoaPlugin 753 | com.apple.InterfaceBuilder.CocoaPlugin 754 | 755 | 756 | com.apple.InterfaceBuilder.CocoaPlugin 757 | 758 | 759 | 760 | YES 761 | 762 | 763 | YES 764 | 765 | 766 | 767 | 768 | YES 769 | 770 | 771 | YES 772 | 773 | 774 | 775 | 142 776 | 777 | 778 | 779 | YES 780 | 781 | NSObject 782 | 783 | YES 784 | 785 | YES 786 | didAdjustSubviews: 787 | willAdjustSubviews: 788 | 789 | 790 | YES 791 | RBSplitView 792 | RBSplitView 793 | 794 | 795 | 796 | IBProjectSource 797 | Source/RBSplitView.h 798 | 799 | 800 | 801 | RBSplitSubview 802 | 803 | IBProjectSource 804 | Plugin/RBSplitViewPlugin.h 805 | 806 | 807 | 808 | RBSplitSubview 809 | NSView 810 | 811 | IBProjectSource 812 | Source/RBSplitSubview.h 813 | 814 | 815 | 816 | RBSplitSubview 817 | 818 | IBProjectSource 819 | Source/RBSplitViewPrivateDefines.h 820 | 821 | 822 | 823 | RBSplitSubviewInspector 824 | IBInspector 825 | 826 | 827 | 828 | RBSplitView 829 | 830 | 831 | 832 | RBSplitView 833 | RBSplitSubview 834 | 835 | delegate 836 | id 837 | 838 | 839 | 840 | 841 | RBSplitView 842 | 843 | 844 | 845 | 846 | YES 847 | 848 | IBInspector 849 | NSObject 850 | 851 | inspectorView 852 | NSView 853 | 854 | 855 | IBFrameworkSource 856 | InterfaceBuilderKit.framework/Headers/IBInspector.h 857 | 858 | 859 | 860 | NSObject 861 | 862 | IBFrameworkSource 863 | InterfaceBuilderKit.framework/Headers/IBObjectIntegration.h 864 | 865 | 866 | 867 | NSView 868 | 869 | IBFrameworkSource 870 | InterfaceBuilderKit.framework/Headers/IBViewIntegration.h 871 | 872 | 873 | 874 | 875 | 0 876 | 877 | com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 878 | 879 | 880 | YES 881 | ../../RBSplitView.xcodeproj 882 | 3 883 | 884 | 885 | -------------------------------------------------------------------------------- /Plugin/English.lproj/RBSplitViewPlugin.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1060 5 | 10B504 6 | 732 7 | 1038.2 8 | 437.00 9 | 10 | 732 11 | 732 12 | 13 | 14 | 15 | 16 | 17 | com.apple.InterfaceBuilder.IBSDKPlugin 18 | com.apple.InterfaceBuilder.CocoaPlugin 19 | 20 | 21 | 22 | 23 | RBSplitViewPlugin 24 | 25 | 26 | FirstResponder 27 | 28 | 29 | NSApplication 30 | 31 | 32 | 33 | 292 34 | 35 | 36 | 37 | 268 38 | 39 | Apple PDF pasteboard type 40 | Apple PICT pasteboard type 41 | Apple PNG pasteboard type 42 | NSFilenamesPboardType 43 | NeXT Encapsulated PostScript v1.2 pasteboard type 44 | NeXT TIFF v4.0 pasteboard type 45 | 46 | {48, 48} 47 | 48 | YES 49 | 50 | 130560 51 | 33554432 52 | 53 | NSImage 54 | RBSplitViewPlugin 55 | 56 | 0 57 | 2 58 | 0 59 | NO 60 | 61 | YES 62 | 63 | 64 | {48, 48} 65 | RBSplitView 66 | DF5A1C5F-3DF7-4C73-BBAB-E8DED7357FAC 67 | A more flexible split view. 68 | 69 | A more flexible split view. Details at http://www.brockerhoff.net/src/rbs.html 70 | 71 | 72 | Helvetica 73 | 12 74 | 16 75 | 76 | 77 | 4 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 0 89 | NO 90 | 91 | 92 | 93 | 274 94 | 95 | Apple PDF pasteboard type 96 | Apple PICT pasteboard type 97 | Apple PNG pasteboard type 98 | NSFilenamesPboardType 99 | NeXT Encapsulated PostScript v1.2 pasteboard type 100 | NeXT TIFF v4.0 pasteboard type 101 | 102 | {128, 80} 103 | 104 | YES 105 | 106 | 130560 107 | 33554432 108 | 109 | NSImage 110 | RBSplitView 111 | 112 | 0 113 | 2 114 | 0 115 | NO 116 | 117 | YES 118 | 119 | 120 | 121 | 122 | 123 | 124 | representedObject 125 | 126 | 127 | 128 | 59 129 | 130 | 131 | 132 | 133 | 134 | 0 135 | 136 | 137 | 138 | 139 | 140 | -2 141 | 142 | 143 | File's Owner 144 | 145 | 146 | -1 147 | 148 | 149 | First Responder 150 | 151 | 152 | -3 153 | 154 | 155 | Application 156 | 157 | 158 | 40 159 | 160 | 161 | 162 | 163 | 164 | Library Object Template 165 | 166 | 167 | 47 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 54 176 | 177 | 178 | 179 | 180 | 57 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 58 189 | 190 | 191 | 192 | 193 | 194 | 195 | com.apple.InterfaceBuilder.CocoaPlugin 196 | 197 | com.apple.InterfaceBuilder.IBSDKPlugin 198 | 199 | com.apple.InterfaceBuilder.CocoaPlugin 200 | 201 | com.apple.InterfaceBuilder.CocoaPlugin 202 | {{0, 665}, {128, 80}} 203 | com.apple.InterfaceBuilder.CocoaPlugin 204 | com.apple.InterfaceBuilder.CocoaPlugin 205 | 206 | 207 | 208 | 209 | 210 | 59 211 | 212 | 213 | 214 | 215 | FirstResponder 216 | NSObject 217 | 218 | fax: 219 | id 220 | 221 | 222 | IBUserSource 223 | 224 | 225 | 226 | 227 | IBLibraryObjectTemplate 228 | NSView 229 | 230 | IBUserSource 231 | 232 | 233 | 234 | 235 | NSFormatter 236 | NSObject 237 | 238 | IBUserSource 239 | 240 | 241 | 242 | 243 | RBSplitViewPlugin 244 | IBPlugin 245 | 246 | NSTextField 247 | NSView 248 | 249 | 250 | IBProjectSource 251 | Plugin/RBSplitViewPlugin.h 252 | 253 | 254 | 255 | 256 | 257 | IBPlugin 258 | NSObject 259 | 260 | preferencesView 261 | NSView 262 | 263 | 264 | IBFrameworkSource 265 | InterfaceBuilderKit.framework/Headers/IBPlugin.h 266 | 267 | 268 | 269 | NSObject 270 | 271 | IBFrameworkSource 272 | InterfaceBuilderKit.framework/Headers/IBObjectIntegration.h 273 | 274 | 275 | 276 | NSView 277 | 278 | IBFrameworkSource 279 | InterfaceBuilderKit.framework/Headers/IBViewIntegration.h 280 | 281 | 282 | 283 | 284 | 0 285 | 286 | com.apple.InterfaceBuilder.CocoaPlugin.macosx 287 | 288 | 289 | 290 | com.apple.InterfaceBuilder.CocoaPlugin.macosx 291 | 292 | 293 | YES 294 | ../../RBSplitView.xcodeproj 295 | 3 296 | 297 | 298 | -------------------------------------------------------------------------------- /Plugin/Plugin-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | net.brockerhoff.RBSplitView.IBPlugin 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.2 23 | NSPrincipalClass 24 | RBSplitViewPlugin 25 | 26 | 27 | -------------------------------------------------------------------------------- /Plugin/RBSplitSubview.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | ClassName = RBSplitSubview; 3 | SuperClass = NSView; 4 | Actions = { 5 | }; 6 | Outlets = { 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /Plugin/RBSplitView.classdescription: -------------------------------------------------------------------------------- 1 | { 2 | ClassName = RBSplitView; 3 | SuperClass = RBSplitSubview; 4 | Actions = { 5 | }; 6 | Outlets = { 7 | delegate = id; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /Plugin/RBSplitView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Plugin/RBSplitView.png -------------------------------------------------------------------------------- /Plugin/RBSplitViewPlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // RBSplitViewPlugin.h version 1.2 3 | // RBSplitView 4 | // 5 | // Created by Rainer Brockerhoff on 24/09/2004. 6 | // Copyright 2004-2007 Rainer Brockerhoff. 7 | // Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License. 8 | // 9 | 10 | #import 11 | #import "RBSplitView.h" 12 | 13 | // This is the main plugin class. 14 | 15 | @interface RBSplitViewPlugin : IBPlugin { 16 | IBOutlet NSView* prefView; 17 | IBOutlet NSTextField* pluginPath; 18 | } 19 | @end 20 | 21 | // This class implements the RBSplitSubview attribute inspector. 22 | 23 | @interface RBSplitSubviewInspector : IBInspector { 24 | RBSplitSubview* splitSubview; 25 | // IBOutlet NSButton* collapseButton; 26 | // IBOutlet NSButton* adjustButton; 27 | // IBOutlet NSTextField* identifierValue; 28 | // IBOutlet NSTextField* minimumValue; 29 | // IBOutlet NSTextField* maximumValue; 30 | // IBOutlet NSStepper* positionStepper; 31 | // IBOutlet NSTextField* positionValue; 32 | // IBOutlet NSTextField* tagValue; 33 | // IBOutlet NSButton* currentMinButton; 34 | // IBOutlet NSButton* currentMaxButton; 35 | } 36 | @end 37 | 38 | // This class implements the RBSplitSubview size inspector. 39 | 40 | @interface RBSplitSubviewSizeInspector : IBInspector { 41 | // RBSplitSubview* splitSubview; 42 | // IBOutlet NSForm* sizeValue; 43 | // IBOutlet NSTextField* sizeLimits; 44 | // IBOutlet NSButton* collapsedButton; 45 | } 46 | - (IBAction)setMinimumAction:(id)sender; 47 | - (IBAction)setMaximumAction:(id)sender; 48 | - (IBAction)adjustTheSubview:(id)sender; 49 | @end 50 | 51 | // This class implements the RBSplitView attribute inspector. 52 | 53 | @interface RBSplitViewInspector : IBInspector { 54 | // RBSplitView* splitView; 55 | // IBOutlet NSTextField* autosaveName; 56 | // IBOutlet NSColorWell* backgroundWell; 57 | // IBOutlet NSPopUpButton* dividerImage; 58 | // IBOutlet NSTextField* dividerSize; 59 | // IBOutlet NSButton* coupledButton; 60 | // IBOutlet NSButton* useButton; 61 | // IBOutlet NSTextField* identifier; 62 | // IBOutlet NSMatrix* orientation; 63 | // IBOutlet NSTextField* subviewCount; 64 | // IBOutlet NSStepper* subviewStepper; 65 | // IBOutlet NSTextField* tagValue; 66 | // IBOutlet NSTabView* tabView; 67 | // IBOutlet NSButton* collapseButton; 68 | // IBOutlet NSTextField* identifierValue; 69 | // IBOutlet NSTextField* minimumValue; 70 | // IBOutlet NSTextField* maximumValue; 71 | // IBOutlet NSStepper* positionStepper; 72 | // IBOutlet NSTextField* positionValue; 73 | // IBOutlet NSTextField* thicknessValue; 74 | IBOutlet NSPopUpButton* dividerImage; 75 | IBOutlet NSTextField* imageText; 76 | } 77 | - (IBAction)dividerAction:(id)sender; 78 | @end 79 | 80 | // This category adds some functionality to RBSplitSubview to support Interface Builder stuff. 81 | 82 | @interface RBSplitSubview (RBSS_IBAdditions) 83 | - (void)setMinDimension:(NSString*)mind; 84 | - (void)setMaxDimension:(NSString*)maxd; 85 | @end 86 | 87 | // This category adds some functionality to RBSplitView to support Interface Builder stuff. 88 | 89 | @interface RBSplitView (RBSV_IBAdditions) 90 | @end 91 | 92 | // A simple number formatter. 93 | @interface RBNumberFormatter : NSNumberFormatter { 94 | } 95 | @end 96 | 97 | -------------------------------------------------------------------------------- /Plugin/RBSplitViewPlugin.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Plugin/RBSplitViewPlugin.icns -------------------------------------------------------------------------------- /Plugin/RBSplitViewPlugin.m: -------------------------------------------------------------------------------- 1 | // 2 | // RBSplitViewPlugin.m version 1.2 3 | // RBSplitView 4 | // 5 | // Created by Rainer Brockerhoff on 24/09/2004. 6 | // Copyright 2004-2009 Rainer Brockerhoff. 7 | // Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License. 8 | // 9 | 10 | #import "RBSplitViewPlugin.h" 11 | #import "RBSplitViewPrivateDefines.h" 12 | #import 13 | 14 | // Please don't remove this copyright notice! 15 | static const unsigned char RBSplitViewPlugin_Copyright[] __attribute__ ((used)) = 16 | "RBSplitViewPlugin 1.2 Copyright(c)2004-2009 by Rainer Brockerhoff ."; 17 | 18 | // This is the plugin class itself. 19 | 20 | @implementation RBSplitViewPlugin 21 | 22 | - (NSImage*)thumb8 { 23 | static NSImage* thumb8 = nil; 24 | if (!thumb8) { 25 | thumb8 = [[NSImage alloc] initWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForImageResource:@"Thumb8"]]; 26 | [thumb8 setFlipped:YES]; 27 | } 28 | return thumb8; 29 | } 30 | 31 | - (NSImage*)thumb9 { 32 | static NSImage* thumb9 = nil; 33 | if (!thumb9) { 34 | thumb9 = [[NSImage alloc] initWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForImageResource:@"Thumb9"]]; 35 | [thumb9 setFlipped:YES]; 36 | } 37 | return thumb9; 38 | } 39 | 40 | - (NSArray *)libraryNibNames { 41 | return [NSArray arrayWithObject:@"RBSplitViewPlugin"]; 42 | } 43 | 44 | - (NSString *)label { 45 | return @"RBSplitView Plugin"; 46 | } 47 | 48 | - (NSArray *)pasteboardObjectsForDraggedLibraryView:(NSView *)view { 49 | RBSplitView* splitView = [[[RBSplitView alloc] initWithFrame:[view frame] andSubviews:2] autorelease]; 50 | [splitView setDivider:[self thumb8]]; 51 | [splitView adjustSubviews]; 52 | return [NSArray arrayWithObject:splitView]; 53 | } 54 | 55 | - (NSView*)preferencesView { 56 | if (!prefView) { 57 | [NSBundle loadNibNamed:@"RBSplitViewPreferences" owner:self]; 58 | [pluginPath setStringValue:[[NSBundle bundleForClass:[self class]] bundlePath]]; 59 | } 60 | return prefView; 61 | } 62 | 63 | - (NSArray *)requiredFrameworks { 64 | NSBundle* bundle = [NSBundle bundleForClass:[self class]]; 65 | NSArray* paths = [bundle pathsForResourcesOfType:@"framework" inDirectory:@"../Frameworks"]; 66 | NSMutableArray* frmwks = [NSMutableArray arrayWithObject:[NSBundle bundleWithIdentifier:@"com.apple.Cocoa"]]; 67 | for (NSString* fp in paths) { 68 | NSBundle* frmw = [NSBundle bundleWithPath:fp]; 69 | NSError* error = nil; 70 | if ([frmw loadAndReturnError:&error]) { 71 | [frmwks addObject:frmw]; 72 | } else { 73 | NSLog(@"RBSplitView Plugin: Error loading framework %@:\n%@",fp,error); 74 | } 75 | } 76 | return frmwks; 77 | } 78 | 79 | @end 80 | 81 | // This category adds some functionality to RBSplitSubview to support Interface Builder stuff. 82 | 83 | @implementation RBSplitSubview (RBSS_IBAdditions) 84 | 85 | - (NSString *)ibDefaultLabel { 86 | return @"RBSplitSubview"; 87 | } 88 | 89 | - (void)ibPopulateAttributeInspectorClasses:(NSMutableArray *)classes { 90 | [super ibPopulateAttributeInspectorClasses:classes]; 91 | [classes addObject:[RBSplitSubviewInspector class]]; 92 | } 93 | 94 | - (void)ibPopulateSizeInspectorClasses:(NSMutableArray *)classes { 95 | if ([self splitView]) { 96 | [classes addObject:[RBSplitSubviewSizeInspector class]]; 97 | } else { 98 | [super ibPopulateSizeInspectorClasses:classes]; 99 | } 100 | } 101 | 102 | - (void)ibPopulateKeyPaths:(NSMutableDictionary *)keyPaths { 103 | [super ibPopulateKeyPaths:keyPaths]; 104 | [[keyPaths objectForKey:IBAttributeKeyPaths] addObjectsFromArray: 105 | [NSArray arrayWithObjects:@"tag",@"identifier",@"position",@"canCollapse",@"hasSplitView",@"canAdjust",@"collapsed",@"minDimension",@"maxDimension",@"dimension",nil]]; 106 | } 107 | 108 | // This overrides RBSplitSubview's drawRect: method, to draw the nice brown background for 109 | // empty subviews. As a convenience, the subview's dimension is also shown. 110 | - (void)drawRect:(NSRect)rect { 111 | // Draw only if a normal subview. 112 | if ([self numberOfSubviews]>0) { 113 | // Don't draw brown background if there are any subviews; draw the set background, if any. 114 | NSColor* bg = [[self splitView] background]; 115 | if (bg) { 116 | [bg set]; 117 | NSRectFillUsingOperation(rect,NSCompositeSourceOver); 118 | } 119 | return; 120 | } 121 | if (![self asSplitView]) { 122 | rect = [self bounds]; 123 | // Draws the bezel around the subview. 124 | static NSRectEdge mySides[] = {NSMinXEdge,NSMaxYEdge,NSMinXEdge,NSMinYEdge,NSMaxXEdge,NSMaxYEdge,NSMaxXEdge,NSMinYEdge}; 125 | static CGFloat myGrays[] = {0.5,0.5,1.0,1.0,1.0,1.0,0.5,0.5}; 126 | rect = NSDrawTiledRects(rect,rect,mySides,myGrays,8); 127 | static NSColor* brown = nil; 128 | if (!brown) { 129 | brown = [[[NSColor alternateSelectedControlColor] colorWithAlphaComponent:0.5] retain]; 130 | } 131 | [brown set]; 132 | NSRectFillUsingOperation(rect,NSCompositeSourceOver); 133 | // Sets up the text attributes for the dimension text. 134 | static NSDictionary* attributes = nil; 135 | if (!attributes) { 136 | attributes = [[NSDictionary alloc] initWithObjectsAndKeys:[NSColor whiteColor],NSForegroundColorAttributeName,[NSFont systemFontOfSize:12.0],NSFontAttributeName,nil]; 137 | } 138 | // Sets up the "nnnpx" string and draws it centered into the subview. 139 | NSMutableAttributedString* label = [[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%gpx",[self dimension]] attributes:attributes] autorelease]; 140 | NSSize labelSize = [label size]; 141 | if (rect.size.width=WAYOUT)) { 405 | return @""; 406 | } 407 | return [super stringForObjectValue:anObject]; 408 | } 409 | 410 | - (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string errorDescription:(NSString **)error { 411 | if (([string length]==0)||([string floatValue]<1.0)) { 412 | *anObject = @""; 413 | return YES; 414 | } 415 | return [super getObjectValue:anObject forString:string errorDescription:error]; 416 | } 417 | 418 | @end 419 | 420 | @implementation RBSplitSubviewInspector 421 | 422 | - (NSString *)viewNibName { 423 | return @"RBSplitSubviewInspector"; 424 | } 425 | 426 | + (BOOL)supportsMultipleObjectInspection { 427 | return NO; 428 | } 429 | 430 | @end 431 | 432 | @implementation RBSplitSubviewSizeInspector 433 | 434 | - (NSString *)viewNibName { 435 | return @"RBSplitSubviewSizeInspector"; 436 | } 437 | 438 | + (BOOL)supportsMultipleObjectInspection { 439 | return NO; 440 | } 441 | 442 | - (RBSplitSubview*)subView { 443 | NSArray* objs = [[self inspectedObjectsController] selectedObjects]; 444 | if ([objs count]==1) { 445 | return [objs objectAtIndex:0]; 446 | } 447 | return nil; 448 | } 449 | 450 | - (IBAction)setMinimumAction:(id)sender { 451 | RBSplitSubview* subv = [self subView]; 452 | [self willChangeValueForKey:@"minDimension"]; 453 | [self willChangeValueForKey:@"dimension"]; 454 | [subv setMinDimension:[subv dimension] andMaxDimension:[subv maxDimension]]; 455 | [self didChangeValueForKey:@"minDimension"]; 456 | [self didChangeValueForKey:@"dimension"]; 457 | [self refresh]; 458 | } 459 | 460 | - (IBAction)setMaximumAction:(id)sender { 461 | RBSplitSubview* subv = [self subView]; 462 | [self willChangeValueForKey:@"maxDimension"]; 463 | [self willChangeValueForKey:@"dimension"]; 464 | [subv setMinDimension:[subv minDimension] andMaxDimension:[subv dimension]]; 465 | [self didChangeValueForKey:@"maxDimension"]; 466 | [self didChangeValueForKey:@"dimension"]; 467 | [self refresh]; 468 | } 469 | 470 | - (IBAction)adjustTheSubview:(id)sender { 471 | RBSplitSubview* subv = [self subView]; 472 | NSArray* subs = [subv subviews]; 473 | if ([subs count]==1) { 474 | NSView* sub = [subs objectAtIndex:0]; 475 | [sub setFrame:[subv bounds]]; 476 | [sub setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable]; 477 | } 478 | } 479 | 480 | @end 481 | 482 | 483 | @implementation RBSplitViewInspector 484 | 485 | - (NSString *)viewNibName { 486 | return @"RBSplitViewInspector"; 487 | } 488 | 489 | + (BOOL)supportsMultipleObjectInspection { 490 | return NO; 491 | } 492 | 493 | - (RBSplitView*)splitView { 494 | NSArray* objs = [[self inspectedObjectsController] selectedObjects]; 495 | if ([objs count]==1) { 496 | return [objs objectAtIndex:0]; 497 | } 498 | return nil; 499 | } 500 | 501 | - (IBAction)dividerAction:(id)sender { 502 | NSImage* thi = nil; 503 | switch ([[dividerImage selectedItem] tag]) { 504 | // case 1: // None 505 | // thi = nil; 506 | // break; 507 | case 2: // Empty 508 | thi = [[[NSImage alloc] initWithSize:NSMakeSize(1.0,1.0)] autorelease]; 509 | [thi lockFocus]; 510 | [[NSColor clearColor] set]; 511 | NSRectFill(NSMakeRect(0.0,0.0,1.0,1.0)); 512 | [thi unlockFocus]; 513 | [thi setFlipped:YES]; 514 | break; 515 | case 3: // Default 8x8 516 | thi = [[RBSplitViewPlugin sharedInstance] thumb8]; 517 | break; 518 | case 4: // NSSplitView's 9x9 519 | thi = [[RBSplitViewPlugin sharedInstance] thumb9]; 520 | break; 521 | case 5: // Paste Image 522 | thi = [[[NSImage alloc] initWithPasteboard:[NSPasteboard generalPasteboard]] autorelease]; 523 | [thi setFlipped:YES]; 524 | break; 525 | } 526 | [[self splitView] setDivider:thi]; 527 | [self refresh]; 528 | } 529 | 530 | - (void)refresh { 531 | RBSplitView* sv = [self splitView]; 532 | if (sv) { 533 | NSImage* divider = [[[sv divider] copy] autorelease]; 534 | [divider setFlipped:NO]; 535 | [[[dividerImage menu] itemAtIndex:0] setImage:divider]; 536 | NSSize size = divider?[divider size]:NSZeroSize; 537 | [imageText setStringValue:[NSString stringWithFormat:@"(%g x %g)",size.width,size.height]]; 538 | } 539 | [super refresh]; 540 | } 541 | 542 | @end 543 | 544 | 545 | -------------------------------------------------------------------------------- /Plugin/Thumb8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Plugin/Thumb8.png -------------------------------------------------------------------------------- /Plugin/Thumb9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Plugin/Thumb9.png -------------------------------------------------------------------------------- /RB.xcconfig: -------------------------------------------------------------------------------- 1 | PREBINDING = NO 2 | ZERO_LINK = NO 3 | LINK_WITH_STANDARD_LIBRARIES = YES 4 | GCC_REUSE_STRINGS = YES 5 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 6 | GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES 7 | GCC_WARN_MISSING_PARENTHESES = YES 8 | GCC_WARN_CHECK_SWITCH_STATEMENTS = YES 9 | GCC_WARN_UNINITIALIZED_AUTOS = NO 10 | GCC_WARN_SHADOW = YES 11 | GCC_WARN_SIGN_COMPARE = YES 12 | GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES 13 | GCC_WARN_ABOUT_MISSING_NEWLINE = YES 14 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES 15 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES 16 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = YES 17 | CURRENT_PROJECT_VERSION = 1.2 18 | GCC_MODEL_TUNING = G5 19 | GCC_PRECOMPILE_PREFIX_HEADER = YES 20 | GCC_INCREASE_PRECOMPILED_HEADER_SHARING = YES 21 | GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; 22 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 23 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | RBSplitView by [Rainer Brockerhoff][1] 2 | ====================================== 3 | 4 | [RBSplitView][2] 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. 5 | 6 | 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. 7 | 8 | This latest release of RBSplitView is compatible with Leopard and Snow Leopard, runs on 32-bit or 64-bit, and supports optional garbage-collection. 9 | 10 | The version in this repository includes the basic RBSplitView and RBSplitSubview classes, an Interface Builder plug-in, full source code with Xcode project (for version 3.1), full documentation, and a sample application showing most features. If you’re still on Tiger, you should stay with the previous RBSplitView 1.1.4, which is the initial commit in this repository. 11 | 12 | Simplified build settings 13 | ------------------------- 14 | 15 | Jan has changed the build settings to be more simple and developer friendly. The new settings are designed to mimic the integration of the Interface Builder plug-in of [BGHUDAppKit][4]. As your users don’t need the IB plug-in you can do the following, as adapted from BGHUDAppKit’s documentation: 16 | 17 | Shrinking 18 | --------- 19 | 20 | RBSplitView is approx. 1.0 Mb in size. The extra disk space is taken up by the RBSplitView.ibplugin. This really doesn’t need to be in your distributed app, the framework will function normally without it. Do NOT delete RBSplitView.ibplugin from your source RBSplitView.framework. 21 | 22 | The reason the framework is build this way is because IB will automatically look in a linked framework for a plugin. A way to shrink your final APP size is really simple. Create a new “Run Script” build phase and copy the following line to it. 23 | 24 | rm -fR "${CONFIGURATION_BUILD_DIR}/${WRAPPER_NAME}/Contents/Frameworks/RBSplitView.framework/Versions/Current/Resources/RBSplitView.ibplugin" 25 | 26 | What happens is this: When you build, Xcode will look in your final .app folder and remove the unneeded RBSplitView.ibplugin. This shrinks RBSplitView.framework down by approx. 200k. 27 | 28 | Important 29 | --------- 30 | 31 | The previous beta version of the RBSplitView plug-in for Interface Builder had a misspelling in its bundle ID ("RBsplitView" instead of "RBSplitView"), causing nib files built by it to be incompatible with the newer plug-in (where the misspelling was fixed). You can either hand-edit the files inside the nib/xib to fix this, or use the [RBSplitViewFixer droplet application][3]. 32 |   33 | Just download it and drop your .lproj folders onto the application’s icon; source code is included. 34 | 35 | [1]: http://www.brockerhoff.net/ 36 | [2]: http://brockerhoff.net/src/rbs.html 37 | [3]: http://brockerhoff.net/src/RBSplitViewFixer.zip 38 | [4]: http://www.binarymethod.com/bghudappkit/ 39 | -------------------------------------------------------------------------------- /Read Me.rtfd/TXT.rtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Read Me.rtfd/TXT.rtf -------------------------------------------------------------------------------- /Read Me.rtfd/rb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Read Me.rtfd/rb.png -------------------------------------------------------------------------------- /Sample App/Drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Sample App/Drag.png -------------------------------------------------------------------------------- /Sample App/English.lproj/SampleApp.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JanX2/RBSplitView/b8c14bc03e046dcaac41eeb10b7e168aabca6217/Sample App/English.lproj/SampleApp.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sample App/SampleApp-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | net.brockerhoff.RBSplitView.SampleApp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.2 19 | NSMainNibFile 20 | SampleApp 21 | NSPrincipalClass 22 | NSApplication 23 | 24 | 25 | -------------------------------------------------------------------------------- /Sample App/main.h: -------------------------------------------------------------------------------- 1 | /* 2 | * main.h 3 | * RBSplitView 4 | * 5 | * Created by Rainer Brockerhoff on 22/10/09. 6 | * Copyright 2009 Rainer Brockerhoff. All rights reserved. 7 | * 8 | */ 9 | 10 | #import 11 | #import "RBSplitView.h" 12 | 13 | @interface MyAppDelegate : NSObject { 14 | IBOutlet RBSplitSubview* firstSplit; 15 | IBOutlet RBSplitView* secondSplit; 16 | IBOutlet RBSplitView* thirdSplit; 17 | IBOutlet RBSplitView* lowerSplit; 18 | IBOutlet RBSplitView* mySplitView; 19 | IBOutlet NSButton* myButton; 20 | IBOutlet NSView* dragView; 21 | IBOutlet RBSplitSubview* nestedSplit; 22 | } 23 | @end 24 | 25 | #define DIM(x) (((CGFloat*)&(x))[ishor]) 26 | 27 | -------------------------------------------------------------------------------- /Sample App/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 4 | // RBSplitView sample app version 1.2 5 | // RBSplitView 6 | // 7 | // Created by Rainer Brockerhoff on 01/11/2004. 8 | // Copyright 2004-2009 Rainer Brockerhoff. 9 | // Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License. 10 | // 11 | 12 | #import "main.h" 13 | 14 | // Number of pixels to widen the lowerSplit view's divider for dragging/cursor 15 | #define WIDEN (8) 16 | 17 | @implementation MyAppDelegate 18 | 19 | // This keeps firstSplit and nestedSplit the same size whenever the window is resized. 20 | - (void)splitView:(RBSplitView*)sender wasResizedFrom:(CGFloat)oldDimension to:(CGFloat)newDimension { 21 | if (sender==mySplitView) { 22 | [sender adjustSubviewsExcepting:firstSplit]; 23 | } else if (sender==secondSplit) { 24 | [sender adjustSubviewsExcepting:nestedSplit]; 25 | } 26 | } 27 | 28 | // This keeps the button aligned with the left edge of the second subview, and sets its title. 29 | - (void)splitView:(RBSplitView*)sender changedFrameOfSubview:(RBSplitSubview*)subview from:(NSRect)fromRect to:(NSRect)toRect { 30 | if (sender==mySplitView) { 31 | RBSplitSubview* firstOrSecond = [secondSplit isHidden]?thirdSplit:secondSplit; 32 | if (subview==firstSplit) { 33 | // Set the button's title and state according the first subview's state. 34 | if ([RBSplitSubview animating]) { 35 | [myButton setTitle:@"="]; 36 | [myButton setEnabled:NO]; 37 | } else if (toRect.size.width<1.0) { 38 | [myButton setTitle:@">"]; 39 | [myButton setEnabled:YES]; 40 | } else { 41 | [myButton setTitle:@"<"]; 42 | [myButton setEnabled:YES]; 43 | } 44 | } else if (subview==firstOrSecond) { 45 | // Move the button to align with the second (or third) subview. 46 | NSRect oldr = [myButton frame]; 47 | NSRect newr = oldr; 48 | NSView* view = [myButton superview]; 49 | newr.origin.x = [sender convertPoint:toRect.origin toView:view].x; 50 | [myButton setFrame:newr]; 51 | // We ask the button's superview to redisplay just the smallest rect that covers both the old and the new position. 52 | [view setNeedsDisplayInRect:NSUnionRect(oldr,newr)]; 53 | } 54 | } 55 | } 56 | 57 | // This sets the menu item titles according to the state of the first subview and second subviews. 58 | - (BOOL)validateMenuItem:(NSMenuItem*)menuItem { 59 | SEL selector = [menuItem action]; 60 | if (selector==@selector(firstAction:)) { 61 | switch ([firstSplit status]) { 62 | case RBSSubviewExpanding: 63 | case RBSSubviewCollapsing: 64 | return NO; 65 | case RBSSubviewNormal: 66 | [menuItem setTitle:@"Collapse First Split"]; 67 | return YES; 68 | case RBSSubviewCollapsed: 69 | [menuItem setTitle:@"Expand First Split"]; 70 | return YES; 71 | } 72 | } else if (selector==@selector(secondAction:)) { 73 | if ([secondSplit isHidden]) { 74 | [menuItem setTitle:@"Show Middle Split"]; 75 | } else { 76 | [menuItem setTitle:@"Hide Middle Split"]; 77 | } 78 | return YES; 79 | } 80 | return YES; 81 | } 82 | 83 | // This slows the animation down to 1/5th the speed when the shift key is held down. 84 | - (NSTimeInterval)splitView:(RBSplitView*)sender willAnimateSubview:(RBSplitSubview*)subview withDimension:(CGFloat)dimension { 85 | // This is the default speed. 86 | NSTimeInterval duration = 0.2*dimension/150; 87 | if ([[NSApp currentEvent] modifierFlags]&NSShiftKeyMask) { 88 | duration *= 5.0; 89 | } 90 | return duration; 91 | } 92 | 93 | // This makes it possible to drag the first divider around by the dragView. 94 | - (NSUInteger)splitView:(RBSplitView*)sender dividerForPoint:(NSPoint)point inSubview:(RBSplitSubview*)subview { 95 | if (subview==firstSplit) { 96 | if ([dragView mouse:[dragView convertPoint:point fromView:sender] inRect:[dragView bounds]]) { 97 | return 0; // [firstSplit position], which we assume to be zero 98 | } 99 | // This widens the dragging region for the lowerSplit view/ 100 | } else if (sender==lowerSplit) { 101 | NSRect lead = [subview frame]; 102 | NSRect trail = lead; 103 | unsigned pos = [subview position]; 104 | BOOL ishor = [sender isHorizontal]; 105 | CGFloat dim = DIM(trail.size); 106 | DIM(trail.origin) += dim-WIDEN; 107 | DIM(trail.size) = WIDEN; 108 | DIM(lead.size) = WIDEN; 109 | if ([sender mouse:point inRect:lead]&&(pos>0)) { 110 | return pos-1; 111 | } else if ([sender mouse:point inRect:trail]&&(pos<[sender numberOfSubviews]-1)) { 112 | return pos; 113 | } 114 | } 115 | return NSNotFound; 116 | } 117 | 118 | // This makes dragging any divider resize the window while the option key is held down. 119 | // However, it doesn't work for RBSplitViews nested more than one level, so we check for that. 120 | - (BOOL)splitView:(RBSplitView*)sender shouldResizeWindowForDivider:(NSUInteger)divider betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing willGrow:(BOOL)grow { 121 | return (sender!=lowerSplit)&&(([[NSApp currentEvent] modifierFlags]&NSAlternateKeyMask)!=0); 122 | } 123 | 124 | // This changes the cursor when it's over the dragView. 125 | - (NSRect)splitView:(RBSplitView*)sender cursorRect:(NSRect)rect forDivider:(NSUInteger)divider { 126 | if ((sender==mySplitView)&&(divider==0)) { 127 | [sender addCursorRect:[dragView convertRect:[dragView bounds] toView:sender] cursor:[RBSplitView cursor:RBSVVerticalCursor]]; 128 | // Also show the cursor over the widened lowerSplit view. 129 | } else if (sender==lowerSplit) { 130 | BOOL ishor = [sender isHorizontal]; 131 | DIM(rect.origin) -= WIDEN; 132 | DIM(rect.size) += WIDEN*2; 133 | } 134 | return rect; 135 | } 136 | 137 | // This draws a white bar into the divider for the lowerSplit view. 138 | - (NSRect)splitView:(RBSplitView*)sender willDrawDividerInRect:(NSRect)dividerRect betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing withProposedRect:(NSRect)imageRect { 139 | if (sender==lowerSplit) { 140 | [[NSColor whiteColor] set]; 141 | NSRectFill(dividerRect); 142 | return NSZeroRect; 143 | } 144 | return imageRect; 145 | } 146 | 147 | // This collapses/expands the first subview with animation and resizing when double-clicking. 148 | - (BOOL)splitView:(RBSplitView*)sender shouldHandleEvent:(NSEvent*)theEvent inDivider:(NSUInteger)divider betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing { 149 | if ((sender==mySplitView)&&(divider==0)&&([theEvent clickCount]>1)) { 150 | if ([leading isCollapsed]) { 151 | [leading expandWithAnimation:YES withResize:YES]; 152 | } else { 153 | [leading collapseWithAnimation:YES withResize:YES]; 154 | } 155 | return NO; 156 | } 157 | return YES; 158 | } 159 | 160 | 161 | // This is called for collapsing or expanding the first subview with animation but no resizing, either from the menu or from the button. 162 | - (IBAction)firstAction:(id)sender { 163 | if ([firstSplit isCollapsed]) { 164 | [firstSplit expandWithAnimation:YES withResize:NO]; 165 | } else { 166 | [firstSplit collapseWithAnimation:YES withResize:NO]; 167 | } 168 | } 169 | 170 | // This is called for hiding or showing the second subview. 171 | - (IBAction)secondAction:(id)sender { 172 | if ([secondSplit isHidden]) { 173 | [secondSplit setHidden:NO]; 174 | } else { 175 | [secondSplit setHidden:YES]; 176 | } 177 | } 178 | 179 | // Standard delegate method to quit when the window is closed. 180 | - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication { 181 | return YES; 182 | } 183 | 184 | @end 185 | 186 | int main(int argc,char* argv[]) { 187 | return NSApplicationMain(argc,(const char**)argv); 188 | } 189 | -------------------------------------------------------------------------------- /Source/Framework-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | net.brockerhoff.RBSplitView.Framework 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.2 23 | NSPrincipalClass 24 | RBSplitView 25 | 26 | 27 | -------------------------------------------------------------------------------- /Source/RBSplitSubview.h: -------------------------------------------------------------------------------- 1 | // 2 | // RBSplitSubview.h version 1.2 3 | // RBSplitView 4 | // 5 | // Created by Rainer Brockerhoff on 19/11/2004. 6 | // Copyright 2004-2009 Rainer Brockerhoff. 7 | // Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License. 8 | // 9 | 10 | #import 11 | 12 | @class RBSplitView; 13 | 14 | // These values are used to inquire about the status of a subview. 15 | typedef enum { 16 | RBSSubviewExpanding=-2, 17 | RBSSubviewCollapsing=-1, 18 | RBSSubviewNormal=0, 19 | RBSSubviewCollapsed=1 20 | } RBSSubviewStatus; 21 | 22 | @interface RBSplitSubview : NSView { 23 | // Subclasses normally should use setter methods instead of changing instance variables by assignment. 24 | // Most getter methods simply return the corresponding instance variable, so with some care, subclasses 25 | // could reference them directly. 26 | NSString* identifier; // An identifier string for the subview, default is @"". 27 | NSInteger tag; // A tag integer for the subview, default is 0. 28 | CGFloat minDimension; // The minimum dimension. Must be 1.0 or any larger integer. 29 | CGFloat maxDimension; // The maximum dimension. Must be at least equal to the minDimension. 30 | // Set to a large number if there's no maximum. 31 | double fraction; // A fractional part of the dimension, used for proportional resizing. 32 | // Normally varies between -0.999... and 0.999... 33 | // When collapsed, holds the proportion of the RBSplitView's dimension 34 | // the view was occupying before collapsing. 35 | NSRect previous; // Holds the frame rect for the last delegate notification. 36 | NSSize savedSize; // This holds the size the subview had before it was resized beyond 37 | // its minimum or maximum limits. Valid if notInLimits is YES. 38 | NSUInteger actDivider; // This is set temporarily while an alternate drag view is being dragged. 39 | BOOL canDragWindow; // This is set temporarily during a mouseDown on a non-opaque subview. 40 | BOOL canCollapse; // YES if the subview can be collapsed. 41 | BOOL notInLimits; // YES if the subview's dimensions are outside the set limits. 42 | } 43 | 44 | // This class method returns YES if some RBSplitSubview is being animated. 45 | + (BOOL)animating; 46 | 47 | // This is the designated initializer for creating extra subviews programmatically. 48 | - (id)initWithFrame:(NSRect)frame; 49 | 50 | // Returns the immediately containing RBSplitView, or nil if there is none. 51 | // couplingSplitView returns nil if we're a non-coupled RBSplitView. 52 | // outermostSplitView returns the outermost RBSplitView. 53 | - (RBSplitView*)splitView; 54 | - (RBSplitView*)couplingSplitView; 55 | - (RBSplitView*)outermostSplitView; 56 | 57 | // Returns self if we're a RBSplitView, nil otherwise. Convenient for testing or calling methods. 58 | // coupledSplitView returns nil if we're a non-coupled RBSplitView. 59 | - (RBSplitView*)asSplitView; 60 | - (RBSplitView*)coupledSplitView; 61 | 62 | // Sets and gets the coupling between the view and its containing RBSplitView (if any). Coupled 63 | // RBSplitViews take some parameters, such as divider images, from the containing view. The default 64 | // for RBSplitView is YES. However, calling setCoupled: on a RBSplitSubview will have no effect, 65 | // and isCoupled will always return false. 66 | - (void)setCoupled:(BOOL)flag; 67 | - (BOOL)isCoupled; 68 | 69 | // Returns YES if the containing RBSplitView is horizontal. 70 | - (BOOL)splitViewIsHorizontal; 71 | 72 | // Returns the number of subviews. Just a convenience method. 73 | - (NSUInteger)numberOfSubviews; 74 | 75 | // Sets and gets the tag. 76 | - (void)setTag:(NSInteger)theTag; 77 | - (NSInteger)tag; 78 | 79 | // Sets and gets the identifier string. Will never be nil. 80 | - (void)setIdentifier:(NSString*)aString; 81 | - (NSString*)identifier; 82 | 83 | // Position means the subview's position within the RBSplitView - counts from zero left to right 84 | // or top to bottom. Setting it will move the subview to another position without changing its size, 85 | // status or attributes. Set position to 0 to move it to the start, or to some large number to move it 86 | // to the end of the RBSplitView. 87 | - (NSUInteger)position; 88 | - (void)setPosition:(NSUInteger)newPosition; 89 | 90 | // Returns YES if the subview is collapsed. Collapsed subviews are squashed down to zero but never 91 | // made smaller than the minimum dimension as far as their own subviews are concerned. If the 92 | // subview is being animated this will return NO. 93 | - (BOOL)isCollapsed; 94 | 95 | // This will return the current status of the subview. Negative values mean the subview is 96 | // being animated. 97 | - (RBSSubviewStatus)status; 98 | 99 | // Sets and gets the ability to collapse the subview. However, this can be overridden by the delegate. 100 | - (BOOL)canCollapse; 101 | - (void)setCanCollapse:(BOOL)flag; 102 | 103 | // Tests whether the subview can shrink or expand further. 104 | - (BOOL)canShrink; 105 | - (BOOL)canExpand; 106 | 107 | // Sets and gets the minimum and maximum dimensions. They're set at the same time to make sure values 108 | // are consistent. Despite being floats, they'll always have integer values. The minimum value for the 109 | // minimum is 1.0. Pass 0.0 for the maximum to set it to some huge number. 110 | - (CGFloat)minDimension; 111 | - (CGFloat)maxDimension; 112 | - (void)setMinDimension:(CGFloat)newMinDimension andMaxDimension:(CGFloat)newMaxDimension; 113 | 114 | // Call this to expand a subview programmatically. It will return the subview's dimension after 115 | // expansion. 116 | - (CGFloat)expand; 117 | 118 | // Call this to collapse a subview programmatically. It will return the negative 119 | // of the subview's dimension _before_ collapsing, or 0.0 if the subview can't be collapsed. 120 | - (CGFloat)collapse; 121 | 122 | // These calls collapse and expand subviews with animation. They return YES if animation 123 | // startup was successful. 124 | - (BOOL)collapseWithAnimation; 125 | - (BOOL)expandWithAnimation; 126 | 127 | // These methods collapse and expand subviews with animation, depending on the parameters. 128 | // They return YES if animation startup was successful. If resize is NO, the subview is 129 | // collapsed/expanded without resizing it during animation. 130 | - (BOOL)collapseWithAnimation:(BOOL)animate withResize:(BOOL)resize; 131 | - (BOOL)expandWithAnimation:(BOOL)animate withResize:(BOOL)resize; 132 | 133 | // Returns the current dimension of the subview. 134 | - (CGFloat)dimension; 135 | 136 | // Sets the current dimension of the subview, subject to the current maximum and minimum. 137 | // If the subview is collapsed, this has no immediate effect. 138 | - (void)setDimension:(CGFloat)value; 139 | 140 | // This method is used internally when a divider is dragged. It tries to change the subview's dimension 141 | // and returns the actual change, collapsing or expanding whenever possible. You usually won't need 142 | // to call this directly. 143 | - (CGFloat)changeDimensionBy:(CGFloat)increment mayCollapse:(BOOL)mayCollapse move:(BOOL)move; 144 | 145 | @end 146 | 147 | -------------------------------------------------------------------------------- /Source/RBSplitSubview.m: -------------------------------------------------------------------------------- 1 | // 2 | // RBSplitSubview.m version 1.2 3 | // RBSplitView 4 | // 5 | // Created by Rainer Brockerhoff on 19/11/2004. 6 | // Copyright 2004-2009 Rainer Brockerhoff. 7 | // Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License. 8 | // 9 | 10 | #import "RBSplitView.h" 11 | #import "RBSplitViewPrivateDefines.h" 12 | 13 | // This variable points to the animation data structure while an animation is in 14 | // progress; if there's none, it will be NULL. Animating may be very CPU-intensive so 15 | // we allow only one animation to take place at a time. 16 | static animationData* currentAnimation = NULL; 17 | 18 | @implementation RBSplitSubview 19 | 20 | // This class method returns YES if an animation is in progress. 21 | + (BOOL)animating { 22 | return currentAnimation!=NULL; 23 | } 24 | 25 | // This is the designated initializer for RBSplitSubview. It sets some reasonable defaults. However, you 26 | // can't rely on anything working until you insert it into a RBSplitView. 27 | - (id)initWithFrame:(NSRect)frame { 28 | self = [super initWithFrame:frame]; 29 | if (self) { 30 | fraction = 0.0; 31 | canCollapse = NO; 32 | notInLimits = NO; 33 | minDimension = 1.0; 34 | maxDimension = WAYOUT; 35 | identifier = @""; 36 | previous = NSZeroRect; 37 | savedSize = frame.size; 38 | actDivider = NSNotFound; 39 | canDragWindow = NO; 40 | } 41 | return self; 42 | } 43 | 44 | // Just releases our stuff when going away. 45 | - (void)dealloc { 46 | [identifier release]; 47 | [super dealloc]; 48 | } 49 | 50 | // These return nil since we're not a RBSplitView (they're overridden there). 51 | - (RBSplitView*)asSplitView { 52 | return nil; 53 | } 54 | 55 | - (RBSplitView*)coupledSplitView { 56 | return nil; 57 | } 58 | 59 | // Sets and gets the coupling between a RBSplitView and its containing RBSplitView (if any). 60 | // For convenience, these methods are also implemented here. 61 | - (void)setCoupled:(BOOL)flag { 62 | } 63 | 64 | - (BOOL)isCoupled { 65 | return NO; 66 | } 67 | 68 | // RBSplitSubviews are never flipped, unless they're RBSplitViews. 69 | - (BOOL)isFlipped { 70 | return NO; 71 | } 72 | 73 | // We copy the opacity of the owning split view. 74 | - (BOOL)isOpaque { 75 | return [[self couplingSplitView] isOpaque]; 76 | } 77 | 78 | // A hidden RBSplitSubview is not redrawn and is not considered for drawing dividers. 79 | - (void)setHidden:(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 { 86 | [sv adjustSubviewsExcepting:self]; 87 | } 88 | } 89 | } 90 | 91 | // RBSplitSubviews can't be in the responder chain. 92 | - (BOOL)acceptsFirstResponder { 93 | return NO; 94 | } 95 | 96 | // This returns the owning splitview. It's guaranteed to return a RBSplitView or nil. 97 | // You should avoid having "orphan" RBSplitSubviews, or at least manipulating 98 | // them while they're not inserted in a RBSplitView. 99 | - (RBSplitView*)splitView { 100 | id result = [self superview]; 101 | if ([result isKindOfClass:[RBSplitView class]]) { 102 | return (RBSplitView*)result; 103 | } 104 | return nil; 105 | } 106 | 107 | // This also returns the owning splitview. It's overridden for nested RBSplitViews. 108 | - (RBSplitView*)couplingSplitView { 109 | id result = [self superview]; 110 | if ([result isKindOfClass:[RBSplitView class]]) { 111 | return (RBSplitView*)result; 112 | } 113 | return nil; 114 | } 115 | 116 | // This returns the outermost directly containing RBSplitView, or nil. 117 | - (RBSplitView*)outermostSplitView { 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 | } 125 | 126 | // This convenience method returns YES if the containing RBSplitView is horizontal. 127 | - (BOOL)splitViewIsHorizontal { 128 | return [[self splitView] isHorizontal]; 129 | } 130 | 131 | // You can use either tags (NSIntegers) or identifiers (NSStrings) to identify individual subviews. 132 | // We take care not to have nil identifiers. 133 | - (void)setTag:(NSInteger)theTag { 134 | tag = theTag; 135 | } 136 | 137 | - (NSInteger)tag { 138 | return tag; 139 | } 140 | 141 | - (void)setIdentifier:(NSString*)aString { 142 | [identifier autorelease]; 143 | identifier = aString?[aString retain]:@""; 144 | } 145 | 146 | - (NSString*)identifier { 147 | return identifier; 148 | } 149 | 150 | // If we have an identifier, this will make debugging a little easier by appending it to the 151 | // default description. 152 | - (NSString*)description { 153 | return [identifier length]>0?[NSString stringWithFormat:@"%@(%@)",[super description],identifier]:[super description]; 154 | } 155 | 156 | // This pair of methods allows you to get and change the position of a subview (within the split view); 157 | // this counts from zero from the left or top of the split view. 158 | - (NSUInteger)position { 159 | RBSplitView* sv = [self splitView]; 160 | return sv?[[sv subviews] indexOfObjectIdenticalTo:self]:0; 161 | } 162 | 163 | - (void)setPosition:(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 | } 177 | 178 | // Tests whether the subview is collapsed. 179 | - (BOOL)isCollapsed { 180 | return [self RB___visibleDimension]<=0.0; 181 | } 182 | 183 | // Tests whether the subview can shrink further. 184 | - (BOOL)canShrink { 185 | return [self RB___visibleDimension]>([self canCollapse]?0.0:minDimension); 186 | } 187 | 188 | // Tests whether the subview can expand further. 189 | - (BOOL)canExpand { 190 | return [self RB___visibleDimension]collapsing?RBSSubviewCollapsing:RBSSubviewExpanding; 198 | } 199 | return [self RB___visibleDimension]<=0.0?RBSSubviewCollapsed:RBSSubviewNormal; 200 | } 201 | 202 | // Tests whether the subview can be collapsed. The local instance variable will be overridden by the 203 | // delegate method if it's implemented. 204 | - (BOOL)canCollapse { 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 | } 216 | 217 | // This sets the subview's "canCollapse" flag. Ignored if the delegate's splitView:canCollapse: 218 | // method is implemented. 219 | - (void)setCanCollapse:(BOOL)flag { 220 | canCollapse = flag; 221 | } 222 | 223 | // This expands a collapsed subview and calls the delegate's splitView:didExpand: method, if it exists. 224 | // This is not called internally by other methods; call this to expand a subview programmatically. 225 | // As a convenience to other methods, it returns the subview's dimension after expanding (this may be 226 | // off by 1 pixel due to rounding) or 0.0 if it couldn't be expanded. 227 | // The delegate should not change the subview's frame. 228 | - (CGFloat)expand { 229 | return [self RB___expandAndSetToMinimum:NO]; 230 | } 231 | 232 | // This collapses an expanded subview and calls the delegate's splitView:didCollapse: method, if it exists. 233 | // This is not called internally by other methods; call this to expand a subview programmatically. 234 | // As a convenience to other methods, it returns the negative of the subview's dimension before 235 | // collapsing (or 0.0 if it couldn't be collapsed). 236 | // The delegate should not change the subview's frame. 237 | - (CGFloat)collapse { 238 | return [self RB___collapse]; 239 | } 240 | 241 | // This tries to collapse the subview with animation, and collapses it instantly if some other 242 | // subview is animating. Returns YES if animation was started successfully. 243 | - (BOOL)collapseWithAnimation { 244 | return [self collapseWithAnimation:YES withResize:YES]; 245 | } 246 | 247 | // This tries to expand the subview with animation, and expands it instantly if some other 248 | // subview is animating. Returns YES if animation was started successfully. 249 | - (BOOL)expandWithAnimation { 250 | return [self expandWithAnimation:YES withResize:YES]; 251 | } 252 | 253 | // These methods collapse and expand subviews with animation, depending on the parameters. 254 | // They return YES if animation startup was successful. If resize is NO, the subview is 255 | // collapsed/expanded without resizing it during animation. 256 | - (BOOL)collapseWithAnimation:(BOOL)animate withResize:(BOOL)resize { 257 | if ([self status]==RBSSubviewNormal) { 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 | } 270 | 271 | - (BOOL)expandWithAnimation:(BOOL)animate withResize:(BOOL)resize { 272 | if ([self status]==RBSSubviewCollapsed) { 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 | } 282 | 283 | // These 3 methods get and set the view's minimum and maximum dimensions. 284 | // The minimum dimension ought to be an integer at least equal to 1.0 but we make sure. 285 | // The maximum dimension ought to be an integer at least equal to the minimum. As a convenience, 286 | // pass in zero to set it to some huge number. 287 | - (CGFloat)minDimension { 288 | return minDimension; 289 | } 290 | 291 | - (CGFloat)maxDimension { 292 | return maxDimension; 293 | } 294 | 295 | - (void)setMinDimension:(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 ((dimmaxDimension)) { 303 | [[self splitView] setMustAdjust]; 304 | } 305 | } 306 | 307 | // This returns the subview's dimension. If it's collapsed, it returns the dimension it would have 308 | // after expanding. 309 | - (CGFloat)dimension { 310 | CGFloat dim = [self RB___visibleDimension]; 311 | if (dim<=0.0) { 312 | dim = [[self splitView] RB___dimensionWithoutDividers]*fraction; 313 | if (dimmaxDimension) { 316 | dim = maxDimension; 317 | } 318 | } 319 | return dim; 320 | } 321 | 322 | // Sets the current dimension of the subview, subject to the current maximum and minimum. 323 | // If the subview is collapsed, this will have an effect only after reexpanding. 324 | - (void)setDimension:(CGFloat)value { 325 | if (valuemaxDimension) { 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. 341 | fraction = value/[sv RB___dimensionWithoutDividers]; 342 | } 343 | } 344 | 345 | // This just draws the background of a subview, then tells the delegate, if any. 346 | // The delegate would usually draw a frame inside the subview. 347 | - (void)drawRect:(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 | } 359 | 360 | // We check if the RBSplitView must be adjusted before redisplaying programmatically. 361 | // if so, we adjust and display the whole RBSplitView. 362 | - (void)display { 363 | RBSplitView* sv = [self splitView]; 364 | if (sv) { 365 | if ([sv mustAdjust]) { 366 | [sv display]; 367 | } else { 368 | [super display]; 369 | } 370 | } 371 | } 372 | 373 | // RBSplitSubviews will always resize their own subviews. 374 | - (BOOL)autoresizesSubviews { 375 | return YES; 376 | } 377 | 378 | // ...and we don't want that to change under any circumstances. 379 | - (void)setAutoresizesSubviews:(BOOL)flag { 380 | } 381 | 382 | // This is method is called automatically when the subview is resized; don't call it yourself. 383 | - (void)resizeSubviewsWithOldSize:(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 | } 406 | 407 | // This method is used internally when a divider is dragged. It tries to change the subview's dimension 408 | // and returns the actual change, collapsing or expanding whenever possible. You usually won't need 409 | // to call this directly. 410 | - (CGFloat)changeDimensionBy:(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 (newdimolddim) { 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 | } 455 | 456 | // This convenience method returns the number of subviews (surprise!) 457 | - (NSUInteger)numberOfSubviews { 458 | return [[self subviews] count]; 459 | } 460 | 461 | // We return the deepest subview that's hit by aPoint. We also check with the delegate if aPoint is 462 | // within an alternate drag view. 463 | - (NSView*)hitTest:(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 | } 480 | 481 | // This method handles clicking and dragging in an empty portion of the subview, or in an alternate 482 | // drag view as designated by the delegate. 483 | - (void)mouseDown:(NSEvent*)theEvent { 484 | NSWindow* window = [self window]; 485 | NSPoint where = [theEvent locationInWindow]; 486 | if (actDivider=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 | } 617 | 618 | @end 619 | 620 | @implementation RBSplitSubview (RB___SubviewAdditions) 621 | 622 | // This hides/shows the subview without calling adjustSubviews. 623 | - (void)RB___setHidden:(BOOL)flag { 624 | [super setHidden:flag]; 625 | } 626 | 627 | // This internal method returns the current animationData. It will always return nil if 628 | // the receiver isn't the current owner and some other subview is already being animated. 629 | // Otherwise, if the parameter is YES, a new animation will be started (or the current 630 | // one will be restarted). 631 | - (animationData*)RB___animationData:(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; 654 | currentAnimation->stepsDone = 0; 655 | currentAnimation->elapsedTime = 0.0; 656 | currentAnimation->dimension = dim; 657 | currentAnimation->collapsing = ![self isCollapsed]; 658 | currentAnimation->totalTime = total; 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 | } 671 | 672 | // This internal method steps the animation to the next frame. 673 | - (void)RB___stepAnimation { 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 | } 722 | 723 | // This internal method stops the animation, if the receiver is being animated. It will 724 | // return YES if the animation was stopped. 725 | - (BOOL)RB___stopAnimation { 726 | if (currentAnimation&&(currentAnimation->owner==self)) { 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 | } 735 | 736 | // This internal method returns the actual visible dimension of the subview. Differs from -dimension in 737 | // that it returns 0.0 if the subview is collapsed. 738 | - (CGFloat)RB___visibleDimension { 739 | BOOL ishor = [self splitViewIsHorizontal]; 740 | NSRect frame = [self frame]; 741 | return MAX(0.0,DIM(frame.size)); 742 | } 743 | 744 | // This pair of internal methods is used only inside -[RBSplitView adjustSubviews] to copy subview data 745 | // from and to that method's internal cache. 746 | - (void)RB___copyIntoCache:(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 | } 753 | 754 | - (void)RB___updateFromCache:(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 | } 777 | 778 | // This internal method sets minimum and maximum values to the same value, saves the old values, 779 | // and returns the new value (which will be limited to the old values). 780 | - (CGFloat)RB___setMinAndMaxTo:(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 | } 792 | 793 | // This internal method tries to clear the first responder, if the current responder is a descendant of 794 | // the receiving subview. If so, it will set first responder to nil, redisplay the former responder and 795 | // return YES. Returns NO otherwise. 796 | - (BOOL)RB___clearResponder { 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 | } 811 | 812 | // This internal method collapses a subview. 813 | // It returns the negative of the size of the subview before collapsing, or 0.0 if it wasn't collapsed. 814 | - (CGFloat)RB___collapse { 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 | } 830 | 831 | // This internal method finishes the collapse of a subview, stopping the animation if 832 | // there is one, and calling the delegate method if there is one. 833 | - (void)RB___finishCollapse:(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 | } 846 | 847 | // This internal method expands a subview. setToMinimum will usually be YES during a divider drag. 848 | // It returns the size of the subview after expanding, or 0.0 if it wasn't expanded. 849 | - (CGFloat)RB___expandAndSetToMinimum:(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 | } 869 | 870 | // This internal method finishes the the expansion of a subview, stopping the animation if 871 | // there is one, and calling the delegate method if there is one. 872 | - (void)RB___finishExpand:(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 | } 885 | 886 | // These internal methods set the subview's frame or size, and also store a fraction value 887 | // which is used to ensure repeatability when the whole split view is resized. 888 | - (void)RB___setFrame:(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 | } 909 | 910 | - (void)RB___setFrameSize:(NSSize)size withFraction:(double)value { 911 | [[self splitView] setMustAdjust]; 912 | [self setFrameSize:size]; 913 | fraction = value; 914 | } 915 | 916 | // This internal method gets the fraction value. 917 | - (double)RB___fraction { 918 | return fraction; 919 | } 920 | 921 | @end 922 | 923 | -------------------------------------------------------------------------------- /Source/RBSplitView.h: -------------------------------------------------------------------------------- 1 | // 2 | // RBSplitView.h version 1.2 3 | // RBSplitView 4 | // 5 | // Created by Rainer Brockerhoff on 24/09/2004. 6 | // Copyright 2004-2009 Rainer Brockerhoff. 7 | // Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License. 8 | // 9 | 10 | #import "RBSplitSubview.h" 11 | 12 | // These values are used to handle the various cursor types. 13 | typedef enum { 14 | RBSVHorizontalCursor=0, // appears over horizontal dividers 15 | RBSVVerticalCursor, // appears over vertical dividers 16 | RBSV2WayCursor, // appears over two-way thumbs 17 | RBSVDragCursor, // appears while dragging 18 | RBSVCursorTypeCount 19 | } RBSVCursorType; 20 | 21 | @interface RBSplitView : RBSplitSubview { 22 | // Subclasses normally should use setter methods instead of changing instance variables by assignment. 23 | // Most getter methods simply return the corresponding instance variable, so with some care, subclasses 24 | // could reference them directly. 25 | IBOutlet id delegate; // The delegate (may be nil). 26 | NSString* autosaveName; // This name is used for storing subview proportions in user defaults. 27 | NSColor* background; // The color used to paint the view's background (may be nil). 28 | NSImage* divider; // The image used for the divider "dimple". 29 | NSRect* dividers; // A C array of NSRects, one for each divider. 30 | CGFloat dividerThickness; // Actual divider width; should be an integer and at least 1.0. 31 | BOOL mustAdjust; // Set internally if the subviews need to be adjusted. 32 | BOOL mustClearFractions; // Set internally if fractions should be cleared before adjusting. 33 | BOOL isHorizontal; // The divider's orientation; default is vertical. 34 | BOOL canSaveState; // Set internally to allow saving subview state. 35 | BOOL isCoupled; // If YES, take some parameters from the containing RBSplitView, if any. 36 | BOOL isAdjusting; // Set internally while the subviews are being adjusted. 37 | BOOL isDragging; // Set internally while in a drag loop. 38 | BOOL isInScrollView; // Set internally if directly contained in an NSScrollView. 39 | } 40 | 41 | // These class methods get and set the cursor used for each type. 42 | // Pass in nil to reset to the default cursor for that type. 43 | + (NSCursor*)cursor:(RBSVCursorType)type; 44 | + (void)setCursor:(RBSVCursorType)type toCursor:(NSCursor*)cursor; 45 | 46 | // This class method clears the saved state for a given autosave name from the defaults. 47 | + (void)removeStateUsingName:(NSString*)name; 48 | 49 | // This class method returns the actual key used to store autosave data in the defaults. 50 | + (NSString*)defaultsKeyForName:(NSString*)name isHorizontal:(BOOL)orientation; 51 | 52 | // Sets and gets the autosaveName; this will be the key used to store the subviews' proportions 53 | // in the user defaults. Default is @"", which doesn't save anything. Set flag to YES to set 54 | // unique names for nested subviews. You are responsible for avoiding duplicates. 55 | - (void)setAutosaveName:(NSString*)aString recursively:(BOOL)flag; 56 | - (NSString*)autosaveName; 57 | 58 | // Saves the current state of the subviews if there's a valid autosave name set. If the argument 59 | // is YES, it's then also called recursively for nested RBSplitViews. Returns YES if successful. 60 | - (BOOL)saveState:(BOOL)recurse; 61 | 62 | // Restores the saved state of the subviews if there's a valid autosave name set. If the argument 63 | // is YES, it's first called recursively for nested RBSplitViews. Returns YES if successful. 64 | // You need to call adjustSubviews after calling this. 65 | - (BOOL)restoreState:(BOOL)recurse; 66 | 67 | // Returns a string encoding the current state of all direct subviews. Does not check for nesting. 68 | - (NSString*)stringWithSavedState; 69 | 70 | // Readjusts all direct subviews according to the encoded string parameter. The number of subviews 71 | // must match. Returns YES if successful. Does not check for nesting. 72 | - (BOOL)setStateFromString:(NSString*)aString; 73 | 74 | // Returns an array with complete state information for the receiver and all subviews, taking 75 | // nesting into account. Don't store this array in a file, as its format might change in the 76 | // future; this is for taking a state snapshot and later restoring it with setStatesFromArray. 77 | - (NSArray*)arrayWithStates; 78 | 79 | // Restores the state of the receiver and all subviews. The array must have been produced by a 80 | // previous call to arrayWithStates. Returns YES if successful. This will fail if you have 81 | // added or removed subviews in the meantime! 82 | // You need to call adjustSubviews after calling this. 83 | - (BOOL)setStatesFromArray:(NSArray*)array; 84 | 85 | // This is the designated initializer for creating RBSplitViews programmatically. 86 | - (id)initWithFrame:(NSRect)frame; 87 | 88 | // This convenience initializer adds any number of subviews and adjusts them proportionally. 89 | - (id)initWithFrame:(NSRect)frame andSubviews:(NSUInteger)count; 90 | 91 | // Sets and gets the delegate. (Delegates aren't retained.) See further down for delegate methods. 92 | - (void)setDelegate:(id)anObject; 93 | - (id)delegate; 94 | 95 | // Returns a subview which has a certain identifier string, or nil if there's none 96 | - (RBSplitSubview*)subviewWithIdentifier:(NSString*)anIdentifier; 97 | 98 | // Returns the subview at a certain position. Returns nil if the position is invalid. 99 | - (RBSplitSubview*)subviewAtPosition:(NSUInteger)position; 100 | 101 | // Adds a subview at a certain position. 102 | - (void)addSubview:(NSView*)aView atPosition:(NSUInteger)position; 103 | 104 | // Sets and gets the divider thickness, which should be a positive integer or zero. 105 | // Setting the divider image also resets this automatically, so you would call this 106 | // only if you want the divider to be larger or smaller than the image. Zero means that 107 | // the image dimensions will be used. 108 | - (void)setDividerThickness:(CGFloat)thickness; 109 | - (CGFloat)dividerThickness; 110 | 111 | // Sets and gets the divider image. The default image can also be set in Interface Builder, so usually 112 | // there's no need to call this. Passing in nil means that the default divider thickness will be zero, 113 | // and no mouse events will be processed, so that the dividers can be moved only programmatically. 114 | - (void)setDivider:(NSImage*)image; 115 | - (NSImage*)divider; 116 | 117 | // Sets and gets the view background. The default is nil, meaning no background is 118 | // drawn and the view and its subviews are considered transparent. 119 | - (void)setBackground:(NSColor*)color; 120 | - (NSColor*)background; 121 | 122 | // Sets and gets the orientation. This uses the same convention as NSSplitView: vertical means the 123 | // dividers are vertical, but the subviews are in a horizontal row. Sort of counter-intuitive, yes. 124 | - (void)setVertical:(BOOL)flag; 125 | - (BOOL)isVertical; 126 | - (void)setHorizontal:(BOOL)flag; 127 | - (BOOL)isHorizontal; 128 | 129 | // Call this to force adjusting the subviews before display. Called automatically if anything 130 | // relevant is changed. 131 | - (void)setMustAdjust; 132 | 133 | // Returns YES if there's a pending adjustment. 134 | - (BOOL)mustAdjust; 135 | - (BOOL)isAdjusting; 136 | 137 | // Returns YES if we're in a dragging loop. 138 | - (BOOL)isDragging; 139 | 140 | // Returns YES if the view is directly contained in an NSScrollView. 141 | - (BOOL)isInScrollView; 142 | 143 | // Call this to recalculate all subview dimensions. Normally this is done automatically whenever 144 | // something relevant is changed, so you rarely will need to call this explicitly. 145 | - (void)adjustSubviews; 146 | 147 | // This method should be called only from within the splitView:wasResizedFrom:to: delegate method 148 | // to keep some specific subview the same size. 149 | - (void)adjustSubviewsExcepting:(RBSplitSubview*)excepting; 150 | 151 | // This method draws dividers. You should never call it directly but you can override it when 152 | // subclassing, if you need custom dividers. 153 | - (void)drawDivider:(NSImage*)anImage inRect:(NSRect)rect betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing; 154 | 155 | @end 156 | 157 | // The following methods are optionally implemented by the delegate. 158 | 159 | @protocol RBSplitViewDelegate 160 | @optional 161 | 162 | // The delegate can override a subview's ability to collapse by implementing this method. 163 | // Return YES to allow collapsing. If this is implemented, the subviews' built-in 164 | // 'collapsed' flags are ignored. 165 | - (BOOL)splitView:(RBSplitView*)sender canCollapse:(RBSplitSubview*)subview; 166 | 167 | // The delegate can alter the divider's appearance by implementing this method. 168 | // Before calling this, the divider is filled with the background, and afterwards 169 | // the divider image is drawn into the returned rect. If imageRect is empty, no 170 | // divider image will be drawn, because there are nested RBSplitViews. Return 171 | // NSZeroRect to suppress the divider image. Return imageRect to use the default 172 | // location for the image, or change its origin to place the image elsewhere. 173 | // You could also draw the divider yourself at this point and return NSZeroRect. 174 | - (NSRect)splitView:(RBSplitView*)sender willDrawDividerInRect:(NSRect)dividerRect betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing withProposedRect:(NSRect)imageRect; 175 | 176 | // These methods are called after a subview is completely collapsed or expanded. adjustSubviews may or may not 177 | // have been called, however. 178 | - (void)splitView:(RBSplitView*)sender didCollapse:(RBSplitSubview*)subview; 179 | - (void)splitView:(RBSplitView*)sender didExpand:(RBSplitSubview*)subview; 180 | 181 | // These methods are called just before and after adjusting subviews. 182 | - (void)willAdjustSubviews:(RBSplitView*)sender; 183 | - (void)didAdjustSubviews:(RBSplitView*)sender; 184 | 185 | // This method will be called after a RBSplitView is resized with setFrameSize: but before 186 | // adjustSubviews is called on it. 187 | - (void)splitView:(RBSplitView*)sender wasResizedFrom:(CGFloat)oldDimension to:(CGFloat)newDimension; 188 | 189 | // This method will be called when a divider is double-clicked and both leading and trailing 190 | // subviews can be collapsed. Return either of the parameters to collapse that subview, or nil 191 | // to collapse neither. If not implemented, the smaller subview will be collapsed. 192 | - (RBSplitSubview*)splitView:(RBSplitView*)sender collapseLeading:(RBSplitSubview*)leading orTrailing:(RBSplitSubview*)trailing; 193 | 194 | // This method will be called when a cursor rect is being set (inside resetCursorRects). The 195 | // proposed rect is passed in. Return the actual rect, or NSZeroRect to suppress cursor setting 196 | // for this divider. This won't be called for two-axis thumbs, however. The rects are in 197 | // sender's local coordinates. 198 | - (NSRect)splitView:(RBSplitView*)sender cursorRect:(NSRect)rect forDivider:(NSUInteger)divider; 199 | 200 | // This method will be called whenever a mouse-down event is received in a divider. Return YES to have 201 | // the event handled by the split view, NO if you wish to ignore it or handle it in the delegate. 202 | - (BOOL)splitView:(RBSplitView*)sender shouldHandleEvent:(NSEvent*)theEvent inDivider:(NSUInteger)divider betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing; 203 | 204 | // This method will be called just before a subview will be collapsed or expanded with animation. 205 | // Return the approximate time the animation should take, or 0.0 to disallow animation. 206 | // If not implemented, it will use the default of 0.2 seconds per 150 pixels. 207 | - (NSTimeInterval)splitView:(RBSplitView*)sender willAnimateSubview:(RBSplitSubview*)subview withDimension:(CGFloat)dimension; 208 | 209 | // This method will be called whenever a subview's frame is changed, usually from inside adjustSubviews' final loop. 210 | // You'd normally use this to move some auxiliary view to keep it aligned with the subview. 211 | - (void)splitView:(RBSplitView*)sender changedFrameOfSubview:(RBSplitSubview*)subview from:(NSRect)fromRect to:(NSRect)toRect; 212 | 213 | // This method is called whenever the event handlers want to check if some point within the RBSplitSubview 214 | // should act as an alternate drag view. Usually, the delegate will check the point (which is in sender's 215 | // local coordinates) against the frame of one or several auxiliary views, and return a valid divider number. 216 | // Returning NSNotFound means the point is not valid. 217 | - (NSUInteger)splitView:(RBSplitView*)sender dividerForPoint:(NSPoint)point inSubview:(RBSplitSubview*)subview; 218 | 219 | // This method is called continuously while a divider is dragged, just before the leading subview is resized. 220 | // Return NO to resize the trailing view by the same amount, YES to resize the containing window by the same amount. 221 | - (BOOL)splitView:(RBSplitView*)sender shouldResizeWindowForDivider:(NSUInteger)divider betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing willGrow:(BOOL)grow; 222 | 223 | // This method is called by each subview's drawRect: method, just after filling it with the background color but 224 | // before the contained subviews are drawn. Usually you would use this to draw a frame inside the subview. 225 | - (void)splitView:(RBSplitView*)sender willDrawSubview:(RBSplitSubview*)subview inRect:(NSRect)rect; 226 | 227 | @end 228 | 229 | -------------------------------------------------------------------------------- /Source/RBSplitViewPrivateDefines.h: -------------------------------------------------------------------------------- 1 | // 2 | // RBSplitViewPrivateDefines.h version 1.2 3 | // RBSplitView 4 | // 5 | // Created by Rainer Brockerhoff on 19/11/2004. 6 | // Copyright 2004-2009 Rainer Brockerhoff. 7 | // Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License. 8 | // 9 | 10 | // These defines are used only locally; no sense exporting them in the main header file where they might 11 | // conflict with something... 12 | 13 | // This is the hysteresis value for collapsing/expanding subviews with the mouse. 0.05 (5%) works well. 14 | #define HYSTERESIS (0.05) 15 | 16 | // This selects the main horizontal or vertical coordinate according to the split view's orientation. 17 | // It can be used as an lvalue, too. You need to have BOOL ishor declared to use it. 18 | #define DIM(x) (((CGFloat*)&(x))[ishor]) 19 | 20 | // This selects the other coordinate. You need to have BOOL ishor declared to use it. 21 | #define OTHER(x) (((CGFloat*)&(x))[!ishor]) 22 | 23 | // This value for the view offsets is guaranteed to be out of view for quite some time and is used 24 | // to mark the view as collapsed. 25 | #define WAYOUT (1000000.0) 26 | 27 | // This is the default framerate for collapse/expand animation. 28 | #define FRAMETIME (1.0/60.0) 29 | 30 | // This struct is used internally for speeding up adjustSubviews. 31 | typedef struct subviewCache { 32 | NSRect rect; // the subview's frame 33 | double fraction; // fractional extra 34 | RBSplitSubview* sub; // points at the subview 35 | CGFloat size; // current dimension 36 | BOOL constrain; // set if constrained 37 | } subviewCache; 38 | 39 | // This struct is used internally for doing collapse/expand animation. 40 | typedef struct animationData { 41 | RBSplitSubview* owner; // the subview being animated 42 | CGFloat dimension; // the subview's starting or ending dimension 43 | int stepsDone; // counts already done animation steps 44 | NSTimeInterval elapsedTime; // time already spent in resizing and adjusting subviews 45 | NSTimeInterval finishTime; // the animation should be finished at this time 46 | NSTimeInterval totalTime; // total time the animation should take 47 | BOOL collapsing; // YES if we're collapsing, NO if we're expanding 48 | BOOL resizing; // YES if we're resizing, NO if we're frozen 49 | } animationData; 50 | 51 | // The following methods are for internal use, and you should never call or override them. 52 | // They'll probably vary wildy from version to version, too. 53 | 54 | @interface RBSplitSubview (RB___SubviewAdditions) 55 | 56 | - (void)RB___setHidden:(BOOL)flag; 57 | - (animationData*)RB___animationData:(BOOL)start resize:(BOOL)resize; 58 | - (void)RB___stepAnimation; 59 | - (BOOL)RB___stopAnimation; 60 | - (CGFloat)RB___visibleDimension; 61 | - (CGFloat)RB___setMinAndMaxTo:(CGFloat)value savingMin:(CGFloat*)oldmin andMax:(CGFloat*)oldmax; 62 | - (CGFloat)RB___collapse; 63 | - (CGFloat)RB___expandAndSetToMinimum:(BOOL)setToMinimum; 64 | - (void)RB___finishCollapse:(NSRect)rect withFraction:(double)value; 65 | - (void)RB___finishExpand:(NSRect)rect withFraction:(double)value; 66 | - (void)RB___setFrameSize:(NSSize)size withFraction:(double)value; 67 | - (void)RB___setFrame:(NSRect)rect withFraction:(double)value notify:(BOOL)notify; 68 | - (double)RB___fraction; 69 | - (void)RB___copyIntoCache:(subviewCache*)cache; 70 | - (void)RB___updateFromCache:(subviewCache*)cache withTotalDimension:(CGFloat)value; 71 | - (BOOL)RB___clearResponder; 72 | 73 | @end 74 | 75 | @interface RBSplitView (RB___ViewAdditions) 76 | 77 | - (void)RB___adjustOutermostIfNeeded; 78 | - (void)RB___setDragging:(BOOL)flag; 79 | - (CGFloat)RB___dividerOrigin:(NSUInteger)indx; 80 | - (NSArray*)RB___subviews; 81 | - (NSUInteger)RB___numberOfSubviews; 82 | - (void)RB___adjustSubviewsExcepting:(RBSplitSubview*)excepting; 83 | - (CGFloat)RB___dimensionWithoutDividers; 84 | - (CGFloat)RB___dividerThickness; 85 | - (NSRect)RB___dividerRect:(NSUInteger)indx relativeToView:(RBSplitView*)view; 86 | - (void)RB___setMustClearFractions; 87 | - (BOOL)RB___shouldResizeWindowForDivider:(NSUInteger)indx betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing willGrow:(BOOL)grow; 88 | - (void)RB___tryToExpandLeading:(RBSplitSubview*)leading divider:(NSUInteger)indx trailing:(RBSplitSubview*)trailing delta:(CGFloat)delta; 89 | - (void)RB___tryToShortenLeading:(RBSplitSubview*)leading divider:(NSUInteger)indx trailing:(RBSplitSubview*)trailing delta:(CGFloat)delta always:(BOOL)always; 90 | - (void)RB___tryToExpandTrailing:(RBSplitSubview*)trailing leading:(RBSplitSubview*)leading delta:(CGFloat)delta; 91 | - (void)RB___tryToShortenTrailing:(RBSplitSubview*)trailing divider:(NSUInteger)indx leading:(RBSplitSubview*)leading delta:(CGFloat)delta always:(BOOL)always; 92 | - (void)RB___trackMouseEvent:(NSEvent*)theEvent from:(NSPoint)where withBase:(NSPoint)base inDivider:(NSUInteger)indx; 93 | - (void)RB___addCursorRectsTo:(RBSplitView*)masterView forDividerRect:(NSRect)rect thickness:(CGFloat)delta; 94 | - (NSUInteger)RB___dividerHitBy:(NSPoint)point relativeToView:(RBSplitView*)view thickness:(CGFloat)delta; 95 | - (void)RB___drawDividersIn:(RBSplitView*)masterView forDividerRect:(NSRect)rect thickness:(CGFloat)delta; 96 | 97 | @end 98 | 99 | --------------------------------------------------------------------------------