LAPTOP-SNT8I5JK\Boounion
2025-03-04 cb3d913e147acce92bfacc34dab441abb9ab8735
SourceCode/Bond/Servo/CPanelAttributes.cpp
@@ -37,6 +37,7 @@
   ON_WM_DESTROY()
   ON_WM_SIZE()
   ON_NOTIFY(BYVERTICALLINE_MOVEX, IDC_LINE1, &CPanelAttributes::OnVLineMoveX)
   ON_BN_CLICKED(IDC_BUTTON_CLOSE, &CPanelAttributes::OnBnClickedButtonClose)
END_MESSAGE_MAP()
@@ -62,11 +63,10 @@
   for (unsigned int i = 0; i < nSize; i++) {
      SERVO::CAttribute* pAttribute = attrubutes.getAttribute(i);
      CMFCPropertyGridProperty* pProp1 = new CMFCPropertyGridProperty(
      m_gridCtrl.AddProperty(new CMFCPropertyGridProperty(
         pAttribute->getName().c_str(),
         pAttribute->getValue().c_str(),
         pAttribute->getDescription().c_str());
      m_gridCtrl.AddProperty(pProp1);
         pAttribute->getDescription().c_str()));
   }
}
@@ -74,6 +74,19 @@
{
   CDialogEx::OnInitDialog();
   // 关闭按钮
   CString strIcon1;
   strIcon1.Format(_T("%s\\Res\\panel_close_24_b.ico"), theApp.m_strAppDir);
   HICON hIcon1 = (HICON)::LoadImage(AfxGetInstanceHandle(),
      strIcon1, IMAGE_ICON, 24, 24,
      LR_LOADFROMFILE | LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_DEFAULTSIZE);
   m_btnClose.SubclassDlgItem(IDC_BUTTON_CLOSE, this);
   m_btnClose.SetIcon(hIcon1, hIcon1, 24);
   m_btnClose.SetFaceColor(m_crBkgnd);
   m_btnClose.SetFrameColor(m_crBkgnd);
   m_btnClose.SetFrameColor(BS_HOVER, RGB(218, 218, 218));
   m_btnClose.SetFrameColor(BS_PRESS, RGB(168, 168, 168));
   CVerticalLine* pLine1 = CVerticalLine::Hook(GetDlgItem(IDC_LINE1)->GetSafeHwnd());
   pLine1->SetBkgndColor(RGB(225, 225, 225));
@@ -137,6 +150,10 @@
   pItem = GetDlgItem(IDC_LABEL_TITLE);
   pItem->GetWindowRect(&rcItem);
   pItem->MoveWindow(5, y, rcClient.Width() - 8, rcItem.Height());
   pItem = GetDlgItem(IDC_BUTTON_CLOSE);
   pItem->GetWindowRect(&rcItem);
   pItem->MoveWindow(rcClient.right - 6 - rcItem.Width(), y, rcItem.Width(), rcItem.Height());
   y += rcItem.Height();
   y += 3;
@@ -163,3 +180,9 @@
   *result = 0;
}
void CPanelAttributes::OnBnClickedButtonClose()
{
   ShowWindow(SW_HIDE);
   GetParent()->SendMessage(ID_MSG_PANEL_RESIZE, m_nPanelWidth, 0);
}