Usig Ctrl+Y to delete a line
Moderator: Rathinagiri
Usig Ctrl+Y to delete a line
Hi All,
Is it possible to delete a line in textbox or editbox using Ctrl+Y?
If possible, how to do it?
TIA.
With best regards.
Sudip
Is it possible to delete a line in textbox or editbox using Ctrl+Y?
If possible, how to do it?
TIA.
With best regards.
Sudip
With best regards,
Sudip
Sudip
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Usig Ctrl+Y to delete a line
Hi Sudip
Ctrl-Y isn't very popular for line deleting.
Regards
--
Esgici
Why you don't use Ctrl-Del ? ( after highlighted whole line ) ?sudip wrote: Is it possible to delete a line in textbox or editbox using Ctrl+Y?
Ctrl-Y isn't very popular for line deleting.
Regards
--
Esgici
Viva INTERNATIONAL HMG
Re: Usig Ctrl+Y to delete a line
Yes Esgici. But, is there any way to do so (Ctrk+Y)? Our old Clipper/VFP users may require itesgici wrote: Why you don't use Ctrl-Del ? ( after highlighted whole line ) ?
Ctrl-Y isn't very popular for line deleting.
Esgici
With best regards.
Sudip
With best regards,
Sudip
Sudip
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Usig Ctrl+Y to delete a line
As far as I remember, CTRL+Y comes from DOS WordStar editorsudip wrote:Yes Esgici. But, is there any way to do so (Ctrk+Y)? Our old Clipper/VFP users may require itesgici wrote: Why you don't use Ctrl-Del ? ( after highlighted whole line ) ?
Ctrl-Y isn't very popular for line deleting.
Esgici
With best regards.
Sudip
It is possible, but with a a little work:
1. You must define the key combination and give it an action (ie: ON KEY CONTROL+Y OF ... ACTION ....
2. In the action procedure copy the content of the EditBox to a variable.
3. Scan the variable in a loop (for... mlcount() ... memoline() ... next) and remove the required line (you can detect it via caretpos property).
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Usig Ctrl+Y to delete a line
Hi Sudip
Please take a look following example.
I had worked whole night on the way our Karta adviced.
But what I'm not sure this is a good way. F.e. line deleted by Ctrl+Y, can't undo by Ctrl-Z.
I hope that it will come in handy to you.
Regards
--
Esgici
Perhaps your users are older than mesudip wrote:
Our old Clipper/VFP users may require it
Please take a look following example.
I had worked whole night on the way our Karta adviced.
But what I'm not sure this is a good way. F.e. line deleted by Ctrl+Y, can't undo by Ctrl-Z.
Code: Select all
#include "minigui.ch"
PROC Main()
DEFINE WINDOW frmEBCYTest ;
AT 0,0 ;
WIDTH 640 HEIGHT 490 ;
TITLE 'Harbour MiniGUI EditBox Demo ( Using Cntr-Y for line deleting )' ;
MAIN
ON KEY CONTROL+Y ACTION EBoxDelL()
@ 10,10 EDITBOX Edit_1 ;
WIDTH 610 ;
HEIGHT 440 ;
VALUE MEMOREAD( "EBox_CY.Prg" )
END WINDOW // MAIN
frmEBCYTest.Center()
frmEBCYTest.Activate()
RETURN // Main()
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._
PROC EBoxDelL() // Line deleting in EditBox by pressing Ctrl+Del
LOCA cEBoxContent := frmEBCYTest.Edit_1.Value ,;
nBegPntr := frmEBCYTest.Edit_1.CaretPos,;
nEndPntr := frmEBCYTest.Edit_1.CaretPos
WHILE nBegPntr > 0 .AND. SUBSTR( cEBoxContent, nBegPntr, 2 ) # CRLF
--nBegPntr
ENDDO
nBegPntr += IF( nBegPntr < 1, 0, 1 )
WHILE nEndPntr < LEN( cEBoxContent ) .AND. SUBSTR( cEBoxContent, nEndPntr, 2 ) # CRLF
++nEndPntr
ENDDO
frmEBCYTest.Edit_1.Value := LEFT( cEBoxContent, nBegPntr ) + SUBSTR( cEBoxContent, nEndPntr + 2 )
frmEBCYTest.Edit_1.CaretPos := nBegPntr + 1
RETU // EBoxDelL()
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._
Regards
--
Esgici
Viva INTERNATIONAL HMG
Re: Usig Ctrl+Y to delete a line
Hello Roberto,
Thank you very much. I got another soln from elsewhere. But, this is the best (Both in coding and efficiency)
Hello Esgici:
Excellent. It works like a breeze And I also understand the code
I don't think you are too old. (I know your age)
Age gives us more maturity and experience. In India, we believe aged persons are assets of our society. They can guide us to overcome various difficulties in our life. I believe "real age" lives in our mind.
With my best regards to you all.
Sudip
Thank you very much. I got another soln from elsewhere. But, this is the best (Both in coding and efficiency)
Hello Esgici:
First of all let me pay my gratitude regarding this program.Esgici wrote:Perhaps your users are older than me
Please take a look following example.
I had worked whole night on the way our Karta adviced.
But what I'm not sure this is a good way. F.e. line deleted by Ctrl+Y, can't undo by Ctrl-Z.
Excellent. It works like a breeze And I also understand the code
I don't think you are too old. (I know your age)
Age gives us more maturity and experience. In India, we believe aged persons are assets of our society. They can guide us to overcome various difficulties in our life. I believe "real age" lives in our mind.
With my best regards to you all.
Sudip
With best regards,
Sudip
Sudip
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Usig Ctrl+Y to delete a line
Hi Sudip
Thanks for nice words, especially about age
Please test it carefully before committing to users.
Regards
--
Esgici
Thanks for nice words, especially about age
Please test it carefully before committing to users.
Regards
--
Esgici
Viva INTERNATIONAL HMG
Re: Usig Ctrl+Y to delete a line
Hi Esgici,
There are sometimes when I feel depressed. All my positive thinking don't work for time being. Only one thing comes to rescue me - Faith. Faith in Myself, Faith in my Work, Faith in God. (Sorry, to write irrelevant words. But, I am now feeling very good!!!)
Thank you all.
With best regards.
Sudip
Thanks a lot! Yes I shall do it!Esgici wrote:Please test it carefully before committing to users.
There are sometimes when I feel depressed. All my positive thinking don't work for time being. Only one thing comes to rescue me - Faith. Faith in Myself, Faith in my Work, Faith in God. (Sorry, to write irrelevant words. But, I am now feeling very good!!!)
Thank you all.
With best regards.
Sudip
With best regards,
Sudip
Sudip
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Usig Ctrl+Y to delete a line
Hi Sudipsudip wrote: ...
Sorry, to write irrelevant words. ...
Please don't worry, your words doesn't irrelevant; personally I'm sure that I'am correctly understanding you and sharing your sens
Only a very little difference in detail: my faith list is in reverse order than yours.
Best Regards
--
Esgici
Viva INTERNATIONAL HMG
Re: Usig Ctrl+Y to delete a line
Thanks a lot again. My wife is just sitting beside me (looking at what I am typing). And she is agree with your orderesgici wrote:Hi Sudipsudip wrote: ...
Sorry, to write irrelevant words. ...
Please don't worry, your words doesn't irrelevant; personally I'm sure that I'am correctly understanding you and sharing your sens
Only a very little difference in detail: my faith list is in reverse order than yours.
Regards.
Sudip
With best regards,
Sudip
Sudip