How do I add a Close button in editbox and other similar objects?
Or, is it possible to add something like: On Escape, close object?
Also, how do I hide cursor in an editbox (created as readonly)?
Once again, thank you for the help.
Editbox and other objects
Moderator: Rathinagiri
Re: Editbox and other objects
The original post did not get a reply, so please allow me to re-phrase my question.
In a form, there is an editbox object. After reading, how do users close the editbox (since there is no Close button)? In the program, I cannot issue a Release statement because there is no trigger.
So, I tried this:
@ 10, 10 EDITBOX ebRein ;
PARENT MainForm ;
WIDTH 300 ;
HEIGHT 300 ;
VALUE "Reindexing files..." + CRLF ;
ON GOTFOCUS ReinQuit();
READONLY
...
function ReinQuit()
// quit editbox if escape is pressed by user
if lastkey() == K_ESC
MainForm.ebRein.Release
endif
return NIL
It did not work. What I was trying to do was:
if object has focus, check if last keypressed is ESC.
If yes, then close object.
Any idea how to do it?
All I want is allow the user to close the editbox.
Please help. TYVM.
In a form, there is an editbox object. After reading, how do users close the editbox (since there is no Close button)? In the program, I cannot issue a Release statement because there is no trigger.
So, I tried this:
@ 10, 10 EDITBOX ebRein ;
PARENT MainForm ;
WIDTH 300 ;
HEIGHT 300 ;
VALUE "Reindexing files..." + CRLF ;
ON GOTFOCUS ReinQuit();
READONLY
...
function ReinQuit()
// quit editbox if escape is pressed by user
if lastkey() == K_ESC
MainForm.ebRein.Release
endif
return NIL
It did not work. What I was trying to do was:
if object has focus, check if last keypressed is ESC.
If yes, then close object.
Any idea how to do it?
All I want is allow the user to close the editbox.
Please help. TYVM.
Re: Editbox and other objects
LASTKEY does not work in GUI.
You can add:
or
You can add:
Code: Select all
ON KEY ESCAPE OF MainForm ACTION ReinQuit()
Code: Select all
ON KEY ESCAPE OF MainForm ACTION MainForm.ebRein.Release
Re: Editbox and other objects
It worked! Thank you very much, Marek.
Is this the only way to allow the user to close an object?
Is it not possible to add a Close button (X) at the top-right part?
This editbox is a progress window for indexing files. While indexing is going on, I pressed Esc. It did close the editbox window but the indexing process did not terminate prematurely (thankfully!).
Thanks again, Marek, you've been a very big help to me.
Is this the only way to allow the user to close an object?
Is it not possible to add a Close button (X) at the top-right part?
This editbox is a progress window for indexing files. While indexing is going on, I pressed Esc. It did close the editbox window but the indexing process did not terminate prematurely (thankfully!).
Thanks again, Marek, you've been a very big help to me.
Re: Editbox and other objects
You can use standalone button and set its action to release editbox.
I'm glad to help you!
Marek
I'm glad to help you!
Marek
Re: Editbox and other objects
Thanks, Marek, for the suggestion.