Lots more stuff merged in. Added an ITImageView/ITImageCell object to allow smooth...
authorMatthew Judy <mjudy@ithinksw.com>
Thu, 20 Nov 2003 14:37:58 +0000 (14:37 +0000)
committerMatthew Judy <mjudy@ithinksw.com>
Thu, 20 Nov 2003 14:37:58 +0000 (14:37 +0000)
ITImageCell.h [new file with mode: 0755]
ITImageCell.m [new file with mode: 0755]
ITImageView.h [new file with mode: 0755]
ITImageView.m [new file with mode: 0755]
ITKit.h
ITKit.xcode/project.pbxproj
ITTextFieldCell.m
Showcase/English.lproj/MainMenu.nib/info.nib
Showcase/English.lproj/MainMenu.nib/keyedobjects.nib

diff --git a/ITImageCell.h b/ITImageCell.h
new file mode 100755 (executable)
index 0000000..c4bb080
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ *     ITKit
+ *  ITImageCell
+ *    NSImageCell subclass which adds new features.
+ *
+ *  Original Author : Matt Judy <mjudy@ithinksw.com>
+ *   Responsibility : Matt Judy <mjudy@ithinksw.com>
+ *
+ *  Copyright (c) 2003 iThink Software.
+ *  All Rights Reserved
+ *
+ */
+#import <Cocoa/Cocoa.h>
+
+
+@interface ITImageCell : NSImageCell {
+
+    BOOL _scalesSmoothly;
+
+}
+
+- (BOOL)scalesSmoothly;
+- (void)setScalesSmoothly:(BOOL)flag;
+
+
+@end
diff --git a/ITImageCell.m b/ITImageCell.m
new file mode 100755 (executable)
index 0000000..cefbcff
--- /dev/null
@@ -0,0 +1,46 @@
+#import "ITImageCell.h"
+
+
+@implementation ITImageCell
+
+
+- (id)initImageCell:(NSImage *)image
+{
+    if ( (self = [super initImageCell:image]) ) {
+        _scalesSmoothly = YES;
+    }
+    NSLog(@"foo");
+    return self;
+}
+
+
+
+- (void)drawWithFrame:(NSRect)rect inView:(NSView *)controlView
+{
+    NSImageInterpolation interpolation;
+
+    if ( _scalesSmoothly ) {
+        interpolation = [[NSGraphicsContext currentContext] imageInterpolation];
+        [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationHigh];
+    }
+    
+    [super drawWithFrame:rect inView:controlView];
+
+    if ( _scalesSmoothly ) {
+        [[NSGraphicsContext currentContext] setImageInterpolation:interpolation];
+    }
+}
+
+- (BOOL)scalesSmoothly
+{
+    return _scalesSmoothly;
+}
+
+- (void)setScalesSmoothly:(BOOL)flag
+{
+    _scalesSmoothly = flag;
+    [[self controlView] setNeedsDisplay:YES];
+}
+
+
+@end
diff --git a/ITImageView.h b/ITImageView.h
new file mode 100755 (executable)
index 0000000..d9141c8
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ *     ITKit
+ *  ITImageView
+ *    NSImageView subclass which adds new features.
+ *
+ *  Original Author : Matt Judy <mjudy@ithinksw.com>
+ *   Responsibility : Matt Judy <mjudy@ithinksw.com>
+ *
+ *  Copyright (c) 2003 iThink Software.
+ *  All Rights Reserved
+ *
+ */
+
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface ITImageView : NSImageView {
+
+}
+
+- (BOOL)scalesSmoothly;
+- (void)setScalesSmoothly:(BOOL)flag;
+
+@end
diff --git a/ITImageView.m b/ITImageView.m
new file mode 100755 (executable)
index 0000000..899cae6
--- /dev/null
@@ -0,0 +1,40 @@
+#import "ITImageView.h"
+#import "ITImageCell.h"
+
+
+@implementation ITImageView
+
+
++ (void)initialize
+{
+    if ( self == [ITImageView class] ) {
+        [self setCellClass:[ITImageCell class]];
+    }
+}
+
++ (Class)cellClass
+{
+    return [ITImageCell class];
+}
+
+- (id)initWithFrame:(NSRect)rect
+{
+    if ( (self = [super initWithFrame:rect]) ) {
+        [self setScalesSmoothly:YES];
+    }
+    
+    return self;
+}
+
+- (BOOL)scalesSmoothly
+{
+    return [[self cell] scalesSmoothly];
+}
+
+- (void)setScalesSmoothly:(BOOL)flag
+{
+    [[self cell] setScalesSmoothly:flag];
+}
+
+
+@end
diff --git a/ITKit.h b/ITKit.h
index 75cbf13..ba348f0 100755 (executable)
--- a/ITKit.h
+++ b/ITKit.h
@@ -21,6 +21,7 @@
 #import <ITKit/ITButton.h>
 #import <ITKit/ITButtonCell.h>
 #import <ITKit/ITStatusItem.h>
+#import <ITKit/ITImageView.h>
 #import <ITKit/ITTableView.h>
 #import <ITKit/ITTabView.h>
 #import <ITKit/ITBevelView.h>
index a1a36f3..73e0eec 100755 (executable)
                        target = 8DC2EF4F0486A6940098B216;
                        targetProxy = 2AC8297F056C451900A7D7E2;
                };
+               2AC8313F056D00F700A7D7E2 = {
+                       expectedFileType = sourcecode.c.h;
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       path = ITImageView.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               2AC83140056D00F700A7D7E2 = {
+                       expectedFileType = sourcecode.c.objc;
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       path = ITImageView.m;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               2AC83141056D00F700A7D7E2 = {
+                       fileRef = 2AC8313F056D00F700A7D7E2;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               2AC83142056D00F700A7D7E2 = {
+                       fileRef = 2AC83140056D00F700A7D7E2;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               2AC8319B056D037700A7D7E2 = {
+                       expectedFileType = sourcecode.c.h;
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       path = ITImageCell.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               2AC8319C056D037700A7D7E2 = {
+                       expectedFileType = sourcecode.c.objc;
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       path = ITImageCell.m;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               2AC8319D056D037700A7D7E2 = {
+                       fileRef = 2AC8319B056D037700A7D7E2;
+                       isa = PBXBuildFile;
+                       settings = {
+                               ATTRIBUTES = (
+                                       Public,
+                               );
+                       };
+               };
+               2AC8319E056D037700A7D7E2 = {
+                       fileRef = 2AC8319C056D037700A7D7E2;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
 //2A0
 //2A1
 //2A2
                        fileRef = 7C992DD8054F5179000B93EA;
                        isa = PBXBuildFile;
                        settings = {
+                               ATTRIBUTES = (
+                                       Private,
+                               );
                        };
                };
                7C992E0E054F5179000B93EA = {
                                7C992DCC054F5179000B93EA,
                                7C992DF5054F5179000B93EA,
                                7C992DF6054F5179000B93EA,
+                               2AC8313F056D00F700A7D7E2,
+                               2AC83140056D00F700A7D7E2,
                        );
                        isa = PBXGroup;
                        name = Controls;
                                7C992DCE054F5179000B93EA,
                                7C992DF7054F5179000B93EA,
                                7C992DF8054F5179000B93EA,
+                               2AC8319B056D037700A7D7E2,
+                               2AC8319C056D037700A7D7E2,
                        );
                        isa = PBXGroup;
                        name = Cells;
                                7C992E2E054F5179000B93EA,
                                7C992E30054F5179000B93EA,
                                7C992E32054F5179000B93EA,
+                               2AC83141056D00F700A7D7E2,
+                               2AC8319D056D037700A7D7E2,
                        );
                        isa = PBXHeadersBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                                7C992E2D054F5179000B93EA,
                                7C992E2F054F5179000B93EA,
                                7C992E31054F5179000B93EA,
+                               2AC83142056D00F700A7D7E2,
+                               2AC8319E056D037700A7D7E2,
                        );
                        isa = PBXSourcesBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
index aed1f00..aeb6ca7 100755 (executable)
@@ -15,7 +15,7 @@
 #pragma mark INITIALIZATION METHODS
 /*************************************************************************/
 
-- (id)initTextCell:(NSString *)string;
+- (id)initTextCell:(NSString *)string
 {
     if ( ( self = [super initTextCell:string] ) ) {
         castsShadow      = NO;
index 0484bb9..42842c4 100755 (executable)
@@ -7,7 +7,7 @@
        <key>IBEditorPositions</key>
        <dict>
                <key>197</key>
-               <string>564 424 153 99 0 0 1056 770 </string>
+               <string>564 424 153 118 0 0 1056 770 </string>
                <key>29</key>
                <string>1 271 349 44 0 0 1056 770 </string>
        </dict>
@@ -15,7 +15,7 @@
        <string>349.0</string>
        <key>IBOpenObjects</key>
        <array>
-               <integer>21</integer>
+               <integer>197</integer>
        </array>
        <key>IBSystem Version</key>
        <string>7C107</string>
index 05d95b0..240f29a 100755 (executable)
Binary files a/Showcase/English.lproj/MainMenu.nib/keyedobjects.nib and b/Showcase/English.lproj/MainMenu.nib/keyedobjects.nib differ