Revision: 27308
          http://sourceforge.net/p/bibdesk/svn/27308
Author:   hofman
Date:     2022-03-15 15:09:53 +0000 (Tue, 15 Mar 2022)
Log Message:
-----------
Rename BDSKGroupTextField to BDSKLineTextField, add separate files for it, and 
use it for text cells in main table. Force also multi-line fields to be 
displayed as a single (first) line.

Modified Paths:
--------------
    trunk/bibdesk/BDSKGroupTextFieldCell.h
    trunk/bibdesk/BDSKGroupTextFieldCell.m
    trunk/bibdesk/Base.lproj/BibDocument.xib
    trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj

Added Paths:
-----------
    trunk/bibdesk/BDSKLineTextField.h
    trunk/bibdesk/BDSKLineTextField.m

Modified: trunk/bibdesk/BDSKGroupTextFieldCell.h
===================================================================
--- trunk/bibdesk/BDSKGroupTextFieldCell.h      2022-03-14 22:57:51 UTC (rev 
27307)
+++ trunk/bibdesk/BDSKGroupTextFieldCell.h      2022-03-15 15:09:53 UTC (rev 
27308)
@@ -46,8 +46,3 @@
 @property (nonatomic) BOOL displayAsColor;
 
 @end
-
-
-@interface BDSKGroupTextField : NSTextField
-@end
-

Modified: trunk/bibdesk/BDSKGroupTextFieldCell.m
===================================================================
--- trunk/bibdesk/BDSKGroupTextFieldCell.m      2022-03-14 22:57:51 UTC (rev 
27307)
+++ trunk/bibdesk/BDSKGroupTextFieldCell.m      2022-03-15 15:09:53 UTC (rev 
27308)
@@ -68,21 +68,3 @@
 }
 
 @end
-
-@implementation BDSKGroupTextField
-
-- (NSSize)intrinsicContentSize {
-    static NSMapTable *heightTable = nil;
-    NSFont *font = [self font];
-    CGFloat *height = heightTable ? NSMapGet(heightTable, font) : NULL;
-    if (height == NULL) {
-        height = NSZoneMalloc(NULL, sizeof(CGFloat));
-        *height = [[self font] defaultViewLineHeight];
-        if (heightTable == nil)
-            heightTable = NSCreateMapTable(NSObjectMapKeyCallBacks, 
NSOwnedPointerMapValueCallBacks, 0);
-        NSMapInsert(heightTable, font, height);
-    }
-    return NSMakeSize(NSViewNoIntrinsicMetric, *height);
-}
-
-@end

Added: trunk/bibdesk/BDSKLineTextField.h
===================================================================
--- trunk/bibdesk/BDSKLineTextField.h                           (rev 0)
+++ trunk/bibdesk/BDSKLineTextField.h   2022-03-15 15:09:53 UTC (rev 27308)
@@ -0,0 +1,44 @@
+//
+//  BDSKLineTextField.h
+//  BibDesk
+//
+//  Created by Christiaan Hofman on 15/03/2022.
+/*
+ This software is Copyright (c) 2022
+ Christiaan Hofman. All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ 
+ - Neither the name of Christiaan Hofman nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface BDSKLineTextField : NSTextField
+@end
+

Added: trunk/bibdesk/BDSKLineTextField.m
===================================================================
--- trunk/bibdesk/BDSKLineTextField.m                           (rev 0)
+++ trunk/bibdesk/BDSKLineTextField.m   2022-03-15 15:09:53 UTC (rev 27308)
@@ -0,0 +1,59 @@
+//
+//  BDSKLineTextField.m
+//  BibDesk
+//
+//  Created by Christiaan Hofman on 15/03/2022.
+/*
+ This software is Copyright (c) 2022
+ Christiaan Hofman. All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ 
+ - Neither the name of Christiaan Hofman nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "BDSKLineTextField.h"
+#import "NSFont_BDSKExtensions.h"
+
+
+@implementation BDSKLineTextField
+
+- (NSSize)intrinsicContentSize {
+    static NSMapTable *heightTable = nil;
+    NSFont *font = [self font];
+    CGFloat *height = heightTable ? NSMapGet(heightTable, font) : NULL;
+    if (height == NULL) {
+        height = NSZoneMalloc(NULL, sizeof(CGFloat));
+        *height = [[self font] defaultViewLineHeight];
+        if (heightTable == nil)
+            heightTable = NSCreateMapTable(NSObjectMapKeyCallBacks, 
NSOwnedPointerMapValueCallBacks, 0);
+        NSMapInsert(heightTable, font, height);
+    }
+    return NSMakeSize(NSViewNoIntrinsicMetric, *height);
+}
+
+@end

Modified: trunk/bibdesk/Base.lproj/BibDocument.xib
===================================================================
--- trunk/bibdesk/Base.lproj/BibDocument.xib    2022-03-14 22:57:51 UTC (rev 
27307)
+++ trunk/bibdesk/Base.lproj/BibDocument.xib    2022-03-15 15:09:53 UTC (rev 
27308)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="19455" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="19455"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="19529"/>
         <capability name="documents saved in the Xcode 8 format" 
minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -71,7 +71,7 @@
                                         <rect key="frame" x="11" y="1" 
width="97" height="17"/>
                                         <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
-                                            <textField 
horizontalHuggingPriority="251" verticalHuggingPriority="750" 
horizontalCompressionResistancePriority="250" allowsExpansionToolTips="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="eQ6-je-G23">
+                                            <textField 
horizontalHuggingPriority="251" verticalHuggingPriority="750" 
horizontalCompressionResistancePriority="250" allowsExpansionToolTips="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="eQ6-je-G23" 
customClass="BDSKLineTextField">
                                                 <rect key="frame" x="0.0" 
y="1" width="97" height="15"/>
                                                 <textFieldCell key="cell" 
lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" id="4af-gC-Qt0">
                                                     <font key="font" 
metaFont="cellTitle"/>
@@ -383,7 +383,7 @@
                                                                     <rect 
key="frame" x="92" y="9" width="0.0" height="0.0"/>
                                                                     <imageCell 
key="cell" refusesFirstResponder="YES" alignment="left" 
imageScaling="proportionallyDown" id="eOM-PZ-O5b" 
customClass="BDSKGroupBubbleCell"/>
                                                                 </imageView>
-                                                                <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
verticalCompressionResistancePriority="751" allowsExpansionToolTips="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="oFI-uU-pLf" 
customClass="BDSKGroupTextField">
+                                                                <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
verticalCompressionResistancePriority="751" allowsExpansionToolTips="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="oFI-uU-pLf" 
customClass="BDSKLineTextField">
                                                                     <rect 
key="frame" x="20" y="2" width="74" height="12"/>
                                                                     
<textFieldCell key="cell" lineBreakMode="truncatingTail" id="tSR-5x-qeN">
                                                                         <font 
key="font" metaFont="miniSystem"/>
@@ -399,7 +399,7 @@
                                                                         
</binding>
                                                                     
</connections>
                                                                 </textField>
-                                                                <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" 
id="h4r-Dh-CgO" customClass="BDSKGroupTextField">
+                                                                <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" 
id="h4r-Dh-CgO" customClass="BDSKLineTextField">
                                                                     <rect 
key="frame" x="20" y="1" width="74" height="14"/>
                                                                     
<textFieldCell key="cell" lineBreakMode="truncatingTail" 
sendsActionOnEndEditing="YES" id="bzr-RQ-gYy" 
customClass="BDSKGroupTextFieldCell">
                                                                         <font 
key="font" metaFont="smallSystem"/>

Modified: trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj
===================================================================
--- trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj     2022-03-14 22:57:51 UTC 
(rev 27307)
+++ trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj     2022-03-15 15:09:53 UTC 
(rev 27308)
@@ -774,6 +774,8 @@
                CEFA07F50AF0E52100A3B4B1 /* BDSKApplication.m in Sources */ = 
{isa = PBXBuildFile; fileRef = CEFA07F30AF0E52100A3B4B1 /* BDSKApplication.m 
*/; };
                CEFA2F130CC0272C002A8262 /* BDSKTemplateTag.m in Sources */ = 
{isa = PBXBuildFile; fileRef = CEFA2F110CC0272C002A8262 /* BDSKTemplateTag.m 
*/; };
                CEFAD8BF1150F7A800A3D969 /* BDSKFontWell.m in Sources */ = {isa 
= PBXBuildFile; fileRef = CEFAD8BD1150F7A800A3D969 /* BDSKFontWell.m */; };
+               CEFB268F27E0E262002E50D5 /* BDSKLineTextField.h in Headers */ = 
{isa = PBXBuildFile; fileRef = CEFB268D27E0E262002E50D5 /* BDSKLineTextField.h 
*/; };
+               CEFB269027E0E262002E50D5 /* BDSKLineTextField.m in Sources */ = 
{isa = PBXBuildFile; fileRef = CEFB268E27E0E262002E50D5 /* BDSKLineTextField.m 
*/; };
                CEFB73F610A07E31001DC4C1 /* libraryGroup.tiff in Resources */ = 
{isa = PBXBuildFile; fileRef = CEFB73F510A07E31001DC4C1 /* libraryGroup.tiff 
*/; };
                CEFD45890BFFC1F80027B933 /* NSWindow+Scripting.m in Sources */ 
= {isa = PBXBuildFile; fileRef = CEFD45870BFFC1F80027B933 /* 
NSWindow+Scripting.m */; };
                CEFDBDBE0AEA86BA009EE99D /* BDSKSmartGroup.m in Sources */ = 
{isa = PBXBuildFile; fileRef = CEFDBDBC0AEA86BA009EE99D /* BDSKSmartGroup.m */; 
};
@@ -1996,6 +1998,8 @@
                CEFA2F110CC0272C002A8262 /* BDSKTemplateTag.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= BDSKTemplateTag.m; sourceTree = "<group>"; };
                CEFAD8BC1150F7A800A3D969 /* BDSKFontWell.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
BDSKFontWell.h; sourceTree = "<group>"; };
                CEFAD8BD1150F7A800A3D969 /* BDSKFontWell.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= BDSKFontWell.m; sourceTree = "<group>"; };
+               CEFB268D27E0E262002E50D5 /* BDSKLineTextField.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
BDSKLineTextField.h; sourceTree = "<group>"; };
+               CEFB268E27E0E262002E50D5 /* BDSKLineTextField.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
BDSKLineTextField.m; sourceTree = "<group>"; };
                CEFB73F510A07E31001DC4C1 /* libraryGroup.tiff */ = {isa = 
PBXFileReference; lastKnownFileType = image.tiff; path = libraryGroup.tiff; 
sourceTree = "<group>"; };
                CEFD45860BFFC1F80027B933 /* NSWindow+Scripting.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
"NSWindow+Scripting.h"; sourceTree = "<group>"; };
                CEFD45870BFFC1F80027B933 /* NSWindow+Scripting.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= "NSWindow+Scripting.m"; sourceTree = "<group>"; };
@@ -2631,6 +2635,7 @@
                                CE33D61A136AB8A700ACE924 /* 
BDSKImportTextView.m */,
                                F92405010BC5856900672839 /* 
BDSKLevelIndicatorCell.m */,
                                CE15198014B62E47003AE698 /* 
BDSKLineNumberView.m */,
+                               CEFB268E27E0E262002E50D5 /* BDSKLineTextField.m 
*/,
                                CEF536691192EFE400027C3C /* 
BDSKNotesOutlineView.m */,
                                CE62E0BE0F4C4A5500BDF01E /* BDSKOutlineView.m 
*/,
                                CE62DE3A0F4B777800BDF01E /* 
BDSKPreferenceWindow.m */,
@@ -3307,6 +3312,7 @@
                                F92405000BC5856900672839 /* 
BDSKLevelIndicatorCell.h */,
                                CE24B33210C3E13900818EDF /* BDSKLibraryGroup.h 
*/,
                                CE15197F14B62E47003AE698 /* 
BDSKLineNumberView.h */,
+                               CEFB268D27E0E262002E50D5 /* BDSKLineTextField.h 
*/,
                                F911D7100CFE90050009C77B /* BDSKLinkedFile.h */,
                                F9201DFF0B72504C007E45BB /* BDSKMacro.h */,
                                CE3B5E7A09CEDE470017D339 /* BDSKMacroResolver.h 
*/,
@@ -3755,6 +3761,7 @@
                                CE2A0AB922459A4500A8F31C /* BibPref_Display.h 
in Headers */,
                                CE2A0A24224599EF00A8F31C /* 
BDSKLevelIndicatorCell.h in Headers */,
                                CE2A0AA722459A4100A8F31C /* BibAuthor.h in 
Headers */,
+                               CEFB268F27E0E262002E50D5 /* BDSKLineTextField.h 
in Headers */,
                                CE2A0ABA22459A4500A8F31C /* BibPref_Export.h in 
Headers */,
                                CE2A0A7222459A0A00A8F31C /* BDSKSharingClient.h 
in Headers */,
                                CE2A09CA2245997A00A8F31C /* BDSKCFCallBacks.h 
in Headers */,
@@ -4694,6 +4701,7 @@
                                CE4476DC2128907100DF38E1 /* 
DOMNode_BDSKExtensions.m in Sources */,
                                F92EF32309E6242200A244D0 /* BDSKSharedGroup.m 
in Sources */,
                                F946DCE909FDC4B600D471DF /* 
BDSKAsynchronousDOServer.m in Sources */,
+                               CEFB269027E0E262002E50D5 /* BDSKLineTextField.m 
in Sources */,
                                F9A411FC0A0B2066008493C0 /* 
BDSKPreferenceController.m in Sources */,
                                CE3448020A11302F0026A92A /* BDSKPreviewItem.m 
in Sources */,
                                CE3256000A1748D0002D6E4C /* 
NSGeometry_BDSKExtensions.m in Sources */,

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to