Пример #1
0
//----------------------------------------------------------------------
//  Init the button list for the requested joystick
//----------------------------------------------------------------------
void CFuiAxis::ButtonList(int No)
{ jsp = jsm->GetJoystickNo(No);
  if (0 == jsp)     return;
  devPOP->SetButtonText(devMENU[No]);
  butBOX.EmptyIt();
  //-----Locate joystick descriptor
	int       end = jsp->nbt;
  char      txt[128];
  char     *ktx = "";
  CButLine *btl = 0;
  for (int k=0; k<end; k++)
  { CSimButton     *but = jsp->GetButton(k);
    CKeyDefinition *kdf = (but)?(but->GetKey()):(0);
    ktx = (kdf)?(kdf->GetName()):("");
    sprintf(txt,"Button %02d",k);
    btl = new CButLine;
    btl->SetName(txt);
    btl->SetKeyText(ktx);
    butBOX.AddSlot(btl);
  }
  butBOX.Display();
	//--- Set Hat control ---------------------------
	sprintf(txt,"This device has %d HAT",jsp->hNumber());
	SetChildText('labH',txt);
	char	use = jsp->HatUsed();
	chkHAT->SetState(use);
	HatControl();
  return;
}
Пример #2
0
CTaskModel::CTaskModel(MSXML2::IXMLDOMNode *pNode, unsigned __int64 id, unsigned __int64 parentID, 
		const TCHAR *pDesc, const TCHAR *pTitle, const TCHAR *pOwner, const TCHAR *pAssignee, 
		unsigned __int64 createdDate, unsigned __int64 startDate,	unsigned __int64 dueDate, 
		unsigned __int64 estDuration, bool complete, int pri, TASK_STATE state) : m_pNode(pNode), 
		m_pTaskManager(NULL), m_id(id)
{
	SecureZeroMemory(m_bstrs, sizeof(m_bstrs));
	if(!m_pNode)DebugBreak();
	m_pNode->AddRef();
	StringBuffer temp(32);
	SetAttribute(TASKID, ModelUtils::toHexString(id, temp));
	temp.flush();
	SetAttribute(PARENTID, ModelUtils::toHexString(parentID, temp));
	temp.flush();
	SetAttribute(COMPLETE, complete? _T("true"): _T("false"));
	temp.appendInt(pri);
	SetAttribute(PRIORITY, temp);
	temp.flush();
	temp.appendInt(static_cast<int>(state));
	SetAttribute(STATE, temp);
	temp.flush();
	SetAttribute(ESTIMATE, ModelUtils::toHexString(estDuration, temp));
	temp.flush();
	SetAttribute(CREATED, ModelUtils::toHexString(createdDate, temp));
	temp.flush();
	SetAttribute(DUE, ModelUtils::toHexString(dueDate, temp));
	temp.flush();
	SetAttribute(START, ModelUtils::toHexString(startDate, temp));
	temp.flush();
	SetAttribute(ASSIGNED, ModelUtils::toHexString(pAssignee? createdDate: 0, temp));
	temp.flush();
	if(pAssignee)
	{
		SetAttribute(ASSIGNEE, pAssignee);
	}
	SetAttribute(OWNER, pOwner);
	SetChildText(TITLE, pTitle);
	if(pDesc)
	{
		SetChildText(DESCRIPTION, pDesc);
	}
}
Пример #3
0
void CTaskModel::SetDescription(const TCHAR *pDescription, bool notify)
{
	SetChildText(DESCRIPTION, pDescription);
	if(m_bstrs[BSTRDesc])SysFreeString(m_bstrs[BSTRDesc]);
	m_bstrs[BSTRDesc] = 0;
	SetModifiedDate(ModelUtils::CurrentUTC());
	if(notify)
	{
		TaskEvent te(TaskEvent::Description, m_id);
		notifyTaskListeners(&te);
	}
}