March 03, 2021, 02:40:44 AM

Author Topic: MaxGUI Scintilla TextArea  (Read 371 times)

Offline degac

  • Full Member
  • ***
  • Posts: 170
    • graphio.net
MaxGUI Scintilla TextArea
« on: January 11, 2021, 05:15:35 PM »
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

Offline Dabz

  • Sr. Member
  • ****
  • Posts: 408
  • Is it cos I is ginger?
    • dabzy.co.uk
Re: MaxGUI Scintilla TextArea
« Reply #1 on: January 11, 2021, 06:13:27 PM »
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

Offline Henri

  • Sr. Member
  • ****
  • Posts: 294
Re: MaxGUI Scintilla TextArea
« Reply #2 on: January 11, 2021, 07:37:05 PM »
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
  1. Import maxgui.maxguitextareascintilla
  2.  
  3. Local window:TGadget = CreateWindow("Scintilla", 0, 0, 300, 200, Null, WINDOW_DEFAULT | WINDOW_CENTER)
  4. Local g:TGadget = New TWindowsScintillaTextArea.Create(window, 0, "")
  5.  
  6.  
  7. Repeat
  8.  
  9.         WaitEvent()
  10.        
  11.         Select EventID()
  12.        
  13.         Case EVENT_WINDOWCLOSE
  14.                 End
  15.         EndSelect
  16. Forever
  17.  

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

Offline degac

  • Full Member
  • ***
  • Posts: 170
    • graphio.net
Re: MaxGUI Scintilla TextArea
« Reply #3 on: January 11, 2021, 07:56:24 PM »
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

Offline Henri

  • Sr. Member
  • ****
  • Posts: 294
Re: MaxGUI Scintilla TextArea
« Reply #4 on: January 17, 2021, 11:05:25 PM »
@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

Offline Dabz

  • Sr. Member
  • ****
  • Posts: 408
  • Is it cos I is ginger?
    • dabzy.co.uk
Re: MaxGUI Scintilla TextArea
« Reply #5 on: January 18, 2021, 05:49:22 AM »
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

Offline Henri

  • Sr. Member
  • ****
  • Posts: 294
Re: MaxGUI Scintilla TextArea
« Reply #6 on: January 18, 2021, 02:38:12 PM »
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

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal