Skip to content

Commit 1ace82f

Browse files
committed
初始代码
1 parent ca6b6e4 commit 1ace82f

File tree

2,195 files changed

+691684
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,195 files changed

+691684
-0
lines changed

3DPreviewControl.cpp

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#include "stdafx.h"
2+
#include "eMule.h"
3+
#include "3DPreviewControl.h"
4+
5+
#ifdef _DEBUG
6+
#define new DEBUG_NEW
7+
#undef THIS_FILE
8+
static char THIS_FILE[] = __FILE__;
9+
#endif
10+
11+
12+
CBarShader C3DPreviewControl::s_preview(16,32);
13+
14+
// C3DPreviewControl
15+
IMPLEMENT_DYNAMIC(C3DPreviewControl, CStatic)
16+
17+
BEGIN_MESSAGE_MAP(C3DPreviewControl, CStatic)
18+
ON_WM_PAINT()
19+
END_MESSAGE_MAP()
20+
21+
C3DPreviewControl::C3DPreviewControl()
22+
: m_iSliderPos(0) // use flat
23+
{
24+
}
25+
26+
C3DPreviewControl::~C3DPreviewControl()
27+
{
28+
}
29+
30+
// Sets "slider" position for type of preview
31+
32+
33+
void C3DPreviewControl::SetSliderPos(int iPos)
34+
{
35+
if ( iPos <= 5 && iPos >= -5)
36+
{
37+
m_iSliderPos = iPos;
38+
}
39+
if ( GetSafeHwnd() )
40+
{
41+
Invalidate();
42+
UpdateWindow();
43+
}
44+
}
45+
46+
void C3DPreviewControl::OnPaint()
47+
{
48+
CPaintDC dc(this); // device context for painting
49+
RECT outline_rec;
50+
outline_rec.top=0;
51+
outline_rec.bottom=18;
52+
outline_rec.left=0;
53+
outline_rec.right=34;
54+
CBrush gdiBrush(RGB(104,104,104));
55+
CBrush* pOldBrush = dc.SelectObject(&gdiBrush); //eklmn: select a new brush
56+
dc.FrameRect(&outline_rec, &gdiBrush);
57+
dc.SelectObject(pOldBrush); //eklmn: recover an old brush
58+
s_preview.SetFileSize((uint64)32);
59+
s_preview.Fill(RGB(192,192,255));
60+
s_preview.DrawPreview(&dc, 1, 1, m_iSliderPos);
61+
}

3DPreviewControl.h

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#pragma once
2+
3+
#include "barshader.h"
4+
5+
// C3DPreviewControl
6+
7+
class C3DPreviewControl : public CStatic
8+
{
9+
DECLARE_DYNAMIC(C3DPreviewControl)
10+
11+
public:
12+
C3DPreviewControl();
13+
virtual ~C3DPreviewControl();
14+
15+
protected:
16+
DECLARE_MESSAGE_MAP()
17+
int m_iSliderPos;
18+
static CBarShader s_preview;
19+
public:
20+
// Sets "slider" position for type of preview
21+
void SetSliderPos(int iPos);
22+
afx_msg void OnPaint();
23+
};
24+
25+

0 commit comments

Comments
 (0)