⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ccc.cpp

📁 Visual C++下的界面设计
💻 CPP
字号:
// ccc.cpp : implementation file
//

#include "stdafx.h"
#include "TextInStatus.h"
#include "ccc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// ccc

ccc::ccc()
{
}

ccc::~ccc()
{
}


BEGIN_MESSAGE_MAP(ccc, CStatusBar)
	//{{AFX_MSG_MAP(ccc)
	ON_WM_TIMER()
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// ccc message handlers

void ccc::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	if (m_strscrolltext.IsEmpty())
	{
		KillTimer(1);
		SetPaneText(CommandToIndex(IDS_SCROLL_PANE), "");
		return;
	}
	static UINT str_idx = 0;        //offset into string
	
	//if end of string, return to top
	if (str_idx >= (UINT) (m_strscrolltext.GetLength() / 2) - 1)
	{
		str_idx = 0;
	}
	
	//display string
	SetPaneText(CommandToIndex(IDS_SCROLL_PANE), ((LPCSTR) 
		m_strscrolltext)+str_idx); 
	
	//scroll one character
	str_idx = str_idx + 1;
	
	CStatusBar::OnTimer(nIDEvent);
}

void ccc::OnDestroy() 
{
	CStatusBar::OnDestroy();
	
	KillTimer(1);
	
}

void ccc::startdisplay(void) 
{
	//set text for scrolling
	m_strscrolltext = "   hello! world.   ";
		
	//to make it circular scroll
	m_strscrolltext += m_strscrolltext;
	
	KillTimer(1);
	VERIFY(SetTimer(1, 200, NULL) != 0);    //timer
}

⌨️ 快捷键说明

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