B4J Question B4J - again from panel to panel

ivanomonti

Expert
Licensed User
Longtime User
I noticed that the panes anchored inside a pane and not only the panes but also objects such as buttons, labels etc etc if they are inside a panel which in turn and in the main panel have no effect. Is this behavior correct?

I tried not to put anchor on the parent panel or put it and the same thing, it seems that the daughter anchors don't work.

 

zed

Active Member
Licensed User
For me, the parent and child panel anchors work well when I use the designer.
When the parent position is declared in the script, then child panel anchors do not work on parent panels.
 
Upvote 0

ivanomonti

Expert
Licensed User
Longtime User
For me, the parent and child panel anchors work well when I use the designer.
When the parent position is declared in the script, then child panel anchors do not work on parent panels.
the objects on the parent panel are fine, but except if inside the parent panel you have other panels and its objects, look at my image, those child panels and profile objects have no effect either with anchor or with anything except through code.

For example, if I size the child panel then the objects resize, otherwise they are as if they don't have it yet even if they have it. and I did everything as a designer.


B4X:
        Pane_main.PrefHeight = 900 ' pane parent (master)
        Pane_main.PrefWidth = 780 ' pane parent (master)
        Pane_main.Left = 400 ' pane parent (master)
        Pane_main.Top = 0 ' pane parent (master)
      
        Pane_Artificial_intelligent.PrefWidth = 560 ' pane child
        grafico1.GetBase.As(Pane).PrefWidth = 760 ' pane child
        Pane_wallet.PrefWidth = 760 ' pane child
        Button_winner_info.PrefWidth = Button_winner_info.PrefWidth-400 ' button into pane child
        Pane_info.Left = Pane_info.Left-400 ' pane into pane child
        Pane_buy_sell.Left = Pane_buy_sell.Left-400 ' pane chil
        Button_play_long.Left = Button_play_long.Left - 400 ' object into pane child
        Button_play_short.Left = Button_play_short.Left - 400 ' object into pane child
 
Upvote 0

ivanomonti

Expert
Licensed User
Longtime User
this is an example where I resize panel 1 to see panel three below, in panel one there is panel 2 with its button and panel 1 has its button

I don't have to shrink the window but reposition the parent panel to see an underlying panel, and in this case the panel does not inherit the parent's anchors
 

Attachments

  • Panetopane.zip
    212.9 KB · Views: 79
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
When you change dimensions at runtime, by code, the anchors do not work, it is always as if they did not exist.
 
Upvote 0

ivanomonti

Expert
Licensed User
Longtime User
the truth is that they are not taken into consideration, because if I model the window with the classic resize method they work

B4X:
Private Sub Button1_Click
'    If Pane1.PrefWidth >= 580 Then
'        Pane1.Left = Pane1.Left + 200
'        Pane1.PrefWidth = Pane1.PrefWidth - 200
'    Else
'        Pane1.Left = Pane1.Left - 200
'        Pane1.PrefWidth = Pane1.PrefWidth + 200
'    End If
    If Main.MainForm.WindowWidth >=600 Then
        Main.MainForm.WindowWidth = Main.MainForm.WindowWidth-200
    Else
        Main.MainForm.WindowWidth = Main.MainForm.WindowWidth+200
    End If
End Sub

examples download

When you change dimensions at runtime, by code, the anchors do not work, it is always as if they did not exist.
 

Attachments

  • Panetopane.zip
    215.9 KB · Views: 79
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…