- Fix some indentation problems.

- Handle correctly the alignement of the checkboxes if the
  BS_TOP/BS_BOTTOM flags are set.
This commit is contained in:
Maxime Bellengé 2003-04-30 23:57:43 +00:00 committed by Alexandre Julliard
parent 812b4f46e9
commit 7ba2a371d3
1 changed files with 57 additions and 38 deletions

View File

@ -862,6 +862,12 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
rbox.right = checkBoxWidth;
}
/* Draw label */
client = rtext;
dtFlags = BUTTON_CalcLabelRect(hwnd, hDC, &rtext);
rbox.top = rtext.top;
rbox.bottom = rtext.bottom;
/* Draw the check-box bitmap */
if (action == ODA_DRAWENTIRE || action == ODA_SELECT)
{
@ -911,27 +917,40 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
/* rbox must have the correct height */
delta = rbox.bottom - rbox.top - checkBoxHeight;
if (style & BS_TOP) {
if (delta > 0) {
rbox.bottom = rbox.top + checkBoxHeight;
} else {
rbox.top -= -delta/2 + 1;
rbox.bottom += rbox.top + checkBoxHeight;
}
} else if (style & BS_BOTTOM) {
if (delta > 0) {
rbox.top = rbox.bottom - checkBoxHeight;
} else {
rbox.bottom += -delta/2 + 1;
rbox.top = rbox.bottom -= checkBoxHeight;
}
} else { /* Default */
if (delta > 0)
{
int ofs = (abs(delta) / 2);
int ofs = (delta / 2);
rbox.bottom -= ofs + 1;
rbox.top = rbox.bottom - checkBoxHeight;
}
else if (delta < 0)
{
int ofs = (abs(delta) / 2);
int ofs = (-delta / 2);
rbox.top -= ofs + 1;
rbox.bottom = rbox.top + checkBoxHeight;
}
}
DrawFrameControl( hDC, &rbox, DFC_BUTTON, flags );
}
}
/* Draw label */
client = rtext;
dtFlags = BUTTON_CalcLabelRect(hwnd, hDC, &rtext);
if (dtFlags == (UINT)-1L) /* Noting to draw */
return;
hRgn = CreateRectRgn(client.left, client.top, client.right, client.bottom);