示例#1
0
LRESULT CHexView::OnCreate (UINT uMsg, 
	WPARAM wParam, LPARAM lParam, BOOL &bHandled) 
{
	m_sizeTotal .cx = (9 + (16 * 3) + 16);
	m_sizeTotal .cx *= g_sizeFixed .cx;
	m_sizeTotal .cy = (m_sRes .GetSize () + 15) / 16;
	m_sizeTotal .cy *= g_sizeFixed .cy;
	SetScrollOffset (0, 0, FALSE);
	SetScrollSize (m_sizeTotal);
	SetScrollLine (g_sizeFixed);

	//
	// Return FALSE
	//

	return false;
}
示例#2
0
/**
 * @param hWnd - handle to the control to receive the default keyboard focus.
 * @param lParam - specifies additional initialization data.
 * @return message result code.
 */
LRESULT CManualModeDlg::OnInitDialog(HWND /*hWnd*/, LPARAM /*lParam*/)
{
	m_txtMapPdbFile.Attach(GetDlgItem(IDC_MAPPDBFILE));
	m_txtMapPdbFile.SetLimitText(MAX_PATH - 1);
	m_txtBaseAddress.Attach(GetDlgItem(IDC_BASEADDRESS), GetDlgItem(IDC_BASEADDRESS_RADIX));
	CNumEdit& txtBaseAddress = m_txtBaseAddress.GetNumEdit();
	txtBaseAddress.SetLimitText(8);
	txtBaseAddress.SetNumFormat(CNumEdit::NF_HEX);
	CNumEdit& txtModuleSize = m_txtModuleSize.GetNumEdit();
	m_txtModuleSize.Attach(GetDlgItem(IDC_MODULESIZE), GetDlgItem(IDC_MODULESIZE_RADIX));
	txtModuleSize.SetLimitText(8);
	txtModuleSize.SetNumFormat(CNumEdit::NF_HEX);
	txtModuleSize.EnableWindow(FALSE);
	CNumEdit& txtCrashAddress = m_txtCrashAddress.GetNumEdit();
	m_txtCrashAddress.Attach(GetDlgItem(IDC_CRASHADDRESS), GetDlgItem(IDC_CRASHADDRESS_RADIX));
	txtCrashAddress.SetLimitText(8);
	txtCrashAddress.SetNumFormat(CNumEdit::NF_HEX);
	m_txtFunctionName.Attach(GetDlgItem(IDC_FUNCTIONNAME));
	m_txtSourceFile.Attach(GetDlgItem(IDC_SOURCEFILE));
	m_txtLineNumber.Attach(GetDlgItem(IDC_LINENUMBER));

	//////////////////////////////////////////////////////////////
	// workaround for WinXP bug when scrollbars are not skinned //
	LONG lStyle = GetWindowLong(GWL_STYLE);                     //
	SetWindowLong(GWL_STYLE, lStyle | WS_HSCROLL | WS_VSCROLL); //
	SetWindowLong(GWL_STYLE, lStyle);                           //
	//////////////////////////////////////////////////////////////

	InitLayout(false, true);
	AddControlsToLayout(g_arrLayout, countof(g_arrLayout));

	CRect rcClient;
	GetClientRect(&rcClient);
	SetScrollSize(rcClient.right, rcClient.bottom);
	DWORD dwDlgUnits = GetDialogBaseUnits();
	int nLineUnit = HIWORD(dwDlgUnits);
	SetScrollLine(nLineUnit, nLineUnit);

	ClearProcessor();
	return TRUE;
}
示例#3
0
void CCxImageCtrl::OnSize(UINT nType, int cx, int cy) 
{
	CWnd::OnSize(nType, cx, cy);
	
	SetScrollSize(cx, cy);
}
/**
 * @param hWnd - handle to the control to receive the default keyboard focus.
 * @param lParam - specifies additional initialization data.
 * @return message result code.
 */
LRESULT CExpressModeDlg::OnInitDialog(HWND /*hWnd*/, LPARAM /*lParam*/)
{
	m_rxFunctionName.assign("([0-9A-Za-z_:]+)\\(.*\\)");

	m_txtLogFile.Attach(GetDlgItem(IDC_LOGFILE));
	m_txtLogFile.SetLimitText(MAX_PATH - 1);
	m_txtMapPdbFolder.Attach(GetDlgItem(IDC_MAPPDBFOLDER));
	m_txtMapPdbFolder.SetLimitText(MAX_PATH - 1);
	m_txtErrorReason.Attach(GetDlgItem(IDC_ERROR_REASON));
	m_lstStackTrace.Attach(GetDlgItem(IDC_STACK_TRACE));
	m_lstStackTrace.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP);

	//////////////////////////////////////////////////////////////
	// workaround for WinXP bug when scrollbars are not skinned //
	LONG lStyle = GetWindowLong(GWL_STYLE);                     //
	SetWindowLong(GWL_STYLE, lStyle | WS_HSCROLL | WS_VSCROLL); //
	SetWindowLong(GWL_STYLE, lStyle);                           //
	//////////////////////////////////////////////////////////////

	InitLayout(false, true);
	AddControlsToLayout(g_arrLayout, countof(g_arrLayout));

	CRect rcClient;
	GetClientRect(&rcClient);
	SetScrollSize(rcClient.right, rcClient.bottom);
	DWORD dwDlgUnits = GetDialogBaseUnits();
	int nLineUnit = HIWORD(dwDlgUnits);
	SetScrollLine(nLineUnit, nLineUnit);

	TCHAR szColumnTitle[64];
	HINSTANCE hInstance = _Module.GetResourceInstance();

	CRect rcList;
	m_lstStackTrace.GetClientRect(&rcList);

	LVCOLUMN lvc;
	ZeroMemory(&lvc, sizeof(lvc));
	lvc.mask = LVCF_TEXT;
	lvc.pszText = szColumnTitle;

	LoadString(hInstance, IDS_COLUMN_ADDRESS, szColumnTitle, countof(szColumnTitle));
	m_lstStackTrace.InsertColumn(CID_ENTRY_ADDRESS, &lvc);
	m_lstStackTrace.SetColumnWidth(CID_ENTRY_ADDRESS, rcList.right / 6);

	LoadString(hInstance, IDS_COLUMN_FUNCTION, szColumnTitle, countof(szColumnTitle));
	m_lstStackTrace.InsertColumn(CID_ENTRY_FUNCTION, &lvc);
	m_lstStackTrace.SetColumnWidth(CID_ENTRY_FUNCTION, rcList.right / 4);

	LoadString(hInstance, IDS_COLUMN_FILE, szColumnTitle, countof(szColumnTitle));
	m_lstStackTrace.InsertColumn(CID_ENTRY_FILE, &lvc);
	m_lstStackTrace.SetColumnWidth(CID_ENTRY_FILE, rcList.right / 4);

	LoadString(hInstance, IDS_COLUMN_LINE, szColumnTitle, countof(szColumnTitle));
	m_lstStackTrace.InsertColumn(CID_ENTRY_LINE, &lvc);
	m_lstStackTrace.SetColumnWidth(CID_ENTRY_LINE, rcList.right / 6);

	LoadString(hInstance, IDS_COLUMN_MODULE, szColumnTitle, countof(szColumnTitle));
	m_lstStackTrace.InsertColumn(CID_ENTRY_MODULE, &lvc);
	m_lstStackTrace.SetColumnWidth(CID_ENTRY_MODULE, rcList.right / 4);

	return TRUE;
}
void CNCaptureView::_SetScrollInfo(float newZoomScale, BOOL bUseCenterPoint)
{
	if (m_pImage && !m_pImage->IsNull())
	{
		BOOL bRet = FALSE;
		CRect rcClient;
		API_VERIFY(GetClientRect(&rcClient));

		//save old ptLogical
		CPoint ptMouseDevice(0, 0);
		API_VERIFY(::GetCursorPos(&ptMouseDevice));
		API_VERIFY(ScreenToClient(&ptMouseDevice));

		if (!rcClient.PtInRect(ptMouseDevice) || bUseCenterPoint)
		{
			ptMouseDevice = rcClient.CenterPoint();
		}

		CPoint ptOldLogical = ptMouseDevice;
		ClientToDoc(&ptOldLogical);
		//ptOldPos.Offset(m_rcDrawTarget.TopLeft());

		SetZoomScale(newZoomScale);

		//FTLTRACE(TEXT("Zoom=%f, image=[%d,%d], sizeAll=[%d,%d]\n"),
		//	s_FixedZoomScales[m_iFixedZoomIndex], m_pImage->GetWidth(), m_pImage->GetHeight(),
		//	(int)((float)m_pImage->GetWidth() * s_FixedZoomScales[m_iFixedZoomIndex]),
		//	(int)((float)m_pImage->GetHeight() * s_FixedZoomScales[m_iFixedZoomIndex]));

		SetScrollSize(m_pImage->GetWidth(), m_pImage->GetHeight(), TRUE, true);

		CPoint ptNewClient = ptOldLogical;

		//ptNewPos.Offset(-m_rcDrawTarget.TopLeft());
		DocToClient(&ptNewClient);
		CPoint ptNewOffset = ptNewClient;
		ptNewOffset.Offset(-ptMouseDevice);
		SetScrollOffset(ptNewOffset.x, ptNewOffset.y);

/*
		if (!GetSelection().empty())
		{
			CTextObject* pTextObject = dynamic_cast<CTextObject*>(GetSelection().front());
			if (pTextObject)
			{
				//SIZEL newExtent = {0};
				//newExtent.cy = (double)pTextObject->GetPosition().Height() * 2540 * newZoomScale * 96;
				//newExtent.cx = (double)pTextObject->GetPosition().Width() * 2540 * newZoomScale * 96;

				pTextObject->GetRichEditPanel()->SetZoom(m_sizeAll.cx, m_sizeLogAll.cx);
				//pTextObject->GetRichEditPanel()->SetExtent(&newExtent, TRUE);
			}
		}
*/
		//FTLTRACE(TEXT("ptMouseDevice=[%d,%d], ptOldLogical=[%d,%d], ptNewClient=[%d,%d], ptNewOffset=[%d,%d]\n"),
		//	ptMouseDevice.x, ptMouseDevice.y, ptOldLogical.x, ptOldLogical.y, ptNewClient.x, ptNewClient.y,
		//	ptNewOffset.x, ptNewOffset.y);

		_UpdateMousePosInfo(ptMouseDevice);
		SetCurrentToolType(CalcCurrentToolType());
		//DrawObjectList& SelectObjects = GetSelection();
		//if (SelectObjects.size() == 1 )
		//{
		//	CDrawObject* pDrawObj = SelectObjects.front();
		//	if (dotSelectRect == pDrawObj->GetDrawObjType())
		//	{
		//		CRect rcDevice = pDrawObj->GetPosition();
		//		DocToClient(&rcDevice);
		//		ScrollToView(rcDevice);
		//	}
		//}
	}
	else //make scrollbar disappear
	{
		SetZoomScale(s_FixedZoomScales[s_NormalZoomIndex]);
		SetScrollSize(1, 1, FALSE, FALSE);
	}
}