ツールバーとステータスバーの設定
ツールバーの設定



ステータスバーの設定

ヒントとして、「線の色を緑に変更」を選択します.入力


マウスカーソルでアクティブ化
プロンプトに「n緑」を追加


ステータスバー領域
既存のステータスバー

宣言の場所
----MainFrame.cpp
static UINT indicators[] =
{
ID_SEPARATOR, // 상태 줄 표시기
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
生成位置----MainFrame.cpp
if (!m_wndStatusBar.Create(this))
{
TRACE0("상태 표시줄을 만들지 못했습니다.\n");
return -1; // 만들지 못했습니다.
}
m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
ステータスバーの色域を追加

カラー領域を追加
----MainFrame.cpp
static UINT indicators[] =
{
ID_SEPARATOR, // 상태 줄 표시기
ID_INDICATOR_COLOR,
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};



----doc.cpp
void CCHomeWorkDoc::OnUpdateIndicatorColor(CCmdUI* pCmdUI)
{
// TODO: 여기에 명령 업데이트 UI 처리기 코드를 추가합니다.
switch (m_line.m_penColor) {
case RGB(255, 0, 0):
pCmdUI->SetText(_T("빨간색"));
break;
case RGB(0, 255, 0):
pCmdUI->SetText(_T("초록색"));
break;
case RGB(0, 0, 255):
pCmdUI->SetText(_T("파랑색"));
break;
default:
pCmdUI->SetText(_T(""));
break;
}
}

ステータスバー[座標](Coordinates)を追加
特定座標のみ出力
----MainFrame.h
// 특성입니다.
public:
void SetMousePositionOutput(const CPoint& pt) {
m_wndStatusBar.SetWindowText(_T("100, 200 pt"));
}

マウス位置座標を出力
----view.cpp
#include "MainFrm.h"
void CCHomeWorkView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: 여기에 메시지 처리기 코드를 추가 및/또는 기본값을 호출합니다.
if ((nFlags & MK_LBUTTON) == MK_LBUTTON) {
CCHomeWorkDoc* pDoc = GetDocument();
CClientDC dc(this);
pDoc->m_line.DrawLastLine(&dc, point);
pDoc->m_line.push_back(point);
}
CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
pMainFrame->SetMousePositionOutput(point);
CView::OnMouseMove(nFlags, point);
}
----MainFrame.h// 특성입니다.
public:
void SetMousePositionOutput(const CPoint& pt) {
//m_wndStatusBar.SetWindowText(_T("100, 200 pt"));
CString str;
str.Format(_T("%d, %d pt"), pt.x, pt.y);
m_wndStatusBar.SetWindowText(str);
}

Reference
この問題について(ツールバーとステータスバーの設定), 我々は、より多くの情報をここで見つけました https://velog.io/@hj-yu-code/도구바-및-상태바-설정テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol