MCPcopy Create free account
hub / github.com/WheretIB/nullc / SetTextStyle

Method SetTextStyle

GUI/RichTextarea.cpp:781–797  ·  view source on GitHub ↗

Set style parameters. bold\italics\underline flags don't work together

Source from the content-addressed store, hash-verified

779}
780// Set style parameters. bold\italics\underline flags don't work together
781bool RichTextarea::SetTextStyle(unsigned int id, unsigned char red, unsigned char green, unsigned char blue, bool bold, bool italics, bool underline)
782{
783 // There are FONT_STYLE_COUNT styles available
784 if(id >= FONT_STYLE_COUNT)
785 return false;
786 tStyle[id].color[0] = red;
787 tStyle[id].color[1] = green;
788 tStyle[id].color[2] = blue;
789 tStyle[id].font = FONT_REGULAR;
790 if(bold)
791 tStyle[id].font = FONT_BOLD;
792 if(italics)
793 tStyle[id].font = FONT_ITALIC;
794 if(underline)
795 tStyle[id].font = FONT_UNDERLINED;
796 return true;
797}
798
799bool RichTextarea::SetLineStyle(unsigned int id, HBITMAP img, const char *tooltipText)
800{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected