RE: Autohiding scrollers/determining visibility
RE: Autohiding scrollers/determining visibility
- Subject: RE: Autohiding scrollers/determining visibility
- From: "Josh Ferguson" <email@hidden>
- Date: Thu, 15 Jan 2004 14:45:28 -0600
- Thread-topic: Autohiding scrollers/determining visibility
Josh,
I wanted to implement the autohiding functionality in 10.2, so I needed to find out if the scrollers needed to be displayed or not. I did so by checking to see if the document view rect was greater than the scroll view frame. Here's basically what I did inside the [NSScrollView reflectScrolledClipView:aClipView] method:
if([self frame].size.width >= [aClipView documentRect].size.width)
hide horizontal scrollers
else
show horizontal scrollers
if([self frame].size.height >= [aClipView documentRect].size.height)
hide vertical scrollers
else
show vertical scrollers
You can probably do something similar outside of the class.
Josh Ferguson
Software Engineer
MindVision Software
-----Original Message-----
From: email@hidden
[
mailto:email@hidden]On Behalf Of Josh Anon
Sent: Thursday, January 15, 2004 1:03 PM
To: email@hidden
Subject: Autohiding scrollers/determining visibility
Hi everyone,
Here's an interesting one. If I have a scroll view, and I set it to
autohide its scrollers, how can I determine if the scroller is visible
or not? Here's what I've found:
1. hasHorizontal/VertcalScroller will return yes, even if it's not
visible
2. Sometimes the scroller's frame origin will be < 0 or > scroll view
width, which works to determine visibility
3. Other times (when not visible), the scroller's width will be
significantly less than the scroll view width, but sometimes it will
only be a few pixels less.
Is there a definitive way to determine visibility?
Thanks,
Josh
---
Josh Anon
Studio Tools, Pixar Animation Studios
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.