KMNotesPreferences.swift 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. //
  2. // KMNotesPreferences.swift
  3. // PDF Master
  4. //
  5. // Created by tangchao on 2023/11/6.
  6. //
  7. import Cocoa
  8. class KMNotesPreferences: NSViewController {
  9. /*
  10. @interface SKNotesPreferences : NSViewController <SKPreferencePane> {
  11. NSArray *labels1;
  12. NSArray *colorLabels2;
  13. NSArray *colorLabels3;
  14. NSArray *lineLabels2;
  15. NSArray *colorWells1;
  16. NSArray *colorWells2;
  17. NSArray *colorWells3;
  18. // NSArray *fontWells;
  19. NSArray *lineWells1;
  20. NSArray *lineWells2;
  21. }
  22. // fontWells
  23. @property (nonatomic, retain) IBOutlet NSArray *labels1, *colorLabels2, *colorLabels3, *lineLabels2, *colorWells1, *colorWells2, *colorWells3, *lineWells1, *lineWells2;
  24. */
  25. @IBOutlet var fontWell1: SKFontWell!
  26. @IBOutlet var fontWell2: SKFontWell!
  27. override var nibName: NSNib.Name? {
  28. return "NotesPreferences"
  29. }
  30. override func viewDidLoad() {
  31. super.viewDidLoad()
  32. // Do view setup here.
  33. }
  34. override var title: String? {
  35. set {
  36. super.title = newValue
  37. }
  38. get {
  39. return KMLocalizedString("Annotate", "Preference pane label")
  40. }
  41. }
  42. override func loadView() {
  43. super.loadView()
  44. // NSMutableArray * = [NSMutableArray array];
  45. var controls: [NSView] = []
  46. // CGFloat , dw1, dw2;
  47. var dw: CGFloat = 0
  48. var dw1: CGFloat = 0
  49. var dw2: CGFloat = 0
  50. // [controls addObjectsFromArray:colorWells3];
  51. // dw = SKAutoSizeLabelFields(colorLabels3, controls, NO);
  52. // [controls addObjectsFromArray:colorWells2];
  53. // [controls addObjectsFromArray:colorLabels3];
  54. // dw += SKAutoSizeLabelFields(colorLabels2, controls, NO);
  55. // [controls addObjectsFromArray:colorWells1];
  56. // [controls addObjectsFromArray:colorLabels2];
  57. // [controls addObjectsFromArray:fontWells];
  58. // [controls addObject:self.fontWell1];
  59. // [controls addObject:self.fontWell2];
  60. // [controls addObjectsFromArray:lineWells1];
  61. // dw += dw1 = SKAutoSizeLabelFields(labels1, controls, NO);
  62. // dw2 = SKAutoSizeLabelFields(lineLabels2, lineWells2, NO);
  63. // SKShiftAndResizeViews(fontWells, 0.0, dw - dw1);
  64. // SKShiftAndResizeViews([lineLabels2 arrayByAddingObjectsFromArray:lineWells2], dw - dw2, 0.0);
  65. // SKShiftAndResizeView([self view], 0.0, dw);
  66. // NSUserDefaultsController *sudc = [NSUserDefaultsController sharedUserDefaultsController];
  67. // SKLineWell *lineWell = [lineWells1 objectAtIndex:0];
  68. // [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteLineWidthKey) options:nil];
  69. // [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteLineStyleKey) options:nil];
  70. // [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteDashPatternKey) options:nil];
  71. // [lineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
  72. //
  73. // lineWell = [lineWells2 objectAtIndex:0];
  74. // [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteLineWidthKey) options:nil];
  75. // [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteLineStyleKey) options:nil];
  76. // [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteDashPatternKey) options:nil];
  77. // [lineWell setDisplayStyle:SKLineWellDisplayStyleOval];
  78. //
  79. // lineWell = [lineWells2 objectAtIndex:1];
  80. // [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteLineWidthKey) options:nil];
  81. // [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteLineStyleKey) options:nil];
  82. // [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteDashPatternKey) options:nil];
  83. // [lineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
  84. //
  85. // lineWell = [lineWells1 objectAtIndex:1];
  86. // [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteLineWidthKey) options:nil];
  87. // [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteLineStyleKey) options:nil];
  88. // [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteDashPatternKey) options:nil];
  89. // [lineWell bind:SKLineWellStartLineStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteStartLineStyleKey) options:nil];
  90. // [lineWell bind:SKLineWellEndLineStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteEndLineStyleKey) options:nil];
  91. //
  92. // lineWell = [lineWells1 objectAtIndex:2];
  93. // [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteLineWidthKey) options:nil];
  94. // [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteLineStyleKey) options:nil];
  95. // [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteDashPatternKey) options:nil];
  96. // [lineWell setDisplayStyle:SKLineWellDisplayStyleSimpleLine];
  97. // let fontWell = self.fontWell1
  98. // NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:NSUnarchiveFromDataTransformerName, NSValueTransformerNameBindingOption, nil];
  99. // [fontWell setHasTextColor:YES];
  100. // [fontWell bind:@"textColor" toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteFontColorKey) options:options];
  101. }
  102. /*
  103. @implementation SKNotesPreferences
  104. @synthesize labels1, colorLabels2, colorLabels3, lineLabels2, colorWells1, colorWells2, colorWells3, lineWells1, lineWells2;
  105. - (void)dealloc {
  106. // SKDESTROY(labels1);
  107. // SKDESTROY(colorLabels2);
  108. // SKDESTROY(colorLabels3);
  109. // SKDESTROY(lineLabels2);
  110. // SKDESTROY(colorWells1);
  111. // SKDESTROY(colorWells2);
  112. // SKDESTROY(colorWells3);
  113. // SKDESTROY(fontWells);
  114. // SKDESTROY(lineWells1);
  115. // SKDESTROY(lineWells2);
  116. // [super dealloc];
  117. }
  118. - (NSString *)nibName {
  119. return @"";
  120. }
  121. */
  122. }