[comp.sys.mac.programmer] Need help with List Manager and scroll bar

system@asuvax.asu.edu (Marc Lesure) (08/16/90)

I having a problem using the scroll bar with the List Manager.  I'm unable
to use the scroll bar at all.  I can scroll within the display window by
pulling the mouse down or pushing it up.  The scroll bar is correctly
updated when I scroll this way.  But clicking the mouse within the scroll
bar region has no effect.

I have set scrollVert to TRUE in the LNew call.  According to the manual
this should implemeted all vertical scrolling functions.  Is there something
else I must do to get the scroll bar region itself functional?

-----------------------------------------------------------------------
Marc Lesure / Arizona State University / Tempe, AZ
"Between the world of men and make-believe, I can be found..."
"False faces and meaningless chases, I travel alone..."
"And where do you go when you come to the end of your dream?"

UUCP:       ...!ncar!noao!asuvax!lesure  
Internet:   lesure@asuvax.eas.asu.edu

stevec@Apple.COM (Steve Christensen) (08/16/90)

In article <1573@asuvax.asu.edu> system@asuvax.asu.edu (Marc Lesure) writes:
>I having a problem using the scroll bar with the List Manager.  I'm unable
>to use the scroll bar at all.  I can scroll within the display window by
>pulling the mouse down or pushing it up.  The scroll bar is correctly
>updated when I scroll this way.  But clicking the mouse within the scroll
>bar region has no effect.
>
>I have set scrollVert to TRUE in the LNew call.  According to the manual
>this should implemeted all vertical scrolling functions.  Is there something
>else I must do to get the scroll bar region itself functional?

Is this list part of a dialog window?  If so, you probably set it up in a
userItem.  If that's the case, did you indent the right side of the rView
rectangle by 15 pixels so that the scrollbar is contained within the userItem?
Of course, if you're not using a dialog, I'm clueless since it should work
OK...

steve

-- 
____________________________________________________________________

  Steve Christensen             Internet:   stevec@goofy.apple.com
  Apple Computer, Inc.          AppleLink:  STEVEC
  20525 Mariani Ave, MS 81-CS   CompuServe: 76174,1712
  Cupertino, CA  95014

  "You just contradicted me."  "No I didn't."
____________________________________________________________________

mxmora@unix.SRI.COM (Matt Mora) (08/16/90)

In article <1573@asuvax.asu.edu> system@asuvax.asu.edu (Marc Lesure) writes:
>I have set scrollVert to TRUE in the LNew call.  According to the manual
>this should implemeted all vertical scrolling functions.  Is there something
>else I must do to get the scroll bar region itself functional?

What method are you using to detect a mouseclick in your list 
PtInRect(event.where, MylistRect)? (where mylistrect = the rect you used
to create your list)  If you are that could be your problem. 
You have to add 15 to the right edge of the rect.

The List Manager will always humor me!

I just love the way it validrects the horizontal scrollbar area even if
there isn't one. Never a dull moment when using the List Manager. :-)




-- 
___________________________________________________________
Matthew Mora                |   my Mac  Matt_Mora@sri.com
SRI International           |  my unix  mxmora@unix.sri.com
___________________________________________________________

stephens@BINAH.CC.BRANDEIS.EDU (08/18/90)

In article <9781@goofy.Apple.COM>, stevec@Apple.COM (Steve Christensen) writes:
>In article <1573@asuvax.asu.edu> system@asuvax.asu.edu (Marc Lesure) writes:
>>I having a problem using the scroll bar with the List Manager.  I'm unable
>>to use the scroll bar at all.  I can scroll within the display window by
>>pulling the mouse down or pushing it up.  The scroll bar is correctly
>>updated when I scroll this way.  But clicking the mouse within the scroll
>>bar region has no effect.
>>
>>I have set scrollVert to TRUE in the LNew call.  According to the manual
>>this should implemeted all vertical scrolling functions.  Is there something
>>else I must do to get the scroll bar region itself functional?
>
>Is this list part of a dialog window?  If so, you probably set it up in a
>userItem.  If that's the case, did you indent the right side of the rView
>rectangle by 15 pixels so that the scrollbar is contained within the userItem?
>Of course, if you're not using a dialog, I'm clueless since it should work
>OK...
>

Ok, your problem is as follows:

As you know, the Mac is event driven.  Thus, you must have a variable defined
as and EventRecord, such as myEvent.  This variable is filled by calling
GetNextEvent or WaitNextEvent.  In order to update your list properly, as you
also know, you must call LClick (spelling?) when a mousedown event occurs 
within the enclosing rectangle of the list.  The location of the mousedown is
stored in myEvent.where, but it is stored in global coordinates.  Therefore,
you must first convert it to local coordinates by defining a variable myPt of
type Point, assigning it to myEvent.where, and then calling 
GlobalToLocal(&myPt).  Now you merely call PtInRect(myPt,&ListRect) and if it
returns TRUE, call LClick.

Good Luck.