Simplicty and flexibility!

SubForm+Getcurrent problems

Started by afonso santos
You will need to Sign In to be able to add or comment on the forum!

SubForm+Getcurrent problems

Hi all,

In my App i need to show a picture related with the product i'm listing in a subform.

Using MouseOver event I've:

define "xpos" number .

define "ypos" number .

act := setvalue("image",foto.value) .

xpos := xinfo.value .

ypos := yinfo.value .

act := LabelExecDQL("DQLM1",xpos ,ypos,code_level1.value,"","") .

act := setstate("image",1) .

DQLM1 code defined into the form:

define "retval" text .

define "xpos" number .

define "ypos" number .

define "code" text .

xpos := data-entry field1 +5 .

ypos := data-entry field2 +5 .

code := data-entry field3 .

retval := SetCurrent("Move","image",xpos,ypos) .

xinfo and ypos are virtual fields into the rows of subform with the derivation :


getcurrent("XPOS",concat("code_level1#",GetCurrent("RowNumber")-1) )


getcurrent("YPOS",concat("code_level1#",GetCurrent("RowNumber")-1) )

Problems :

a)In MouseOver Event while I don't scroll down/up the subform's content, the xinfo & yinfo are both OK

As soon I scroll down/up, these value are incorrect ( reporting negative numbers )

b) The picture ( Object called "image" ) is not properly shown in the coordinates given  .

What am I doing wrong?

Thks Afonso

Written by afonso santos 19/11/17 at 16:22:17 Dataease [{8}]FIVE

Re:SubForm Getcurrent problems

No ideias about it ?



Written by afonso santos 27/11/17 at 00:09:26 Dataease [{8}]FIVE

Re:Re:SubForm Getcurrent problems

GoTo Sample


Not sure what you are trying to do here, but it looks quite a complex way of achieving the objective ;-)

The object model of DataEase is old and rigorous and you have to play within the rules.

I can see a lot of potential problems in your code which is not a bug but "rules" that one need to comply with.

To put it in frank English - it is easy to get ones knickers in a twist here...

1. you can't move a child outside the borders of its parent.
2. The data in a subform row does not own the row, the row is a container and the objects just inhabit  when it is that number in the row,when you scroll the data move to a new row i.e the row is not a property of the data but the other way around.

When you combine DQL and OML you can get very peculiar results as they have a completely different reality. ExecDQL is completely live when OML is compiled. You can't for instance not call GetCurrent("RownNumber") from OML and get the correct number which is why you have to have a virtual field in the Row that keep this value.

So this is a minefield and it would be easier if you explain what you try to do.

If you just want an image in a subform I guess you would just have used a ImageField and it would be very easy and straight forward so one would assume that you try to show a "full size" image of the product image when you mouse over?

In any case we just made a small sample that show you how we would have solved that.

It is quite funny when you work on this level because there is so many "cross overs". You will for instance see that we allocate the values from the XSIZE and YSIZE to variables (number) in the OML.

This is because VALUE is always text and hence when the number is bigger than 1000 the number converted to text will have thousand divider... and hence if you convert for instance"1 000" i.e. 1 space 000 to number it will be 1...

Another small problem is order of objects.

In DataEase for Windows the order is ALWAYS top to bottom/left to right. Which means that an object that is 1 - one - pixle higher up is always earlier in the object (tab) order and if they are on the same line the one that is 1 - one - pixel to the left is also ahead in the tab order.

You will see that we inserted the Preview field next to Manip. If we move this image to the centre and then resize it, it will be behind all the objects on the screen hence we use the SetState("Preview","MoveToFront") to put it ontop of everything.

Written by DataEase 27/11/17 at 09:32:34 Dataease [{8}]FIVE