MCPcopy Create free account
hub / github.com/ColorCop/ColorCop / FigurePound

Method FigurePound

ColorCop/ColorCopDlg.cpp:2503–2526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2501}
2502
2503void CColorCopDlg::FigurePound() {
2504 // This function adds or removes characters from the hex edit control
2505 if (m_Appflags & OmitPound) {
2506 if (m_Appflags & ModeHTML) {
2507 if (m_Hexcolor.Left(1) == _T("#")) // remove the # is it exists
2508 m_Hexcolor.Delete(0);
2509 } else if (m_Appflags & ModeDelphi) {
2510 if (m_Hexcolor.Left(1) == _T("$"))
2511 m_Hexcolor.Delete(0);
2512 }
2513 } else {
2514 if (m_Appflags & ModeHTML) {
2515 // if the user is switching to omit the pound, we need to add it if it doesn't exist
2516 if (m_Hexcolor.Left(1) != _T("#")) {
2517 m_Hexcolor = _T("#") + m_Hexcolor;
2518 }
2519 } else if (m_Appflags & ModeDelphi) {
2520 if (m_Hexcolor.Left(1) != _T("$"))
2521 m_Hexcolor = _T("$") + m_Hexcolor;
2522 }
2523 }
2524 UpdateData(false);
2525 // update changes to the edit control (m_Hexcolor)
2526}
2527
2528void CColorCopDlg::OnUpdateOptionsOmitsymbol(CCmdUI* pCmdUI) {
2529 pCmdUI->SetCheck((m_Appflags & OmitPound) ? 1 : 0);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected