Element Panel BaseElements include 'Win.inc' EndBase Vars Self#.BorderWidth db ? Self#.BevelInner db ? Self#.BevelOuter db ? Self#.BevelWidth db ? GlobalProc proc Panel.Draw hdc locals r RECT c1 dd ? c2 dd ? c3 dd ? endl mov eax,[pPanel.Color] or eax,eax jns @f and eax,0FFh invoke GetSysColor,eax @@: mov [c3],eax lea eax,[r] invoke GetClientRect,[pPanel.hwnd],eax mov cl,[pPanel.BevelWidth] mov al,[pPanel.BevelOuter] call .drawbevel mov cl,[pPanel.BorderWidth] mov al,3 call .drawbevel mov cl,[pPanel.BevelWidth] mov al,[pPanel.BevelInner] call .drawbevel lea eax,[r] invoke FillRect,[hdc],eax,[pPanel.hbrush] ret .drawbevel: and ecx,0FFh jcxz .draw3 or al,al je .draw3 cmp al,1 jne .drawb0 mov [c1],808080h mov [c2],0FFFFFFh jmp .drawb2 .drawb0: cmp al,2 jne .drawb1 mov [c1],0FFFFFFh mov [c2],808080h jmp .drawb2 .drawb1: mov eax,[c3] mov [c1],eax mov [c2],eax .drawb2: push ecx stdcall Draw3DRect,[hdc],[r.left],[r.top],[r.right],[r.bottom],[c1],[c2] inc [r.left] inc [r.top] dec [r.right] dec [r.bottom] pop ecx loop .drawb2 .draw3: retn endp Create i = Self#.prop.BorderWidth if Self#.prop.BevelInner > 0 i = i + Self#.prop.BevelWidth end if if Self#.prop.BevelOuter > 0 i = i + Self#.prop.BevelWidth end if mov [Self#.Border],i*1010101h mov dword [Self#.BorderWidth],Self#.prop.BorderWidth+(Self#.prop.BevelInner shl 8)+(Self#.prop.BevelOuter shl 16)+(Self#.prop.BevelWidth shl 24) NewControl Self,Parent,window_class,Self#.prop.Caption,WS_CLIPCHILDREN PostInit stdcall AlignChildWindows,[Self#.hwnd] MessageMap cmp [wmsg],WM_ERASEBKGND jne @f stdcall Panel.Draw,[wparam] jmp Self#.finish @@: Destroy DestroyControl Self,Parent EndElement