Пример #1
0
CMainWindow::CMainWindow()
: CDialog(MAKEINTRESOURCE(IDD_MAINWINDOW))
{
	CAppConfig::GetInstance().RegisterPreferenceInteger(PREF_MAINWINDOW_RECT_LEFT, 0);
	CAppConfig::GetInstance().RegisterPreferenceInteger(PREF_MAINWINDOW_RECT_TOP, 0);
	CAppConfig::GetInstance().RegisterPreferenceInteger(PREF_MAINWINDOW_RECT_RIGHT, 0);
	CAppConfig::GetInstance().RegisterPreferenceInteger(PREF_MAINWINDOW_RECT_BOTTOM, 0);
	CAppConfig::GetInstance().RegisterPreferenceBoolean(PREF_MAINWINDOW_MAXIMIZED, true);

	SetClassPtr();
	m_tabs = Framework::Win32::CTab(GetItem(IDC_MAINWINDOW_TABS));

	{
		int smallIconSizeX = GetSystemMetrics(SM_CXSMICON);
		int smallIconSizeY = GetSystemMetrics(SM_CYSMICON);
		int bigIconSizeX = GetSystemMetrics(SM_CXICON);
		int bigIconSizeY = GetSystemMetrics(SM_CYICON);

		HICON smallIcon = reinterpret_cast<HICON>(LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, smallIconSizeX, smallIconSizeY, 0));
		HICON bigIcon = reinterpret_cast<HICON>(LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, bigIconSizeX, bigIconSizeY, 0));

		SetIcon(ICON_SMALL, smallIcon);
		SetIcon(ICON_BIG, bigIcon);
	}

	ShowWelcomePage();

	LoadWindowRect();

	m_accelerators = LoadAccelerators(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_MAINWINDOW_ACCELERATORS));
}
Пример #2
0
// NOTE: this must be called after setting the layout
//       to have the view and its controls displayed properly
BOOL CResizableMDIChild::EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly)
{
	m_sSection = pszSection;

	m_bEnableSaveRestore = TRUE;
	m_bRectOnly = bRectOnly;

	// restore immediately
	return LoadWindowRect(pszSection, bRectOnly);
}
Пример #3
0
// NOTE: this must be called after setting the layout
//       to have the dialog and its controls displayed properly
void CResizableDialog::EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly)
{
	m_sSection = pszSection;

	m_bEnableSaveRestore = TRUE;
	m_bRectOnly = bRectOnly;

	// restore immediately
	LoadWindowRect(pszSection, bRectOnly);
}
Пример #4
0
// NOTE: this must be called after all the other settings
//       to have the dialog and its controls displayed properly
void CResizableSheet::EnableSaveRestore(LPCTSTR pszSection, LPCTSTR pszEntry, BOOL bWithPage)
{
	m_sSection = pszSection;
	m_sEntry = pszEntry;
	m_bSavePage = bWithPage;

	m_bEnableSaveRestore = TRUE;

	LoadWindowRect();
}
Пример #5
0
// NOTE: this must be called after setting the layout
//       to have the view and its controls displayed properly
BOOL CResizableMDIFrame::EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly, BOOL bHorzResize, BOOL bVertResize)
{
	m_sSection = pszSection;

	m_bEnableSaveRestore = TRUE;
	m_bRectOnly = bRectOnly;

	// restore immediately
	return LoadWindowRect(pszSection, bRectOnly, bHorzResize, bVertResize);
}
Пример #6
0
// NOTE: this must be called after all the other settings
//       to have the window and its controls displayed properly
void CResizableSheet::EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly, BOOL bWithPage)
{
	m_sSection = pszSection;
	m_bSavePage = bWithPage;

	m_bEnableSaveRestore = TRUE;
	m_bRectOnly = bRectOnly;

	// restore immediately
	LoadWindowRect(pszSection, bRectOnly);
	LoadPage();
}
Пример #7
0
// NOTE: this must be called after all the other settings
//       to have the dialog and its controls displayed properly
void CExtResizableDialog::EnableSaveRestore(
		LPCTSTR pszSection,
		LPCTSTR pszEntry,
		bool bForceHideWindow // = false
		)
{
	m_sSection = pszSection;
	m_sEntry = pszEntry;

	m_bEnableSaveRestore = TRUE;

	LoadWindowRect( bForceHideWindow );
}
Пример #8
0
// NOTE: this must be called after setting the layout
//       to have the dialog and its controls displayed properly
void CResizableDialog::EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly)
{
    m_sSection = pszSection;

    m_bEnableSaveRestore = TRUE;
    m_bRectOnly = bRectOnly;

    // restore immediately
    LoadWindowRect(pszSection, bRectOnly);

    CMenu* pMenu = GetMenu();
    if ( pMenu )
        DrawMenuBar();
}
Пример #9
0
// NOTE: this must be called after all the other settings
//       to have the window and its controls displayed properly
void CResizableSheet::EnableSaveRestore(LPCTSTR pszSection, BOOL bRectOnly, BOOL bWithPage)
{
	m_sSection = pszSection;
	m_bSavePage = bWithPage;

	m_bEnableSaveRestore = TRUE;
	m_bRectOnly = bRectOnly;

	// restore immediately
	LoadWindowRect(pszSection, bRectOnly);
	{
		LoadPage(pszSection);
		ArrangeLayout();	// needs refresh
	}
}