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

📄 tabbar.cpp

📁 用CJ60Lib界面库制作的SQL数据库客户与服务器程序。
💻 CPP
字号:
// TabBar.cpp : implementation file
//

#include "stdafx.h"
#include "Client.h"
#include "TabBar.h"

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

/////////////////////////////////////////////////////////////////////////////
// CTabBar

CTabBar::CTabBar()
{
}

CTabBar::~CTabBar()
{
}


BEGIN_MESSAGE_MAP(CTabBar, CControlBar)
	//{{AFX_MSG_MAP(CTabBar)
	ON_WM_CREATE()
	ON_WM_WINDOWPOSCHANGED()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTabBar message handlers
void CTabBar::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos) 
{
	CControlBar::OnWindowPosChanged(lpwndpos);
	
	if (IsFloating()) {
		m_RichCtrl.MoveWindow( 5, 5, lpwndpos->cx-10, lpwndpos->cy-10 );
	}

	else if (IsHorzDocked()) {
		m_RichCtrl.MoveWindow( 17, 3, lpwndpos->cx-25, lpwndpos->cy-17 );
	}

	else {
		m_RichCtrl.MoveWindow( 3, 17, lpwndpos->cx-17, lpwndpos->cy-30 );
	}
}

int CTabBar::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CControlBar::OnCreate(lpCreateStruct) == -1)
		return -1;

	if( !m_RichCtrl.Create( WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL |
		ES_AUTOHSCROLL | ES_AUTOVSCROLL |  ES_MULTILINE |
		ES_LEFT | ES_READONLY, CRect(0,0,0,0), this ,1 ) )
	{
		TRACE0("Failed to create view for CTabBar\n");
		return -1;
	}

	m_RichCtrl.SetMenuID(IDR_RICH_POP);
	m_RichCtrl.ModifyStyleEx(0, WS_EX_CLIENTEDGE | WS_EX_WINDOWEDGE);

	m_RichCtrl.SetSel( -1, -1 );
	m_RichCtrl.ReplaceSel( " - - - - - - - - - - - - - - - - Configurations : miniSQL run-time report - - - - - - - - - - - - - - - - " );

	return 0;
}

void CTabBar::Clear()
{
	m_RichCtrl.SetSel( 0, -1 );
	m_RichCtrl.ReplaceSel( NULL );
	m_RichCtrl.SetSel( -1, -1 );
	m_RichCtrl.ReplaceSel( " - - - - - - - - - - - - - - - - Configurations : miniSQL run-time report - - - - - - - - - - - - - - - - " );
}

void CTabBar::InsertText( LPCTSTR text )
{
	m_RichCtrl.SetSel( -1, -1 );
	m_RichCtrl.ReplaceSel( "\n" );
	m_RichCtrl.ReplaceSel( text );
}

⌨️ 快捷键说明

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