问题描述
以下我使用的代码设置了一个Scintilla窗口进行折叠:
The following code I use sets a Scintilla window for folding:
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)
但是无论出于何种原因,折叠打开/关闭的默认圆圈图标都不会被新值覆盖,因此圆圈会显示在新选择的下方:
but for whatever reason the default circle icon for the fold open/close does not get overwritten by the new value so the circle shows below the new selection:
已经尝试过SCI_MARKERDELETEALL和SCI_MARKERDELETE尝试在应用新图标之前删除默认图标,但是它没有效果,如何摆脱令人讨厌的圈子?
have tried SCI_MARKERDELETEALL and SCI_MARKERDELETE to try to remove the default icon before applying the new one but it has no effect, how do I get rid of the offending circle?
正方形是默认的Scintilla图像,根据文档显示,正方形不应该像这样(Box +,Box-):
The square is the default Scintilla image and according to the docs it should not look like that (Box +, Box -):
推荐答案
您需要设置所有文件夹标记才能正确绘制它们.
You need to set all folder markers for them to be drawn properly.
这篇关于闪烁折叠边距图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!