void draw_menu HDC hdc RECT 10 10 100 500 if mitem sel getItem true do

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
void draw_menu(HDC hdc)
{
RECT r = {10, 10, 100, 500};
if (mitem* t = m[sel].getItem (true))
do switch (t->type)
{
case MBUTTON:
if (m[sel].isItemSelected(t))
r.top += (long) (DrawText (
hdc, t->caption(), -1, &r, DT_SINGLELINE | DT_RIGHT)*1.1);
else
r.top += (long) (DrawText (
hdc, t->caption(), -1, &r, DT_SINGLELINE)*1.1);
break;
case MSEPARATOR:
r.top += ((mseparator* ) t->data)->length;
break;
}
while (t = m[sel].getItem ());
}