win32: try calculating debugger font height
This commit is contained in:
parent
1f57d295cb
commit
1c509ed632
|
@ -1240,7 +1240,7 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
int height = rectDisassembly.bottom-rectDisassembly.top;
|
int height = rectDisassembly.bottom-rectDisassembly.top;
|
||||||
tmp = mouse_y - 12;
|
tmp = mouse_y - 12;
|
||||||
if(tmp > height) setString = false;
|
if(tmp > height) setString = false;
|
||||||
tmp /= 12;
|
tmp /= debugSystem->fixedFontHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(setString)
|
if(setString)
|
||||||
|
@ -1592,6 +1592,17 @@ DebugSystem::DebugSystem()
|
||||||
ANSI_CHARSET,OUT_DEVICE_PRECIS,CLIP_MASK, /*charset, precision, clipping*/
|
ANSI_CHARSET,OUT_DEVICE_PRECIS,CLIP_MASK, /*charset, precision, clipping*/
|
||||||
DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/
|
DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/
|
||||||
"Courier"); /*font name*/
|
"Courier"); /*font name*/
|
||||||
|
|
||||||
|
HDC hdc = GetDC(GetDesktopWindow());
|
||||||
|
HGDIOBJ old = SelectObject(hdc,hFixedFont);
|
||||||
|
TEXTMETRIC tm;
|
||||||
|
GetTextMetrics(hdc,&tm);
|
||||||
|
fixedFontHeight = tm.tmHeight;
|
||||||
|
fixedFontWidth = tm.tmAveCharWidth;
|
||||||
|
printf("fixed font height: %d\n",fixedFontHeight);
|
||||||
|
printf("fixed font width: %d\n",fixedFontWidth);
|
||||||
|
SelectObject(hdc,old);
|
||||||
|
DeleteDC(hdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugSystem::~DebugSystem()
|
DebugSystem::~DebugSystem()
|
||||||
|
|
|
@ -43,8 +43,8 @@ public:
|
||||||
~DebugSystem();
|
~DebugSystem();
|
||||||
|
|
||||||
HFONT hFixedFont;
|
HFONT hFixedFont;
|
||||||
static const int fixedFontWidth = 8;
|
int fixedFontWidth;
|
||||||
static const int fixedFontHeight = 13;
|
int fixedFontHeight;
|
||||||
} *debugSystem;
|
} *debugSystem;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue