?? showiconview.cpp
字號:
// showiconView.cpp : implementation of the CShowiconView class
//
#include "stdafx.h"
#include "showicon.h"
#include "showiconDoc.h"
#include "showiconView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CShowiconView
IMPLEMENT_DYNCREATE(CShowiconView, CView)
BEGIN_MESSAGE_MAP(CShowiconView, CView)
//{{AFX_MSG_MAP(CShowiconView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CShowiconView construction/destruction
CShowiconView::CShowiconView()
{
// TODO: add construction code here
}
CShowiconView::~CShowiconView()
{
}
BOOL CShowiconView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CShowiconView drawing
unsigned char Lock_Bmp[24][3]={
0,126,0,
0,255,0,
1,129,128,
1,129,128,
1,129,128,
1,129,128,
1,129,128,
1,129,128,
1,129,128,
1,129,128,
15,255,240,
15,255,240,
15,255,240,
15,255,240,
15,255,240,
15,255,240,
15,255,240,
15,255,240,
15,255,240,
15,255,240,
15,255,240,
15,255,240,
15,255,240,
15,255,240
};
unsigned char Favour_Bmp[24][3]=
{7,207,128,
31,255,224,
63,255,240,
63,255,240,
127,255,248,
127,255,248,
255,255,252,
255,255,252,
255,255,252,
255,255,252,
127,255,248,
63,255,240,
63,255,240,
31,255,224,
31,255,224,
15,255,192,
15,255,192,
7,255,128,
7,255,128,
3,255,0,
1,255,0,
1,254,0,
0,254,0,
0,124,0
};
unsigned char Dollar_Bmp[24][3]=
{0,0,0,
0,28,0,
0,28,0,
0,63,0,
0,127,128,
0,221,192,
1,221,192,
1,157,192,
1,157,192,
1,220,0,
0,220,0,
0,124,0,
0,60,0,
0,30,0,
0,31,128,
0,29,192,
0,28,192,
3,156,192,
3,156,192,
3,156,192,
1,220,192,
1,221,128,
0,255,128,
0,127,0
};
unsigned char Help_Bmp[24][3]=
{0,0,0,
0,0,0,
0,0,0,
0,0,0,
0,124,0,
1,134,0,
2,3,0,
2,3,0,
3,3,0,
3,3,0,
0,6,0,
0,12,0,
0,48,0,
0,32,0,
0,32,0,
0,32,0,
0,0,0,
0,0,0,
0,112,0,
0,112,0,
0,112,0,
0,0,0,
0,0,0,
0,0,0
};
unsigned char Packet_Bmp[24][3]=
{
0,0,0,
0,0,0,
0,0,0,
0,0,0,
0,0,0,
3,224,0,
7,240,0,
15,255,224,
15,255,224,
15,255,224,
15,255,224,
15,255,224,
15,255,224,
15,255,224,
15,255,224,
15,255,224,
15,255,224,
15,255,224,
15,255,224,
0,0,0,
0,0,0,
0,0,0,
0,0,0,
0,0,0
};
unsigned char Packet1_Bmp[24][4]=
{
0,0,0,0,
0,0,12,0,
0,0,52,0,
0,0,204,0,
0,3,24,0,
0,12,48,0,
0,16,96,0,
62,32,127,252,
63,192,0,2,
63,0,7,254,
63,0,15,252,
63,0,0,64,
63,0,7,192,
63,0,15,128,
63,0,0,128,
63,192,15,128,
63,240,31,0,
62,62,2,0,
0,15,254,0,
0,1,252,0,
0,0,0,0,
0,0,0,0,
0,0,0,0,
0,0,0,0,
};
unsigned char zoom_out[40][5]=
{
0x60,0x00,0xff,0xff,0xff,
0xff,0xff,0x10,0x7f,0xf8,
0x7f,0xf0,0x60,0x00,0xff,
0x00,0xff,0xff,0xff,0x10,
0xff,0x10,0x07,0x80,0x60,
0x80,0x60,0x00,0xff,0xff,
0xff,0xff,0xff,0x18,0x07,
0x04,0x07,0x80,0x80,0x00,
0x80,0x00,0xff,0xff,0xff,
0xff,0xff,0x04,0x07,0x01,
0x00,0x01,0x80,0x00,0xff,
0x00,0xff,0xff,0xff,0x04,
0xff,0x06,0x00,0x01,0x80,
0x0f,0xe0,0x00,0xff,0xff,
0xff,0xff,0xff,0x01,0xc0,
0x01,0xe0,0x1f,0xe0,0x00,
0xf8,0x00,0xff,0xff,0xff,
0xff,0xff,0x00,0x1f,0xe1,
0x1f,0xe1,0xf8,0x00,0xff,
0x00,0xff,0xff,0xff,0x00,
0xff,0x00,0x00,0x00,0x7e,
0x00,0x7e,0x00,0xff,0xff,
0xff,0xff,0xff,0x00,0x00,
0x00,0x00,0x00,0x1f,0x80,
0x1f,0x80,0xff,0xff,0xff,
0xff,0xff,0x00,0x00,0x00,
0x00,0x00,0x07,0x80,0xff,
0x80,0xff,0xff,0xff,0x00,
0xff,0x00,0x00,0x00,0x07,
0x00,0x00,0x00,0xff,0xff,
0xff,0xff,0xff,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xff,0xff,0xff,
0xff,0xff,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xff,
0x00,0xff,0xff,0xff,0x00,
0xff,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xff,0xff,
0xff,0xff,0xff,0x00,0x00,
0x00,0x00,0x00,0x00,0x00
};
void loadbmp(char *filename,CDC *pDC,int tt);
extern unsigned char allArabics[24][4];
extern void CH_ShowICon(int x,int y,int color,unsigned char name[24][4],CDC *pDC);
extern void CH1_ShowICon(int x,int y,int color,unsigned char name[30][5],CDC *pDC);
void CShowiconView::OnDraw(CDC* pDC)
{
CShowiconDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
//CH_Show_Lock(pDC);
// pDC->AngleArc(
/*CRect rect1(100,100,300,180);
CRect rect2(100,100-60,300,180+60-60);
pDC->Ellipse(rect1);
pDC->Ellipse(rect2);*/
//
CH1_ShowICon(100,100,1,zoom_out,pDC);
//loadbmp("bmail.bmp",pDC);
#if 0
int i = 51;
char filename[50] ={0};
for ( i = 86/*51*/; i < 155 ;i++ )
{
sprintf(filename,"%d%s",i,".bmp");
loadbmp(filename,pDC,i);
}
#endif
#if 1
loadbmp("xian.bmp",pDC,5);
#else
int i = /*51*/1;
char filename[50] ={0};
for ( i =1/*51*/; i < 2.
/*0xff*/ ;i++ )
{
#if 1
sprintf(filename,"R%02x%s",i,".bmp");
loadbmp(filename,pDC,i);
#else
sprintf(filename,"%s","i4c.bmp");
loadbmp(filename,pDC,i);
#endif
}
#endif
/*CH_ShowICon(100,100,1,Packet1_Bmp,pDC);*/
/* CH_ShowICon(100,100,1,Lock_Bmp,pDC);
CH_ShowICon(100,200,1,Favour_Bmp,pDC);
CH_ShowICon(100,300,1,Dollar_Bmp,pDC);
CH_ShowICon(100,400,1,Help_Bmp,pDC);
CH_ShowICon(300,200,1,Packet_Bmp,pDC);*/
// CH_ShowICon(100,400,1,Dollar_Bmp,pDC);
//allArabics[24][3]=0;
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CShowiconView printing
BOOL CShowiconView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CShowiconView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CShowiconView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CShowiconView diagnostics
#ifdef _DEBUG
void CShowiconView::AssertValid() const
{
CView::AssertValid();
}
void CShowiconView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
void CShowiconView::CH_Show_Lock(CDC *pDC)
{
CBrush brush;
CBrush *oldbrush;
brush.CreateSolidBrush(RGB(0,0,255));
oldbrush=pDC->SelectObject(&brush);
RECT rect;
rect.left=100;
rect.right=100+16;
rect.top=100;
rect.bottom=100+16;
pDC->Rectangle(&rect);
pDC->MoveTo(100+4,100);
pDC->LineTo(100+4,100-4);
pDC->MoveTo(100+12,100);
pDC->LineTo(100+12,100-4);
pDC->AngleArc(100+8,100-4,4,0,180);
}
void CShowiconView::CH_Show_Favour(CDC *pDC)
{
}
void CShowiconView::CH_Show_Dollar(CDC *pDC)
{
}
void CShowiconView::CH_Show_Button(CDC *pDC)
{
}
CShowiconDoc* CShowiconView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CShowiconDoc)));
return (CShowiconDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CShowiconView message handlers
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -