diff options
author | nyamatongwe <devnull@localhost> | 2013-03-15 23:34:46 +1100 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2013-03-15 23:34:46 +1100 |
commit | 9d124ce8cc3b212187f8b9637bf6c4685377fa87 (patch) | |
tree | 01d292cf11e925824a8f907316527ef7255388f4 /cocoa/ScintillaView.h | |
parent | 23d76d437f1089cdd2cc7c01cf011ec21f7f7a63 (diff) | |
download | scintilla-mirror-9d124ce8cc3b212187f8b9637bf6c4685377fa87.tar.gz |
Use an NSScrollView on Cocoa for kinetic scrolling and hiding scrollbars unless wanted.
Also affects platform-independent code.
Diffstat (limited to 'cocoa/ScintillaView.h')
-rw-r--r-- | cocoa/ScintillaView.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/cocoa/ScintillaView.h b/cocoa/ScintillaView.h index f34ac7e08..87a443f73 100644 --- a/cocoa/ScintillaView.h +++ b/cocoa/ScintillaView.h @@ -27,6 +27,24 @@ extern NSString *SCIUpdateUINotification; @end /** + * MarginView draws line numbers and other margins next to the text view. + */ +@interface MarginView : NSRulerView +{ +@private + int marginWidth; + ScintillaView *owner; + NSMutableArray *currentCursors; +} + +@property (assign) int marginWidth; +@property (assign) ScintillaView *owner; + +- (id)initWithScrollView:(NSScrollView *)aScrollView; + +@end + +/** * InnerView is the Cocoa interface to the Scintilla backend. It handles text input and * provides a canvas for painting the output. */ @@ -63,8 +81,8 @@ extern NSString *SCIUpdateUINotification; // This is the actual content to which the backend renders itself. InnerView* mContent; - NSScroller* mHorizontalScroller; - NSScroller* mVerticalScroller; + NSScrollView *scrollView; + MarginView *marginView; CGFloat zoomDelta; @@ -78,6 +96,7 @@ extern NSString *SCIUpdateUINotification; @property (nonatomic, readonly) Scintilla::ScintillaCocoa* backend; @property (nonatomic, assign) id<ScintillaNotificationProtocol> delegate; +@property (nonatomic, readonly) NSScrollView *scrollView; - (void) dealloc; - (void) positionSubViews; @@ -90,11 +109,7 @@ extern NSString *SCIUpdateUINotification; - (void) suspendDrawing: (BOOL) suspend; // Scroller handling -- (BOOL) setVerticalScrollRange: (int) range page: (int) page; -- (void) setVerticalScrollPosition: (float) position; -- (BOOL) setHorizontalScrollRange: (int) range page: (int) page; -- (void) setHorizontalScrollPosition: (float) position; - +- (void) setMarginWidth: (int) width; - (void) scrollerAction: (id) sender; - (InnerView*) content; |