1. mle help
Thanks for the help on the crashing routine_id. Moving the call to =
WinMain to the bottom of the main program rather than in the include files =
worked like a charm. Now to my next dilemma.
My window consists of three MLEs only. The first two need to be read-only,=
while the third is editable. But I need to be able to scroll the first =
two. I tried using SetEnable(mle1,0) which did the read-only thing, but =
then I couldn't scroll. So I enabled the first two, which let me scroll, =
but then they were editable. I added a LostFocus trap for the third MLE =
which SetFocus back to itself. So far, so good -- I can scroll the first =
two boxes, and they remain read-only. But now, I have no caret in the =
third MLE.
So I say to myself, I'll just change the background color to the first two =
using SetWindowBackColor. That didn't work, so I'd use SetBackColor. =
Still no go. Try repaintWindow after setting a background color. No =
dice. Set the background color of the MLE, the whole window, both -- =
nothing.
So I say again, Let's just change the text color with SetTextColor. Argh! =
It's doesn't work. I can change the font and the font size, but why not =
the color? =20
No caret, no background color, no text color. BTW: I'm using setText to =
control what appears in the first two MLEs. Any suggestions other than =
using wPuts?
Also, when I setText(mle3,""), I still get a blank line in the box. How =
do I get rid of it?
TIA,
Michael J. Sabal
mjs at osa.att.ne.jp=20
2. Re: mle help
On Wed, 2 Feb 2000 10:01:43 -0500, Mike Sabal <MikeS at NOTATIONS.COM> wrote:
>Thanks for the help on the crashing routine_id. Moving the call to
>WinMain to the bottom of the main program rather than in the include files
>worked like a charm. Now to my next dilemma.
>
>My window consists of three MLEs only. The first two need to be read-
>only, while the third is editable. But I need to be able to scroll the
> first two.
<SNIP>
Try creating the object with the ES_READONLY flag:
------------------------------- UNTESTED CODE -----------------------------
constant ES_READONLY = #00000800 -- unless its already declared in win32lib
global constant
MainWin = create(Window, "Read only MLE Demo", 0, 0, 0, 300, 200, 0),
MyMLE = create(MleText, "", MainWin, 0, 0, 300, 200, ES_READONLY)
--... your code follows
>So I say to myself, I'll just change the background color to the first two
>using SetWindowBackColor. That didn't work, so I'd use SetBackColor.
>Still no go. Try repaintWindow after setting a background color. No
>dice. Set the background color of the MLE, the whole window, both --
>nothing.
I investigated the same thing once, very briefly. Windows uses a special
message to change colors on edittexts and comboboxes. I didn't get in to
any more detail than that.
>Also, when I setText(mle3,""), I still get a blank line in the box. How
>do I get rid of it?
Hmmm. I tried that one, and couldn't make it happen. I'm using win32lib
version 0.45k.
Brian
3. Re: mle help
Brian Jackson wrote:
> Windows uses a special message to change
> colors on edittexts and comboboxes.
Win32Lib traps two of the messages, but ignores the rest:
elsif iMsg = WM_CTLCOLORBTN
or iMsg = WM_CTLCOLORSTATIC
-- or iMsg = WM_CTLCOLOREDIT
-- or iMsg = WM_CTLCOLORLISTBOX
-- or iMsg = WM_CTLCOLORMSGBOX
-- or iMsg = WM_CTLCOLORDLG
-- or iMsg = WM_CTLCOLORSCROLLBAR
then
-- David Cuny