rwblinn Well-Known Member Licensed User Longtime User Oct 20, 2016 #1 Hi, developed a Custom View (CV) ListViewEdit. It contains the routines Code: Public Sub DesignerCreateView (Base As Pane, Lbl As Label, Props As Map) to create using the B4J Designer and Code: Public Sub AddToParent(Parent As Pane, Left As Int, Top As Int, Width As Int, Height As Int) to create the CV via code. In an example created a CVs ListViewEdit1 using the Designer and ListViewEdit2 As ListViewEdit using code. Issue Resizing the CV code created using button Resize List 2, is not working, whilst created with the Designer works fine via button Resize List 1. It seems that the sub Public Base_Resize in the CV class is not called when the CV is created via code. Any hints appreciated. See attached example code and the draft CV. Attachments CustomViewListViewEdit.zip CustomViewListViewEdit.zip 5.1 KB · Views: 310 Last edited: Oct 20, 2016
Hi, developed a Custom View (CV) ListViewEdit. It contains the routines Code: Public Sub DesignerCreateView (Base As Pane, Lbl As Label, Props As Map) to create using the B4J Designer and Code: Public Sub AddToParent(Parent As Pane, Left As Int, Top As Int, Width As Int, Height As Int) to create the CV via code. In an example created a CVs ListViewEdit1 using the Designer and ListViewEdit2 As ListViewEdit using code. Issue Resizing the CV code created using button Resize List 2, is not working, whilst created with the Designer works fine via button Resize List 1. It seems that the sub Public Base_Resize in the CV class is not called when the CV is created via code. Any hints appreciated. See attached example code and the draft CV.
Erel B4X founder Staff member Licensed User Longtime User Oct 23, 2016 #2 The EventName is not set correctly. It is mBase instead of Base. BTW, there aren't many good reasons to add direct code support. Developers can always create a layout with only the custom view and add it multiple times. Upvote 0
The EventName is not set correctly. It is mBase instead of Base. BTW, there aren't many good reasons to add direct code support. Developers can always create a layout with only the custom view and add it multiple times.