//*************************************************************************************
void CFavoritesManager::FillTree (CTreeCtrl& wndTree)
{
	ASSERT (wndTree.GetSafeHwnd () != NULL);

	wndTree.DeleteAllItems ();
	wndTree.SetImageList (CImageList::FromHandle (m_himSystem), TVSIL_NORMAL);
	m_Root.FillTree (wndTree, NULL);
}
BOOL TreeDlg::OnInitDialog() {
  __super::OnInitDialog();
  m_accelTable = LoadAccelerators(theApp.m_hInstance, MAKEINTRESOURCE(IDR_ACCELERATORTREE));

  CTreeCtrl *ctrl = getTreeCtrl();
  m_images.Create(IDB_BITMAPTERMINAL, 13, 1, RGB(255, 255, 255));
  ctrl->SetImageList(&m_images, TVSIL_NORMAL);
  traverse(ctrl, m_tree, TVI_ROOT);
  ctrl->SetFocus();
  ctrl->SelectItem(ctrl->GetRootItem());

  m_layoutManager.OnInitDialog(this);
  m_layoutManager.addControl(IDC_DERIVATIONTREE , RELATIVE_SIZE );
  m_layoutManager.addControl(IDOK               , RELATIVE_X_POS);
  m_layoutManager.addControl(IDC_BUTTONEXPAND   , RELATIVE_X_POS);
  m_layoutManager.addControl(IDC_BUTTONEXPANDALL, RELATIVE_X_POS);

  return false;
}
Exemple #3
0
// @pymethod int|PyCTreeCtrl|SetImageList|Assigns an image list to a list view control.
PyObject *PyCTreeCtrl_SetImageList( PyObject *self, PyObject *args )
{
	CTreeCtrl *pList;
	PyObject *obList;
	int imageType;
	if (!(pList=GetTreeCtrl(self)))
		return NULL;
	if (!PyArg_ParseTuple(args, "Oi:SetImageList", 
		                  &obList, // @pyparm <o PyCImageList>|imageList||The Image List to use.
						  &imageType )) // @pyparm int|imageType||Type of image list. It can be one of (COMMCTRL.) LVSIL_NORMAL, LVSIL_SMALL or LVSIL_STATE
		return NULL;
	CImageList *pImageList = PyCImageList::GetImageList(obList);
	if (pImageList==NULL) return NULL;
 	GUI_BGN_SAVE;
	CImageList *pOldList = pList->SetImageList( pImageList, imageType );
 	GUI_END_SAVE;
	if (pOldList==NULL)
		RETURN_NONE;
	return ui_assoc_object::make( PyCImageList::type, pOldList )->GetGoodRet();
}