GPI wrote:If somebody what to know: Folding works

GOOD NEWS
where is the learning code
GPI, I appreciated the last coloring code, but didn't had much time to look into it - your test code worked amazingly well though.
I'm working on the ability to edit more than one Source Code at the time (like the original PureBasicEditor).
After that is finished, I like to add the coloring stuff etc.
Don't know how it's done in the PureBasic's original editor to code on more than one file at the time (never looked deeper at the code), but Scintilla accepts only one "Scintilla" control at the time. (otherwise it crashes)
So if you want to have more than one file opened you have to do a lot of work (move the scintilla control to the desired PanelItem, copy source code text in memory back and forth, and keep track of all of this {is the text already modified?} - argh...)
Uff, the user activated to a different PanelItem - switch the source code...
The switching works amazingly fast though.
A big problem occures when you close a file that's not the last one.
Lets say you have 10 opened files and you close file 2.
When you remove PanelItem number 2 WindowsOS (or could it be Fred's GUI code?) automatically moves the PanelItem Text from 3 to 2, 4 to 3, 5 to 4 etc. (this means the PanelItem Index decreases automatically...)
But the Source Code inside the scintilla control on your panel remains, because YOU did the assignment....
So everytime you close a file you have to look if there is a used PanelItem with a higher number than the deleted one, and move all data to the lower PanelItem.
Well I got it working, but with one known bug:
If I kill Item number 2 then Item 3 becomes 2, 4 becomes 3 etc.
All PanelItem have the correct PanelItem Text and the Source Code except the new (reorganized) Panel 2 (the PanelItem Text is correct - done by WindowsOS or Fred) but the Source Code in Scintilla remains the old one (the memory transfer is done as first of all Items - so why it's wrong and all memory transfer done later (same Procedure) on the other Items are OK?).
All the other ones changed as desired... - arghh, my little brain hurts
Maybe I should look at the code of the original PureBasic Editor (but if there are more than one RichEdit Gadget in use, it's no help at all...)
GPI, if you want my code to elaborate on it, let me know.