EditorFactory - Module for object management in a Canvas

Share your advanced PureBasic knowledge/code with the community.
mestnyi
Addict
Addict
Posts: 1098
Joined: Mon Nov 25, 2013 6:41 am

Re: EditorFactory - Module for object management in a Canvas

Post by mestnyi »

These examples are not yet shared at this time, moreover they are in French as I said.

I have many other examples to give and all are in French but I need to clean up and reorganize them.
Let them be in French.
The main thing is that the examples were acceptable.
And since people don't seem to be interested, I'll wait too.
But this is in vain, because you do not need to look at it.
when one day there are those who truly appreciate your work, because of them there will be no your work
I like when things are well done.
Me too.
ShadowStorm
Enthusiast
Enthusiast
Posts: 303
Joined: Tue Feb 14, 2017 12:07 pm

Re: EditorFactory - Module for object management in a Canvas

Post by ShadowStorm »

But this is in vain, because you do not need to look at it.
when one day there are those who truly appreciate your work, because of them there will be no your work
I don't really understand this sentence, it doesn't translate very well.

The examples will be published don't worry, but a little later :)
I am French, I do not speak English.
My apologies for the mistakes.

I have sometimes problems of expression
I am sometimes quite clumsy, please excuse me and let me know.
superadnim
Enthusiast
Enthusiast
Posts: 480
Joined: Thu Jul 27, 2006 4:06 am

Re: EditorFactory - Module for object management in a Canvas

Post by superadnim »

i didn't fully understand his message either but i think he means "share them as-is don't worry about translating them".
there is interest but this is a very niche module for a niche programming language!

:lol: should I bash the keyboard and give up?
:?
punak
User
User
Posts: 81
Joined: Tue Sep 07, 2021 12:08 pm

Re: EditorFactory - Module for object management in a Canvas

Post by punak »

Hi STARGÅTE,
I have two questions about this module :
1- can we use "BindGadgetEvent" to manage events instead of "Repeat loop"? If yes, please give a small example.
2- how can we get the (x,y) position of the mouse on the form? I didn't find the function to do this.
User avatar
STARGÅTE
Addict
Addict
Posts: 2226
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: EditorFactory - Module for object management in a Canvas

Post by STARGÅTE »

Dear punak,
  1. You can use BindGadgetEvent(#Canvas, @EventLoopExample()) to bind all events to the procedure EventLoopExample().
    However, inside the procedure you still have to use an event loop for all events triggered by CanvasObjectsEvent().

    Code: Select all

    Procedure EventLoopExample()
    	
    	; Event loop of the objects in the canvas gadget
    	Repeat
    		
    		Select CanvasObjectsEvent(#Canvas) ;  Something happened in the canvas.
    				
    			Case #Event_Object ; It is an object event
    				
    				Select CanvasObjectsEventType(#Canvas) ; What type of events happened on the object?
    						
    					Case #EventType_MouseEnter
    						Debug "The mouse enters Object #" + EventObject(#Canvas)
    				EndSelect
    				
    			Case #Event_Handle ; It is a handle event
    				
    				Select CanvasObjectsEventType(#Canvas) ; What type of events happened on the handle ?
    					Case #EventType_MouseEnter
    						Debug "The mouse enters Handle #" + EventHandle(#Canvas) + " on the Object #" + EventObject(#Canvas)
    				EndSelect
    				
    			Case #Event_None ; No Events.
    				Break
    				
    		EndSelect
    		
    	ForEver
    	
    EndProcedure
    
    BindGadgetEvent(#Canvas, @EventLoopExample())
    If you mean, if there is an option to bind events to an object like BindObjectEvent(#Object, @Function(), #EventType_MouseEnter) similar to the BindGadgetEvent(), then no, that is currently not possible. However, it is a good idea for a feature request. I will note it down.
  2. Do you mean with form the object? No, there is no function like ObjectMouseX().
    However, if you know your object, you can calculate this mouse position by GetGadgetAttribute(#Gadget, #PB_Canvas_MouseX) - GetObjectX(#Object). Am I right?
    But I think, I can also add such function to the module.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
punak
User
User
Posts: 81
Joined: Tue Sep 07, 2021 12:08 pm

Re: EditorFactory - Module for object management in a Canvas

Post by punak »

Hi again and thanks for your reply. :)
I just started working with this module, I will probably ask you more questions in the future.
yes you understand what I mean and It would be great if you could add these suggestions to the module.
punak
User
User
Posts: 81
Joined: Tue Sep 07, 2021 12:08 pm

Re: EditorFactory - Module for object management in a Canvas

Post by punak »

Hi dear STARGÅTE,
is there a way for controls such as "panel" to start the selector from the bottom of the tabs?
i want the selector to work only below the header line.
maybe you can understand what I mean better on the photo.
Image
Image
punak
User
User
Posts: 81
Joined: Tue Sep 07, 2021 12:08 pm

Re: EditorFactory - Module for object management in a Canvas

Post by punak »

Another question :?: How can we replace the "click action" on the controls in this module?
For example, I want to have the right click on the control exactly the "selection action" that is done with the left click.
I hope you understand what I mean.
Thankful.
User avatar
STARGÅTE
Addict
Addict
Posts: 2226
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: EditorFactory - Module for object management in a Canvas

Post by STARGÅTE »

Dear punak,

thank you for trying our module.
At the moment I'm quite busy and cannot react immediately to your requests and questions.

However, here a short answer to your last posts:
punak wrote: Wed May 10, 2023 9:48 am It would be great if you could add these suggestions to the module.
I have noted it in our to-do list.
punak wrote: Sat May 13, 2023 10:30 am is there a way for controls such as "panel" to start the selector from the bottom of the tabs?
i want the selector to work only below the header line.
maybe you can understand what I mean better on the photo.
You can change the inner area with the iViewBox* arguments in AddObjectFrame().
However, I don't know what you mean with "start the selector from the bottom of the tabs".
The selector is coming from you, from the user. Do you mean, how to prevent a selection above the panel headline?
May be I can correlate the area of a possible selection with the defined view box. Am I right?
punak wrote: Sat May 13, 2023 11:32 am Another question How can we replace the "click action" on the controls in this module?
For example, I want to have the right click on the control exactly the "selection action" that is done with the left click.
I hope you understand what I mean.
Thankful.
You mean, you want to map the selection frame action from the a left click to a right click? This is currently not possible. I have to think about it, how to implement such request.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
punak
User
User
Posts: 81
Joined: Tue Sep 07, 2021 12:08 pm

Re: EditorFactory - Module for object management in a Canvas

Post by punak »

thanks for your reply.
Do you mean, how to prevent a selection above the panel headline?
May be I can correlate the area of a possible selection with the defined view box. Am I right?
yes, that's exactly what I mean.
You mean, you want to map the selection frame action from the a left click to a right click?
I just want the selection of controls to be done with right click. suppose the left click of my mouse is broken. of course, this is common in other designers, that is, selecting objects with a right click just like a left click.
ShadowStorm
Enthusiast
Enthusiast
Posts: 303
Joined: Tue Feb 14, 2017 12:07 pm

Re: EditorFactory - Module for object management in a Canvas

Post by ShadowStorm »

Hi punak,

Thanks to you for trying our great module :)

Personally, I did not understand what you wanted, but as long as stargate understood, everything is fine ^^

For your last request, I had already proposed to stargate to be able to customize the mouse buttons for the selection of the objects as well as the clicks, and other actions still but it was not priority.

Currently, stargate is very busy, but what is good is that he has not abandoned the project, personally I leave him alone so as not to disturb him.

This module is not used enough, which does not necessarily give us much desire to work on it, you will understand, yet I keep saying that it is an excellent module but it interests almost nobody and it remains a deep mystery for me!
I am French, I do not speak English.
My apologies for the mistakes.

I have sometimes problems of expression
I am sometimes quite clumsy, please excuse me and let me know.
punak
User
User
Posts: 81
Joined: Tue Sep 07, 2021 12:08 pm

Re: EditorFactory - Module for object management in a Canvas

Post by punak »

Hi, you're welcome
I also appreciate the efforts of both of you. Stargate has handled this idea well.

regarding the design of container controls: if it can add "SplitterGadget", it can be said that this module does not lack anything from visual designers based on .NET. I am still stressing about adding this.

some ideas take time to become common.
I hope you are successful.
ShadowStorm
Enthusiast
Enthusiast
Posts: 303
Joined: Tue Feb 14, 2017 12:07 pm

Re: EditorFactory - Module for object management in a Canvas

Post by ShadowStorm »

Hi punak,

I don't understand what you want to do with a SplitterGadget?
Maybe you could explain in more detail and give examples?

You also know that the module proposes to be able to create several editors (canvas) at the same time in your application?
I am French, I do not speak English.
My apologies for the mistakes.

I have sometimes problems of expression
I am sometimes quite clumsy, please excuse me and let me know.
punak
User
User
Posts: 81
Joined: Tue Sep 07, 2021 12:08 pm

Re: EditorFactory - Module for object management in a Canvas

Post by punak »

Hi ShadowStorm,
please note, all designer engines can be able to support container controls and normal controls.
the engine you created now correctly designs the controls such as (panel, scroll area and container).
what special control is missing? Splitter control.

really ? unfortunately, I have not yet tested the design of multiple forms at the same time.
ShadowStorm
Enthusiast
Enthusiast
Posts: 303
Joined: Tue Feb 14, 2017 12:07 pm

Re: EditorFactory - Module for object management in a Canvas

Post by ShadowStorm »

Hello punak,

Yes but basically this module is not for creating "Gadgets" but "Manipulatable graphic objects", and I don't understand why you want a separator, what is the purpose here?

Yes this module allows you to create as many editors as you want, it's not complicated, there is an example that uses 2, but you can put 10 or 20 if you like, it will just be more complicated to manage all this mess ^^
I am French, I do not speak English.
My apologies for the mistakes.

I have sometimes problems of expression
I am sometimes quite clumsy, please excuse me and let me know.
Post Reply