Coloring Section Of A TextArea

BlitzMax Forums/MaxGUI Module/Coloring Section Of A TextArea

Hardcoal(Posted 2013) [#1]
Lets Say I want To colorize just one word
how do I do that.

And aslo Are there any Good MaxGui Example Files?


col(Posted 2013) [#2]
Hiya,

FormatTextAreaText

is what you're looking for.

An eg..
Strict

Import MaxGUI.Drivers

Global Win:TGadget = CreateWindow("TextArea colours",0,0,400,400,Null,WINDOW_DEFAULT|WINDOW_CENTER)
Global TArea:TGadget = CreateTextArea(0,0,ClientWidth(Win),ClientHeight(Win),Win)
SetGadgetText(TArea,"This is some coloured text.")

' Set 'This is' to blue
FormatTextAreaText(TArea,0,0,255,0,0,7)

' Set 'coloured' to green
FormatTextAreaText(TArea,0,255,0,0,13,8)

Repeat
	WaitEvent
	
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	
	EndSelect
Forever



col(Posted 2013) [#3]
You may ( or may not as its Windows only ) find this link useful too for your editor

TextArea underline color

And some line numbers too if you wanted them. Again Windows only, sorry.


Hardcoal(Posted 2013) [#4]
Hey Col
Great Post, tnx that whats I needed
Its rarely that people Actualy answer straight to the point.
This is one of them.

btw
Im making a set of MaxGui Examples that will be available for download
in my shared fodlers soon


Derron(Posted 2013) [#5]
Why is it rare that there are "straight answers" : because most people asking are just to lazy to search for the problem and hope others will do.

Not all of us have the time to write specific examples for ones problems - especially if it is just an example showing off some commands one would find in the manuals.


bye
Ron


Hardcoal(Posted 2013) [#6]
Lazy?

First Im searching before I ask.
and Whats wrong about asking? its not about laziness.
Thats why a forum exists!

FormatTextAreaText doesnt strike as a TextColorChanger.

When you have million stuff to do you dont want to get stuck on suppose to be a simple Instruction.

By your Standard forums would be empty of posts beside questions about Einstein theory's

Besides if you will notice, I wasnt saying people dont answer.
I was saying that straight clear answers are hard to get.

I also plan to release Example for download at any field
to help others save time and frustration

Cheers


Derron(Posted 2013) [#7]
It was a more generic response to your statement, not a personal insult. Do not get that wrong.

And for searching: I think you would better search for "colo(u)red text" or "syntax highlighting" (which should not only bring results for "color" but for other font styles too)

In your case:
https://www.google.de/search?q=coloured%20text%20maxgui

hmm... first hit (for me) are the wikibooks-pages which are nothing but the manual in another form.

Although a forum search is a good idea, google or other search engines do the work of "american/british-english" etc [colo(u)red]. and also give ideas of synonyms and related searches.


bye
Ron


Hardcoal(Posted 2013) [#8]
Tnx for clearing and for the advices, Im quickly learning the whole deal.
The problem in searches is that sometimes you are not sure if you are not searching for something that those not exists on first place.

So the meaning of some questions are to ask "Is it possible at all"

ATM Im trying to deal with Code parsing. God knows if ill make it.

Cheers