| 338 | } |
| 339 | |
| 340 | BOOL SButton::InitFromXml(pugi::xml_node xmlNode) |
| 341 | { |
| 342 | BOOL bRet=SWindow::InitFromXml(xmlNode); |
| 343 | SStringT strText = GetWindowText(TRUE); |
| 344 | |
| 345 | if (!strText.IsEmpty()&&(strText[strText.GetLength()-1]==_T(')'))) |
| 346 | { |
| 347 | int pos=strText.ReverseFind(_T('(')); |
| 348 | if ((pos != -1)&&(strText[++pos]==_T('&'))) |
| 349 | { |
| 350 | SStringT strAccelT=_T("alt+"); |
| 351 | strAccelT += strText[++pos]; |
| 352 | m_accel = CAccelerator::TranslateAccelKey(strAccelT); |
| 353 | if (m_accel) |
| 354 | { |
| 355 | CAccelerator acc(m_accel); |
| 356 | GetContainer()->GetAcceleratorMgr()->RegisterAccelerator(acc, this); |
| 357 | } |
| 358 | } |
| 359 | } |
| 360 | return bRet; |
| 361 | } |
| 362 | |
| 363 | void SButton::OnDestroy() |
| 364 | { |
no test coverage detected