1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- //
- // PaginationVC.swift
- // PDF Reader Pro Edition
- //
- // Created by Niehaoyu on 2024/9/19.
- //
- import Cocoa
- import KMComponentLibrary
- class PaginationVC: NSViewController {
- @IBOutlet weak var paginationItemA: ComponentPaginationItem!
- @IBOutlet weak var paginationItemB: ComponentPaginationItem!
- @IBOutlet weak var paginationItemC: ComponentPaginationItem!
- @IBOutlet weak var paginationItemD: ComponentPaginationItem!
- @IBOutlet weak var paginationItemE: ComponentPaginationItem!
-
- @IBOutlet weak var itemDisableBtn: NSButton!
-
- @IBOutlet weak var pagenationView: ComponentPagination!
- @IBOutlet weak var paginationDoubleArrow: NSButton!
-
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do view setup here.
-
- self.reloadData()
-
- }
-
-
- func reloadData() {
- let propertyA: ComponentPaginationItemProperty = ComponentPaginationItemProperty(type: .arrowLeft, state: .normal, isDisabled: self.itemDisableBtn.state == .on)
- self.paginationItemA.properties = propertyA
-
- let propertyB: ComponentPaginationItemProperty = ComponentPaginationItemProperty(type: .arrowRight, state: .normal, isDisabled: self.itemDisableBtn.state == .on)
- self.paginationItemB.properties = propertyB
-
- let propertyC: ComponentPaginationItemProperty = ComponentPaginationItemProperty(type: .doubleArrowLeft, state: .normal, isDisabled: self.itemDisableBtn.state == .on)
- self.paginationItemC.properties = propertyC
-
- let propertyD: ComponentPaginationItemProperty = ComponentPaginationItemProperty(type: .doubleArrowRight, state: .normal, isDisabled: self.itemDisableBtn.state == .on)
- self.paginationItemD.properties = propertyD
-
- let propertyE: ComponentPaginationItemProperty = ComponentPaginationItemProperty(type: .more, state: .normal, isDisabled: self.itemDisableBtn.state == .on)
- self.paginationItemE.properties = propertyE
-
- let paginationProperty: ComponentPaginationProperty = ComponentPaginationProperty(doubleArrow_show: self.paginationDoubleArrow.state == .on,
- currentIndex: 1,
- totalCount: 100)
- self.pagenationView.properties = paginationProperty
-
-
- }
-
- @IBAction func itemAction(_ sender: Any) {
- self.reloadData()
-
- }
-
- }
|