// // KMEditPDFCropComfirmWindowController.swift // PDF Reader Pro // // Created by tangchao on 2024/6/26. // import Cocoa class KMEditPDFCropComfirmWindowController: NSWindowController { @IBOutlet weak var leftBox: NSBox! @IBOutlet weak var rightBox: NSBox! private var leftVc_: KMDesignButton? private var rightVc_: KMDesignButton? var itemAction: KMCommonClickBlock? static let shared = KMEditPDFCropComfirmWindowController(windowNibName: "KMEditPDFCropComfirmWindowController") override func windowDidLoad() { super.windowDidLoad() self.window?.backgroundColor = .white self.window?.contentView?.wantsLayer = true self.window?.contentView?.layer?.cornerRadius = 4 self.leftVc_ = KMDesignButton(withType: .Image) self.leftBox.contentView = self.leftVc_!.view self.leftBox.borderWidth = 0 self.leftVc_?.pagination() self.leftVc_?.target = self self.leftVc_?.action = #selector(_itemClick) self.leftVc_?.image = NSImage(named: "KMImageNameEditPDFCropComfirm")! self.leftVc_?.tag = 0 self.rightVc_ = KMDesignButton(withType: .Image) self.rightBox.contentView = self.rightVc_!.view self.rightBox.borderWidth = 0 self.rightVc_?.pagination() self.rightVc_?.target = self self.rightVc_?.action = #selector(_itemClick) self.rightVc_?.image = NSImage(named: "KMImageNameEditPDFCropCancel")! self.rightVc_?.tag = 1 } @objc private func _itemClick(_ sender: NSButton) { self.itemAction?(sender.tag) } }