2017-05-27 19:43:27 +02:00
|
|
|
//
|
|
|
|
// TimelineTableView.swift
|
|
|
|
// Evergreen
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 10/11/16.
|
2017-05-29 22:17:58 +02:00
|
|
|
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
2017-05-27 19:43:27 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
import Cocoa
|
|
|
|
|
|
|
|
class TimelineTableView: NSTableView {
|
|
|
|
|
2017-12-20 21:59:31 +01:00
|
|
|
@IBOutlet var keyboardDelegate: KeyboardDelegate!
|
2017-05-27 19:43:27 +02:00
|
|
|
|
|
|
|
//MARK: NSResponder
|
|
|
|
|
|
|
|
override func keyDown(with event: NSEvent) {
|
2017-12-20 21:59:31 +01:00
|
|
|
|
|
|
|
if keyboardDelegate.keydown(event, in: self) {
|
|
|
|
return
|
2017-05-27 19:43:27 +02:00
|
|
|
}
|
|
|
|
super.keyDown(with: event)
|
|
|
|
}
|
|
|
|
|
|
|
|
override func viewWillStartLiveResize() {
|
|
|
|
|
|
|
|
if let scrollView = self.enclosingScrollView {
|
|
|
|
scrollView.hasVerticalScroller = false
|
|
|
|
}
|
|
|
|
super.viewWillStartLiveResize()
|
|
|
|
}
|
|
|
|
|
|
|
|
override func viewDidEndLiveResize() {
|
|
|
|
|
|
|
|
if let scrollView = self.enclosingScrollView {
|
|
|
|
scrollView.hasVerticalScroller = true
|
|
|
|
}
|
|
|
|
super.viewDidEndLiveResize()
|
|
|
|
}
|
|
|
|
|
2017-11-02 06:40:28 +01:00
|
|
|
func redrawGrid() {
|
|
|
|
|
|
|
|
guard let rowViews = visibleRowViews() else {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
rowViews.forEach{ (rowView) in
|
|
|
|
if let rowView = rowView as? TimelineTableRowView {
|
|
|
|
rowView.invalidateGridRect()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-05-27 19:43:27 +02:00
|
|
|
}
|