1 // BarWnd.cpp : implementation file
5 #include "nel_launcher.h"
11 static char THIS_FILE
[] = __FILE__
;
24 /////////////////////////////////////////////////////////////////////////////
38 BEGIN_MESSAGE_MAP(CBarWnd
, CWnd
)
39 //{{AFX_MSG_MAP(CBarWnd)
45 /////////////////////////////////////////////////////////////////////////////
46 // CBarWnd message handlers
48 void CBarWnd::OnPaint()
50 CPaintDC
dc(this); // device context for painting
56 if(r
.Width() == 0 || m_iRange
== 0)
59 int iWidth
= m_iPos
* r
.Width() / m_iRange
;
63 for(int i
= 0; i
< iWidth
; i
++)
65 iRatio
= double(i
) / double(r
.Width());
66 iR
= int(iRatio
* (R2
- R1
) + R1
);
67 iG
= int(iRatio
* (G2
- G1
) + G1
);
68 iB
= int(iRatio
* (B2
- B1
) + B1
);
70 dc
.FillSolidRect(i
+1, 0, 1, r
.Height(), RGB(iR
/1.5, iG
/1.5, iB
/1.5));
73 dc
.FillSolidRect(i
+1, 0, 1, r
.Height(), RGB(iR
, iG
, iB
));
74 dc
.SetPixelV(i
+1, 0, RGB(iR
/1.5, iG
/1.5, iB
/1.5));
75 dc
.SetPixelV(i
+1, 1, RGB(iR
/1.5, iG
/1.5, iB
/1.5));
78 dc
.FillSolidRect(iWidth
+1, 0, r
.Width() - iWidth
-2, r
.Height(), RGB(0, 32, 0));
81 void CBarWnd::SetRange(int iRange
)
86 void CBarWnd::UpdatePos(int iPos
)