PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WEBDEV 2024 → Indirection behaviour inconsistent
Indirection behaviour inconsistent
Started by Stef, Mar., 11 2013 5:10 PM - 6 replies
Registered member
45 messages
Posted on March, 11 2013 - 5:10 PM
Hi,

Using indirection to refer to a number of similarly named edit controls (EDT_h followed by a number) I can set various properties of each edit control.
For example, using i as a variable counter
{"EDT_h"+i+"..Visible"}=True
{"EDT_h"+i+"..Value"}=arrPosition[i]
{"EDT_h"+i+"..Caption"}=Right(arrCodepos[i],Length(arrCodepos[i])-1)

Works like a charm and the screen is instantly updated.
But when I try
{"EDT_h"+i+"..X"}=(IMG_Wp_dwg..X+IMG_Wp_dwg..Width)
the X position is modified in memory as I can see in the debugger, but on screen the position is not modified. Same with ..Y.
All properties seem modifyable except for the X and Y values.

Any ideas ? A page refresh does not do the trick.

Thanks
Registered member
45 messages
Posted on March, 11 2013 - 5:18 PM
By the way the edit control is set to stackable.
Posted on March, 11 2013 - 5:39 PM
Hi Stef

I think that it should be something like

{"EDT_h"+numtostring(i),indControl}..Property

Best regards


--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


On 3/11/2013 10:20 AM, Stef wrote:
Hi,

Using indirection to refer to a number of similarly named edit controls (EDT_h followed by a number) I can set various properties of each edit control.
For example, using i as a variable counter
{"EDT_h"+i+"..Visible"}=True
{"EDT_h"+i+"..Value"}=arrPosition[i]
{"EDT_h"+i+"..Caption"}=Right(arrCodepos[i],Length(arrCodepos[i])-1)

Works like a charm and the screen is instantly updated.
But when I try
{"EDT_h"+i+"..X"}=(IMG_Wp_dwg..X+IMG_Wp_dwg..Width)
the X position is modified in memory as I can see in the debugger, but on screen the position is not modified. Same with ..Y.
All properties seem modifyable except for the X and Y values.

Any ideas ? A page refresh does not do the trick.

Thanks
Registered member
45 messages
Posted on March, 22 2013 - 6:53 PM
Hi Fabrice,

I am becoming very fond of your answers Farbrice, so I will try to get a bit of your help once more :)

The syntax you suggest works, but the edit controls will still not move on screen. All other properties I change (caption, value ...) instantly change both in memory and on screen. Only properties X and Y change only in memory but are not reflected on screen.
Posted on March, 22 2013 - 11:11 PM
Hi Stef

I do not have enough information to be sure, but it looks like you have
a problem between the server and browser codes, a refresh of the page
with the initial position and so on... So a few possible problems :

Where do you change the position (in which code)?
Browser ?
Server ?
Ajax ?
Do you refresh the page afterward?

best regards


--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


On 3/22/2013 1:10 PM, Stef wrote:
Hi Fabrice,

I am becoming very fond of your answers Farbrice, so I will try to get a bit of your help once more :)

The syntax you suggest works, but the edit controls will still not move on screen. All other properties I change (caption, value ...) instantly change both in memory and on screen. Only properties X and Y change only in memory but are not reflected on screen.
Registered member
45 messages
Posted on March, 25 2013 - 10:22 AM
Hi Fabrice,

Here are the answers to your questions:

- Where do you change the position (in which code)?
The code is executed in a local procedure of the page where the edit controls reside.

- Browser ? Server ? Ajax ?
The local procedure is server code, run in non-ajax mode.

- Do you refresh the page afterward?
Yes I do using PageRefresh(PageName).
But whether this line of code is added or not makes no difference at all and other properties of the edit controls are even modified on screen without the PageRefresh command.

The code I orininally used:

...
1. {"EDT_v"+i+"..X"}=(IMG_Wp_dwg..X+(arrPosition[i]*rScale)-(EDT_Template..Width/2)-7+nHorcorrFactor)
2. {"EDT_v"+i+"..Y"}=(IMG_Wp_dwg..Y+IMG_Wp_dwg..Height)
3. {"EDT_v"+i+"..Visible"}=True
4. {"EDT_v"+i+"..Value"}=arrPosition[i]
5. {"EDT_v"+i+"..Caption"}=Right(arrCodepos[i],Length(arrCodepos[i])-1)
6. PageRefresh(Page_Main1)

This syntax is accepted an the code runs without errors, but lines 1 and 2 do not have any effect, lines 3,4,5 and 6 work.
Making the edit controls visible first also makes no difference.

Then I used your syntax which is also accepted
{"EDT_h"+NumToString(i),indControl}..X= ...
...
PageRefresh(Page_Main1)
but the problem remains the same, only the values in memory get updated, not on screen.

Hope this supplies you with enough information.

Stef
Registered member
45 messages
Posted on March, 25 2013 - 12:48 PM
Solved !
The issue depends on a property of the edit control itself. The edit control only moves on screen when in the GUI tab the Type is set to dynamic instead of automatic as is by default.