コード例 #1
0
ファイル: DialogPreview.cpp プロジェクト: phohale/ResEdit
/*********************************************************************\
	Function name    : CPreviewSub::Command
	Description      :
	Created at       : 11.08.01, @ 21:30:06
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
Bool CPreviewSub::Command(Int32 lId, const BaseContainer &msg)
{
	CDialogDoc* pDoc = m_pDialog->m_pDocument;

	CDialogItem* pItem = pDoc->SearchItem(pDoc->m_pTreeDlg->GetTreeView()->GetRootItem(), lId);
	if (pItem)
	{
		if (pItem->GetType() != Group)
			pDoc->SelChanged(pItem);
		if (pItem->GetType() == CustomElement)
		{
			CDialogCustomElement* pCustom = (CDialogCustomElement*)pItem;
			Int32 l = pCustom->GetElementPluginID();
			if (l >= 0)
			{
				_BaseCustomGui* pGUI = (_BaseCustomGui*)FindCustomGui(lId, l);
				if (pGUI)
				{
					if (pCustom->m_lElement >= 0 && pCustom->m_lElement < g_pCustomElements->Entries() && pCustom->m_pData)
					{
						pCustom->m_pData[pCustom->m_lElement] = pGUI->GetData(l);
					}
				}
			}
		}
	}
	return false;
}
コード例 #2
0
Bool DiffDistriDialog::CreateLayout(void)
{
	if (!GeDialog::CreateLayout())
		return false;
	if (!LoadDialogResource(IDD_DIFF_DISTRI_DLG, nullptr, 0))
		return false;

	m_pTreeView = (TreeViewCustomGui*)FindCustomGui(IDC_DIFF_DISTRI_FILES_TREE, CUSTOMGUI_TREEVIEW);
	m_pNewZipEdit = (FilenameCustomGui*)FindCustomGui(IDC_DIFF_DISTRI_NEWZIP_EDIT, CUSTOMGUI_FILENAME);
	m_pDestPathEdit = (FilenameCustomGui*)FindCustomGui(IDC_DIFF_DISTRI_DESTPATH_EDIT, CUSTOMGUI_FILENAME);
	if (!m_pTreeView || !m_pNewZipEdit || !m_pDestPathEdit)
		return false;

	BaseContainer bcLayout;
	bcLayout.SetInt32(0, LV_TREE);
	m_pTreeView->SetLayout(1, bcLayout);
	m_pTreeView->SetRoot(&g_pResEditPrefs->arOldFiles, &funcs, this);

	return true;
}