🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #3318

Re: Multiline Edit Control in Dialog

#3318
From: Brian Wyld
Date: Thu, 20 Jun 1991 14:48
40 lines
2201 bytes
In article <STERGIOS.91Jun18103411@kt22.Stanford.EDU> stergios@kt22.Stanford.EDU writes:
>
>
>Hi Gang, got a question/problem I hope you can help me with.
>
>SYNOPSIS: 
>	Multiline edit control causes dialog box to go away when the
>return key is pressed.
>
>DESCRIPTION:
>	I have a multiline edit crontrol in a dialog box. The flags
>for the edit crontrol appearing in the resource are:
>
>	ES_MULTILINE | WS _TABSTOP | WS_BORDER | WS_VISBLE | WS_CHILD
>
>Nothing fancy about that.  I have tried adding ES_AUTOVSCROLL.  The
>multiline edit would then automatically scroll when it was time to
>wordwrap, as one would expect, but still exhibit the same behaviour
>when the return key was pressed. 
>
>Could it be that a dialog default push button listens on the input
>stream and accepts all returns no matter where the input focus is?
>
>Obviously, I do not completely understand dialogs. Can some clear
>things up for me?
>

As Paul Bonneau said, Win 3 takes RETURN as default button. <CTRL><RETURN>
puts in a return. 

You can change this behaviour by subclassing the edit control. I have code
to do this (email me if you want it) or simply subclass, catch the
VK_RETURN, fiddle the keyboard map (Get/SetKeyboardState) to say CTRL is
pressed, call the default proc and then refiddle the map back again.

Slightly more intuitive....

brian wyld
<brianw@spider.co.uk : Spider Systems Ltd, Stanwell St, Edinburgh >
<My opinions, ok?    : 031 554 9424 : That's SCOTLAND, pal >
Technical Details
Message-ID: <1991Jun20.144858.11588@spider.co.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!tardis!tymix!uunet!mcsun!ukc!edcastle!spider!raft.spider.co.uk!orbweb.spider.co.uk!brianw
References: <STERGIOS.91Jun18103411@kt22.Stanford.EDU> <1991Jun19.185843.2195@hyper.hyper.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!tardis!tymix!uunet!mcsun!ukc!edcastle!spider!raft.spider.co.uk!orbweb.spider.co.uk!brianw
From: brianw@spider.co.uk (Brian Wyld)
Newsgroups: comp.windows.ms.programmer
Subject: Re: Multiline Edit Control in Dialog
Message-ID: <1991Jun20.144858.11588@spider.co.uk>
Date: 20 Jun 91 14:48:58 GMT
References: <STERGIOS.91Jun18103411@kt22.Stanford.EDU> <1991Jun19.185843.2195@hyper.hyper.com>
Sender: news@spider.co.uk (USENET News System)
Reply-To: brianw@spider.co.uk (Brian Wyld)
Organization: Spider Systems Limited, Edinburgh, UK.
Lines: 40
Nntp-Posting-Host: orbweb.spider.co.uk