AutoCAD的狀態欄增加“同步”按鈕

不多說,代碼很簡單,如下:

AcApStatusBar* pStatus = acedGetApplicationStatusBar();
if (pStatus)
{
int iCnt = pStatus->GetPaneCount();
for (int i=0; i <iCnt ;i++ )
{
AcPane* pPane = pStatus->GetPane(i);
CString sText;
pPane->GetText(sText);
int iStyle=pPane->GetStyle();

if (sText == _T("模型"))
{
AcPane* pPane = new AcPane;
if (pPane)
{
pPane->SetToolTipText(_T("視圖同步"));
pPane->SetVisible(TRUE);
//pPane->SetStyle(ACSB_NOBORDERS);
pPane->SetText(_T("同步"));
pPane->SetMinWidth(pStatus->GetTextWidth(_T("捕捉")));

pStatus->Insert(i+1, pPane);
break;
}
}
}

pStatus->Update();
}


發佈了21 篇原創文章 · 獲贊 4 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章