Welcome! Log In Create A New Profile

Advanced

Windev Mobile 17 - 1 Window Multiple Planes

Posted by Ericus 
Ericus
Windev Mobile 17 - 1 Window Multiple Planes
October 30, 2012 07:23AM
Hallo

I have an Android App. I make use of 1 window with 5 planes.

Question 1

I don't know how to prevent my app from closing when the back/return button is pressed on the phone. If I am on plane 5 and press back my application returns to plane 1, the login plane
.

Question 2

If I am on, let's say plane 5, and tilt the phone sideways it also returns to plane 1.

The initialization code of my window just changes the plane to either 1 or the current plane.

Any ideas will be much appreciated.



Ericus Steyn
Markus K.
Re: Windev Mobile 17 - 1 Window Multiple Planes
October 30, 2012 09:13AM
In WD (not mobile) you can change the visible planes by windowname..plane = x, where x is number of the plane.

To go back from plane 5: If win..plane = 5 then win..plane = 4 and so on
Ericus
Re: Windev Mobile 17 - 1 Window Multiple Planes
October 30, 2012 12:37PM
Thanks Markus

It help a bit but my problem is the back button on the phone. I cannot trap the push event of that button.

If I have a back arrow on my window it works as you explained.

Regards


Ericus Steyn
DerekT
Re: Windev Mobile 17 - 1 Window Multiple Planes
October 30, 2012 01:59PM
The back button in a mobile window works like the RedX in a window.

To overcome this you need to put a condition in the 'Window Closing' code section

IF MyWindow..Plane > 1 THEN
//Your condition here
END

You will need to know which plane you want the window to return to of course - depends on your app.
If its a simple scroll back the MyWindow..pane -= 1 will do if not you will need to program the sequence required.

Back buttons and App Close buttons are not recommended (allowed) in mobile apps.


Not sure about Q2 - the above may solve it but if not then there is a 'Change of orientation' code section available
Arie
Re: Windev Mobile 17 - 1 Window Multiple Planes
October 30, 2012 02:49PM
Ericus,
on a tablet the Closing-event of the window is fired.
Using returntocapture() prevents the window (and thus your app) from closing.
But I can't say if this is the same on a phone.
Ericus
Re: Windev Mobile 17 - 1 Window Multiple Planes
October 30, 2012 05:17PM
Thanks Arie/Derek

Half my problem is solved but not the main one where the application is closed when back is pressed.

I used a returntocapture and it works correctly in Project test but not on the phone where it still closes.

Waiting to see if WinDev support can add anything.

Regards


Ericus Steyn
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: