Página 1 de 1
Is there a way to start an Edit/Memo field at a certain position?
Publicado: Vie Jul 26, 2013 1:09 am
por Guest
Hi,
If you place an initial value, say 3 spaces or the word "Content: " in a
memo field mmoMemoField:Value := " ", the initial position when you
start typing is still the beginning of the field.
Is there a way to start typing, on whatever the current line is, in a
position at the end of the current content of the line, in an Edit or
Memo field?
So if the first line in the memo field has 3 spaces, can the cursor be
set at position 4?
Is there a way to start an Edit/Memo field at a certain position?
Publicado: Vie Jul 26, 2013 3:06 am
por Guest
Further clarification:
The lWantReturn attribute is set to false, so that the carriage return
can be trapped.
When the carriage return is pressed, a CRLF is added to the current
TMemo.Value field, along with an initial value for the next line
e.g.
sInitialLineString := "CONTENTS: "
::memoField:Value := ::mmoField:Value + CRLF + sInitialLineString
, but the cursor afterwards always ends up in the first column, first line.
The Help file mentions an nLine property, which unfortunately generates
a No exported variable message when used:
e.g.
::mmoField:nLine := 7
If the property function is used directly, e.g.
::mmoField:SetLineNumber( 2 ),
same thing for the nColumn property, which is in the Memo.prg source,
but not mentioned in the Help file.
I'm assuming that GetColumnNumber() and GetLineNumber() can't be used
because they are set to RESERVED. But nLine and nColumn should be
available.
Is there a way to start an Edit/Memo field at a certain position?
Publicado: Vie Jul 26, 2013 9:57 am
por ignacio
Childers escribió el vie, 26 julio 2013 01:09Hi,
If you place an initial value, say 3 spaces or the word "Content: " in a
memo field mmoMemoField:Value := " ", the initial position when you
start typing is still the beginning of the field.
Is there a way to start typing, on whatever the current line is, in a
position at the end of the current content of the line, in an Edit or
Memo field?
So if the first line in the memo field has 3 spaces, can the cursor be
set at position 4?
Hello,
- Use method Append( cText ) to add content add the end
- Use method Replace( cText ) to replace actual selected content
- To select any content use method SetSel()
For example:
WITH OBJECT oMemo
:SetSel( 3, 6 ) // From pos 3 to 6
:Replace( "New" )
END WITH
Regards,
Note: I highly appreciate if you could use the PRO groups.
Is there a way to start an Edit/Memo field at a certain position?
Publicado: Vie Jul 26, 2013 12:25 pm
por Guest
>>
Hello,
- Use method Append( cText ) to add content add the end
- Use method Replace( cText ) to replace actual selected
content
<<
Yeah, I used Append previously, but didn't recall whether it would allow
the user to automatically start typing at a specific position. Will
try, thanks.
>>Note: I highly appreciate if you could use the PRO groups. <<
Nope, that doesn't work. I've tried many times in the past, and it
continues to ask me for an id & password. When the password I have for
for forum is typed in, it says it's invalid.
Is there a way to start an Edit/Memo field at a certain position?
Publicado: Vie Jul 26, 2013 12:48 pm
por ignacio
Childers escribió el vie, 26 julio 2013 12:25>>
Nope, that doesn't work. I've tried many times in the past, and it
continues to ask me for an id & password. When the password I have for
for forum is typed in, it says it's invalid.
Fixed. Now you should be able to post on PRO forums.
Regards,
Is there a way to start an Edit/Memo field at a certain position?
Publicado: Vie Jul 26, 2013 1:46 pm
por DC
Ok, will do so next time, thanks.