home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.tools
- Path: sparky!uunet!spool.mu.edu!wupost!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsm!cbnewsl!ggh
- From: ggh@cbnewsl.cb.att.com (gerald.g.heit)
- Subject: IS IT WINDOWS, OWL, OR ME?
- Organization: AT&T
- Date: Tue, 15 Sep 1992 00:15:26 GMT
- Message-ID: <1992Sep15.001526.18454@cbnewsl.cb.att.com>
- Keywords: OWL Windows Borland BCW
- Lines: 68
-
-
- I am writing a windows app using BCW 3.1 and OWL and have
- discovered a minor bug, but I don't know what's at fault.
- I believe it's probably an OWL oversight, but then I'm fairly
- new to OWL, Windows and C++ as my experience is in C,
- UNIX, and OpenWindows.
-
- My app uses a resource'd dialog for the main window and has
- a multiline edit control, TEdit, that I like to come up as read only.
- Then the user may click a radio button to make it fully
- editable (and click again for readonly, etc.).
- I experimented with TEdit and could not find a way to
- merely toggle readonly on and off as I would have liked, so
- I settled on a solution of having two TEdit's, one readonly
- and one editable which I then HIDE and SHOW and copy text and
- selections between upon clicking the radio button.
- To accomplish this within my resource file,
- I have declared two nearly identical edit controls of which
- the only difference is that one was 3.1 readonly.
-
- This seemed to work well until I noticed that my edit control
- was not getting repainted correctly. Whenever I had a window
- over my dialog and brought my dialog back to the front, the
- edit control's text was not showing up. It was still there because
- I could select it and it would show up again. Neither control
- was getting repainted or redrawn in this situation. Upon
- changing the controls' text, etc., they were fine.
-
- Not wanting to do any painting myself, I was at my wits end as to
- why this was happening and after nearly
- a whole day of trying various things
- and even resorting to previously unsuccessful experiments with
- making TEdit readable and not.
- I finally found that by merely reversing the order of the
- edit control declarations in my RC file fixed the problem.
- I had the readonly edit control declared first, with the editable
- edit control immediately after.
- Putting the editable one first, works great!
- Is this an ignorant fix or am I ignorant for trying to do
- something like this in the first place (AHEM, be nice)?
-
- For all of the Windows, OWL, and/or BCW experts out there:
-
- 1) Is the order in the RC file supposed to be significant
- in this type of situation?
-
- 2) Can I somehow merely toggle the read only status of a TEdit?
- If so, how? If not, is this a blatent oversight on
- Borland's part to get 3.1 out the door?
-
- 3) Has anyone else done something similar?
- Again, how?
-
- 4) While I am reasonably happy with BCW 3.1 and OWL's power, speed,
- and level of abstraction, I find Borland's documentation
- to be severely lacking. It seems to be geared to the simple
- basics and covers mostly "frequently used" options and such.
- I would like a comprehensive OWL/Windows
- reference. Does anyone know of such a thing, preferably
- for 3.1?
-
- Thank You.
-
- --------------------------------------------------------
- Jerry Heit
- AT&T Bell Laboratories
- ggh@cbnewsl.att.com
- All opinions expressed here are mine.
-