2006-06-15 04:19:30 +00:00
|
|
|
#ifndef _MEMORYVIEW_H_
|
|
|
|
#define _MEMORYVIEW_H_
|
|
|
|
|
|
|
|
#include "Types.h"
|
|
|
|
#include "win32/CustomDrawn.h"
|
2007-02-28 20:20:18 +00:00
|
|
|
#include "win32/DeviceContext.h"
|
|
|
|
#include <boost/signal.hpp>
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2007-03-03 19:24:42 +00:00
|
|
|
class CMemoryView : public Framework::Win32::CCustomDrawn
|
2006-06-15 04:19:30 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-02-28 20:20:18 +00:00
|
|
|
CMemoryView(HWND, RECT*);
|
|
|
|
virtual ~CMemoryView();
|
|
|
|
void SetMemorySize(uint32);
|
|
|
|
void ScrollToAddress(uint32);
|
2007-02-28 20:51:06 +00:00
|
|
|
uint32 GetSelection();
|
2007-02-28 20:20:18 +00:00
|
|
|
|
|
|
|
boost::signal<void (uint32)> m_OnSelectionChange;
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
protected:
|
2007-02-28 20:20:18 +00:00
|
|
|
virtual uint8 GetByte(uint32) = 0;
|
|
|
|
virtual HFONT GetFont();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2007-02-28 20:20:18 +00:00
|
|
|
void Paint(HDC);
|
|
|
|
long OnSize(unsigned int, unsigned int, unsigned int);
|
|
|
|
long OnVScroll(unsigned int, unsigned int);
|
|
|
|
long OnSetFocus();
|
|
|
|
long OnKillFocus();
|
|
|
|
long OnMouseWheel(short);
|
|
|
|
long OnLeftButtonDown(int, int);
|
|
|
|
long OnLeftButtonUp(int, int);
|
|
|
|
long OnKeyDown(unsigned int);
|
2007-02-28 20:51:06 +00:00
|
|
|
void SetSelectionStart(unsigned int);
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
private:
|
2007-02-28 20:20:18 +00:00
|
|
|
void GetVisibleRowsCols(unsigned int*, unsigned int*);
|
|
|
|
void UpdateScrollRange();
|
|
|
|
unsigned int GetScrollOffset();
|
|
|
|
unsigned int GetScrollThumbPosition();
|
|
|
|
void UpdateCaretPosition();
|
|
|
|
void GetRenderParams(const SIZE&, unsigned int&, unsigned int&, uint32&);
|
|
|
|
|
|
|
|
uint32 m_nSelectionStart;
|
|
|
|
uint32 m_nSize;
|
|
|
|
unsigned int m_nPos;
|
2006-06-15 04:19:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|