Revision: 2944
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2944&view=rev
Author:   hofman
Date:     2007-09-20 03:04:07 -0700 (Thu, 20 Sep 2007)

Log Message:
-----------
Instantiate secondary PDFView and its enclosing splitview in the nib.

Modified Paths:
--------------
    trunk/Dutch.lproj/MainWindow.nib/classes.nib
    trunk/Dutch.lproj/MainWindow.nib/info.nib
    trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib
    trunk/English.lproj/MainWindow.nib/classes.nib
    trunk/English.lproj/MainWindow.nib/info.nib
    trunk/English.lproj/MainWindow.nib/keyedobjects.nib
    trunk/French.lproj/MainWindow.nib/classes.nib
    trunk/French.lproj/MainWindow.nib/info.nib
    trunk/French.lproj/MainWindow.nib/keyedobjects.nib
    trunk/Italian.lproj/MainWindow.nib/classes.nib
    trunk/Italian.lproj/MainWindow.nib/info.nib
    trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib
    trunk/SKMainWindowController.h
    trunk/SKMainWindowController.m

Modified: trunk/Dutch.lproj/MainWindow.nib/classes.nib
===================================================================
--- trunk/Dutch.lproj/MainWindow.nib/classes.nib        2007-09-20 08:46:49 UTC 
(rev 2943)
+++ trunk/Dutch.lproj/MainWindow.nib/classes.nib        2007-09-20 10:04:07 UTC 
(rev 2944)
@@ -147,6 +147,7 @@
                 passwordField = NSTextField; 
                 passwordSheet = NSWindow; 
                 pdfContentBox = BDSKEdgeView; 
+                pdfSplitView = SKSplitView; 
                 pdfView = SKPDFView; 
                 rightSideButton = NSSegmentedControl; 
                 rightSideCollapsibleView = BDSKCollapsibleView; 
@@ -156,6 +157,8 @@
                 rightSideGradientView = BDSKGradientView; 
                 scaleField = NSTextField; 
                 searchField = NSSearchField; 
+                secondaryPdfContentBox = BDSKEdgeView; 
+                secondaryPdfView = SKSecondaryPDFView; 
                 snapshotArrayController = NSArrayController; 
                 snapshotTableView = SKSnapshotTableView; 
                 snapshotView = NSView; 
@@ -187,6 +190,12 @@
         }, 
         {CLASS = SKOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; 
}, 
         {CLASS = SKPDFView; LANGUAGE = ObjC; SUPERCLASS = PDFView; }, 
+        {
+            ACTIONS = {pagePopUpAction = id; scalePopUpAction = id; }; 
+            CLASS = SKSecondaryPDFView; 
+            LANGUAGE = ObjC; 
+            SUPERCLASS = PDFView; 
+        }, 
         {CLASS = SKSnapshotPageCell; LANGUAGE = ObjC; SUPERCLASS = 
NSTextFieldCell; }, 
         {
             CLASS = SKSnapshotTableView; 

Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib
===================================================================
--- trunk/Dutch.lproj/MainWindow.nib/info.nib   2007-09-20 08:46:49 UTC (rev 
2943)
+++ trunk/Dutch.lproj/MainWindow.nib/info.nib   2007-09-20 10:04:07 UTC (rev 
2944)
@@ -22,6 +22,8 @@
                <string>610 420 220 442 0 0 1440 938 </string>
                <key>694</key>
                <string>610 420 220 442 0 0 1440 938 </string>
+               <key>760</key>
+               <string>560 470 320 342 0 0 1440 938 </string>
        </dict>
        <key>IBFramework Version</key>
        <string>446.1</string>
@@ -31,9 +33,11 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
+               <integer>5</integer>
+               <integer>314</integer>
+               <integer>760</integer>
+               <integer>502</integer>
                <integer>256</integer>
-               <integer>502</integer>
-               <integer>314</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8R218</string>

Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib
===================================================================
(Binary files differ)

Modified: trunk/English.lproj/MainWindow.nib/classes.nib
===================================================================
--- trunk/English.lproj/MainWindow.nib/classes.nib      2007-09-20 08:46:49 UTC 
(rev 2943)
+++ trunk/English.lproj/MainWindow.nib/classes.nib      2007-09-20 10:04:07 UTC 
(rev 2944)
@@ -147,6 +147,7 @@
                 passwordField = NSTextField; 
                 passwordSheet = NSWindow; 
                 pdfContentBox = BDSKEdgeView; 
+                pdfSplitView = SKSplitView; 
                 pdfView = SKPDFView; 
                 rightSideButton = NSSegmentedControl; 
                 rightSideCollapsibleView = BDSKCollapsibleView; 
@@ -156,6 +157,8 @@
                 rightSideGradientView = BDSKGradientView; 
                 scaleField = NSTextField; 
                 searchField = NSSearchField; 
+                secondaryPdfContentBox = BDSKEdgeView; 
+                secondaryPdfView = SKSecondaryPDFView; 
                 snapshotArrayController = NSArrayController; 
                 snapshotTableView = SKSnapshotTableView; 
                 snapshotView = NSView; 
@@ -187,6 +190,12 @@
         }, 
         {CLASS = SKOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; 
}, 
         {CLASS = SKPDFView; LANGUAGE = ObjC; SUPERCLASS = PDFView; }, 
+        {
+            ACTIONS = {pagePopUpAction = id; scalePopUpAction = id; }; 
+            CLASS = SKSecondaryPDFView; 
+            LANGUAGE = ObjC; 
+            SUPERCLASS = PDFView; 
+        }, 
         {CLASS = SKSnapshotPageCell; LANGUAGE = ObjC; SUPERCLASS = 
NSTextFieldCell; }, 
         {
             CLASS = SKSnapshotTableView; 

Modified: trunk/English.lproj/MainWindow.nib/info.nib
===================================================================
--- trunk/English.lproj/MainWindow.nib/info.nib 2007-09-20 08:46:49 UTC (rev 
2943)
+++ trunk/English.lproj/MainWindow.nib/info.nib 2007-09-20 10:04:07 UTC (rev 
2944)
@@ -22,6 +22,8 @@
                <string>610 420 220 442 0 0 1440 938 </string>
                <key>694</key>
                <string>610 420 220 442 0 0 1440 938 </string>
+               <key>760</key>
+               <string>560 470 320 342 0 0 1440 938 </string>
        </dict>
        <key>IBFramework Version</key>
        <string>446.1</string>
@@ -31,20 +33,21 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>256</integer>
+               <integer>5</integer>
+               <integer>760</integer>
+               <integer>208</integer>
                <integer>553</integer>
                <integer>224</integer>
-               <integer>314</integer>
-               <integer>168</integer>
-               <integer>539</integer>
-               <integer>502</integer>
-               <integer>5</integer>
-               <integer>585</integer>
                <integer>687</integer>
-               <integer>208</integer>
                <integer>694</integer>
+               <integer>633</integer>
+               <integer>585</integer>
                <integer>511</integer>
-               <integer>633</integer>
+               <integer>168</integer>
+               <integer>502</integer>
+               <integer>314</integer>
+               <integer>256</integer>
+               <integer>539</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8R218</string>

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

Modified: trunk/French.lproj/MainWindow.nib/classes.nib
===================================================================
--- trunk/French.lproj/MainWindow.nib/classes.nib       2007-09-20 08:46:49 UTC 
(rev 2943)
+++ trunk/French.lproj/MainWindow.nib/classes.nib       2007-09-20 10:04:07 UTC 
(rev 2944)
@@ -147,6 +147,7 @@
                 passwordField = NSTextField; 
                 passwordSheet = NSWindow; 
                 pdfContentBox = BDSKEdgeView; 
+                pdfSplitView = SKSplitView; 
                 pdfView = SKPDFView; 
                 rightSideButton = NSSegmentedControl; 
                 rightSideCollapsibleView = BDSKCollapsibleView; 
@@ -156,6 +157,8 @@
                 rightSideGradientView = BDSKGradientView; 
                 scaleField = NSTextField; 
                 searchField = NSSearchField; 
+                secondaryPdfContentBox = BDSKEdgeView; 
+                secondaryPdfView = SKSecondaryPDFView; 
                 snapshotArrayController = NSArrayController; 
                 snapshotTableView = SKSnapshotTableView; 
                 snapshotView = NSView; 
@@ -187,6 +190,12 @@
         }, 
         {CLASS = SKOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; 
}, 
         {CLASS = SKPDFView; LANGUAGE = ObjC; SUPERCLASS = PDFView; }, 
+        {
+            ACTIONS = {pagePopUpAction = id; scalePopUpAction = id; }; 
+            CLASS = SKSecondaryPDFView; 
+            LANGUAGE = ObjC; 
+            SUPERCLASS = PDFView; 
+        }, 
         {CLASS = SKSnapshotPageCell; LANGUAGE = ObjC; SUPERCLASS = 
NSTextFieldCell; }, 
         {
             CLASS = SKSnapshotTableView; 

Modified: trunk/French.lproj/MainWindow.nib/info.nib
===================================================================
--- trunk/French.lproj/MainWindow.nib/info.nib  2007-09-20 08:46:49 UTC (rev 
2943)
+++ trunk/French.lproj/MainWindow.nib/info.nib  2007-09-20 10:04:07 UTC (rev 
2944)
@@ -22,6 +22,8 @@
                <string>690 581 220 442 0 0 1600 1178 </string>
                <key>694</key>
                <string>690 581 220 442 0 0 1600 1178 </string>
+               <key>760</key>
+               <string>560 470 320 342 0 0 1440 938 </string>
        </dict>
        <key>IBFramework Version</key>
        <string>446.1</string>
@@ -31,9 +33,11 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
+               <integer>5</integer>
+               <integer>760</integer>
+               <integer>256</integer>
                <integer>314</integer>
                <integer>502</integer>
-               <integer>256</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8R218</string>

Modified: trunk/French.lproj/MainWindow.nib/keyedobjects.nib
===================================================================
(Binary files differ)

Modified: trunk/Italian.lproj/MainWindow.nib/classes.nib
===================================================================
--- trunk/Italian.lproj/MainWindow.nib/classes.nib      2007-09-20 08:46:49 UTC 
(rev 2943)
+++ trunk/Italian.lproj/MainWindow.nib/classes.nib      2007-09-20 10:04:07 UTC 
(rev 2944)
@@ -147,6 +147,7 @@
                 passwordField = NSTextField; 
                 passwordSheet = NSWindow; 
                 pdfContentBox = BDSKEdgeView; 
+                pdfSplitView = SKSplitView; 
                 pdfView = SKPDFView; 
                 rightSideButton = NSSegmentedControl; 
                 rightSideCollapsibleView = BDSKCollapsibleView; 
@@ -156,6 +157,8 @@
                 rightSideGradientView = BDSKGradientView; 
                 scaleField = NSTextField; 
                 searchField = NSSearchField; 
+                secondaryPdfContentBox = BDSKEdgeView; 
+                secondaryPdfView = SKSecondaryPDFView; 
                 snapshotArrayController = NSArrayController; 
                 snapshotTableView = SKSnapshotTableView; 
                 snapshotView = NSView; 
@@ -187,6 +190,12 @@
         }, 
         {CLASS = SKOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; 
}, 
         {CLASS = SKPDFView; LANGUAGE = ObjC; SUPERCLASS = PDFView; }, 
+        {
+            ACTIONS = {pagePopUpAction = id; scalePopUpAction = id; }; 
+            CLASS = SKSecondaryPDFView; 
+            LANGUAGE = ObjC; 
+            SUPERCLASS = PDFView; 
+        }, 
         {CLASS = SKSnapshotPageCell; LANGUAGE = ObjC; SUPERCLASS = 
NSTextFieldCell; }, 
         {
             CLASS = SKSnapshotTableView; 

Modified: trunk/Italian.lproj/MainWindow.nib/info.nib
===================================================================
--- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-09-20 08:46:49 UTC (rev 
2943)
+++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-09-20 10:04:07 UTC (rev 
2944)
@@ -22,6 +22,8 @@
                <string>610 420 220 442 0 0 1440 938 </string>
                <key>677</key>
                <string>610 420 220 442 0 0 1440 938 </string>
+               <key>743</key>
+               <string>642 352 320 342 0 0 1440 938 </string>
        </dict>
        <key>IBFramework Version</key>
        <string>446.1</string>
@@ -31,19 +33,20 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>224</integer>
-               <integer>511</integer>
                <integer>314</integer>
+               <integer>539</integer>
+               <integer>168</integer>
                <integer>677</integer>
+               <integer>511</integer>
+               <integer>676</integer>
+               <integer>743</integer>
+               <integer>553</integer>
                <integer>5</integer>
-               <integer>539</integer>
-               <integer>553</integer>
+               <integer>502</integer>
+               <integer>208</integer>
                <integer>256</integer>
-               <integer>208</integer>
-               <integer>502</integer>
-               <integer>676</integer>
+               <integer>224</integer>
                <integer>628</integer>
-               <integer>168</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8R218</string>

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

Modified: trunk/SKMainWindowController.h
===================================================================
--- trunk/SKMainWindowController.h      2007-09-20 08:46:49 UTC (rev 2943)
+++ trunk/SKMainWindowController.h      2007-09-20 10:04:07 UTC (rev 2944)
@@ -73,9 +73,9 @@
     IBOutlet SKPDFView          *pdfView;
     IBOutlet BDSKEdgeView       *pdfContentBox;
     
-    SKSplitView                 *pdfSplitView;
-    SKSecondaryPDFView          *secondaryPdfView;
-    BDSKEdgeView                *secondaryPdfContentBox;
+    IBOutlet SKSplitView        *pdfSplitView;
+    IBOutlet SKSecondaryPDFView *secondaryPdfView;
+    IBOutlet BDSKEdgeView       *secondaryPdfContentBox;
     
     IBOutlet NSBox              *leftSideContentBox;
     IBOutlet NSView             *leftSideContentView;

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2007-09-20 08:46:49 UTC (rev 2943)
+++ trunk/SKMainWindowController.m      2007-09-20 10:04:07 UTC (rev 2944)
@@ -260,6 +260,7 @@
     [rightSideCollapsibleView setMinSize:NSMakeSize(111.0, 
NSHeight([rightSideCollapsibleView frame]))];
     
     [pdfContentBox setEdges:BDSKMinXEdgeMask | BDSKMaxXEdgeMask | 
BDSKMinYEdgeMask];
+    [secondaryPdfContentBox setEdges:BDSKEveryEdgeMask];
     [leftSideEdgeView setEdges:BDSKMinXEdgeMask | BDSKMaxXEdgeMask];
     [rightSideEdgeView setEdges:BDSKMinXEdgeMask | BDSKMaxXEdgeMask];
     
@@ -288,6 +289,9 @@
     
     [pdfView setFrame:[[pdfContentBox contentView] bounds]];
     
+    [secondaryPdfView setFrame:[[secondaryPdfContentBox contentView] bounds]];
+    [pdfSplitView setBlendEnds:YES];
+    
     [outlineView setAutoresizesOutlineColumn: NO];
     [self displayOutlineView];
     [self displayNoteView];
@@ -318,6 +322,7 @@
     [pdfView setShouldAntiAlias:[sud boolForKey:SKShouldAntiAliasKey]];
     [pdfView setGreekingThreshold:[sud floatForKey:SKGreekingThresholdKey]];
     [pdfView setBackgroundColor:[sud colorForKey:SKBackgroundColorKey]];
+    [secondaryPdfView setBackgroundColor:[pdfView backgroundColor]];
     
     if ([sud objectForKey:SKLeftSidePaneWidthKey]) {
         float width = [sud floatForKey:SKLeftSidePaneWidthKey];
@@ -1887,58 +1892,35 @@
 }
 
 - (IBAction)toggleSplitPDF:(id)sender {
-    if (pdfSplitView) {
+    if ([secondaryPdfView window]) {
         
-        [pdfContentBox setFrame:[pdfSplitView frame]];
-        [splitView replaceSubview:pdfSplitView with:pdfContentBox];
-        pdfSplitView = nil;
-        secondaryPdfContentBox = nil;
-        secondaryPdfView = nil;
+        [secondaryPdfContentBox removeFromSuperview];
         
     } else {
         
         NSPoint point = [pdfView convertPoint:[pdfView bounds].origin 
toPage:[pdfView currentPage]];
         NSRect ignored, frame1, frame2;
         
-        pdfSplitView = [[SKSplitView alloc] initWithFrame:[pdfContentBox 
bounds]];
-        [pdfSplitView setBlendEnds:YES];
-        [pdfContentBox retain];
-        [splitView replaceSubview:pdfContentBox with:pdfSplitView];
-        [pdfSplitView release];
-        
         frame1 = [pdfSplitView bounds];
         NSDivideRect(frame1, &frame1, &frame2, roundf(0.7 * NSHeight(frame1)), 
NSMaxYEdge);
         NSDivideRect(frame2, &ignored, &frame2, [pdfSplitView 
dividerThickness], NSMaxYEdge);
         
         [pdfContentBox setFrame:frame1];
-        [pdfSplitView addSubview:pdfContentBox];
-        [pdfContentBox release];
         
-        secondaryPdfContentBox = [[BDSKEdgeView alloc] initWithFrame:frame1];
-        [secondaryPdfContentBox setEdges:BDSKMinXEdgeMask | BDSKMaxXEdgeMask | 
BDSKMinYEdgeMask | BDSKMaxYEdgeMask];
         [secondaryPdfContentBox setFrame:frame2];
         [pdfSplitView addSubview:secondaryPdfContentBox];
-        [secondaryPdfContentBox release];
         
-        secondaryPdfView = [[SKSecondaryPDFView alloc] 
initWithFrame:[[secondaryPdfContentBox contentView] bounds]];
-        [secondaryPdfView setAutoresizingMask:NSViewWidthSizable | 
NSViewHeightSizable];
-        [secondaryPdfContentBox addSubview:secondaryPdfView];
-        [secondaryPdfView release];
-        
-        [pdfSplitView setDelegate:self];
-        [pdfSplitView adjustSubviews];
-        
         [secondaryPdfView setDocument:[pdfView document]];
-        [secondaryPdfView setAutoScales:YES];
-        [secondaryPdfView setDisplayMode:kPDFDisplaySinglePageContinuous];
         [secondaryPdfView setDisplaysPageBreaks:NO];
-        [secondaryPdfView setDisplayBox:kPDFDisplayBoxCropBox];
-        [secondaryPdfView setBackgroundColor:[pdfView backgroundColor]];
+        [secondaryPdfView setAutoScales:YES];
         [secondaryPdfView layoutDocumentView];
         [secondaryPdfView goToPage:[pdfView currentPage]];
         point = [secondaryPdfView convertPoint:[secondaryPdfView 
convertPoint:point fromPage:[secondaryPdfView currentPage]] 
toView:[secondaryPdfView documentView]];
         [[secondaryPdfView documentView] scrollPoint:point];
     }
+    
+    [pdfSplitView adjustSubviews];
+    [[self window] recalculateKeyViewLoop];
 }
 
 - (IBAction)toggleFullScreen:(id)sender {
@@ -4774,7 +4756,7 @@
         [menuItem setState:(int)rightSidePaneState == [menuItem tag] ? 
NSOnState : NSOffState];
         return [self isPresentation] == NO;
     } else if (action == @selector(toggleSplitPDF:)) {
-        if (secondaryPdfView)
+        if ([secondaryPdfView window])
             [menuItem setTitle:NSLocalizedString(@"Hide Split PDF", @"Menu 
item title")];
         else
             [menuItem setTitle:NSLocalizedString(@"Show Split PDF", @"Menu 
item title")];
@@ -4829,7 +4811,7 @@
             [self toggleLeftSidePane:self];
         else
             [self toggleRightSidePane:self];
-    } else if ([sender isEqual:pdfSplitView]) {
+    } else if ([sender isEqual:pdfSplitView] && [[sender subviews] count] > 1) 
{
         NSRect primaryFrame = [pdfContentBox frame];
         NSRect secondaryFrame = [secondaryPdfContentBox frame];
         
@@ -4885,26 +4867,32 @@
         
         [sender adjustSubviews];
     } else if ([sender isEqual:pdfSplitView]) {
-        NSView *primaryView = [[sender subviews] objectAtIndex:0];
-        NSView *secondaryView = [[sender subviews] objectAtIndex:1];
-        NSRect primaryFrame = [primaryView frame];
-        NSRect secondaryFrame = [secondaryView frame];
-        
-        if (NSHeight(secondaryFrame) <= 1.0)
-            secondaryFrame.size.height = 0.0;
-        
-        primaryFrame.size.height = NSHeight([sender frame]) - 
NSHeight(secondaryFrame)  - [sender dividerThickness];
-        
-        if (NSHeight(primaryFrame) < 0.0) {
-            float resizeFactor = 1.0 + NSHeight(primaryFrame) / 
NSHeight(secondaryFrame);
-            secondaryFrame.size.height = floorf(resizeFactor * 
NSHeight(secondaryFrame));
-            primaryFrame.size.height = NSHeight([sender frame]) - 
NSHeight(secondaryFrame) - 2 * [sender dividerThickness];
+        if ([[sender subviews] count] > 1) {
+            NSView *primaryView = [[sender subviews] objectAtIndex:0];
+            NSView *secondaryView = [[sender subviews] objectAtIndex:1];
+            NSRect primaryFrame = [primaryView frame];
+            NSRect secondaryFrame = [secondaryView frame];
+            
+            if (NSHeight(secondaryFrame) <= 1.0)
+                secondaryFrame.size.height = 0.0;
+            
+            primaryFrame.size.height = NSHeight([sender frame]) - 
NSHeight(secondaryFrame)  - [sender dividerThickness];
+            
+            if (NSHeight(primaryFrame) < 0.0) {
+                float resizeFactor = 1.0 + NSHeight(primaryFrame) / 
NSHeight(secondaryFrame);
+                secondaryFrame.size.height = floorf(resizeFactor * 
NSHeight(secondaryFrame));
+                primaryFrame.size.height = NSHeight([sender frame]) - 
NSHeight(secondaryFrame) - 2 * [sender dividerThickness];
+            }
+            primaryFrame.origin.x = NSMaxY(secondaryFrame) + [sender 
dividerThickness];
+            [primaryView setFrame:primaryFrame];
+            [secondaryView setFrame:secondaryFrame];
+            
+            [sender adjustSubviews];
+        } else {
+            NSView *primaryView = [[sender subviews] objectAtIndex:0];
+            [primaryView setFrame:[sender bounds]];
+            [sender adjustSubviews];
         }
-        primaryFrame.origin.x = NSMaxY(secondaryFrame) + [sender 
dividerThickness];
-        [primaryView setFrame:primaryFrame];
-        [secondaryView setFrame:secondaryFrame];
-        
-        [sender adjustSubviews];
     }
 }
 


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to