@@ -505,41 +505,45 @@ void XPopupMenuItem::DrawItemCheckBox(const LPDRAWITEMSTRUCT lpdis, const XPMENU
505505 if ((!hBrush) || (!hPenBorder) || (!hPenText))
506506 return ;
507507
508- const auto hOldBrush = SelectObject (lpdis->hDC , hBrush);
509- Auto (SelectObject (lpdis->hDC , hOldBrush));
510-
511- const auto hOldPen = SelectObject (lpdis->hDC , hPenBorder);
512- Auto (SelectObject (lpdis->hDC , hOldPen));
513-
514508 RECT rc = lpdis->rcItem ;
515509
516- InflateRect (&rc, 0 , -1 );
517- rc.left += 1 ;
518- rc.right = rc.left + rc.bottom - rc.top ;
510+ const auto hOldBrush = SelectObject (lpdis->hDC , hBrush);
511+ Auto (SelectObject (lpdis->hDC , hOldBrush));
519512
520- // RoundRect( lpdis->hDC, rc.left, rc.top, rc.right, rc.bottom, 5, 5 );
521- Rectangle (lpdis->hDC , rc.left , rc.top , rc.right , rc.bottom );
513+ {
514+ /* const auto hOldPen =*/ SelectObject (lpdis->hDC , hPenBorder);
515+ // Auto(SelectObject(lpdis->hDC, hOldPen));
522516
523- const auto hOldPenTxt = SelectObject (lpdis->hDC , hPenText);
524- Auto (SelectObject (lpdis->hDC , hOldPenTxt));
517+ InflateRect (&rc, 0 , -1 );
518+ rc.left += 1 ;
519+ rc.right = rc.left + rc.bottom - rc.top ;
525520
526- const auto x = (rc.right + rc.left ) / 2 - 3 ;
527- const auto y = (rc.bottom + rc.top ) / 2 - 3 ;
521+ // RoundRect( lpdis->hDC, rc.left, rc.top, rc.right, rc.bottom, 5, 5 );
522+ Rectangle (lpdis->hDC , rc.left , rc.top , rc.right , rc.bottom );
523+ }
528524
529- MoveToEx (lpdis->hDC , x, y + 2 , nullptr );
530- LineTo (lpdis->hDC , x, y + 5 );
531- MoveToEx (lpdis->hDC , x + 1 , y + 3 , nullptr );
532- LineTo (lpdis->hDC , x + 1 , y + 6 );
533- MoveToEx (lpdis->hDC , x + 2 , y + 4 , nullptr );
534- LineTo (lpdis->hDC , x + 2 , y + 7 );
535- MoveToEx (lpdis->hDC , x + 3 , y + 3 , nullptr );
536- LineTo (lpdis->hDC , x + 3 , y + 6 );
537- MoveToEx (lpdis->hDC , x + 4 , y + 2 , nullptr );
538- LineTo (lpdis->hDC , x + 4 , y + 5 );
539- MoveToEx (lpdis->hDC , x + 5 , y + 1 , nullptr );
540- LineTo (lpdis->hDC , x + 5 , y + 4 );
541- MoveToEx (lpdis->hDC , x + 6 , y, nullptr );
542- LineTo (lpdis->hDC , x + 6 , y + 3 );
525+ {
526+ const auto hOldPenTxt = SelectObject (lpdis->hDC , hPenText);
527+ Auto (SelectObject (lpdis->hDC , hOldPenTxt));
528+
529+ const auto x = (rc.right + rc.left ) / 2 - 3 ;
530+ const auto y = (rc.bottom + rc.top ) / 2 - 3 ;
531+
532+ MoveToEx (lpdis->hDC , x, y + 2 , nullptr );
533+ LineTo (lpdis->hDC , x, y + 5 );
534+ MoveToEx (lpdis->hDC , x + 1 , y + 3 , nullptr );
535+ LineTo (lpdis->hDC , x + 1 , y + 6 );
536+ MoveToEx (lpdis->hDC , x + 2 , y + 4 , nullptr );
537+ LineTo (lpdis->hDC , x + 2 , y + 7 );
538+ MoveToEx (lpdis->hDC , x + 3 , y + 3 , nullptr );
539+ LineTo (lpdis->hDC , x + 3 , y + 6 );
540+ MoveToEx (lpdis->hDC , x + 4 , y + 2 , nullptr );
541+ LineTo (lpdis->hDC , x + 4 , y + 5 );
542+ MoveToEx (lpdis->hDC , x + 5 , y + 1 , nullptr );
543+ LineTo (lpdis->hDC , x + 5 , y + 4 );
544+ MoveToEx (lpdis->hDC , x + 6 , y, nullptr );
545+ LineTo (lpdis->hDC , x + 6 , y + 3 );
546+ }
543547}
544548
545549/* !
0 commit comments