K Kiran Raotole Active Member Licensed User Aug 28, 2018 #1 Hii experts, I have to create an application by custom components class. in which I want all same property of default object. like Button class, I want to create my custom components button which contains all property and event of buttons. like in other software, there is option of base class, to take all similar property to this class. I created a new custom components custbutton I add it in my designer trying to generate button_click event, but it not show. Last edited: Aug 28, 2018
Hii experts, I have to create an application by custom components class. in which I want all same property of default object. like Button class, I want to create my custom components button which contains all property and event of buttons. like in other software, there is option of base class, to take all similar property to this class. I created a new custom components custbutton I add it in my designer trying to generate button_click event, but it not show.
Cableguy Expert Licensed User Longtime User Sep 1, 2018 #21 without seeing your code, we can only guess… Upvote 0
K Kiran Raotole Active Member Licensed User Sep 1, 2018 #22 Sorry, Here is my edittext custom view : Code: Copy Public Sub DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) mBase = Base edittext.Initialize("edittext") Base.AddView(edittext,0,0,Base.Width,Base.Height) End Sub and In activity i'm using edittext property like hinttext, but it not work. Is there is any option for this? Upvote 0
Sorry, Here is my edittext custom view : Code: Copy Public Sub DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) mBase = Base edittext.Initialize("edittext") Base.AddView(edittext,0,0,Base.Width,Base.Height) End Sub and In activity i'm using edittext property like hinttext, but it not work. Is there is any option for this?
LucaMs Expert Licensed User Longtime User Sep 1, 2018 #23 I think that a good way when you "wrap" a "native View", to add custom properties/events which the View does not has, is to write only the new feateures and expose the "native View" (by a method) to allow the developer to set all the other properties, instead of creating in the custom view all the properties already present in the View. For example: i want a jumping button. Well, I create my custom view, a Button1 inside of it, the jumping method (Public Sub Jump(...)) and a method to get the "base button" (Public GetButton As Button - Return Button1) Last edited: Sep 1, 2018 Upvote 0
I think that a good way when you "wrap" a "native View", to add custom properties/events which the View does not has, is to write only the new feateures and expose the "native View" (by a method) to allow the developer to set all the other properties, instead of creating in the custom view all the properties already present in the View. For example: i want a jumping button. Well, I create my custom view, a Button1 inside of it, the jumping method (Public Sub Jump(...)) and a method to get the "base button" (Public GetButton As Button - Return Button1)
K Kiran Raotole Active Member Licensed User Sep 1, 2018 #24 I tried like this but I'm unable to change default property then or use event, like if I want to use that custom view click event, i can't use it. Upvote 0
I tried like this but I'm unable to change default property then or use event, like if I want to use that custom view click event, i can't use it.
LucaMs Expert Licensed User Longtime User Sep 1, 2018 #25 Kiran Raotole said: I tried like this but I'm unable to change default property then or use event, like if I want to use that custom view click event, i can't use it. Click to expand... https://www.b4x.com/android/forum/threads/custom-view-default-value.96759/#post-610374 Upvote 0
Kiran Raotole said: I tried like this but I'm unable to change default property then or use event, like if I want to use that custom view click event, i can't use it. Click to expand... https://www.b4x.com/android/forum/threads/custom-view-default-value.96759/#post-610374
Cableguy Expert Licensed User Longtime User Sep 2, 2018 #27 I haven't done much work with B4A in a long time, but on b4j it will throw at least an error, even if it doesn't crash the app completely Upvote 0
I haven't done much work with B4A in a long time, but on b4j it will throw at least an error, even if it doesn't crash the app completely
LucaMs Expert Licensed User Longtime User Sep 2, 2018 #28 Cableguy said: I haven't done much work with B4A in a long time, but on b4j it will throw at least an error, even if it doesn't crash the app completely Click to expand... I suppose you wanted to answer the other discussion-thread. It is not so; your app does not crashes if the activity sub you try to call from inside your (custom view) class does not exists. Anyway, if you use SubExists you do not create damage Upvote 0
Cableguy said: I haven't done much work with B4A in a long time, but on b4j it will throw at least an error, even if it doesn't crash the app completely Click to expand... I suppose you wanted to answer the other discussion-thread. It is not so; your app does not crashes if the activity sub you try to call from inside your (custom view) class does not exists. Anyway, if you use SubExists you do not create damage
Cableguy Expert Licensed User Longtime User Sep 2, 2018 #29 LucaMs said: I suppose you wanted to answer the other discussion-thread. It is not so; your app does not crashes if the activity sub you try to call from inside your (custom view) class does not exists. Anyway, if you use SubExists you do not create damage Click to expand... That's the danger of using the phone to answer topics... sorry for posting on the wrong thread. Thanks Lucas for pointing this out Upvote 0
LucaMs said: I suppose you wanted to answer the other discussion-thread. It is not so; your app does not crashes if the activity sub you try to call from inside your (custom view) class does not exists. Anyway, if you use SubExists you do not create damage Click to expand... That's the danger of using the phone to answer topics... sorry for posting on the wrong thread. Thanks Lucas for pointing this out
LucaMs Expert Licensed User Longtime User Sep 2, 2018 #30 Cableguy said: That's the danger of using the phone to answer topics... sorry for posting on the wrong thread. Thanks Lucas for pointing this out Click to expand... Same "author" Upvote 0
Cableguy said: That's the danger of using the phone to answer topics... sorry for posting on the wrong thread. Thanks Lucas for pointing this out Click to expand... Same "author"