InputBox 3rd parm 
Author Message
 InputBox 3rd parm

Thanks to Lee,
I have found this useful default entry!
The specifications are available in the chapter 14 of oodialog.pdf only,
undocumented in the online help.

Regards, Claude

demo code follows:

/* InputBox */
-- Name: InputBox.rex
-- Type: Object REXX Script 2.1.2

-- Source: OODialog Method Reference Version 1.0.3 - oodialog.pdf
-- Version: demo by Claude VIE
-- Date: 12/2002
-- Demo of two standard parameters (preval, len), undocumented in the online
doc
-- and a user modification (multiple lines of prompt)

Parse Source system . programname
Parse Version level
Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
Call SysLoadFuncs -- load the RexxUtil functions

cr = '0D'x  -- carriage return
crlf = '0D0A'x  -- carriage return+line feed
tab = '09'x -- tabulation

Call main

done:
  Call SysDropFuncs  -- drop all RexxUtil functions
  Exit -- the only exit.

main:

-- From OODialog Method Reference: Chapter 14. Standard Dialog Classes and
Functions
-- aInputBox~Init( message , title , preval , len )
-- message A text string that is displayed in the dialog
-- title A string that is displayed as the dialog's title in the title bar
-- preval A string to initialize the entry line. If you do not want to put
-- any text in the entry line, just pass an empty string.
-- len The width of the entry line in dialog units
-- Example:
-- The following example shows a dialog with the Input title and an entry
line:
dlg = .InputBox~New("Please enter your email address", "Input",

value = dlg~Execute
say "You entered:" value
drop dlg

-- From OODialog Method Reference: Chapter 14. Standard Dialog Classes and
Functions
-- aMultiInputBox~Init( message , title , labels. , datas., len )
-- message A text string that is displayed on top of the entry lines. Use it
-- to give the user advice on what to do.
-- title A text string that is displayed in the title bar.
-- labels. A stem variable containing strings that are used as labels on
-- the left side of the entry lines. Labels.1 becomes the label for
-- the first entry line, labels.2 for the second, and so forth.
-- datas. A stem variable (do not forget the trailing period) containing
-- strings that are used to initialize the entry lines. The entries
-- must start with 101 and continue in increments of 1.
-- len The length of the entry lines. All entry lines get the same length.
-- Example:
-- The following example creates a four-line input box. The data entered
-- is stored in the object attributes that are displayed after dialog
execution.
lab.1 = "First name" ; lab.2 = "Last name"
lab.3 = "Street" ;lab.4 = "City" ; lab.5 = "Profession"
addr.101 = "John" ; addr.102 = "Doe" ; addr.103 = "" ; addr.104 = ""
addr.105 = "Software Engineer"
dlg = .MultiInputBox~new("Please enter your address", "Your Address", lab.,
addr., 80)
if dlg~execute = 1 then do
say "The address is:"
say dlg~firstname dlg~lastname
say dlg~Street dlg~City
say dlg~Profession
end

-- Demo of standard InputBox, using the third and fourth parameters
default = "Enter here"
length = 60
title = ".inputbox~New(title,header,default,length)"
header = "InputBox with 4 parameters"
dlg = .inputbox~New(title,header,default,length)
answer = dlg~execute

msg = "The answer is:"cr||answer
Call RxMessageBox msg,"InputBox",'OK','INFORMATION'

-- Demo of a modified version of InputBox, to allow 1 or 2 lines of output
default = "Default"
length = 40
title = "Modified InputBox to allow 2 lines of
output."cr".inputbox2~New(title,header,default,length)"
header = "InputBox2 with 2 lines"
dlg = .inputbox2~New(title,header,default,length)
answer = dlg~execute

msg = "The answer is:"cr||answer
Call RxMessageBox msg,"InputBox",'OK','INFORMATION'

return

-- ::requires "OODPLAIN.cls"

::Requires OODIALOG.cls
-- This class provides a simple dialog with a title, a message, one entry
line, an OK, a Cancel push button
-- and 1 or 2 lines of prompt, using a carriage return separator.
-- source code from Program Files\ObjRexx\OODialog\Scripts\stddlg.cls file
of the Developer's Edition of Object Rexx

changed to '0D'x from ^ to be the same as for RxMessageBox
-- note that default and size are already included in OREXX, but
undocumented in the online help.

::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 '0D'x msg2 -- added
   if size = 0 then size = self~sx
--   self~AddText(10,10, self~sx+2, self~sy, message)
--   self~AddLine(10, self~sy+4+10, size)
--   self~AddButtonGroup(self~sx-80, dlgy - 18, 0, 0, "&Ok 1 OK &Cancel 2
CANCEL", 1, "DEFAULT")
   self~AddText(10,7, self~sx+2, self~sy, msg1) -- added
   self~AddText(10,17, self~sx+2, self~sy, msg2) -- added
   self~AddLine(10, self~sy+4+17, size) -- added
   self~AddButtonGroup(self~sx-80, dlgy - 18 + 5, 0, 0, "&Ok 1 OK &Cancel 2
CANCEL", 1, "DEFAULT") -- added

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

::method execute
   expose message title datas. dlgy size

   parse value GetStdTextSize(message) 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 ""



Mon, 13 Jun 2005 23:23:18 GMT  
 InputBox 3rd parm
Glad to know you got some use from this.  I have a set of the
"printed" documentation, but did not check it b4 making my post.  I
did verify that the on-line documentation for 2.1.2 is still lagging
behind the pdf.
Lee
Quote:

>Thanks to Lee,
>I have found this useful default entry!
>The specifications are available in the chapter 14 of oodialog.pdf only,
>undocumented in the online help.

>Regards, Claude



Tue, 14 Jun 2005 01:14:05 GMT  
 InputBox 3rd parm
The OODIALOG online help does not have a good and complete specifications
for parameters.
We have to refer to other doc like the .pdf ones. Version 1.03 of these .pdf
are avaible from the IBM Toolbox at the guest level (free). See
http://www.ibm.com/developerWorks/toolbox/download.html
Claude


Tue, 14 Jun 2005 23:26:41 GMT  
 InputBox 3rd parm

says...

Quote:
> The OODIALOG online help does not have a good and complete specifications
> for parameters.
> We have to refer to other doc like the .pdf ones. Version 1.03 of these .pdf
> are avaible from the IBM Toolbox at the guest level (free). See
> http://www.ibm.com/developerWorks/toolbox/download.html
> Claude

You can find the 2.1 PDF files at
ftp.software.ibm.com/ps/products/ad/obj-xx/


Tue, 14 Jun 2005 23:48:45 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Passing parm hex parm to STCKCONV

2. InputBox

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

4. Buglet or WAD - using CRLFs with InputBox

5. Inputbox with win32api?

6. App to App parm passing in 2.003

7. C functions with variable parm lists

8. why no function(parm)^ in the Modula-2 language

9. How to Pass parm to PRO*CoBOL program in UNIX environment

10. From PARM= to PROC DIV USING?

11. HELP!! Micro Focus COBOL Parm Passing

12. CALL prog USING parm BY DESCRIPTOR

 

 
Powered by phpBB® Forum Software