WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Colored text within an editbox (https://www.wowinterface.com/forums/showthread.php?t=48307)

Billtopia 10-05-13 03:03 PM

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...

Seerah 10-05-13 09:04 PM

WoWLua uses the ForAllIndentsAndPurposes library.

kurapica.igas 10-05-13 09:08 PM

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

Billtopia 10-06-13 06:01 AM

Thanks... those were exactly what I was looking for...


All times are GMT -6. The time now is 03:16 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI