mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Use NSTextView subclass in find panel (close #363)
This commit is contained in:
parent
847c636154
commit
661387d0f5
@ -8,6 +8,9 @@ Change Log
|
||||
### Additions/Changes
|
||||
|
||||
- Change place to create backup files (Now, backup files are always created in `~/Library/Autosave Information/`).
|
||||
- Improve find panel:
|
||||
- Add scroll bars to the text fields.
|
||||
- Now, “Swap Yen and backslash keys” option is also applied to the fields in the find panel.
|
||||
- Add “Cyrillic (Windows)” to the encoding list.
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
<window identifier="findPanel" title="Find & Replace" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="findPanel" animationBehavior="default" id="Wal-Sg-6d6" userLabel="Find Panel" customClass="NSPanel">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" resizable="YES" utility="YES"/>
|
||||
<rect key="contentRect" x="167" y="107" width="540" height="380"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
<view key="contentView" id="VS9-oi-ter">
|
||||
<rect key="frame" x="0.0" y="0.0" width="540" height="380"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
@ -27,48 +27,89 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="540" height="148"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField verticalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="l7V-L6-eHO">
|
||||
<rect key="frame" x="72" y="30" width="448" height="44"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" state="on" borderStyle="bezel" placeholderString=" Replace" drawsBackground="YES" id="oVG-0K-H2V" customClass="CEFindTextFieldCell">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="qZS-yd-wpm" name="value" keyPath="replacementString" id="rCp-kT-O6b">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
|
||||
<string key="NSNullPlaceholder">Replace</string>
|
||||
<bool key="NSValidatesImmediately" value="YES"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
<outlet property="nextKeyView" destination="bcO-Vd-Pum" id="DSe-ru-2Pe"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="249" verticalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="bcO-Vd-Pum">
|
||||
<scrollView focusRingType="exterior" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hxw-DS-gxQ" userLabel="Find Scroll View">
|
||||
<rect key="frame" x="72" y="84" width="448" height="44"/>
|
||||
<clipView key="contentView" copiesOnScroll="NO" id="YCX-T1-drQ" customClass="CEFindPanelTextClipView">
|
||||
<rect key="frame" x="1" y="1" width="223" height="133"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView importsGraphics="NO" richText="NO" allowsUndo="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" id="fDB-No-De7" customClass="CEFindPanelTextView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="223" height="133"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<size key="minSize" width="446" height="42"/>
|
||||
<size key="maxSize" width="463" height="10000000"/>
|
||||
<color key="insertionPointColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<size key="minSize" width="446" height="42"/>
|
||||
<size key="maxSize" width="463" height="10000000"/>
|
||||
<connections>
|
||||
<binding destination="qZS-yd-wpm" name="value" keyPath="findString" id="oNs-q5-oCH">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
|
||||
<string key="NSNullPlaceholder">Find</string>
|
||||
<bool key="NSValidatesImmediately" value="YES"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
<outlet property="findPanelController" destination="qZS-yd-wpm" id="OWD-3g-T9c"/>
|
||||
<outlet property="nextKeyView" destination="0XH-tC-fau" id="nZE-Wv-9Ph"/>
|
||||
</connections>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</clipView>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="f9q-Ai-xTj"/>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="pES-RH-prG"/>
|
||||
</constraints>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" state="on" borderStyle="bezel" placeholderString=" Find" drawsBackground="YES" id="OdZ-gI-O2r" customClass="CEFindTextFieldCell">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<action selector="findNext:" target="qZS-yd-wpm" id="Rw0-sf-WVf"/>
|
||||
<binding destination="qZS-yd-wpm" name="value" keyPath="findString" id="KFJ-K2-zGh">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
|
||||
<string key="NSNullPlaceholder">Find</string>
|
||||
<bool key="NSValidatesImmediately" value="YES"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
<outlet property="nextKeyView" destination="l7V-L6-eHO" id="FTF-NT-nq7"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<scroller key="horizontalScroller" verticalHuggingPriority="750" doubleValue="1" controlSize="small" horizontal="YES" id="r5Z-he-d07">
|
||||
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="1" controlSize="small" horizontal="NO" id="UpI-hP-Ru9">
|
||||
<rect key="frame" x="224" y="1" width="15" height="133"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
<scrollView focusRingType="exterior" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qiQ-tb-XCa" userLabel="Replecement Scroll View">
|
||||
<rect key="frame" x="72" y="30" width="448" height="44"/>
|
||||
<clipView key="contentView" copiesOnScroll="NO" id="sC4-EU-bnm" customClass="CEFindPanelTextClipView">
|
||||
<rect key="frame" x="1" y="1" width="223" height="133"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView importsGraphics="NO" richText="NO" allowsUndo="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" id="0XH-tC-fau" customClass="CEFindPanelTextView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="223" height="133"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<size key="minSize" width="446" height="42"/>
|
||||
<size key="maxSize" width="463" height="10000000"/>
|
||||
<color key="insertionPointColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<size key="minSize" width="446" height="42"/>
|
||||
<size key="maxSize" width="463" height="10000000"/>
|
||||
<connections>
|
||||
<binding destination="qZS-yd-wpm" name="value" keyPath="replacementString" id="zd8-iN-ws4">
|
||||
<dictionary key="options">
|
||||
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
|
||||
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
|
||||
<string key="NSNullPlaceholder">Replace</string>
|
||||
<bool key="NSValidatesImmediately" value="YES"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
<outlet property="nextKeyView" destination="fDB-No-De7" id="Xrl-J9-oZh"/>
|
||||
</connections>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" verticalHuggingPriority="750" doubleValue="1" controlSize="small" horizontal="YES" id="DHo-wb-6CP">
|
||||
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="1" controlSize="small" horizontal="NO" id="kcQ-as-bev">
|
||||
<rect key="frame" x="224" y="1" width="15" height="133"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8My-G5-daT">
|
||||
<rect key="frame" x="69" y="7" width="125" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Regular Expression" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="brT-HP-GVL">
|
||||
@ -197,6 +238,24 @@
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="changeSyntax:" target="qZS-yd-wpm" id="F7y-5o-SvY"/>
|
||||
<menuItem title="Escape Character" indentationLevel="1" id="r68-46-LBY">
|
||||
<menu key="submenu" title="Escape Character" id="OVR-vE-lYb">
|
||||
<items>
|
||||
<menuItem title="\" id="jZU-Im-diP">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="changeEscapeCharacter:" target="qZS-yd-wpm" id="q6T-Wz-YU7"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="¥" id="sBj-Z6-qJG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="changeEscapeCharacter:" target="qZS-yd-wpm" id="Uep-ff-9Oe"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="POSIX Extended" tag="2" id="QfE-cX-d9h">
|
||||
@ -238,24 +297,6 @@
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Escape Character" indentationLevel="1" id="r68-46-LBY">
|
||||
<menu key="submenu" title="Escape Character" id="OVR-vE-lYb">
|
||||
<items>
|
||||
<menuItem title="\" id="jZU-Im-diP">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="changeEscapeCharacter:" target="qZS-yd-wpm" id="q6T-Wz-YU7"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="¥" id="sBj-Z6-qJG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="changeEscapeCharacter:" target="qZS-yd-wpm" id="Uep-ff-9Oe"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Single Line" tag="1" indentationLevel="1" id="UQ6-Up-xWI">
|
||||
<connections>
|
||||
<action selector="toggleOption:" target="qZS-yd-wpm" id="lGm-6L-ovY"/>
|
||||
@ -344,30 +385,29 @@
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="bcO-Vd-Pum" secondAttribute="trailing" constant="20" symbolic="YES" id="4xG-MF-G50"/>
|
||||
<constraint firstItem="gM0-RD-hIC" firstAttribute="leading" secondItem="l7V-L6-eHO" secondAttribute="leading" constant="-3" id="6wd-uq-QGG"/>
|
||||
<constraint firstItem="hxw-DS-gxQ" firstAttribute="leading" secondItem="EY8-gj-fQb" secondAttribute="trailing" constant="8" symbolic="YES" id="2Oh-vm-AAA"/>
|
||||
<constraint firstItem="8My-G5-daT" firstAttribute="leading" secondItem="hxw-DS-gxQ" secondAttribute="leading" id="2Px-Ls-3RC"/>
|
||||
<constraint firstItem="tu7-IT-dA3" firstAttribute="top" secondItem="qiQ-tb-XCa" secondAttribute="bottom" constant="8" symbolic="YES" id="3zE-iF-XlX"/>
|
||||
<constraint firstAttribute="trailing" secondItem="hxw-DS-gxQ" secondAttribute="trailing" constant="20" symbolic="YES" id="56k-C9-YpU"/>
|
||||
<constraint firstItem="hxw-DS-gxQ" firstAttribute="leading" secondItem="qiQ-tb-XCa" secondAttribute="leading" id="5cn-Lc-y98"/>
|
||||
<constraint firstItem="hxw-DS-gxQ" firstAttribute="top" secondItem="lkE-wj-Gi5" secondAttribute="top" constant="20" symbolic="YES" id="7Zc-gJ-cne"/>
|
||||
<constraint firstItem="GvT-tD-Cbk" firstAttribute="top" secondItem="qiQ-tb-XCa" secondAttribute="bottom" constant="8" symbolic="YES" id="7fX-EX-Etf"/>
|
||||
<constraint firstItem="8My-G5-daT" firstAttribute="centerY" secondItem="i2l-7Z-Zmf" secondAttribute="centerY" id="B6G-yH-N5A"/>
|
||||
<constraint firstAttribute="trailing" secondItem="l7V-L6-eHO" secondAttribute="trailing" constant="20" symbolic="YES" id="CwA-d9-ijx"/>
|
||||
<constraint firstItem="bcO-Vd-Pum" firstAttribute="leading" secondItem="l7V-L6-eHO" secondAttribute="leading" id="DCe-vg-reB"/>
|
||||
<constraint firstItem="tu7-IT-dA3" firstAttribute="top" secondItem="l7V-L6-eHO" secondAttribute="bottom" constant="8" symbolic="YES" id="Eu5-LL-cmi"/>
|
||||
<constraint firstItem="bcO-Vd-Pum" firstAttribute="height" secondItem="l7V-L6-eHO" secondAttribute="height" id="G8q-Mw-Dbl"/>
|
||||
<constraint firstItem="i2l-7Z-Zmf" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="tu7-IT-dA3" secondAttribute="trailing" constant="12" symbolic="YES" id="IKi-Zn-5pX"/>
|
||||
<constraint firstItem="EY8-gj-fQb" firstAttribute="leading" secondItem="lkE-wj-Gi5" secondAttribute="leading" constant="20" symbolic="YES" id="LOY-dv-dZe"/>
|
||||
<constraint firstItem="bcO-Vd-Pum" firstAttribute="top" secondItem="lkE-wj-Gi5" secondAttribute="top" constant="20" symbolic="YES" id="O7x-yh-1xh"/>
|
||||
<constraint firstAttribute="bottom" secondItem="8My-G5-daT" secondAttribute="bottom" constant="10" id="U9G-t3-7BQ"/>
|
||||
<constraint firstItem="8My-G5-daT" firstAttribute="top" secondItem="l7V-L6-eHO" secondAttribute="bottom" constant="8" symbolic="YES" id="Uye-P5-B73"/>
|
||||
<constraint firstItem="hxw-DS-gxQ" firstAttribute="height" secondItem="qiQ-tb-XCa" secondAttribute="height" id="U9g-2U-ALP"/>
|
||||
<constraint firstAttribute="trailing" secondItem="i2l-7Z-Zmf" secondAttribute="trailing" constant="20" symbolic="YES" id="WF4-HF-UDF"/>
|
||||
<constraint firstItem="ybT-sQ-Vn5" firstAttribute="top" secondItem="bcO-Vd-Pum" secondAttribute="top" constant="2" id="YXj-1y-SnG"/>
|
||||
<constraint firstItem="ybT-sQ-Vn5" firstAttribute="leading" secondItem="bcO-Vd-Pum" secondAttribute="leading" constant="-3" id="abB-r2-pGB"/>
|
||||
<constraint firstItem="bcO-Vd-Pum" firstAttribute="leading" secondItem="EY8-gj-fQb" secondAttribute="trailing" constant="8" symbolic="YES" id="fce-xA-WLu"/>
|
||||
<constraint firstItem="bcO-Vd-Pum" firstAttribute="leading" secondItem="l7V-L6-eHO" secondAttribute="leading" id="heF-YI-2bT"/>
|
||||
<constraint firstItem="GvT-tD-Cbk" firstAttribute="top" secondItem="l7V-L6-eHO" secondAttribute="bottom" constant="8" symbolic="YES" id="rFe-ch-03T"/>
|
||||
<constraint firstItem="gM0-RD-hIC" firstAttribute="top" secondItem="l7V-L6-eHO" secondAttribute="top" constant="2" id="rVe-3h-ueu"/>
|
||||
<constraint firstItem="hxw-DS-gxQ" firstAttribute="leading" secondItem="ybT-sQ-Vn5" secondAttribute="leading" constant="3" id="Ygo-iO-YvZ"/>
|
||||
<constraint firstItem="hxw-DS-gxQ" firstAttribute="top" secondItem="EY8-gj-fQb" secondAttribute="top" id="ZnD-4N-pni"/>
|
||||
<constraint firstItem="qiQ-tb-XCa" firstAttribute="leading" secondItem="gM0-RD-hIC" secondAttribute="leading" constant="3" id="duc-IJ-uJo"/>
|
||||
<constraint firstItem="qiQ-tb-XCa" firstAttribute="top" secondItem="gM0-RD-hIC" secondAttribute="top" constant="-2" id="kM3-sK-QkA"/>
|
||||
<constraint firstAttribute="trailing" secondItem="qiQ-tb-XCa" secondAttribute="trailing" constant="20" symbolic="YES" id="p4e-o4-Jfv"/>
|
||||
<constraint firstItem="8My-G5-daT" firstAttribute="top" secondItem="qiQ-tb-XCa" secondAttribute="bottom" constant="8" symbolic="YES" id="pMc-aZ-JfI"/>
|
||||
<constraint firstItem="tu7-IT-dA3" firstAttribute="leading" secondItem="GvT-tD-Cbk" secondAttribute="trailing" constant="8" symbolic="YES" id="riZ-4A-Sii"/>
|
||||
<constraint firstItem="hxw-DS-gxQ" firstAttribute="top" secondItem="ybT-sQ-Vn5" secondAttribute="top" constant="-2" id="tO8-50-o7G"/>
|
||||
<constraint firstItem="GvT-tD-Cbk" firstAttribute="leading" secondItem="8My-G5-daT" secondAttribute="trailing" constant="8" symbolic="YES" id="tbc-D3-uHU"/>
|
||||
<constraint firstItem="bcO-Vd-Pum" firstAttribute="leading" secondItem="8My-G5-daT" secondAttribute="leading" id="uec-Po-k7L"/>
|
||||
<constraint firstItem="bcO-Vd-Pum" firstAttribute="top" secondItem="EY8-gj-fQb" secondAttribute="top" id="vXe-3F-WGA"/>
|
||||
<constraint firstItem="l7V-L6-eHO" firstAttribute="top" secondItem="bcO-Vd-Pum" secondAttribute="bottom" constant="10" symbolic="YES" id="yh3-8x-L1W"/>
|
||||
<constraint firstItem="qiQ-tb-XCa" firstAttribute="top" secondItem="hxw-DS-gxQ" secondAttribute="bottom" constant="10" id="wWy-WI-ln7"/>
|
||||
</constraints>
|
||||
</customView>
|
||||
<customView id="CRP-NW-b9J" userLabel="Result View">
|
||||
@ -657,7 +697,7 @@
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="qZS-yd-wpm" id="ypw-qP-ztD"/>
|
||||
<outlet property="initialFirstResponder" destination="bcO-Vd-Pum" id="UOj-bz-AOm"/>
|
||||
<outlet property="initialFirstResponder" destination="fDB-No-De7" id="ADj-AL-xHX"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="261" y="-21"/>
|
||||
</window>
|
||||
|
@ -24,7 +24,6 @@
|
||||
25B2C24407FA68D100F4EFC7 /* CEBorderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 25B2C24207FA68D100F4EFC7 /* CEBorderView.m */; };
|
||||
25B2C24D07FA6BC400F4EFC7 /* CETextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 25B2C24B07FA6BC400F4EFC7 /* CETextView.m */; };
|
||||
2A009ACB1A57BA8B00C3D542 /* CETextFinder.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A009ACA1A57BA8B00C3D542 /* CETextFinder.m */; };
|
||||
2A009ACE1A587B3100C3D542 /* CEFindTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A009ACD1A587B3100C3D542 /* CEFindTextFieldCell.m */; };
|
||||
2A009AD11A58ED1D00C3D542 /* CEFindResultViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A009AD01A58ED1D00C3D542 /* CEFindResultViewController.m */; };
|
||||
2A009ADA1A5AAE8000C3D542 /* CEFindPanelSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A009AD91A5AAE8000C3D542 /* CEFindPanelSplitView.m */; };
|
||||
2A07202B18E0E1C2006F3A43 /* CEPrintPanelAccessoryController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A07202A18E0E1C2006F3A43 /* CEPrintPanelAccessoryController.m */; };
|
||||
@ -123,6 +122,8 @@
|
||||
2AD318C31A462C30001B8112 /* CEIntegrationPaneController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD318C21A462C30001B8112 /* CEIntegrationPaneController.m */; };
|
||||
2AD4599B19DDCF6600A20FBB /* CEScriptMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD4599A19DDCF6600A20FBB /* CEScriptMenuItem.m */; };
|
||||
2AD5322A19779FD000A925CA /* CELineHeightTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD5322919779FD000A925CA /* CELineHeightTransformer.m */; };
|
||||
2AD67C241AA7285F0078BB95 /* CEFindPanelTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD67C231AA7285F0078BB95 /* CEFindPanelTextView.m */; };
|
||||
2AD67C2A1AA75E7F0078BB95 /* CEFindPanelTextClipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD67C291AA75E7F0078BB95 /* CEFindPanelTextClipView.m */; };
|
||||
2AD84CAA1966314100DE49BD /* CEODBEventSender.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD84CA91966314100DE49BD /* CEODBEventSender.m */; };
|
||||
2AE2E9D519D2CF00000D66A9 /* CEEncodingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AE2E9D419D2CF00000D66A9 /* CEEncodingManager.m */; };
|
||||
2AE356461A86D32500E29FEF /* CEClipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AE356451A86D32500E29FEF /* CEClipView.m */; };
|
||||
@ -246,8 +247,6 @@
|
||||
25B2C24B07FA6BC400F4EFC7 /* CETextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CETextView.m; sourceTree = "<group>"; };
|
||||
2A009AC91A57BA8B00C3D542 /* CETextFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CETextFinder.h; sourceTree = "<group>"; };
|
||||
2A009ACA1A57BA8B00C3D542 /* CETextFinder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CETextFinder.m; sourceTree = "<group>"; };
|
||||
2A009ACC1A587B3100C3D542 /* CEFindTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEFindTextFieldCell.h; sourceTree = "<group>"; };
|
||||
2A009ACD1A587B3100C3D542 /* CEFindTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEFindTextFieldCell.m; sourceTree = "<group>"; };
|
||||
2A009ACF1A58ED1D00C3D542 /* CEFindResultViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEFindResultViewController.h; sourceTree = "<group>"; };
|
||||
2A009AD01A58ED1D00C3D542 /* CEFindResultViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEFindResultViewController.m; sourceTree = "<group>"; };
|
||||
2A009AD81A5AAE7F00C3D542 /* CEFindPanelSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEFindPanelSplitView.h; sourceTree = "<group>"; };
|
||||
@ -484,6 +483,10 @@
|
||||
2AD488721A085D8B00B795CB /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/SyntaxEditSheet.strings; sourceTree = "<group>"; };
|
||||
2AD5322819779FD000A925CA /* CELineHeightTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CELineHeightTransformer.h; sourceTree = "<group>"; };
|
||||
2AD5322919779FD000A925CA /* CELineHeightTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CELineHeightTransformer.m; sourceTree = "<group>"; };
|
||||
2AD67C221AA7285F0078BB95 /* CEFindPanelTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEFindPanelTextView.h; sourceTree = "<group>"; };
|
||||
2AD67C231AA7285F0078BB95 /* CEFindPanelTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEFindPanelTextView.m; sourceTree = "<group>"; };
|
||||
2AD67C281AA75E7F0078BB95 /* CEFindPanelTextClipView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEFindPanelTextClipView.h; sourceTree = "<group>"; };
|
||||
2AD67C291AA75E7F0078BB95 /* CEFindPanelTextClipView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEFindPanelTextClipView.m; sourceTree = "<group>"; };
|
||||
2AD84CA81966314100DE49BD /* CEODBEventSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEODBEventSender.h; sourceTree = "<group>"; };
|
||||
2AD84CA91966314100DE49BD /* CEODBEventSender.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEODBEventSender.m; sourceTree = "<group>"; };
|
||||
2AE2E9D319D2CF00000D66A9 /* CEEncodingManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEEncodingManager.h; sourceTree = "<group>"; };
|
||||
@ -605,8 +608,8 @@
|
||||
children = (
|
||||
2A009AD81A5AAE7F00C3D542 /* CEFindPanelSplitView.h */,
|
||||
2A009AD91A5AAE8000C3D542 /* CEFindPanelSplitView.m */,
|
||||
2A009ACC1A587B3100C3D542 /* CEFindTextFieldCell.h */,
|
||||
2A009ACD1A587B3100C3D542 /* CEFindTextFieldCell.m */,
|
||||
2AD67C281AA75E7F0078BB95 /* CEFindPanelTextClipView.h */,
|
||||
2AD67C291AA75E7F0078BB95 /* CEFindPanelTextClipView.m */,
|
||||
);
|
||||
name = Views;
|
||||
sourceTree = "<group>";
|
||||
@ -1038,6 +1041,8 @@
|
||||
2A7CF2421A5747EC00D09249 /* CEFindPanelController.m */,
|
||||
2A009ACF1A58ED1D00C3D542 /* CEFindResultViewController.h */,
|
||||
2A009AD01A58ED1D00C3D542 /* CEFindResultViewController.m */,
|
||||
2AD67C221AA7285F0078BB95 /* CEFindPanelTextView.h */,
|
||||
2AD67C231AA7285F0078BB95 /* CEFindPanelTextView.m */,
|
||||
2A009ADB1A5AB96F00C3D542 /* Views */,
|
||||
);
|
||||
name = "Text Finder";
|
||||
@ -1413,6 +1418,7 @@
|
||||
8CB0122E07CA0EFA00221EDC /* CEToolbarController.m in Sources */,
|
||||
258D708A07D456DF0062A3E5 /* CETextSelection.m in Sources */,
|
||||
8CC1925707E2D84500B54AE4 /* CEDocument+ScriptingSupport.m in Sources */,
|
||||
2AD67C241AA7285F0078BB95 /* CEFindPanelTextView.m in Sources */,
|
||||
2A63122E19C2D30C0088C5C6 /* CEThemeViewController.m in Sources */,
|
||||
8CC1961D07E2E54E00B54AE4 /* CEScriptManager.m in Sources */,
|
||||
2AACC9591942A82900E3FF63 /* CEIndicatorSheetController.m in Sources */,
|
||||
@ -1430,10 +1436,10 @@
|
||||
2A07202B18E0E1C2006F3A43 /* CEPrintPanelAccessoryController.m in Sources */,
|
||||
2A3A759419E77D66001DAB88 /* CEMigrationWindowController.m in Sources */,
|
||||
2A51793A1A40A3B500A3F852 /* CEShortcutKeyField.m in Sources */,
|
||||
2AD67C2A1AA75E7F0078BB95 /* CEFindPanelTextClipView.m in Sources */,
|
||||
2A7846DE18FE0C0C006BDF00 /* CETheme.m in Sources */,
|
||||
2A68F93818FB04F400673440 /* CEMenuItemCell.m in Sources */,
|
||||
2AB432711912AF7200835004 /* CEGlyphPopoverController.m in Sources */,
|
||||
2A009ACE1A587B3100C3D542 /* CEFindTextFieldCell.m in Sources */,
|
||||
2AE356461A86D32500E29FEF /* CEClipView.m in Sources */,
|
||||
2AFFB71B18D7F18300118477 /* CEGoToSheetController.m in Sources */,
|
||||
2A3FB2AD18ECEFF200D9CB2C /* CESyntaxEditSheetController.m in Sources */,
|
||||
|
35
CotEditor/Sources/CEFindPanelTextClipView.h
Normal file
35
CotEditor/Sources/CEFindPanelTextClipView.h
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
==============================================================================
|
||||
CEFindPanelTextClipView
|
||||
|
||||
CotEditor
|
||||
http://coteditor.com
|
||||
|
||||
Created on 2015-03-05 by 1024jp
|
||||
encoding="UTF-8"
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
© 2015 1024jp
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 2 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
@import Cocoa;
|
||||
|
||||
|
||||
@interface CEFindPanelTextClipView : NSClipView
|
||||
|
||||
@end
|
@ -1,11 +1,11 @@
|
||||
/*
|
||||
==============================================================================
|
||||
CEFindTextFieldCell
|
||||
CEFindPanelTextClipView
|
||||
|
||||
CotEditor
|
||||
http://coteditor.com
|
||||
|
||||
Created on 2015-01-03 by 1024jp
|
||||
Created on 2015-03-05 by 1024jp
|
||||
encoding="UTF-8"
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
@ -27,24 +27,24 @@
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#import "CEFindTextFieldCell.h"
|
||||
#import "CEFindPanelTextClipView.h"
|
||||
|
||||
|
||||
@implementation CEFindTextFieldCell
|
||||
@implementation CEFindPanelTextClipView
|
||||
|
||||
#pragma mark Superclass Methods
|
||||
|
||||
// ------------------------------------------------------
|
||||
/// add left padding for history popup
|
||||
- (NSRect)drawingRectForBounds:(NSRect)theRect
|
||||
/// add left padding for popup button
|
||||
- (void)setFrame:(NSRect)frame
|
||||
// ------------------------------------------------------
|
||||
{
|
||||
const CGFloat padding = 28;
|
||||
const CGFloat padding = 28.0;
|
||||
|
||||
theRect.size.width -= padding;
|
||||
theRect.origin.x += padding;
|
||||
frame.origin.x += padding;
|
||||
frame.size.width -= padding;
|
||||
|
||||
return [super drawingRectForBounds:theRect];
|
||||
[super setFrame:frame];
|
||||
}
|
||||
|
||||
@end
|
@ -1,11 +1,11 @@
|
||||
/*
|
||||
==============================================================================
|
||||
CEFindTextFieldCell
|
||||
CEFindPanelTextView
|
||||
|
||||
CotEditor
|
||||
http://coteditor.com
|
||||
|
||||
Created on 2015-01-03 by 1024jp
|
||||
Created on 2015-03-04 by 1024jp
|
||||
encoding="UTF-8"
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
@ -30,6 +30,6 @@
|
||||
@import Cocoa;
|
||||
|
||||
|
||||
@interface CEFindTextFieldCell : NSTextFieldCell
|
||||
@interface CEFindPanelTextView : NSTextView
|
||||
|
||||
@end
|
138
CotEditor/Sources/CEFindPanelTextView.m
Normal file
138
CotEditor/Sources/CEFindPanelTextView.m
Normal file
@ -0,0 +1,138 @@
|
||||
/*
|
||||
==============================================================================
|
||||
CEFindPanelTextView
|
||||
|
||||
CotEditor
|
||||
http://coteditor.com
|
||||
|
||||
Created on 2015-03-04 by 1024jp
|
||||
encoding="UTF-8"
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
© 2015 1024jp
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 2 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#import "CEFindPanelTextView.h"
|
||||
#import "CEFindPanelController.h"
|
||||
#import "constants.h"
|
||||
|
||||
|
||||
@interface CEFindPanelTextView ()
|
||||
|
||||
@property (nonatomic) IBOutlet CEFindPanelController *findPanelController;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@implementation CEFindPanelTextView
|
||||
|
||||
#pragma mark Superclass Methods
|
||||
|
||||
// ------------------------------------------------------
|
||||
/// initialize instance
|
||||
- (instancetype)initWithCoder:(NSCoder *)coder
|
||||
// ------------------------------------------------------
|
||||
{
|
||||
self = [super initWithCoder:coder];
|
||||
if (self) {
|
||||
// set system font (standard NSTextField behavior)
|
||||
NSFont *font = [NSFont systemFontOfSize:[NSFont systemFontSize]];
|
||||
[self setFont:font];
|
||||
|
||||
// set inset a bit like NSTextField (horizontal inset is added in CEFindPanelTextClipView)
|
||||
[self setTextContainerInset:NSMakeSize(0.0, 2.0)];
|
||||
|
||||
// avoid wrapping
|
||||
[[self textContainer] setWidthTracksTextView:NO];
|
||||
[[self textContainer] setContainerSize:NSMakeSize(CGFLOAT_MAX, CGFLOAT_MAX)];
|
||||
[self setHorizontallyResizable:YES];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------
|
||||
/// view is on focus
|
||||
- (BOOL)becomeFirstResponder
|
||||
// ------------------------------------------------------
|
||||
{
|
||||
// select whole string on focus (standard NSTextField behavior)
|
||||
[self setSelectedRange:NSMakeRange(0, [[self string] length])];
|
||||
|
||||
return [super becomeFirstResponder];
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------
|
||||
/// view dismiss focus
|
||||
- (BOOL)resignFirstResponder
|
||||
// ------------------------------------------------------
|
||||
{
|
||||
// clear current selection (standard NSTextField behavior)
|
||||
[self setSelectedRange:NSMakeRange(0, 0)];
|
||||
return [super resignFirstResponder];
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------
|
||||
/// swap '¥' with '\' if needed
|
||||
- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange
|
||||
// ------------------------------------------------------
|
||||
{
|
||||
NSString *string = ([aString isKindOfClass:[NSAttributedString class]]) ? [aString string] : aString;
|
||||
|
||||
// swap '¥' with '\' if needed
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:CEDefaultSwapYenAndBackSlashKey] && ([string length] == 1)) {
|
||||
NSString *yen = [NSString stringWithCharacters:&kYenMark length:1];
|
||||
|
||||
if ([string isEqualToString:@"\\"]) {
|
||||
string = yen;
|
||||
} else if ([string isEqualToString:yen]) {
|
||||
string = @"\\";
|
||||
}
|
||||
}
|
||||
|
||||
[super insertText:string replacementRange:replacementRange];
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------
|
||||
/// jump to the next responder with tab key (standard NSTextField behavior)
|
||||
- (void)insertTab:(id)sender
|
||||
// ------------------------------------------------------
|
||||
{
|
||||
[[self window] makeFirstResponder:[self nextKeyView]];
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------
|
||||
/// perform Find Next with return
|
||||
- (void)insertNewline:(id)sender
|
||||
// ------------------------------------------------------
|
||||
{
|
||||
// -> do nothing if no findpanelController is connected (standard NSTextField behavior)
|
||||
if ([self findPanelController]) {
|
||||
[[self findPanelController] findNext:self];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
@ -15,10 +15,10 @@
|
||||
/* Class = "NSPanel"; title = "Find & Replace"; ObjectID = "Wal-Sg-6d6"; */
|
||||
"Wal-Sg-6d6.title" = "検索と置換";
|
||||
|
||||
/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Find"; ObjectID = "KFJ-K2-zGh"; */
|
||||
"KFJ-K2-zGh.ibShadowedIsNilPlaceholder" = "検索";
|
||||
/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Replace"; ObjectID = "rCp-kT-O6b"; */
|
||||
"rCp-kT-O6b.ibShadowedIsNilPlaceholder" = "置換";
|
||||
/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Find"; ObjectID = "oNs-q5-oCH"; */
|
||||
"oNs-q5-oCH.ibShadowedIsNilPlaceholder" = "検索";
|
||||
/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Replace"; ObjectID = "zd8-iN-ws4"; */
|
||||
"zd8-iN-ws4.ibShadowedIsNilPlaceholder" = "置換";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Regular Expression"; ObjectID = "brT-HP-GVL"; */
|
||||
"brT-HP-GVL.title" = "正規表現";
|
||||
|
@ -16,10 +16,10 @@
|
||||
/* Class = "NSPanel"; title = "Find & Replace"; ObjectID = "Wal-Sg-6d6"; */
|
||||
"Wal-Sg-6d6.title" = "查找 & 替换";
|
||||
|
||||
/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Find"; ObjectID = "KFJ-K2-zGh"; */
|
||||
"KFJ-K2-zGh.ibShadowedIsNilPlaceholder" = "查找";
|
||||
/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Replace"; ObjectID = "rCp-kT-O6b"; */
|
||||
"rCp-kT-O6b.ibShadowedIsNilPlaceholder" = "替换";
|
||||
/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Find"; ObjectID = "oNs-q5-oCH"; */
|
||||
"oNs-q5-oCH.ibShadowedIsNilPlaceholder" = "查找";
|
||||
/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Replace"; ObjectID = "zd8-iN-ws4"; */
|
||||
"zd8-iN-ws4.ibShadowedIsNilPlaceholder" = "替换";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Regular Expression"; ObjectID = "brT-HP-GVL"; */
|
||||
"brT-HP-GVL.title" = "正则表达式";
|
||||
|
Loading…
Reference in New Issue
Block a user