int AutoRotateInit(int allow, int(*callback)(int));
Allows adjustment of the screen orientation in response to the orientation of the device.
Return Value
Return value not used.
Parameters
allow Specifies which orientations will be allowed when rotating the device. Possible values are:
callback A function that will be called when the device rotates the screen automatically. The callback's parameter indicates which orientation was set. Possible values are:
Remarks
AutoRotateInit() enables automatic rotation of the device's screen in response to a change in orientation by the user moving the device one way or another.
NOTE: this function is effective on the device only.
Availability
Available in DragonFireSDK 1.4 and later.
Example
#include "DragonFireSDK.h"
int OnRotate(int value) { if (value==1) { // Position views for portrait display } else if (value==2) { // Position views for landscape display } }
void AppMain() { // Allow the orientation to be changed to any orientation // as a result of the user repositioning the device. AutoRotateInit(3, OnRotate); }
//=============================================== void OnTimer() {
}
//=============================================== void AppExit() {
} |