Thread Tools Display Modes
10-05-13, 03:03 PM   #1
Billtopia
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 110
Colored text within an editbox

so, in my addon Slash Magic, I have a large, multiline editbox for inputting lua scripts to turn into slash commands. Is there any method within WoW to do syntax coloring within an editbox or would I have to go line editor with a text frame for the code? I think I prefer the huge editbox for coding myself...
  Reply With Quote
10-05-13, 09:04 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
WoWLua uses the ForAllIndentsAndPurposes library.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
10-05-13, 09:08 PM   #3
kurapica.igas
A Chromatic Dragonspawn
Join Date: Aug 2011
Posts: 152
Lua Code:
  1. RED = "|cffff0000"
  2. CLOSE = "|r"
  3.  
  4. editbox:SetText(RED .. "red text" .. CLOSE .. " normal part")

You need to color all text yourself. Or using some existed lib to do this. Search "FAIAP.lua", it's easy to be used.

BTW, I also have a lib to support the lua editor, with many other features, like double-click to select, undo, redo(based on the operation not time), an auto-complete system looks like(use up, down to select, use tab to select and cycle, just like sublimetext) :



Example can be found here : IGAS-Cube

Last edited by kurapica.igas : 10-05-13 at 09:19 PM.
  Reply With Quote
10-06-13, 06:01 AM   #4
Billtopia
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 110
Thanks... those were exactly what I was looking for...
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Colored text within an editbox

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off