Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Pagination in NSView subclass not working

Pagination in NSView subclass not working
Thread Tools
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Jul 25, 2002, 09:23 PM
 
I cannot seem to get pagination working. I've got a single NSView which includes many subviews tiled vertically (with a small gap between each for aesthetics). The subviews are each of a subclass of NSView. All the subclass does is override the basic set of 4 pagination methods (see below): If the page bottom occurs anywhere in the view, it is supposed to push the page bottom up to the top of the view. But it ain't working. It doesn't appear to be doing anything.

Using debugging, and logging (see commented out NSLog below), I've determined that the subclass' pagination methods are being called and they appear to be calculating the correct new bottom. But it doesn't seem to be used by the superview, or have any effect on printing.

The complete implementation of the NSView subclass is below (I've tried various values for the heightAdjustLimit from 0.0 to 1.0).

Any ideas?

</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> #import &quot;NoBreakView.h&quot;

@implementation NoBreakView

- (void)adjustPageHeightNewfloat *)newBottom topfloat)top bottomfloat)proposedBottom limitfloat)bottomLimit
{
NSRect viewFrame = [self frame];

if ( proposedBottom &gt; 0.0 )
*newBottom = viewFrame.size.height;
else
*newBottom = proposedBottom;

//NSLog(@&quot;\nproposedBottom %f.0\nviewFrame height %f.0\nbottomLimit %f.0\nnewBottom %f.0&quot;, proposedBottom, viewFrame.size.height, bottomLimit, *newBottom);
}

- (void)adjustPageWidthNewfloat *)newRight leftfloat)left rightfloat)proposedRight limitfloat)rightLimit
{
NSRect viewFrame = [self frame];

if ( proposedRight &gt; viewFrame.size.width )
*newRight = viewFrame.size.width;
else
*newRight = proposedRight;
}

- (float)heightAdjustLimit
{
return 0.9;
}

- (float)widthAdjustLimit
{
return 0.9;
}

@end
</pre><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">

<small>[ 07-25-2002, 10:27 PM: Message edited by: Brass ]</small>
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:35 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2