Xbasic

RTF.STYLE Function

IN THIS PAGE

Description

The RTF Memo Editor supports up to 8 different styles.

Style Properties 

Element
Details
Style[N].First_Left_Indent

Type: 'N'. Indent of first line of paragraph.

Style[N].Left_Indent

Type: 'N'. Left indent of paragraph.

Style[N].Right_Indent

Type: 'N'. Right indent of paragraph.

Style[N].Name

Type: 'C'. Name of style.

Style[N].Tab.Align

Type: 'C'. Alignment of tab.

Style[N].Tab.Pos

Type: 'N'. Position of tab.

Example 

dim crtf.text as C
dim num as N = 1
dim name as C
dim first_left_indent as N
dim left_indent as N
dim right_indent as N
crtf.object = rtf.create(" ")
crtf.object.insert("RTF Text to stretch over one line." + crlf()+ "So you can see what full justify does", 1)
crtf.text = crtf.object.rtf_text
ui_dlg_box("Xdialog Sample", <<%dlg%
{xmargin=2}
|{rtf=30,10crtf};
{lf};
Style;
Number |[.5num];
Name |[.25name];
First Indent |[.10first_left_indent];
Left Indent |[.10left_indent];
Right Indent |[.10right_indent];
{lf};
|;
|;
%dlg%,<<%code%
if a_dlg_button="Set_Style" then
    crtf.object.style[num].name = name
    crtf.object.style[num].first_left_indent = first_left_indent
    crtf.object.style[num].left_indent = left_indent
    crtf.object.style[num].right_indent = right_indent
    a_dlg_button = ""
end if
if a_dlg_button="Get_Style" then
    crtf.object.Get_style(num)
    name = crtf.object.style[num].name
    first_left_indent = crtf.object.style[num].first_left_indent
    left_indent = crtf.object.style[num].left_indent
    right_indent = crtf.object.style[num].right_indent
    a_dlg_button = ""
end if
if a_dlg_button = "Left" then
crtf.object.left_justify()
    a_dlg_button = ""
end if
if a_dlg_button = "Right" then
crtf.object.right_justify()
    a_dlg_button = ""
end if
if a_dlg_button = "Toggle_Codes" then
crtf.object.show_codes()
    a_dlg_button = ""
end if
%code%)

Limitations

Desktop applications only.

See Also