Problems with Containers
Posted
#1
(In Topic #1101)
Regular

So far I am pretty close with this:
Code (gambas)
- 'FMain
- ' .Arrangement = Arrange.Vertical
- ' .Autoresize = True
- 'GreenPanel
- ' .Arrangement = Arrange.Horizontal
- ' Spring
- ' OrangePanel
- ' .Arrangement = Arrange.Vertical
- ' .Autoresize = True
- ' .Centered = True
- ' BlueTextLabel_XXX
- ' .Alignment = Left
- ' .Autoresize = True
- ' .Wrap = False
- ' GreenishTextLabel_O
- ' .Alignment = Left
- ' .Autoresize = True
- ' .Wrap = False
What do I need to change to make XXX and O drawn on top of each other? I'm thinking of a customized version of the Panel class with the stacking feature removed, but don't know how to do this.
Posted
Guru

Do you mean overlapping so it looks like one label?
If yes then it would be better to put them in a Horizontal aligned panel with a border and no spacing then remove the borders from the labels.
Then the panel border acts like the label border and the labels will look like one and can be aligned accordingly.
Posted
Guru

Regarding your present issue, I think what you are looking for is below. Be careful with the use of AutoResize. In your image it has reduced the size of the TextLables to next to nothing as there is next to nothing in them!
If I have incorrectly interpreted what you are looking for, then let me know and I will try again. If you want the TextLables at the bottom, remove the top Spring. If you want the TextLables at the top, remove both of the Springs.
<IMG src="https://www.cogier.com/gambas/GambasExpands.png">
</IMG>
Posted
Regular

I want O to be draw over X; Not above or below.BruceSteers said
Do you mean overlapping so it looks like one label?
PS: I try to make my app work consistently on both GTK and QT with different display scalings on each platform. I noticed that margin, padding and width are not reliable in QT with display scaling.
PSS: I also noticed that leading white space and consecutive white space is trimmed off from Gambas Text elements. This poses yet another problem I try to circumvent.
Maybe I have to investigate creation of a CustomContainer https://gambaswiki.org/wiki/dev/gambas?l=ru
Here's am example where this is going to be used:
Posted
Regular

Code
Public Sub Form_Open()
Dim L1 As New Label(Me)
Dim L2 As New Label(Me)
L1.X = 1
L1.Y = 1
L2.X = 1
L2.Y = 1
L1.AutoResize = True
L2.AutoResize = True
L1.Text = "Xxxxx"
L2.Text = "O"
Me.W = L1.Width
Me.H = L1.H
EndThat is the entire code for the project, just an empty form with this proc. No containers.
1 guest and 0 members have just viewed this.





