Permalink
Browse files

Adding toolbar support for code sections.

  • Loading branch information...
Jan Weiß
Jan Weiß committed Aug 31, 2012
1 parent 63f5a1f commit df917df6a365985caab2b10fe9d6cb19555a7e44
Showing with 87 additions and 1 deletion.
  1. +81 −1 English.lproj/MyDocument.xib
  2. +1 −0 MyDocument.h
  3. +5 −0 MyDocument.m
@@ -286,6 +286,51 @@
<bool key="NSToolbarIsUserRemovable">YES</bool>
<int key="NSToolbarItemVisibilityPriority">0</int>
</object>
+ <object class="NSToolbarItem" key="51A0DA9C-15A1-4394-8CA4-678AA234CD4B" id="498818140">
+ <object class="NSMutableString" key="NSToolbarItemIdentifier">
+ <characters key="NS.bytes">51A0DA9C-15A1-4394-8CA4-678AA234CD4B</characters>
+ </object>
+ <string key="NSToolbarItemLabel">Code</string>
+ <string key="NSToolbarItemPaletteLabel">Code</string>
+ <nil key="NSToolbarItemToolTip"/>
+ <object class="NSButton" key="NSToolbarItemView" id="921590949">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{4, 14}, {27, 25}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <string key="NSReuseIdentifierKey">_NS:3196</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="475486488">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">C</string>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">Courier</string>
+ <double key="NSSize">13</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <string key="NSCellIdentifier">_NS:3196</string>
+ <reference key="NSControlView" ref="921590949"/>
+ <int key="NSButtonFlags">-2038152961</int>
+ <int key="NSButtonFlags2">163</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ </object>
+ <nil key="NSToolbarItemImage"/>
+ <nil key="NSToolbarItemTarget"/>
+ <nil key="NSToolbarItemAction"/>
+ <string key="NSToolbarItemMinSize">{27, 25}</string>
+ <string key="NSToolbarItemMaxSize">{27, 25}</string>
+ <bool key="NSToolbarItemEnabled">YES</bool>
+ <bool key="NSToolbarItemAutovalidates">YES</bool>
+ <int key="NSToolbarItemTag">0</int>
+ <bool key="NSToolbarIsUserRemovable">YES</bool>
+ <int key="NSToolbarItemVisibilityPriority">0</int>
+ </object>
<object class="NSToolbarItem" key="7294EEE5-5683-474F-BDF0-DDE6D9CB9160" id="506851974">
<object class="NSMutableString" key="NSToolbarItemIdentifier">
<characters key="NS.bytes">7294EEE5-5683-474F-BDF0-DDE6D9CB9160</characters>
@@ -485,6 +530,7 @@
<reference ref="733612615"/>
<reference ref="697314889"/>
<reference ref="292750228"/>
+ <reference ref="498818140"/>
<reference ref="506851974"/>
<reference ref="465090285"/>
<reference ref="589767847"/>
@@ -498,6 +544,7 @@
<reference ref="733612615"/>
<reference ref="697314889"/>
<reference ref="292750228"/>
+ <reference ref="498818140"/>
<reference ref="962119405"/>
<reference ref="506851974"/>
<reference ref="465090285"/>
@@ -836,6 +883,14 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
</object>
<int key="connectionID">100119</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">codeSection:</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="921590949"/>
+ </object>
+ <int key="connectionID">100124</int>
+ </object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
@@ -966,6 +1021,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
<reference ref="375349958"/>
<reference ref="168111067"/>
<reference ref="292750228"/>
+ <reference ref="498818140"/>
</array>
<reference key="parent" ref="275939982"/>
<string key="objectName">Toolbar</string>
@@ -1153,6 +1209,27 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
<reference key="object" ref="925117237"/>
<reference key="parent" ref="307263606"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100120</int>
+ <reference key="object" ref="498818140"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="921590949"/>
+ </array>
+ <reference key="parent" ref="855952761"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100121</int>
+ <reference key="object" ref="921590949"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="475486488"/>
+ </array>
+ <reference key="parent" ref="498818140"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100122</int>
+ <reference key="object" ref="475486488"/>
+ <reference key="parent" ref="921590949"/>
+ </object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -1196,6 +1273,9 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
<string key="100115.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="100116.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="100117.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="100120.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="100121.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="100122.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="5.IBWindowTemplateEditedContentRect">{{597, 57}, {769, 667}}</string>
<boolean value="NO" key="5.NSWindowTemplate.visibleAtLaunch"/>
@@ -1205,7 +1285,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">100119</int>
+ <int key="maxID">100124</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
View
@@ -34,6 +34,7 @@
- (IBAction)header2:(id)sender;
- (IBAction)header3:(id)sender;
- (IBAction)blockQuote:(id)sender;
+- (IBAction)codeSection:(id)sender;
- (IBAction)unorderedList:(id)sender;
- (IBAction)numberedList:(id)sender;
View
@@ -431,6 +431,11 @@ - (IBAction)blockQuote:(id)sender
[self _addStringBeforeSelectedLines:@"> "];
}
+- (IBAction)codeSection:(id)sender
+{
+ [self _addStringBeforeSelectedLines:@" "];
+}
+
- (IBAction)unorderedList:(id)sender
{
[self _addStringBeforeSelectedLines:@"* "];

0 comments on commit df917df

Please sign in to comment.