PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Theo Gottwald on March 20, 2010, 06:01:51 AM

Title: Native support for EDM32 control as alternative to the richtext
Post by: Theo Gottwald on March 20, 2010, 06:01:51 AM
If somebody wants to make a n editor tool, actually the only choice would be the richtext control,
which has several disadvantages.
I'd prefer a (enahnced?) Fire-EDM32 which should be easy to use and embed.
Or maybe something like the Text-Control used in Firefly itself for the Code.
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: José Roca on March 20, 2010, 03:14:28 PM
Currently, the best free edit control is Scintilla, and it is very easy to use.
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: José Roca on March 20, 2010, 07:15:43 PM
Then you're going to be unhappy using FireFly, since all the custom controls have been implemented as DLLs.
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: Paul Breen on March 20, 2010, 08:15:45 PM
Sounds like a good idea to me. I'm trying to do almost the same thing with edm32 and pbforms, but if FireFly had it, I could use FF instead.

Scintilla is much more capable, but it has seemed to be kind of intimidating to me. I need a text editor with syntax coloring but something for making utility programs, not for a big IDE. Edm32 does not have syntax coloring on the fly(no pun intended) and that is a big incentive for rich edit, because you can generate rtf tags on the fly (not the FireFly).

Jose, should I give up on edm32 and just bite the bullet and learn Scintilla?
PB
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: José Roca on March 20, 2010, 09:18:01 PM
Quote
I'm trying to do almost the same thing with edm32 and pbforms

Taken from my include file for EDM32.INC.


' ========================================================================================
' Registers the window class
' Added by Jose Roca: 21 Sep 2009
' ========================================================================================
FUNCTION InitEdmCtx () AS WORD

   LOCAL  wcex AS WNDCLASSEX               ' // WNDCLASSEX structure
   LOCAL  szClassName AS ASCIIZ * 256      ' // Class name
   STATIC wAtom AS WORD                    ' // Atom

   ' // Already initialized
   IF wAtom <> 0 THEN
      FUNCTION = wAtom
      EXIT FUNCTION
   END IF

   szClassName        = "EDM32EDIT"
   wcex.cbSize        = SIZEOF(wcex)
   wcex.style         = %CS_DBLCLKS OR %CS_CLASSDC
   wcex.lpfnWndProc   = CODEPTR(ctlWndProc)
   wcex.cbClsExtra    = 0
   wcex.cbWndExtra    = 4 ' For pointer to private data
   wcex.hInstance     = GetModuleHandle(BYVAL %NULL)
   wcex.hIcon         = %NULL
   wcex.hCursor       = %NULL ' LoadCursor(%NULL, BYVAL %IDC_ARROW)
   wcex.hbrBackground = %NULL ' GetStockObject(%WHITE_BRUSH)
   wcex.lpszMenuName  = %NULL
   wcex.lpszClassName = VARPTR(szClassName)
   wcex.hIconSm       = %NULL

   wAtom = RegisterClassEx(wcex)
   FUNCTION = wAtom

END FUNCTION
' ========================================================================================


All you need is to call this function before using CONTROL ADD "EDM32EDIT".

I did not post it in the PB DDT only Forum because a guy called Gösta quickly complains as soon as you post a single API call.
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: José Roca on March 20, 2010, 09:27:05 PM
Quote
Scintilla is much more capable, but it has seemed to be kind of intimidating to me.

To start using it, you only need to load the library using something like hSciLib = LoadLibrary(EXE.PATH$ & "SciLexer.dll") and create an instance of the control using CreateWindowEx with "Scintilla" as the class name.

Then, use SendMessage to set the wanted options. It works like any other standard Windows control.

A trick that I use when a control has many options is to make a copy of the documentation, read it and remove the options that I'm not going to use for the moment. If your needs are small, the list will quickly become short and little complex. The basic options aren't more difficult to use than EDM32.
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: James Fuller on March 21, 2010, 06:15:18 AM
Resource Editor comes with an text editor control. I've used it a bit so I know it works with Pb. Have not tried it with FF.
http://radasm.cherrytree.at/resed/

James
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: Paul Squires on March 21, 2010, 11:32:22 AM
Quote from: Jose Roca on March 20, 2010, 07:15:43 PM
Then you're going to be unhappy using FireFly, since all the custom controls have been implemented as DLLs.

Yes, they are implemented as DLL's **but** those DLL's are only needed in order to display the control during **design** time. All of the Fire style controls (FireTextBox, FireImage, etc...) are code generated using the **pure code** from the INCLUDE file rather than requiring the DLL to be shipped. Granted, some controls like EGrid or SIGrid only work with the DLL but that is expected because they are commercial controls being distributed by other authors.
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: Marc van Cauwenberghe on March 21, 2010, 12:11:41 PM
Hi Paul,

You did't say anything about your edit control dll. Would be wonderfull if we could use it.

Regards,
Marc
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: James Fuller on March 22, 2010, 10:43:59 AM
Jim,
  Sorry about that. That link appears to be just an update. I'm not sure where the version with all the 3rd party controls is located now. The ones in RADASM are the same ones I believe.

All I had was a bit of skeleton code to see if I could get it to work. I'll see if I can track it down.

James
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: Theo Gottwald on March 24, 2010, 03:44:21 AM
The nice thing about the EDM32 is that you have it all in PB-Code. Means you can customize ist as you want. In its actual Form it will only make a Syntax Colouring for PB-Code and such. But the whole thing is done in good, fast PB. You can customize it to your needs.
I know it can be used with FF, and long time before, Paul was so kind to even sent me an example, ithink for FF2.
But I am new in this and it would be much more easy to just be able to use it like the other FF Controls using "Drag'n Drop". Also my impression is here, that i am not alone with the idea of using an "Editor control".
The Scintilla would also be a possible choice, if it could be nicely integrated into FF.

@Paul: How about the "Jelly_edit" ? Could it be used by the FF3 users as a control for their own programms, also?

PS: Sorry Paul, put your WII and your PS3 aside for a while :-).
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: Theo Gottwald on September 05, 2010, 05:38:27 AM
No answer here, Paul are you alive?
How about sharing your own control - the one you are using - with the FF Users?
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: Paul Squires on September 05, 2010, 09:26:33 AM
Hi Theo,

I will put the creation of a EDM custom control in my bug tracker to see if I can make a FF control for it. It may be just as easy for users to create the EDM create control themselves via the WM_CREATE message handler. If I remember correctly, EDM has a lot of messages and properties...and creating a custom control for it is a big job.

I decided not to share my own text editor control. Sorry.
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: Roger Garstang on September 07, 2010, 11:32:59 AM
From what I understand he built his control from scratch and not really modeled after others (Although there may have been ideas from them).  I indicated interest again either in thread of PM and he is hesitant on giving it out at the moment.  I managed to find the latest EDM code and had started to write a PHP editor control to be used as an addon for an webpage creation app I use...like most of my ideas though they seem to take the back burner to my ever-growing workload.  I can somewhat understand him not wanting to give it out since he put a lot of work into it and still has more to do to be perfect.  Giving it out would make it even easier to create a competing product too.

Oops...didn't notice there was a page two.  Oh well, Paul said the same thing and if needed I can share the EDM code I found too.  I was still looking at it myself.  I understood all the changes except the control creation ones that removed some code that looked to me like it would be needed.
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: Paul Squires on September 07, 2010, 12:36:52 PM
The EDM control is functional but it sure uses a lot of hard to follow code with a lot of hard coded magic numbers to represent states of things. It is the type of code that you can modify bits and pieces of, but if you need to add major functionality (like code folding) then you're better off almost rewriting the whole thing.

I was going back and forth between writing my own and using Scintilla. In the end, there were benefits for me to have my own editor although ther eis some functionality in Scintilla that would be nice ot have.
Title: Re: Native support for EDM32 control as alternative to the richtext
Post by: Paul Breen on November 10, 2010, 11:47:59 AM
I agree about your comments about Borjes' code. I regard it as almost read-only. Another control with the same functionality but written in your style would be worth paying for as an accessory to firefly. Like my little grid is not free, but it is affordable if you need it. But I would want the source in pb because if I wanted to include a dll we already have scintilla. I have situations where installation is a big fat issue - single file exe programs solve that problem like no other solution I know of. I would rather you offered a real editor control for $ instead of vaporware for free. I would like to have a choice:

fire textbox                  = light weight, a good choice for what it is good for.
firefly accessory control = welter weight, edm32 class
scintilla dll                   = heavy weight and the best if you accept installation issues.