imgsimonebiliato Well-Known Member Licensed User Longtime User Sep 30, 2015 #1 Hello, I created a class with a custom panel. I want to create an event "Show", showing the panel in the main activity. How do I do?
Hello, I created a class with a custom panel. I want to create an event "Show", showing the panel in the main activity. How do I do?
Erel B4X founder Staff member Licensed User Longtime User Sep 30, 2015 #2 You have two options: 1. Pass the Activity to the Show sub: B4X: Public Sub Show(Activity As Activity) 2. Create a sub that returns the internal view and add the custom panel in the activity code: B4X: Public Sub getView As View Return innerPanel End Sub Upvote 0
You have two options: 1. Pass the Activity to the Show sub: B4X: Public Sub Show(Activity As Activity) 2. Create a sub that returns the internal view and add the custom panel in the activity code: B4X: Public Sub getView As View Return innerPanel End Sub
imgsimonebiliato Well-Known Member Licensed User Longtime User Sep 30, 2015 #3 Hello, I used the first method. But using the 2, I must call the MainActivity.AddView(...) ? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Sep 30, 2015 #4 imgsimonebiliato said: But using the 2, I must call the MainActivity.AddView(...) ? Click to expand... Yes. If you are creating a custom control then with the AsView property you are allowing the client to treat the custom control like any other control. Upvote 0
imgsimonebiliato said: But using the 2, I must call the MainActivity.AddView(...) ? Click to expand... Yes. If you are creating a custom control then with the AsView property you are allowing the client to treat the custom control like any other control.
imgsimonebiliato Well-Known Member Licensed User Longtime User Sep 30, 2015 #5 I saw that using CustomDialog2, I call the method "Show", but without passing any panels or activity. How do I implement this? Upvote 0
I saw that using CustomDialog2, I call the method "Show", but without passing any panels or activity. How do I implement this?
Erel B4X founder Staff member Licensed User Longtime User Sep 30, 2015 #6 The dialogs are based on a different mechanism. You will need to add your panel to another panel or activity. Upvote 0
The dialogs are based on a different mechanism. You will need to add your panel to another panel or activity.
imgsimonebiliato Well-Known Member Licensed User Longtime User Oct 7, 2015 #7 Erel said: The dialogs are based on a different mechanism. You will need to add your panel to another panel or activity. Click to expand... So in the class, I create a panel that it is show in another panel? Upvote 0
Erel said: The dialogs are based on a different mechanism. You will need to add your panel to another panel or activity. Click to expand... So in the class, I create a panel that it is show in another panel?
Erel B4X founder Staff member Licensed User Longtime User Oct 7, 2015 #8 For a dialog an Activity will be better. Upvote 0
imgsimonebiliato Well-Known Member Licensed User Longtime User Oct 7, 2015 #9 I can't understand.. How can I implement a class that use an activity? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 7, 2015 #10 See the code in post #2. Upvote 0