- DrawState(hdc, NULL, NULL,
- (LPARAM)(const wxChar *)m_strName, m_strName.Length(),
- x, rc.y, rc.GetWidth(), rc.GetHeight(),
- DST_PREFIXTEXT | ( st & wxODDisabled ? DSS_DISABLED : 0) );
+
+ wxString strMenuText = m_strName.BeforeFirst('\t');
+
+ ::DrawState(hdc, NULL, NULL,
+ (LPARAM)strMenuText.c_str(), strMenuText.length(),
+ x, rc.y + 1, rc.GetWidth(), rc.GetHeight(),
+ DST_PREFIXTEXT |
+ (((st & wxODDisabled) && !(st & wxODSelected)) ? DSS_DISABLED : 0));
+
+ if ( !m_strAccel.empty() )
+ {
+ int accel_width, accel_height;
+ dc.GetTextExtent(m_strAccel, &accel_width, &accel_height);
+
+ ::DrawState(hdc, NULL, NULL,
+ (LPARAM)m_strAccel.c_str(), m_strAccel.length(),
+ rc.GetRight() - accel_width - 16, rc.y + 1, 0, 0,
+ DST_TEXT |
+ (((st & wxODDisabled) && !(st & wxODSelected)) ? DSS_DISABLED : 0));
+ }