April 29, 2024, 01:14:54 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Text Box

Started by tbohon, October 20, 2008, 01:44:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tbohon

I'm trying to figure out how to know when a user hits <cr> after typing in a text box.  I need to grab whatever it is that was typed to evaluate it.

Thoughts?

Tnx.

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

LarryMc

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

tbohon

Thanks, Larry - I'll see if I can twist, err, tweak that code to do what I need to do.

Best,

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

tbohon

Larry:

Works like a charm ... !!!   ;D

Thanks again.

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

tbohon

Follow-on question:

I have the issue above resolved.  However, I want to be able to start the 'end program' activities (saving any changed files, cleaning up, etc.) when the user types 'quit' in the text box.  So far I have the command line parsed out and am examining the first value (which is the command, 'quit' in this case).  However, when I find 'quit' I can't figure out how to make the program think that the 'exit' button (or the 'x' button in the upper right) has been clicked.  I tried to simply set run to zero (0) and return but that event isn't trapped and doesn't do anything for me.

Note that I have an 'Exit' button and it works just fine by setting run to zero ...

Maybe I need to throw the 'close window' event somehow ... ?  Any thoughts? 

Tnx in advance.

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

LarryMc

CLOSEWINDOW MyWin

or SENDMESSAGE MyWin, @IDCLOSEWINDOW,0,0  maybe

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

tbohon

Larry:

I think this gets me closer but it still doesn't do anything - seems to want one more parameter (per the help file) ... and I don't know what to put there.

Here's the window code and the SENDMESSAGE line ...

' Declare window and controls, set color, center window on open
WINDOW w1,0,0,810,582,0x80CB0080,0,"Window w1 Title Goes Here",main
CONTROL w1,"RE,,29,26,747,477,0x50800804,1"
CONTROL w1,"E,Edit1,29,517,543,22,0x50800080,2"
CONTROL w1,"B,Print,614,519,70,20,0x50000000,3"
CONTROL w1,"B,Exit,705,519,70,20,0x50000000,4"

SETWINDOWCOLOR w1,RGB(176,196,222)

CENTERWINDOW w1

...

SENDMESSAGE w1,@IDCLOSEWINDOW,0,0,


I tried putting all of the control numbers (one at a time) at the end of the SENDMESSAGE but it just beeps at me.

ARRGHHHHH!!!  :)

Tnx.

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

LarryMc

SENDMESSAGE shouldn't have that last comma.

Besides I tried it and I couldn't get it to work anyway.

In the handler where you are catching the "quit" text I would call a subroutine to do all your file saving, etc. and then just use CLOSEWINDOW w1

Maybe Graham or Sapero or Paul knows a better way.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Ionic Wind Support Team

Send it a WM_CLOSE message (0x10)

SENDMESSAGE w1,0x10,0,0

Ionic Wind Support Team

LarryMc

How come SENDMESSAGE w1,@IDCLOSEWINDOW,0,0 wouldn't work?

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

aurelCB

I use in my interpreter this
after parser:

SELECT command
    CASE "QUIT"
     GoTo Quit()
ENDSELECT

SUB Quit
CLOSEWINDOW win
RETURN

or if you want finish main program:

Quit:
CLOSEWINDOW win
END

Ionic Wind Support Team

Larry,
@IDCLOSEWINDOW is a private message and has a different value than WM_CLOSE.   Technically it should work, but since it didn't I suggested sending it the real close window message, which will be mapped to @IDCLOSEWINDOW internally. 

Paul.

Ionic Wind Support Team

tbohon

Paul:

Works like a charm.  I still need to study it a bit but I think I understand what's happening.

Larry and aurelcb:

Thanks for your help.  The willingness of members here to jump in and suggest fixes is one of the strengths of this forum - we all learn every time this happens.

Maybe some day I can actually help folks rather than always asking questions ...  :o

Best,

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

LarryMc

Tom

What little I know has come from the people on the forums.

I know I've tried Paul's patience a few times but he's been able to teach me a little about the internal workings of windows.

I rely on Paul and Sapero to bail me out all the time.

The EBasic source code also helps a lot.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library