home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / pascal / 5178 < prev    next >
Encoding:
Text File  |  1992-09-02  |  3.0 KB  |  72 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!decwrl!borland.com!chard
  3. From: chard@genghis.borland.com (Richard Nelson)
  4. Subject: Re: Question about tWindow in TVision
  5. Message-ID: <1992Sep3.032551.6804@genghis.borland.com>
  6. Summary: Frames and frames....
  7. Originator: chard@genghis.borland.com
  8. Sender: news@borland.com (News Admin)
  9. Organization: Borland International
  10. References: <1992Sep2.122445.22682@rz.uni-karlsruhe.de>
  11. Date: Thu, 3 Sep 1992 03:25:51 GMT
  12. Lines: 58
  13.  
  14. >today, i've a question about Turbo Pascal 6.0 Turbo Vision. I tryed to
  15. >open a window _without_ a frame.
  16.  
  17. Kind of a strange thing to do, but read on...
  18.  
  19. >First, i set the Options to _no_ Frame (Options := Options and not ofFramed;)
  20. >within the init-constructor. Nothing happens (the Option ofFramed is never set
  21. >in my opinion).
  22.  
  23. Read the doc on ofFramed again.  It doesn't apply to windows.  It applies
  24. to views *in* windows.  That is, if you insert a view into a window or a
  25. dialog box and set that view's ofFramed bit, the window (actually the
  26. window's frame object) will draw a frame line around the view.
  27.  
  28. >Second, i defined a new object tMyWindow = object(tWindow) with the method
  29. >InitFrame.
  30. >
  31. >procedure tMyWindow.InitFrame;
  32. >begin
  33. >  Frame := nil;
  34. >end;
  35. >
  36. >but something happy was the result. I got a frame, but not a full one. The botton
  37. >line was not there (only corrupted).
  38.  
  39. Window objects expect to have frames.  The frame draws all the background for
  40. the window, so setting Frame to nil will have strange results, as you
  41. noticed.
  42.  
  43. >Now, my question. How is the right way to open a Window _without_ a frame.
  44.  
  45. Ah, now we get to the heart of the matter.  The answer is probably "you
  46. don't."  If you want a "window" without a frame, what you're really
  47. talking about is just a group.  After all, a window without a frame
  48. isn't really a window, since it's the frame that allows you to move,
  49. resize, etc. the window.  If you just want to create a frameless view
  50. on the desktop, you should probably derive your object from TGroup
  51. instead of TView.
  52.  
  53. Another approach would be to cover the frame of the window.  I actually
  54. did that once, although I can't remember why at the moment.  There's
  55. no reason you can't put an "interior" view into the window that eclipses
  56. the frame view. That way you still have all the functions built into the
  57. frame available, without it being visible.
  58.  
  59. A third approach that might work (I haven't thought about this very hard
  60. yet) is to create the default frame, then Grow it so it's larger than the
  61. window view.  The window should clip the frame, so you wouldn't have to see
  62. the outline part of the frame.  Again, this gives you the benefits of
  63. having the frame as a background to any other views in the window, without
  64. having to look at the view.
  65.  
  66. I hope one of these ideas is helpful.
  67. -- 
  68. =========================================================================
  69.  Richard Nelson, Borland Int'l | chard@borland.com | Go Bears! Grrr-rah!
  70.   Had this been Borland's opinion, I would have written it in a manual.
  71.              "Be good and you will be lonesome." -- Mark Twain
  72.