Discussion:
Folding only at top node help
RaptorX
2013-09-21 22:33:05 UTC
Permalink
Is there a way to tell the scintilla notification handler function to
distinguish between a click on a margin that contains
a SC_MARKNUM_FOLDEROPEN and one that has something
like SC_MARKNUM_FOLDERSUB?
that way i would like to make it so that only when i click on a top node
that contains an open/close box that the folding logic runs and when
clicking in a line that there is no folding done.

Any help on that topic would be appreciated.
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-09-22 00:12:08 UTC
Permalink
Is there a way to tell the scintilla notification handler function to distinguish between a click on a margin that contains a SC_MARKNUM_FOLDEROPEN and one that has something like SC_MARKNUM_FOLDERSUB?
You could check if there is no parent with SCI_GETFOLDPARENT returning -1.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
RaptorX
2013-09-22 05:17:10 UTC
Permalink
Thank you very much but i think i worded the question incorrectly...
basically it wasnt just the top node in the whole fold hierarchy but all
SC_FOLDLEVELHEADERFLAG, which are the ones that are fold points.
in the end after reading a bit further and testing out i figured that this
is what i meant:

sciObj.GetFoldLevel(line) & SC_FOLDLEVELHEADERFLAG, which would be true
only if the place where you clicked is a folding point.

so in my AHK code:

*if (sciObj.scnCode = SCN_MARGINCLICK && sciObj.GetFoldLevel(line) &
SC_FOLDLEVELHEADERFLAG)*
* sciObj.ToggleFold(line)*

this would fold only when clicking on a folding point instead of in any
part of the margin which belongs to a fold section.

Thanks for your help!
Post by RaptorX
Is there a way to tell the scintilla notification handler function to
distinguish between a click on a margin that contains a
SC_MARKNUM_FOLDEROPEN and one that has something like SC_MARKNUM_FOLDERSUB?
You could check if there is no parent with SCI_GETFOLDPARENT returning -1.
Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Continue reading on narkive:
Loading...