VOID CDUIIconTextItem::PaintBkgnd(HDC dc) { RECT rtBK = GetBKRect(); BOOL bFill(FALSE); CARGB clrBK; CRefPtr<CDUIFrameBK> pFrameBK; if(GetStatus() & CONTROL_STATUS_HOVER) { pFrameBK = GetHoverFrameBK(); bFill = TRUE; } if(m_bSelect) { pFrameBK = GetSelectFrameBK(); bFill = TRUE; } if(bFill && !pFrameBK.IsNull() && !pFrameBK->IsEmpty()) { pFrameBK->DrawBK(dc, rtBK); } }
int test3 (void) { struct tagbstring t = bsStatic ("Hello world"); bstring b; int ret = 0; printf ("TEST: bFill function.\n"); ret += 0 <= bFill (&t, 'x', 7); ret += 0 > bFill (b = bstrcpy (&t), 'x', 7); ret += 0 >= biseqcstr (b, "xxxxxxx"); ret += 0 <= bFill (b, 'x', -1); ret += 0 > bFill (b, 'x', 0); ret += 0 >= biseqcstr (b, ""); bdestroy (b); printf ("\t# failures: %d\n", ret); return ret; }
END_TEST START_TEST(core_003) { struct tagbstring t = bsStatic("Hello world"); bstring b; int ret = 0; ret = bFill(&t, 'x', 7); ck_assert_int_eq(ret, BSTR_ERR); b = bstrcpy(&t); ck_assert(b != NULL); ret = bFill(b, 'x', 7); ck_assert_int_eq(ret, 0); ret = biseqcstr(b, "xxxxxxx"); ck_assert_int_eq(ret, 1); ret = bFill(b, 'x', -1); ck_assert(ret < 0); ret = bFill(b, 'x', 0); ck_assert_int_eq(ret, 0); ret = biseqcstr(b, ""); ck_assert_int_eq(ret, 1); ret = bdestroy(b); ck_assert_int_eq(ret, BSTR_OK); }