Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "#29 - Add global options to further window/panel support"

This reverts commit f4fe3a9.
  • Loading branch information...
commit 147e20c1532ded61aa4610b538decc5b724ba65d 1 parent ee9bc0f
Mark Carver markcarver authored
2  Configurations/Config.xcconfig
View
@@ -2,7 +2,7 @@
PREBINDING = NO
ZERO_LINK = NO
-SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.7.sdk
+SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk
MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.4
MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5
MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.4
759 Resources/en-US.lproj/Textbox.xib
View
@@ -0,0 +1,759 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1070</int>
+ <string key="IBDocument.SystemVersion">11C74</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1938</string>
+ <string key="IBDocument.AppKitVersion">1138.23</string>
+ <string key="IBDocument.HIToolboxVersion">567.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="NS.object.0">1938</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>NSScroller</string>
+ <string>NSButton</string>
+ <string>NSScrollView</string>
+ <string>NSTextFieldCell</string>
+ <string>NSImageView</string>
+ <string>NSButtonCell</string>
+ <string>NSImageCell</string>
+ <string>NSCustomObject</string>
+ <string>NSTextView</string>
+ <string>NSView</string>
+ <string>NSWindowTemplate</string>
+ <string>NSTextField</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="157887034">
+ <object class="NSCustomObject" id="295017903">
+ <string key="NSClassName">CDTextboxControl</string>
+ </object>
+ <object class="NSCustomObject" id="385592680">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="566852106">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSWindowTemplate" id="346836699">
+ <int key="NSWindowStyleMask">13</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{224, 353}, {400, 450}}</string>
+ <int key="NSWTFlags">1886912512</int>
+ <string key="NSWindowTitle">Panel</string>
+ <string key="NSWindowClass">NSPanel</string>
+ <object class="NSMutableString" key="NSViewClass">
+ <characters key="NS.bytes">View</characters>
+ </object>
+ <nil key="NSUserInterfaceItemIdentifier"/>
+ <string key="NSWindowContentMinSize">{200, 100}</string>
+ <object class="NSView" key="NSWindowView" id="892073455">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="NSImageView" id="176067980">
+ <reference key="NSNextResponder" ref="892073455"/>
+ <int key="NSvFlags">268</int>
+ <set class="NSMutableSet" key="NSDragTypes">
+ <string>Apple PDF pasteboard type</string>
+ <string>Apple PICT pasteboard type</string>
+ <string>Apple PNG pasteboard type</string>
+ <string>NSFilenamesPboardType</string>
+ <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
+ <string>NeXT TIFF v4.0 pasteboard type</string>
+ </set>
+ <string key="NSFrame">{{20, 382}, {48, 48}}</string>
+ <reference key="NSSuperview" ref="892073455"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="188151597"/>
+ <string key="NSReuseIdentifierKey">_NS:2141</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSImageCell" key="NSCell" id="936659409">
+ <int key="NSCellFlags">130560</int>
+ <int key="NSCellFlags2">33554432</int>
+ <string key="NSCellIdentifier">_NS:2141</string>
+ <int key="NSAlign">2</int>
+ <int key="NSScale">2</int>
+ <int key="NSStyle">0</int>
+ <bool key="NSAnimates">NO</bool>
+ </object>
+ <bool key="NSEditable">YES</bool>
+ </object>
+ <object class="NSTextField" id="188151597">
+ <reference key="NSNextResponder" ref="892073455"/>
+ <int key="NSvFlags">266</int>
+ <string key="NSFrame">{{77, 416}, {306, 14}}</string>
+ <reference key="NSSuperview" ref="892073455"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="127451908"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="560981705">
+ <int key="NSCellFlags">69336577</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">Small System Font Text</string>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">11</double>
+ <int key="NSfFlags">3100</int>
+ </object>
+ <reference key="NSControlView" ref="188151597"/>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlColor</string>
+ <object class="NSColor" key="NSColor" id="323634808">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlTextColor</string>
+ <object class="NSColor" key="NSColor" id="530497912">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSScrollView" id="127451908">
+ <reference key="NSNextResponder" ref="892073455"/>
+ <int key="NSvFlags">274</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="NSClipView" id="75042322">
+ <reference key="NSNextResponder" ref="127451908"/>
+ <int key="NSvFlags">2304</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="NSTextView" id="34913011">
+ <reference key="NSNextResponder" ref="75042322"/>
+ <int key="NSvFlags">2322</int>
+ <string key="NSFrameSize">{296, 14}</string>
+ <reference key="NSSuperview" ref="75042322"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="249985030"/>
+ <object class="NSTextContainer" key="NSTextContainer" id="720781868">
+ <object class="NSLayoutManager" key="NSLayoutManager">
+ <object class="NSTextStorage" key="NSTextStorage">
+ <object class="NSMutableString" key="NSString">
+ <characters key="NS.bytes"/>
+ </object>
+ <nil key="NSDelegate"/>
+ </object>
+ <array class="NSMutableArray" key="NSTextContainers">
+ <reference ref="720781868"/>
+ </array>
+ <int key="NSLMFlags">6</int>
+ <nil key="NSDelegate"/>
+ </object>
+ <reference key="NSTextView" ref="34913011"/>
+ <double key="NSWidth">296</double>
+ <int key="NSTCFlags">1</int>
+ </object>
+ <object class="NSTextViewSharedData" key="NSSharedData">
+ <int key="NSFlags">67120997</int>
+ <int key="NSTextCheckingTypes">0</int>
+ <nil key="NSMarkedAttributes"/>
+ <object class="NSColor" key="NSBackgroundColor" id="842879580">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <dictionary key="NSSelectedAttributes">
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">selectedTextBackgroundColor</string>
+ <reference key="NSColor" ref="323634808"/>
+ </object>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">selectedTextColor</string>
+ <reference key="NSColor" ref="530497912"/>
+ </object>
+ </dictionary>
+ <reference key="NSInsertionColor" ref="530497912"/>
+ <dictionary key="NSLinkAttributes">
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDEAA</bytes>
+ </object>
+ <integer value="1" key="NSUnderline"/>
+ </dictionary>
+ <nil key="NSDefaultParagraphStyle"/>
+ <nil key="NSTextFinder"/>
+ <int key="NSPreferredTextFinderStyle">1</int>
+ </object>
+ <int key="NSTVFlags">6</int>
+ <string key="NSMaxSize">{390, 10000000}</string>
+ <string key="NSMinize">{114, 0}</string>
+ <nil key="NSDelegate"/>
+ </object>
+ </array>
+ <string key="NSFrame">{{1, 1}, {298, 346}}</string>
+ <reference key="NSSuperview" ref="127451908"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="34913011"/>
+ <reference key="NSDocView" ref="34913011"/>
+ <reference key="NSBGColor" ref="842879580"/>
+ <object class="NSCursor" key="NSCursor">
+ <string key="NSHotSpot">{4, 5}</string>
+ <object class="NSImage" key="NSImage">
+ <int key="NSImageFlags">12582912</int>
+ <array class="NSMutableArray" key="NSReps">
+ <array>
+ <integer value="0"/>
+ <object class="NSBitmapImageRep">
+ <object class="NSData" key="NSTIFFRepresentation">
+ <bytes key="NS.bytes">TU0AKgAAAHCAFUqgBVKsAAAAwdVQUqwaEQeIRGJRGFlYqwWLQ+JxuOQpVRmEx2RROKwOQyOUQSPyaUym
+SxqWyKXyeYxyZzWbSuJTScRCbz2Nz+gRKhUOfTqeUai0OSxiWTiBQSHSGFquGwekxyAgAAAOAQAAAwAA
+AAEAEAAAAQEAAwAAAAEAEAAAAQIAAwAAAAIACAAIAQMAAwAAAAEABQAAAQYAAwAAAAEAAQAAAREABAAA
+AAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEAAgAAARYAAwAAAAEAEAAAARcABAAAAAEAAABnARwAAwAA
+AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
+ </object>
+ </object>
+ </array>
+ </array>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MCAwAA</bytes>
+ </object>
+ </object>
+ </object>
+ <int key="NScvFlags">4</int>
+ </object>
+ <object class="NSScroller" id="502970651">
+ <reference key="NSNextResponder" ref="127451908"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{-30, 1}, {15, 315}}</string>
+ <reference key="NSSuperview" ref="127451908"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="75042322"/>
+ <reference key="NSTarget" ref="127451908"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSCurValue">1</double>
+ </object>
+ <object class="NSScroller" id="249985030">
+ <reference key="NSNextResponder" ref="127451908"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{-100, -100}, {87, 18}}</string>
+ <reference key="NSSuperview" ref="127451908"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="502970651"/>
+ <int key="NSsFlags">1</int>
+ <reference key="NSTarget" ref="127451908"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSCurValue">1</double>
+ <double key="NSPercent">0.94565218687057495</double>
+ </object>
+ </array>
+ <string key="NSFrame">{{80, 60}, {300, 348}}</string>
+ <reference key="NSSuperview" ref="892073455"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="75042322"/>
+ <int key="NSsFlags">133650</int>
+ <reference key="NSVScroller" ref="502970651"/>
+ <reference key="NSHScroller" ref="249985030"/>
+ <reference key="NSContentView" ref="75042322"/>
+ </object>
+ <object class="NSButton" id="923120149">
+ <reference key="NSNextResponder" ref="892073455"/>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{308, 12}, {78, 32}}</string>
+ <reference key="NSSuperview" ref="892073455"/>
+ <reference key="NSWindow"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="174093312">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">1</string>
+ <object class="NSFont" key="NSSupport" id="814415447">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">13</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="923120149"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="814415447"/>
+ <string key="NSAlternateContents"/>
+ <string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="779635846">
+ <reference key="NSNextResponder" ref="892073455"/>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{230, 12}, {78, 32}}</string>
+ <reference key="NSSuperview" ref="892073455"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="923120149"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="766787080">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">2</string>
+ <reference key="NSSupport" ref="814415447"/>
+ <reference key="NSControlView" ref="779635846"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="814415447"/>
+ <string key="NSAlternateContents"/>
+ <string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="449231231">
+ <reference key="NSNextResponder" ref="892073455"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{14, 12}, {78, 32}}</string>
+ <reference key="NSSuperview" ref="892073455"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="779635846"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="288774339">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">3</string>
+ <reference key="NSSupport" ref="814415447"/>
+ <reference key="NSControlView" ref="449231231"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="814415447"/>
+ <string key="NSAlternateContents"/>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </array>
+ <string key="NSFrameSize">{400, 450}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="176067980"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {2560, 1440}}</string>
+ <string key="NSMinSize">{200, 122}</string>
+ <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
+ <int key="NSWindowAnimationBehavior">3</int>
+ <bool key="NSWindowIsRestorable">YES</bool>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">button2</string>
+ <reference key="source" ref="295017903"/>
+ <reference key="destination" ref="779635846"/>
+ </object>
+ <int key="connectionID">15</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">button1</string>
+ <reference key="source" ref="295017903"/>
+ <reference key="destination" ref="923120149"/>
+ </object>
+ <int key="connectionID">17</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">textView</string>
+ <reference key="source" ref="295017903"/>
+ <reference key="destination" ref="34913011"/>
+ </object>
+ <int key="connectionID">18</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">button3Pressed:</string>
+ <reference key="source" ref="295017903"/>
+ <reference key="destination" ref="449231231"/>
+ </object>
+ <int key="connectionID">19</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">button1Pressed:</string>
+ <reference key="source" ref="295017903"/>
+ <reference key="destination" ref="923120149"/>
+ </object>
+ <int key="connectionID">21</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">button3</string>
+ <reference key="source" ref="295017903"/>
+ <reference key="destination" ref="449231231"/>
+ </object>
+ <int key="connectionID">107</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">expandingLabel</string>
+ <reference key="source" ref="295017903"/>
+ <reference key="destination" ref="188151597"/>
+ </object>
+ <int key="connectionID">110</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">scrollView</string>
+ <reference key="source" ref="295017903"/>
+ <reference key="destination" ref="127451908"/>
+ </object>
+ <int key="connectionID">118</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">button2Pressed:</string>
+ <reference key="source" ref="295017903"/>
+ <reference key="destination" ref="779635846"/>
+ </object>
+ <int key="connectionID">120</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">controlIcon</string>
+ <reference key="source" ref="295017903"/>
+ <reference key="destination" ref="176067980"/>
+ </object>
+ <int key="connectionID">126</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">controlPanel</string>
+ <reference key="source" ref="295017903"/>
+ <reference key="destination" ref="346836699"/>
+ </object>
+ <int key="connectionID">127</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="346836699"/>
+ <reference key="destination" ref="295017903"/>
+ </object>
+ <int key="connectionID">108</int>
+ </object>
+ </array>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <array key="orderedObjects">
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <array key="object" id="0"/>
+ <reference key="children" ref="157887034"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="295017903"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="385592680"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="346836699"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="892073455"/>
+ </array>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Panel</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="892073455"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="188151597"/>
+ <reference ref="127451908"/>
+ <reference ref="923120149"/>
+ <reference ref="779635846"/>
+ <reference ref="449231231"/>
+ <reference ref="176067980"/>
+ </array>
+ <reference key="parent" ref="346836699"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">8</int>
+ <reference key="object" ref="188151597"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="560981705"/>
+ </array>
+ <reference key="parent" ref="892073455"/>
+ <string key="objectName">expandingLabel</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">10</int>
+ <reference key="object" ref="127451908"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="34913011"/>
+ <reference ref="249985030"/>
+ <reference ref="502970651"/>
+ </array>
+ <reference key="parent" ref="892073455"/>
+ <string key="objectName">scrollView</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">11</int>
+ <reference key="object" ref="34913011"/>
+ <reference key="parent" ref="127451908"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">12</int>
+ <reference key="object" ref="923120149"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="174093312"/>
+ </array>
+ <reference key="parent" ref="892073455"/>
+ <string key="objectName">button1</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">13</int>
+ <reference key="object" ref="779635846"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="766787080"/>
+ </array>
+ <reference key="parent" ref="892073455"/>
+ <string key="objectName">button2</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">14</int>
+ <reference key="object" ref="449231231"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="288774339"/>
+ </array>
+ <reference key="parent" ref="892073455"/>
+ <string key="objectName">button3</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">112</int>
+ <reference key="object" ref="560981705"/>
+ <reference key="parent" ref="188151597"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">113</int>
+ <reference key="object" ref="174093312"/>
+ <reference key="parent" ref="923120149"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">114</int>
+ <reference key="object" ref="766787080"/>
+ <reference key="parent" ref="779635846"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">115</int>
+ <reference key="object" ref="288774339"/>
+ <reference key="parent" ref="449231231"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">116</int>
+ <reference key="object" ref="249985030"/>
+ <reference key="parent" ref="127451908"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">117</int>
+ <reference key="object" ref="502970651"/>
+ <reference key="parent" ref="127451908"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="566852106"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">124</int>
+ <reference key="object" ref="176067980"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="936659409"/>
+ </array>
+ <reference key="parent" ref="892073455"/>
+ <string key="objectName">controlIcon</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">125</int>
+ <reference key="object" ref="936659409"/>
+ <reference key="parent" ref="176067980"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="10.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="11.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <boolean value="NO" key="11.usesInspectorBar"/>
+ <string key="112.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="113.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="114.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="115.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="116.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="117.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="12.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="124.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="125.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="13.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="14.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <boolean value="YES" key="5.IBNSWindowAutoPositionCentersHorizontal"/>
+ <boolean value="YES" key="5.IBNSWindowAutoPositionCentersVertical"/>
+ <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <boolean value="NO" key="5.NSWindowTemplate.visibleAtLaunch"/>
+ <string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="8.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+ <nil key="activeLocalization"/>
+ <dictionary class="NSMutableDictionary" key="localizations"/>
+ <nil key="sourceID"/>
+ <int key="maxID">127</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">CDCommon</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/CDCommon.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">CDControl</string>
+ <string key="superclassName">CDCommon</string>
+ <dictionary class="NSMutableDictionary" key="outlets">
+ <string key="controlIcon">NSImageView</string>
+ <string key="controlPanel">NSPanel</string>
+ <string key="timeoutLabel">NSTextField</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <object class="IBToOneOutletInfo" key="controlIcon">
+ <string key="name">controlIcon</string>
+ <string key="candidateClassName">NSImageView</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="controlPanel">
+ <string key="name">controlPanel</string>
+ <string key="candidateClassName">NSPanel</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="timeoutLabel">
+ <string key="name">timeoutLabel</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ </dictionary>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/CDControl.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">CDTextboxControl</string>
+ <string key="superclassName">CDThreeButtonControl</string>
+ <dictionary class="NSMutableDictionary" key="outlets">
+ <string key="scrollView">NSScrollView</string>
+ <string key="textView">NSTextView</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <object class="IBToOneOutletInfo" key="scrollView">
+ <string key="name">scrollView</string>
+ <string key="candidateClassName">NSScrollView</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="textView">
+ <string key="name">textView</string>
+ <string key="candidateClassName">NSTextView</string>
+ </object>
+ </dictionary>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/CDTextboxControl.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">CDThreeButtonControl</string>
+ <string key="superclassName">CDControl</string>
+ <dictionary class="NSMutableDictionary" key="actions">
+ <string key="button1Pressed:">id</string>
+ <string key="button2Pressed:">id</string>
+ <string key="button3Pressed:">id</string>
+ <string key="setControl:">id</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="actionInfosByName">
+ <object class="IBActionInfo" key="button1Pressed:">
+ <string key="name">button1Pressed:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="button2Pressed:">
+ <string key="name">button2Pressed:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="button3Pressed:">
+ <string key="name">button3Pressed:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="setControl:">
+ <string key="name">setControl:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="outlets">
+ <string key="button1">NSButton</string>
+ <string key="button2">NSButton</string>
+ <string key="button3">NSButton</string>
+ <string key="controlMatrix">NSMatrix</string>
+ <string key="expandingLabel">NSTextField</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <object class="IBToOneOutletInfo" key="button1">
+ <string key="name">button1</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="button2">
+ <string key="name">button2</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="button3">
+ <string key="name">button3</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="controlMatrix">
+ <string key="name">controlMatrix</string>
+ <string key="candidateClassName">NSMatrix</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="expandingLabel">
+ <string key="name">expandingLabel</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ </dictionary>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/CDThreeButtonControl.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+ <integer value="1070" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
5 Resources/en-US.lproj/tbc.xib
View
@@ -44,10 +44,10 @@
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="365987548">
- <int key="NSWindowStyleMask">4111</int>
+ <int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{713, 453}, {428, 132}}</string>
- <int key="NSWTFlags">611852288</int>
+ <int key="NSWTFlags">1685586944</int>
<string key="NSWindowTitle">cocoaDialog</string>
<string key="NSWindowClass">NSPanel</string>
<nil key="NSViewClass"/>
@@ -247,7 +247,6 @@
<string key="NSScreenRect">{{0, 0}, {1920, 1058}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<int key="NSWindowAnimationBehavior">3</int>
- <int key="NSWindowCollectionBehavior">165</int>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
<object class="NSUserDefaultsController" id="617304574">
2  Source/CDCommon.m
View
@@ -32,7 +32,7 @@ - (id)initWithOptions:(CDOptions *)opts {
return self;
}
- (NSRect) screen {
- NSRect screen = [[NSScreen mainScreen] frame];
+ NSRect screen = [[NSScreen mainScreen] visibleFrame];
int screenNumber = 1;
if ([options hasOpt:@"screen"]) {
if (![[NSScanner scannerWithString:[options optValue:@"screen"]] scanInt:&screenNumber]) {
18 Source/CDControl/CDIcon.m
View
@@ -431,19 +431,14 @@ - (void) setIconWithImage:(NSImage *)anImage withSize:(NSSize)aSize withControls
float iconWidthDiff = [control frame].size.width - iconFrame.size.width;
NSEnumerator *en = [anArray objectEnumerator];
- id _control = nil, _previous = nil;
+ id _control;
while (_control = [en nextObject]) {
// Make sure the control exists
if (_control != nil) {
NSRect controlFrame = [_control frame];
- CGFloat y = controlFrame.origin.y;
- if (_previous != nil) {
- y = [_previous frame].origin.y - controlFrame.size.height - 8.0f;
- }
- NSRect newControlFrame = NSMakeRect(controlFrame.origin.x + iconWidthDiff, y, controlFrame.size.width - iconWidthDiff, controlFrame.size.height);
+ NSRect newControlFrame = NSMakeRect(controlFrame.origin.x + iconWidthDiff, controlFrame.origin.y, controlFrame.size.width - iconWidthDiff, controlFrame.size.height);
minHeight += newControlFrame.size.height + 8.0f;
[_control setFrame:newControlFrame];
- _previous = _control;
}
}
CGFloat iconHeight = [control frame].size.height;
@@ -461,20 +456,15 @@ - (void) setIconWithImage:(NSImage *)anImage withSize:(NSSize)aSize withControls
control = nil;
// Move the controls to the left and increase their width
NSEnumerator *en = [anArray objectEnumerator];
- id _control = nil, _previous = nil;
+ id _control;
while (_control = [en nextObject]) {
// Make sure the control exists
if (_control != nil) {
NSRect controlFrame = [_control frame];
- CGFloat y = controlFrame.origin.y;
- if (_previous != nil) {
- y = [_previous frame].origin.y - controlFrame.size.height - 8.0f;
- }
float newControlWidth = controlFrame.size.width + (controlFrame.origin.x - iconFrame.origin.x);
- NSRect newControlFrame = NSMakeRect(iconFrame.origin.x, y, newControlWidth, controlFrame.size.height);
+ NSRect newControlFrame = NSMakeRect(iconFrame.origin.x, controlFrame.origin.y, newControlWidth, controlFrame.size.height);
minHeight += newControlFrame.size.height + 8.0f;
[_control setFrame:newControlFrame];
- _previous = _control;
}
}
[panel addMinHeight:minHeight];
4 Source/CDControl/CDPanel.h
View
@@ -13,14 +13,10 @@
@interface CDPanel : CDCommon <NSWindowDelegate> {
IBOutlet NSPanel *panel;
- NSMutableArray *controls;
NSNumber *minWidth, *minHeight, *maxWidth, *maxHeight;
}
@property (retain) NSPanel *panel;
-- (void) addControl:(id)control;
-- (void) addControlView:(NSView *)view;
-- (void) addHeight:(CGFloat)height;
- (void) addMinHeight:(CGFloat)height;
- (void) addMinWidth:(CGFloat)width;
- (void) configure;
51 Source/CDControl/CDPanel.m
View
@@ -11,57 +11,17 @@
@implementation CDPanel
@synthesize panel;
-- (id)initWithOptions:(CDOptions *)opts {
- self = [super initWithOptions:opts];
- controls = [[[NSMutableArray alloc] init] retain];
- return self;
-}
-
-- (void) addControl:(id)control {
- if (control != nil) {
- [self addMinHeight:[control frame].size.height + 8.0f];
- [controls addObject:control];
- }
-}
-- (void) addControlView:(NSView *)view {
- [self addHeight:[view frame].size.height + 8.0f];
- CGFloat maxControlWidth = 0.0f;
- // Set default position if no controls exist
- CGFloat x = 76;
- CGFloat y = NSHeight([panel frame]) - 40.f - [view frame].size.height;
- // Add the new control below any existing controls, using the last control as position reference points
- if ([controls count]) {
- id _control = nil;
- NSEnumerator *en = [controls objectEnumerator];
- while (_control = [en nextObject]) {
- if ([_control frame].size.width > maxControlWidth) maxControlWidth = [_control frame].size.width;
- }
- id _lastControl = [controls lastObject];
- x = [_lastControl frame].origin.x;
- y = [_lastControl frame].origin.y - 8.0f - [view frame].size.height;
- }
- [view setFrameSize:NSMakeSize(maxControlWidth, [view frame].size.height)];
- [view setFrameOrigin:NSMakePoint(x, y)];
-
- [[panel contentView] addSubview:view];
- [panel setViewsNeedDisplay:YES];
- [controls addObject:view];
-}
-- (void) addHeight:(CGFloat)height {
- NSSize size = [panel frame].size;
- size.height += height;
- [panel setContentSize:size];
-}
-- (void) addMinHeight:(CGFloat)height {
+- (void)addMinHeight:(CGFloat)height {
NSSize minSize = [panel minSize];
minSize.height += height;
[panel setMinSize:minSize];
}
-- (void) addMinWidth:(CGFloat)width {
+- (void)addMinWidth:(CGFloat)width {
NSSize minSize = [panel minSize];
minSize.width += width;
[panel setMinSize:minSize];
}
+
- (void) configure {
if (panel != nil) {
// Set title
@@ -160,16 +120,11 @@ - (void) configure {
[[panel standardWindowButton:NSWindowMiniaturizeButton] setHidden:YES];
[[panel standardWindowButton:NSWindowZoomButton] setHidden:YES];
}
- if (![options hasOpt:@"fullscreen"]) {
- [[panel standardWindowButton:NSWindowFullScreenButton] setHidden:YES];
- }
[panel makeKeyAndOrderFront:nil];
-
}
}
- (void) dealloc {
- [controls release];
[panel release];
[super dealloc];
}
66 Source/CDControl/CDThreeButtonControl/CDSlider.m
View
@@ -130,14 +130,14 @@ - (void) controlHasFinished:(int)button {
[super controlHasFinished:button];
}
-- (void) setControl:(id)sender {
+- (void) setControl:(id)sender {
NSWindow *_panel = [panel panel];
NSRect cmFrame = [controlMatrix frame];
NSView *sliderView = [[NSView alloc] initWithFrame:NSMakeRect(cmFrame.origin.x, (cmFrame.origin.y + cmFrame.size.height) - 17.0f, cmFrame.size.width, 14.0f)];
- [sliderView setAutoresizingMask:NSViewMinYMargin|NSViewWidthSizable];
-
- NSString *_sliderLabel = @"Choose value:";
+ [sliderView setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewMinYMargin];
+
+ NSString *_sliderLabel = @"Choose a value:";
if ([options hasOpt:@"slider-label"] && ![[options optValue:@"slider-label"] isEqualToString:@""]) {
_sliderLabel = [options optValue:@"slider-label"];
}
@@ -148,9 +148,8 @@ - (void) setControl:(id)sender {
[sliderLabel setSelectable:NO];
[sliderLabel setAlignment:NSLeftTextAlignment];
[sliderLabel setStringValue:_sliderLabel];
- [sliderLabel setAutoresizingMask:NSViewMinYMargin|NSViewWidthSizable];
[sliderView addSubview:sliderLabel];
-
+
valueLabel = [[[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, cmFrame.size.width, 14.0f)] autorelease];
[valueLabel setBezeled:NO];
[valueLabel setDrawsBackground:NO];
@@ -158,12 +157,22 @@ - (void) setControl:(id)sender {
[valueLabel setSelectable:NO];
[valueLabel setAlignment:NSRightTextAlignment];
[valueLabel setFont:[NSFont fontWithName:[[valueLabel font] fontName] size:10.0f]];
- [valueLabel setAutoresizingMask:NSViewMinYMargin|NSViewWidthSizable];
if (![options hasOpt:@"always-show-value"])
[valueLabel setHidden:YES];
[sliderView addSubview:valueLabel];
- [[_panel contentView] addSubview:sliderView];
+ [[_panel contentView] addSubview:sliderView];
+
+ // Move controlMatrix to make room for valueView
+ NSPoint cmOrigin = cmFrame.origin;
+ cmOrigin.y -= [sliderView frame].size.height - 8.0f;
+ [controlMatrix setFrameOrigin:cmOrigin];
+
+ // Add the valueView to the panel height
+ NSSize panelSize = [[[panel panel] contentView] frame].size;
+ panelSize.height += [sliderView frame].size.height + 4.0f;
+ [[panel panel] setContentSize:panelSize];
+ [panel resize];
// Set other attributes of matrix
[controlMatrix setCellSize:NSMakeSize(cmFrame.size.width, 22.0f)];
@@ -191,48 +200,41 @@ - (void) setControl:(id)sender {
// Resize controlMatrix
[controlMatrix sizeToCells];
cmFrame = [controlMatrix frame];
-
- [icon addControl:sliderView];
- [icon addControl:controlMatrix];
if (ticks > 0) {
- NSView *tickView = [[NSView alloc] initWithFrame:NSMakeRect(cmFrame.origin.x, cmFrame.origin.y - (cmFrame.size.height - oldHeight) - 17.0f, cmFrame.size.width, 18.0f)];
- [tickView setAutoresizesSubviews:YES];
- [tickView setAutoresizingMask:NSViewMinYMargin|NSViewWidthSizable];
+ NSView *tickView = [[NSView alloc] initWithFrame:NSMakeRect(0.0f, cmFrame.origin.y - (cmFrame.size.height - oldHeight) - 17.0f, [_panel frame].size.width, 18.0f)];
+ [tickView setAutoresizingMask:NSViewMinYMargin];
NSUInteger count = [slider numberOfTickMarks];
for (NSUInteger i = 0; i < count; i++) {
- CGFloat length=cmFrame.size.width-2*6;
+ CGFloat length=cmFrame.size.width-2*10;
CGFloat position=floor((count==1)?length/2:i*(length/(count-1)));
- NSTextField *tickLabel = [[[NSTextField alloc] initWithFrame:NSMakeRect(6.0f + position, 0, 0, 0)] autorelease];
+ NSTextField *tickLabel = [[[NSTextField alloc] initWithFrame:NSMakeRect(cmFrame.origin.x + 10.0f + position, 0, 0, 0)] autorelease];
[tickLabel setBezeled:NO];
[tickLabel setDrawsBackground:NO];
[tickLabel setEditable:NO];
[tickLabel setSelectable:NO];
[tickLabel setStringValue:[NSString stringWithFormat:@"%i", (int)[slider tickMarkValueAtIndex:i]]];
[tickLabel setFont:[NSFont fontWithName:[[tickLabel font] fontName] size:10.0f]];
- [tickLabel setAlignment:NSRightTextAlignment];
[tickLabel sizeToFit];
// Center the label on the tick
NSPoint labelOrigin = [tickLabel frame].origin;
- if (i == 0) {
- labelOrigin.x = 6.0f;
- [tickLabel setAutoresizingMask:NSViewMinYMargin];
- }
- else if (i == (count - 1)) {
- labelOrigin.x = [tickView frame].size.width - [tickLabel frame].size.width - 6.0f;
- [tickLabel setAutoresizingMask:NSViewWidthSizable];
- }
- else {
- labelOrigin.x -= floor([tickLabel frame].size.width / 2.0f);
- [tickLabel setAutoresizingMask:NSViewMinXMargin|NSViewMaxXMargin];
- }
+ labelOrigin.x -= floor([tickLabel frame].size.width / 2.0f);
[tickLabel setFrameOrigin:labelOrigin];
[tickView addSubview:tickLabel];
}
- [icon addControl:tickView];
[[_panel contentView] addSubview:tickView];
-
+
+ // Move controlMatrix to make room for tickView
+ cmOrigin = cmFrame.origin;
+ cmOrigin.y += [tickView frame].size.height + 4.0f;
+ [controlMatrix setFrameOrigin:cmOrigin];
+
+ // Add the tickView to the panel height
+ panelSize = [[[panel panel] contentView] frame].size;
+ panelSize.height += [tickView frame].size.height + 4.0f;
+ [[panel panel] setContentSize:panelSize];
+ [panel resize];
}
[self sliderChanged];
@@ -297,4 +299,4 @@ - (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)c
}
-@end
+@end
7 Source/CDControl/CDThreeButtonControl/CDTextboxControl.h
View
@@ -22,8 +22,11 @@
#import "CDThreeButtonControl.h"
@interface CDTextboxControl : CDThreeButtonControl {
- NSScrollView *scrollView;
- NSTextView *textView;
+ IBOutlet NSTextView *textView;
+ IBOutlet NSScrollView *scrollView;
}
+- (void) setLabel:(NSString *)labelText;
+
+
@end
87 Source/CDControl/CDThreeButtonControl/CDTextboxControl.m
View
@@ -23,20 +23,24 @@
@implementation CDTextboxControl
+- (NSString *)controlNib {
+ return @"Textbox";
+}
+
- (NSDictionary *) availableKeys
{
NSNumber *vOne = [NSNumber numberWithInt:CDOptionsOneValue];
NSNumber *vNone = [NSNumber numberWithInt:CDOptionsNoValues];
return [NSDictionary dictionaryWithObjectsAndKeys:
- vOne, @"value",
- vNone, @"fullscreen",
- vOne, @"text-from-file",
+ vOne, @"label",
+ vOne, @"text",
+ vOne, @"text-from-file",
vNone, @"editable",
vNone, @"no-editable",
vNone, @"selected",
vNone, @"focus-textbox",
- vOne, @"scroll-to",
+ vOne, @"scroll-to",
nil];
}
@@ -44,10 +48,48 @@ - (NSDictionary *) depreciatedKeys
{
return [NSDictionary dictionaryWithObjectsAndKeys:
@"label", @"informative-text",
- @"value", @"text",
nil];
}
+// Should be called after setButtons, and before resize
+- (void) setLabel:(NSString *)labelText {
+ if (expandingLabel != nil) {
+ if (labelText == nil) {
+ labelText = [NSString stringWithString:@""];
+ }
+ float labelNewHeight = -10.0f;
+ NSRect labelRect = [expandingLabel frame];
+ float labelHeightDiff = labelNewHeight - labelRect.size.height;
+ if (![labelText isEqualToString:@""]) {
+ [expandingLabel setStringValue:labelText];
+ NSTextStorage *textStorage = [[[NSTextStorage alloc] initWithString: labelText]autorelease];
+ NSTextContainer *textContainer = [[[NSTextContainer alloc] initWithContainerSize:NSMakeSize(labelRect.size.width, FLT_MAX)] autorelease];
+ NSLayoutManager *layoutManager = [[[NSLayoutManager alloc]init] autorelease];
+ [layoutManager addTextContainer: textContainer];
+ [textStorage addLayoutManager: layoutManager];
+ [layoutManager glyphRangeForTextContainer:textContainer];
+ labelNewHeight = [layoutManager usedRectForTextContainer:textContainer].size.height;
+ labelHeightDiff = labelNewHeight - labelRect.size.height;
+ // Set label's new height
+ NSRect l = NSMakeRect(labelRect.origin.x, labelRect.origin.y - labelHeightDiff, labelRect.size.width, labelNewHeight);
+ [expandingLabel setFrame: l];
+ }
+ else {
+ [expandingLabel setHidden:YES];
+ }
+ // Set panel's new width and height
+ NSSize p = [[[panel panel] contentView] frame].size;
+ p.height += labelHeightDiff;
+ [[panel panel] setContentSize:p];
+
+ // Set scrollView's new height
+ NSSize s = [scrollView frame].size;
+ s.height -= labelHeightDiff;
+ [scrollView setFrameSize:s];
+
+ }
+}
+
- (BOOL)isReturnValueEmpty
{
return [[[textView textStorage] string] isEqualToString:@""];
@@ -71,19 +113,10 @@ - (BOOL)validateOptions {
- (void) createControl {
- controlMatrix = nil;
- [self setTitleButtonsLabel:[options optValue:@"label"]];
-
- scrollView = [[[NSScrollView alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, 300.0f, 450.0f)] autorelease];
- [scrollView setHasVerticalScroller:YES];
- [scrollView setHasHorizontalScroller:YES];
- [scrollView setBorderType:NSBezelBorder];
- [scrollView setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable];
+ NSAttributedString *text;
- textView = [[[NSTextView alloc] initWithFrame:[scrollView bounds]] autorelease];
- [textView setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable];
-
- NSAttributedString *text;
+ [icon addControl:scrollView];
+
// set editable
if ([options hasOpt:@"editable"]) {
[textView setEditable:YES];
@@ -92,15 +125,15 @@ - (void) createControl {
}
// Set initial text in textview
- if ([options hasOpt:@"value"]) {
+ if ([options hasOpt:@"text"]) {
text = [[NSAttributedString alloc] initWithString:
- [options optValue:@"value"]];
+ [options optValue:@"text"]];
[[textView textStorage] setAttributedString:text];
[textView scrollRangeToVisible:NSMakeRange([text length], 0)];
[text release];
} else if ([options hasOpt:@"text-from-file"]) {
NSString *contents = [NSString stringWithContentsOfFile:
- [options optValue:@"text-from-file"] encoding:NSUTF8StringEncoding error:nil];
+ [options optValue:@"text-from-file"] encoding:NSUTF8StringEncoding error:nil];
if (contents == nil) {
if ([options hasOpt:@"debug"]) {
[self debug:@"Could not read file"];
@@ -115,6 +148,7 @@ - (void) createControl {
[[textView textStorage] setAttributedString:[[[NSAttributedString alloc] initWithString:@""] autorelease]];
}
+ [self setTitleButtonsLabel:[options optValue:@"label"]];
// scroll to top or bottom (do this AFTER resizing, setting the text,
// etc). Default is top
@@ -122,7 +156,7 @@ - (void) createControl {
&& [[options optValue:@"scroll-to"] isCaseInsensitiveLike:@"bottom"])
{
[textView scrollRangeToVisible:
- NSMakeRange([[textView textStorage] length]-1, 0)];
+ NSMakeRange([[textView textStorage] length]-1, 0)];
} else {
[textView scrollRangeToVisible:NSMakeRange(0, 0)];
}
@@ -130,7 +164,7 @@ - (void) createControl {
// select all the text
if ([options hasOpt:@"selected"]) {
[textView setSelectedRange:
- NSMakeRange(0, [[textView textStorage] length])];
+ NSMakeRange(0, [[textView textStorage] length])];
}
// Set first responder
@@ -140,17 +174,8 @@ - (void) createControl {
} else {
[[panel panel] makeFirstResponder:button1];
}
-
- [scrollView setDocumentView:textView];
- [panel addControlView:scrollView];
-
- [panel setMaxHeight:[self screen].size.height];
- [panel setMaxWidth:[self screen].size.width];
-// [icon addControl:textView];
-
}
-
- (void) controlHasFinished:(int)button {
if ([[self options] hasOpt:@"editable"]) {
[controlReturnValues addObject:[[textView textStorage] string]];
19 Source/CDControl/CDThreeButtonControl/CDThreeButtonControl.m
View
@@ -161,15 +161,8 @@ - (void) setTitle:(NSString*)aTitle forButton:(NSButton*)aButton
// This resizes
- (void) setTitleButtonsLabel:(NSString *)labelText {
- [panel setMaxHeight:0];
- [panel setMaxWidth:[self screen].size.width / 2];
- [panel resize];
-
[self setButtons];
[self setLabel:labelText];
- if (expandingLabel != nil && ![[icon controls] containsObject:expandingLabel]) {
- [icon addControl:expandingLabel];
- }
if (controlMatrix != nil) {
// Remember old controlMatrix size
@@ -204,9 +197,15 @@ - (void) setTitleButtonsLabel:(NSString *)labelText {
[panel addMinWidth:[timeoutLabel frame].size.width];
}
// Add default controls
+ if (expandingLabel != nil && ![[icon controls] containsObject:expandingLabel]) {
+ [icon addControl:expandingLabel];
+ }
if (controlMatrix != nil && ![[icon controls] containsObject:controlMatrix]) {
[icon addControl:controlMatrix];
}
+ if (timeoutLabel != nil && ![[icon controls] containsObject:timeoutLabel]) {
+ [icon addControl:timeoutLabel];
+ }
}
- (void) setButtons {
@@ -267,7 +266,6 @@ - (void) setLabel:(NSString *)labelText {
labelHeightDiff = labelNewHeight - labelRect.size.height;
// Set label's new height
NSRect l = NSMakeRect(labelRect.origin.x, labelRect.origin.y - labelHeightDiff, labelRect.size.width, labelNewHeight);
- [panel addControl:expandingLabel];
[expandingLabel setFrame: l];
}
else {
@@ -303,11 +301,8 @@ - (void) setTimeoutLabel {
labelNewHeight = [layoutManager usedRectForTextContainer:textContainer].size.height;
labelHeightDiff = labelNewHeight - labelRect.size.height;
// Set label's new height
- NSRect l = NSMakeRect(labelRect.origin.x, 48.0f, labelRect.size.width, labelNewHeight);
+ NSRect l = NSMakeRect(labelRect.origin.x, labelRect.origin.y - labelHeightDiff, labelRect.size.width, labelNewHeight);
[timeoutLabel setFrame: l];
- if (![[icon controls] containsObject:timeoutLabel]) {
- [icon addControl:timeoutLabel];
- }
}
else {
[timeoutLabel setHidden:YES];
12 cocoaDialog.xcodeproj/project.pbxproj
View
@@ -84,6 +84,7 @@
A78A8CD614376C42007AE363 /* Msgbox.xib in Resources */ = {isa = PBXBuildFile; fileRef = A78A8CB9143759ED007AE363 /* Msgbox.xib */; };
A78A8CD714376C42007AE363 /* Progressbar.xib in Resources */ = {isa = PBXBuildFile; fileRef = A78A8CBB143759ED007AE363 /* Progressbar.xib */; };
A78A8CD814376C42007AE363 /* tbc.xib in Resources */ = {isa = PBXBuildFile; fileRef = A78A8CBD143759ED007AE363 /* tbc.xib */; };
+ A78A8CD914376C42007AE363 /* Textbox.xib in Resources */ = {isa = PBXBuildFile; fileRef = A78A8CBF143759ED007AE363 /* Textbox.xib */; };
A78A8CE014377610007AE363 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = A78A8CDE14377610007AE363 /* CHANGELOG */; };
A78A8CE114377610007AE363 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = A78A8CDF14377610007AE363 /* LICENSE */; };
A7BABB401445829B00D3F168 /* relaunch in Resources */ = {isa = PBXBuildFile; fileRef = A7BABB2E1445817B00D3F168 /* relaunch */; };
@@ -191,6 +192,7 @@
A78A8CBA143759ED007AE363 /* en-US */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "en-US"; path = "Resources/en-US.lproj/Msgbox.xib"; sourceTree = "<group>"; };
A78A8CBC143759ED007AE363 /* en-US */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "en-US"; path = "Resources/en-US.lproj/Progressbar.xib"; sourceTree = "<group>"; };
A78A8CBE143759ED007AE363 /* en-US */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "en-US"; path = "Resources/en-US.lproj/tbc.xib"; sourceTree = "<group>"; };
+ A78A8CC0143759ED007AE363 /* en-US */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "en-US"; path = "Resources/en-US.lproj/Textbox.xib"; sourceTree = "<group>"; };
A78A8CD2143761E5007AE363 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Resources/Info.plist; sourceTree = "<group>"; };
A78A8CDE14377610007AE363 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
A78A8CDF14377610007AE363 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
@@ -271,6 +273,7 @@
A78A8CB9143759ED007AE363 /* Msgbox.xib */,
A78A8CBB143759ED007AE363 /* Progressbar.xib */,
A78A8CBD143759ED007AE363 /* tbc.xib */,
+ A78A8CBF143759ED007AE363 /* Textbox.xib */,
0E71DA0A0963B19500FF6F7C /* cocoadialog.icns */,
);
name = Resources;
@@ -538,6 +541,7 @@
A78A8CD614376C42007AE363 /* Msgbox.xib in Resources */,
A78A8CD714376C42007AE363 /* Progressbar.xib in Resources */,
A78A8CD814376C42007AE363 /* tbc.xib in Resources */,
+ A78A8CD914376C42007AE363 /* Textbox.xib in Resources */,
A78A8CE014377610007AE363 /* CHANGELOG in Resources */,
A78A8CE114377610007AE363 /* LICENSE in Resources */,
61FA9D2114518E97006E0674 /* dsa_pub.pem in Resources */,
@@ -644,6 +648,14 @@
name = tbc.xib;
sourceTree = "<group>";
};
+ A78A8CBF143759ED007AE363 /* Textbox.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ A78A8CC0143759ED007AE363 /* en-US */,
+ );
+ name = Textbox.xib;
+ sourceTree = "<group>";
+ };
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
Please sign in to comment.
Something went wrong with that request. Please try again.