LAPTOP-SNT8I5JK\Boounion
2024-11-15 106787bbf3418e9199043bcea81d29161fdada8f
SourceCode/Bond/BondEq/AxisSettingsDlg.cpp
@@ -210,16 +210,6 @@
      pWnd->MoveWindow(newX, newY, newWidth, newHeight);
      AdjustControlFont(pWnd, newWidth, newHeight);
      if (pWnd->IsKindOf(RUNTIME_CLASS(CComboBox))) {
         CComboBox* pComboBox = (CComboBox*)pWnd;
         pComboBox->SetItemHeight(-1, newHeight);  // -1 表示所有项的高度
      }
      if (pWnd->IsKindOf(RUNTIME_CLASS(CStatic))) {
         CStatic* pStatic = (CStatic*)pWnd;
         pStatic->ModifyStyle(0, SS_CENTER | SS_CENTERIMAGE);
      }
      // 获取下一个控件
      pWnd = pWnd->GetNextWindow();
   }
@@ -227,8 +217,21 @@
void CAxisSettingsDlg::AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight)
{
   int fontSize = nHeight - 10;
   TCHAR szClassName[256];
   GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
   if (_tcsicmp(szClassName, _T("Static")) == 0) {
      CStatic* pStatic = (CStatic*)pWnd;
      pStatic->ModifyStyle(0, SS_CENTER | SS_CENTERIMAGE);
      return;
   }
   if (_tcsicmp(szClassName, _T("ComboBox")) == 0) {
      CComboBox* pComboBox = (CComboBox*)pWnd;
      pComboBox->SetItemHeight(-1, nHeight);  // -1 表示所有项的高度
   }
   int fontSize = nHeight - 10;
   CFont* pCurrentFont = pWnd->GetFont();
   LOGFONT logFont;
   pCurrentFont->GetLogFont(&logFont);