Xojo Conferences
XDCMay2019MiamiUSA

StyledText (Real Studio games Mailinglist archive)

Back to the thread list
Previous thread: Eclipse update
Next thread: server assumption...


[ANN] Preview of RBD 2.4   -   Marc Zeedar
  StyledText   -   KamaShin
   Re: StyledText   -   Asher Dunn

StyledText
Date: 02.01.05 00:31 (Sun, 2 Jan 2005 00:31:03 +0100)
From: KamaShin
Hi guys,
I'm writing a script editor for a game. The script is written in an
editfield and I'd like to make something ressembling RB's own behavior:
when keywords are recognized, I'd like to write them in a special
color, numbers too and strings and so on... Is there an "easy" way of
doing so, or do I have to go the "long" way, meaning I have to write
huge procedures of keywords recognition, delete the recognized word to
rewrite it using the styledText property of my EditField, and call
those functions each time the user press a key? (I clearly understood
what StyleText class does but I'm not sure about the StyleRuns, so I
was wondering if they could be used for such a purpose...)
and if there is no "easy" way, could anyone give me hints (if not piece
of codes) to help me optimize my code? (to recognize words the user is
writting is no big deal, however I'm beginning to see trouble coming
when I'll have to "update" the EditField as soon as the word is
recognized: let's say the keyword is "End", the user will first write
"En", so far so good, the text simply appears black in my EditField,
but as soon as the letter "d" is written, the "End" word should appear
in blue... If I understood clearly, to change this word's color, I ve
got 2 choices: clear the black version, set the
MyEditField.StyledText.TextColor property to blue, re-write it, and set
the text color back to black. Else, I can force the selection of the
word, and change the SelTextColor property... that sounds a bit
annoying to code...)
Also I'll probably soon ask for hints/help about autocompletion (things
like dealing with the "contextual menu??" that appears when you hit tab
in RB and there are multiple choices to finish your word and so on...
but I'll ask about that later)
thanks for your help :)

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: StyledText
Date: 02.01.05 01:18 (Sat, 1 Jan 2005 19:18:00 -0500)
From: Asher Dunn

On Jan 1, 2005, at 6:31 PM, KamaShin wrote:

> <snip>

> If I understood clearly, to change this word's color, I ve got 2
> choices: clear the black version, set the
> MyEditField.StyledText.TextColor property to blue, re-write it, and
> set the text color back to black. Else, I can force the selection of
> the word, and change the SelTextColor property... that sounds a bit
> annoying to code...)
> thanks for your help :)

MyEditField.StyledText.TextColor is not a property, it is a method that
takes the start and length to apply the effect. For instance,
'MyEditField.StyledText.TextColor(0, 5) = &c0000FF' would change the
first 5 characters of the editField to blue.

Asher Dunn
--------------------------------------------------------
President and Head Developer of Fireye Software
<http://www.fireyesoftware.com/>
AIM and Yahoo: fireye7517

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>