is_tab_stop question

Started by csgoh, June 17, 2010, 01:17:23 AM

Previous topic - Next topic

csgoh

I am starting to learn this opendcl.
i wrote the following lsp to get the user so input text for the lot number.
1st scenario. the "is tab stop" in the ok button is set to false. Key in say 1234567 into the lot number textbox and click ok. It returns the same.
2nd scenario. the "is tab stop" in the ok button is set to true. Key in say 987654 into lot number textbox and press return and press return again. It did not return 987654 but return 1234567.
So, isnt pressing return on the ok button and clicking on the ok button the same?
I hope you can understand what i am trying to say and i apologise for no being able to put it clearer.
Many thanks.

BazzaCAD

Have a look at the (defun c:UPI_frmUPI_tbLotNo_OnReturnPressed) Event.
Then run your OK button code when it's fired....
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

csgoh

Ok, check the ReturnPress event.
variable lotno is event ReturnPress is fired
variable lotno1 is event ok is fired.

case 1. enter a value 13579 for the lot number. press enter and enter for the ok button.

It returns
Command: (print lotno)

"13579" "13579"

Command: (print lotno1)

nil nil

case 2 : enter 357913 for the lot number. press enter and click mouse for the ok button.
It returns
Command: (print lotno)

"13579" "13579"-----> this is the old value entered the first time.

Command: (print lotno1)

"357913" "357913"

So it returns different result when clicking using mouse and pressing return at the ok button.
How to do it so that both action returns the same result. Something wrong in my code?
attached the updated code.




BazzaCAD

I'm sorry you code is too large from me to go through it line by line & figure out what's wrong with it.
So I've put together this sample that shows how to get the same results from hitting enter on a text box & on the OK button.
I hope it helps you out....
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

velasquez

Hi 
Very good your example. 
But it imagines that TextBox loses the focus for a PictureBox or ListBox. 
How could I close the form pressing Enter or Esc?