iOS Question Panel enabled/disabled behaviour different to B4A

JackKirk

Well-Known Member
Licensed User
Longtime User
During porting of a large app from B4A to B4I I have found an inconsistency in behaviour of panels.

In B4A - if a panel is disabled its child views can be disabled or enabled, depending on the setting you apply to the child view.

In B4I - if a panel is disabled its child views are also disabled regardless of the setting you apply to the child view.

Am I imagining things? - code is becoming blurry right now.

Is this by design?

Is it a bug?

If it is by design - it was a nasty little dirty corner that took me a half day to fall to.

Comments?
 

JackKirk

Well-Known Member
Licensed User
Longtime User
Erel,

Why do you disable the panel in B4A? What does it do?

It is a container for a host of other views (e.g. radio buttons) - its a long story.

There is no Enabled property for panels in B4i.

Splitting hairs :) - I never used the term "Enabled property" wrt B4I panels - I am en/disabling them with
UserInteractionEnabled

The behavior of these controls is based on the behavior of the native controls.

So I take it the different behaviours I am observing are correct - as this is a fairly fundamental difference it should be prominently documented somewhere - have I missed it?

Don't take my snarly posts too much to heart - I continue to be immensely impressed with what you have done...
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Erel,



It is a container for a host of other views (e.g. radio buttons) - its a long story.



Splitting hairs :) - I never used the term "Enabled property" wrt B4I panels - I am en/disabling them with
UserInteractionEnabled



So I take it the different behaviours I am observing are correct - as this is a fairly fundamental difference it should be prominently documented somewhere - have I missed it?

Don't take my snarly posts too much to heart - I continue to be immensely impressed with what you have done...

Those differences are because of the differences of the platforms. Klaus has a great documentation for both b4i and b4a. You should check it.
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Hi,

Could you give me a pointer - I've tried some forum searches without success.

Thanks...
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Erel, the question has evolved to "is there any documentation that indicates differences between B4A and B4i wrt effects of panel enabled state on child views"

In my initial post I noted a significant difference that I thought I had found.

Regards...
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
tufanv,

Thanks for your interest - I was aware of Klaus' beginners guide and had been thru it thoroughly some time ago.

I just went through it again - its section on B4A vs B4I doesn't cover the issue this thread is about.

If Klaus reads this, could I be so bold as to suggest the following enhancement (in red) to 11.2:

~~~~~~~~~~~~~~~~~~~~~~~~~
11.2 Panel
B4i
Panels don’t have a background bitmap.
But you can draw onto a Panel with a Canvas.

If a Panel, without event routines, covers other views the events are NOT submitted to the underlying views. In B4A they are!
If you want to submit them, you must set the UserInteractionEnabled property to False:

Panel1.UserInteractionEnabled = False

If a panel is disabled (UserInteractionEnabled = False) its child views are also disabled regardless of the UserInteractionEnabled setting you apply to the child view.

Transparent panel: Background: Color.Transparent Alpha = 1

B4A
Panels have a background bitmap.
It is also possible to draw onto a Panel with a Canvas.
If a Panel, without event routines, covers other views the events ARE submitted to the underlying views. In B4i they are NOT!
To avoid this, one solution is to add an empty event routine.

If a panel is disabled (Enabled = False) its child views can be disabled or enabled, depending on the Enabled setting you apply to the child view.

Transparent panel: Background: Color.Transparent Alpha = 0
~~~~~~~~~~~~~~~~~~~~~~~~~

This all assumes my discovery is correct...
 
Upvote 0
Top