123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- //
- // KMNotesPreferences.swift
- // PDF Master
- //
- // Created by tangchao on 2023/11/6.
- //
- import Cocoa
- class KMNotesPreferences: NSViewController {
- /*
- @interface SKNotesPreferences : NSViewController <SKPreferencePane> {
- NSArray *labels1;
- NSArray *colorLabels2;
- NSArray *colorLabels3;
- NSArray *lineLabels2;
- NSArray *colorWells1;
- NSArray *colorWells2;
- NSArray *colorWells3;
- // NSArray *fontWells;
- NSArray *lineWells1;
- NSArray *lineWells2;
- }
- // fontWells
- @property (nonatomic, retain) IBOutlet NSArray *labels1, *colorLabels2, *colorLabels3, *lineLabels2, *colorWells1, *colorWells2, *colorWells3, *lineWells1, *lineWells2;
- */
-
- @IBOutlet var fontWell1: SKFontWell!
- @IBOutlet var fontWell2: SKFontWell!
-
- override var nibName: NSNib.Name? {
- return "NotesPreferences"
- }
-
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do view setup here.
- }
-
- override var title: String? {
- set {
- super.title = newValue
- }
- get {
- return KMLocalizedString("Annotate", "Preference pane label")
- }
- }
-
- override func loadView() {
- super.loadView()
-
- // NSMutableArray * = [NSMutableArray array];
- var controls: [NSView] = []
- // CGFloat , dw1, dw2;
- var dw: CGFloat = 0
- var dw1: CGFloat = 0
- var dw2: CGFloat = 0
-
- // [controls addObjectsFromArray:colorWells3];
- // dw = SKAutoSizeLabelFields(colorLabels3, controls, NO);
-
- // [controls addObjectsFromArray:colorWells2];
- // [controls addObjectsFromArray:colorLabels3];
- // dw += SKAutoSizeLabelFields(colorLabels2, controls, NO);
-
- // [controls addObjectsFromArray:colorWells1];
- // [controls addObjectsFromArray:colorLabels2];
- // [controls addObjectsFromArray:fontWells];
- // [controls addObject:self.fontWell1];
- // [controls addObject:self.fontWell2];
- // [controls addObjectsFromArray:lineWells1];
- // dw += dw1 = SKAutoSizeLabelFields(labels1, controls, NO);
-
- // dw2 = SKAutoSizeLabelFields(lineLabels2, lineWells2, NO);
-
- // SKShiftAndResizeViews(fontWells, 0.0, dw - dw1);
-
- // SKShiftAndResizeViews([lineLabels2 arrayByAddingObjectsFromArray:lineWells2], dw - dw2, 0.0);
-
- // SKShiftAndResizeView([self view], 0.0, dw);
-
- // NSUserDefaultsController *sudc = [NSUserDefaultsController sharedUserDefaultsController];
-
- // SKLineWell *lineWell = [lineWells1 objectAtIndex:0];
- // [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteLineWidthKey) options:nil];
- // [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteLineStyleKey) options:nil];
- // [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteDashPatternKey) options:nil];
- // [lineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
- //
- // lineWell = [lineWells2 objectAtIndex:0];
- // [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteLineWidthKey) options:nil];
- // [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteLineStyleKey) options:nil];
- // [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteDashPatternKey) options:nil];
- // [lineWell setDisplayStyle:SKLineWellDisplayStyleOval];
- //
- // lineWell = [lineWells2 objectAtIndex:1];
- // [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteLineWidthKey) options:nil];
- // [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteLineStyleKey) options:nil];
- // [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteDashPatternKey) options:nil];
- // [lineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
- //
- // lineWell = [lineWells1 objectAtIndex:1];
- // [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteLineWidthKey) options:nil];
- // [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteLineStyleKey) options:nil];
- // [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteDashPatternKey) options:nil];
- // [lineWell bind:SKLineWellStartLineStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteStartLineStyleKey) options:nil];
- // [lineWell bind:SKLineWellEndLineStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteEndLineStyleKey) options:nil];
- //
- // lineWell = [lineWells1 objectAtIndex:2];
- // [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteLineWidthKey) options:nil];
- // [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteLineStyleKey) options:nil];
- // [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteDashPatternKey) options:nil];
- // [lineWell setDisplayStyle:SKLineWellDisplayStyleSimpleLine];
-
- // let fontWell = self.fontWell1
- // NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:NSUnarchiveFromDataTransformerName, NSValueTransformerNameBindingOption, nil];
- // [fontWell setHasTextColor:YES];
- // [fontWell bind:@"textColor" toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteFontColorKey) options:options];
- }
-
- /*
- @implementation SKNotesPreferences
- @synthesize labels1, colorLabels2, colorLabels3, lineLabels2, colorWells1, colorWells2, colorWells3, lineWells1, lineWells2;
- - (void)dealloc {
- // SKDESTROY(labels1);
- // SKDESTROY(colorLabels2);
- // SKDESTROY(colorLabels3);
- // SKDESTROY(lineLabels2);
- // SKDESTROY(colorWells1);
- // SKDESTROY(colorWells2);
- // SKDESTROY(colorWells3);
- // SKDESTROY(fontWells);
- // SKDESTROY(lineWells1);
- // SKDESTROY(lineWells2);
- // [super dealloc];
- }
- - (NSString *)nibName {
- return @"";
- }
- */
-
- }
|