Exemplo n.º 1
0
BOOL CPreferencesDlgBase::CreatePPHost(UINT nHostID)
{
	if (GetDlgItem(nHostID))
	{
		CRect rPPHost;
		GetDlgItem(nHostID)->GetWindowRect(rPPHost);
		ScreenToClient(rPPHost);
		
		return CreatePPHost(rPPHost);
	}
	
	// else
	return FALSE;
}
Exemplo n.º 2
0
BOOL CPreferencesDlg::OnInitDialog() 
{
	CRect rClient;
	GetClientRect(rClient);
	m_sizeCurrent = rClient.Size();
	
	CRect rHost;
	GetDlgItem(IDC_HOSTFRAME)->GetWindowRect(rHost);
	ScreenToClient(rHost);
	rHost.DeflateRect(1, 1);
	
	VERIFY(CreatePPHost(rHost));

	CPreferencesDlgBase::OnInitDialog();
	
	// disable translation of category title because
	// categories will already been translated
	CLocalizer::EnableTranslation(::GetDlgItem(*this, IDC_PAGE_TITLE), FALSE);

	m_tcPages.SetIndent(0);
	CThemed::SetWindowTheme(&m_tcPages, _T("Explorer"));

	// add pages to tree control
	AddPage(&m_pageGen,					IDS_PREF_GEN);
	AddPage(&m_pageMultiUser,			IDS_PREF_MULTIUSER);
	AddPage(&m_pageMultiUser,			IDS_PREF_MULTIUSERFILE,		IDC_TOPOFPAGE);
	AddPage(&m_pageMultiUser,			IDS_PREF_MULTIUSERSS,		IDC_SSCGROUP);
	AddPage(&m_pageFile,				IDS_PREF_FILE,				IDC_TOPOFPAGE);
	AddPage(&m_pageFile,				IDS_PREF_FILELOAD,			IDC_LOADGROUP);
	AddPage(&m_pageFile,				IDS_PREF_FILEARCHIVE,		IDC_ARCHIVEGROUP);
	AddPage(&m_pageFile,				IDS_PREF_FILESWITCH,		IDC_SWITCHGROUP);
	AddPage(&m_pageFile,				IDS_PREF_FILENOTIFY,		IDC_DUEGROUP);
	AddPage(&m_pageFile2,				IDS_PREF_FILEMORE,			IDC_TOPOFPAGE);
	AddPage(&m_pageFile2,				IDS_PREF_FILEBACKUP,		IDC_BACKUPGROUP);
	AddPage(&m_pageFile2,				IDS_PREF_FILESAVE,			IDC_SAVEGROUP);
	AddPage(&m_pageUI,					IDS_PREF_UI,				IDC_TOPOFPAGE);
	AddPage(&m_pageUI,					IDS_PREF_UIFILTERING,		IDC_FILTERGROUP);
	AddPage(&m_pageUI,					IDS_PREF_UISORTING,			IDC_SORTGROUP);
	AddPage(&m_pageUI,					IDS_PREF_UITOOLBAR,			IDC_TOOLBARGROUP);
	AddPage(&m_pageUI,					IDS_PREF_UICOMMENTS,		IDC_COMMENTSGROUP);
	AddPage(&m_pageUI,					IDS_PREF_UITABBAR,			IDC_TABBARGROUP);
	AddPage(&m_pageUIVisibility,		IDS_PREF_UIVISIBILITY);
	AddPage(&m_pageUITasklist,			IDS_PREF_UITASK);
	AddPage(&m_pageUITasklistColors,	IDS_PREF_UITASKCOLOR);
	AddPage(&m_pageTask,				IDS_PREF_TASK,				IDC_TOPOFPAGE);
	AddPage(&m_pageTask,				IDS_PREF_TIMETRACK,			IDC_TRACKGROUP);
	AddPage(&m_pageTask,				IDS_PREF_TASKTIME,			IDC_TIMEGROUP);
	AddPage(&m_pageTaskCalc,			IDS_PREF_TASKCALCS);
	AddPage(&m_pageTaskDef,				IDS_PREF_TASKDEF,			IDC_TOPOFPAGE);
	AddPage(&m_pageTaskDef,				IDS_PREF_TASKDEFATTRIB,		IDC_DEFGROUP);
	AddPage(&m_pageTaskDef,				IDS_PREF_TASKDEFINHERIT,	IDC_INHERITGROUP);
	AddPage(&m_pageTaskDef,				IDS_PREF_TASKDEFLISTS,		IDC_DROPLISTGROUP);
	AddPage(&m_pageExport,				IDS_PREF_EXPORT);
	AddPage(&m_pageTool,				IDS_PREF_TOOLS);
	AddPage(&m_pageShortcuts,			IDS_PREF_SHORTCUT); 
	
	SynchronizeTree();

	GetDlgItem(IDC_APPLY)->EnableWindow(FALSE);

	// fixup icon
	HICON hIcon = GraphicsMisc::LoadIcon(IDI_PREFERENCES_DIALOG_STD);
	SetIcon(hIcon, FALSE);

	m_tcPages.SetFocus();

	return FALSE;  // return TRUE unless you set the focus to a control
}