home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / mswindo / programm / tools / 955 < prev    next >
Encoding:
Text File  |  1992-09-14  |  3.2 KB  |  79 lines

  1. Newsgroups: comp.os.ms-windows.programmer.tools
  2. Path: sparky!uunet!spool.mu.edu!wupost!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsm!cbnewsl!ggh
  3. From: ggh@cbnewsl.cb.att.com (gerald.g.heit)
  4. Subject: IS IT WINDOWS, OWL, OR ME?
  5. Organization: AT&T
  6. Date: Tue, 15 Sep 1992 00:15:26 GMT
  7. Message-ID: <1992Sep15.001526.18454@cbnewsl.cb.att.com>
  8. Keywords: OWL Windows Borland BCW
  9. Lines: 68
  10.  
  11.  
  12. I am writing a windows app using BCW 3.1 and OWL and have
  13. discovered a minor bug, but I don't know what's at fault.
  14. I believe it's probably an OWL oversight, but then I'm fairly
  15. new to OWL, Windows and C++ as my experience is in C,
  16. UNIX, and OpenWindows.
  17.  
  18. My app uses a resource'd dialog for the main window and has
  19. a multiline edit control, TEdit, that I like to come up as read only.
  20. Then the user may click a radio button to make it fully
  21. editable (and click again for readonly, etc.).
  22. I experimented with TEdit and could not find a way to
  23. merely toggle readonly on and off as I would have liked, so
  24. I settled on a solution of having two TEdit's, one readonly
  25. and one editable which I then HIDE and SHOW and copy text and
  26. selections between upon clicking the radio button.
  27. To accomplish this within my resource file,
  28. I have declared two nearly identical edit controls of which
  29. the only difference is that one was 3.1 readonly.
  30.  
  31. This seemed to work well until I noticed that my edit control
  32. was not getting repainted correctly.  Whenever I had a window
  33. over my dialog and brought my dialog back to the front, the
  34. edit control's text was not showing up.  It was still there because
  35. I could select it and it would show up again.  Neither control
  36. was getting repainted or redrawn in this situation.  Upon
  37. changing the controls' text, etc., they were fine.
  38.  
  39. Not wanting to do any painting myself, I was at my wits end as to
  40. why this was happening and after nearly
  41. a whole day of trying various things
  42. and even resorting to previously unsuccessful experiments with
  43. making TEdit readable and not.
  44. I finally found that by merely reversing the order of the
  45. edit control declarations in my RC file fixed the problem.
  46. I had the readonly edit control declared first, with the editable
  47. edit control immediately after.
  48. Putting the editable one first, works great!
  49. Is this an ignorant fix or am I ignorant for trying to do
  50. something like this in the first place (AHEM, be nice)?
  51.  
  52. For all of the Windows, OWL, and/or BCW experts out there:
  53.  
  54. 1)  Is the order in the RC file supposed to be significant
  55.     in this type of situation?
  56.  
  57. 2)  Can I somehow merely toggle the read only status of a TEdit?
  58.     If so, how?  If not, is this a blatent oversight on
  59.     Borland's part to get 3.1 out the door?
  60.  
  61. 3)  Has anyone else done something similar?
  62.     Again, how?
  63.  
  64. 4)  While I am reasonably happy with BCW 3.1 and OWL's power, speed,
  65.     and level of abstraction, I find Borland's documentation
  66.     to be severely lacking.  It seems to be geared to the simple
  67.     basics and covers mostly "frequently used" options and such.
  68.     I would like a comprehensive OWL/Windows
  69.     reference.  Does anyone know of such a thing, preferably
  70.     for 3.1?
  71.  
  72. Thank You.
  73.  
  74. --------------------------------------------------------
  75. Jerry Heit
  76. AT&T Bell Laboratories
  77. ggh@cbnewsl.att.com
  78. All opinions expressed here are mine.
  79.