PDA

View Full Version : Input Box



Garret Mott
29-Sep-2005, 10:07 AM
Hi All -

Maybe I'm missing something (it's happened once or twice;-), but I'd love to
see something equivalent to VB's InputBox.

It allows the developer to pop up something similar to an YesNo_Box, except
that it allows user input. I'd see the code as something like "Move
(InputBox,"Please enter the date:") to dUserDate. BTW - why isn't this
"Get" instead of "Move"?

An InputBox obviously isn't an elegant way to get info (doesn't allow
formatting or validation at time of entry) , but it would be nice to have a
"quick & dirty" way - rather than have to set up a dialog, include it, etc.
etc.

Thoughts anyone?

Garret

Raphael Theiler
29-Sep-2005, 10:15 AM
I created a "ModalPanel" for that purpose...
It's not as easy to use as it is in VB... but it works fine.

kind regards
Raphael Theiler

"Garret Mott" <garret_atsign_automatesoftware_dot_com> schrieb im
Newsbeitrag news:0lwyNeQxFHA.2208@dacmail.dataaccess.com...
> Hi All -
>
> Maybe I'm missing something (it's happened once or twice;-), but I'd love
> to see something equivalent to VB's InputBox.
>
> It allows the developer to pop up something similar to an YesNo_Box,
> except that it allows user input. I'd see the code as something like
> "Move (InputBox,"Please enter the date:") to dUserDate. BTW - why isn't
> this "Get" instead of "Move"?
>
> An InputBox obviously isn't an elegant way to get info (doesn't allow
> formatting or validation at time of entry) , but it would be nice to have
> a "quick & dirty" way - rather than have to set up a dialog, include it,
> etc. etc.
>
> Thoughts anyone?
>
> Garret
>
>

Garret Mott
29-Sep-2005, 10:20 AM
Raphael -

Yes indeed, that's what I've done. It's still more work, though -and I'm
lazy <g>.

Thanks,

Garret

"Raphael Theiler" <webmaster@black-silence.ch> wrote in message
news:l8PqOgQxFHA.3732@dacmail.dataaccess.com...
>I created a "ModalPanel" for that purpose...
> It's not as easy to use as it is in VB... but it works fine.
>
> kind regards
> Raphael Theiler
>
> "Garret Mott" <garret_atsign_automatesoftware_dot_com> schrieb im
> Newsbeitrag news:0lwyNeQxFHA.2208@dacmail.dataaccess.com...
>> Hi All -
>>
>> Maybe I'm missing something (it's happened once or twice;-), but I'd love
>> to see something equivalent to VB's InputBox.
>>
>> It allows the developer to pop up something similar to an YesNo_Box,
>> except that it allows user input. I'd see the code as something like
>> "Move (InputBox,"Please enter the date:") to dUserDate. BTW - why isn't
>> this "Get" instead of "Move"?
>>
>> An InputBox obviously isn't an elegant way to get info (doesn't allow
>> formatting or validation at time of entry) , but it would be nice to have
>> a "quick & dirty" way - rather than have to set up a dialog, include it,
>> etc. etc.
>>
>> Thoughts anyone?
>>
>> Garret
>>
>>
>
>

Oliver T. Nelson
29-Sep-2005, 11:40 AM
I've been using this package for years...


Garret Mott wrote:
> Hi All -
>
> Maybe I'm missing something (it's happened once or twice;-), but I'd love to
> see something equivalent to VB's InputBox.
>
> It allows the developer to pop up something similar to an YesNo_Box, except
> that it allows user input. I'd see the code as something like "Move
> (InputBox,"Please enter the date:") to dUserDate. BTW - why isn't this
> "Get" instead of "Move"?
>
> An InputBox obviously isn't an elegant way to get info (doesn't allow
> formatting or validation at time of entry) , but it would be nice to have a
> "quick & dirty" way - rather than have to set up a dialog, include it, etc.
> etc.
>
> Thoughts anyone?
>
> Garret
>
>


//AB/ Project Generic Question Input
//AB/ Object prj is a Dialog_Project
//AB/ Set ProjectName to "Generic Question Input"
//AB/ Set ProjectFileName to "GenQuestion.DG"
//AB/ Set GenerateFileName to "NONAME"

// Project Object Structure
// oQDg is a ModalPanel
// oInput is a Form
// oOK_bn is a Button
// oCancel_bn is a Button

// Register all objects
Register_Object oCancel_bn
Register_Object oInput
Register_Object oOK_bn
Register_Object oQDg


//AB-IgnoreStart
//************************************************** **********************
// GenQuestion.dg
//
// Copyright (c) 2000-2001 Out of the Box Consulting, Inc.
// All rights reserved.
//
//************************************************** **********************
// Description:
// A generic question dialog.
//
// Author: Oliver T. Nelson
//************************************************** **********************


//AB-IgnoreEnd


//AB-IgnoreEnd

Object oQDg is a ModalPanel

//AB-StoreTopStart
Property string spRetVal PUBLIC ""
Property integer ipButton PUBLIC -1
//AB-StoreTopEnd

Set Label to "New Folder"
Set Size to 94 217
Set Location to 26 79

//AB-DDOStart


//AB-DDOEnd

Object oInput is a Form
Set Label to "Name for New Folder:"
Set Size to 13 197
Set Location to 29 7
Set Label_Row_Offset to 5
Set Label_Col_Offset to 0
Set Label_Justification_Mode to jMode_Top
End_Object // oInput

Object oOK_bn is a Button
Set Label to "&OK"
Set Location to 61 98

//AB-StoreStart
Procedure OnClick
local string misc
set ipButton to TRUE
get value of (oInput(self)) to misc
set spRetVal to misc
send stop_modal_ui
end_procedure // OnClick



//AB-StoreEnd

End_Object // oOK_bn

Object oCancel_bn is a Button
Set Label to "&Cancel"
Set Location to 61 157

//AB-StoreStart
Procedure OnClick
send stop_modal_ui
end_procedure // OnClick

//AB-StoreEnd

End_Object // oCancel_bn


//AB-StoreStart

Function Get_Input String sTitle String sQuestion Integer iMaxInput Integer iDefault String sDefault Returns String
local string misc sRetVal
local integer iCnt

Set label to sTitle
Set label of (oInput(self)) to sQuestion
set form_margin of (oInput(self)) to iMaxInput
if (iDefault = 1) set default_state of (oOk_Bn(self)) to TRUE
if (iDefault = 2) set default_state of (oCancel_Bn(self)) to TRUE
set value of (oInput(self)) to sDefault

Send Popup_Modal

if ( (ipButton(self)) = DFTRUE ) begin
get spRetVal to sRetVal
function_return sRetVal
end
else function_return ""
end_function
//AB-StoreEnd

End_Object // oQDg

//AB/ End_Object // prj

David Martinko
29-Sep-2005, 12:15 PM
I have had a package I posted in the NG that does this. It autosizes to the
size the input you specify... you can format date, password, currency,
number, or just plain text. You can attach a prompt object to the input
field. You can default a value for the input.

Lots of options...

You should find everything you need in here. It's a bit old and could use
some updating...

--
David Martinko
Redeemed Software
248-535-7495
RedeemedSoftware(SHIFT+2)Hotmail(PERIOD)com
www.redeemedsoftware.com

"Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
news:0lwyNeQxFHA.2208@dacmail.dataaccess.com...
> Hi All -
>
> Maybe I'm missing something (it's happened once or twice;-), but I'd love
> to
> see something equivalent to VB's InputBox.
>
> It allows the developer to pop up something similar to an YesNo_Box,
> except
> that it allows user input. I'd see the code as something like "Move
> (InputBox,"Please enter the date:") to dUserDate. BTW - why isn't this
> "Get" instead of "Move"?
>
> An InputBox obviously isn't an elegant way to get info (doesn't allow
> formatting or validation at time of entry) , but it would be nice to have
> a
> "quick & dirty" way - rather than have to set up a dialog, include it,
> etc.
> etc.
>
> Thoughts anyone?
>
> Garret
>
>

Garret Mott
29-Sep-2005, 02:00 PM
Thanks Oliver & David!

Both work (as you knew they would) - David's certainly has a great deal of
functionality, while Oliver's is almost exactly like the VB InputBox.

This group of developers is wonderful!

I should mention that I posted it here 'cause I thought it really should be
a regular VDF function. Hmm - I guess that'd make it an "out of the box"
function? In that case we've got one <g>. Sorry Oliver...

Garret

"Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
news:0lwyNeQxFHA.2208@dacmail.dataaccess.com...
> Hi All -
>
> Maybe I'm missing something (it's happened once or twice;-), but I'd love
> to see something equivalent to VB's InputBox.
>
> It allows the developer to pop up something similar to an YesNo_Box,
> except that it allows user input. I'd see the code as something like
> "Move (InputBox,"Please enter the date:") to dUserDate. BTW - why isn't
> this "Get" instead of "Move"?
>
> An InputBox obviously isn't an elegant way to get info (doesn't allow
> formatting or validation at time of entry) , but it would be nice to have
> a "quick & dirty" way - rather than have to set up a dialog, include it,
> etc. etc.
>
> Thoughts anyone?
>
> Garret
>
>

Clayton
16-Apr-2019, 10:33 AM
Hi

I know this is an old thread, the attached zip is not working when I try do open it.

Perhaps someone still have the package or a function like that and can share it.

Thanks.

wila
16-Apr-2019, 12:10 PM
If it ever was posted at the forum -or newsgroups- then I probably have a copy ;)

Here you go (not sure if it is the same version though)
12725

--
Wil

Clayton
16-Apr-2019, 12:56 PM
If it ever was posted at the forum -or newsgroups- then I probably have a copy
;)
Wow, good to know that :cool:




Here you go (not sure if it is the same version though)

Thank you so much, zip opened

Regards