J Juzer Hussain Active Member Licensed User Longtime User Oct 26, 2020 #1 Hi, I have a requirement of adding a panel with text box to few forms to show help. This panel is not added in layout. I want to add it through a common class to avoid writing in every form. Is there a way for this. Pls give some clue. Thanks Juzer
Hi, I have a requirement of adding a panel with text box to few forms to show help. This panel is not added in layout. I want to add it through a common class to avoid writing in every form. Is there a way for this. Pls give some clue. Thanks Juzer
B Brian Dean Well-Known Member Licensed User Longtime User Oct 26, 2020 #2 I want to add it through a common class to avoid writing in every form. Is there a way for this. Click to expand... This is quite easy to do. I usually add a semi-transparent panel over the activity - this dims the screen and stops the User activating any views. Then another panel on top of that carries the help information. I am a bit busy at the moment, but if you are interested I can post a demo example later. Upvote 0
I want to add it through a common class to avoid writing in every form. Is there a way for this. Click to expand... This is quite easy to do. I usually add a semi-transparent panel over the activity - this dims the screen and stops the User activating any views. Then another panel on top of that carries the help information. I am a bit busy at the moment, but if you are interested I can post a demo example later.
J Juzer Hussain Active Member Licensed User Longtime User Oct 26, 2020 #3 Thanks Brian, Actually i wanted to avoid adding any view to layouts. Looks like it isn't possible to add everything from class. I will also add a panel(in every layout) and add a panel over it from class to show help text. Thanks Juzer Upvote 0
Thanks Brian, Actually i wanted to avoid adding any view to layouts. Looks like it isn't possible to add everything from class. I will also add a panel(in every layout) and add a panel over it from class to show help text. Thanks Juzer
B Brian Dean Well-Known Member Licensed User Longtime User Oct 26, 2020 #4 Actually i wanted to avoid adding any view to layouts. Click to expand... I don't add any views to the layout - the class creates the panel. It certainly is possible to add everything from a class! Are you interested now? Upvote 0
Actually i wanted to avoid adding any view to layouts. Click to expand... I don't add any views to the layout - the class creates the panel. It certainly is possible to add everything from a class! Are you interested now?
J Juzer Hussain Active Member Licensed User Longtime User Oct 26, 2020 #6 After getting value in class (from the job) I am loading a predefined layout in a temporary panel. When i am trying to add this temp panel to activity it gives error. Upvote 0
After getting value in class (from the job) I am loading a predefined layout in a temporary panel. When i am trying to add this temp panel to activity it gives error.
J Juzer Hussain Active Member Licensed User Longtime User Oct 26, 2020 #7 error in below line java.lang.ClassCastException: java.lang.Class cannot be cast to anywheresoftware.b4a.BALayout Code: sModule.AddView(tmpPanel,0,0,10%x,10%y) Upvote 0
error in below line java.lang.ClassCastException: java.lang.Class cannot be cast to anywheresoftware.b4a.BALayout Code: sModule.AddView(tmpPanel,0,0,10%x,10%y)
B Brian Dean Well-Known Member Licensed User Longtime User Oct 26, 2020 #8 Here is the demo. This one gives short help tips with "Got it" (don't show again) and "Later" (don't bother me now) options. I have added a "Reset" button to set everything back to the start - this is useful for the demo. If you want to give longer help messages then you will have to adapt the demo to provide a larger area for text. However the principle of overlaying a panel to screen the underlying activity will be the same. Note that you need to give the panel some elevation to get above buttons. Let me know if anything is unclear. Attachments HelpDemo.zip HelpDemo.zip 10.9 KB · Views: 266 Last edited: Oct 26, 2020 Upvote 0
Here is the demo. This one gives short help tips with "Got it" (don't show again) and "Later" (don't bother me now) options. I have added a "Reset" button to set everything back to the start - this is useful for the demo. If you want to give longer help messages then you will have to adapt the demo to provide a larger area for text. However the principle of overlaying a panel to screen the underlying activity will be the same. Note that you need to give the panel some elevation to get above buttons. Let me know if anything is unclear.
J Juzer Hussain Active Member Licensed User Longtime User Oct 26, 2020 #9 I checked the demo and found a minor difference instead of Me it should be Activity when calling class function . I changed it and it worked. Lot of Thanks Brian. Juzer Upvote 0
I checked the demo and found a minor difference instead of Me it should be Activity when calling class function . I changed it and it worked. Lot of Thanks Brian. Juzer