Apply hanging indent style to only a specific line?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 222
- Joined: Thu Jul 01, 2010 11:50 am
Apply hanging indent style to only a specific line?
Can I select some text in a field, click a button, and have that text (and only that text) formatted as a hanging indent?
I've seen recipes that involve setting the leftmargin of the field, but that affects every line in the field, on all cards, which is not what I want. I want to format only a specific paragraph as a hanging indent on demand.
My current method is to select the text in LC, copy it to the clipboard, switch to TextEdit (Mac text editor), past the text, create the hanging indent with the ruler, select the text, copy it to the clipboard, switch back to LC, select the text, and paste the formatted text back in. This is cumbersome, to say the least.
I imagine there a convoluted way by copying the rtftext of the field to a variable, finding the right line in that string (somehow), adding the hanging indent code, setting the entire text of the field to the rtftext variable, then restoring the selection or insertion point.
I've seen recipes that involve setting the leftmargin of the field, but that affects every line in the field, on all cards, which is not what I want. I want to format only a specific paragraph as a hanging indent on demand.
My current method is to select the text in LC, copy it to the clipboard, switch to TextEdit (Mac text editor), past the text, create the hanging indent with the ruler, select the text, copy it to the clipboard, switch back to LC, select the text, and paste the formatted text back in. This is cumbersome, to say the least.
I imagine there a convoluted way by copying the rtftext of the field to a variable, finding the right line in that string (somehow), adding the hanging indent code, setting the entire text of the field to the rtftext variable, then restoring the selection or insertion point.
Re: Apply hanging indent style to only a specific line?
Hi Michael,
check -> firstindent in the dictionary, sounds like that is what you are looking for!
Best
Klaus
check -> firstindent in the dictionary, sounds like that is what you are looking for!
Best
Klaus
-
- Posts: 222
- Joined: Thu Jul 01, 2010 11:50 am
Re: Apply hanging indent style to only a specific line?
Like I said, I don't want to set the leftmargin of the field, and doing a hanging indent with firstindent seems to require that.
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Apply hanging indent style to only a specific line?
Hi Michael,
set the leftIndent to e.g 17 and the firstIndent to -17 for a paragraph.
See attachement "Paragraph Formatting Properties"
Kind regards
Bernd
set the leftIndent to e.g 17 and the firstIndent to -17 for a paragraph.
Code: Select all
on mouseUp
lock screen
set the leftIndent of line 2 of field 1 to 17
set the firstIndent of line 2 of field 1 to -17
unlock screen
end mouseUP
See attachement "Paragraph Formatting Properties"
Kind regards
Bernd
-
- Posts: 222
- Joined: Thu Jul 01, 2010 11:50 am
Re: Apply hanging indent style to only a specific line?
That did it, thanks!
Re: Apply hanging indent style to only a specific line?
Hi.
LiveCode55DP1field.livecode crashes on Windows 10 Home.
Livecode 9.6.1
1) Run LiveCode55DP1field.livecode in the IDE.
2) Select the word You in the second paragraph.
3) Click the button : Flag Selection.
4) Click the button : Transfer Selection.
5) LiveCode crashes without warning.
If you try the above without clicking on button Flag Selection then
everything is OK.
Anybody else experiencing this ?
Sincere
Thunder
LiveCode55DP1field.livecode crashes on Windows 10 Home.
Livecode 9.6.1
1) Run LiveCode55DP1field.livecode in the IDE.
2) Select the word You in the second paragraph.
3) Click the button : Flag Selection.
4) Click the button : Transfer Selection.
5) LiveCode crashes without warning.
If you try the above without clicking on button Flag Selection then
everything is OK.
Anybody else experiencing this ?
Sincere
Thunder
bn wrote: ↑Thu Nov 05, 2020 10:42 pmHi Michael,
set the leftIndent to e.g 17 and the firstIndent to -17 for a paragraph.
Code: Select all
on mouseUp lock screen set the leftIndent of line 2 of field 1 to 17 set the firstIndent of line 2 of field 1 to -17 unlock screen end mouseUP
See attachement "Paragraph Formatting Properties"
LiveCode55DP1field.livecode.zip
Kind regards
Bernd
Re: Apply hanging indent style to only a specific line?
This has really helped me out. Wow, there is quite some fine text control in LC but it's knowing where to look!