本文整理汇总了C++中Frame::AddControl方法的典型用法代码示例。如果您正苦于以下问题:C++ Frame::AddControl方法的具体用法?C++ Frame::AddControl怎么用?C++ Frame::AddControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frame
的用法示例。
在下文中一共展示了Frame::AddControl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FMainForm
void
FormMgr::SwitchToForm(RequestId requestId, Osp::Base::Collection::IList* pArgs)
{
Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
if (requestId == REQUEST_MAINFORM) {
FMainForm* pExeForm = new FMainForm();
pExeForm->Initialize();
pFrame->AddControl(*pExeForm);
pFrame->SetCurrentForm(*pExeForm);
pExeForm->Draw();
pExeForm->Show();
if (__pPreviousForm != null)
pFrame->RemoveControl(*__pPreviousForm);
__pPreviousForm = pExeForm;
} else if (requestId == REQUEST_CAMERAFORM) {
Integer * arg1 = static_cast<Integer*>(pArgs->GetAt(0));
int sinterval = arg1->ToInt();
Osp::Graphics::Dimension * arg2 = static_cast<Osp::Graphics::Dimension*>(pArgs->GetAt(1));
Osp::Graphics::Dimension sresolution;
sresolution.SetSize(arg2->width,arg2->height);
Integer * arg3 = static_cast<Integer*>(pArgs->GetAt(2));
int sstopafter = arg3->ToInt();
FCameraForm* pExeForm = new FCameraForm();
pExeForm->Initialize();
pFrame->AddControl(*pExeForm);
pFrame->SetCurrentForm(*pExeForm);
pExeForm->Draw();
pExeForm->Show();
pExeForm->StartCamera(sinterval, sresolution, sstopafter);
if (__pPreviousForm != null)
pFrame->RemoveControl(*__pPreviousForm);
__pPreviousForm = pExeForm;
} else if (requestId == REQUEST_PLAYERFORM) {
Osp::Base::String filename = L"";
bool autoplay = false;
Osp::Base::String * arg1 = static_cast<Osp::Base::String*>(pArgs->GetAt(0));
if (pArgs->GetCount() >= 2) {
Osp::Base::Boolean * arg2 = static_cast<Osp::Base::Boolean*>(pArgs->GetAt(1));
autoplay = arg2->ToBool();
}
filename.Append(*arg1);
FPlayer* pExeForm = new FPlayer();
pExeForm->Initialize();
pFrame->AddControl(*pExeForm);
pFrame->SetCurrentForm(*pExeForm);
pExeForm->Draw();
pExeForm->Show();
pExeForm->LoadFile(filename, autoplay);
if (__pPreviousForm != null)
pFrame->RemoveControl(*__pPreviousForm);
__pPreviousForm = pExeForm;
}
}
示例2: Initialize
bool FormMgr::Initialize()
{
result r = E_SUCCESS;
r = Form::Construct(FORM_STYLE_NORMAL);
SetName(L"FormMgr");
Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
__pForm1 = new Form1();
__pForm1->Initialize();
pFrame->AddControl(*__pForm1);
__pFormHelp = new FormHelp();
__pFormHelp->Initialize();
pFrame->AddControl(*__pFormHelp);
return true;
}
示例3: GetAppFrame
bool
WatchList::OnAppInitializing(AppRegistry& appRegistry)
{
// TODO:
// Initialize UI resources and application specific data.
// The application's permanent data and context can be obtained from the appRegistry.
//
// If this method is successful, return true; otherwise, return false.
// If this method returns false, the application will be terminated.
// Uncomment the following statement to listen to the screen on/off events.
//PowerManager::SetScreenEventListener(*this);
// Create a form
Form1 *pForm1 = new Form1();
pForm1->Initialize();
// Add the form to the frame
Frame *pFrame = GetAppFrame()->GetFrame();
pFrame->AddControl(*pForm1);
// Set the current form
pFrame->SetCurrentForm(*pForm1);
// Draw and Show the form
pForm1->Draw();
pForm1->Show();
return true;
}
示例4: new
//
// create the ScummVM system
//
TizenAppForm *systemStart(Tizen::App::Application *app) {
logEntered();
Frame *appFrame = new (std::nothrow) TizenAppFrame();
if (!appFrame || appFrame->Construct() == E_FAILURE) {
AppLog("Failed to create appFrame");
return NULL;
}
app->AddFrame(*appFrame);
TizenAppForm *appForm = new TizenAppForm();
if (!appForm) {
AppLog("Failed to create appForm");
return NULL;
}
if (E_SUCCESS != appForm->Construct() ||
E_SUCCESS != appFrame->AddControl(appForm)) {
delete appForm;
AppLog("Failed to construct appForm");
return NULL;
}
appFrame->SetCurrentForm(appForm);
appForm->GetVisualElement()->SetShowState(false);
logLeaving();
return appForm;
}
示例5: MainForm
bool
DrStrangecodeRssReader::OnAppInitializing(AppRegistry& appRegistry)
{
// Create a form
MainForm *pMainForm = new MainForm();
pMainForm->Initialize();
pMainForm->SetName(kMainFormNameString);
ItemForm * pItemForm = new ItemForm();
pItemForm->Initialize();
pItemForm->SetName(kItemFormNameString);
// Add the form to the frame
Frame *pFrame = GetAppFrame()->GetFrame();
pFrame->AddControl(*pMainForm);
pFrame->AddControl(*pItemForm);
// Set the current form
pFrame->SetCurrentForm(*pMainForm);
// Draw and Show the form
pMainForm->Draw();
pMainForm->Show();
return true;
}
示例6: Initialize
void FormNavigationManager::Initialize() {
AppLog("FormNavigationManager::Initialize()");
_currentFormsStack.Construct();
Form::Construct(FORM_STYLE_NORMAL);
// Adds itself to the app frame, so we can receive user events from the event queue
Frame * pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
pFrame->AddControl(*this);
}
示例7: showAuthenticationForm
void TreeViewForm::showAuthenticationForm(){
myAuthenticationForm = new AuthenticationForm;
myAuthenticationForm->Initialize();
myAuthenticationForm->SetPreviousForm(this);
myAuthenticationForm->myNode = myNode;
Frame *pFrame = UiApp::GetInstance()->GetAppFrame()->GetFrame();
pFrame->AddControl(myAuthenticationForm);
pFrame->SetCurrentForm(myAuthenticationForm);
myAuthenticationForm->Invalidate(true);
}
示例8: Create
bool CCEGLView::Create(Osp::App::Application* pApp, int width, int height)
{
m_sSizeInPoint.width = MIN(width, height);
m_sSizeInPoint.height = MAX(width, height);
Construct(FORM_STYLE_NORMAL);
Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
pFrame->AddControl(*this);
pFrame->SetCurrentForm(*this);
m_pEGL = CCEGL::create(this);
if (m_pEGL == null)
return false;
s_pMainWindow = this;
Draw();
Show();
return true;
}
示例9: OnAppInitializing
bool LearnABC::OnAppInitializing(AppRegistry& appRegistry) {
// Create a form
LearnABCForm *pMainForm = new LearnABCForm();
pMainForm->Initialize();
// Add the form to the frame
Frame *pFrame = GetAppFrame()->GetFrame();
pFrame->AddControl(*pMainForm);
// Set the current form
pFrame->SetCurrentForm(*pMainForm);
// Draw and Show the form
pMainForm->Draw();
pMainForm->Show();
return true;
}
示例10: WebForm
bool
Cordova::OnAppInitializing(AppRegistry& appRegistry)
{
// TODO:
// Initialize UI resources and application specific data.
// The application's permanent data and context can be obtained from the appRegistry.
//
// If this method is successful, return true; otherwise, return false.
// If this method returns false, the application will be terminated.
// Uncomment the following statement to listen to the screen on/off events.
//PowerManager::SetScreenEventListener(*this);
Frame *pFrame = null;
result r = E_SUCCESS;
// Create a form
WebForm *pWebForm = new WebForm();
r = pWebForm->Construct(FORM_STYLE_INDICATOR);
if (IsFailed(r))
{
AppLog("WebForm Construct() has failed.\n");
goto CATCH;
}
// Add the form to the frame
pFrame = GetAppFrame()->GetFrame();
pFrame->AddControl(*pWebForm);
// Set the current form
pFrame->SetCurrentForm(*pWebForm);
// Draw and Show the form
pWebForm->Draw();
pWebForm->Show();
return true;
CATCH:
return false;
}
示例11: value
//.........这里部分代码省略.........
ArrayList waypoints;
String value(L"");
Osp::Base::String __newStartingPoint = (L"51.5033, -0.1197");
Osp::Base::String __newDestinationPoint = (L"51.500721983903,-0.124197006225586");
Coordinates* pStartCoord = NavigatorUtil::StringToCoordinatesN(__newStartingPoint);
Coordinates* pDestCoord = NavigatorUtil::StringToCoordinatesN(__newDestinationPoint);
NavigatorRouteServices* __pRouteSvc = new NavigatorRouteServices();
if(pStartCoord != null)
waypoints.Add(*pStartCoord);
else
{
waypoints.Add(*new String(__newStartingPoint));
value += L"0";
value += Locale::CountryCodeToString(COUNTRY_US);
value += L";";
}
if(pDestCoord != null)
waypoints.Add(*pDestCoord);
else
{
waypoints.Add(*new String(__newDestinationPoint));
value += L"1";
value += Locale::CountryCodeToString(COUNTRY_US);
value += L";";
}
__pRouteSvc->GetRoute(waypoints, value);
waypoints.RemoveAll(true);
}
break;
case ACTION_ID_MY_LOCATION: {
ShowAll(false);
ShowMyLocation(true);
Redraw();
}
break;
case ACTION_ID_MARKERMOVE: {
if (_showAll) {
ShowAll(false);
MoveMarker(true);
} else {
ShowOverlays(false);
ShowInfoWindow(false);
ShowInfoWindowWithImage(false);
ShowMyLocation(false);
if (_movedMarker) {
MoveMarker(false);
} else {
MoveMarker(true);
}
}
Redraw();
}
break;
case ACTION_ID_ALL: {
if (_showAll == false) {
ShowAll(true);
} else {
ShowAll(false);
}
Redraw();
}
break;
case ACTION_ID_BUTTON_OK_POPUP: {
if (_popupShow == true) {
_pPopup->SetShowState(false);
_pPopup->Show();
_popupShow = false;
Redraw();
}
}
break;
case ACTION_ID_GET_ADDRESS:
RequestReverseGeocode(_positionOfContextMenu);
break;
case ACTION_ID_BACK: {
BukkaMain *pMain = new BukkaMain();
pMain->Initialize();
Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
pFrame->AddControl(*pMain);
pFrame->SetCurrentForm(*pMain);
pMain->Draw();
pMain->Show();
}
break;
}
}
示例12: Frame
bool
GCubeApp::OnAppInitialized(void)
{
// フレーム作成
Frame *pFrame = new Frame();
pFrame->Construct();
pFrame->SetName(L"GCube");
// フォーム作成
Form *pForm = new Form();
if (settings->showStatusBar) {
pForm->Construct(FORM_STYLE_INDICATOR);
} else {
pForm->Construct(FORM_STYLE_NORMAL);
}
pForm->AddTouchEventListener(*this);
pForm->AddOrientationEventListener(*this);
pFrame->AddControl(pForm);
pFrame->SetCurrentForm(pForm);
// 画面の向き
enum Orientation orientation = ORIENTATION_NONE;
if (settings->orientationPortrait) {
if (settings->orientationLandscapeLeft || settings->orientationLandscapeRight) {
orientation = ORIENTATION_AUTOMATIC;
} else {
orientation = ORIENTATION_PORTRAIT;
}
} else {
if (settings->orientationPortraitUpsideDown) {
if (settings->orientationLandscapeLeft || settings->orientationLandscapeRight) {
orientation = ORIENTATION_AUTOMATIC_FOUR_DIRECTION;
} else {
orientation = ORIENTATION_PORTRAIT_REVERSE;
}
} else {
if (settings->orientationLandscapeLeft) {
orientation = ORIENTATION_LANDSCAPE_REVERSE;
} else {
if (settings->orientationLandscapeRight) {
orientation = ORIENTATION_LANDSCAPE;
}
}
}
}
pFrame->SetOrientation(orientation);
pForm->SetOrientation(orientation);
pFrame->SetMultipointTouchEnabled(true);
AddFrame(*pFrame);
{
__player = new Tizen::Graphics::Opengl::GlPlayer;
__player->Construct(Tizen::Graphics::Opengl::EGL_CONTEXT_CLIENT_VERSION_2_X, pForm);
__player->SetFps(settings->frameRate);
__player->SetEglAttributePreset(Tizen::Graphics::Opengl::EGL_ATTRIBUTES_PRESET_ARGB8888);
EGLint eglConfigList[] =
{
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL_DEPTH_SIZE, 16,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_NONE
};
__player->SetEglAttributeList(eglConfigList);
__player->Start();
}
__renderer = new GlRendererTemplate();
__player->SetIGlRenderer(__renderer);
int w = __renderer->GetTargetControlWidth();
int h = __renderer->GetTargetControlHeight();
if (settings->debugButtonPos > 0) {
// デバッグボタン作成
// TODO: XMLで作成
int dy = 0;
if (settings->showStatusBar) {
dy = 60;
}
Button* pDebugButton = new Button();
if (settings->debugButtonPos == 1) {
pDebugButton->Construct(Rectangle(w-80, h-80-dy, 70, 70), L"D");
} else if (settings->debugButtonPos == 2) {
pDebugButton->Construct(Rectangle(10, h-80-dy, 70, 70), L"D");
} else if (settings->debugButtonPos == 3) {
pDebugButton->Construct(Rectangle(w-80, 10, 70, 70), L"D");
} else {
pDebugButton->Construct(Rectangle(10, 10, 70, 70), L"D");
}
pDebugButton->SetActionId(ID_DEBUG_BUTTON);
pDebugButton->AddActionEventListener(*this);
pForm->AddControl(pDebugButton);
// ポップアップ作成
//.........这里部分代码省略.........
示例13: StartAudioPlayer
void AntiMoustiqueMainForm::StartAudioPlayer()
{
result r = E_SUCCESS;
Frame *pFrame = (Frame *)GetParent();
if( !pFrame )
{
AppLog(">>>>>> GetParent has failed.\n");
return ;
}
if ( !g_pAudioPlayer )
{
g_pAudioPlayer = new AntiMoustiqueAudioPlayer();
if( !g_pAudioPlayer )
{
AppLog( ">>>>>> new AudioPlay() has been failed\n");
return;
}
if( g_pAudioPlayer->ConstructAudioPlayer() == false )
{
AppLog( ">>>>>>ConstructVideoPlay has been failed\n");
delete g_pAudioPlayer;
g_pAudioPlayer= null;
return;
}
//------------------------------
// Attach Form to Frame
//------------------------------
r = pFrame->AddControl( *g_pAudioPlayer );
if( IsFailed(r))
{
AppLog( ">>>>>> pFrame->AddControl( *g_pAudioPlayer ) has been failed\n");
delete g_pAudioPlayer;
g_pAudioPlayer= null;
return;
}
}
//Assign the current form as Form1
r = pFrame->SetCurrentForm( *g_pAudioPlayer );
if( IsFailed(r))
{
AppLog(">>>>>> SetCurrentForm( *g_pAudioPlayer ) has failed.\n");
return ;
}
//Redraw form
pFrame->Draw();
r = pFrame->Show();
if( IsFailed(r))
{
AppLog(">>>>>> Show() has failed.\n");
return ;
}
g_pAudioPlayer->AudioPlayerOpen();
}
示例14: MainForm
void
FormManager::SwitchToForm(RequestId requestId, Osp::Base::Collection::IList* pArgs)
{
Frame* pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
BaseForm* pExeForm = null;
switch (requestId)
{
case REQUEST_MAINFORM:
{
if (__pMainForm == null)
{
__pMainForm = new MainForm();
__pMainForm->Initialize();
pFrame->AddControl(*__pMainForm);
}
pFrame->SetCurrentForm(*__pMainForm);
__pMainForm->Draw();
__pMainForm->Show();
if (__pPreviousForm != null)
{
if (__pPreviousForm != __pMainForm)
pFrame->RemoveControl(*__pPreviousForm);
}
__pPreviousForm = __pMainForm;
return;
}
break;
case REQUEST_FACEBOOKLOGINFORM:
pExeForm = new LoginForm();
break;
case REQUEST_USERPROFILEFORM:
pExeForm = new UserProfileForm();
break;
case REQUEST_FRIENDSFORM:
pExeForm = new FriendsForm();
break;
default:
return;
break;
}
pExeForm->Initialize();
pFrame->AddControl(*pExeForm);
pFrame->SetCurrentForm(*pExeForm);
pExeForm->Draw();
pExeForm->Show();
if (__pPreviousForm != null)
{
if (__pPreviousForm != __pMainForm)
pFrame->RemoveControl(*__pPreviousForm);
}
__pPreviousForm = pExeForm;
return;
}
示例15: OnUserEventReceivedN
void FormNavigationManager::OnUserEventReceivedN(RequestId requestId,
IList* pArgs) {
switch (requestId) {
case SET_ROOT_FORM: {
AppLog("FormNavigationManager: setting root form");
AppAssertf(NumberOfFormsInCurrentStack() == 0, "This navigation stack has already a root form");
Frame * pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
StackBasedNavigationForm * nextForm = static_cast<StackBasedNavigationForm *> (pArgs->GetAt(0));
// Add new form in the stack
_currentFormsStack.Add(*nextForm);
// Add new form on display, the form is automatically set as the current form
pFrame->AddControl(*nextForm);
// Call FormWillAppear() on the root form
nextForm->FormWillAppear();
// Show new form
nextForm->Draw();
nextForm->Show();
delete pArgs;
}
break;
case PUSH_FORM: {
AppLog("FormNavigationManager: pushing form");
AppAssertf(NumberOfFormsInCurrentStack() > 0, "This navigation stack has no root form, please set a root form with SetRootForm()");
StackBasedNavigationForm * nextForm = static_cast<StackBasedNavigationForm *> (pArgs->GetAt(0));
StackBasedNavigationForm * currentForm = static_cast<StackBasedNavigationForm *> (_currentFormsStack.GetAt(_currentFormsStack.GetCount() - 1));
Frame * pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
// Call FormWillDisappear() on the old form
currentForm->FormWillDisappear();
// Add new form in the stack
_currentFormsStack.Add(*nextForm);
// Add new form on display, nextForm becomes the current form
pFrame->AddControl(*nextForm);
// Re-set currentForm as the current form so we can perform a nice animation
pFrame->SetCurrentForm(*currentForm);
// Call FormWillAppear() on the new form
nextForm->FormWillAppear();
// Perform the transition with a nice slide-in animation
FrameAnimator * pAnimator = pFrame->GetFrameAnimator();
pAnimator->SetFormTransitionAnimation(
FRAME_ANIMATOR_FORM_TRANSITION_ANIMATION_TRANSLATE_LEFT, 600,
ANIMATION_INTERPOLATOR_EASE_IN_OUT);
pAnimator->SetCurrentForm(*nextForm);
delete pArgs;
}
break;
case POP_FORM: {
AppLog("FormNavigationManager: popping form");
AppAssertf(NumberOfFormsInCurrentStack() > 0, "This navigation stack has no root form, please set a root form with SetRootForm()");
Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
AppAssertf(_currentFormsStack.GetCount() > 1, "Illegal: Trying to pop the root form");
StackBasedNavigationForm * previousForm = static_cast<StackBasedNavigationForm *> (_currentFormsStack.GetAt(_currentFormsStack.GetCount() - 2));
StackBasedNavigationForm * currentForm = static_cast<StackBasedNavigationForm *> (_currentFormsStack.GetAt(_currentFormsStack.GetCount() - 1));
// Call FormWillDisappear() on the current form
currentForm->FormWillDisappear();
// Call FormWillAppear() on the previous form
previousForm->FormWillAppear();
// Perform the transition with a nice slide-out animation
FrameAnimator * pAnimator = pFrame->GetFrameAnimator();
pAnimator->SetFormTransitionAnimation(
FRAME_ANIMATOR_FORM_TRANSITION_ANIMATION_TRANSLATE_RIGHT, 600,
ANIMATION_INTERPOLATOR_EASE_IN_OUT);
pAnimator->SetCurrentForm(*previousForm);
pFrame->RemoveControl(*currentForm);
_currentFormsStack.RemoveAt(_currentFormsStack.GetCount() - 1, false);
}
break;
}
}