Owner alignment in VO X# windows

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Owner alignment in VO X# windows

Post 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
User avatar
Chris
Posts: 4910
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Owner alignment in VO X# windows

Post by Chris »

Hi Dick,

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

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Owner alignment in VO X# windows

Post 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
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Owner alignment in VO X# windows

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Owner alignment in VO X# windows

Post 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
Post Reply