Skip to content

Commit

Permalink
Add colors of all sorts to the editor user interface, and shadow supp…
Browse files Browse the repository at this point in the history
…ort. Also fix scrollers. Remove application subclass and use an event monitor instead.
  • Loading branch information
uliwitness committed Aug 8, 2011
1 parent c170a8e commit e9074d3
Show file tree
Hide file tree
Showing 16 changed files with 2,718 additions and 414 deletions.
2 changes: 1 addition & 1 deletion Editor/WILDFieldInfoViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
NSButton* mDontWrapSwitch;
NSButton* mDontSearchSwitch;
NSButton* mHorizontalScrollerSwitch;
NSButton* mVerticalalScrollerSwitch;
NSButton* mVerticalScrollerSwitch;
}

@property (retain) IBOutlet NSPopUpButton* stylePopUp;
Expand Down
16 changes: 16 additions & 0 deletions Editor/WILDPartInfoViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
NSTextField * partNumberField;
NSTextField * partNumberLabel;
NSTextView * contentsTextField;
NSColorWell * fillColorWell;
NSColorWell * lineColorWell;
NSColorWell * shadowColorWell;
NSSlider * shadowBlurRadiusSlider;
NSSlider * shadowOffsetSlider;
}

@property(retain) IBOutlet NSButton * scriptEditorButton;
Expand All @@ -37,11 +42,22 @@
@property(retain) IBOutlet NSTextField * partNumberField;
@property(retain) IBOutlet NSTextField * partNumberLabel;
@property(retain) IBOutlet NSTextView * contentsTextField;
@property(retain) IBOutlet NSColorWell * fillColorWell;
@property(retain) IBOutlet NSColorWell * lineColorWell;
@property(retain) IBOutlet NSColorWell * shadowColorWell;
@property(retain) IBOutlet NSSlider * shadowBlurRadiusSlider;
@property(retain) IBOutlet NSSlider * shadowOffsetSlider;

-(id) initWithPart: (WILDPart*)inPart ofCardView: (WILDCardView*)owningView;

-(IBAction) doScriptEditorButton: (id)sender;
-(IBAction) doEnabledSwitchToggled:(id)sender;
-(IBAction) doVisibleSwitchToggled:(id)sender;

-(IBAction) doShadowBlurRadiusChanged:(id)sender;
-(IBAction) doShadowOffsetChanged:(id)sender;
-(IBAction) doShadowColorChanged:(id)sender;
-(IBAction) doLineColorChanged:(id)sender;
-(IBAction) doFillColorChanged:(id)sender;

@end
69 changes: 69 additions & 0 deletions Editor/WILDPartInfoViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ @implementation WILDPartInfoViewController
@synthesize idField;
@synthesize partNumberField;
@synthesize partNumberLabel;
@synthesize fillColorWell;
@synthesize lineColorWell;
@synthesize shadowColorWell;
@synthesize shadowBlurRadiusSlider;
@synthesize shadowOffsetSlider;


-(id) initWithPart: (WILDPart*)inPart ofCardView: (WILDCardView*)owningView
{
Expand Down Expand Up @@ -49,6 +55,9 @@ -(void) dealloc
DESTROY(partNumberField);
DESTROY(partNumberLabel);
DESTROY(contentsTextField);
DESTROY(fillColorWell);
DESTROY(lineColorWell);
DESTROY(shadowColorWell);

[super dealloc];
}
Expand All @@ -70,6 +79,12 @@ -(void) loadView
[enabledSwitch setState: [part isEnabled]];
[visibleSwitch setState: [part visible]];

[fillColorWell setColor: [part fillColor]];
[lineColorWell setColor: [part lineColor]];
[shadowColorWell setColor: [part shadowColor]];
[shadowBlurRadiusSlider setDoubleValue: [part shadowBlurRadius]];
[shadowOffsetSlider setDoubleValue: [part shadowOffset].width];

if( contentsTextField )
{
WILDPartContents* theContents = nil;
Expand Down Expand Up @@ -117,6 +132,60 @@ -(IBAction) doEnabledSwitchToggled:(id)sender
}


-(IBAction) doFillColorChanged:(id)sender
{
[[NSNotificationCenter defaultCenter] postNotificationName: WILDPartWillChangeNotification object: part];

[part setFillColor: [fillColorWell color]];

[[NSNotificationCenter defaultCenter] postNotificationName: WILDPartDidChangeNotification object: part];
[part updateChangeCount: NSChangeDone];
}

-(IBAction) doLineColorChanged:(id)sender
{
[[NSNotificationCenter defaultCenter] postNotificationName: WILDPartWillChangeNotification object: part];

[part setLineColor: [lineColorWell color]];

[[NSNotificationCenter defaultCenter] postNotificationName: WILDPartDidChangeNotification object: part];
[part updateChangeCount: NSChangeDone];
}


-(IBAction) doShadowColorChanged:(id)sender
{
[[NSNotificationCenter defaultCenter] postNotificationName: WILDPartWillChangeNotification object: part];

[part setShadowColor: [shadowColorWell color]];

[[NSNotificationCenter defaultCenter] postNotificationName: WILDPartDidChangeNotification object: part];
[part updateChangeCount: NSChangeDone];
}


-(IBAction) doShadowOffsetChanged:(id)sender
{
[[NSNotificationCenter defaultCenter] postNotificationName: WILDPartWillChangeNotification object: part];

[part setShadowOffset: NSMakeSize([shadowOffsetSlider doubleValue],-[shadowOffsetSlider doubleValue])];

[[NSNotificationCenter defaultCenter] postNotificationName: WILDPartDidChangeNotification object: part];
[part updateChangeCount: NSChangeDone];
}


-(IBAction) doShadowBlurRadiusChanged:(id)sender
{
[[NSNotificationCenter defaultCenter] postNotificationName: WILDPartWillChangeNotification object: part];

[part setShadowBlurRadius: [shadowBlurRadiusSlider doubleValue]];

[[NSNotificationCenter defaultCenter] postNotificationName: WILDPartDidChangeNotification object: part];
[part updateChangeCount: NSChangeDone];
}


-(void) controlTextDidChange: (NSNotification *)notif
{
if( [notif object] == nameField )
Expand Down
69 changes: 21 additions & 48 deletions English.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<data>
<int key="IBDocument.SystemTarget">1070</int>
<string key="IBDocument.SystemVersion">11A511</string>
<string key="IBDocument.InterfaceBuilderVersion">1881</string>
<string key="IBDocument.InterfaceBuilderVersion">1617</string>
<string key="IBDocument.AppKitVersion">1138</string>
<string key="IBDocument.HIToolboxVersion">566.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">1881</string>
<string key="NS.object.0">1617</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand All @@ -26,8 +26,11 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="dict.values" ref="0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -849,16 +852,9 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMenuItem" id="292947418">
<reference key="NSMenu" ref="597730667"/>
<string key="NSTitle">Button Info…</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="1033313550"/>
<reference key="NSMixedImage" ref="310636482"/>
</object>
<object class="NSMenuItem" id="382042600">
<reference key="NSMenu" ref="597730667"/>
<string key="NSTitle">Field Info…</string>
<string key="NSKeyEquiv"/>
<string key="NSTitle">Get Info</string>
<string key="NSKeyEquiv">i</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="1033313550"/>
<reference key="NSMixedImage" ref="310636482"/>
Expand Down Expand Up @@ -1703,7 +1699,7 @@
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="407472854">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand All @@ -1713,8 +1709,6 @@
<object class="NSPSMatrix" key="NSDrawMatrix"/>
<string key="NSFrame">{{18, 16}, {345, 20}}</string>
<reference key="NSSuperview" ref="407472854"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<int key="NSpiFlags">16394</int>
<double key="NSMaxValue">100</double>
</object>
Expand All @@ -1723,7 +1717,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{17, 44}, {347, 34}}</string>
<reference key="NSSuperview" ref="407472854"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="33553989"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="1033723403">
Expand Down Expand Up @@ -1758,8 +1751,6 @@
</object>
</object>
<string key="NSFrameSize">{381, 98}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="110721871"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1366, 746}}</string>
Expand Down Expand Up @@ -2449,22 +2440,6 @@
</object>
<int key="connectionID">579</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">showButtonInfoPanel:</string>
<reference key="source" ref="1014"/>
<reference key="destination" ref="292947418"/>
</object>
<int key="connectionID">604</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">showFieldInfoPanel:</string>
<reference key="source" ref="1014"/>
<reference key="destination" ref="382042600"/>
</object>
<int key="connectionID">605</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">showCardInfoPanel:</string>
Expand Down Expand Up @@ -2713,15 +2688,21 @@
</object>
<int key="connectionID">791</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">showInfoPanel:</string>
<reference key="source" ref="1014"/>
<reference key="destination" ref="292947418"/>
</object>
<int key="connectionID">798</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<object class="NSArray" key="object" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="object" ref="0"/>
<reference key="children" ref="1048"/>
<nil key="parent"/>
</object>
Expand Down Expand Up @@ -3821,7 +3802,6 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="267160867"/>
<reference ref="816133967"/>
<reference ref="382042600"/>
<reference ref="292947418"/>
<reference ref="560023501"/>
<reference ref="876181136"/>
Expand Down Expand Up @@ -3853,11 +3833,6 @@
<reference key="object" ref="816133967"/>
<reference key="parent" ref="597730667"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">584</int>
<reference key="object" ref="382042600"/>
<reference key="parent" ref="597730667"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">585</int>
<reference key="object" ref="292947418"/>
Expand Down Expand Up @@ -4212,7 +4187,6 @@
<string>581.IBPluginDependency</string>
<string>582.IBPluginDependency</string>
<string>583.IBPluginDependency</string>
<string>584.IBPluginDependency</string>
<string>585.IBPluginDependency</string>
<string>590.IBPluginDependency</string>
<string>592.IBPluginDependency</string>
Expand Down Expand Up @@ -4465,7 +4439,6 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
Expand All @@ -4480,7 +4453,7 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">797</int>
<int key="maxID">798</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down
Loading

0 comments on commit e9074d3

Please sign in to comment.