home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / pascal / 6476 < prev    next >
Encoding:
Text File  |  1992-11-10  |  3.2 KB  |  75 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!spool.mu.edu!sdd.hp.com!swrinde!elroy.jpl.nasa.gov!ames!purdue!mentor.cc.purdue.edu!pf@bilbo.bio.purdue.edu
  3. From: pf@bilbo.bio.purdue.edu (Paul Furbacher)
  4. Subject: Re: Question about scroll bars in TPW 1.0
  5. Message-ID: <BxJK8x.3nt@mentor.cc.purdue.edu>
  6. Sender: news@mentor.cc.purdue.edu (USENET News)
  7. Organization: Purdue University
  8. References: <92315.090438F0O@psuvm.psu.edu>
  9. Distribution: comp.lang.pascal
  10. Date: Wed, 11 Nov 1992 07:46:09 GMT
  11. Lines: 62
  12.  
  13. In article <92315.090438F0O@psuvm.psu.edu>, 
  14.   <F0O@psuvm.psu.edu> writes: [my *emphasis* added]
  15. >    I've found what *seems* to be a quirk with the scroll bar controls.  In
  16. > the scroll app example program, if I change the XRange and YRange values
  17. > to 0 in the init constructor, the scroll bars don't show up.  So far all
  18. > is ok.  I've read this is what is supposed to happen.  However, when I
  19. > set the XRange and YRange values to 0 in the init method in a program I
  20. > wrote, the scroll bars still appear!  My code is:
  21. >      Scroller := New(PScroller, Init(@Self, 0, 0, 0, 0));
  22. >    I set them all to 0's at the start since I don't yet know what they
  23. > should be until the user loads a file.  When I try this same line of code
  24. > in the scrollapp example program, they don't show up.
  25.  
  26. Though there is no way to know what else you do in your program, 
  27. my advice is this:
  28.  
  29. Make sure that none of the code you borrowed from OWLDEMOS, etc. has
  30. a call to the TScroller.SetRange() method.  The SCROLAPP.PAS code 
  31. does not call the SetRange() method and therefore you don't experience
  32. the problem in saying "..., Init(@Self, 0,0,0,0));".  As a comparison,
  33. do the same in BSCRLAPP.PAS and you'll find that sometimes you'll 
  34. get scrollbar(s) and sometimes you won't.  (The behavior shows up if  
  35. you've done something in between runs to alter the contents
  36. of the memory location where "TBitScrollWindow.PixelWidth" and 
  37. ".PixelHeight" reside.)  Until you open a bitmap file, the values of 
  38. PixelWidth and PixelHeight are undefined in calls to the
  39. TBitScrollWindow.AdjustScroller method.  [The latter method calls
  40. "Scroller^.SetRange(...)".]
  41.  
  42. If you play with BSCRLAPP.PAS, try assigning values to 
  43. PixelWidth and PixelHeight in the TBitScrollWindow.Init() 
  44. constructor before the call to "Scroller := New(PScroller, Init(...);".  
  45. If you use "Scroller^.SetRange(...)", then call this 
  46. *after* init'ing the "Scroller" instance.  
  47.  
  48. Note that once you open a bitmap file, PixelWidth&Height are 
  49. set (see lines 260 ff.).  If the bitmap is small, there 
  50. is no need for scrollbars.  Resize the window to crop the 
  51. bitmap and you'll get scrollbars.
  52.  
  53. Hopefully, these explanations lead to a solution of the problem.  
  54.  
  55. Try altering the various demos provided with TPW, making one 
  56. small change at a time, in order to study the behavior of an object.
  57.  
  58. In general, when using a complicated library like OWL or TVision,
  59. cross-reference the demos until you understand how the    
  60. methods and fields of a particular object are used.  
  61.  
  62. Do this by using the GREP utility which comes 
  63. on the distribution diskettes.  If you're going to 
  64. get up to speed with OWL, you'll have to "grep" 'til you drop.
  65.  
  66. Have fun.
  67.  
  68. PF
  69.  
  70.  
  71.  
  72.