DingZhiGang:
Please see the code as below. I hope it could realize setting the different key words as different color( I set 5 color). But when run it just only show the last color {0x808080, 0xFEFCF5}. Would you help me to check whether need add any more code?static int sz_color[5][2] = { {0xFF0000, 0xFFFF00}, {0xC00000, 0xFF8000}, {0x808080, 0xE4E4E4}, {0x008000, 0xD5FFD5}, {0x808080, 0xFEFCF5} }; for( int i=0; i<5; i++) { SendMessage(SCI_STYLESETBACK, 31, sz_color[i][0]); SendMessage(SCI_STYLESETFORE, 31, sz_color[i][1]); SendMessage(SCI_INDICSETSTYLE, 2, INDIC_ROUNDBOX); SendMessage(SCI_STARTSTYLING, pos_start, 31); SendMessage(SCI_SETSTYLING, pos_end, 31); }
A style has one foreground and one background colour. Your loop is setting style 31 to 5 different colour pairs so only the last values set remain. It is also mixing up indicator settings (SCI_INDICSETSTYLE) with style settings (SCI_STYLESETFORE). If you are using SCI_INDICSETSTYLE, 2 because you want to use indicator 2 then use INDIC2_MASK for SCI_STARTSTYLING and SCI_SETSTYLING and use SCI_INDICSETFORE to set the colour. Neil _______________________________________________ Scintilla-interest mailing list [email protected] http://mailman.lyra.org/mailman/listinfo/scintilla-interest
