Hello everyone,
 
I download ScintillaVB and it is working after the comments of other
users from this location, you can download the working source code:
 
 
The only problem I am having now is how to implement Folding.
I tried this code:
 
' Manager of events
Friend Sub Raise_Events(Notif As SCNotification)
.........
.........
        Case SCN_MARGINCLICK:
            If Notif.margin = 2 Then
                Dim LineNumber As Long
                LineNumber = LineFromPosition(Notif.position)
                Call Message(SCI_TOGGLEFOLD, LineNumber, 0)
                Call Message(SCI_SETFOLDEXPANDED, LineNumber, 1)
                Call Message(SCI_ENSUREVISIBLEENFORCEPOLICY, LineNumber)
                Call Message(SCI_GOTOLINE, LineNumber)
            End If
and inserted the following code somewhere in the control
to activate the Folding but nothing happens:
 
        Call Message(SCI_SETSTYLEBITS, 7, 0)
        Dim szKey As String * 250
        Dim szValue As String * 250
        szValue = "1"
       
        szKey = "fold"
        Call SendMessageString(sci, SCI_SETPROPERTY, VarPtr(szKey), VarPtr(szValue))
       
        'Perl: fold.comment, fold.compact, fold.perl.pod, fold.perl.package
        szValue = "1"
        szKey = "fold.comment"
        SendMessageString sci, (SCI_SETPROPERTY), VarPtr(szKey), VarPtr(szValue)
        szValue = "1"
        szKey = "fold.compact"
        SendMessageString sci, (SCI_SETPROPERTY), VarPtr(szKey), VarPtr(szValue)
        szValue = "1"
        szKey = "fold.perl.pod"
        SendMessageString sci, (SCI_SETPROPERTY), VarPtr(szKey), VarPtr(szValue)
        szKey = "fold.perl.package"
        SendMessageString sci, (SCI_SETPROPERTY), VarPtr(szKey), VarPtr(szValue)
       
        szKey = "fold.preprocessor"
        SendMessageString sci, (SCI_SETPROPERTY), VarPtr(szKey), VarPtr(szValue)
        'Call Message(SCI_SETFOLDFLAGS, "fold", 1&)
       
        szKey = "fold.symbols"
        SendMessageString sci, (SCI_SETPROPERTY), VarPtr(szKey), VarPtr(szValue)
       
       
        'szValue = Space(240)
        szValue = "                              "
        szKey = "fold.comment"
        SendMessageString ByVal sci, ByVal SCI_GETPROPERTY, VarPtr(szKey), VarPtr(szValue)
        szValue = Replace(szValue, Chr(0), " ", 1, , vbBinaryCompare)
        szKey = Replace(szKey, Chr(0), " ", 1, , vbBinaryCompare)
        Debug.Print "fold.compact: "; szValue; ", "; szKey
        
        Call Message(SCI_SETMARGINWIDTHN, 2, 0)
        Call Message(SCI_SETMARGINTYPEN, 2, SC_MARGIN_SYMBOL)
        Call Message(SCI_SETMARGINMASKN, 2, SC_MASK_FOLDERS)
        Call Message(SCI_SETMARGINWIDTHN, 2, 20)
 
       
       
'        Call Message(SCI_SETMARGINMASKN, 2, SC_MASK_FOLDERS)
'        Call Message(SCI_SETMODEVENTMASK, SC_MOD_INSERTTEXT Or SC_MOD_DELETETEXT, 0)
        
        Call Message(SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_MINUS)
        Call Message(SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_PLUS)
        Call Message(SCI_MARKERDEFINE, SC_MARKNUM_FOLDERSUB, SC_MARK_CIRCLE)
        Call Message(SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_ROUNDRECT)
        Call Message(SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_BACKGROUND)
        Call Message(SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_FULLRECT)
        Call Message(SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_SMALLRECT)
       
        Call Message(SCI_MARKERDEFINE, 0, SC_MARK_CIRCLE)
        Call Message(SCI_SETMARGINWIDTHN, 2, 24)
       
        Call Message(SCI_SETFOLDFLAGS, 16, 0)
        Call Message(SCI_SETMARGINSENSITIVEN, 2, 1)
I am sure the problem in the calling SCI to activate the "fold" and I appreciate any help
 
Dalia
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to