January 16, 2021, 09:44:34 PM

Author Topic: MaxGUI Scintilla TextArea  (Read 105 times)

Offline degac

  • Full Member
  • ***
  • Posts: 169
    • 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: 348
  • 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: 288
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: 169
    • 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

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal