Delegate for month overawe

This commit is contained in:
2017-06-17 00:04:59 +02:00
parent 095e1a8fd1
commit 6540cdad77
9 changed files with 47 additions and 14 deletions
+23 -5
View File
@@ -22,7 +22,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3aE-Wf-9eZ">
<rect key="frame" x="18" y="90" width="26" height="22"/>
<rect key="frame" x="18" y="100" width="26" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="01" id="hZ1-E9-nbm">
<font key="font" metaFont="system" size="17"/>
@@ -31,7 +31,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ios-8D-sSB">
<rect key="frame" x="58" y="65" width="59" height="17"/>
<rect key="frame" x="58" y="75" width="59" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" id="axa-F2-XeS">
<font key="font" metaFont="system"/>
@@ -40,7 +40,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bOH-fN-p3a">
<rect key="frame" x="18" y="65" width="36" height="17"/>
<rect key="frame" x="18" y="75" width="36" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Loss:" id="6Hu-ZO-t9e">
<font key="font" metaFont="system"/>
@@ -49,13 +49,31 @@
</textFieldCell>
</textField>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="B0U-sm-QBD" customClass="LossDistributionPie" customModule="Graphic_Analysis_2" customModuleProvider="target">
<rect key="frame" x="20" y="20" width="37" height="37"/>
<rect key="frame" x="20" y="10" width="37" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ftO-kx-Le5" customClass="LossDistributionPie" customModule="Graphic_Analysis_2" customModuleProvider="target">
<rect key="frame" x="78" y="20" width="37" height="37"/>
<rect key="frame" x="78" y="10" width="37" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nbG-Sm-rH7">
<rect key="frame" x="26" y="50" width="24" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="AM" id="xPq-iI-lK1">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CuG-p6-mV1">
<rect key="frame" x="84" y="50" width="24" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="PM" id="SQW-qO-YRY">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<point key="canvasLocation" x="138.5" y="169"/>
</customView>
@@ -47,3 +47,16 @@ extension CollectionViewMonth: NSCollectionViewDataSource {
return item2
}
}
extension CollectionViewMonth : NSCollectionViewDelegate {
func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set<IndexPath>) {
guard let layer = (collectionView.item(at: indexPaths.first!) as? CollectionViewItemMonth)?.view.layer else { return }
layer.borderColor = NSColor.gray.cgColor
}
func collectionView(_ collectionView: NSCollectionView, didDeselectItemsAt indexPaths: Set<IndexPath>) {
guard let layer = (collectionView.item(at: indexPaths.first!) as? CollectionViewItemMonth)?.view.layer else { return }
layer.borderColor = NSColor.clear.cgColor
}
}
+1 -1
View File
@@ -73,7 +73,7 @@ class Document: NSDocument {
collectionViewYear.dataSource = yearDatasource
collectionViewYear.delegate = yearDatasource
collectionViewMonth.dataSource = monthDatasource
//collectionViewMonth.delegate = monthDatasource
collectionViewMonth.delegate = monthDatasource
}
override func shouldCloseWindowController(_ windowController: NSWindowController, delegate: Any?, shouldClose shouldCloseSelector: Selector?, contextInfo: UnsafeMutableRawPointer?) {
+2 -2
View File
@@ -17,8 +17,8 @@
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="0.0" y="87" width="1272" height="715"/>
<windowPositionMask key="initialPositionMask" topStrut="YES"/>
<rect key="contentRect" x="8" y="85" width="1272" height="715"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="800"/>
<value key="minSize" type="size" width="1272" height="715"/>
<value key="maxSize" type="size" width="1272" height="715"/>
+1 -1
View File
@@ -44,7 +44,7 @@
<key>CFBundleShortVersionString</key>
<string>2.0</string>
<key>CFBundleVersion</key>
<string>208</string>
<string>216</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
+1 -1
View File
@@ -1,2 +1,2 @@
version 2.0
build 208
build 216