1. Password Prompt - How?

Thanks all for your previous help.

I'm stumped again.  Here is a program I made out of example 07.
What I want is for the characters typed to display as blanks or asterisks=
 because it is a password entry field.
How can I do that?

By the way, Example 07 uses the undocumented control "SleText" instead of=
 "EditText".  What in the world is that?
Wishlist item:  Rework the examples in Win32Lib to use best practices.

Louis.

include win32lib.ew
without warning
classAutoSelect(EditText, True)

constant
    Win     =3D create(Window, "Enter Password", 0, Default, Default, 400,=
 200, 0),
    Button =3D create(PushButton, "Check Value...", Win, 180, 10, 120, 20,=
 0),
    Sle1    =3D create(EditText, "", Win, 10, 40, 120, 20, 0)

constant
    aStatusBar      =3D create(StatusBar, "", Win, 0, 25, 20, 20, 0)

procedure Click_Button(integer self, integer event, sequence parms)
    sequence msg
    msg =3D getText(Sle1)
    setText(aStatusBar, msg)
end procedure

setHandler(Button, w32HClick, routine_id("Click_Button"))
WinMain(Win, Normal)

new topic     » topic index » view message » categorize

2. Re: Password Prompt - How?

Hi Louis,
	You can use the ES_PASSWORD flag to do what u want.
	Sle1 =3D create(EditText, "", Win, 10, 40, 120, 20, ES_PASSWORD)
	Also, you can trap when the user enters a key saving it to a sequence=20
and sending the control a character at your choice.
	You're right that some win32lib examples should be added and or=20
reviewed, but you also have the Contributions page to see a lot of good=20
programs and learn from them.

Best Regards,
	Guillermo Bonveh=ED

Louis at cwshop.com wrote:
>=20
>=20
> Thanks all for your previous help.
>=20
> I'm stumped again.  Here is a program I made out of example 07.
> What I want is for the characters typed to display as blanks or asterisks=
 because it is a password entry field.
> How can I do that?
>=20
> By the way, Example 07 uses the undocumented control "SleText" instead of=
 "EditText".  What in the world is that?
> Wishlist item:  Rework the examples in Win32Lib to use best practices.
>=20
> Louis.
>=20
> include win32lib.ew
> without warning
> classAutoSelect(EditText, True)
>=20
> constant
>     Win     =3D create(Window, "Enter Password", 0, Default, Default, 400=
, 200, 0),
>     Button =3D create(PushButton, "Check Value...", Win, 180, 10, 120, 20=
, 0),
>     Sle1    =3D create(EditText, "", Win, 10, 40, 120, 20, 0)
>=20
> constant
>     aStatusBar      =3D create(StatusBar, "", Win, 0, 25, 20, 20, 0)
>=20
> procedure Click_Button(integer self, integer event, sequence parms)
>     sequence msg
>     msg =3D getText(Sle1)
>     setText(aStatusBar, msg)
> end procedure
>=20
> setHandler(Button, w32HClick, routine_id("Click_Button"))
> WinMain(Win, Normal)
>=20
> --^----------------------------------------------------------------
> This email was sent to: knixeur at speedy.com.ar
>=20
>=20
> TOPICA - Start your own email discussion group. FREE!
>=20
>=20
>=20
>=20

new topic     » goto parent     » topic index » view message » categorize

3. Re: Password Prompt - How?

On Tue, 30 Sep 2003 01:11:48 -0400 (09/30/03 15:11:48)
, <Louis at cwshop.com> wrote:

>
>
> Thanks all for your previous help.
>
> I'm stumped again.  Here is a program I made out of example 07.
> What I want is for the characters typed to display as blanks or 
> asterisks because it is a password entry field.
> How can I do that?
>
> By the way, Example 07 uses the undocumented control "SleText" instead 
> of "EditText".  What in the world is that?

SleText == "Single Line Edit Text"
EditText == alias for SleText

> Wishlist item:  Rework the examples in Win32Lib to use best practices.

Already done this for ex00 - ex24 and a couple of others. Next release you 
will see these.

> Louis.
>
include win32lib.ew
without warning
classAutoSelect(EditText, True)

integer cMainWin
integer cButton
integer cPassword
integer cStatusBar

procedure Click_cButton(integer self, integer event, sequence parms)
      sequence msg
      msg = getText(cPassword)
      setText(cStatusBar, msg)
end procedure

procedure InitApp()
   cMainWin     = create(Window, "Enter Password", 0, Default, Default, 
400, 200, 0)
   cButton  = create(PushButton, "Check Value...", cMainWin, 180, 10, 120, 
20, 0)
   cPassword    = create(EditText, "", cMainWin, 10, 40, 120, 20, 
ES_PASSWORD) --> !!!!!
   cStatusBar = create(StatusBar, "", cMainWin, 0, 25, 20, 20, 0)

   setHandler(cButton, w32HClick, routine_id("Click_cButton"))
   WinMain({cMainWin, cPassword}, Normal)
end procedure

InitApp()


-- 

cheers,
Derek Parnell

new topic     » goto parent     » topic index » view message » categorize

4. Re: Password Prompt - How?

On Tue, 30 Sep 2003 01:11:48 -0400 (09/30/03 15:11:48)
, <Louis at cwshop.com> wrote:

>
>
> Thanks all for your previous help.
>
> I'm stumped again.  Here is a program I made out of example 07.
> What I want is for the characters typed to display as blanks or 
> asterisks because it is a password entry field.

I forgot to mention that in the new v59.2 this can also be written as ...

include win32lib.ew
without warning

createForm({
    "Window, Enter Password, width=400, height=200, bar=status",
    "EditText, name=Password, left=10, top=40, width=10char, height=1char, 
flag=ES_PASSWORD",
    "Button, Check Value...,left=180, top=10"
    })

procedure Click_CheckValue(integer self, integer event, sequence parms)
       sequence msg
       msg = getText(getNameId("Password"))
       showMessage(0, msg)
end procedure

procedure AppCallback(integer self, integer event, sequence parms)
     if event = w32HGetHandler then
         returnValue(routine_id(parms[1]))
     end if
end procedure
startApp(routine_id("AppCallback"))

-- 

cheers,
Derek Parnell

new topic     » goto parent     » topic index » view message » categorize

5. Re: Password Prompt - How?

OK, The secret undocumented control ES_PASSWORD works.  Now another=
 question.

I understand how to set up handlers and call WinMain().  I have always=
 assumed that when the window is closed, WinMain() returns and execution=
 resumes.  That's where I close the database.  I tried to use a second=
 WinMain() to open another window and found that it didn't work.  Then I=
 found WinMain is documented that when it closes, the application also=
 closes.  I tried openDialog, which says it activates handlers and waits=
 for input.  It doesn't.  It flashes the window on the screen and closes it=
 immediately.

What I am trying to do is open a window to prompt for a password.  The user=
 types in the EditText field and clicks an "OK" button (or presses Enter).=
  The window closes and if the password was correct, the main application=
 window opens.  (Has anyone seen example code?)  I'm not asking someone to=
 write this for me, just give me some hints as to what functions to use.

Where would I find things like ES_PASSWORD documented?  Would this be in a=
 "Windows Programming" text?

Louis.

*********** REPLY SEPARATOR  ***********

On 9/30/2003 at 4:09 AM Guillermo Bonvehi wrote:

>Hi Louis,
>	You can use the ES_PASSWORD flag to do what u want.
>	Sle1 =3D3D create(EditText, "", Win, 10, 40, 120, 20, ES_PASSWORD)
>	Also, you can trap when the user enters a key saving it to a=
 sequence=3D20
>and sending the control a character at your choice.
>	You're right that some win32lib examples should be added and or=3D20
>reviewed, but you also have the Contributions page to see a lot of=
 good=3D20
>programs and learn from them.
>
>Best Regards,
>	Guillermo Bonveh=3DED

new topic     » goto parent     » topic index » view message » categorize

6. Re: Password Prompt - How?

Check the Win32Lib docs for:

openWindow()
showWindow()
closeWindow()

----- Original Message ----- 
From: <Louis at cwshop.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Password Prompt - How?


>
>
> OK, The secret undocumented control ES_PASSWORD works.  Now another
question.
>
> I understand how to set up handlers and call WinMain().  I have always
assumed that when the window is closed, WinMain() returns and execution
resumes.  That's where I close the database.  I tried to use a second
WinMain() to open another window and found that it didn't work.  Then I
found WinMain is documented that when it closes, the application also
closes.  I tried openDialog, which says it activates handlers and waits for
input.  It doesn't.  It flashes the window on the screen and closes it
immediately.
>
> What I am trying to do is open a window to prompt for a password.  The
user types in the EditText field and clicks an "OK" button (or presses
Enter).  The window closes and if the password was correct, the main
application window opens.  (Has anyone seen example code?)  I'm not asking
someone to write this for me, just give me some hints as to what functions
to use.
>
> Where would I find things like ES_PASSWORD documented?  Would this be in a
"Windows Programming" text?
>
> Louis.
>
> *********** REPLY SEPARATOR  ***********
>
> On 9/30/2003 at 4:09 AM Guillermo Bonvehi wrote:
>
> >Hi Louis,
> > You can use the ES_PASSWORD flag to do what u want.
> > Sle1 =3D create(EditText, "", Win, 10, 40, 120, 20, ES_PASSWORD)
> > Also, you can trap when the user enters a key saving it to a sequence=20
> >and sending the control a character at your choice.
> > You're right that some win32lib examples should be added and or=20
> >reviewed, but you also have the Contributions page to see a lot of
good=20
> >programs and learn from them.
> >
> >Best Regards,
> > Guillermo Bonveh=ED
>
> --^----------------------------------------------------------------
> This email was sent to: euphoric at cklester.com
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view message » categorize

7. Re: Password Prompt - How?

----- Original Message ----- 
From: <Louis at cwshop.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Password Prompt - How?


> 
> 
> OK, The secret undocumented control ES_PASSWORD works.  

It is documented, just not in the stuff I supply with win32lib. It is a standard
flag supplied by Microsoft and its documented in the hundreds of books about
Windows programming AND in the Microsoft SDK. These flags are not dreamed up by
myself - they are what Microsoft have decided upon.

>Now another question.
> 
> I understand how to set up handlers and call WinMain().  I have 
>always assumed that when the window is closed, WinMain() returns 
>and execution resumes.  That's where I close the database.  

True, execution does continue after WinMain() returns, but no more calls to
win32lib code should execute. Closing the database here is okay to do.

>I tried to use a second WinMain() to open another window and found 
>that it didn't work.  Then I found WinMain is documented that 
>when it closes, the application also closes.  

Well, more specifically, when WinMain returns, all the windows have been
destroyed and resources returned to Windows. The application is expected to end
and no further calls to routines inside win32lib are permitted.

Why did you try to call WinMain again, after it had returned?

>I tried openDialog, 
>which says it activates handlers and waits for input.  It 
>doesn't.  It flashes the window on the screen and closes it 
>immediately.

Is this after WinMain had returned? 

> What I am trying to do is open a window to prompt for a password.
>The user types in the EditText field and clicks an "OK" button 
>(or presses Enter).  The window closes and if the password was
>correct, the main application window opens.  (Has anyone seen 
>example code?)  I'm not asking someone to write this for me,
>just give me some hints as to what functions to use.

The w32HOpen event is invoked just PRIOR to a window being opened. You can use
this event to show your password form and process the user's interaction with it
before the main window is displayed.

procedure Open_MainWin(integer self, integer event, sequence parms)
    openDialog(PasswordForm)
end procedure                                       
setHandler(MainWin, w32HOpen, routine_id("Open_MainWin"))

Is that enough of a hint? blink

And by the way, the w32HActivate event occurs AFTER the window is opened.
 
> Where would I find things like ES_PASSWORD documented?  
>Would this be in a "Windows Programming" text?

Oh yes.  There are thousands of special symbol names used when programming for
Windows and I do not intend to repeat their documentation in the stuff I release
with win32lib. The Microsoft documenation is already in the public domain at
http://msdn.microsoft.com and the many Windows programming books. I recommend the
book called "Windows Programming" by Charles Pretzold for API level programming,
and  "About Face, The Essentials of User Interface Design" by Alan Cooper for how
make GUI programming effective.

-- 
Derek

new topic     » goto parent     » topic index » view message » categorize

8. Re: Password Prompt - How?

Thanks, Derek.  I had come to the conclusion that Win32Lib was "thin",=
 meaning that it didn't hide much of Microsoft's underlying structure, as=
 opposed to a language like Visual Basic which presents a completely=
 different model of Windows programming.  I had asked before about a=
 Windows Programming reference, but got no reply then.  Since I am=
 unfamiliar with Windows programming, I am relying completely on your=
 Win32Lib documentation and the examples.  I knew I needed a more extensive=
 reference.

To answer your question, I had assumed that if I set up handlers and ran=
 WinMain() and windows opened, I could close the window and do it again.=
  When that didn't work, I set up handlers for the password window and=
 called openDialog() without calling WinMain().  The documentation seemed=
 to indicate it would obey the handlers and wait for input, but it didn't.=
  Your technique is clearly the right way, I just don't (yet) have a proper=
 reference for Windows programming, so I greatly appreciate your help.

To change the subject, I am impressed with the ease with which Euphoria=
 programs can be written, though Windows programming is a bit more=
 difficult.  Has anyone put some thought in to a "Visual Euphoria" library=
 which supports Windows programming in a simplified way?  I'm thinking of a=
 Window Designer program which the programmer uses to graphically arrange=
 his fields, checkboxes, etc.  It then creates an include file which=
 supports simple calls like this:

sResults =3D wPassword({default values, optional parms})	-- Opens a window=
 to prompt for a password
sPW =3D GetField(sResults, "pw")		-- Extract the value of a field from the=
 sResults sequence
...
sResults =3D wMaininput({default values, optional parms})	-- Opens a window=
 data entry form
sName =3D GetField(sResults, "name")
sAdr =3D GetField(sResults, "adr")
sPhone =3D GetField(sResults, "phone")
sButton =3D GetButton(sResults)	-- Determine which button caused the window=
 to close, eg. OK, Cancel, etc.
...

wPassword and wMaininput are previously defined window forms.
sResults is a compound sequence (structure) which receives the output of=
 the window.
Optional parms could control which field got initial focus, provide the=
 ability to leave the window open for a specified time, then close it=
 automatically, etc.

At the moment, I haven't thought about how these windows could be=
 interactive (e.g. validity checking), but much could be accomplished by a=
 simple input window, and this model seems more Euphoria-like.

Louis.

*********** REPLY SEPARATOR  ***********

On 10/1/2003 at 6:37 AM Derek Parnell wrote:

>
>
>----- Original Message ----- 
>From: <Louis at cwshop.com>
>To: "EUforum" <EUforum at topica.com>
>Sent: Wednesday, October 01, 2003 4:08 AM
>Subject: Re: Password Prompt - How?
>
>
>> OK, The secret undocumented control ES_PASSWORD works.  
>
>It is documented, just not in the stuff I supply with win32lib. It is a
>standard flag supplied by Microsoft and its documented in the hundreds of
>books about Windows programming AND in the Microsoft SDK. These flags are
>not dreamed up by myself - they are what Microsoft have decided upon.
>
>>Now another question.
>> 
>> I understand how to set up handlers and call WinMain().  I have 
>>always assumed that when the window is closed, WinMain() returns 
>>and execution resumes.  That's where I close the database.  
>
>True, execution does continue after WinMain() returns, but no more calls
>to win32lib code should execute. Closing the database here is okay to do.
>
>>I tried to use a second WinMain() to open another window and found 
>>that it didn't work.  Then I found WinMain is documented that 
>>when it closes, the application also closes.  
>
>Well, more specifically, when WinMain returns, all the windows have been
>destroyed and resources returned to Windows. The application is expected
>to end and no further calls to routines inside win32lib are permitted.
>
>Why did you try to call WinMain again, after it had returned?
>
>>I tried openDialog, 
>>which says it activates handlers and waits for input.  It 
>>doesn't.  It flashes the window on the screen and closes it 
>>immediately.
>
>Is this after WinMain had returned? 
>
>> What I am trying to do is open a window to prompt for a password.
>>The user types in the EditText field and clicks an "OK" button 
>>(or presses Enter).  The window closes and if the password was
>>correct, the main application window opens.  (Has anyone seen 
>>example code?)  I'm not asking someone to write this for me,
>>just give me some hints as to what functions to use.
>
>The w32HOpen event is invoked just PRIOR to a window being opened. You can
>use this event to show your password form and process the user's
>interaction with it before the main window is displayed. 
>
>procedure Open_MainWin(integer self, integer event, sequence parms)
>    openDialog(PasswordForm)
>end procedure                                       
>setHandler(MainWin, w32HOpen, routine_id("Open_MainWin"))
>
>Is that enough of a hint? blink
>
>And by the way, the w32HActivate event occurs AFTER the window is opened.
> 
>> Where would I find things like ES_PASSWORD documented?  
>>Would this be in a "Windows Programming" text?
>
>Oh yes.  There are thousands of special symbol names used when programming
>for Windows and I do not intend to repeat their documentation in the stuff
>I release with win32lib. The Microsoft documenation is already in the
>public domain at http://msdn.microsoft.com and the many Windows
>programming books. I recommend the book called "Windows Programming" by
>Charles Pretzold for API level programming, and  "About Face, The
>Essentials of User Interface Design" by Alan Cooper for how make GUI
>programming effective.
>
>-- 
>Derek

new topic     » goto parent     » topic index » view message » categorize

9. Re: Password Prompt - How?

Louis,

Have you checked out Judith's IDE?

Dan Moyer

----- Original Message -----
From: <Louis at cwshop.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Password Prompt - How?


>
>
> Thanks, Derek.  I had come to the conclusion that Win32Lib was "thin",
meaning that it didn't hide much of Microsoft's underlying structure, as
opposed to a language like Visual Basic which presents a completely
different model of Windows programming.  I had asked before about a Windows
Programming reference, but got no reply then.  Since I am unfamiliar with
Windows programming, I am relying completely on your Win32Lib documentation
and the examples.  I knew I needed a more extensive reference.
>
> To answer your question, I had assumed that if I set up handlers and ran
WinMain() and windows opened, I could close the window and do it again.
When that didn't work, I set up handlers for the password window and called
openDialog() without calling WinMain().  The documentation seemed to
indicate it would obey the handlers and wait for input, but it didn't.  Your
technique is clearly the right way, I just don't (yet) have a proper
reference for Windows programming, so I greatly appreciate your help.
>
> To change the subject, I am impressed with the ease with which Euphoria
programs can be written, though Windows programming is a bit more difficult.
Has anyone put some thought in to a "Visual Euphoria" library which supports
Windows programming in a simplified way?  I'm thinking of a Window Designer
program which the programmer uses to graphically arrange his fields,
checkboxes, etc.  It then creates an include file which supports simple
calls like this:
>
> sResults = wPassword({default values, optional parms}) -- Opens a window
to prompt for a password
> sPW = GetField(sResults, "pw") -- Extract the value of a field from the
sResults sequence
> ...
> sResults = wMaininput({default values, optional parms}) -- Opens a window
data entry form
> sName = GetField(sResults, "name")
> sAdr = GetField(sResults, "adr")
> sPhone = GetField(sResults, "phone")
> sButton = GetButton(sResults) -- Determine which button caused the window
to close, eg. OK, Cancel, etc.
> ...
>
> wPassword and wMaininput are previously defined window forms.
> sResults is a compound sequence (structure) which receives the output of
the window.
> Optional parms could control which field got initial focus, provide the
ability to leave the window open for a specified time, then close it
automatically, etc.
>
> At the moment, I haven't thought about how these windows could be
interactive (e.g. validity checking), but much could be accomplished by a
simple input window, and this model seems more Euphoria-like.
>
> Louis.
>
> *********** REPLY SEPARATOR  ***********
>
> On 10/1/2003 at 6:37 AM Derek Parnell wrote:
>
> >
> >----- Original Message -----
> >From: <Louis at cwshop.com>
> >To: "EUforum" <EUforum at topica.com>
> >Sent: Wednesday, October 01, 2003 4:08 AM
> >Subject: Re: Password Prompt - How?
> >
> >
> >> OK, The secret undocumented control ES_PASSWORD works.
> >
> >It is documented, just not in the stuff I supply with win32lib. It is a
> >standard flag supplied by Microsoft and its documented in the hundreds of
> >books about Windows programming AND in the Microsoft SDK. These flags are
> >not dreamed up by myself - they are what Microsoft have decided upon.
> >
> >>Now another question.
> >>
> >> I understand how to set up handlers and call WinMain().  I have
> >>always assumed that when the window is closed, WinMain() returns
> >>and execution resumes.  That's where I close the database.
> >
> >True, execution does continue after WinMain() returns, but no more calls
> >to win32lib code should execute. Closing the database here is okay to do.
> >
> >>I tried to use a second WinMain() to open another window and found
> >>that it didn't work.  Then I found WinMain is documented that
> >>when it closes, the application also closes.
> >
> >Well, more specifically, when WinMain returns, all the windows have been
> >destroyed and resources returned to Windows. The application is expected
> >to end and no further calls to routines inside win32lib are permitted.
> >
> >Why did you try to call WinMain again, after it had returned?
> >
> >>I tried openDialog,
> >>which says it activates handlers and waits for input.  It
> >>doesn't.  It flashes the window on the screen and closes it
> >>immediately.
> >
> >Is this after WinMain had returned?
> >
> >> What I am trying to do is open a window to prompt for a password.
> >>The user types in the EditText field and clicks an "OK" button
> >>(or presses Enter).  The window closes and if the password was
> >>correct, the main application window opens.  (Has anyone seen
> >>example code?)  I'm not asking someone to write this for me,
> >>just give me some hints as to what functions to use.
> >
> >The w32HOpen event is invoked just PRIOR to a window being opened. You
can
> >use this event to show your password form and process the user's
> >interaction with it before the main window is displayed.
> >
> >procedure Open_MainWin(integer self, integer event, sequence parms)
> >    openDialog(PasswordForm)
> >end procedure
> >setHandler(MainWin, w32HOpen, routine_id("Open_MainWin"))
> >
> >Is that enough of a hint? blink
> >
> >And by the way, the w32HActivate event occurs AFTER the window is opened.
> >
> >> Where would I find things like ES_PASSWORD documented?
> >>Would this be in a "Windows Programming" text?
> >
> >Oh yes.  There are thousands of special symbol names used when
programming
> >for Windows and I do not intend to repeat their documentation in the
stuff
> >I release with win32lib. The Microsoft documenation is already in the
> >public domain at http://msdn.microsoft.com and the many Windows
> >programming books. I recommend the book called "Windows Programming" by
> >Charles Pretzold for API level programming, and  "About Face, The
> >Essentials of User Interface Design" by Alan Cooper for how make GUI
> >programming effective.
> >
> >--
> >Derek
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view message » categorize

10. Re: Password Prompt - How?

----- Original Message ----- 
>From: <Louis at cwshop.com>
>To: "EUforum" <EUforum at topica.com>
>Subject: Re: Password Prompt - How?
>

>Thanks, Derek.  I had come to the conclusion that 
>Win32Lib was "thin", meaning that it didn't hide 
>much of Microsoft's underlying structure, as opposed
>to a language like Visual Basic which presents a 
>completely different model of Windows programming.

Your welcome, and you'd be surprised at how much win32lib does hide! I also do a
*LOT* of VB coding at my paying job, so I know its paradigm well.

>  I had asked before about a Windows Programming
>reference, but got no reply then.  Since I am
>unfamiliar with Windows programming, I am relying
>completely on your Win32Lib documentation and the
>examples.  I knew I needed a more extensive reference.

There is NO WAY I can do the subject justice, especially with such quality books
already out there. Win32lib's aim is to make Windows programming easier than
using the API/SDK directly, but I do not pretend to have an Interactive
Development Environment available. However, Judith Evans has developed a good IDE
for Win32lib. You can pick it up from the
http://www.rapideuphoria.com/contrib.htm page - search for "Enhanced IDE".

>To answer your question, I had assumed that if I set up
>handlers and ran WinMain() and windows opened, I could
>close the window and do it again.  When that didn't 
>work, I set up handlers for the password window and 
>called openDialog() without calling WinMain().  The 
>documentation seemed to indicate it would obey the 
>handlers and wait for input, but it didn't.  Your 
>technique is clearly the right way, I just don't 
>(yet) have a proper reference for Windows programming,
>so I greatly appreciate your help.


The basic format for win32lib programs is (and this is just an example) ...

 ------------------------
 include win32lib.ew
without warning --> optional but gets rid of all the warnings about unused
 variables!

 -- Additional include files that might be needed.
 . . .

 -- File-Scoped-Variables --
 -- Usually integer holders for the control IDs you are going to use.
 . . .

 -- Local routines that are shared by the event handlers.
 -- These are the main location for the application's processing logic.
 . . .

 -- The event handler routines.
 -- These are invoked whenever the relevant events occur.
 . . .

 -- Initialization code --
 -- This sets up the various windows and controls and initializes 
 -- variables etc prior to the FIRST window opening.
 . . .

 -- Now start your app running. When this returns, it means that the user has 
 -- requested the applicaiton to stop.
 WinMain( . . . )

 -- Any optional code that DOES NOT use anything from win32lib.
 . . .

 ------------------------

>To change the subject, I am impressed with the 
>ease with which Euphoria programs can be written, 
>though Windows programming is a bit more difficult.
>  Has anyone put some thought in to a 
>"Visual Euphoria" library which supports Windows
>programming in a simplified way?  I'm thinking of a
>Window Designer program which the programmer uses 
>to graphically arrange his fields, checkboxes, etc.
>  It then creates an include file which supports
>simple calls like this:
> 
> sResults = wPassword({default values, optional parms}) -- Opens a window to
> prompt for a password
> sPW = GetField(sResults, "pw") -- Extract the value of a field from the
> sResults sequence
> ...
> sResults = wMaininput({default values, optional parms}) -- Opens a window data
> entry form
> sName = GetField(sResults, "name")
> sAdr = GetField(sResults, "adr")
> sPhone = GetField(sResults, "phone")
> sButton = GetButton(sResults) -- Determine which button caused the window to
> close, eg. OK, Cancel, etc.
> ...
> 
> wPassword and wMaininput are previously defined window forms.
> sResults is a compound sequence (structure) which receives 
>the output of the window. Optional parms could control which
>field got initial focus, provide the ability to leave the 
>window open for a specified time, then close it automatically, etc.
> 
>At the moment, I haven't thought about how these windows
>could be interactive (e.g. validity checking), but much
>could be accomplished by a simple input window, and
>this model seems more Euphoria-like.

Check out Judith's IDE. It might be useful to you.

-- 
Derek

new topic     » goto parent     » topic index » view message » categorize

11. Re: Password Prompt - How?

Louis at cwshop.com wrote:

>sResults = wPassword({default values, optional parms})	-- Opens a window to
>prompt for a password
>sPW = GetField(sResults, "pw")		-- Extract the value of a field from the
>sResults sequence
>
Derek,

Along with Louis' comments, you already have a generic file browser and
calendar, etc., how about providing a password dialog box so we could
just say

-- part of win32lib.ew
global function getPassword( sequence title, object x )
...
end function

-- my program
pw = getPassword( "titlebar" , { "Username" , "Password" } )

and it would provide a textbox prompt for each string encountered. Any
prompt that equals "Password" would, of course, mask the input. You get
returned a sequence of strings the same length as what you provided.

pw = getPassword( "My Password Program" , {"Password"} ) would just get
a password.
pw = getPassword( "" , {} ) would be a vanilla password dialog box. (The
empty sequence defaults to "Password.")

Just a thought... I'm sure it's easy enough to do without it being
integral to Win32Lib, so maybe just a separate include if not part of
the library.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu