Buglet or WAD - using CRLFs with InputBox 
Author Message
 Buglet or WAD - using CRLFs with InputBox

Once in a while I like to use multiple lines when displaying an error or
info box.  There are times when doing the same with an inputbox is
desired but, so far, I haven't been able to convince InputBox to work
with CRLF pairs in the prompt to be displayed.

In the sample below you'll notice that the InputBox DOES appear to leave
space where the 2nd part of the prompt would be but it doesn't display
it.

/* InputBox and InfoMessage test */
CRLF = "0D0A"x
GetNum = .InputBox~new("Enter something" crlf "Second line","This is a
input box")
Temp = GetNum~execute
call InfoMessage "This is an infomessage with" CRLF CRLF ,
                 "Multiple lines."
exit                
::requires "OODPLAIN.CLS"

Is this a buglet in InputBox or working as designed?  Sure would be nice
to be able to have multiple lines of prompt :)

David Martin
DynaComp Solutions
http://www.*-*-*.com/



Tue, 07 Jun 2005 03:03:33 GMT  
 Buglet or WAD - using CRLFs with InputBox
| Once in a while I like to use multiple lines when displaying an error or
| info box.  There are times when doing the same with an inputbox is
| desired but, so far, I haven't been able to convince InputBox to work
| with CRLF pairs in the prompt to be displayed.
|
| In the sample below you'll notice that the InputBox DOES appear to leave
| space where the 2nd part of the prompt would be but it doesn't display
| it.
|
| /* InputBox and InfoMessage test */
| CRLF = "0D0A"x
| GetNum = .InputBox~new("Enter something" crlf "Second line","This is a
| input box")
| Temp = GetNum~execute
| call InfoMessage "This is an infomessage with" CRLF CRLF ,
|                  "Multiple lines."
| exit
| ::requires "OODPLAIN.CLS"
|
| Is this a buglet in InputBox or working as designed?  Sure would be nice
| to be able to have multiple lines of prompt :)

I wrote a REXX program (classic REXX) that does that, among other things
such as:

boxing the message(s), indentation, extra blank lines before and/or after
the messages, color and color highlighting, blocked characters, clearing
of the screen, beeping, also/instead writing the message(s) to a file,
etc., and has extensive documentation (with examples).

The color stuff only works on Windows/9x and DOS, not on Windows/NT and
its successors  (it uses ESC code sequences to support colors).  It has
some pretty hairy code.  _________________________________________Gerard S.



Tue, 07 Jun 2005 05:21:35 GMT  
 Buglet or WAD - using CRLFs with InputBox

Quote:

> The color stuff only works on Windows/9x and DOS, not on Windows/NT and
> its successors  (it uses ESC code sequences to support colors).  It has
> some pretty hairy code.  _________________________________________Gerard S.

One could use Mark Hessling's Rexx Curses library to get nice text mode apps on Win32 / colors, borders, yadda yadda...

http://rexxcurses.sourceforge.net/index.html

--
Michael Lueck
Lueck Data Systems

Remove the upper case letters NOSPAM to contact me directly.



Tue, 07 Jun 2005 10:06:55 GMT  
 Buglet or WAD - using CRLFs with InputBox
|> The color stuff only works on Windows/9x and DOS, not on Windows/NT and
|> its successors  (it uses ESC code sequences to support colors).  It has
|> some pretty hairy code.  _________________________________________Gerard S.
|
| One could use Mark Hessling's Rexx Curses library to get nice text mode apps on Win32 / colors, borders, yadda yadda...
|
| http://rexxcurses.sourceforge.net/index.html

I looked into that once.  As I understand it, it essentially requires the
use of Regina REXX.  My code runs under MVS/TSO, VM/CMS, and my PC (Windows
or in DOS mode).  To each to his own, I suppose. __________________Gerard S.



Tue, 07 Jun 2005 11:01:57 GMT  
 Buglet or WAD - using CRLFs with InputBox
Try this Dave:
Lee
/* testinp.cmd */

title = "Next Symposium, I'm Leaving My Bar Money At Home!^How Many
Beers Does This Make?"

header = "Just For Dave Martin"
dlg = .inputbox2~New(title,header)
say dlg~execute

exit

::Requires OODIALOG.cls

::class InputBox2 subclass PlainUserDialog public

::method sx attribute
::method sy attribute

::method init
   expose message title datas. size
   use arg message, title, default, size

   if Arg(3,"o") = 1 | default = "DEFAULT" then datas.101 = ""; else
datas.101 = default
   if Arg(4,"o") = 1 | size = "SIZE" then size = 0
   self~init:super(datas.)

::method DefineDialog
   expose message size dlgy
   parse var message msg1'^'msg2
   if size = 0 then size = self~sx
   self~AddText(10,7, self~sx+2, self~sy, msg1)
   self~AddText(10,17, self~sx+2, self~sy, msg2)

   self~AddLine(10, self~sy+4+17, size)
   self~AddButtonGroup(self~sx-80, dlgy - 18 + 5, 0, 0, "&Ok 1 OK
&Cancel 2 CANCEL", 1, "DEFAULT")

::method AddLine
   use arg x, y, l
   self~AddEntryLine(101,"DATA", x, y, l)

::method execute
   expose message title datas. dlgy size
   parse var message msg1'^'msg2
   use_this = msg1
   if length(msg2) > length(msg1) then
      use_this = msg2

   parse value GetStdTextSize(use_this) with sx sy
   parse value GetScreenSize() with scrx scry .
   self~sx = max(sx,100,size)
   self~sy = sy

   dlgy = (self~sy+4)*2+36
   dlgx = self~sx + 20
   if dlgx < 110 then dlgx = 110
   self~create(trunc((scrx-self~sx) /2),trunc((scry - dlgy) /2), dlgx,
dlgy, title,,,,,4)
   self~execute:super("SHOWTOP")
   if self~InitCode = 1 then return datas.101
   else return ""



Tue, 07 Jun 2005 21:21:10 GMT  
 Buglet or WAD - using CRLFs with InputBox
BTW: Did you know that there are 2 additional (undocumented )
parameters that can be passed to .InputBox? (There are some more
undocumented ones for the other dialogs, also).
The 3rd parameter can be set to the default answer to "your question".
The 4th parameter is the physical length of the "answer" box.

dlg = .inputbox2~New(title,header,24 '& Still Counting',70)

Lee



Quote:
>Try this Dave:
>Lee
>/* testinp.cmd */

>title = "Next Symposium, I'm Leaving My Bar Money At Home!^How Many
>Beers Does This Make?"

>header = "Just For Dave Martin"
>dlg = .inputbox2~New(title,header)
>say dlg~execute

>exit



Tue, 07 Jun 2005 21:38:38 GMT  
 Buglet or WAD - using CRLFs with InputBox


Quote:
> BTW: Did you know that there are 2 additional (undocumented )
> parameters that can be passed to .InputBox? (There are some more
> undocumented ones for the other dialogs, also).

Sure didn't but do now :)  Very handy indeed.  Got a list of the other
ones that aren't documented by any chance?

Quote:
> >Try this Dave:

You're the man Lee!  Leave your beer money at home for sure :)  The
number I owe you at this point is getting too large to count on my
fingers and toes.

David Martin
DynaComp Solutions
http://DynaComp-Solutions.com



Tue, 07 Jun 2005 22:59:29 GMT  
 Buglet or WAD - using CRLFs with InputBox
On Fri, 20 Dec 2002 09:59:29 -0500, David Martin

Quote:



>> BTW: Did you know that there are 2 additional (undocumented )
>> parameters that can be passed to .InputBox? (There are some more
>> undocumented ones for the other dialogs, also).

>Sure didn't but do now :)  Very handy indeed.  Got a list of the other
>ones that aren't documented by any chance?

If you have the Developer's Edition of Object Rexx look in the
Program Files\ObjRexx\OODialog\Scripts\stddlg.cls file
There you will see the code for each of the standard dialogs.  In the
Init method of each, you "may" find where it is testing for additional
arguments:
if Arg(3,"o") = 1
The above line is from the init section of the InputBox - basically
that tests to see if the 3rd argument is "o"mitted.

Have fun
Lee



Tue, 07 Jun 2005 23:32:43 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Reports, Text Controls & CRLFs

2. JACL word splitting and CRLFs

3. Removing CRLFs

4. InputBox

5. how do I get a multicolumn drop box selection to show in the combo inputbox

6. InputBox 3rd parm

7. Inputbox with win32api?

8. WAD file format

9. DooM Wad file to VRML

10. WAD to VRML

11. Information for WADS'92 needed...

12. RichTextEdit buglet

 

 
Powered by phpBB® Forum Software