Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
8
Erster Beitrag:
vor 10 Monaten, 1 Woche
Letzter Beitrag:
vor 10 Monaten
Beteiligte Autoren:
Rik, ICI, Alexandre Leclerc, Art Bonds, heinz kübler

[WM] Variable First Project Window

Startbeitrag von Rik am 12.10.2016 17: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,
Rik

Antworten:

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

von heinz kübler - am 12.10.2016 19:07
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

von Rik - am 12.10.2016 19:54
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?

von Art Bonds - am 13.10.2016 01:28
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

von Rik - am 13.10.2016 11:40
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

von Alexandre Leclerc - am 13.10.2016 13:12
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

von Rik - am 13.10.2016 14:30
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.

von ICI - am 17.10.2016 10:22
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.