本文整理汇总了C++中CtrlMemView::setMode方法的典型用法代码示例。如果您正苦于以下问题:C++ CtrlMemView::setMode方法的具体用法?C++ CtrlMemView::setMode怎么用?C++ CtrlMemView::setMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CtrlMemView
的用法示例。
在下文中一共展示了CtrlMemView::setMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DlgProc
BOOL CMemoryDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_COMMAND:
{
CtrlMemView *mv = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_MEMVIEW));
switch (LOWORD(wParam))
{
case IDC_REGIONS:
switch (HIWORD(wParam))
{
case LBN_DBLCLK:
{
HWND lb = GetDlgItem(m_hDlg,LOWORD(wParam));
int n = ComboBox_GetCurSel(lb);
if (n!=-1)
{
unsigned int addr = (unsigned int)ComboBox_GetItemData(lb,n);
mv->gotoAddr(addr);
}
}
break;
};
break;
case IDC_SYMBOLS:
switch (HIWORD(wParam))
{
case LBN_DBLCLK:
{
HWND lb = GetDlgItem(m_hDlg,LOWORD(wParam));
int n = ListBox_GetCurSel(lb);
if (n!=-1)
{
unsigned int addr = (unsigned int)ListBox_GetItemData(lb,n);
mv->gotoAddr(addr);
}
}
break;
};
break;
case IDC_MODENORMAL:
mv->setMode(MV_NORMAL);
break;
case IDC_MODESYMBOLS:
mv->setMode(MV_NORMAL);
// mv->setMode(MV_SYMBOLS);
break;
}
}
break;
case WM_DEB_MAPLOADED:
NotifyMapLoaded();
break;
case WM_DEB_GOTOADDRESSEDIT:
{
CtrlMemView *mv = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_MEMVIEW));
char temp[256];
u32 addr;
GetWindowText(GetDlgItem(m_hDlg,IDC_ADDRESS),temp,255);
if (parseExpression(temp,cpu,addr) == false)
{
displayExpressionError(m_hDlg);
} else {
mv->gotoAddr(addr);
SetFocus(GetDlgItem(m_hDlg,IDC_MEMVIEW));
}
break;
}
case WM_INITDIALOG:
{
return TRUE;
}
break;
case WM_SIZE:
Size();
break;
case WM_CLOSE:
Show(false);
break;
}
return FALSE;
}
示例2: wndProc
LRESULT CALLBACK CtrlMemView::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CtrlMemView *ccp = CtrlMemView::getFrom(hwnd);
static bool lmbDown=false,rmbDown=false;
switch(msg)
{
case WM_COMMAND:
/* switch(LOWORD(wParam))
{
case ID_MEMVIEW_DUMP:
MessageBox(hwnd,"This feature has not been implemented.","Sorry",0);
break;
case ID_MEMVIEW_GOTOINDISASM:
CDisasm::Goto(ccp->selection);
break;
case ID_MEMVIEW_ADDMEMORYBREAKPOINT:
{
#ifdef LOGGING
CMemChecksDlg::Show(true);
TMemCheck mc;
_u32 addr = ccp->getSelection();
int fun = Debugger_GetSymbolNum(addr);
int st,end;
if (fun!=-1)
{
st = Debugger_GetSymbolAddr(fun);
end = st + Debugger_GetSymbolSize(fun)-4;
if (end<st) end=st; //for smaller than 4 bytes symbols
}
else
{
st=addr;
end=addr;
}
mc.iStartAddress = st;
mc.iEndAddress = end;
mc.bRange=(end-st)>4;
mc.bBreak=true;
mc.bLog=true;
mc.bOnRead=true;
mc.bOnWrite=true;
CMemChecksDlg::AddNewCheck(mc);
#else
MessageBox(hwnd,"This build does not support this feature.","Speed build restrictions",0);
#endif
}
break;
case ID_MEMVIEW_COPYVALUE:
{
char temp[24];
sprintf(temp,"%08x",CMemory::ReadUnchecked_U32(ccp->selection));
CopyTextToClipboard(hwnd,temp);
}
break;
}*/
break;
case WM_NCCREATE:
// Allocate a new CustCtrl structure for this window.
ccp = new CtrlMemView(hwnd);
ccp->setDebugger(&di);
ccp->setMode(MV_NORMAL);
// Continue with window creation.
return ccp != NULL;
// Clean up when the window is destroyed.
case WM_NCDESTROY:
delete ccp;
break;
case WM_SETFONT:
break;
case WM_SIZE:
ccp->redraw();
break;
case WM_PAINT:
ccp->onPaint(wParam,lParam);
break;
case WM_VSCROLL:
ccp->onVScroll(wParam,lParam);
break;
case WM_ERASEBKGND:
return FALSE;
case WM_KEYDOWN:
ccp->onKeyDown(wParam,lParam);
break;
case WM_LBUTTONDOWN: SetFocus(hwnd); lmbDown=true; ccp->onMouseDown(wParam,lParam,1); break;
case WM_RBUTTONDOWN: rmbDown=true; ccp->onMouseDown(wParam,lParam,2); break;
case WM_MOUSEMOVE: ccp->onMouseMove(wParam,lParam,(lmbDown?1:0) | (rmbDown?2:0)); break;
case WM_LBUTTONUP: lmbDown=false; ccp->onMouseUp(wParam,lParam,1); break;
case WM_RBUTTONUP: rmbDown=false; ccp->onMouseUp(wParam,lParam,2); break;
case WM_SETFOCUS:
SetFocus(hwnd);
ccp->hasFocus=true;
ccp->redraw();
break;
case WM_KILLFOCUS:
ccp->hasFocus=false;
ccp->redraw();
//.........这里部分代码省略.........