result CCEGLView::OnInitializing(void) { result r = E_SUCCESS; AddTouchEventListener(*this); Touch touch; touch.SetMultipointEnabled(*this, true); m_pKeypad = new Keypad(); m_pKeypad->Construct(KEYPAD_STYLE_NORMAL, KEYPAD_MODE_ALPHA); m_pKeypad->AddTextEventListener(*this); Rectangle rc = GetBounds(); if ((rc.width == 480 && rc.height == 720) || (rc.width == 720 && rc.height == 480)) { m_bNotHVGA = false; m_sSizeInPixel.width = rc.width / 1.5f; m_sSizeInPixel.height = rc.height / 1.5f; } else { m_bNotHVGA = true; m_sSizeInPixel.width = rc.width; m_sSizeInPixel.height = rc.height; } // calculate the factor and the rect of viewport m_fScreenScaleFactor = MIN((float)m_sSizeInPixel.width / m_sSizeInPoint.width, (float)m_sSizeInPixel.height / m_sSizeInPoint.height); //CCLOG("rc.width = %d, rc.height = %d, m_fScreenScaleFactor = %f", rc.width, rc.height, m_fScreenScaleFactor); resize(m_sSizeInPoint.width, m_sSizeInPoint.height); return r; }
result BadaAppForm::OnInitializing(void) { logEntered(); SetOrientation(ORIENTATION_LANDSCAPE); AddOrientationEventListener(*this); AddTouchEventListener(*this); AddKeyEventListener(*this); Touch touch; touch.SetMultipointEnabled(*this, true); // set focus to enable receiving key events SetFocusable(true); SetFocus(); return E_SUCCESS; }
result ImageViewer::OnInitializing() { SetFormBackEventListener(this); __pGallery = static_cast<Gallery*>(GetControl(L"IDC_GALLERY1")); if(!__pGallery) { AppLog("Gallery Control does not exist"); return E_FAILURE; } __pGallery->SetBackgroundColor(__bgColor); __pGallery->SetItemProvider(*this); Touch touch; touch.SetMultipointEnabled(*__pGallery, true); GetFooter()->AddActionEventListener(*this); return E_SUCCESS; }