// // KMRedactPageRangeWindowController.swift // PDF Master // // Created by tangchao on 2023/1/19. // import Cocoa class KMRedactPageRangeWindowController: KMRedactBaseWindowController { var pageType: Int = 1 var pageString: String = "" override func windowDidLoad() { super.windowDidLoad() self.setContentSize(NSSize(width: 404, height: 336)) self.titleLabel.stringValue = NSLocalizedString("Mark Page Range", comment: "") self.funcButton.title = NSLocalizedString("Apply", comment: "") self.funcButton.layer?.backgroundColor = NSColor.black.cgColor self.funcButton.attributedTitle = NSMutableAttributedString(string: self.funcButton.title, attributes: [NSAttributedString.Key.foregroundColor : NSColor.white]) let contentView = KMRedactPageRangeContentView.createFromNib() contentView?.frame = self.contentBox.contentView!.bounds contentView?.autoresizingMask = [.width,.height] self.contentBox.contentView?.addSubview(contentView!) self.contentView = contentView contentView?.pageCount = self.pageCount contentView?.itemClick = {[weak self] index, value in if (index == 1) { /// 当前页面 self!.pageType = 1 } else if (index == 2) { /// 全部页面 self!.pageType = 2 } else if (index == 3) { /// 奇数页面 self!.pageType = 3 } else if (index == 4) { /// 偶数页面 self!.pageType = 4 } else if (index == 5) { /// 自定义页面 self!.pageType = 5 } else if (index == 6) { self?.pageString = value as! String } } } }