Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Screen orientation changes automatically?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-30-2007, 08:02 PM
Junior Member
 
Join Date: Apr 2007
Posts: 42
Send a message via Yahoo to mwaite
Default Screen orientation changes automatically?

I see reference to screen orientation support in the "What's New" doc, however I cannot find any way to detect a screen orientation event has occurred. Am I to assume we must query the height/width ourselves?
Reply With Quote
  #2 (permalink)  
Old 05-01-2007, 05:31 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,726
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You need to use the FormLib library.
Code:
<div align="left"><font face="Courier New"><font color="#008000">'First add an object named flb of type FormLib.</font></font>
<font face="Courier New"><font color="#0000ff">Sub </font></font><font face="Courier New"><font color="#010101">Globals</font></font></div> 
 
<div align=
"left"><font face="Courier New"><font color="#0000ff">End Sub</font></font></div> 
 
<div align=
"left"><font face="Courier New"><font color="#0000ff">Sub </font></font><font face="Courier New"><font color="#010101">App_Start</font></font>
<font face=
"Courier New"><font color="#010101">     Form1.show</font></font>
<font face=
"Courier New"><font color="#010101">     flb.New1("Form1",</font></font><font face="Courier New"><font color="#0000ff">B4PObject</font></font><font face="Courier New"><font color="#010101">(1))</font></font>
<font face=
"Courier New"><font color="#0000ff">End Sub</font></font></div> 
 
<div align=
"left"><font face="Courier New"><font color="#0000ff">Sub </font></font><font face="Courier New"><font color="#010101">flb_Resize </font></font><font face="Courier New"><font color="#008000">'Fires when the user changes the screen orientation</font></font>
<font face="Courier New"><font color="#0000ff">if </font></font><font face="Courier New"><font color="#010101">Form1.Width > Form1.Height </font></font><font face="Courier New"><font color="#0000ff">then</font></font>
<font face=
"Courier New"><font color="#0000ff">msgbox</font></font><font face="Courier New"><font color="#010101">("Landscape")</font></font>
<font face=
"Courier New"><font color="#0000ff">else</font></font>
<font face=
"Courier New"><font color="#0000ff">msgbox</font></font><font face="Courier New"><font color="#010101">("Portrait")</font></font>
<font face=
"Courier New"><font color="#0000ff">end if</font></font>
<font face=
"Courier New"><font color="#0000ff">End Sub</font></font></div>
Reply With Quote
  #3 (permalink)  
Old 05-01-2007, 06:09 PM
Junior Member
 
Join Date: Apr 2007
Posts: 42
Send a message via Yahoo to mwaite
Default

Thanks Erel.

I thought I had seen that somewhere when I was reading the docs, but when I went looking for it again I couldn't find it in the list of methods that Formlib supports, and search "resize" yields nothing. I see it now in the Overview paragraph. By chance is there a complete list of supported events/methods for the librarys that one can use as a reference? I hate to miss something. Now I can go remove my timer event that was looking for screen orientation changed
Reply With Quote
  #4 (permalink)  
Old 05-01-2007, 06:53 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,726
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

It is missing from the FormLib help by mistake.
It will be fixed.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change screen orientation programmatically?? HARRY Code Samples & Tips 24 05-11-2010 06:56 PM
Automatically Open Pword With A Word File sintaq Questions (Windows Mobile) 3 03-26-2008 02:31 PM
automatically send a csv file via active-sync sunnyboyj Questions (Windows Mobile) 3 12-22-2007 01:35 PM
sceen orientation Filec Questions (Windows Mobile) 3 07-13-2007 12:34 PM
Image gets lost with orientation change HARRY Questions (Windows Mobile) 7 05-14-2007 09:19 AM


All times are GMT. The time now is 02:17 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0