Revision: 26077 http://sourceforge.net/p/bibdesk/svn/26077 Author: hofman Date: 2021-05-26 09:48:32 +0000 (Wed, 26 May 2021) Log Message: ----------- Add splitview splitter like view to change the constant of a height constraint
Modified Paths: -------------- trunk/bibdesk/Base.lproj/TemplateDocument.xib trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj Added Paths: ----------- trunk/bibdesk/BDSKConstraintTracker.h trunk/bibdesk/BDSKConstraintTracker.m Added: trunk/bibdesk/BDSKConstraintTracker.h =================================================================== --- trunk/bibdesk/BDSKConstraintTracker.h (rev 0) +++ trunk/bibdesk/BDSKConstraintTracker.h 2021-05-26 09:48:32 UTC (rev 26077) @@ -0,0 +1,48 @@ +// +// BDSKConstraintTracker.h +// BibDesk +// +// Created by Christiaan Hofman on 26/05/2021. +/* + This software is Copyright (c) 2021 + 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 BDSKConstraintTracker : NSView{ + NSLayoutConstraint *constraint; +} + +@property (nonatomic, retain) IBOutlet NSLayoutConstraint *constraint; + +@end Added: trunk/bibdesk/BDSKConstraintTracker.m =================================================================== --- trunk/bibdesk/BDSKConstraintTracker.m (rev 0) +++ trunk/bibdesk/BDSKConstraintTracker.m 2021-05-26 09:48:32 UTC (rev 26077) @@ -0,0 +1,77 @@ +// +// BDSKConstraintTracker.m +// BibDesk +// +// Created by Christiaan Hofman on 26/05/2021. +/* + This software is Copyright (c) 2021 + 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 "BDSKConstraintTracker.h" + +#define SIZE 6.0 + +@implementation BDSKConstraintTracker + +@synthesize constraint; + +- (void)dealloc { + BDSKDESTROY(constraint); + [super dealloc]; +} + +- (void)resetCursorRects { + [super resetCursorRects]; + [self addCursorRect:[self bounds] cursor:[NSCursor resizeUpDownCursor]]; +} + +- (void)mouseDown:(NSEvent *)theEvent { + while (YES) { + theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + if ([theEvent type] == NSLeftMouseUp) + break; + [[self constraint] setConstant:fmax(0.0, [[self constraint] constant] + [theEvent deltaY])]; + } +} + +- (void)drawRect:(NSRect)dirtyRect { + NSRect rect = [self bounds]; + rect = NSMakeRect(NSMidX(rect) - 0.5 * SIZE, NSMidY(rect) - 0.5 * SIZE, SIZE, SIZE); + [[[NSColor grayColor] colorWithAlphaComponent:0.33333] setFill]; + [[NSBezierPath bezierPathWithOvalInRect:rect] fill]; +} + +- (NSSize)intrinsicContentSize { + return NSMakeSize(SIZE, SIZE); +} + +@end Modified: trunk/bibdesk/Base.lproj/TemplateDocument.xib =================================================================== --- trunk/bibdesk/Base.lproj/TemplateDocument.xib 2021-05-26 06:30:26 UTC (rev 26076) +++ trunk/bibdesk/Base.lproj/TemplateDocument.xib 2021-05-26 09:48:32 UTC (rev 26077) @@ -719,6 +719,18 @@ </constraints> </view> </box> + <customView placeholderIntrinsicWidth="6" placeholderIntrinsicHeight="6" translatesAutoresizingMaskIntoConstraints="NO" id="bVC-fu-dgF" customClass="BDSKConstraintTracker"> + <rect key="frame" x="414" y="525" width="6" height="6"/> + <connections> + <outlet property="constraint" destination="zGZ-wM-rDV" id="L76-QF-YVR"/> + </connections> + </customView> + <customView placeholderIntrinsicWidth="6" placeholderIntrinsicHeight="6" translatesAutoresizingMaskIntoConstraints="NO" id="hQX-jZ-Y2Y" customClass="BDSKConstraintTracker"> + <rect key="frame" x="414" y="292" width="6" height="6"/> + <connections> + <outlet property="constraint" destination="bn0-3P-xsm" id="BGv-oq-fab"/> + </connections> + </customView> </subviews> <constraints> <constraint firstItem="1559" firstAttribute="trailing" secondItem="1543" secondAttribute="trailing" id="09p-EM-nw3"/> @@ -726,7 +738,9 @@ <constraint firstItem="1547" firstAttribute="trailing" secondItem="1543" secondAttribute="trailing" id="5xB-rb-yw6"/> <constraint firstItem="ZVm-ex-Jeo" firstAttribute="top" secondItem="1537" secondAttribute="bottom" constant="8" symbolic="YES" id="6Bf-5X-jVb"/> <constraint firstAttribute="bottom" secondItem="934" secondAttribute="bottom" constant="-1" id="82e-wL-XLc"/> + <constraint firstItem="bVC-fu-dgF" firstAttribute="centerX" secondItem="6" secondAttribute="centerX" id="8mv-w3-wtW"/> <constraint firstItem="1542" firstAttribute="leading" secondItem="1543" secondAttribute="leading" id="DlK-Rk-P95"/> + <constraint firstItem="hQX-jZ-Y2Y" firstAttribute="top" secondItem="1556" secondAttribute="bottom" constant="1" id="E8i-3k-APc"/> <constraint firstItem="1556" firstAttribute="leading" secondItem="1547" secondAttribute="leading" id="HgQ-kx-sjK"/> <constraint firstItem="1543" firstAttribute="leading" secondItem="6" secondAttribute="leading" constant="20" symbolic="YES" id="KCc-Lu-Tb2"/> <constraint firstItem="1543" firstAttribute="top" secondItem="6" secondAttribute="top" constant="20" symbolic="YES" id="Lpg-2R-mLa"/> @@ -739,9 +753,11 @@ <constraint firstItem="934" firstAttribute="leading" secondItem="6" secondAttribute="leading" constant="-1" id="bNK-t6-7uZ"/> <constraint firstItem="1556" firstAttribute="trailing" secondItem="1543" secondAttribute="trailing" id="cak-pP-Cnc"/> <constraint firstItem="ZVm-ex-Jeo" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="1542" secondAttribute="trailing" id="dil-JB-aH2"/> + <constraint firstItem="bVC-fu-dgF" firstAttribute="top" secondItem="1543" secondAttribute="bottom" constant="1" id="giE-uv-VVF"/> <constraint firstAttribute="trailing" secondItem="1543" secondAttribute="trailing" constant="20" symbolic="YES" id="hAN-RG-VMk"/> <constraint firstItem="1547" firstAttribute="top" secondItem="1543" secondAttribute="bottom" constant="8" symbolic="YES" id="mDB-gU-X7Z"/> <constraint firstItem="1537" firstAttribute="leading" secondItem="1543" secondAttribute="leading" constant="16" id="pAb-6A-aSv"/> + <constraint firstItem="hQX-jZ-Y2Y" firstAttribute="centerX" secondItem="6" secondAttribute="centerX" id="t4R-Or-wiK"/> <constraint firstItem="934" firstAttribute="top" secondItem="1559" secondAttribute="bottom" constant="8" symbolic="YES" id="uFw-Uu-4na"/> <constraint firstItem="ZVm-ex-Jeo" firstAttribute="leading" secondItem="1543" secondAttribute="leading" id="vVR-Ia-hc7"/> <constraint firstItem="1542" firstAttribute="top" secondItem="1543" secondAttribute="bottom" constant="8" symbolic="YES" id="xJ4-eB-X65"/> Modified: trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj =================================================================== --- trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj 2021-05-26 06:30:26 UTC (rev 26076) +++ trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj 2021-05-26 09:48:32 UTC (rev 26077) @@ -525,6 +525,8 @@ CE7611530EA49B6E00301E45 /* NSPrintOperation_BDSKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE7611510EA49B6E00301E45 /* NSPrintOperation_BDSKExtensions.m */; }; CE77964120372B90009C6A52 /* BDSKAsynchronousWebParser.m in Sources */ = {isa = PBXBuildFile; fileRef = CE77963F20372B90009C6A52 /* BDSKAsynchronousWebParser.m */; }; CE77A7FE0923BEBA0019D901 /* NSTableView_BDSKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE77A7FC0923BEBA0019D901 /* NSTableView_BDSKExtensions.m */; }; + CE78C4B1265E4ED200B4A54F /* BDSKConstraintTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = CE78C4AF265E4ED200B4A54F /* BDSKConstraintTracker.h */; }; + CE78C4B2265E4ED200B4A54F /* BDSKConstraintTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = CE78C4B0265E4ED200B4A54F /* BDSKConstraintTracker.m */; }; CE7A31400B08EA1F00D1B333 /* BDSKItemPasteboardHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = CE7A313E0B08EA1F00D1B333 /* BDSKItemPasteboardHelper.m */; }; CE7A4A8F0B0B475B00D1B333 /* BDSKCustomCiteDrawerController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE7A4A8D0B0B475B00D1B333 /* BDSKCustomCiteDrawerController.m */; }; CE7B88932045664200D6A648 /* BDSKDOIWebParser.m in Sources */ = {isa = PBXBuildFile; fileRef = CE7B88912045664200D6A648 /* BDSKDOIWebParser.m */; }; @@ -1559,6 +1561,8 @@ CE77A7FC0923BEBA0019D901 /* NSTableView_BDSKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSTableView_BDSKExtensions.m; sourceTree = "<group>"; }; CE77AE80265115B900C9D43B /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/BDSKCondition.strings; sourceTree = "<group>"; }; CE77AE81265115BC00C9D43B /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/BDSKCondition.strings; sourceTree = "<group>"; }; + CE78C4AF265E4ED200B4A54F /* BDSKConstraintTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BDSKConstraintTracker.h; sourceTree = "<group>"; }; + CE78C4B0265E4ED200B4A54F /* BDSKConstraintTracker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BDSKConstraintTracker.m; sourceTree = "<group>"; }; CE791ECE2638CBE500588E24 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/AuthenticationPanel.strings; sourceTree = "<group>"; }; CE791ECF2638CBE700588E24 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/AuthenticationPanel.strings; sourceTree = "<group>"; }; CE791ED32638CD7B00588E24 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/BDSKErrorEditWindow.strings; sourceTree = "<group>"; }; @@ -2575,6 +2579,7 @@ CE23B2CB233E0B96006390D9 /* BDSKColorLabelWell.m */, CEAC848B261236F3009C4E15 /* BDSKComboBoxCell.h */, CEAC848C261236F3009C4E15 /* BDSKComboBoxCell.m */, + CE78C4B0265E4ED200B4A54F /* BDSKConstraintTracker.m */, CEEC70E0093B6EC200A64F54 /* BDSKDragImageView.m */, CE26481B0B5AB4B700D4B5B8 /* BDSKDragTextField.m */, F9022C410758027800C3F701 /* BDSKMainTableView.m */, @@ -3183,6 +3188,7 @@ CE38FB82091D946900BCB69D /* BDSKCondition.h */, CE6DCA200D6A0237003A072F /* BDSKCondition+Scripting.h */, CE38FB84091D946A00BCB69D /* BDSKConditionController.h */, + CE78C4AF265E4ED200B4A54F /* BDSKConstraintTracker.h */, F9022C3A0758027800C3F701 /* BDSKConverter.h */, CE7A4A8C0B0B475B00D1B333 /* BDSKCustomCiteDrawerController.h */, F97198BF0DADD32F00CA57AA /* BDSKDBLPGroupServer.h */, @@ -3885,6 +3891,7 @@ CE2A09F6224599E100A8F31C /* BDSKFieldInfo.h in Headers */, CE2A0A6C22459A0A00A8F31C /* BDSKSeparatorCell.h in Headers */, CE2A0AD622459A4B00A8F31C /* NSNumber_BDSKExtensions.h in Headers */, + CE78C4B1265E4ED200B4A54F /* BDSKConstraintTracker.h in Headers */, CE2A0A2E224599EF00A8F31C /* BDSKMASParser.h in Headers */, CEA99968264EC52900AB2050 /* BDSKWrappingView.h in Headers */, ); @@ -4773,6 +4780,7 @@ CE0ECDAB0DE78619006EEDDB /* BDSKInspireParser.m in Sources */, CE3402750E014B3800A7FFE6 /* NSNumber_BDSKExtensions.m in Sources */, CE15419D2649753D001F1655 /* BDSKFormatTextField.m in Sources */, + CE78C4B2265E4ED200B4A54F /* BDSKConstraintTracker.m in Sources */, CEF9C0ED2172A378003EC426 /* BDSKSearchBookmark+Scripting.m in Sources */, F9C50D8B0EA3A2D6009FE098 /* BDSKTask.m in Sources */, CE7611530EA49B6E00301E45 /* NSPrintOperation_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 Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit