My favorites | Sign in
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones  
Changes to /AppKit/NSScroller.h
e5277a40a7e8 vs. 2470bd80abf4 Compare: vs.  Format:
Revision 2470bd80abf4
Go to: 
Project members, sign in to write a code review
/AppKit/NSScroller.h   e5277a40a7e8 /AppKit/NSScroller.h   2470bd80abf4
1 /* Copyright (c) 2006 Christopher J. W. Lloyd 1 /* Copyright (c) 2006-2007 Christopher J. W. Lloyd
2 2
3 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 3 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 4
5 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 5 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 6
7 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 7 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
8 8
9 #import <AppKit/NSControl.h> 9 #import <AppKit/NSControl.h>
10 10
11 typedef enum { 11 typedef enum {
12 NSScrollerNoPart=0, 12 NSScrollerNoPart=0,
13 NSScrollerIncrementLine, 13 NSScrollerIncrementLine,
14 NSScrollerDecrementLine, 14 NSScrollerDecrementLine,
15 NSScrollerIncrementPage, 15 NSScrollerIncrementPage,
16 NSScrollerDecrementPage, 16 NSScrollerDecrementPage,
17 NSScrollerKnob, 17 NSScrollerKnob,
18 NSScrollerKnobSlot 18 NSScrollerKnobSlot
19 } NSScrollerPart; 19 } NSScrollerPart;
20 20
21 typedef enum { 21 typedef enum {
22 NSScrollerIncrementArrow, 22 NSScrollerIncrementArrow,
23 NSScrollerDecrementArrow 23 NSScrollerDecrementArrow
24 } NSScrollerArrow; 24 } NSScrollerArrow;
25 25
26 typedef enum { 26 typedef enum {
27 NSScrollerArrowsNone=1, 27 NSScrollerArrowsNone=1,
28 NSScrollerArrowsMinEnd, 28 NSScrollerArrowsMinEnd,
29 NSScrollerArrowsMaxEnd, 29 NSScrollerArrowsMaxEnd,
30 } NSScrollArrowPosition; 30 } NSScrollArrowPosition;
31 31
32 typedef enum { 32 typedef enum {
33 NSNoScrollerParts, 33 NSNoScrollerParts,
34 NSAllScrollerParts, 34 NSAllScrollerParts,
35 NSOnlyScrollerArrows 35 NSOnlyScrollerArrows
36 } NSUsableScrollerParts; 36 } NSUsableScrollerParts;
37 37
38 @interface NSScroller : NSControl { 38 @interface NSScroller : NSControl {
39 id _target; 39 id _target;
40 SEL _action; 40 SEL _action;
41 BOOL _isVertical; 41 BOOL _isVertical;
42 float _floatValue; 42 float _floatValue;
43 float _knobProportion; 43 float _knobProportion;
44 NSScrollArrowPosition _arrowsPosition; 44 NSScrollArrowPosition _arrowsPosition;
45 45
46 NSUsableScrollerParts _usableParts; 46 NSUsableScrollerParts _usableParts;
47 NSScrollerPart _hitPart; 47 NSScrollerPart _hitPart;
48 BOOL _isEnabled; 48 BOOL _isEnabled;
49 BOOL _isHighlighted; 49 BOOL _isHighlighted;
50 } 50 }
51 51
52 +(float)scrollerWidth; 52 +(float)scrollerWidth;
53 53
54 -(float)knobProportion; 54 -(float)knobProportion;
55 -(NSScrollArrowPosition)arrowsPosition; 55 -(NSScrollArrowPosition)arrowsPosition;
56 56
57 -(void)setFloatValue:(float)zeroToOneValue knobProportion:(float)zeroToOneKnob; 57 -(void)setFloatValue:(float)zeroToOneValue knobProportion:(float)zeroToOneKnob;
58 -(void)setArrowsPosition:(NSScrollArrowPosition)position; 58 -(void)setArrowsPosition:(NSScrollArrowPosition)position;
59 59
60 -(NSRect)rectForPart:(NSScrollerPart)part; 60 -(NSRect)rectForPart:(NSScrollerPart)part;
61 -(void)checkSpaceForParts; 61 -(void)checkSpaceForParts;
62 -(NSUsableScrollerParts)usableParts; 62 -(NSUsableScrollerParts)usableParts;
63 63
64 -(void)highlight:(BOOL)flag; 64 -(void)highlight:(BOOL)flag;
65 65
66 -(void)drawParts; 66 -(void)drawParts;
67 -(void)drawArrow:(NSScrollerArrow)arrow highlight:(BOOL)flag; 67 -(void)drawArrow:(NSScrollerArrow)arrow highlight:(BOOL)flag;
68 -(void)drawKnob; 68 -(void)drawKnob;
69 69
70 -(NSScrollerPart)hitPart; 70 -(NSScrollerPart)hitPart;
71 -(NSScrollerPart)testPart:(NSPoint)point; 71 -(NSScrollerPart)testPart:(NSPoint)point;
72 -(void)trackKnob:(NSEvent *)event; 72 -(void)trackKnob:(NSEvent *)event;
73 -(void)trackScrollButtons:(NSEvent *)event; 73 -(void)trackScrollButtons:(NSEvent *)event;
74 74
75 @end 75 @end
Powered by Google Project Hosting