Jump to content

_StringToRichEditArray (HTML Tags for RichEdit)


InunoTaishou
 Share

Recommended Posts

You can now use your favorite html tags in a richedit control!

Supports:

  • <b></b> (bold)
  • <i></i> (italic)
  • <s></s> (strike)
  • <u></u> (underline)
  • <color=#nnnnnn></color> (color text)
  • <color=0xnnnnn></color> (color text)
  • <bkcolor=#nnnnnn></color> (color background text)
  • <bkcolor=0xnnnnnn></color> (color background text)
  • <font name="Font name" size=n></font>

(Font name is the only one that has to have quotes around it. They can be double quotes or single, it doesn't matter. color, bkcolor, and size can also use quotes but they're optional)

Does not support (but I may add later)

  • <align>
  • <a href="">
  • <img>

dsMygOf.png

; Functions
_GUICtrlRichEdit_AppendHtmlText
_StringToRichEditArray
__GetArrayFromRegex
__GetRichEditAttrFromChar
__GUICtrlRichEdit_AppendTextColored
__GUICtrlRichEdit_SetTextColor

(I'm sure someone can come up with some better names for this lol)

You can use a formatted (<color=0xNNNNNN>Formatted</color>) or non-formatted (Non-formatted) string with calling _GUICtrlRichEdit_AppendHtmlText and _StringToRichEditArray. _StringToRichEditArray will just set the attributes, font name, font size, and colors to the current attributes of the RichEdit Control (At least it should... RichEdit can be picky about setting the font and char attributes correctly....).

Calling _StringToRichEditArray will return a 2d array with n amount of rows.

[n][0]  - String
[n][1]  - Font name for the [0] string.
[n][2]  - Font size for the [0] string.
[n][3]  - Character attributes for the [0] string.
[n][4]  - Text color for the [0] string.
[n][5]  - Back color for the [0] string.

It seems I was too hasty in my release and this still wasn't working 100% :(. I guess I'll try to work on it tomorrow and see if I can get it working  the way tags are supposed to work. It's not a complete waste, it's close  but not perfect and I know why.

Formatted RichEdit Array V2.rar

Html Richedit.rar

Edited by InunoTaishou
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...