together with ShadowStorm I want to present our module for object management in a Canvas Gadget.
This module is related to this original thread: Project Editors Factory...
The module can be used for creating a form editor, game editor, or any kind of object-based editors,
where you want to add, remove, move, resize, attach objects.
The module is not an editor itself, its a module to create an editor in a more easy way, without thinking about the object handling itself.
Key features:
- Create, delete and attached objects in an initialized canvas gadget.
- Add drawing callbacks for custom object drawing.
- Flags like: show, hide, disable, enable, select, unselect for objects.
- Adding and customizing handles at edges and corners for moving, resizing and adding custom events.
- Object attachment/container system with multiple frames inside of objects (like panel gadget).
- Event management for cursor and keyboard events on objects and handles.
- Definition of object boundaries for position and size.
- Set and get of "all possible" general object attributes, like: X, Y, width, height, data, cursor, handles, movement/resize steps, selection style.
EditorFactory.pbi (Version 1.17.01, 2021-08-07)
EditorFactory-1-17-01.zip (Archive with include and examples)
A short documentation of each procedure is given in the module part.
The include is shared under the CC BY-NC 4.0 licence.
Feature Requests and Bugs:
Change Log (1.17.01):
- Added: Example #6: Example06_Gadgets.pb
- Changed: More states returned by ObjectState() to create custom gadget easily, see example #6
- Added: IsObjectFrame(), AddObjectFrame(), RemoveObjectFrame(), MoveObjectFrame() to handle the frames inside of objects, but also between different objects.
- Added: ReleaseCanvasObjects() to clean up the object manager before the canvas is freed with FreeGadget.
- Added: #EventType_LeftMouseButtonHold, #EventType_RightMouseButtonHold, #EventType_MiddleMouseButtonHold to give continuously an event when a mouse button is held.
These events only available in thread safe mode!
This could be useful for the scroll bar arrows to perform a continuous scrolling. - Changed: CreateObject() - handling of the frame index is changed, see documentation!
- Changed: AddObjectFrame() now handles also the frame properties like view box and inner area size.
- Changed: SetObjectFrameClipping() --> SetObjectFrameViewBox() - changed behavior
- Changed: SetObjectFrameOffset() --> SetObjectFrameInnerOffset() - changed behavior
- Added: SetObjectFrameClipping(), SetObjectFrameOffset()
- Added: #Object_All, #Object_Default, #Object_Selected as possible constants for various functions.
- Added: #EventType_Created, #EventType_Freed
- Change: CanvasObjectsEvent() do not need a specific gadget
- Bug-fix: Multiple selection in different frames now disallowed.
- Bug-Fix: Partially selection works now.