PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WM] Variable First Project Window
[WM] Variable First Project Window
Iniciado por guest, 12,oct. 2016 19:10 - 7 respuestas
Publicado el 12,octubre 2016 - 19:10
Hello all,

At the moment I'm struggling with my First project window.
I would like to make this variable to open a different window regarding to the mobile phone (i.e. iphone 5 or 6).
I found an example where this is done (Android FTP Client), but for me it is not clear how they have done it.
Because when I try to execute the project, it will ask for a First project window.

Code would look something like this:
SWITCH SysXRes() case 414: OpenMobileWindow(Wnd_i6plus) case 375: OpenMobileWindow(Wnd_i6) case 320: OpenMobileWindow(Wnd_i5) OTHER CASE : OpenMobileWindow(Wnd_general) END
Has anyone a solution?

Thanks in advance,
Koen
Publicado el 12,octubre 2016 - 21:07
Not sure about WM but in WD you can do it with the USE command :

project init code :

SWITCH SysXRes()
case 414: USE(Wnd_i6plus)
case 375: USE(Wnd_i6)
case 320: USE(Wnd_i5)
OTHER CASE : USE(Wnd_general)
END

regards, heinz
Publicado el 12,octubre 2016 - 21:54
Hello Heinz,

Thank you for your fast reply.
Unfortunately the USE command is not accessible for iOS applications.

But it has to work with the OpenMobileWindow command, since the example program does that too.
Nevertheless, when I try to run my code it will ask me to define a First project window.

Regards,
Rik
Publicado el 13,octubre 2016 - 03:28
What about a generic blank or black first window, or a window that says something cute like "Welcome!", and then code that automatically runs your code to resize the window?
Publicado el 13,octubre 2016 - 13:40
Hello Art,

Yes I think this is the only sollution, thank you.

Note: This problem only seems to appear with iOS, when I try it with an android project it does function.

Regards,
Rik
Publicado el 13,octubre 2016 - 15:12
Hi Rik,

Do the following:
1. Set the default window of the project (so WinDev is not complaining)
2. In the program Init code, put your switch case. Just remove the “Other case” since the default window will start anyway in that case.
3. In all your switch case, simply call EndProgram() with the appropriate parameters for your application.

So if a special non-default window is open, the application will end after the special window has been closed. In all other cases, the default window application will be displayed.

I never used that technique in WD Mobile (only in WinDev) but it should work well too.

Best regards,
Alexandre Leclerc
Publicado el 13,octubre 2016 - 16:30
Hi Alexandre,

Thank you for your answer, but the EndProgram command is only available for debugging in iOS applications.
Though this would be a great solution!

Regards,
Rik
Publicado el 17,octubre 2016 - 12:22
Hi Rik
I do this in Initialization of Windev Mobile application

GLOBAL
gsGlavniProzor is string

IF ProjectInfo(piConfiguration) = "Tablet" THEN
gsGlavniProzor = "WIN_Tablet_Start"
ELSE
gsGlavniProzor = "WIN_Phone_Start"
END
OpenMobileWindow(gsGlavniProzor)

and it works without choose first project window. When Windev Mobile ask you on first start to choose first project window you just choose "None" option.