stat working on a pop up for card slots

This commit is contained in:
Kelvin Sherlock 2021-03-10 18:37:59 -05:00
parent d37fb49781
commit 2f514a1db3
6 changed files with 184 additions and 27 deletions

View File

@ -32,7 +32,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
</customView>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nKp-px-nHg">
<rect key="frame" x="587" y="58" width="111" height="23"/>
<rect key="frame" x="587.5" y="58" width="111" height="23"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="roundTextured" title="Launch" bezelStyle="texturedRounded" image="NSAppleMenuImage" imagePosition="left" alignment="center" borderStyle="border" inset="2" id="Ct1-Rb-7uI">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@ -47,7 +47,7 @@ DQ
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nNO-3T-OAy">
<rect key="frame" x="470" y="58" width="109" height="23"/>
<rect key="frame" x="470.5" y="58" width="109" height="23"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="roundTextured" title="Reset Slots" bezelStyle="texturedRounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Uii-5h-2R2">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@ -60,7 +60,7 @@ DQ
</connections>
</button>
<customView id="P9d-sS-qEb" customClass="FlippedView">
<rect key="frame" x="20" y="92" width="306" height="363"/>
<rect key="frame" x="20" y="92" width="316" height="363"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<tabView initialItem="zUN-Qs-haG" id="l8R-bg-6Zm">
@ -348,7 +348,7 @@ DQ
</tabViewItems>
</tabView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="J9O-xI-P5J" customClass="FlippedView">
<rect key="frame" x="392" y="92" width="306" height="363"/>
<rect key="frame" x="382" y="92" width="316" height="363"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
</customView>
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" horizontalScrollElasticity="none" id="2ue-XT-byh">

View File

@ -14,20 +14,20 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="30" horizontalPageScroll="10" verticalLineScroll="30" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="nVT-kT-bWl">
<rect key="frame" x="0.0" y="0.0" width="306" height="363"/>
<scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="25" horizontalPageScroll="10" verticalLineScroll="25" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="nVT-kT-bWl">
<rect key="frame" x="0.0" y="0.0" width="316" height="363"/>
<clipView key="contentView" autoresizesSubviews="NO" focusRingType="none" ambiguous="YES" copiesOnScroll="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IBD-wb-pch">
<rect key="frame" x="0.0" y="0.0" width="306" height="363"/>
<rect key="frame" x="0.0" y="0.0" width="316" height="363"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="none" selectionHighlightStyle="none" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="27" rowSizeStyle="automatic" viewBased="YES" outlineTableColumn="pBj-py-R6a" id="sIz-DD-PZQ">
<rect key="frame" x="0.0" y="0.0" width="306" height="363"/>
<outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="none" selectionHighlightStyle="none" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="22" rowSizeStyle="automatic" viewBased="YES" outlineTableColumn="pBj-py-R6a" id="sIz-DD-PZQ">
<rect key="frame" x="0.0" y="0.0" width="316" height="363"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="2" height="3"/>
<color key="backgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn editable="NO" width="280" minWidth="40" maxWidth="1000" id="pBj-py-R6a">
<tableColumn editable="NO" width="296" minWidth="40" maxWidth="1000" id="pBj-py-R6a">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@ -40,11 +40,11 @@
</textFieldCell>
<prototypeCellViews>
<tableCellView identifier="CategoryView" focusRingType="none" id="33q-UT-ur5">
<rect key="frame" x="1" y="1" width="280" height="17"/>
<rect key="frame" x="1" y="1" width="296" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Pep-mX-LHY">
<rect key="frame" x="0.0" y="0.0" width="280" height="17"/>
<rect key="frame" x="0.0" y="0.0" width="296" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="Rrg-wr-8eL">
<font key="font" metaFont="systemBold"/>
@ -58,11 +58,11 @@
</connections>
</tableCellView>
<tableCellView identifier="ItemView" translatesAutoresizingMaskIntoConstraints="NO" id="yGq-lc-RCM" customClass="TablePathView">
<rect key="frame" x="1" y="21" width="280" height="22"/>
<rect key="frame" x="1" y="21" width="296" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<pathControl focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="f7R-TO-fmF">
<rect key="frame" x="20" y="0.0" width="228" height="22"/>
<rect key="frame" x="20" y="0.0" width="244" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<pathCell key="cell" controlSize="small" selectable="YES" editable="YES" focusRingType="none" alignment="left" pathStyle="popUp" id="dcz-8y-tKb">
<font key="font" metaFont="smallSystem"/>
@ -77,7 +77,7 @@
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageAlignment="left" image="drag-handle-4x10" id="x7F-qD-5y9"/>
</imageView>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zNo-ij-mUl" customClass="EjectButton">
<rect key="frame" x="261" y="3" width="16" height="16"/>
<rect key="frame" x="277" y="3" width="16" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="bevel" bezelStyle="regularSquare" image="eject-16x16" imagePosition="only" alignment="center" alternateImage="eject-hover-16x16" imageScaling="proportionallyDown" inset="2" id="IZA-Tu-olu">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>

View File

@ -8,6 +8,7 @@
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NewSlotViewController">
<connections>
<outlet property="_popover" destination="QIT-2T-wdy" id="WUB-OS-kem"/>
<outlet property="outlineView" destination="Xj3-Qf-yek" id="AWE-Rg-XUM"/>
<outlet property="view" destination="D45-lv-6Fv" id="av3-OE-ph2"/>
</connections>
@ -15,20 +16,20 @@
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="27" horizontalPageScroll="10" verticalLineScroll="27" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" id="D45-lv-6Fv">
<rect key="frame" x="0.0" y="0.0" width="306" height="386"/>
<rect key="frame" x="0.0" y="0.0" width="316" height="386"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" focusRingType="none" copiesOnScroll="NO" id="8x1-xN-a7c">
<rect key="frame" x="0.0" y="0.0" width="306" height="386"/>
<clipView key="contentView" autoresizesSubviews="NO" focusRingType="none" copiesOnScroll="NO" id="8x1-xN-a7c">
<rect key="frame" x="0.0" y="0.0" width="316" height="386"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="none" selectionHighlightStyle="none" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="25" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="16" outlineTableColumn="u7T-p8-F2Z" id="Xj3-Qf-yek">
<rect key="frame" x="0.0" y="0.0" width="306" height="386"/>
<outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="none" selectionHighlightStyle="none" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="25" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="2" autoresizesOutlineColumn="YES" outlineTableColumn="u7T-p8-F2Z" id="Xj3-Qf-yek">
<rect key="frame" x="0.0" y="0.0" width="316" height="386"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="280" minWidth="40" maxWidth="1000" id="u7T-p8-F2Z">
<tableColumn editable="NO" width="296" minWidth="40" maxWidth="1000" id="u7T-p8-F2Z">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@ -39,10 +40,9 @@
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView identifier="MenuCell" id="1RI-9K-5qj" customClass="SlotTableCellView">
<rect key="frame" x="1" y="1" width="280" height="25"/>
<rect key="frame" x="1" y="1" width="296" height="25"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qIF-d4-kOf">
@ -55,7 +55,7 @@
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zQ8-o3-yBB">
<rect key="frame" x="87" y="0.0" width="193" height="25"/>
<rect key="frame" x="82" y="0.0" width="199" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" autoenablesItems="NO" selectedItem="tGi-yg-GFr" id="gt4-HK-pd1">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
@ -72,8 +72,25 @@
<action selector="menuChanged:" target="-2" id="9MH-mu-u5V"/>
</connections>
</popUpButton>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xCe-sY-sGe">
<rect key="frame" x="282" y="8" width="14" height="10"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="NSListViewTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="0qU-ID-kJ8">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="hamburger:" target="-2" id="5Xa-j7-Aod"/>
<binding destination="1RI-9K-5qj" name="hidden" keyPath="objectValue.selectedItem.children" id="rY2-0l-0N8">
<dictionary key="options">
<string key="NSValueTransformerName">NSIsNil</string>
</dictionary>
</binding>
</connections>
</button>
</subviews>
<connections>
<outlet property="hamburgerButton" destination="xCe-sY-sGe" id="5Da-If-Bt4"/>
<outlet property="menuButton" destination="zQ8-o3-yBB" id="zZf-nm-tCI"/>
<outlet property="textField" destination="qIF-d4-kOf" id="zIF-4n-v1e"/>
</connections>
@ -99,5 +116,111 @@
</scroller>
<point key="canvasLocation" x="-100" y="154"/>
</scrollView>
<viewController id="ziL-Zf-s1k" userLabel="Popover View Controller">
<connections>
<outlet property="view" destination="uew-UQ-Q25" id="qjB-ya-gFf"/>
</connections>
</viewController>
<popover behavior="t" id="QIT-2T-wdy">
<connections>
<outlet property="contentViewController" destination="ziL-Zf-s1k" id="rj8-2U-9t0"/>
</connections>
</popover>
<customView id="uew-UQ-Q25">
<rect key="frame" x="0.0" y="0.0" width="250" height="406"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button id="2jh-iq-DV6">
<rect key="frame" x="232" y="388" width="14" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="NSStopProgressFreestandingTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="Wp7-Km-kYI">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="performClose:" target="QIT-2T-wdy" id="Q04-24-ZOK"/>
</connections>
</button>
<scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="27" horizontalPageScroll="10" verticalLineScroll="27" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" id="5gB-oE-Gza">
<rect key="frame" x="0.0" y="0.0" width="250" height="386"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" focusRingType="none" drawsBackground="NO" copiesOnScroll="NO" id="X5e-Ka-JLr">
<rect key="frame" x="0.0" y="0.0" width="250" height="386"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="none" selectionHighlightStyle="none" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="25" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="16" outlineTableColumn="o1K-z1-KVi" id="uM0-Gk-crn">
<rect key="frame" x="0.0" y="0.0" width="253" height="386"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="250" minWidth="40" maxWidth="1000" id="o1K-z1-KVi">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="A12-NQ-gW3">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView identifier="MenuCell" id="Mgb-8H-DmI" customClass="SlotTableCellView">
<rect key="frame" x="1" y="1" width="250" height="25"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ThL-Yz-7Kd">
<rect key="frame" x="1" y="0.0" width="249" height="25"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" autoenablesItems="NO" selectedItem="djR-rV-wzX" id="SkW-fW-gwL">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" autoenablesItems="NO" id="7Ib-TL-f6U">
<items>
<menuItem title="Item 1" state="on" id="djR-rV-wzX"/>
<menuItem title="Item 2" id="qbC-4D-6t6"/>
<menuItem title="Item 3" id="qPv-x5-zpj"/>
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="ytA-nD-fIS"/>
</connections>
</popUpButton>
</subviews>
<connections>
<outlet property="menuButton" destination="ThL-Yz-7Kd" id="3Oc-hx-qKl"/>
</connections>
</tableCellView>
</prototypeCellViews>
</tableColumn>
</tableColumns>
<connections>
<outlet property="dataSource" destination="-2" id="l5t-kD-bae"/>
<outlet property="delegate" destination="-2" id="nwb-IL-MsP"/>
</connections>
</outlineView>
</subviews>
<color key="backgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="calibratedWhite"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="Keh-oo-CPO">
<rect key="frame" x="-100" y="-100" width="223" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="wtc-gL-alh" customClass="TransparentScroller">
<rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
</subviews>
<point key="canvasLocation" x="-451" y="61"/>
</customView>
</objects>
<resources>
<image name="NSListViewTemplate" width="14" height="10"/>
<image name="NSStopProgressFreestandingTemplate" width="14" height="14"/>
</resources>
</document>

View File

@ -41,6 +41,7 @@ static_assert(SLOT_COUNT <= sizeof(unsigned) * 8, "too many slot types");
NSDictionary *_machine_data;
IBOutlet NSPopover *_popover;
}
@ -49,7 +50,7 @@ static_assert(SLOT_COUNT <= sizeof(unsigned) * 8, "too many slot types");
// Do view setup here.
_root = @[];
[_outlineView setIndentationPerLevel: 2.0];
//[_outlineView setIndentationPerLevel: 2.0];
}
-(void)resetMachine {
@ -219,6 +220,18 @@ static_assert(SLOT_COUNT <= sizeof(unsigned) * 8, "too many slot types");
}
[self rebuildArgs];
}
- (IBAction)hamburger:(id)sender {
#if 1
if ([_popover isShown]) {
[_popover close];
}
#endif
[_popover showRelativeToRect: [sender bounds]
ofView: sender
preferredEdge: NSRectEdgeMaxX];
}
-(IBAction)resetSlots:(id)sender {
_slots_explicit = 0;

View File

@ -24,6 +24,7 @@
@property (readonly) NSString *title;
@property (readonly) NSArray *menuItems;
@property (readonly) SlotOption *selectedItem;
-(NSArray *)args;
-(NSArray *)serialize;
@ -32,7 +33,7 @@
-(void)prepareView: (SlotTableCellView *)view;
-(void)selectValue: (NSString *)value;
-(SlotOption *)selectedItem;
-(Media)selectedMedia;
-(NSArray *)selectedChildren;
@ -51,7 +52,7 @@
@interface SlotTableCellView : NSTableCellView
@property (weak) IBOutlet NSPopUpButton *menuButton;
@property (weak) IBOutlet NSButton *hamburgerButton;
@end

View File

@ -308,6 +308,9 @@ static NSDictionary *IndexMap = nil;
NSPopUpButton *button = [view menuButton];
NSTextField *text = [view textField];
[view setObjectValue: self];
[text setObjectValue: _title];
[button unbind: @"selectedIndex"];
NSMenu *menu = [button menu];
@ -316,8 +319,25 @@ static NSDictionary *IndexMap = nil;
[menu setItemArray: menuItems];
[button bind: @"selectedIndex" toObject: self withKeyPath: @"selectedIndex" options: nil];
[button setTag: _index];
NSButton *hb = [view hamburgerButton];
[hb setTag: _index];
#if 0
// bind w/ NSIsNilTransformerName? selected index would need to flag it dirty.
if ([self selectedChildren]) {
[hb setHidden: NO];
} else {
[hb setHidden: YES];
}
#endif
}
/*
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/KeyValueObserving/Articles/KVODependentKeys.html
*/
+ (NSSet *)keyPathsForValuesAffectingSelectedItem {
return [NSSet setWithObject: @"selectedIndex"];
}
@end