Skip to content

Commit

Permalink
Move to shared GDI code in paint background
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfearless committed Sep 15, 2021
1 parent 588fd11 commit dd20260
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions Controls/ModernUI_Checkbox/ModernUI_Checkbox.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1273,26 +1273,11 @@ MUI_ALIGN
;------------------------------------------------------------------------------
_MUI_CheckboxPaintBackground PROC hWin:DWORD, hdc:DWORD, lpRect:DWORD, bEnabledState:DWORD, bMouseOver:DWORD, bSelectedState:DWORD
LOCAL BackColor:DWORD
LOCAL hBrush:DWORD
LOCAL hOldBrush:DWORD
Invoke MUIGetExtProperty, hWin, @CheckboxBackColor
mov BackColor, eax

Invoke GetStockObject, DC_BRUSH
mov hBrush, eax
Invoke SelectObject, hdc, eax
mov hOldBrush, eax
Invoke SetDCBrushColor, hdc, BackColor
Invoke FillRect, hdc, lpRect, hBrush
.IF hOldBrush != 0
Invoke SelectObject, hdc, hOldBrush
Invoke DeleteObject, hOldBrush
.ENDIF
.IF hBrush != 0
Invoke DeleteObject, hBrush
.ENDIF
Invoke MUIGDIPaintFill, hdc, lpRect, BackColor
ret

Expand Down Expand Up @@ -1570,6 +1555,12 @@ _MUI_CheckboxPaintFocusRect PROC PRIVATE hWin:DWORD, hdc:DWORD, lpRect:DWORD, bF
ret
.ENDIF

Invoke GetWindowLong, hWin, GWL_STYLE
and eax, WS_TABSTOP
.IF eax != WS_TABSTOP
ret
.ENDIF

Invoke CopyRect, Addr rect, lpRect
Invoke InflateRect, Addr rect, MUI_CHECKBOX_FOCUSRECT_OFFSET, MUI_CHECKBOX_FOCUSRECT_OFFSET
Invoke DrawFocusRect, hdc, Addr rect
Expand Down
Binary file modified Controls/ModernUI_Checkbox/ModernUI_Checkbox.lib
Binary file not shown.
Binary file modified Controls/ModernUI_Checkbox/ModernUI_Checkbox.rap
Binary file not shown.
Binary file modified Release/ModernUI_Checkbox.zip
Binary file not shown.
Binary file modified Release/ModernUI_Checkbox_Source.zip
Binary file not shown.

0 comments on commit dd20260

Please sign in to comment.