MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / MarginWndProc

Method MarginWndProc

neo/tools/debugger/DebuggerWindow.cpp:375–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373}
374
375LRESULT CALLBACK rvDebuggerWindow::MarginWndProc ( HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam )
376{
377 rvDebuggerWindow* window = (rvDebuggerWindow*) GetWindowLongPtr ( wnd, GWLP_USERDATA );
378
379 switch ( msg )
380 {
381 case WM_RBUTTONDOWN:
382 return SendMessage ( window->mWndScript, WM_RBUTTONDOWN, wparam, lparam );
383
384 case WM_RBUTTONUP:
385 return SendMessage ( window->mWndScript, WM_RBUTTONUP, wparam, lparam );
386
387 case WM_LBUTTONDBLCLK:
388 {
389 int result = SendMessage ( window->mWndScript, WM_LBUTTONDBLCLK, wparam, lparam );
390 window->ToggleBreakpoint ( );
391 return result;
392 }
393
394 case WM_LBUTTONDOWN:
395 {
396 int result = SendMessage ( window->mWndScript, WM_LBUTTONDOWN, wparam, lparam );
397 window->ToggleBreakpoint ( );
398 return result;
399 }
400
401 case WM_LBUTTONUP:
402 return SendMessage ( window->mWndScript, WM_LBUTTONUP, wparam, lparam );
403
404 case WM_PAINT:
405 {
406 HDC dc;
407 float scaling_factor = Win_GetWindowScalingFactor(wnd);
408 int s2 = int(2 * scaling_factor);
409 int s4 = int(4 * scaling_factor);
410 int width,height;
411
412 window->ResizeImageList(width,height);
413
414 PAINTSTRUCT ps;
415 RECT rect;
416 GetClientRect ( wnd, &rect );
417 dc = BeginPaint( wnd, &ps );
418 FillRect( dc, &rect, GetSysColorBrush( COLOR_3DSHADOW ) );
419
420 //draw line nrs
421 int iMaxNumberOfLines = ( (rect.bottom - rect.top ) / height ) + height;
422 int iFirstVisibleLine = SendMessage( window->mWndScript, EM_GETFIRSTVISIBLELINE, 0, 0 );
423 HFONT hf = CreateFont( height, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Courier New" );
424 HFONT hfOld = ( HFONT ) SelectObject( dc, hf );
425 SetBkMode( dc, OPAQUE );
426 // I think it looks nicer when the line number background is white
427 SetBkColor( dc, RGB( 255, 255, 255 ) );
428 SetTextColor( dc, RGB( 0, 0, 255 ) );
429
430 int lnrWidth = 8;
431 GetCharWidth32( dc, '9', '9', &lnrWidth );
432 lnrWidth *= 4; // we want enough width for 4 chars ("9999"), not just one

Callers

nothing calls this directly

Calls 14

ToggleBreakpointMethod · 0.80
ResizeImageListMethod · 0.80
GetBreakpointCountMethod · 0.80
GetBreakpointMethod · 0.80
GetLineNumberMethod · 0.80
IsStoppedMethod · 0.80
GetBreakFilenameMethod · 0.80
GetBreakLineNumberMethod · 0.80
IcmpMethod · 0.60
LengthMethod · 0.45
NumMethod · 0.45

Tested by

no test coverage detected