Revision: 3862
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3862&view=rev
Author:   hofman
Date:     2008-05-08 12:04:53 -0700 (Thu, 08 May 2008)

Log Message:
-----------
Add images to icon type popup.

Modified Paths:
--------------
    trunk/English.lproj/NoteWindow.nib/classes.nib
    trunk/English.lproj/NoteWindow.nib/info.nib
    trunk/English.lproj/NoteWindow.nib/keyedobjects.nib
    trunk/Italian.lproj/NoteWindow.nib/classes.nib
    trunk/Italian.lproj/NoteWindow.nib/keyedobjects.nib
    trunk/SKNoteWindowController.h
    trunk/SKNoteWindowController.m

Modified: trunk/English.lproj/NoteWindow.nib/classes.nib
===================================================================
--- trunk/English.lproj/NoteWindow.nib/classes.nib      2008-05-08 17:19:20 UTC 
(rev 3861)
+++ trunk/English.lproj/NoteWindow.nib/classes.nib      2008-05-08 19:04:53 UTC 
(rev 3862)
@@ -32,6 +32,7 @@
             CLASS = SKNoteWindowController;
             LANGUAGE = ObjC;
             OUTLETS =             {
+                iconTypePopUpButton = NSPopUpButton;
                 imageView = BDSKDragImageView;
                 statusBar = SKStatusBar;
                 textView = NSTextView;

Modified: trunk/English.lproj/NoteWindow.nib/info.nib
===================================================================
--- trunk/English.lproj/NoteWindow.nib/info.nib 2008-05-08 17:19:20 UTC (rev 
3861)
+++ trunk/English.lproj/NoteWindow.nib/info.nib 2008-05-08 19:04:53 UTC (rev 
3862)
@@ -13,8 +13,8 @@
        <string>489.0</string>
        <key>IBOpenObjects</key>
        <array>
+               <integer>7</integer>
                <integer>114</integer>
-               <integer>7</integer>
        </array>
        <key>IBSystem Version</key>
        <string>9C7010</string>

Modified: trunk/English.lproj/NoteWindow.nib/keyedobjects.nib
===================================================================
(Binary files differ)

Modified: trunk/Italian.lproj/NoteWindow.nib/classes.nib
===================================================================
--- trunk/Italian.lproj/NoteWindow.nib/classes.nib      2008-05-08 17:19:20 UTC 
(rev 3861)
+++ trunk/Italian.lproj/NoteWindow.nib/classes.nib      2008-05-08 19:04:53 UTC 
(rev 3862)
@@ -32,6 +32,7 @@
             CLASS = SKNoteWindowController;
             LANGUAGE = ObjC;
             OUTLETS =             {
+                iconTypePopUpButton = NSPopUpButton;
                 imageView = BDSKDragImageView;
                 statusBar = SKStatusBar;
                 textView = NSTextView;

Modified: trunk/Italian.lproj/NoteWindow.nib/keyedobjects.nib
===================================================================
(Binary files differ)

Modified: trunk/SKNoteWindowController.h
===================================================================
--- trunk/SKNoteWindowController.h      2008-05-08 17:19:20 UTC (rev 3861)
+++ trunk/SKNoteWindowController.h      2008-05-08 19:04:53 UTC (rev 3862)
@@ -45,6 +45,7 @@
     IBOutlet NSTextView *textView;
     IBOutlet BDSKDragImageView *imageView;
     IBOutlet SKStatusBar *statusBar;
+    IBOutlet NSPopUpButton *iconTypePopUpButton;
     
     PDFAnnotation *note;
     

Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m      2008-05-08 17:19:20 UTC (rev 3861)
+++ trunk/SKNoteWindowController.m      2008-05-08 19:04:53 UTC (rev 3862)
@@ -46,6 +46,7 @@
 #import "NSWindowController_SKExtensions.h"
 #import "NSUserDefaultsController_SKExtensions.h"
 #import "SKStringConstants.h"
+#import "SKUtilities.h"
 
 static NSString *SKNoteWindowFrameAutosaveName = @"SKNoteWindow";
 
@@ -57,6 +58,34 @@
 
 @implementation SKNoteWindowController
 
+static NSImage *noteIcons[7] = {nil, nil, nil, nil, nil, nil, nil};
+
++ (void)makeNoteIcons {
+    if (noteIcons[0]) return;
+    
+    NSRect bounds = {NSZeroPoint, SKPDFAnnotationNoteSize};
+    PDFAnnotationText *annotation = [[PDFAnnotationText alloc] 
initWithBounds:bounds];
+    PDFPage *page = [[PDFPage alloc] init];
+    [page setBounds:bounds forBox:kPDFDisplayBoxMediaBox];
+    [page addAnnotation:annotation];
+    [annotation release];
+    
+    unsigned int i;
+    for (i = 0; i < 7; i++) {
+        noteIcons[i] = [[NSImage alloc] initWithSize:SKPDFAnnotationNoteSize];
+        [noteIcons[i] lockFocus];
+        [annotation setIconType:i];
+        [annotation drawWithBox:kPDFDisplayBoxMediaBox];
+        [noteIcons[i] unlockFocus];
+    }
+    [page release];
+}
+
++ (void)initialize {
+    OBINITIALIZE;
+    [self makeNoteIcons];
+}
+
 - (id)init {
     return self = [self initWithNote:nil];
 }
@@ -108,6 +137,12 @@
             [textView setFont:font];
     }
     
+    unsigned i, count = [iconTypePopUpButton numberOfItems];
+    for (i = 0; i < count; i++) {
+        NSMenuItem *item = [iconTypePopUpButton itemAtIndex:i];
+        [item setImage:noteIcons[[item tag]]];
+    }
+    
     [self updateStatusMessage];
     
     [self setWindowFrameAutosaveNameOrCascade:SKNoteWindowFrameAutosaveName];


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to