⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 debugoptionpage.cpp

📁 用bcg库编写的java IDE 源码
💻 CPP
字号:
// DebugOptionPage.cpp : implementation file
//

#include "stdafx.h"
#include "VisualJava.h"
#include "DebugOptionPage.h"
#include "registry.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

#define CPropertyPage CSAPrefsSubDlg

/////////////////////////////////////////////////////////////////////////////
// CDebugOptionPage property page

IMPLEMENT_DYNCREATE(CDebugOptionPage, CPropertyPage)

CDebugOptionPage::CDebugOptionPage(): CSAPrefsSubDlg(CDebugOptionPage::IDD)
{
	//{{AFX_DATA_INIT(CDebugOptionPage)
	m_strAddress = _T("");
	m_bCodeByte = FALSE;
	m_bInvokeCommand = FALSE;
	m_bDisplayUnicode = FALSE;
	m_bFixedWidth = FALSE;
	m_bHexDisplay = FALSE;
	m_bJITdebugging = FALSE;
	m_bOLErpcDebugger = FALSE;
	m_bParamTypes = FALSE;
	m_bParamValue = FALSE;
	m_bReEvaluateExpr = FALSE;
	m_bReturnValue = FALSE;
	m_ShowDataBytes = FALSE;
	m_AnnotateSrc = FALSE;
	m_Symbols = FALSE;
	m_bFloatingPointReg = FALSE;
	//}}AFX_DATA_INIT
}

CDebugOptionPage::~CDebugOptionPage()
{
}

void CDebugOptionPage::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDebugOptionPage)
	DDX_Text(pDX, IDC_ADDRESS_EDIT, m_strAddress);
	DDX_Check(pDX, IDC_CODE_BYTE_CHECK, m_bCodeByte);
	DDX_Check(pDX, IDC_DEBUG_COMMAND_INVOKE_CHECK, m_bInvokeCommand);
	DDX_Check(pDX, IDC_DISPLAY_UNICODE_STRINGS_CHECK, m_bDisplayUnicode);
	DDX_Check(pDX, IDC_FIXED_WIDTH_CHECK, m_bFixedWidth);
	DDX_Check(pDX, IDC_HEX_DISPLAY_CHECK, m_bHexDisplay);
	DDX_Check(pDX, IDC_JUST_IN_TIME_DEBUGGING_CHECK, m_bJITdebugging);
	DDX_Check(pDX, IDC_OLE_RPC_DEBUGGING_CHECK, m_bOLErpcDebugger);
	DDX_Check(pDX, IDC_PARAMETER_TYPES_CHECK, m_bParamTypes);
	DDX_Check(pDX, IDC_PARAMETER_VALUES_CHECK, m_bParamValue);
	DDX_Check(pDX, IDC_RE_EVALUATE_EXPR_CHECK, m_bReEvaluateExpr);
	DDX_Check(pDX, IDC_RETURN_VALUE_CHECK, m_bReturnValue);
	DDX_Check(pDX, IDC_SHOW_DATA_BYTES_CHECK, m_ShowDataBytes);
	DDX_Check(pDX, IDC_SOURCE_ANNOTATION_CHECK, m_AnnotateSrc);
	DDX_Check(pDX, IDC_SYMBOLS_CHECK, m_Symbols);
	DDX_Check(pDX, IDC_VIEW_FLOATING_POINT_REG_CHECK, m_bFloatingPointReg);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDebugOptionPage, CPropertyPage)
	//{{AFX_MSG_MAP(CDebugOptionPage)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDebugOptionPage message handlers

void CDebugOptionPage::LoadSettings()
{
  CReg reg;
  LPCTSTR lszpDebugOpts = _T("Options\\Debug");
  LPCTSTR lszpBase = REGISTRY_ROOT;
  if(reg.Create(HKEY_CURRENT_USER,lszpBase,KEY_READ))
  {
     CReg edtReg;
     if(edtReg.Create(reg.hKey,lszpDebugOpts,KEY_READ))
	 {
        edtReg.LoadNumber(_T ("Hexidecimal display"),(DWORD*)&m_bHexDisplay);
        edtReg.LoadNumber(_T ("Source annotation"),(DWORD*)&m_AnnotateSrc);
        edtReg.LoadNumber(_T ("Code bytes"),(DWORD*)&m_bCodeByte);
        edtReg.LoadNumber(_T ("Symbols"),(DWORD*)&m_Symbols);
        edtReg.LoadNumber(_T ("Parameter Values"),(DWORD*)&m_bParamValue);
        edtReg.LoadNumber(_T ("Parameter types"),(DWORD*)&m_bParamTypes);
        edtReg.LoadString(_T ("Address"),m_strAddress);
        edtReg.LoadNumber(_T ("Format"),(DWORD*)&m_nFormat);
        edtReg.LoadNumber(_T ("re-evaluate expression"),(DWORD*)&m_bReEvaluateExpr);
        edtReg.LoadNumber(_T ("Show data bytes"),(DWORD*)&m_ShowDataBytes);
        edtReg.LoadNumber(_T ("Fixed width"),(DWORD*)&m_bFixedWidth);
        edtReg.LoadNumber(_T ("Display unicode strings"),(DWORD*)&m_bDisplayUnicode);		
		edtReg.LoadNumber(_T ("View floating point register"),(DWORD*)&m_bFloatingPointReg);
		edtReg.LoadNumber(_T ("Just-in-time debugging"),(DWORD*)&m_bJITdebugging);
		edtReg.LoadNumber(_T ("OLE RPC debugging"),(DWORD*)&m_bOLErpcDebugger);
		edtReg.LoadNumber(_T ("Debug commands invoke edit and contunue"),(DWORD*)&m_bInvokeCommand);
		edtReg.Close();
	 }
	 reg.Close();
  }
}


void CDebugOptionPage::SaveSettings()
{
  CReg reg;
  LPCTSTR lszpDebugOpts = _T("Options\\Debug");
  LPCTSTR lszpBase = REGISTRY_ROOT;
  if(reg.Create(HKEY_CURRENT_USER,lszpBase,KEY_WRITE))
  {
     CReg edtReg;
     if(edtReg.Create(reg.hKey,lszpDebugOpts,KEY_WRITE))
	 {
        VERIFY(edtReg.SaveNumber(_T ("Hexidecimal display"),m_bHexDisplay));
        VERIFY(edtReg.SaveNumber(_T ("Source annotation"),m_AnnotateSrc));
        VERIFY(edtReg.SaveNumber(_T ("Code bytes"),m_bCodeByte));
        VERIFY(edtReg.SaveNumber(_T ("Symbols"),m_Symbols));
        VERIFY(edtReg.SaveNumber(_T ("Parameter Values"),m_bParamValue));
        VERIFY(edtReg.SaveNumber(_T ("Parameter types"),m_bParamTypes));
        VERIFY(edtReg.SaveString(_T ("Address"),m_strAddress));
        VERIFY(edtReg.SaveNumber(_T ("Format"),m_nFormat));
        VERIFY(edtReg.SaveNumber(_T ("re-evaluate expression"),m_bReEvaluateExpr));
        VERIFY(edtReg.SaveNumber(_T ("Show data bytes"),m_ShowDataBytes));
        VERIFY(edtReg.SaveNumber(_T ("Fixed width"),m_bFixedWidth));
        VERIFY(edtReg.SaveNumber(_T ("Display unicode strings"),m_bDisplayUnicode));		
		VERIFY(edtReg.SaveNumber(_T ("View floating point register"),m_bFloatingPointReg));
		VERIFY(edtReg.SaveNumber(_T ("Just-in-time debugging"),m_bJITdebugging));
		VERIFY(edtReg.SaveNumber(_T ("OLE RPC debugging"),m_bOLErpcDebugger));
		VERIFY(edtReg.SaveNumber(_T ("Debug commands invoke edit and contunue"),m_bInvokeCommand));
		edtReg.Close();
	 }
	 reg.Close();
  }
}

BOOL CDebugOptionPage::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
    m_nFormat = 0;
	LoadSettings();
	UpdateData(FALSE);		
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDebugOptionPage::OnOK() 
{
	UpdateData();
    SaveSettings();		
	CPropertyPage::OnOK();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -