dlgicon.h

来自「caro program is written by VC++ and AI」· C头文件 代码 · 共 80 行

H
80
字号
/****************************************************************************/
//
// ~~~~~~~~~~~~~~~~ Dialog Icon's Functions I ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//							DlgIcon.h
//
//***************************************************************************/



#define DM_BRUSH 0 // Draw mode _ Brush
#define DM_ERASER 1 // Draw mode _ Eraser

WNDTYPE WndDraw;
bool fTempIcon[25][25];

// Prototype Function
void Icon_Size();

//////////////////////////////////////////////////////////////////////////////
/****************************************************************************/
// DlgIcon Function

//////////////////////////////////////////////////////////////
// Dialog Icon Init Message
void Icon_Init()
{
TCHAR szBuffer[50];
TCHAR szDrawClass[]=TEXT("CaroDraw");
WNDCLASS wndclass;
int x,y ;

	RECT rect;
	GetClientRect(DlgIcon.hWnd,&rect) ;
	MoveWindow(DlgIcon.hWnd, WndMain.left + (WndMain.xClient - rect.right )  / 2, WndMain.top + (WndMain.yClient - rect.bottom )/ 2, rect.right , rect.bottom , FALSE);

	/*************************************************************************/
	// Init Window Draw
	wndclass.style = CS_HREDRAW|CS_VREDRAW;
	wndclass.cbClsExtra =0;
	wndclass.cbWndExtra =0;
	wndclass.hbrBackground =(HBRUSH)GetStockObject(NULL_BRUSH);
	wndclass.hCursor = LoadCursor(ec.hInst, "IDC_DRAWBRUSH");
	wndclass.hInstance = ec.hInst ;
	wndclass.lpfnWndProc=WndDrawProc;
	wndclass.hIcon=NULL;
	wndclass.lpszClassName=szDrawClass;
	wndclass.lpszMenuName = 0;

	RegisterClass(&wndclass);
	WndDraw.hWnd =CreateWindow(szDrawClass,NULL,WS_CHILD | WS_VISIBLE,0,0,0,0,DlgIcon.hWnd,(HMENU) 0, ec.hInst ,NULL);

	for( x=0;  x < XBLOCK -1; x++ )
		for ( y=0 ; y < XBLOCK -1; y ++ )
		{
			fTempIcon[x][y] = avatar[ec.iIcon ].fDot[x][y];
		}
	/*************************************************************************/
	// Set Window Text
	if(setting.iLang == LANG_EN)
		wsprintf(szBuffer,"Edit %s Avatar",player[ec.iIcon].szName );
	if(setting.iLang == LANG_VI)
		wsprintf(szBuffer,"Thay h靚h %s",player[ec.iIcon].szName );
	SetWindowText(DlgIcon.hWnd,szBuffer);

	SendMessage(GetDlgItem(DlgIcon.hWnd , IDC_BRUSH ), BM_SETSTATE, 1 , 0);
	ec.iDrawMode = DM_BRUSH ;

	/*************************************************************************/
	// Init Show Grip
	SendMessage(GetDlgItem(DlgIcon.hWnd,IDC_CHK_GRIP),BM_SETCHECK, setting.fGrip ,0);

	// Move IDC_VIEW
	MoveWindow(GetDlgItem(DlgIcon.hWnd , IDC_VIEW), 10, 110, XBLOCK +1, XBLOCK +1, FALSE );

	Icon_Size();

	// Change Lang
	if(setting.iLang == LANG_VI)
	{
		SetWindowText(GetDlgItem(DlgIcon.hWnd,IDC_CHK_GRIP),"&Hi謓 l

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?