home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- 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
- From: pf@bilbo.bio.purdue.edu (Paul Furbacher)
- Subject: Re: Question about scroll bars in TPW 1.0
- Message-ID: <BxJK8x.3nt@mentor.cc.purdue.edu>
- Sender: news@mentor.cc.purdue.edu (USENET News)
- Organization: Purdue University
- References: <92315.090438F0O@psuvm.psu.edu>
- Distribution: comp.lang.pascal
- Date: Wed, 11 Nov 1992 07:46:09 GMT
- Lines: 62
-
- In article <92315.090438F0O@psuvm.psu.edu>,
- <F0O@psuvm.psu.edu> writes: [my *emphasis* added]
- >
- > I've found what *seems* to be a quirk with the scroll bar controls. In
- > the scroll app example program, if I change the XRange and YRange values
- > to 0 in the init constructor, the scroll bars don't show up. So far all
- > is ok. I've read this is what is supposed to happen. However, when I
- > set the XRange and YRange values to 0 in the init method in a program I
- > wrote, the scroll bars still appear! My code is:
- >
- > Scroller := New(PScroller, Init(@Self, 0, 0, 0, 0));
- >
- > I set them all to 0's at the start since I don't yet know what they
- > should be until the user loads a file. When I try this same line of code
- > in the scrollapp example program, they don't show up.
-
- Though there is no way to know what else you do in your program,
- my advice is this:
-
- Make sure that none of the code you borrowed from OWLDEMOS, etc. has
- a call to the TScroller.SetRange() method. The SCROLAPP.PAS code
- does not call the SetRange() method and therefore you don't experience
- the problem in saying "..., Init(@Self, 0,0,0,0));". As a comparison,
- do the same in BSCRLAPP.PAS and you'll find that sometimes you'll
- get scrollbar(s) and sometimes you won't. (The behavior shows up if
- you've done something in between runs to alter the contents
- of the memory location where "TBitScrollWindow.PixelWidth" and
- ".PixelHeight" reside.) Until you open a bitmap file, the values of
- PixelWidth and PixelHeight are undefined in calls to the
- TBitScrollWindow.AdjustScroller method. [The latter method calls
- "Scroller^.SetRange(...)".]
-
- If you play with BSCRLAPP.PAS, try assigning values to
- PixelWidth and PixelHeight in the TBitScrollWindow.Init()
- constructor before the call to "Scroller := New(PScroller, Init(...);".
- If you use "Scroller^.SetRange(...)", then call this
- *after* init'ing the "Scroller" instance.
-
- Note that once you open a bitmap file, PixelWidth&Height are
- set (see lines 260 ff.). If the bitmap is small, there
- is no need for scrollbars. Resize the window to crop the
- bitmap and you'll get scrollbars.
-
- Hopefully, these explanations lead to a solution of the problem.
-
- Try altering the various demos provided with TPW, making one
- small change at a time, in order to study the behavior of an object.
-
- In general, when using a complicated library like OWL or TVision,
- cross-reference the demos until you understand how the
- methods and fields of a particular object are used.
-
- Do this by using the GREP utility which comes
- on the distribution diskettes. If you're going to
- get up to speed with OWL, you'll have to "grep" 'til you drop.
-
- Have fun.
-
- PF
-
-
-
-