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

📄 outpbar.cpp

📁 一个完整的编辑器的代码(很值得参考
💻 CPP
字号:

#include "stdafx.h"
#include "resource.h"
#include "editcmd.h"
#include "outpbar.h"
#include "wm.h"

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

#pragma warning ( disable : 4711 )
/////////////////////////////////////////////////////////////////////////////
// CWorkspaceBar

COutputBar::COutputBar ()
{
}

COutputBar:: ~ COutputBar ()
{
}

BEGIN_MESSAGE_MAP (COutputBar, CAppBar)
//{{AFX_MSG_MAP( COutputBar )
ON_WM_CREATE ()
ON_MESSAGE (WM_APPEND_MENU, OnAppendMenu)
ON_MESSAGE (WM_PROCESS_MENU, OnProcessMenu)
ON_MESSAGE (WM_APPEND_PROPS, OnAppendProps)
//}}AFX_MSG_MAP
END_MESSAGE_MAP ()

/////////////////////////////////////////////////////////////////////////////
// COutputBar message handlers

int COutputBar::OnCreate (LPCREATESTRUCT lpCreateStruct)
{
  if (CAppBar::OnCreate (lpCreateStruct) == -1)
    return -1;
  m_ctlEdit.Create (WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_WANTRETURN|ES_NOHIDESEL|ES_AUTOVSCROLL|ES_AUTOHSCROLL|WS_VSCROLL|WS_HSCROLL, CRect (0, 0, 440, 220), this, 1);
  m_ctlEdit.ModifyStyleEx (0, WS_EX_CLIENTEDGE);
  m_ctlEdit.SetFont (CFont::FromHandle ((HFONT) GetStockObject (DEFAULT_GUI_FONT)));
  AddChild (m_ctlEdit.GetSafeHwnd (), ORD_FULL_END, CRect(0, 0, 0, 0), NULL);
  return 0;
}

#define ID_SPACE_FIRST 0
#define ID_SPACE_LAST 0

#pragma warning ( disable : 4100 )
LONG COutputBar::
OnAppendMenu (WPARAM wParam, LPARAM lParam)
{
  return 0;
}
#pragma warning ( default : 4100 )

#pragma warning ( disable : 4100 )
LONG COutputBar::
OnProcessMenu (WPARAM wParam, LPARAM lParam)
{
  if (wParam >= ID_SPACE_FIRST && wParam <= ID_SPACE_LAST)
    {
      SendMessage (WM_COMMAND, wParam, (LPARAM) this);
      return 1;
    }
  return 0;
}
#pragma warning ( default : 4100 )

#pragma warning ( disable : 4100 )
LONG COutputBar::
OnAppendProps (WPARAM wParam, LPARAM lParam)
{
  return 0;
}
#pragma warning ( default : 4100 )

CString COutputBar::
GetName ()
{
  return _T ("Output");
}

/////////////////////////////////////////////////////////////////////////////
#pragma warning ( default : 4711 )

⌨️ 快捷键说明

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