1. RE: Cursor disappear in text box?
- Posted by Don Phillips <Graebel at hotmail.com> Jul 08, 2002
- 398 views
> Under Win32Lib, is there a way to get rid of (or make invisible) the > (text) cursor in a read-only MLEdit box? Let me see. I believe there are two ways. 1) Dont make it read-only, change it to disabled. This will remove the insertion cursor, but will also have the side effect of making the text a gray color. Good solution if you plan to custom draw the control anyways. Probably poor choice otherwise. 2) I cant test this atm, but if you set up an onEvent handler and capture the WM_SETFOCUS message and returnValue(1) I bet the cursor would be removed. Don
2. RE: Cursor disappear in text box?
- Posted by Derek Parnell <Derek.Parnell at SYD.RABOBANK.COM> Jul 08, 2002
- 382 views
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C226D6.B66C8FA0 charset=iso-8859-1 Hi Andy, I'm not sure what you are trying to achieve here, so please let me ask some dumbish questions. Do you want the user to be able to use the mouse to select text and possibly copy it to the clipboard? Or is it that you just want text displayed, but with word breaks forming multiple lines? If its the last option, you could use a child window and use drawText() in a Paint handler to show the text. I don't know about the first option. Making the MleText read only (using the ES_READONLY flag) is a good start. There maybe a way in the WinAPI to turn off the visible caret. I haven't found it yet. ---------- Derek. > -----Original Message----- > From: Andy Serpa [mailto:renegade at earthling.net] > Sent: Monday, 8 July 2002 11:19 > To: EUforum > Subject: Cursor disappear in text box? > > > > Under Win32Lib, is there a way to get rid of (or make invisible) the > (text) cursor in a read-only MLEdit box? > > > > ================================================================== De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================================== The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================================== ------_=_NextPart_000_01C226D6.B66C8FA0 Content-Type: application/ms-tnef
3. RE: Cursor disappear in text box?
- Posted by Andy Serpa <renegade at earthling.net> Jul 08, 2002
- 394 views
Derek Parnell wrote: > Hi Andy, > I'm not sure what you are trying to achieve here, so please let me ask > some > dumbish questions. > > Do you want the user to be able to use the mouse to select text and > possibly > copy it to the clipboard? > It wouldn't bother me, but it isn't needed either. > Or is it that you just want text displayed, but with word breaks forming > multiple lines? > > I'm simply using the edit box for display only -- not input. It just displays what the program is doing and periodically updates itself. Having the blinking black cursor there is a bit distracting, that's all. > If its the last option, you could use a child window and use drawText() > in a > Paint handler to show the text. > Does that imply a separate window? I don't want that. > I don't know about the first option. Making the MleText read only (using > the > ES_READONLY flag) is a good start. There maybe a way in the WinAPI to > turn > off the visible caret. I haven't found it yet. > How about setting the cursor color to white? Can you do that? This a just a "quick & dirty" interface for a program that does not interact with the user at all really. It just has a "Start/Stop" button and that's it. The text box is just something to look at so you can tell what it is doing at the moment. I should point out that I normally don't do any Windows GUI or API programming at all, and this is only the second time I've used Win32lib. The first time was for a program with a one-button interface and it still took me over an hour just to figure out how to disable the "maximize" button. Therefore I don't really know what I'm doing, and would frankly like to learn as little as needed in this area because making Windows interfaces and dealing with Win32Lib makes me want to kill myself. No offense to those of you who have helped create the system, as it surely would be even more aggravating otherwise. In any case, I just need a box to display some text, cursor not neccessary! Thank you.
4. RE: Cursor disappear in text box?
- Posted by Derek Parnell <Derek.Parnell at SYD.RABOBANK.COM> Jul 08, 2002
- 398 views
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C22711.55D25450 charset=iso-8859-1 Hi Andy, the technique is very simple. Here is a joke example that demonstrates some of the things you can do. ------------ without warning include win32lib.ew constant w = create(Window, "Informational Message", 0, 0.25, 0.25, 200, 200, {WS_BORDER}), msg = create(Window, "", w, 0, 0, 180, 150, {WS_CHILD,WS_VISIBLE}), b1 = create(Button, "Don't Panic", w, {0.5,-34}, 155, 68, 25, 0), timer = 1 ------------------------------------------------ procedure Paint_msg(integer self, integer event, sequence parms) ------------------------------------------------ object VOID -- This just refreshes the display if it has to. VOID = drawText(msg, getText(self), getClientSize(self)+{5,5,-5,-5}, {DT_EXPANDTABS, DT_WORDBREAK, DT_END_ELLIPSIS}, 0, 0, 0) end procedure setHandler(msg, w32HPaint, routine_id("Paint_msg")) integer tick tick = 0 sequence bg bg = {BrightRed, BrightWhite} ------------------------------------------------ procedure Timer_timer(integer self, integer event, sequence parms) ------------------------------------------------ tick -= 1 if tick <= 5 then killTimer(w, timer) setText(msg, "All Clear: That was a close one!") setText(w, "Informational Message") setWindowBackColor(msg, getSysColor(COLOR_BTNFACE)) else setWindowBackColor(msg, bg[remainder(tick,2)+1]) setText(msg, sprintf("You have only %d seconds left before" & " the asteroid (GXP-0033-9a) strikes" & " your neighbourhood.",floor(tick/3))) end if repaintWindow(msg) end procedure setHandler(timer, w32HTimer, routine_id("Timer_timer")) ------------------------------------------------ procedure Click_b1(integer self, integer event, sequence parms) ------------------------------------------------ if tick = 0 then tick = 60 setTimer( w, timer, 333 ) setText(b1, "Goodbye") setText(w, "*** ALERT ***") Timer_timer(timer, w32HTimer, {}) else closeWindow(w) end if end procedure setHandler(b1, w32HClick, routine_id("Click_b1")) setText(msg, "WARNING: Possible asteriod event detected!\n\nProbabilty: LOW") WinMain(w, Normal) ------------ Derek > -----Original Message----- > From: Andy Serpa [mailto:renegade at earthling.net] > Sent: Tuesday, 9 July 2002 13:01 > To: EUforum > Subject: RE: Cursor disappear in text box? > > > > Derek Parnell wrote: > > Hi Andy, > > I'm not sure what you are trying to achieve here, so please > let me ask > > some > > dumbish questions. > > > > Do you want the user to be able to use the mouse to select text and > > possibly > > copy it to the clipboard? > > > It wouldn't bother me, but it isn't needed either. > > > > Or is it that you just want text displayed, but with word > breaks forming > > multiple lines? > > > > > I'm simply using the edit box for display only -- not input. It just > displays what the program is doing and periodically updates itself. > Having the blinking black cursor there is a bit distracting, > that's all. > > > If its the last option, you could use a child window and > use drawText() > > in a > > Paint handler to show the text. > > > Does that imply a separate window? I don't want that. > > > I don't know about the first option. Making the MleText > read only (using > > the > > ES_READONLY flag) is a good start. There maybe a way in the > WinAPI to > > turn > > off the visible caret. I haven't found it yet. > > > > How about setting the cursor color to white? Can you do that? > > This a just a "quick & dirty" interface for a program that does not > interact with the user at all really. It just has a > "Start/Stop" button > and that's it. The text box is just something to look at so you can > tell what it is doing at the moment. > > I should point out that I normally don't do any Windows GUI or API > programming at all, and this is only the second time I've > used Win32lib. > The first time was for a program with a one-button interface and it > still took me over an hour just to figure out how to disable the > "maximize" button. > > Therefore I don't really know what I'm doing, and would > frankly like to > learn as little as needed in this area because making Windows > interfaces > and dealing with Win32Lib makes me want to kill myself. No > offense to > those of you who have helped create the system, as it surely would be > even more aggravating otherwise. > > In any case, I just need a box to display some text, cursor not > neccessary! > > Thank you. > > > > ================================================================== De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================================== The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================================== ------_=_NextPart_000_01C22711.55D25450 Content-Type: application/ms-tnef