Changing the Tab position of a TextArea Rule

  1. 2 years ago

    Emile S

    5 Dec 2016 Europe (France, Strasbourg)
    Edited 2 years ago

    I have to change the Tab location, number of Tabs, etc. in a TextArea rule.

    How can I do that ?

    I want to be able to set a tab at \tx567, and some other at different locations.

  2. 11 months ago

    Vincent S

    13 Apr 2018 Pre-Release Testers, Xojo Pro Amsterdam
    Edited 11 months ago

    This works for me. I found the basic idea from someone else on this forum. The code can be put e.g. in the Texture open event.

    Const Twips = 567 //specifies roughly 1 cm
    Const NumberofTabs = 8
    dim RTFHeader as string = "{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf400" + EndOfLine + _
    "{\fonttbl\f0\fswiss\fcharset0 Helvetica;}" + EndOfLine + _
    "{\colortbl;\red255\green255\blue255;}" + EndOfLine + _
    "{\*\expandedcolortbl;;}" + EndOfLine + _
    "\paperw23800\paperh16840\margl1440\margr1440\vieww21600\viewh8400\viewkind0" + EndOfLine
    dim TabString as string = "\pard\"
    for i as integer = 0 to NumberofTabs //This section needs customisation when Tabs require other spacings
      TabString = TabString + "tx" + Str(i * Twips) +"\" //This sets each tab at approximately 1cm. 
    TabString = TabString + "tqr\" + EndOfLine //Provide a required end string to the tab string
    dim RTFFooter as string = EndOfLine + "\f0\fs24 \cf0 "
    dim RTFTabSetting as string = RTFHeader + MainWindow.TabString + RTFFooter + "}"
    Dim c As New Clipboard
    c.AddRawData (RTFTabSetting, "public.rtf")
    TextArea1.Paste //This last action sets the Tab spacing on the TextArea
  3. Emile S

    15 Apr 2018 Europe (France, Strasbourg)


or Sign Up to reply!