Page 3 of 4

Re: Project Editors Factory...

Posted: Tue Sep 29, 2020 7:18 pm
by STARGÅTE
HeX0R wrote:I guess the problem is, that a DLL has no direct access to any objects, like Gadgets, Windows, created in the main program.
You would have to move the whole Gadget handling into the DLL (via BindEvents) and keep the main loop outside in the main.
Maybe add another few wrapping procedures to the dll, so main will still be able to access gadgets.

But this is all nothing but theory, I have no idea which problems there really are.
You are right.
We already discussed this problem, and mk-soft has shown some code:
viewtopic.php?f=12&t=75840
It works with all gadget functions, but not with the StartVectorDrawing inside the DLL and in the main code.
But when I have to start the drawing new for each object, the drawing will become very slow. So I stopped my investigation into this direction.

Re: Project Editors Factory...

Posted: Tue Sep 29, 2020 7:54 pm
by HeX0R
O.k., so objects (like Gadgets) are created by users in the main scope, and your ... library, dll, so, whatever needs to do some action on them, best without any API.
That's tricky, agreed.
Although I like the solution from mk-soft, I don't think this is very practicable.
You would need to create dlls for each PB version then, right?
Same would be true for user libraries, they will break at some PB update and all are left with empty hands (as happened too often already).

I still think providing the code is the best solution, no need to provide it for free, though.

Re: Project Editors Factory...

Posted: Tue Sep 29, 2020 9:09 pm
by ShadowStorm
Hi, Yes the easiest way would be to provide the code but I don't want it now, probably later :)

Stargate also want to give the code, I don't agree, it's a very big project and we are two on it !

Stargate code, I do all the rest !
It is on the other hand obvious that I prefer to give the code than to see it abandoned, but I don't want that we take advantage of our work to get rich or to grant ourselves the rights...

So we're stuck on the creation of DLL or user library...
So how can we do otherwise?

Re: Project Editors Factory...

Posted: Tue Sep 29, 2020 11:12 pm
by HeX0R
I can only speak for myself:
I never would use a dll which depends on the PB version and also never would use any user lib, no matter how fancy that product is.

You are using PB objects of any kind intensively, from my point of view the one and only easy and future proof solution, without increasing complexity too much, is to offer the source.
You should also take into account:
Although this project looks really cool, in the end it is something which not many people will make use of it. It is just too special to be a high runner.

Anyway, I don't want to frustrate anyone, those are just my personal thoughts, and I think I'm out of that discussion now.
I don't want to be the responsible guy, who made that project die ;)

Re: Project Editors Factory...

Posted: Wed Sep 30, 2020 5:13 am
by wilbert
ShadowStorm wrote:So we're stuck on the creation of DLL or user library...
So how can we do otherwise?
In the past there was the TailBite project
viewforum.php?f=26
I never used it but if it could be updated to work with the current PureBasic version, it might do what you want.
Another option might be to redo your project in C since it's easier to create a user library from a C source.

Re: Project Editors Factory...

Posted: Wed Sep 30, 2020 10:34 am
by Mindphazer
HeX0R wrote:I can only speak for myself:
I never would use a dll which depends on the PB version and also never would use any user lib, no matter how fancy that product is.
Furthermore, one of the biggest PB's advantage is that it's DLL free and i'd never use any user lib either (i did it in the past, and it brought too many problems)

Re: Project Editors Factory...

Posted: Wed Sep 30, 2020 10:41 am
by ShadowStorm
Hello HeX0R,

Don't worry, I thank you for your frankness, I like it, when you say it nicely it passes :)

I never said that the project would remain secret all the time...
I can also change my mind !

For the moment it stays like that but afterwards we'll see if we can make it public, what scares me is that some people exploit our code for commercial or personal purposes (they make the code for themselves).
And I really think this project is fantastic ;)

@wilbert, thank you, but I don't know how to code in C and anyway no matter the lange, I wouldn't know how to do !
@Mindphazer, thank you, I take note of this too !

Re: Project Editors Factory...

Posted: Fri Dec 25, 2020 2:53 pm
by FlatEarth
Whether this project is still under development?

Re: Project Editors Factory...

Posted: Fri Dec 25, 2020 9:24 pm
by STARGÅTE
From the coding aspect, I'm working currently on an attachment system (to make objects to child of other objects), where I make a good progress. Further I try to include the rotation of objects, where I make nearly no progress. When I have started this project, no rotation was planned. That means it is now i little bit tricky to implement in all coordinate transformations for display and events.

From the publication aspect, it is up to ShadowStorm what happens next.

Re: Project Editors Factory...

Posted: Fri Dec 25, 2020 11:11 pm
by Mijikai
Mby this helps (i only have Windows to test) :)

DLL:

Code: Select all

EnableExplicit

Global hwnd.i
Global canvas.i

Procedure.i Callback()
  UseGadgetList(hwnd)
  Select EventType()
    Case #PB_EventType_MouseMove       
      MessageRequester("","")
  EndSelect
EndProcedure

ProcedureDLL.i ext_canvas(hwnd.i,x.i,y.i,w.i,h.i,flags.i)
  UseGadgetList(hwnd);get the 'scope'
  canvas = CanvasGadget(#PB_Any,x,y,w,h,flags)
  If canvas
    BindEvent(#PB_Event_Gadget,@Callback())
  EndIf
  ProcedureReturn canvas
EndProcedure

ProcedureDLL.i ext_canvas_draw(hwnd.i)
  Protected res.i
  UseGadgetList(hwnd)
  If StartDrawing(CanvasOutput(canvas))
    res = #True
    Box(10,10,50,50,#Red)
    StopDrawing()
  EndIf
  ProcedureReturn res
EndProcedure
Prog:

Code: Select all

EnableExplicit

Import "test_dll.lib"
  ext_canvas.i(hwnd,x.i,y.i,w.i,h.i,flags.i)
  ext_canvas_draw.i(hwnd.i)
EndImport

Procedure.i Main()
  Protected ext.i
  If OpenWindow(0,0,0,320,200,#Null$,#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_MinimizeGadget)
    ext = ext_canvas(WindowID(0),10,10,200,100,0)
    Debug ext
    Debug ext_canvas_draw(WindowID(0))
    Repeat
      Select WaitWindowEvent() 
        Case #PB_Event_CloseWindow
          Break
      EndSelect
    ForEver
    CloseWindow(0)  
  EndIf  
  ProcedureReturn #Null
EndProcedure

Main()

End

Re: Project Editors Factory...

Posted: Sat Dec 26, 2020 2:12 am
by FlatEarth
@STARGÅTE: thanks.
Does this module perform copy and paste operations for container controls correctly?
in pb designer, after pasting the container control, all its children are transferred to the main window.

Re: Project Editors Factory...

Posted: Sat Jan 09, 2021 4:58 pm
by STARGÅTE
After some discussions with ShadowStorm we have decided to publish the code next weekend under certain conditions!
The include/module itself has a small documentation about all functions and constants, but we also want to give you some examples, hot to use the module.

@FlatEarth:
Currently the module has no function like CopyObject or PastObject. But I think I can write a procedure like DuplicateObject() with an option: with or with out childs. After this duplication you can move the duplicant to the "paste" position.

@Mijikai:
Thanks for the code, but we have stopped the idea to create a DLL out of the code.

Re: Project Editors Factory...

Posted: Sat Jan 09, 2021 9:44 pm
by ChrisR
It's a good news, thanks to both of you for the future publication 8)
The démo is really interesting. I'd be happy to test it, if I meet the license conditions!

Re: Project Editors Factory...

Posted: Mon Jan 11, 2021 6:43 pm
by ShadowStorm
Hello to all.

The project is NOT ABANDONED, I reassure you!
And there is still a lot to add and with your opinions and criticisms, even more :)

In a few days, the code will be online, but there are still things to do!

I know that you are very impatient to see the possibilities of the program!

I made all the examples myself, but there is still a lot missing to really see the power of the code!

So buckle up, because it's going to be a blast!
Hello to all,

You waited so long for it, even though some of you didn't believe in it and even made fun of it!
He had opinions, criticisms etc., it appeared that this project had about 0.2% to see the light of day according to some.
But other more constructive criticisms too, such as the wish to make the code public!

We tried to create a DLL of the project, but also a library, it was simply a resounding failure!
No way to know how to protect the code, I didn't want to give it to the base because I was afraid of abuse and appropriation!

As time went by, the project was put aside a little bit but we have a little
go ahead anyway (well, when I say "we", it's mostly "Stargate") :)

After some time of reflection and taking into account certain opinions, and especially the fact that some people I don't know
came to ask Stargate where the project is at and that they started to press the cork....

I conclude like him that this project is interesting in the end, and you won't be disappointed.
but I think I misspoke as I often do, alas!

This module is not going to create your editor the fingers in the nose eh, it's up to you to do it!
It's a bit like a game creation software where you have to code to make your game!

Here it's the same thing but for Object editors!
Everything has been thought to make it very easy to use, but it is possible to make it even simpler!

Your editors, your Objects, it's up to you to do the rest!
The particularity of this module is to be able to customize and manipulate objects as you wish.

It is not enough to create an Object, you must also give it an appearance and behaviors with simplistic functions!

Create an Object wherever you want on the editor
Give an image to this object (Appearance)
Then, why not give it a standard or customized cursor when the mouse passes over it?
And while we're at it, let's give standard or custom handles to our Objects, to move or resize them with the mouse, in the desired directions.
And why not restrict our Objects, minimum and maximum X and Y position on the canvas, minimum and maximum size on the canvas, resize them or move them by "steps".
And why not create "Container" type Objects, in the form of a hierarchy of parents and children.

Find all the information of the Objects, their position, their size, etc...
And many other things (not exhaustive) !
And many other even crazier things, which will come later!

With this very powerful tool under development, you will be able to create your own editor!
Why not a drawing editor, a vector editor, etc...
Or even a game editor, let's be crazy!
Or even crazier, a visual editor!

This tool will allow you to create your own editors, but it won't do the job for you!
Don't wait for things to happen to you, you have to provoke them! (Quote from the movie: The Chess Champion on YT)

We found a suitable license for the module.
If I am not mistaken: https://creativecommons.org/licenses/by-nc/4.0/

But we will see how to implement it.

Editors Factory is coming directly to your place next weekend if all goes well.
So drool a lot and prepare the popcorn because it's going to blow your mind!

Re: Project Editors Factory...

Posted: Tue Jan 12, 2021 4:54 pm
by SPH
ShadowStorm wrote:Stargate code, I do all the rest !
:lol: