void QPatientInfoWidget::AddDoctor(const STUDoctor& doctor)
{
	//doctor
	QTreeWidgetItem* topLevelItem = AddChildItem(this, TAGNAME_DOCTOR);

	//name
	AddChildItem(topLevelItem, TAGNAME_NAME, doctor.m_name);
}
void QPatientInfoWidget::AddTechnician(const STUTechnician& technician)
{
	//technician
	QTreeWidgetItem* topLevelItem = AddChildItem(this, TAGNAME_TECHNICIAN);

	//name
	AddChildItem(topLevelItem, TAGNAME_NAME, technician.m_name);
}
void QPatientInfoWidget::AddClinicalClassifications(const STUClinicalClassifications& classifications)
{
	//classifications
	QTreeWidgetItem* topLevelItem = AddChildItem(this, TAGNAME_CLINICALCLASSIFICATIONS);

	//classification
	for (qint32 i=0; i<classifications.m_classifications.size(); i++)
	{
		AddChildItem(topLevelItem, TAGNAME_CLINICALCLASSIFICATION, classifications.m_classifications.at(i));
	}
}
void QPatientInfoWidget::AddMedications(const STUMedications& medications)
{
	//medications
	QTreeWidgetItem* topLevelItem = AddChildItem(this, TAGNAME_MEDICATIONS);

	//medication
	for (qint32 i=0; i<medications.m_name.size(); i++)
	{
		AddChildItem(topLevelItem, TAGNAME_MEDICATION, medications.m_name.at(i));
	}
}
void CXTPPropertyGridItemPoint::OnAddChildItem()
{
	if (m_pItemX && m_pItemY)
		return;

	m_pItemX = (CItemX*)AddChildItem(new CItemX(_T("X")));
	m_pItemY = (CItemY*)AddChildItem(new CItemY(_T("Y")));

	UpdateChilds();

	m_pItemX->SetDefaultValue(m_pItemX->GetValue());
	m_pItemY->SetDefaultValue(m_pItemY->GetValue());
}
void CXTPPropertyGridItemSize::OnAddChildItem()
{
	if (m_pItemHeight && m_pItemWidth)
		return;

	m_pItemWidth = (CXTPPropertyGridItemSizeWidth*)AddChildItem(new CXTPPropertyGridItemSizeWidth(_T("Width")));
	m_pItemHeight = (CXTPPropertyGridItemSizeHeight*)AddChildItem(new CXTPPropertyGridItemSizeHeight(_T("Height")));

	UpdateChilds();

	m_pItemWidth->SetDefaultValue(m_pItemWidth->GetValue());
	m_pItemHeight->SetDefaultValue(m_pItemHeight->GetValue());
}
void QPatientInfoWidget::AddDemographics(const STUDemographics& demographics)
{
	//Demographics
	QTreeWidgetItem* topLevelItem = AddChildItem(this, TAGNAME_DEMOGRAPHICS);

	//FirstName
	AddChildItem(topLevelItem, TAGNAME_FIRSTNAME, demographics.m_firstName);

	//LastName
	AddChildItem(topLevelItem, TAGNAME_LASTNAME, demographics.m_lastName);

	//PatientID
	AddChildItem(topLevelItem, TAGNAME_PATIENTID, demographics.m_patientID);

	//DateOfBirth
	AddChildItem(topLevelItem, TAGNAME_DATEOFBIRTH, demographics.m_dateOfBirth);

	//Age
	AddChildItem(topLevelItem, TAGNAME_AGE, demographics.m_age);

	//Gender
	AddChildItem(topLevelItem, TAGNAME_GENDER, demographics.m_gender);
	
	//Race
	AddChildItem(topLevelItem, TAGNAME_RACE, demographics.m_race);
}
void CDirectoryTreeCtrl::Init(void)
{
	SendMessage(CCM_SETUNICODEFORMAT, TRUE);

	ShowWindow(SW_HIDE);
	DeleteAllItems();

	ModifyStyle( 0, TVS_CHECKBOXES );

	// START: added by FoRcHa /////////////
	WORD wWinVer = thePrefs.GetWindowsVersion();	// maybe causes problems on 98 & nt4
	if(wWinVer == _WINVER_2K_ || wWinVer == _WINVER_XP_ || wWinVer == _WINVER_ME_)		
	{
		SHFILEINFO shFinfo;
		HIMAGELIST hImgList = NULL;

		// Get the system image list using a "path" which is available on all systems. [patch by bluecow]
		hImgList = (HIMAGELIST)SHGetFileInfo(_T("."), 0, &shFinfo, sizeof(shFinfo),
												SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
		if(!hImgList)
		{
			TRACE(_T("Cannot retrieve the Handle of SystemImageList!"));
			//return;
		}

		m_image.m_hImageList = hImgList;
		SetImageList(&m_image, TVSIL_NORMAL);
	}
	////////////////////////////////


	TCHAR drivebuffer[500];
	::GetLogicalDriveStrings(ARRSIZE(drivebuffer), drivebuffer); // e.g. "a:\ c:\ d:\"

	const TCHAR* pos = drivebuffer;
	while(*pos != _T('\0')){

		// Copy drive name
		TCHAR drive[4];
		_tcsncpy(drive, pos, ARRSIZE(drive));
		drive[ARRSIZE(drive) - 1] = _T('\0');

		switch(drive[0]){
			case _T('a'):
			case _T('A'):
			case _T('b'):
			case _T('B'):
			// Skip floppy disk
			break;
		default:
			drive[2] = _T('\0');
			AddChildItem(NULL, drive); // e.g. ("c:")
		}

		// Point to the next drive (4 chars interval)
		pos = &pos[4];
	}
	// VC-kernel[2007-02-13]:
	//ShowWindow(SW_SHOW);
}
/*!
    显示参数
    @para[in]  const STUPatient* patientPtr  
    @return  void
*/
void QPatientInfoWidget::FillPatient(const STUPatient* patientPtr)
{
	//清空内容
	clear();

	if (NULL != patientPtr)
	{
		//demographics
		AddDemographics(patientPtr->m_demographics);

		//assignedLocation
		AddAssignedLocation(patientPtr->m_assignedLocation);

		//doctor
		AddDoctor(patientPtr->m_doctor);

		//technician
		AddTechnician(patientPtr->m_technician);

		//PACE
		AddChildItem(this, TAGNAME_PACED, patientPtr->m_paced);

		//medications
		AddMedications(patientPtr->m_medications);

		//clinicalClassifications
		AddClinicalClassifications(patientPtr->m_clinicalClassfications);
	}

	//全部展开
	expandAll();
}
void CDirectoryTreeCtrl::AddSubdirectories(HTREEITEM hRoot, CString strDir)
{
	strDir += _T("*.*");

	CFileFind finder;
	BOOL bWorking = finder.FindFile(strDir);

	while (bWorking)
	{
		bWorking = finder.FindNextFile();

		if (finder.IsDots())
			continue;
		if (finder.IsSystem())
			continue;
		if (!finder.IsDirectory())
			continue;
		
		CString	strFilename = finder.GetFileName();
		int		iIdx;

		if ((iIdx = strFilename.ReverseFind('\\')) != -1)
			strFilename = strFilename.Mid(iIdx + 1);

		AddChildItem(hRoot, strFilename);
	}

	finder.Close();
}
Exemple #11
0
void CDirectoryTreeCtrl::Init()
{
	// already done ?
	if (m_IsInit) {
		return;
	}
	m_IsInit = true;

	// init image(s)
	wxImageList* images = new wxImageList(16, 16);
	images->Add(wxBitmap(amuleSpecial(1)));
	images->Add(wxBitmap(amuleSpecial(2)));
	// Gives wxTreeCtrl ownership of the list
	AssignImageList(images);


	// Create an empty root item, which we can
	// safely append when creating a full path.
	m_root = AddRoot(wxEmptyString, IMAGE_FOLDER, -1,
					new CItemData(CPath()));

	if (!m_IsRemote) {
	#ifndef __WXMSW__
		AddChildItem(m_root, CPath(wxT("/")));
	#else
		// this might take awhile, so change the cursor
		::wxSetCursor(*wxHOURGLASS_CURSOR);
		// retrieve bitmask of all drives available
		uint32 drives = GetLogicalDrives();
		drives >>= 1;
		for (char drive = 'C'; drive <= 'Z'; drive++) {
			drives >>= 1;
			if (! (drives & 1)) { // skip non existant drives
				continue;
			}
			wxString driveStr = CFormat(wxT("%c:")) % drive;
			uint32 type = GetDriveType(driveStr + wxT("\\"));

			// skip removable/undefined drives, share only fixed or remote drives
			if ((type == 3 || type == 4)   // fixed drive / remote drive
				&& CPath::DirExists(driveStr)) {
				AddChildItem(m_root, CPath(driveStr));
			}
		}
		::wxSetCursor(*wxSTANDARD_CURSOR);
	#endif
	}
void QPatientInfoWidget::AddAssignedLocation(const STUAssignedLocation& assignedLocation)
{
	//assignedLocation
	QTreeWidgetItem* topLevelItem = AddChildItem(this, TAGNAME_ASSIGNEDLOCATION);

	//bed
	AddChildItem(topLevelItem, TAGNAME_BED, assignedLocation.m_bed);

	//Room
	AddChildItem(topLevelItem, TAGNAME_ROOM, assignedLocation.m_room);

	//pointOfCare
	AddChildItem(topLevelItem, TAGNAME_POINTOFCARE, assignedLocation.m_pointOfCare);

	//Facility
	AddChildItem(topLevelItem, TAGNAME_FACILITY, assignedLocation.m_facility);
}
void CDirectoryTreeCtrl::Init(bool bAllowCDROM /*= true*/)
{
#ifdef _UNICODE
//	Win9x: Explicitly set to Unicode to receive Unicode notifications.
	SendMessage(CCM_SETUNICODEFORMAT, TRUE);
#endif

	DeleteAllItems();

	SHFILEINFO shFinfo;
	HIMAGELIST hImgList;
	CImageList imageList;

//	Get the system image list using a "path" which is available on all systems. [patch by bluecow]
	hImgList = (HIMAGELIST)SHGetFileInfo(_T("."), FILE_ATTRIBUTE_DIRECTORY, &shFinfo, sizeof(shFinfo), SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES);
	imageList.Attach(hImgList);
	SetImageList(&imageList, TVSIL_NORMAL);
//	Don't destroy the system's image list
	imageList.Detach();

	TCHAR drivebuffer[128], cDrv, *pos = drivebuffer;

	::GetLogicalDriveStrings(ARRSIZE(drivebuffer), drivebuffer); // e.g. "a:\ c:\ d:\"
	while(*pos != _T('\0'))
	{
		UINT	dwDrvType = ::GetDriveType(pos);

	//	Skip floppy drives (check letter as some USB drives can also be removable) and in some cases CD/DVD
		if ( ((dwDrvType != DRIVE_REMOVABLE) || (((cDrv = CHR2UP(*pos)) != _T('A')) && (cDrv != _T('B')))) &&
			(bAllowCDROM || (dwDrvType != DRIVE_CDROM)) )
		{
			pos[2] = _T('\0');
			AddChildItem(NULL, pos); // e.g. ("c:")
		}
	//	Point to the next drive (4 chars interval)
		pos += 4;
	}
}
void CXTPPropertyGridItemFlags::OnConstraintsChanged()
{
	GetChilds()->Clear();

	CXTPPropertyGridItemConstraints* pConstraints = GetConstraints();

	int i;

	for (i = 0; i < pConstraints->GetCount(); i++)
	{
		AddChildItem(new CXTPPropertyGridItemFlag(pConstraints->GetAt(i), (int)pConstraints->GetConstraintAt(i)->m_dwData));
	}
	UpdateChilds();
	m_strDefaultValue = m_strValue = GetFlagsString();

	CXTPPropertyGridItems* pItems = GetChilds();
	for (i = 0; i < pItems->GetCount(); i++)
	{
		CXTPPropertyGridItemFlag* pItem = (CXTPPropertyGridItemFlag*)pItems->GetAt(i);
		pItem->SetDefaultValue(pItem->GetValue());
	}

}