EditorFactory - Module for object management in a Canvas

Share your advanced PureBasic knowledge/code with the community.
User avatar
ChrisR
Addict
Addict
Posts: 1124
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: EditorFactory - Module for object management in a Canvas

Post by ChrisR »

STARGÅTE wrote:It is possible, but then you can not select the child object with the selection frame or in your case, create new object with the selection frame, because whenever you click into the empty space the parent object is selected.
Therefore I decided to allow only the border. Should it be changed?
No, you are perfectly right :oops:
The selection could be made if the size of the selection is less than a minimum objects size but no worries, it is fine as it is done
STARGÅTE wrote:But anyway, I have to check how we/you can handle that a child object is drawing over the parent empty space, but not over the scroll bars or the tabs in a panel gadget.
Probably I will include a function like SetObjectChildChipping(Object, Left, Top, Right, Bottom), where you can define the clip frame/padding for the drawing of inner objects.
In case of the PanelGadget: SetObjectChildChipping(Object, 0, 20, 0, 0)
In case of the ScrollAreaGadget: SetObjectChildChipping(Object, 0, 0, 20, 20)
SetObjectChildChipping seems very interesting and useful to address the need 8)

Thanks :)
Last edited by ChrisR on Sun Jan 24, 2021 8:40 pm, edited 2 times in total.
User avatar
STARGÅTE
Addict
Addict
Posts: 2063
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 all,

just as an information, we have succefully implemented most of all requested features,
but final checks need to be done and some examples need to be adjusted.
The next version will follow soon.
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
Amitris_de
User
User
Posts: 31
Joined: Wed Jan 06, 2021 2:53 pm

Re: EditorFactory - Module for object management in a Canvas

Post by Amitris_de »

@STARGÅTE : Thanks, this is great, I'll wait. 8)
User avatar
ChrisR
Addict
Addict
Posts: 1124
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: EditorFactory - Module for object management in a Canvas

Post by ChrisR »

wow, it was super fast :)

Be free to include, or not, my previous example
With your corrections and code improvement... (Remove CanvasPreDrawing_GridImageBackground and keep only GridColorBackground)
It should be a good demo, I guess, of your awesome module 8)
As you wish..
ShadowStorm
Enthusiast
Enthusiast
Posts: 237
Joined: Tue Feb 14, 2017 12:07 pm

Re: EditorFactory - Module for object management in a Canvas

Post by ShadowStorm »

Any example is welcome, you can also contribute by making examples, demos, programs.
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.
User avatar
STARGÅTE
Addict
Addict
Posts: 2063
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 »

New Version 1.15.00
  • 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
  • Extend version of Example05, as an example for the new functions SetObjectFrameClipping(), SetObjectFrameOffset()
Download:
EditorFactory.pbi (Version 1.15.00, 2021-01-24)
EditorFactory210124.zip (Archive with include and examples)
The include is shared under the CC BY-NC 4.0 licence.

To show the effective use of SetObjectFrameClipping(), SetObjectFrameOffset() I have updated also Example05_Attachment-and-containers.pb with three examples, how the attachment system can work.

@ChrisR:
I like your code example, but it is currently not included in the download archive. Probably you can check first by your self, if the new features works fine for you, and then you can send my the new demo code whcih I should upload.

Do not hesitate to give us feedback, we are looking forward to it.
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
User avatar
Rings
Moderator
Moderator
Posts: 1427
Joined: Sat Apr 26, 2003 1:11 am

Re: EditorFactory - Module for object management in a Canvas

Post by Rings »

very nice stuff !!!
thx for sharing
SPAMINATOR NR.1
User avatar
ChrisR
Addict
Addict
Posts: 1124
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: EditorFactory - Module for object management in a Canvas

Post by ChrisR »

Thanks for the new version
No worries at all for my example. Example05_Attachment-and-containers with the new functions SetObjectFrameClipping(), SetObjectFrameOffset() is really impressive 8)
Amitris_de
User
User
Posts: 31
Joined: Wed Jan 06, 2021 2:53 pm

Re: EditorFactory - Module for object management in a Canvas

Post by Amitris_de »

@STARGÅTE & @ShadowStorm: Thanks to both of you for the new version. :D
could this be a bug? sorry I could not write a description for it, I think the pictures are understandable.

VS ScrollArea :
https://i.ibb.co/B238QdJ/3.gif

EF ScrollArea :
https://i.ibb.co/Lg1FXjB/1.gif

VS ScrollArea :
https://i.ibb.co/936tQWC/4.gif

EF ScrollArea :
https://i.ibb.co/Vjcb19k/2.gif
Last edited by Amitris_de on Tue Jan 26, 2021 12:18 pm, edited 1 time in total.
User avatar
STARGÅTE
Addict
Addict
Posts: 2063
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 Amitris_de,

first of all, I just want to comment that there exists no "real" scroll area gadget in the editor factory module.
The editor factory module is just the environment or a tool to create things like a scroll area gadget.
From the images you showed, it looks like that the viewport is adapted when die object size gets larger (in case of the PB gadget).
I think it is a missing feature in editor factory, because currently the frame of an object has no "inner size".

For the next version I will extend the functionality for frames of objects.
I have to implement functions like: AddObjectFrame, RemoveObjectFrame, MoveObjectFrame, and additionally a function to set the inner size of such a frame.
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
Amitris_de
User
User
Posts: 31
Joined: Wed Jan 06, 2021 2:53 pm

Re: EditorFactory - Module for object management in a Canvas

Post by Amitris_de »

@STARGÅTE: This is very promising news, thanks for your efforts. do you have any plans to design the following in later versions?
1-menubar
2-toolbar
3-statusbar
4-splittergadget
ShadowStorm
Enthusiast
Enthusiast
Posts: 237
Joined: Tue Feb 14, 2017 12:07 pm

Re: EditorFactory - Module for object management in a Canvas

Post by ShadowStorm »

Hello Amitris_de,

Editors Factorys is not strictly speaking made to create "Gadgets", that's not its purpose!

Already with the new functionalities that Stargate has put in place
and which was not planned, it is already good!

Maybe later we can create a second module to create "Gadgets", but we're not there yet!

The usefulness of Editors Factory is to be able to manipulate your Objects as you please, but not to create "Gadgets" as such.

Although you can already do it easily thanks to it!
But, afterwards, ok, I'm not against the idea!

For your ideas, no, not planned in itself, you can do it all by yourself !

We already have other important things planned!

Rotate objects, undo and restore changes....
It's already a good thing that Stargate has done, I wouldn't want us to get lost!

Thanks for your ideas and remarks!
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.
User avatar
ChrisR
Addict
Addict
Posts: 1124
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: EditorFactory - Module for object management in a Canvas

Post by ChrisR »

I made a new example Panel Gadget.
The RemoveObjectFrame is nor Declared! is it intended ? I added it to be able to compile
Declare.i RemoveObjectFrame(iObject.i, iFrameIndex.i)


By using SetObjectFrameOffset(Object, 0, GetGadgetAttribute(GadgetID, #PB_Panel_TabHeight)),
There is an issue concerning the resizing of the panel in relation to the position of the child's objects.
It seems to be fixed with:
In AdjustWidth Procedure, I added *Object\FrameClip\iX here:

Code: Select all

If *ChildObject\eAttachmentMode & #Attachment_X And *ChildObject\iX + *ChildObject\iWidth + *Object\FrameClip\iX > iMinWidth And *ChildObject\Boundaries\iMaxX & #Boundary_ParentSizeMask = #Boundary_ParentSize & #Boundary_ParentSizeMask
  iMinWidth = *ChildObject\iX + *ChildObject\iWidth + *Object\FrameClip\iX
In AdjustHeight ProcedureI, I added *Object\FrameClip\iY here:

Code: Select all

If *ChildObject\eAttachmentMode & #Attachment_Y And *ChildObject\iY + *ChildObject\iHeight + *Object\FrameClip\iY > iMinHeight And *ChildObject\Boundaries\iMaxY & #Boundary_ParentSizeMask = #Boundary_ParentSize & #Boundary_ParentSizeMask
  iMinHeight = *ChildObject\iY + *ChildObject\iHeight + *Object\FrameClip\iY
I have a 2nd problem, or maybe a misuse!
When I delete a tab and then create a new tab, Several Frames are created according to the index of the frame (While ListSize(*ParentObject\lFrame()) <= iFrameIndex-1)
eg: I have 2 tabs (index 1, 2), I delete tab 1 and then create a new frame with index 3 (internal counter), 2 frames are created and not only the Frame index 3.

Edit: Fixed latest problem using CountObjectFrames() + 1 as Index for Creating a new Frame

Code: Select all

; Example_Panel_Gadget.pb

; Includes the program file
XIncludeFile "EditorFactory.pbi"

; Initializes the Module
UseModule EditorFactory

EnableExplicit

; --------- Example ---------

; Program constants
Enumeration 1
  #Window
  #Canvas
EndEnumeration

; Object constants starting from 1
Enumeration 1
  #Object1
  #Object2
  #Object3
  #Object4
EndEnumeration

#MinSize = 6

Macro _FreeCaptureGadget_(Gadget)   ; Free Image to Capture Image without Resizing
  If IsImage(GetGadgetData(Gadget))   
    FreeImage(GetGadgetData(Gadget)) : SetGadgetData(Gadget, #Null)
  EndIf
EndMacro

;{ ----------------------------------------------
; CaptureGadget: The message WM_PRINT is sent to a Gadget to request it to be drawn in a picture
; Need some Specific for: SpinGadget (Part1), ComboBoxGadget, EditorGadget, ExplorerComboGadget, SpinGadget (Part2) - (See IceDesign CaptureGadget procedure) 
;}
Procedure CaptureGadget(Gadget.i)
  Protected Image.i, hDC.i
  Image = CreateImage(#PB_Any,GadgetWidth(Gadget),GadgetHeight(Gadget))
  If IsGadget(Gadget)
    hDC =  StartDrawing(ImageOutput(Image))
    If hDC
      DrawingMode(#PB_2DDrawing_Default)
      Box(0, 0, OutputWidth(), OutputHeight(), $FFFFFF)   ; Gadget_BackColor
      SendMessage_(GadgetID(Gadget),#WM_PRINT,hDC, #PRF_CHILDREN|#PRF_CLIENT|#PRF_NONCLIENT|#PRF_OWNED|#PRF_ERASEBKGND)
      StopDrawing()
    EndIf 
  EndIf
  ProcedureReturn Image
EndProcedure

;{ ----------------------------------------------
; Callback procedure to draw on the object
;   Object.i is the number of the object, you can use it to get properties of the currently drawn object
;   Width.i is the current width of the object
;   Height.i is the current height of the object
;   iData.i is a custom data value set in SetObjectDrawingCallback, here it is used as the color
; This procedure will automatically called during the draw of the Object
;}
Procedure ObjectDrawing(Object.i, Width.i, Height.i, iData.i)   ; Draw Captured Image + Border
  Protected Image.i, Resize.b
  AddPathBox(0.5, 0.5, Width-1, Height-1)
  If IsGadget(iData)
    If GadgetWidth(iData) <> Width Or GadgetHeight(iData) <> Height
      ResizeGadget(iData, #PB_Ignore, #PB_Ignore, Width, Height)
      Resize = #True
    EndIf
    If IsImage(GetGadgetData(iData))
      If Resize
        FreeImage(GetGadgetData(iData))
        Image = CaptureGadget(iData)
        SetGadgetData(iData, Image)
      Else
        Image = GetGadgetData(iData)
      EndIf
    Else
      Image = CaptureGadget(iData)
      SetGadgetData(iData, Image)
    EndIf
    ;DrawVectorImage(ImageID(Image)) -  
    VectorSourceImage(ImageID(Image), 230, Width, Height) : FillPath(#PB_Path_Preserve)
  Else
    VectorSourceColor($804080C0)
    FillPath(#PB_Path_Preserve)
  EndIf
  If ObjectState(Object) = #State_Selected
    VectorSourceColor($A80000FF)
  Else
    VectorSourceColor($80FF0000)
  EndIf
  StrokePath(1)
EndProcedure

;{ ----------------------------------------------
; Create and Set Object
; GadgetID is the GadgetID 
; Object is the number of the object
; ParentObject is the number of the Parent Object
; FrameIndex An index of the frame (starting with 1) in which the object should attached (optional)
;
; Set Properties: ObjectData (GadgetID), ObjectBoundaries (#Boundary_ParentSize, MinWidth 6, MinHeight 6), ObjectDrawingCallback (iData=GadgetID),
; AddObjectHandle (#Handle_Size|#Handle_Position), SetObjectCursor (#PB_Cursor_Hand), ObjectHandleDisplayMode (#Handle_ShowIfSelected)
;}
Procedure CreateSetObject(GadgetID.i, Object.i, ParentObject.i=#PB_Default, FrameIndex.i=#PB_Default)
  Protected Parent.i, iMinX.i, iMinY.i, iMaxX.i = #Boundary_ParentSize, iMaxY.i = #Boundary_ParentSize
  CreateObject(#Canvas, Object, GadgetX(GadgetID), GadgetY(GadgetID), GadgetWidth(GadgetID), GadgetHeight(GadgetID), ParentObject, FrameIndex)
  SetObjectData(Object, GadgetID)
  If GadgetType(GadgetID) = #PB_GadgetType_Panel
    SetObjectFrameOffset(Object, 0, GetGadgetAttribute(GadgetID, #PB_Panel_TabHeight))
    AddObjectHandle(Object, #Handle_Custom1, CatchImage(#PB_Any, ?arrow_left_png) , #Alignment_Top | #Alignment_Right, -80, 0)   ; This is the handle to swap the frame
    AddObjectHandle(Object, #Handle_Custom2, CatchImage(#PB_Any, ?arrow_right_png), #Alignment_Top | #Alignment_Right, -60, 0)   ; This is the handle to swap the frame
    AddObjectHandle(Object, #Handle_Custom3, CatchImage(#PB_Any, ?delete_png)     , #Alignment_Top | #Alignment_Right, -40, 0)   ; This is the handle to swap the frame
    AddObjectHandle(Object, #Handle_Custom4, CatchImage(#PB_Any, ?add_png)        , #Alignment_Top | #Alignment_Right, -20, 0)   ; This is the handle to swap the frame
  EndIf
  If ParentObject <> #PB_Default And IsGadget(GetObjectData(ParentObject))
    Parent = GetObjectData(ParentObject)
    If GadgetType(Parent) = #PB_GadgetType_Panel
      iMaxY = #Boundary_ParentSize - GetGadgetAttribute(Parent, #PB_Panel_TabHeight)
    EndIf
  EndIf
  SetObjectBoundaries(Object, iMinX, iMinY, iMaxX, iMaxY, #MinSize, #MinSize)   ; Set the boundaries to the parent size.
  SetObjectDrawingCallback(Object, @ObjectDrawing(), GadgetID)
  AddObjectHandle(Object, #Handle_Size | #Handle_Position)
  SetObjectCursor(Object, #PB_Cursor_Hand)
  ObjectHandleDisplayMode(Object, #Handle_ShowIfSelected)
EndProcedure

;- ----- Main -----
Define GadgetID.i, EFParentObject.i = 1, EFObject.i = 2, EFIndex.i = 1 

UsePNGImageDecoder()

; Create a window
OpenWindow(#Window, 0, 0, 480, 360, "Example Captured Panel Gadget Objects", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)

; Create a canvas gadget
CanvasGadget(#Canvas, 0, 0, WindowWidth(#Window), WindowHeight(#Window), #PB_Canvas_Keyboard)

; Initializes the object management for the canvas gadget
If Not InitializeCanvasObjects(#Canvas, #Window)
  Debug "Unable to initialize the object manager !"    
EndIf

SetCursorSelectionStyle(#Canvas, #SelectionStyle_Solid|#SelectionStyle_Partially, RGBA(0, 128, 255, 255), 1, RGBA(0, 128, 255, 25))
SetObjectSelectionStyle(#Object_Default, #SelectionStyle_Dashed, $A80000FF, 1, #SelectionStyle_Ignore)
SetObjectBoundaries(#Object_Default, 0, 0, #Boundary_ParentSize, #Boundary_ParentSize) ; Set the boundaries to the parent size for the next created objects.

; Creates Gadget and then Create and Set an object to the specified canvas object
PanelGadget(#Object1, 20, 20, 440, 320)
AddGadgetItem(#Object1, -1, "Tab 1") : AddGadgetItem(#Object1, -1, "Tab 2") : SetGadgetState(#Object1, 0)
CloseGadgetList()
HideGadget(#Object1, #True)
CreateSetObject(#Object1, EFParentObject)

GadgetID = ButtonGadget(#PB_Any, 20*EFIndex, 20*EFIndex, 200, 60, "Button_" + Str(EFObject - 1)) : HideGadget(GadgetID, #True)
CreateSetObject(GadgetID, EFObject, EFParentObject, EFIndex) : EFObject + 1 : EFIndex + 1

GadgetID = ButtonGadget(#PB_Any, 20*EFIndex, 20*EFIndex, 200, 60, "Button_" + Str(EFObject - 1)) : HideGadget(GadgetID, #True)
CreateSetObject(GadgetID, EFObject, EFParentObject, EFIndex) : EFObject + 1 : EFIndex + 1

; The window's event loop
Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow                   ; Exit the program.
      Break
      
  EndSelect
  
  ; Event loop of the objects in the canvas gadget
  Repeat
    Select CanvasObjectsEvent(#Canvas)           ; Something happened in the canvas.
      Case #Event_Handle                         ; It is an Handle event
        Select CanvasObjectsEventType(#Canvas)   ; What type of Events happened on the Handle ?
          Case #EventType_LeftMouseClick
            If EventObject(#Canvas) = #Object1   ; Panel container - Here the currently shown frame is changed.
              If EventHandle(#Canvas) = #Handle_Custom1 And CountObjectFrames(EventObject(#Canvas)) > 0
                ShowObjectFrame(EventObject(#Canvas), (VisibleObjectFrame(EventObject(#Canvas))+CountObjectFrames(EventObject(#Canvas))-2) % CountObjectFrames(EventObject(#Canvas)) + 1)
                SetGadgetState(#Object1, VisibleObjectFrame(EventObject(#Canvas)) - 1)
                _FreeCaptureGadget_(#Object1)
              EndIf
              If EventHandle(#Canvas) = #Handle_Custom2 And CountObjectFrames(EventObject(#Canvas)) > 0
                ShowObjectFrame(EventObject(#Canvas), VisibleObjectFrame(EventObject(#Canvas)) % CountObjectFrames(EventObject(#Canvas)) + 1)
                SetGadgetState(#Object1, VisibleObjectFrame(EventObject(#Canvas)) - 1)
                _FreeCaptureGadget_(#Object1)
              EndIf
              If EventHandle(#Canvas) = #Handle_Custom3 And CountObjectFrames(EventObject(#Canvas)) > 1
                RemoveGadgetItem(#Object1, VisibleObjectFrame(EventObject(#Canvas)) - 1)
                RemoveObjectFrame(EventObject(#Canvas), VisibleObjectFrame(EventObject(#Canvas)))
                ShowObjectFrame(EventObject(#Canvas), GetGadgetState(#Object1) + 1)
                _FreeCaptureGadget_(#Object1)
              EndIf
              If EventHandle(#Canvas) = #Handle_Custom4 And CountObjectFrames(EventObject(#Canvas)) > 0
                OpenGadgetList(#Object1) : AddGadgetItem(#Object1, -1, "Tab " + Str(EFIndex)) : CloseGadgetList()
                GadgetID = ButtonGadget(#PB_Any, 20*EFIndex, 20*EFIndex, 200, 60, "Button_" + Str(EFObject - 1)) : HideGadget(GadgetID, #True)
                ; Does not work by using an internal Index counter, when I delete a tab and then create a new tab, Several Frames are created according to the internal Index (While ListSize(*ParentObject\lFrame()) <= iFrameIndex-1)
                ;CreateSetObject(GadgetID, EFObject, EFParentObject, EFIndex)
                ;SetGadgetState(#Object1, EFIndex - 1) : ShowObjectFrame(EventObject(#Canvas), EFIndex)
                CreateSetObject(GadgetID, EFObject, EventObject(#Canvas), CountObjectFrames(EventObject(#Canvas)) + 1)
                SetGadgetState(#Object1, CountGadgetItems(#Object1) - 1)
                ShowObjectFrame(EventObject(#Canvas), CountObjectFrames(EventObject(#Canvas)))
                EFObject + 1 : EFIndex + 1
                _FreeCaptureGadget_(#Object1)
              EndIf
            EndIf
        EndSelect
        
      Case #Event_Object                         ; It is an object event
        Select CanvasObjectsEventType(#Canvas)   ; What type of events happened on the object?
          Case #EventType_Selected
            ;Debug "Object " + EventObject(#Canvas) + " has been Selected. Put Object on Top." 
            SetObjectLayer(EventObject(#Canvas), -1, #PB_Absolute)   ; Push to the last layer (-1), on Top
          Case #EventType_Moved,  #EventType_Resized
            Debug "Object " + EventObject(#Canvas) + " (" + 
                  GetObjectX(EventObject(#Canvas), #Object_LocalPosition) + ", " + GetObjectY(EventObject(#Canvas), #Object_LocalPosition)  + ", " + 
                  GetObjectWidth(EventObject(#Canvas)) + ", " + GetObjectHeight(EventObject(#Canvas)) + ") Moved or Resized"
          Case #EventType_Selection
            ;Debug "A Selection has been Drawn: ({" + CanvasObjectsEventData(#Canvas, #EventTypeData_MinX) + ", " + CanvasObjectsEventData(#Canvas, #EventTypeData_MinY) + 
            ;      " }, {" + CanvasObjectsEventData(#Canvas, #EventTypeData_MaxX) + ", " + CanvasObjectsEventData(#Canvas, #EventTypeData_MaxY) + "}). " +
            ;      Str(ExamineObjects(#Canvas, #True)) + " Selected Object(s)."
        EndSelect                                ; CanvasObjectsEventType(#Canvas)
        
      Case #Event_None                           ; No Events.
        Break
    EndSelect                                    ; CanvasObjectsEvent(#Canvas)
  ForEver
  
ForEver

End

; Data section for the icon licensed under a Creative Commons Attribution 3.0 License. https://github.com/gammasoft/fatcow
DataSection
  arrow_left_png:
    Data.q $0A1A0A0D474E5089,$524448490D000000,$1000000010000000,$FFF31F0000000608,$5845741900000061
    Data.q $72617774666F5374,$2065626F64410065,$6165526567616D49,$00003C65C9717964,$DA78544144491501
    Data.q $861041034B3D93D4,$6A0867F03F5BDD9F,$980CAC03F8277169,$562349A6960A8280,$29967F4928DABD82
    Data.q $105C580C11B6B46D,$1360D2C2C108AB04,$3D2C39BBAEEDE9C2,$799D99B781C429A2,$27196B5857667679
    Data.q $434AA81BDFC66324,$040D8B680C60A7E0,$E6F812A31799291D,$926AD8DB1DE0C34C,$BEB16C666769CC66
    Data.q $DB3D81FA717CAF66,$B70B3CB0ED3D698E,$8ED3E1837C09219D,$68F635A54B808992,$1AB0518AA5E498F3
    Data.q $083B82C8D25A52ED,$ACB8CD0714A93677,$020FDA60F59FA27C,$362A2F3204E77B1E,$BD921395C2BC49C8
    Data.q $56867DD31157954A,$C06684F1322C473B,$9227DABED3AB5A8D,$0BFBBB837D6D49C4,$289BC25C46890FAE
    Data.q $53A58499D1AE19D7,$6FE2C33530F29D12,$F10693F0B4E845DF,$7E000300A7D33FFF,$009390748AB06662
    Data.q $AE444E4549000000
  arrow_right_png:
    Data.q $0A1A0A0D474E5089,$524448490D000000,$1000000010000000,$FFF31F0000000608,$5845741900000061
    Data.q $72617774666F5374,$2065626F64410065,$6165526567616D49,$00003C65C9717964,$DA78544144490D01
    Data.q $8025033FFFFFFC62,$04B006F030428189,$FEA428214A24604C,$2A433FF7F59863FD,$B06AD01323032333
    Data.q $193B5D8B1220504E,$3B73BFE4B27CDFFE,$88681FAFC19FFB88,$02197FDFFAC32F4F,$D03D63C7FC33A680
    Data.q $51450606551B0666,$CBC50CD985230606,$F96467FC54F61953,$EBF0CA9315DCD403,$3FEFFA317C061FCF
    Data.q $61CE9F970CCCB5C8,$8DBC35A19534F338,$1FC80B3FF19BB3C1,$D780C01A06CFDED7,$D8192BA05FDC9000
    Data.q $38B03BCFF5FF4121,$865E563AC32D4BA3,$6D68BC8334047FC0,$FFF083033C82F40C,$A9EC33661B898654
    Data.q $8C188503C9013064,$DC37FF0C1DEEC189,$632E0E0ED6EFF90A,$1FE71F13F7FA2070,$DCC86716E34C319F
    Data.q $91967CD40260C25A,$301C0D750923748C,$9900601004CCFD0E,$00DF4D769AFC8659,$AE444E4549000000
  add_png:
    Data.q $0A1A0A0D474E5089,$524448490D000000,$1000000010000000,$FFF31F0000000608,$5845741900000061
    Data.q $72617774666F5374,$2065626F64410065,$6165526567616D49,$00003C65C9717964,$DA78544144495C02
    Data.q $3D105153684B53A4,$4B1A4987926D36F7,$B65D8DC160B44B69,$5742911161FC1115,$EC4445828A082775
    Data.q $175A845C2E170B22,$A576764A0A17155A,$B48685C42E94DC14,$098D20B442C54A90,$9D3EFBE6D24D34F9
    Data.q $7985E1705315F979,$E6733339CEE777DC,$1FC2CB3FF030C30A,$54860CD2E0E34421,$47B34328C75D3E0D
    Data.q $7F3BCC81624DA04A,$4FCC2E4CBBF54B0F,$380FBB9E34E2E00D,$07FAC70373395D6F,$C89147CAD8735651
    Data.q $8ABC30421EB4206C,$16E5C29F9B9B4572,$F137D839E77E0A00,$5E58B7912B1F9AEC,$F295807672A4A3F7
    Data.q $31617453B0063A54,$4C99417B594282B4,$4D87218B1EC60036,$498FE2C7EEB93E09,$A9CEE0755063B6A4
    Data.q $8811B0167E9E7F6A,$2D75F0BBA648ED14,$92C6BB87F0C74D06,$C646C68F15150BE4,$2A310AA42BCFEDF1
    Data.q $FF46C6816D9BD018,$6EBD136576055B46,$39DDAC9F61986BF2,$268FC9C230E7A477,$F780137A4A229973
    Data.q $38652BB24B872A45,$A2702A1B67BBB315,$91CDC4ECEA8B6D25,$5FA94DD3DE548B74,$2AB2FABA95530B2E
    Data.q $BFE4584049D99023,$54802481CCFB9785,$E0625989B1D50A36,$EF8D2A89EF5D3832,$0958DEA76895308B
    Data.q $B4F131D1F5046680,$3745182FE8E10212,$64D1DACC93AA566C,$72019B2FB19F3DE1,$7E4800D022292279
    Data.q $C3A13247122D6F87,$F0026966CC2C25D0,$88171E2ACA34CF9E,$36BF2CC629C40DA6,$C6EAE378FBF9CA48
    Data.q $470E8F77448F51C4,$6299009AF5B2E017,$467E04C70514B90C,$AB88785B98E2640D,$1E17FDCA3BDF9B14
    Data.q $80B73ED189D2B5E0,$0AE78EE4EA346EC3,$C7453C19A4EDE655,$71C181AD02DE5BBF,$8E3B16DB8C343C9C
    Data.q $2360405AB762A5D7,$FBC1C4F8F7D5D988,$3990F131E2DAA63E,$EFCB21164B3012FF,$4CDC000C02BB8D7D
    Data.q $0000B1AFD4924B07,$42AE444E45490000
  delete_png:
    Data.q $0A1A0A0D474E5089,$524448490D000000,$1000000010000000,$FFF31F0000000608,$5845741900000061
    Data.q $72617774666F5374,$2065626F64410065,$6165526567616D49,$00003C65C9717964,$DA78544144495902
    Data.q $3D105153684B538C,$2069FA858A937DF7,$D45A846A514454D2,$DC50BADAA5A35A2E,$E85176085D4EE375
    Data.q $2E0B0B82174BB5C2,$A0D20A2A373B8DC4,$44350895517589B6,$68C6C6D5246C1F8B,$E979DEBBF797936C
    Data.q $CCCCB8607608D1B3,$2FE19779DCCDE739,$CD3DC7718C74F44B,$64C198C639F80F39,$58F5F399A7A1C6E9
    Data.q $C0746F6483F30181,$ED68FDC3B6F1ACB1,$03955E05A5AD07DA,$4D3E05EA7C88B166,$74A9B183AAAC823E
    Data.q $9300E8C1E4810FFC,$75040873D9E8F1E4,$E7601FB3B093A794,$A1B644A186B4A1E7,$FAFA4552A3063BA9
    Data.q $C7493D8C19D77035,$477BE4EF744C0B7F,$0F787E50E42F2146,$B816FC32C98163AE,$01391D34559240E3
    Data.q $DF465CAF2F05B427,$7BB3D12901232CF4,$E51E42D418F4722C,$A48016B2181A6DF8,$54F298A4EF55C268
    Data.q $5C971F4789E11C27,$F8F182ECEA133DD7,$CAB00D562857643E,$794C45D569795832,$450123C4F08E13AA
    Data.q $C15AB3073E4AEB48,$778F159FF8330786,$C0C4803AF3C4F082,$8462D60A4921EFB3,$F63662026AF13C23
    Data.q $100935BAE0E43BE3,$998CE046F3C4F08E,$9F2C66FACA6965B6,$24C8DC169B6C07EA,$79E20F027080A282
    Data.q $1A5A5F277DA68B02,$E7EF74D3066D0B6A,$121B4651B4F83FC0,$692B7882BE179F22,$74F7FB73A37A2644
    Data.q $0D226B76E9D01020,$E2A8C304BF31300D,$02EDD2A6FA0CABF9,$0D28593B2D449597,$AEAAFB4530B332A7
    Data.q $38450AAAA834D543,$E11C2754F22C5E9D,$ECEBE2E046B2B789,$5BEDD5CCD4ED3A4D,$C10565C4870E11DB
    Data.q $FB9F3030C747AD78,$73F6F890E71F7782,$7C2CD6F823FBC7D8,$95526C2EBB03ADC7,$CCC11F703422E293
    Data.q $25CDECF43BBECB45,$758D786A5E15BC11,$B9AAF15BD1BE1116,$97F9CFF5DB7E0BC2,$091508A250000300
    Data.q $49000000004CEEB8
EndDataSection
Last edited by ChrisR on Tue Jan 26, 2021 3:05 pm, edited 2 times in total.
User avatar
STARGÅTE
Addict
Addict
Posts: 2063
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 »

ChrisR wrote:The RemoveObjectFrame is nor Declared! is it intended ? I added it to be able to compile
The frame functions like RemoveObjectFrame() are not declared because they are not finished. Please wait for the next version.
ChrisR wrote:By using SetObjectFrameOffset(Object, 0, GetGadgetAttribute(GadgetID, #PB_Panel_TabHeight)),
There is an issue concerning the resizing of the panel in relation to the position of the child's objects.
Yes I also observed it. I will fix it.
ChrisR wrote:I have a 2nd problem, or maybe a misuse!
When I delete a tab and then create a new tab, Several Frames are created according to the index of the frame (While ListSize(*ParentObject\lFrame()) <= iFrameIndex-1)
eg: I have 2 tabs (index 1, 2), I delete tab 1 and then create a new frame with index 3 (internal counter), 2 frames are created and not only the Frame index 3.
All these points will be corrected if the frame-Functions are fully implemented.
However I have also some questions about functionallity:
  • Should the frame index behave like in PureBasic in the PanelGadget? That means, if one tab is in (index = 0) and you add a frame with index/position 3, it becomes index 1, instead of adding empty frames with index 1 and 2
  • If you remove a frame (index = 1) the next frames should fill the gap? Meaning next frame with index 2 become index 1?
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
User avatar
ChrisR
Addict
Addict
Posts: 1124
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: EditorFactory - Module for object management in a Canvas

Post by ChrisR »

STARGÅTE wrote:All these points will be corrected if the frame-Functions are fully implemented.
However I have also some questions about functionallity:
  • Should the frame index behave like in PureBasic in the PanelGadget? That means, if one tab is in (index = 0) and you add a frame with index/position 3, it becomes index 1, instead of adding empty frames with index 1 and 2
  • If you remove a frame (index = 1) the next frames should fill the gap? Meaning next frame with index 2 become index 1?
I think it would be nice like PB's tabs. Starting at 0 and to use -1 to add a Frame
It would be easier for the PanelGadget, the tabs and Frames would have then the same index.
Would be good to have the Amitris opinion.
Post Reply