Position PRIM_IMAG component programmatically

This forum allows developers to post programming tips and coding techniques that may be useful to other Visual LANSA developers. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
User avatar
belzswd
Posts: 8
Joined: Mon Jun 03, 2024 6:41 pm

Position PRIM_IMAG component programmatically

Post by belzswd »

I have a routine like the following, but I'm trying to position the Image dynamically (the literal Left/Top assignments are just a sample) -

Mthroutine Name(RevealImage)
#Image.Left := 220
#Image.Top := 35
#Image.DisplayPosition := 1
#Image.FadeIn Delay(0) Duration(300)
#Image.Visible := True
#Image.FadeOut Delay(2000) Duration(1000) Visible(False)
#Image.Visible := False
#Image.Top := 0
#Image.Left := 0
#Image.DisplayPosition := 3
Endroutine

---ooo---
FadeIn/FadeOut is working fine, however the Left/Top positioning is not .. Instead the image is always positioned at [0,0] when it fades in/out.

What am I missing here?

Regards, Anthony.
User avatar
belzswd
Posts: 8
Joined: Mon Jun 03, 2024 6:41 pm

Re: Position PRIM_IMAG component programmatically

Post by belzswd »

FYI - I dropped the reversion to Top/Left = [0,0] at the end of the routine, & this worked - Not very intuitive, as this is after the fade-out & visible = false assignments. I'd like to return the default position [0,0] afterwards at some point, but this can be deferred.

Comments welcome. 🐏
davidbalansa
Posts: 92
Joined: Mon Feb 01, 2016 10:08 am

Re: Position PRIM_IMAG component programmatically

Post by davidbalansa »

Hi

I would say the image is positioning back to [0,0] before the display updates from the FadeIn settings. You may be thinking that the command execution is pausing at the Visible True / False commands based on your FadeIn / FadeOut settings.

Also setting the DisplayPosition will not have any implications unless you are using a layout manager to control the image position.

Regards
Post Reply