|
@@ -550,19 +550,19 @@ class KMAnnotationTableViewController: NSViewController {
|
|
pdfView!.needsDisplay = true
|
|
pdfView!.needsDisplay = true
|
|
}
|
|
}
|
|
|
|
|
|
- @IBAction func titleEndTablePopUpButtonAction(_ sender: NSPopUpButton) {
|
|
|
|
|
|
+ @IBAction func titleEndTablePopUpButtonAction(_ sender: KMPopUpButton) {
|
|
guard let table = self.annotation else {
|
|
guard let table = self.annotation else {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
let bounds = self.annotation!.bounds
|
|
let bounds = self.annotation!.bounds
|
|
- guard let popButton = sender as? NSPopUpButton else {
|
|
|
|
|
|
+ guard let popButton = sender as? KMPopUpButton else {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
switch popButton.tag {
|
|
switch popButton.tag {
|
|
case 100:
|
|
case 100:
|
|
- let count = (popButton.titleOfSelectedItem as NSString?)?.integerValue ?? 0 - table.sidebarCount()
|
|
|
|
|
|
+ let count = (Int(popButton.titleOfSelectedItem ?? "0") ?? 0) - table.sidebarCount()
|
|
if count > 0 {
|
|
if count > 0 {
|
|
for _ in 0..<count {
|
|
for _ in 0..<count {
|
|
table.insertColumnAtIndex(before: 0, with: .round)
|
|
table.insertColumnAtIndex(before: 0, with: .round)
|
|
@@ -572,24 +572,28 @@ class KMAnnotationTableViewController: NSViewController {
|
|
table.removeColumn(at: 0)
|
|
table.removeColumn(at: 0)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- table.bounds.origin.x -= (bounds.size.width - table.bounds.size.width)
|
|
|
|
|
|
+ table.bounds = NSRectFromCGRect(CGRect(x: table.bounds.origin.x - (bounds.size.width - table.bounds.size.width),
|
|
|
|
+ y: table.bounds.origin.y,
|
|
|
|
+ width: table.bounds.size.width, height: table.bounds.size.height))
|
|
case 101:
|
|
case 101:
|
|
- let count = (popButton.titleOfSelectedItem as NSString?)?.integerValue ?? 0 - table.headerCount()
|
|
|
|
|
|
+ let count = (Int(popButton.titleOfSelectedItem ?? "0") ?? 0) - table.headerCount()
|
|
if count > 0 {
|
|
if count > 0 {
|
|
for _ in 0..<count {
|
|
for _ in 0..<count {
|
|
- table.insertColumnAtIndex(before: 0, with: .round)
|
|
|
|
|
|
+ table.insertRowAtIndex(before: 0, with: .round)
|
|
}
|
|
}
|
|
} else if count < 0 {
|
|
} else if count < 0 {
|
|
for _ in count..<0 {
|
|
for _ in count..<0 {
|
|
table.removeRow(at: 0)
|
|
table.removeRow(at: 0)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- table.bounds.origin.y -= (table.bounds.size.height - bounds.size.height)
|
|
|
|
|
|
+ table.bounds = NSRectFromCGRect(CGRect(x: table.bounds.origin.x,
|
|
|
|
+ y: table.bounds.origin.y - (table.bounds.size.height - bounds.size.height),
|
|
|
|
+ width: table.bounds.size.width, height: table.bounds.size.height))
|
|
case 102:
|
|
case 102:
|
|
- let count = (popButton.titleOfSelectedItem as NSString?)?.integerValue ?? 0 - table.footerCount()
|
|
|
|
|
|
+ let count = (Int(popButton.titleOfSelectedItem ?? "0") ?? 0) - table.footerCount()
|
|
if count > 0 {
|
|
if count > 0 {
|
|
for _ in 0..<count {
|
|
for _ in 0..<count {
|
|
- table.insertColumnAtIndex(before: table.rowNumber - 1, with: .bevel)
|
|
|
|
|
|
+ table.insertRow(atIndexBehind: table.rowNumber - 1, with: .bevel)
|
|
}
|
|
}
|
|
} else if count < 0 {
|
|
} else if count < 0 {
|
|
for _ in count..<0 {
|
|
for _ in count..<0 {
|
|
@@ -602,7 +606,7 @@ class KMAnnotationTableViewController: NSViewController {
|
|
|
|
|
|
table.drawLine(self.point)
|
|
table.drawLine(self.point)
|
|
reloadData(with: self.point)
|
|
reloadData(with: self.point)
|
|
- pdfView!.needsDisplay = true
|
|
|
|
|
|
+ pdfView?.setNeedsDisplayAnnotationViewFor(table.page)
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func widthPopUpButtonAction(_ sender: NSPopUpButton) {
|
|
@IBAction func widthPopUpButtonAction(_ sender: NSPopUpButton) {
|