| | |
| | | // 创建动态控件 |
| | | CBLLabel* pStatic = new CBLLabel(); |
| | | DWORD style = WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE; // 确保垂直居中 |
| | | if (hasBorder) { |
| | | style |= WS_BORDER; // 添加边框 |
| | | if (!hasBorder) { |
| | | pStatic->DisableBorder(); |
| | | } |
| | | pStatic->Create(text, style, CRect(x, y, x + width, y + height), this, id); |
| | | |
| | |
| | | UserRole enRole = userManager.getCurrentUserRole(); |
| | | if (clickCallback && (enRole == UserRole::SuperAdmin || enRole == UserRole::Operator)) { |
| | | pStatic->SetClickCallback(clickCallback); |
| | | pStatic->SetRoundedCorners(TRUE, 5); |
| | | pStatic->DisableBorder(); |
| | | } |
| | | |
| | | // 存储控件指针 |