Scintilla折叠边缘图标

时间:2014-05-20 16:36:54

标签: lua scintilla

我使用的以下代码设置了一个Scintilla窗口进行折叠:

local SCI_STYLECLEARALL = 2050
local SCI_SETMARGINMASKN = 2244
local SCI_SETMARGINSENSITIVEN = 2246
local SCI_STYLESETFORE = 2051
local SCI_MARKERDEFINE = 2040
local SC_MARKNUM_FOLDEROPEN = 31
local SC_MARK_BOXMINUS = 14
local SC_MARKNUM_FOLDER = 30
local SC_MARK_BOXPLUS = 12
local SC_MARKNUM_FOLDERSUB = 29
local SC_MARK_VLINE = 9
local SC_MARKNUM_FOLDERTAIL = 28
local SC_MARK_LCORNERCURVE = 16
local SCI_MARKERSETFORE = 2041
local SCI_MARKERSETBACK = 2042
local SCI_SETFOLDMARGINCOLOUR = 2290
local SCI_USEPOPUP = 2371
local SCI_SETMARGINWIDTHN = 2242
local SCI_STYLESETSIZE = 2055
Scintilla.SendMessage(Ctrl,SCI_STYLECLEARALL,0,0)
Scintilla.SendMessage(Ctrl,SCI_SETMARGINWIDTHN,1,0)
Scintilla.SendMessage(Ctrl,SCI_SETMARGINSENSITIVEN,2,1)
Scintilla.SendMessage(Ctrl,SCI_SETMARGINMASKN,2,-33554432)
Scintilla.SendMessage(Ctrl,SCI_STYLESETFORE,32,12632256)
Scintilla.SendMessage(Ctrl,SCI_MARKERDEFINE,SC_MARKNUM_FOLDEROPEN,SC_MARK_BOXMINUS)
Scintilla.SendMessage(Ctrl,SCI_MARKERDEFINE,SC_MARKNUM_FOLDER,SC_MARK_BOXPLUS)
Scintilla.SendMessage(Ctrl,SCI_MARKERDEFINE,SC_MARKNUM_FOLDERSUB,SC_MARK_VLINE)
Scintilla.SendMessage(Ctrl,SCI_MARKERDEFINE,SC_MARKNUM_FOLDERTAIL,SC_MARK_LCORNERCURVE)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETFORE,SC_MARKNUM_FOLDER,12632256)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETBACK,SC_MARKNUM_FOLDER,16777215)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETFORE,SC_MARKNUM_FOLDEROPEN,12632256)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETBACK,SC_MARKNUM_FOLDEROPEN,16777215)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETBACK,SC_MARKNUM_FOLDERSUB,12632256)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETBACK,SC_MARKNUM_FOLDERTAIL,12632256)
Scintilla.SendMessage(Ctrl,SCI_SETMARGINWIDTHN,2,20)
Scintilla.SendMessage(Ctrl,SCI_USEPOPUP,0,0)
Scintilla.SendMessage(Ctrl,SCI_SETFOLDMARGINCOLOUR,1,16777215)
Scintilla.SendMessage(Ctrl,SCI_STYLESETSIZE,32,10)

但无论出于何种原因,折叠打开/关闭的默认圆圈图标不会被新值覆盖,因此圆圈显示在新选择的下方:

enter image description here

已尝试SCI_MARKERDELETEALL和SCI_MARKERDELETE尝试删除默认图标,然后再应用新图标但它没有效果,如何摆脱有问题的圈子?

正方形是默认的Scintilla图像,根据文档它不应该是那样(Box +,Box - ):

enter image description here

1 个答案:

答案 0 :(得分:0)

您需要设置所有文件夹标记才能正确绘制。