Пример #1
0
void CMainWindow::LoadWindowRect()
{
	Framework::Win32::CRect windowRect(0, 0, 0, 0);
	windowRect.SetLeft(CAppConfig::GetInstance().GetPreferenceInteger(PREF_MAINWINDOW_RECT_LEFT));
	windowRect.SetTop(CAppConfig::GetInstance().GetPreferenceInteger(PREF_MAINWINDOW_RECT_TOP));
	windowRect.SetRight(CAppConfig::GetInstance().GetPreferenceInteger(PREF_MAINWINDOW_RECT_RIGHT));
	windowRect.SetBottom(CAppConfig::GetInstance().GetPreferenceInteger(PREF_MAINWINDOW_RECT_BOTTOM));
	bool maximized = CAppConfig::GetInstance().GetPreferenceBoolean(PREF_MAINWINDOW_MAXIMIZED);
	if(windowRect.Width() != 0 && windowRect.Height() != 0)
	{
		SetSizePosition(windowRect);
	}
	Show(maximized ? SW_SHOWMAXIMIZED : SW_SHOW);
}
Пример #2
0
CPixelBufferView::CPixelBufferView(HWND parent, const RECT& rect)
: CDirectXControl(parent)
, m_zoomFactor(1)
, m_panX(0)
, m_panY(0)
, m_dragging(false)
, m_dragBaseX(0)
, m_dragBaseY(0)
, m_panXDragBase(0)
, m_panYDragBase(0)
{
	m_overlay = std::make_unique<CPixelBufferViewOverlay>(m_hWnd);

	m_checkerboardEffect = CreateEffectFromResource(MAKEINTRESOURCE(IDR_CHECKERBOARD_SHADER));
	m_pixelBufferViewEffect = CreateEffectFromResource(MAKEINTRESOURCE(IDR_PIXELBUFFERVIEW_SHADER));
	SetSizePosition(rect);
}
//-----------
// MsgCreate \
//---------------------------------------------------------------------------
// Event:		WM_CREATE
// Cause:		Issued by OS when window is created
// Description:	This method gets called when the window is initially created.
//				It initializes all of the visual aspects of the class.
//
void *C_WINDOW_MAIN::MsgCreate( void *mp1, void *mp2 )
{
	char	szX[10];
	char	szY[10];


	// Create a status bar to display miscellaneous data
	pxcStatus = (C_STATUS *) new C_STATUS( this );

	// Create a toolbar control
	pxcTBar = (C_TOOLBAR_TOP *)new C_TOOLBAR_TOP( this, pxcStatus );

	// Keep track of the main menu so we can enable/disable items
	pxcMenu = (C_MENU *)new C_MENU( this );

	// Load parameters out of the INI file
	C_INI_USER xcIni( "BookNews" );
	xcIni.Open();
	xcIni.Read( "MainX", szX, "0", 10 );
	xcIni.Read( "MainY", szY, "0", 10 );
	xcIni.Close();

	// Make the window look like a control panel
	SetSizePosition( atoi( szX ), atoi( szY ), xcApp.DesktopWidth() / 10 * 4,
				xcApp.DialogBorderHeight() * 2 + xcApp.TitleBarHeight() +
													xcApp.MenuHeight() + 65 );

	// Make the window visible
	Show();

	// Disable menu options so the user can't select information
	// until we're connected
	pxcMenu->DisableItem( DM_WINDOWS );

	// Disable the toolbar buttons until we're connected
	pxcTBar->ButtonEnable( DB_WND_GRP, FALSE );
	pxcTBar->ButtonEnable( DB_WND_SUB, FALSE );

	// Begin a thread to open all of the news connections
	xcConnectThread.Create( ConnectThread, 40000, this );

	return FALSE;
}