Revision: 26127 http://sourceforge.net/p/bibdesk/svn/26127 Author: hofman Date: 2021-06-03 16:11:47 +0000 (Thu, 03 Jun 2021) Log Message: ----------- View based table view in template document
Modified Paths: -------------- trunk/bibdesk/BDSKTemplateDocument.m trunk/bibdesk/Base.lproj/TemplateDocument.xib Modified: trunk/bibdesk/BDSKTemplateDocument.m =================================================================== --- trunk/bibdesk/BDSKTemplateDocument.m 2021-06-03 16:05:17 UTC (rev 26126) +++ trunk/bibdesk/BDSKTemplateDocument.m 2021-06-03 16:11:47 UTC (rev 26127) @@ -1158,6 +1158,10 @@ return NO; } +- (NSView *)tableView:(NSTableView *)tv viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { + return [tv makeViewWithIdentifier:[tableColumn identifier] owner:self]; +} + - (NSArray *)tableView:(NSTableView *)tv typeSelectHelperSelectionStrings:(BDSKTypeSelectHelper *)aTypeSelectHelper { return [[self typeTemplates] valueForKey:@"pubType"]; } Modified: trunk/bibdesk/Base.lproj/TemplateDocument.xib =================================================================== --- trunk/bibdesk/Base.lproj/TemplateDocument.xib 2021-06-03 16:05:17 UTC (rev 26126) +++ trunk/bibdesk/Base.lproj/TemplateDocument.xib 2021-06-03 16:11:47 UTC (rev 26127) @@ -51,17 +51,17 @@ <autoresizingMask key="autoresizingMask"/> <subviews> <scrollView focusRingType="none" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="934"> - <rect key="frame" x="-1" y="-1" width="836" height="170"/> + <rect key="frame" x="-1" y="-1" width="836" height="198"/> <clipView key="contentView" id="Nj5-U4-FLc"> - <rect key="frame" x="1" y="1" width="834" height="168"/> + <rect key="frame" x="1" y="1" width="834" height="196"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <textView editable="NO" importsGraphics="NO" verticallyResizable="YES" usesFontPanel="YES" continuousSpellChecking="YES" usesRuler="YES" spellingCorrection="YES" smartInsertDelete="YES" id="935" customClass="BDSKTextView"> - <rect key="frame" x="0.0" y="0.0" width="834" height="168"/> + <rect key="frame" x="0.0" y="0.0" width="834" height="196"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> - <size key="minSize" width="834" height="168"/> + <size key="minSize" width="834" height="196"/> <size key="maxSize" width="1655" height="10000000"/> <color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/> <connections> @@ -81,7 +81,7 @@ <autoresizingMask key="autoresizingMask"/> </scroller> <scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="1948"> - <rect key="frame" x="819" y="1" width="16" height="168"/> + <rect key="frame" x="819" y="1" width="16" height="196"/> <autoresizingMask key="autoresizingMask"/> </scroller> </scrollView> @@ -419,7 +419,7 @@ </view> </box> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1542"> - <rect key="frame" x="18" y="510" width="72" height="14"/> + <rect key="frame" x="18" y="510" width="52" height="14"/> <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Default type:" id="1901"> <font key="font" metaFont="smallSystem"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> @@ -427,7 +427,7 @@ </textFieldCell> </textField> <popUpButton horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1537"> - <rect key="frame" x="32" y="482" width="60" height="22"/> + <rect key="frame" x="32" y="482" width="40" height="22"/> <popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" inset="2" arrowPosition="arrowAtCenter" preferredEdge="maxY" selectedItem="1541" id="1900"> <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="smallSystem"/> @@ -444,13 +444,13 @@ </connections> </popUpButton> <scrollView autohidesScrollers="YES" horizontalLineScroll="26" horizontalPageScroll="10" verticalLineScroll="26" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZVm-ex-Jeo"> - <rect key="frame" x="20" y="177" width="68" height="301"/> + <rect key="frame" x="20" y="205" width="48" height="273"/> <clipView key="contentView" id="D7r-8N-QXM"> - <rect key="frame" x="1" y="1" width="66" height="299"/> + <rect key="frame" x="1" y="1" width="46" height="271"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> - <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="24" rowSizeStyle="small" headerView="W7l-ga-thB" id="6Be-c7-qbI" customClass="BDSKTableView"> - <rect key="frame" x="0.0" y="0.0" width="71" height="271"/> + <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="24" rowSizeStyle="small" headerView="W7l-ga-thB" viewBased="YES" id="6Be-c7-qbI" customClass="BDSKTableView"> + <rect key="frame" x="0.0" y="0.0" width="71" height="243"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -466,9 +466,29 @@ <font key="font" metaFont="smallSystem"/> </buttonCell> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> - <connections> - <binding destination="700" name="value" keyPath="arrangedObjects.included" id="jwf-rJ-hUQ"/> - </connections> + <prototypeCellViews> + <tableCellView id="o7L-lR-P3B"> + <rect key="frame" x="1" y="1" width="21" height="24"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RS4-i7-mBX"> + <rect key="frame" x="-1" y="4" width="23" height="16"/> + <buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="only" controlSize="small" scrollable="YES" lineBreakMode="clipping" inset="2" id="5Oa-0S-l3m"> + <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> + <font key="font" metaFont="smallSystem"/> + </buttonCell> + <connections> + <binding destination="o7L-lR-P3B" name="value" keyPath="objectValue.included" id="JwI-7g-0mU"/> + </connections> + </button> + </subviews> + <constraints> + <constraint firstItem="RS4-i7-mBX" firstAttribute="leading" secondItem="o7L-lR-P3B" secondAttribute="leading" id="JuH-1c-CnJ"/> + <constraint firstAttribute="trailing" secondItem="RS4-i7-mBX" secondAttribute="trailing" id="nO6-dB-4V3"/> + <constraint firstItem="RS4-i7-mBX" firstAttribute="centerY" secondItem="o7L-lR-P3B" secondAttribute="centerY" id="uqH-ec-fjZ"/> + </constraints> + </tableCellView> + </prototypeCellViews> </tableColumn> <tableColumn identifier="pubType" editable="NO" width="40" minWidth="40" maxWidth="1000" id="0gE-kr-5MZ"> <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="BibTeX Type"> @@ -481,14 +501,39 @@ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> - <connections> - <binding destination="700" name="fontBold" keyPath="arrangedObjects.defaultTemplate" id="U96-1L-dm9"/> - <binding destination="700" name="value" keyPath="arrangedObjects.pubType" id="5EF-U2-YrA"/> - <binding destination="700" name="textColor" keyPath="arrangedObjects.textColor" id="jk6-Bn-wxK"/> - </connections> + <prototypeCellViews> + <tableCellView id="v6j-yd-fiN"> + <rect key="frame" x="25" y="1" width="44" height="24"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="7Dg-ca-LfT"> + <rect key="frame" x="-2" y="5" width="48" height="14"/> + <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" id="xRw-Ny-OTi"> + <font key="font" metaFont="smallSystem"/> + <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> + <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + <connections> + <binding destination="v6j-yd-fiN" name="fontBold" keyPath="objectValue.defaultTemplate" id="LaG-JY-R59"/> + <binding destination="v6j-yd-fiN" name="textColor" keyPath="objectValue.textColor" id="Jqf-r9-Qs3"/> + <binding destination="v6j-yd-fiN" name="value" keyPath="objectValue.pubType" id="MMb-NR-LB9"/> + </connections> + </textField> + </subviews> + <constraints> + <constraint firstAttribute="trailing" secondItem="7Dg-ca-LfT" secondAttribute="trailing" id="2cg-cb-NJX"/> + <constraint firstItem="7Dg-ca-LfT" firstAttribute="leading" secondItem="v6j-yd-fiN" secondAttribute="leading" id="Osa-lc-JjA"/> + <constraint firstItem="7Dg-ca-LfT" firstAttribute="centerY" secondItem="v6j-yd-fiN" secondAttribute="centerY" id="wkD-Xo-ziv"/> + </constraints> + <connections> + <outlet property="textField" destination="7Dg-ca-LfT" id="BVF-Gh-j3t"/> + </connections> + </tableCellView> + </prototypeCellViews> </tableColumn> </tableColumns> <connections> + <binding destination="700" name="content" keyPath="arrangedObjects" id="FW4-ch-Vee"/> <outlet property="dataSource" destination="-2" id="LuU-9C-Vmc"/> <outlet property="delegate" destination="-2" id="a8B-r1-O98"/> </connections> @@ -495,8 +540,8 @@ </tableView> </subviews> </clipView> - <scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="qw6-WF-LwA"> - <rect key="frame" x="1" y="284" width="66" height="16"/> + <scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="0.20000000000000001" horizontal="YES" id="qw6-WF-LwA"> + <rect key="frame" x="1" y="256" width="46" height="16"/> <autoresizingMask key="autoresizingMask"/> </scroller> <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="vni-Rr-d7f"> @@ -509,13 +554,13 @@ </tableHeaderView> </scrollView> <box verticalCompressionResistancePriority="250" title="Item Template" translatesAutoresizingMaskIntoConstraints="NO" id="1556"> - <rect key="frame" x="93" y="303" width="724" height="94"/> + <rect key="frame" x="53" y="331" width="764" height="66"/> <view key="contentView" id="vaM-Fl-fT2"> - <rect key="frame" x="3" y="3" width="718" height="76"/> + <rect key="frame" x="3" y="3" width="758" height="48"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <tokenField horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="1558" customClass="BDSKTokenField"> - <rect key="frame" x="12" y="10" width="694" height="56"/> + <rect key="frame" x="12" y="10" width="734" height="28"/> <constraints> <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="22" id="bkY-kv-FEE"/> <constraint firstAttribute="height" priority="499" constant="56" id="bn0-3P-xsm"/> @@ -544,13 +589,13 @@ </view> </box> <box title="Options for field" translatesAutoresizingMaskIntoConstraints="NO" id="1559"> - <rect key="frame" x="93" y="173" width="724" height="126"/> + <rect key="frame" x="53" y="201" width="764" height="126"/> <view key="contentView" id="TSn-hs-oy2"> - <rect key="frame" x="3" y="3" width="718" height="108"/> + <rect key="frame" x="3" y="3" width="758" height="108"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <customView translatesAutoresizingMaskIntoConstraints="NO" id="cLa-yx-uut"> - <rect key="frame" x="4" y="6" width="710" height="96"/> + <rect key="frame" x="4" y="6" width="750" height="96"/> <constraints> <constraint firstAttribute="height" constant="96" id="ZSn-Gp-DmP"/> </constraints> @@ -572,15 +617,15 @@ </connections> </box> <box title="Available Fields" translatesAutoresizingMaskIntoConstraints="NO" id="1547"> - <rect key="frame" x="93" y="401" width="724" height="123"/> + <rect key="frame" x="53" y="401" width="764" height="123"/> <view key="contentView" id="fnr-QQ-bwY"> - <rect key="frame" x="3" y="3" width="718" height="105"/> + <rect key="frame" x="3" y="3" width="758" height="105"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasVerticalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1549"> - <rect key="frame" x="12" y="0.0" width="694" height="95"/> + <rect key="frame" x="12" y="0.0" width="734" height="95"/> <clipView key="contentView" autoresizesSubviews="NO" drawsBackground="NO" copiesOnScroll="NO" id="uAv-0P-sO3"> - <rect key="frame" x="0.0" y="0.0" width="694" height="95"/> + <rect key="frame" x="0.0" y="0.0" width="734" height="95"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <customView translatesAutoresizingMaskIntoConstraints="NO" id="1550" customClass="BDSKFlippedView"> @@ -726,7 +771,7 @@ </connections> </customView> <customView placeholderIntrinsicWidth="9" placeholderIntrinsicHeight="9" translatesAutoresizingMaskIntoConstraints="NO" id="hQX-jZ-Y2Y" customClass="BDSKResizeView"> - <rect key="frame" x="96" y="298" width="718" height="9"/> + <rect key="frame" x="56" y="326" width="758" height="9"/> <connections> <outlet property="constraint" destination="bn0-3P-xsm" id="BGv-oq-fab"/> </connections> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit