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


C++ Task::GetTitle方法代码示例

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


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

示例1: RealizeTask

void RecurrenceManager::RealizeTask(MSXML2::IXMLDOMNode *pNode, unsigned __int64 templateId, unsigned __int64 parentId, unsigned __int64 start, int duration)
{
	if(!FindTaskInstance(templateId, start))
	{
		TaskManager *pTaskManager = m_pDataManager->GetTaskManagerInstance();
		BSTR title = 0;
		HRESULT hr = XMLHelper::GetChildText(pNode, CTaskModel::TITLE, &title);
		if(hr == S_OK && title)
		{
			BSTR desc = 0;
			hr = XMLHelper::GetChildText(pNode, CTaskModel::DESCRIPTION, &desc);
			//TODO: set task templateId
			Task *pTask = pTaskManager->createTask(desc, title, 3, false, start, 0, parentId);		
			StringBuffer conv(32);
			pTask->SetCustomAttribute(_T("recurrenceid"), ModelUtils::toHexString(templateId, conv));
			TimeEntryManager *pTimeEntryManager = m_pDataManager->GetDayManagerInstance()->GetSpeculativeEntryManager();
			pTimeEntryManager->CreateTimeEntry(pTask->GetID(), start, start + (duration * ModelUtils::UNITS_PER_MINUTE), pTask->GetTitle());

			if(hr == S_OK && desc)SysFreeString(desc);
			SysFreeString(title);
		}
	}

}
开发者ID:jaylauffer,项目名称:loadngo,代码行数:24,代码来源:RecurrenceManager.cpp

示例2: OnInitDialog

void CEditTaskDlg::OnInitDialog()
{
	using namespace loadngo::data;
	SetWindowText(m_hwnd, _T("Edit Task"));

	/**
	The combo drop down should be tree-d
	mapping here translates the dialog locations to window coordinates
	*/
	RECT r = { 43, 24, 43+195, 24+12 };
	MapDialogRect(m_hwnd, &r);
	m_pTaskCombo->Create(m_hwnd, r, WS_VISIBLE | WS_CHILD, WS_EX_CLIENTEDGE);
	if(m_pTask)
	{
		Task *pParentTask = m_pTask->GetParentTask();
		if(pParentTask)
			m_pTaskCombo->SetText(loadngo::gui::NativeString(pParentTask->GetTitle()));
		//m_pTaskCombo->Invalidate();
	}

	HWND hwndTemp = GetDlgItem(m_hwnd, IDC_CREATE_TASK_COMBO_PRIORITY);
	TCHAR buffer[256] = {};
	for(int i = 0; i < 5; ++i)
	{
		_stprintf_s(buffer, _T("%d"), i + 1);
		::SendMessage(hwndTemp, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(buffer));
	}
	::SendMessage(hwndTemp, CB_SETCURSEL, m_pTask->GetPriority() - 1, 0);

	hwndTemp = GetDlgItem(m_hwnd, IDC_STATIC_STATE);
	ShowWindow(hwndTemp, SW_SHOW);

	hwndTemp = GetDlgItem(m_hwnd, IDC_COMBO_TASK_STATE);
	//TODO: get these literals out of the code and into the resource dll.
	::SendMessage(hwndTemp, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_T("Open")));
	::SendMessage(hwndTemp, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_T("Complete")));
	::SendMessage(hwndTemp, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_T("Closed")));

	Task::State state = m_pTask->GetState();
	int convState = static_cast<int>(state) - 1;
	SendMessage(hwndTemp, CB_SETCURSEL, convState, 0);
	ShowWindow(hwndTemp, SW_SHOW);

	hwndTemp = GetDlgItem(m_hwnd, IDC_CREATE_TASK_EDIT_TITLE);
	SetWindowText(hwndTemp, loadngo::gui::NativeString(m_pTask->GetTitle()));

	hwndTemp = GetDlgItem(m_hwnd, IDC_CREATE_TASK_EDIT_DESCRIPTION);
	SetWindowText(hwndTemp, loadngo::gui::NativeString(m_pTask->GetDescription()));

	SYSTEMTIME date;
	FILETIME ft;
	hwndTemp = GetDlgItem(m_hwnd, IDC_CREATE_TASK_DATETIMEPICKER_START);
	unsigned __int64 dateValue = m_pTask->GetScheduledStart();
	if(dateValue)
	{
		//dateValue = ModelUtils::UTCToLocalTime(dateValue);
		ft.dwHighDateTime = static_cast<unsigned long>(dateValue >> 32);
		ft.dwLowDateTime = static_cast<unsigned long>(dateValue);
		FileTimeToSystemTime(&ft, &date);
		::SendMessage(hwndTemp, DTM_SETSYSTEMTIME, GDT_VALID, reinterpret_cast<LPARAM>(&date));
	}
	else
	{
开发者ID:jaylauffer,项目名称:loadngo,代码行数:63,代码来源:EditTaskDlg.cpp


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