home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!decwrl!borland.com!chard
- From: chard@genghis.borland.com (Richard Nelson)
- Subject: Re: Question about tWindow in TVision
- Message-ID: <1992Sep3.032551.6804@genghis.borland.com>
- Summary: Frames and frames....
- Originator: chard@genghis.borland.com
- Sender: news@borland.com (News Admin)
- Organization: Borland International
- References: <1992Sep2.122445.22682@rz.uni-karlsruhe.de>
- Date: Thu, 3 Sep 1992 03:25:51 GMT
- Lines: 58
-
- >today, i've a question about Turbo Pascal 6.0 Turbo Vision. I tryed to
- >open a window _without_ a frame.
-
- Kind of a strange thing to do, but read on...
-
- >First, i set the Options to _no_ Frame (Options := Options and not ofFramed;)
- >within the init-constructor. Nothing happens (the Option ofFramed is never set
- >in my opinion).
-
- Read the doc on ofFramed again. It doesn't apply to windows. It applies
- to views *in* windows. That is, if you insert a view into a window or a
- dialog box and set that view's ofFramed bit, the window (actually the
- window's frame object) will draw a frame line around the view.
-
- >Second, i defined a new object tMyWindow = object(tWindow) with the method
- >InitFrame.
- >
- >procedure tMyWindow.InitFrame;
- >begin
- > Frame := nil;
- >end;
- >
- >but something happy was the result. I got a frame, but not a full one. The botton
- >line was not there (only corrupted).
-
- Window objects expect to have frames. The frame draws all the background for
- the window, so setting Frame to nil will have strange results, as you
- noticed.
-
- >Now, my question. How is the right way to open a Window _without_ a frame.
-
- Ah, now we get to the heart of the matter. The answer is probably "you
- don't." If you want a "window" without a frame, what you're really
- talking about is just a group. After all, a window without a frame
- isn't really a window, since it's the frame that allows you to move,
- resize, etc. the window. If you just want to create a frameless view
- on the desktop, you should probably derive your object from TGroup
- instead of TView.
-
- Another approach would be to cover the frame of the window. I actually
- did that once, although I can't remember why at the moment. There's
- no reason you can't put an "interior" view into the window that eclipses
- the frame view. That way you still have all the functions built into the
- frame available, without it being visible.
-
- A third approach that might work (I haven't thought about this very hard
- yet) is to create the default frame, then Grow it so it's larger than the
- window view. The window should clip the frame, so you wouldn't have to see
- the outline part of the frame. Again, this gives you the benefits of
- having the frame as a background to any other views in the window, without
- having to look at the view.
-
- I hope one of these ideas is helpful.
- --
- =========================================================================
- Richard Nelson, Borland Int'l | chard@borland.com | Go Bears! Grrr-rah!
- Had this been Borland's opinion, I would have written it in a manual.
- "Be good and you will be lonesome." -- Mark Twain
-