Bug? Designer Visible Items

aaronk

Well-Known Member
Licensed User
Longtime User
Hello,

Not sure if this is a bug or not..

I am using the designer to create a little layout and I am using a panel in it.

If I set the panel's Visible state to True its shown and when its set to False it's hidden when I run the script (no code in the script at this stage)

So far so good..

If I now add a label inside this panel and set it's parent to be the panel and I set the panel's Visible state to False and now run the script the panel is hidden but the label is still shown.

Isn't it meant to hide the label as well as the panel ?

If I load the layout in my Activity ( Activity.LoadLayout("Layout1") ) it doesn't show the labels as the panel is set to false.

So in other words it works like it's meant to when you run the app when calling the layout in the activity but when running it in script mode in the designer it's not hiding the items that where placed in the panel when that panel's visible state is set to False (I am connected to the designer on my phone while running the designer script)
 

aaronk

Well-Known Member
Licensed User
Longtime User
In my Designer (v. 3.00) it works.

Are you sure you have set the panel as the parent of the label?
Yes.

I am using B4A v3.20 not v3.00

Here is what I have done:
- Connected to the designer to my phone (so I can see the layout etc. appear on my phone screen)
- Added a panel (panel1, parent = Activity)
- Added a label (label1, parent = panel1)
- Panel1 visible state to True
- Run the designer script and label1 and Panel1 is both showing.
- Changed Panel1 visible state to False
- Run the designer script and label1 is showing but the panel1 is not

This is all done by changing the properties in the designer, and not using any code in the designer.

If I then save the layout (layout1) and call/display that layout using code in my Activity like you normally would it works as it's meant to.
Just that it doesn't hide that object (the label in this case) if it's in a panel and if that panel visible is set to False.
If the label is not in the panel and the visible is set to false then it works.
 

aaronk

Well-Known Member
Licensed User
Longtime User
If you change the visibility of the views to false they won't show on the designer scripts screen.
I understand True = Show & False = Hide, but it still shows on your devices screen when using the designer.

Try this for me..
Download the Demo project attached to this post.

Without changing anything connect the designer to your phone/device.
Press the designer scripts tab in the designer.
Notice it shows the panel and label. (as it is set to True, So far so good..)
Click on the main tab and then click label1, You will notice that the parent is set to Panel1
Now click on Panel1 and set the visible to False (which should hide the panel and all object inside that panel when we run the script/layout)
Leave label1 (keep that visible to True)
Now run the designer script
Panel1 is gone, and label1 is also not showing in the Abstract designer. (Label1 parent is set to be panel1, that's why its not showing.. so far so good)
But look on your phone/device. The label is still showing!

I would of thought since the label is part of the panel it would also be hidden since the panel is hidden (set to false).

If you now call/load that layout in your Main Activity and run it, you will see that the label and panel is not shown as the panel's visible is set to False. (which is correct)
Loading and showing it in your Main activity it is working as you expect, when you run it using the designer the label is still shown on your device.

Hopefully this explains it a little better?
 

Attachments

  • Demo.zip
    6.9 KB · Views: 180

aaronk

Well-Known Member
Licensed User
Longtime User
Hi Erel,

This has only been half fixed in the latest version.
I have noticed the same issue happens with a panel.

Setting a panel visible state to False it is hidden in the Abstract designer when running it in script mode, but it's still showing on the phone during script mode.
 
Top