当前位置: 首页>>代码示例>>C++>>正文


C++ Frame::GetControl方法代码示例

本文整理汇总了C++中Frame::GetControl方法的典型用法代码示例。如果您正苦于以下问题:C++ Frame::GetControl方法的具体用法?C++ Frame::GetControl怎么用?C++ Frame::GetControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Frame的用法示例。


在下文中一共展示了Frame::GetControl方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void
FSettings::OnActionPerformed(const Osp::Ui::Control& source, int actionId)
{
	if (actionId == ASAVE) {
		int tmpval;
		int setlimit = 0;
		int setday = 1;
		Osp::Ui::Controls::EditField * tmpef;
		tmpef = static_cast<Osp::Ui::Controls::EditField *>(this->GetControl(L"limitel", true));
		if (Osp::Base::Integer::Parse(tmpef->GetText(), setlimit) != E_SUCCESS) {
			setlimit = 0;
		}
		if (Application::GetInstance()->GetAppRegistry()->Get(L"limit", tmpval) == E_KEY_NOT_FOUND) {
			Application::GetInstance()->GetAppRegistry()->Add(L"limit", setlimit);
		} else {
			Application::GetInstance()->GetAppRegistry()->Set(L"limit", setlimit);
		}
		tmpef = static_cast<Osp::Ui::Controls::EditField *>(this->GetControl(L"dayel", true));
		if (Osp::Base::Integer::Parse(tmpef->GetText(), setday) != E_SUCCESS) {
			setday = 1;
		}
		if (Application::GetInstance()->GetAppRegistry()->Get(L"day", tmpval) == E_KEY_NOT_FOUND) {
			Application::GetInstance()->GetAppRegistry()->Add(L"day", setday);
		} else {
			Application::GetInstance()->GetAppRegistry()->Set(L"day", setday);
		}
		Application::GetInstance()->GetAppRegistry()->Save();
		Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
		FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
		pFormMgr->TransitionDirection = pFormMgr->TRANSITIONRIGHT;
		pFormMgr->SendUserEvent(FormMgr::REQUEST_MAINFORM, null);
	} else if (actionId == ACANCEL) {
		Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
		FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
		pFormMgr->TransitionDirection = pFormMgr->TRANSITIONLEFT;
		pFormMgr->SendUserEvent(FormMgr::REQUEST_MAINFORM, null);
	}

	DateTime today, nextrundate;

	Osp::System::SystemTime::GetCurrentTime(Osp::System::WALL_TIME, today);
	int dayinm = 1;
	if (Application::GetInstance()->GetAppRegistry()->Get(L"day", dayinm) != E_SUCCESS) {
		dayinm = 1;
	}
	nextrundate.SetValue(today.GetYear(),today.GetMonth(),dayinm,0,0,0);
	if (today.GetDay() >= dayinm) {
		nextrundate.AddMonths(1);
	}

	AppManager * appmgr = Osp::App::AppManager::GetInstance();
	if (appmgr->IsAppLaunchRegistered() == true) {
		appmgr->UnregisterAppLaunch();
	}
	appmgr->RegisterAppLaunch(L"DateTime='" + nextrundate.ToString() + "'", null, AppManager::LAUNCH_OPTION_DEFAULT);

	AppLog("set next run %S", nextrundate.ToString().GetPointer());

}
开发者ID:BoboTheRobot,项目名称:Badaprojects,代码行数:59,代码来源:FSettings.cpp

示例2:

void
CropForm::OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId,
		const Tizen::Base::String& operationId,
		const Tizen::App::AppCtrlResult appControlResult,
		const Tizen::Base::Collection::IMap* pResultList)
{
	if (appId.Equals(L"tizen.filemanager", true) && operationId.Equals(L"http://tizen.org/appcontrol/operation/pick", true))
	{
		AppCtrlResult selectResult = appControlResult;
		if (selectResult == APP_CTRL_RESULT_SUCCEEDED)
		{
			//Get the file name
			result r ;
			String filename;
			String* pFilePath ;
			pFilePath = (String*)(Tizen::Base::String*)pResultList->GetValue(String(L"path"));
			LoadImage(pFilePath);
		}
		else
		{
			result r;
			Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
			Form *pForm = (Form*)pFrame->GetControl(MAIN_FORM_NAME, false);
			if(pForm)
			{
				r = pFrame->SetCurrentForm(*pForm);
				pForm->Draw();
				pForm->Show();
				pFrame->RemoveControl(*this);
			}
		}
	}
}
开发者ID:CoCoTeam,项目名称:TizenGameHub,代码行数:33,代码来源:CropForm.cpp

示例3:

void
InfoForm::OnFormBackRequested(Osp::Ui::Controls::Form& form)
{
	Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
	FormManager *pFormMgr = static_cast<FormManager *>(pFrame->GetControl("FormManager"));
	if (pFormMgr != null) {
		pFormMgr->SendUserEvent(FormManager::REQUEST_ITEMLIST, null);
	}
}
开发者ID:Vizantiec,项目名称:Bada,代码行数:9,代码来源:InfoForm.cpp

示例4:

void
CategoryItemForm::OnFormBackRequested(Osp::Ui::Controls::Form& form)
{
	__pFooter->SetBackButtonEnabled(false);
	Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
	FormManager *pFormMgr = static_cast<FormManager *>(pFrame->GetControl("FormManager"));
	if (pFormMgr != null) {
		pFormMgr->SendUserEvent(FormManager::REQUEST_CATEGORYLISTBACK, null);
	}
}
开发者ID:Vizantiec,项目名称:Bada,代码行数:10,代码来源:CategoryItemForm.cpp

示例5:

void
FSettingsForm::OnActionPerformed(const Control& source, int actionId)
{
	if (actionId == ABACK) {
		Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
		FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
		pFormMgr->SendUserEvent(FormMgr::REQUEST_MAINFORM, null);
	}
	if (actionId == ASAVE) {
		Osp::Ui::Controls::CheckButton * chkel;
		chkel = static_cast<CheckButton *>(GetControl(L"IDPC_CHECKBUTTON1", true));
		flashenable = chkel->IsSelected();
		chkel = static_cast<CheckButton *>(GetControl(L"IDPC_CHECKBUTTON2", true));
		shuttersound = chkel->IsSelected();
		SaveSettings(isolevel, exposure, brightness, contrast, flashenable, shuttersound);
		Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
		FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
		pFormMgr->SendUserEvent(FormMgr::REQUEST_MAINFORM, null);
	}
}
开发者ID:BoboTheRobot,项目名称:Badaprojects,代码行数:20,代码来源:FSettingsForm.cpp

示例6: Bitmap

void
CropForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
{
	if(actionId == ID_FOOTERITEMCROP)
	{

		__Croprectangle.x = __x_min ;
		__Croprectangle.y = __y_min ;
		__Croprectangle.width = __x_max - __x_min;
		__Croprectangle.height = __y_max - __y_min;

		if ((__Croprectangle.width <= 0) || (__Croprectangle.height <= 0))
		{
			MessageBox messageBox;
			messageBox.Construct(L"Noting to crop", L"Please select region using finger to crop.", MSGBOX_STYLE_OK, 3000);
			int modalResult = 0;
			messageBox.ShowAndWait(modalResult);
			return;
		}

		Bitmap *pBitmapCroped = new Bitmap();
		pBitmapCroped->Construct(*__pBitmapOriginal,__Croprectangle);
		Image img;
		result r = img.Construct();

		if(!IsFailed(r))
		{
			img.EncodeToFile(*pBitmapCroped, IMG_FORMAT_JPG, USER_CROPPED_FILE_PATH, true);

			AppLogDebug("Save_location : %S", USER_CROPPED_FILE_PATH.GetPointer());

			Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
			Form *pForm = (Form*)pFrame->GetControl(MAIN_FORM_NAME, false);
			if(pForm)
			{
				pFrame->SetCurrentForm(*pForm);
				pForm->SendUserEvent(CROPPING_COMPLETE, null);
				pForm->Draw();
				pForm->Show();
				pFrame->RemoveControl(*this);
			}
		}

		delete pBitmapCroped;
	}
}
开发者ID:CoCoTeam,项目名称:TizenGameHub,代码行数:46,代码来源:CropForm.cpp

示例7: OnFormBackRequested

void ItemForm::OnFormBackRequested(Osp::Ui::Controls::Form & source) {
	AppLog("OnFormBackRequested()");
	Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();

	MainForm * pForm = static_cast<MainForm*> (pFrame->GetControl(kMainFormNameString));
/*
    pFrame->SetCurrentForm(*pForm);
    pForm->Draw();
    pForm->Show();
*/

	FrameAnimator * pAnimator = pFrame->GetFrameAnimator();
	pAnimator->SetFormTransitionAnimation(FRAME_ANIMATOR_FORM_TRANSITION_ANIMATION_TRANSLATE_RIGHT,
			                              800,
			                              ANIMATION_INTERPOLATOR_EASE_IN_OUT);

	pAnimator->SetCurrentForm(*pForm);

}
开发者ID:drstrangecode,项目名称:Bada_RssReader_DrStrangecode,代码行数:19,代码来源:ItemForm.cpp

示例8:

void
UserProfileForm::OnActionPerformed(const Control& source, int actionId)
{
	Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
	FormManager *pFormManager = static_cast<FormManager *>(pFrame->GetControl(L"FormManager"));
	switch (actionId)
	{
	case ID_BUTTON_FRIENDS_CLICKED:

		if (pFormManager == null)
			return;
		pFormManager->SendUserEvent(FormManager::REQUEST_FRIENDSFORM, null);
		break;

	case ID_BUTTON_LOGOUT_CLICKED:

		if (pFormManager == null)
			return;
		pFormManager->SendUserEvent(FormManager::REQUEST_MAINFORM, null);
		break;
	}
}
开发者ID:claymodel,项目名称:bigcloud,代码行数:22,代码来源:UserProfileForm.cpp

示例9: Integer

void
FCarAddEdit::OnActionPerformed(const Control& source, int actionId)
{
	Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
	if (actionId == ID_CANCEL){
		bool issaved = false;
		if (!this->detailmode) {
		if (CheckIfDataChanged()) {
			MessageBox msgbox;
			int modalResult = 0;
			msgbox.Construct("Confirm cancel", "Car data changed. Save data?", MSGBOX_STYLE_YESNO, 10000);
			msgbox.ShowAndWait(modalResult);
			if (modalResult == MSGBOX_RESULT_YES) {
				if (Save() == false) {
					return;
				} else {
					issaved = true;
				}
			}
		}
		}
		if (this->formtype == 2) {
			FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
			if (issaved) {
				carconclass_->SetLastSelectedID(this->itemid);
				FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
				pFormMgr->SendUserEvent(FormMgr::REQUEST_MAINFORM, null);
			} else {
				ArrayList * list = new ArrayList;
				list->Construct();
				list->Add(*(new Integer(2)));
				pFormMgr->SendUserEvent(FormMgr::REQUEST_SETTINGSFORM, list);
			}
		} else {
		if ((!this->detailform) || (this->detailmode)) {
			FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
			ArrayList * list = new ArrayList;
			list->Construct();
			list->Add(*(new Integer(this->itemid)));
			pFormMgr->SendUserEvent(FormMgr::REQUEST_CARSELECTFORM, list);
		} else {
			OnActionPerformed(source, ID_DETAIL);
		}
		}
	} else if (actionId == ID_SAVE) {
		if (Save() == false) {
			return;
		}
		if (this->formtype == 2) {
		carconclass_->SetLastSelectedID(this->itemid);
		FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
		pFormMgr->SendUserEvent(FormMgr::REQUEST_MAINFORM, null);
		} else {
		if (!this->detailform) {
			FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
			ArrayList * list = new ArrayList;
			list->Construct();
			list->Add(*(new Integer(this->itemid)));
			pFormMgr->SendUserEvent(FormMgr::REQUEST_CARSELECTFORM, list);
		} else {
			OnActionPerformed(source, ID_DETAIL);
		}
		}
	} else if (actionId == ID_SELECTFUELTYPEPOPUPOK) {
		fueltypesselectedarray_.RemoveAll();
		int checkeditemindex;
		int fueltypeid;
		checkeditemindex = pListSelectFuelTypes_->GetFirstCheckedItemIndex();
		while (checkeditemindex > -1) {
			fueltypeid = pListSelectFuelTypes_->GetItemIdAt(checkeditemindex);
			fueltypesselectedarray_.Add(fueltypeid);
			checkeditemindex = pListSelectFuelTypes_->GetNextCheckedItemIndexAfter(checkeditemindex);
		}
		controlhandler_->SetValue(this,L"CB_4_fueltypestring", GetFuelTypesString());
		pPopup_->SetShowState(false);
		this->SetFocus();
		RequestRedraw(true);
	} else if (actionId == ID_ADDNEWFUELTYPEPOPUPCANCEL) {
		pAddnewfueltypepopup_->SetShowState(false);
		this->SetFocus();
		RequestRedraw(true);
	} else if (actionId == ID_ADDNEWFUELTYPEPOPUPSAVE) {
		Osp::Ui::Controls::EditField *pAddnewfueltypepopupEditField_ = static_cast<EditField *>(pAddnewfueltypepopup_->GetControl(L"IDC_EDITFIELD1"));
		String tmps = pAddnewfueltypepopupEditField_->GetText();
		tmps.Trim();
		if (tmps == "") {
			MessageBox msgbox;
			int modalResult = 0;
			msgbox.Construct("Empty value!", "Input fuel type caption!", MSGBOX_STYLE_OK, 10000);
			msgbox.ShowAndWait(modalResult);
		} else {
			FuelTypeData fueltypedata_;
			fueltypedata_.Caption = tmps;
			fueltypedata_.ID = 0;
			carconclass_->SaveFuelTypeData(fueltypedata_);
			pListSelectFuelTypes_->AddItem(&fueltypedata_.Caption, null, null, null, fueltypedata_.ID);
			int selecteditemindex = pListSelectFuelTypes_->GetItemIndexFromItemId(fueltypedata_.ID);
			if (selecteditemindex > -1) {
				pListSelectFuelTypes_->SetItemChecked(selecteditemindex, true);
			}
//.........这里部分代码省略.........
开发者ID:BoboTheRobot,项目名称:Badaprojects,代码行数:101,代码来源:FCarAddEdit.cpp

示例10: OnActionPerformed

void FPlayer::OnActionPerformed(const Osp::Ui::Control& source, int actionId) {
	if (actionId == ABACK) {
		Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
		FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
		pFormMgr->SendUserEvent(FormMgr::REQUEST_MAINFORM, null);
	} else if (actionId == APLAYPAUSE) {
		HideControlsTimer_->Cancel();
		infobtn->SetShowState(pPlayerThread_->playing);
		deletebtn->SetShowState(pPlayerThread_->playing);
		exportbtn->SetShowState(pPlayerThread_->playing);
		//editbtn->SetShowState(pPlayerThread_->playing);
		nextframebtn->SetShowState(pPlayerThread_->playing);
		prevframebtn->SetShowState(pPlayerThread_->playing);
		speedbtn->SetShowState(pPlayerThread_->playing);
		if (pPlayerThread_->playing == true) {
			playpausebtn->SetNormalBackgroundBitmap(*playpausebtnbmpn_);
			playpausebtn->SetPressedBackgroundBitmap(*playpausebtnbmps_);
			controlsarevisible = true;
			backbtn->SetShowState(true);
			playpausebtn->SetShowState(true);
		} else {
			playpausebtn->SetNormalBackgroundBitmap(*playpausepausebtnbmpn_);
			playpausebtn->SetPressedBackgroundBitmap(*playpausepausebtnbmps_);
		}
		RedrawDisplayBuffer(displaybuffer_->GetBounds());
		this->RequestRedraw();
		if (pPlayerThread_->playing != true) {
			Osp::System::PowerManager::KeepScreenOnState(true, false);
			HideControlsTimer_->Start(2000);
		} else {
			Osp::System::PowerManager::KeepScreenOnState(false, true);
		}
		pPlayerThread_->SendUserEvent(pPlayerThread_->THREAD_PLAYPAUSE, null);
	} else if (actionId == APREVFRAME) {
		if (pPlayerThread_->playing != true) {
			pPlayerThread_->SendUserEvent(pPlayerThread_->THREAD_PREVFRAME, null);
		}
	} else if (actionId == ANEXTFRAME) {
		if (pPlayerThread_->playing != true) {
			pPlayerThread_->SendUserEvent(pPlayerThread_->THREAD_NEXTFRAME, null);
		}
	} else if (actionId == ADELETEVIDEO) {
		if (pPlayerThread_->playing != true) {
			MessageBox msgbox;
			int modalResult = 0;
			msgbox.Construct("Delete?", "Do you want to delete video?", MSGBOX_STYLE_YESNO, 0);
			msgbox.ShowAndWait(modalResult);
			if (modalResult == MSGBOX_RESULT_YES) {
				Osp::Base::String filename = pPlayerThread_->filename;
				pPlayerThread_->Stop();
				pPlayerThread_->Join();
				delete pPlayerThread_;
				pPlayerThread_ = null;
				if (Osp::Io::File::IsFileExist(filename)) {
					Osp::Io::File::Remove(filename);
				}
				Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
				FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
				pFormMgr->SendUserEvent(FormMgr::REQUEST_MAINFORM, null);
			}
		}
	} else if (actionId == ASHOWINFO) {
		if (pPlayerThread_->playing != true) {
			Osp::Base::String strvalue;

			Osp::Ui::Controls::Label * infopopuplresel_ = static_cast<Label *>(infopopup_->GetControl(L"LBLRES"));
			Osp::Ui::Controls::Label * infopopupstimeel_ = static_cast<Label *>(infopopup_->GetControl(L"LBLSTIME"));
			Osp::Ui::Controls::Label * infopopupetimeel_ = static_cast<Label *>(infopopup_->GetControl(L"LBLETIME"));
			Osp::Ui::Controls::Label * infopopupframesel_ = static_cast<Label *>(infopopup_->GetControl(L"LBLFRAMES"));
			Osp::Ui::Controls::Label * infopopupfilesizeel_ = static_cast<Label *>(infopopup_->GetControl(L"LBLFILESIZE"));
			Osp::Ui::Controls::Label * infopopupftimeel_ = static_cast<Label *>(infopopup_->GetControl(L"LBLFTIME"));
			Osp::Ui::Controls::Label * infopopupframenel_ = static_cast<Label *>(infopopup_->GetControl(L"LBLFRAMEN"));
			Osp::Ui::Controls::Label * infopopupframesizeel_ = static_cast<Label *>(infopopup_->GetControl(L"LBLFRAMESIZE"));

			infopopuplresel_->SetText(Osp::Base::Integer::ToString(pPlayerThread_->resolution.width) + L"x" + Osp::Base::Integer::ToString(pPlayerThread_->resolution.height));
			infopopupstimeel_->SetText(pPlayerThread_->startframetime.ToString());
			infopopupetimeel_->SetText(pPlayerThread_->endframetime.ToString());
			infopopupframesel_->SetText(Osp::Base::Integer::ToString(pPlayerThread_->framescount));

			if (pPlayerThread_->filesize > 1048576) {
				strvalue = L"";
				strvalue.Format(25,L"%.2f",(double)(pPlayerThread_->filesize / 1048576.0f));
				strvalue.Append(L" Mb");
			} else {
				strvalue = L"";
				strvalue.Append((int)(pPlayerThread_->filesize / 1024));
				strvalue.Append(L" Kb");
			}
			infopopupfilesizeel_->SetText(strvalue);

			infopopupftimeel_->SetText(pPlayerThread_->curframedatetime.ToString());
			infopopupframenel_->SetText(Osp::Base::Integer::ToString(pPlayerThread_->curframe));

			if (pPlayerThread_->curframesize > 1048576) {
				strvalue = L"";
				strvalue.Format(25,L"%.2f",(double)(pPlayerThread_->curframesize / 1048576.0f));
				strvalue.Append(L" Mb");
			} else {
				strvalue = L"";
				strvalue.Append((int)(pPlayerThread_->curframesize / 1024));
//.........这里部分代码省略.........
开发者ID:BoboTheRobot,项目名称:Badaprojects,代码行数:101,代码来源:FPlayer.cpp

示例11: dim

void
FTrip::OnActionPerformed(const Control& source, int actionId)
{
	Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
	if ((actionId == ID_EDIT) || (actionId == ID_DETAIL)) {
		if (this->selecteditemid > 0) {
			FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
			ArrayList * list = new ArrayList;
			list->Construct();
			list->Add(*(new Integer(this->selecteditemid)));
			if (actionId == ID_EDIT) {
				pFormMgr->SendUserEvent(FormMgr::REQUEST_TRIPADDEDIT, list);
			} else {
				pFormMgr->SendUserEvent(FormMgr::REQUEST_TRIPDETAIL, list);
			}
		} else {
			MessageBox msgbox;
			int modalResult = 0;
			msgbox.Construct("Record not selected!", "Please select record you want to edit.", MSGBOX_STYLE_OK, 10000);
			msgbox.ShowAndWait(modalResult);
		}
	} else if (actionId == ID_DELETE) {
		if (this->selecteditemid > 0) {
			MessageBox msgbox;
			int modalResult = 0;
			if (carconclass_->DeleteTripData(this->selecteditemid, true) == false) {
				msgbox.Construct("Can't delete trip!", "Trip is selected in reference table!", MSGBOX_STYLE_OK, 10000);
				msgbox.ShowAndWait(modalResult);
			} else {
				msgbox.Construct("Delete trip?", "Do you really want to delete trp?", MSGBOX_STYLE_YESNO, 10000);
				msgbox.ShowAndWait(modalResult);
				if (modalResult == MSGBOX_RESULT_YES) {
					Osp::Ui::Controls::Popup* pPopup_;
					pPopup_ = new Popup();
					Dimension dim(300, 50);
					pPopup_->Construct(true, dim);
					pPopup_->SetTitleText(L"Deleting please wait...");
					pPopup_->SetShowState(true);
					pPopup_->Show();
					carconclass_->DeleteTripData(this->selecteditemid);
					int selecteditemindex = pExList->GetItemIndexFromItemId(this->selecteditemid);
					if (selecteditemindex > -1) {
						pExList->RemoveItemAt(selecteditemindex);
					}
					this->selecteditemid = 0;
					pPopup_->SetShowState(false);
					delete pPopup_;
					RequestRedraw(true);
				}
			}
		} else {
			MessageBox msgbox;
			int modalResult = 0;
			msgbox.Construct("Record not selected!", "Please select record you want to delete.", MSGBOX_STYLE_OK, 10000);
			msgbox.ShowAndWait(modalResult);
		}
	} else if (actionId == ID_ADD) {
		FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
		pFormMgr->SendUserEvent(FormMgr::REQUEST_TRIPADDEDIT, null);
	} else if (actionId == ID_BACK) {
		FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
		pFormMgr->SendUserEvent(FormMgr::REQUEST_MAINFORM, null);
	} else if (actionId == ID_CLEARSEARCH) {
		SearchAction(L"");
	}
}
开发者ID:BoboTheRobot,项目名称:Badaprojects,代码行数:66,代码来源:FTrip.cpp

示例12: if

void
FPlaylistForm::OnActionPerformed(const Control& source, int actionId)
{
	if (actionId == APLAY) {
		FMainForm *pMainForm = static_cast<FMainForm *>(Application::GetInstance()->GetAppFrame()->GetFrame()->GetControl("FMainForm"));
		int playlistitemscount = 0;
		if (pMainForm->isstreaming) {
			playlistitemscount = pMainForm->playliststream->GetCount();
		} else {
			playlistitemscount = publicfunc_->playlist->GetCount();
		}
		if ((curselitemid > 0) && (curselitemid <= playlistitemscount)) {
			if (publicfunc_->sendingcommand == false) {
				//if (curplayingitemid != curselitemid) {
					PlayListItem * playlistitem_;
					if (pMainForm->isstreaming) {
						playlistitem_ = static_cast<PlayListItem *> (pMainForm->playliststream->GetAt(curselitemid-1));
						pMainForm->StreamingPlayListPlayItem(curselitemid-1);
					} else {
						playlistitem_ = static_cast<PlayListItem *> (publicfunc_->playlist->GetAt(curselitemid-1));
						publicfunc_->SendCommand(L"pl_play&id=" + Osp::Base::Integer::ToString(playlistitem_->id));
					}
					int listitemindex = -1;
					if (curplayingitemid >= 0) {
						PlayListItem * playlistitemold_;
						if (pMainForm->isstreaming) {
							playlistitemold_ = static_cast<PlayListItem *> (pMainForm->playliststream->GetAt(curplayingitemid-1));
						} else {
							playlistitemold_ = static_cast<PlayListItem *> (publicfunc_->playlist->GetAt(curplayingitemid-1));
						}
						listitemindex = UList_->GetItemIndexFromItemId(curplayingitemid);
						if (listitemindex >= 0) {
							CustomListItem* pItem = const_cast <CustomListItem*>(UList_->GetItemAt(listitemindex));
							pItem->SetElement(ID_LIST_ICON, L"");
							UList_->RefreshItem(listitemindex);
						}
					}
					listitemindex = UList_->GetItemIndexFromItemId(curselitemid);
					if (listitemindex >= 0) {
						CustomListItem* pItem = const_cast <CustomListItem*>(UList_->GetItemAt(listitemindex));
						pItem->SetElement(ID_LIST_ICON, *currenticon, currenticon);
						UList_->RefreshItem(listitemindex);
					}
					this->RequestRedraw();
					curplayingitemid = curselitemid;
				//}
			}
		}
	} else if (actionId == AREMOVE) {
		FMainForm *pMainForm = static_cast<FMainForm *>(Application::GetInstance()->GetAppFrame()->GetFrame()->GetControl("FMainForm"));
		int playlistitemscount = 0;
		if (pMainForm->isstreaming) {
			playlistitemscount = pMainForm->playliststream->GetCount();
		} else {
			playlistitemscount = publicfunc_->playlist->GetCount();
		}
		if ((curselitemid > 0) && (curselitemid <= playlistitemscount)) {
			if (publicfunc_->sendingcommand == false) {
				if (curplayingitemid == curselitemid) {
					curplayingitemid = -1;
				}
				PlayListItem * playlistitem_;
				if (pMainForm->isstreaming) {
					playlistitem_ = static_cast<PlayListItem *> (pMainForm->playliststream->GetAt(curselitemid-1));
					pMainForm->StreamingPlayListRemoveItem(curselitemid-1);

					UList_->RemoveAllItems();
					FillListItems();
				} else {
					playlistitem_ = static_cast<PlayListItem *> (publicfunc_->playlist->GetAt(curselitemid-1));
					publicfunc_->SendCommand(L"pl_delete&id=" + Osp::Base::Integer::ToString(playlistitem_->id));
					publicfunc_->playlist->RemoveAt(curselitemid-1,true);

					UList_->RemoveAllItems();
					FillListItems();

				}
			}
		}
	} else if (actionId == ACLEAR) {
		MessageBox msgbox;
		int modalResult = 0;
		msgbox.Construct("Clear playlist?", "Do you want to clear playlist?", MSGBOX_STYLE_YESNO, 0);
		msgbox.ShowAndWait(modalResult);
		if (modalResult == MSGBOX_RESULT_YES) {
			FMainForm *pMainForm = static_cast<FMainForm *>(Application::GetInstance()->GetAppFrame()->GetFrame()->GetControl("FMainForm"));
			if (pMainForm->isstreaming) {
				pMainForm->StreamingPlayListClear();
			}
			UList_->RemoveAllItems();
			publicfunc_->ClearPlayList();
			FillListItems();
		}
	} else if (actionId == AADD) {
		Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
		FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
		pFormMgr->SendUserEvent(FormMgr::REQUEST_BROWSEFORMADDTOPLAYLIST, null);
	} else if (actionId == ABACK) {
		Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
		FormMgr *pFormMgr = static_cast<FormMgr *>(pFrame->GetControl("FormMgr"));
//.........这里部分代码省略.........
开发者ID:BoboTheRobot,项目名称:Badaprojects,代码行数:101,代码来源:FPlaylistForm.cpp


注:本文中的Frame::GetControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。