xsharp.eu • Owner alignment in VO X# windows
Page 1 of 1

Owner alignment in VO X# windows

Posted: Tue Dec 20, 2022 3:40 pm
by ic2
In our VO project-in-conversion we have VO windows. Unchanged these have owner alignments settings.

Now I see in e.g. 1 screen that a couple of separate controls with OA_X at the right of the window move further right while enlarging the window, as expected and like in VO.

But we have a couple of other control, MLE e.g., with resp OA_WIDTH_HEIGHT, OA_Y_WIDTH and OA_HEIGHT, next to each other. Below on the full width of the window a bBrowser with OA_WIDTH_HEIGHT.

None enlarge or move when on enlarging that very same window, while this works fine in VO.

What could cause that? How to solve?

Dick

Owner alignment in VO X# windows

Posted: Tue Dec 20, 2022 7:07 pm
by Chris
Hi Dick,

We are not aware of such an issue, can you please send a (compilable) sample showing this?

Owner alignment in VO X# windows

Posted: Wed Dec 21, 2022 11:37 am
by ic2
Hello Chris,

In a simple test program it worked fine. But I found the cause. In the postinit of the window, code like this is applied:

Self:oDCmOpmerking:OwnerAlignment := 0x15140000 // 1/5 1/4 0% 0%
Self:oDCMemoIntern:OwnerAlignment := 0x15140014
Self:oDCMemoCarcube:OwnerAlignment := 0x15140024
Self:oDCMemoOrder:OwnerAlignment := 0x15140034

I was already a bit surprised about the seemingly random owner alignments in the window editor of some of the MLE's but in VO this is apparently overruled by these settings and in X# this is doing nothing.

I guess I can apply that in a sample but maybe you have an idea why the above doesn't set owner alignment in X# without a sample?

Dick

Owner alignment in VO X# windows

Posted: Wed Dec 21, 2022 12:05 pm
by robert
Dick,
For this style of the owner alignment to work, the value needs to be of type PTR.

In your code, these are numbers.
In the linear owner alignment sample in VO, this can be seen as:

Code: Select all

oDCMLE1:OwnerAlignment         := PTR(_CAST, 0x12130000)
So you need to add the PTR(_CAST,...) to your code.
I am not sure why this worked in your VO code. It should not have worked in VO too.


Robert

Owner alignment in VO X# windows

Posted: Wed Dec 21, 2022 1:16 pm
by ic2
Hello Robert,
robert post=24849 userid=253 wrote: I am not sure why this worked in your VO code. It should not have worked in VO too.
Thanks for the quick reply, this fixed it indeed.

We have seen this often, that we wondered how it could ever work in VO but it did. Great for sloppy written code :) but it's good that X# is tighter. In some cases like this it is not immediately clear (as this compiled without error) but good we found it.

Dick