MaxGUI Scintilla TextArea

Started by degac, January 11, 2021, 17:15:35

Previous topic - Next topic

degac

Hi

I would like to know if there are somewhere some examples about using Scintilla/Textarea in MaxGUI.

I tried to read the MaxIDE code, but too big to read and understand.
Moreover I'm quite sure Scintilla has some interesting feature (like folding) - but I don't know if these are enabled (I didn't found a command about Folding for example and many TextAreaXXXXX commands are not documented in the source code).

Thanks
If there's a problem, there's at least one solution.
www.blitzmax.org

Dabz

#1
Dig around in my old editor code:-

https://sourceforge.net/p/bamboobasic/code/ci/master/tree/Editors/Win/Editor/

I had it all working perfectly, though, it was all written donkeys ago so some stuff might of changed... Be warned though, it is a good lump of code! :D

EDIT: Oh, and if your interested in Linux, then there is Vala code in there that uses Gtk.SourceView, I had that tee'd up canny as well, so well worth a look if your planning on motoring over to that side, see Editors/PI/ Editor/main.vala 

Not as expansive as the Windows one, but, worked out well! :)

Dabz
Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 16Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit

Henri

Hi,

I literally just browsed the scintilla folder for the first time so I can't offer superior insight, but what I see from a glance is that scintilla source code seems to be fully included so all the raw functionally is there, but not all functionality have been wrapped (for example SetFoldLevel is missing ). What functions are currently wrapped can be found inside maxgui.mod/maxguitextareascintilla.mod/win32.bmx (for Windows, but are the same in all) 

I did manage to create a scintilla gadget so thats something :-) For folding to work you would need to enable fold-style for default folding behaviour and SetFoldLevel function to set individual lines for custom fold behavior.

Code (blitzmax) Select

Import maxgui.maxguitextareascintilla

Local window:TGadget = CreateWindow("Scintilla", 0, 0, 300, 200, Null, WINDOW_DEFAULT | WINDOW_CENTER)
Local g:TGadget = New TWindowsScintillaTextArea.Create(window, 0, "")


Repeat

WaitEvent()

Select EventID()

Case EVENT_WINDOWCLOSE
End
EndSelect
Forever


-Henri
- Got 01100011 problems, but the bit ain't 00000001

degac

Many thanks to both!
I have something to explore now!

Thanks!
If there's a problem, there's at least one solution.
www.blitzmax.org

Henri

@Dabz

What happened to Bamboo basic ? Seems like you put a lot of effort on the editor..

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Dabz

Quote
What happened to Bamboo basic ? Seems like you put a lot of effort on the editor..

To be honest, it was just one of them, I've always fancied writing my own language, and a combination of hating php syntax, it seemed a good idea to make a transpiler setup for such a thing, and my intention was to only write a command line thing... It was initially just going to be an "interest" at first. But then I started playing with wxMax, then someone suggested Vala for Pi/x86 Linux (Max on Linux was already getting a bit scruffy then), that pricked my ears up, there wasn't much in the way of resources back then for Vala or its bindings to C libs, so that was something nice to explore, because I like doing that, sleeves up yadda yadda. I did get it complete, there wasn't much uptake in it and well, moved on really eventually, and just whacked the whole lot up on source forge.

It's all probably written terrible, I'm no compiler writer, but, I had the idea on how it would work in my head, coded it, and, it worked, good enough for me, and the editors, well, I always start off anything with the best intentions of keeping it tight and neat... Week in, monkey at a typewriter approach kicked in and I just went for it, Vala, wasnt entirely sure what I was doing as I was learning as I was going, if it I clicked build in geany, and it built, and then ran, and it ran and did exactly what I was wanting... That was good enough for me! :D hehehe

So yeah, thats pretty much it Henri matey!

Dabz
Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 16Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit

Henri

Sweet :-)

I'm dabbling on an editor myself (in wxMax) when I have some spare time.

At the moment there are a lot of work related projects to do so we'll see..

-Henri
- Got 01100011 problems, but the bit ain't 00000001