| 200 | } |
| 201 | |
| 202 | void CClassView::OnKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags ) |
| 203 | { |
| 204 | std::vector<HOTSPOT>::iterator FirstSelected; |
| 205 | std::vector<HOTSPOT>::iterator Found; |
| 206 | CNodePtr* PtrNode; |
| 207 | CNodeClass* ClassNode; |
| 208 | CNodeBase* FindNode; |
| 209 | ULONG_PTR FindAddress; |
| 210 | |
| 211 | if (nChar == VK_DOWN) |
| 212 | { |
| 213 | FirstSelected = m_Selected.begin( ); |
| 214 | if (FirstSelected != m_Selected.end( )) |
| 215 | { |
| 216 | if (FirstSelected->Object->GetType( ) == nt_pointer) |
| 217 | { |
| 218 | PtrNode = static_cast<CNodePtr*>(FirstSelected->Object); |
| 219 | FindNode = static_cast<CNodeBase*>(PtrNode->GetClass( )); |
| 220 | |
| 221 | Found = std::find_if( m_Hotspots.begin( ), m_Hotspots.end( ), |
| 222 | [FindNode]( const HOTSPOT hs ) { return (hs.Object == FindNode); } ); |
| 223 | if (Found != m_Hotspots.end( )) |
| 224 | { |
| 225 | // Select the found hotspot |
| 226 | ClearSelection( ); |
| 227 | Found->Object->Select( ); |
| 228 | m_Selected.push_back( *Found ); |
| 229 | } |
| 230 | } |
| 231 | else if (FirstSelected->Object->GetType( ) == nt_class) |
| 232 | { |
| 233 | ClassNode = static_cast<CNodeClass*>(FirstSelected->Object); |
| 234 | FindNode = static_cast<CNodeBase*>(ClassNode->GetNode( 0 )); |
| 235 | |
| 236 | Found = std::find_if( m_Hotspots.begin( ), m_Hotspots.end( ), |
| 237 | [FindNode]( const HOTSPOT hs ) { return (hs.Object == FindNode); } ); |
| 238 | if (Found != m_Hotspots.end( )) |
| 239 | { |
| 240 | ClearSelection( ); |
| 241 | Found->Object->Select( ); |
| 242 | m_Selected.push_back( *Found ); |
| 243 | } |
| 244 | } |
| 245 | else |
| 246 | { |
| 247 | if (m_Hotspots[0].Object != FirstSelected->Object) |
| 248 | { |
| 249 | FindAddress = FirstSelected->Address + FirstSelected->Object->GetMemorySize( ); |
| 250 | |
| 251 | Found = std::find_if( m_Hotspots.begin( ), m_Hotspots.end( ), |
| 252 | [FindAddress] ( const HOTSPOT hs ) { return (hs.Address == FindAddress); } ); |
| 253 | if (Found != m_Hotspots.end( )) |
| 254 | { |
| 255 | if (Found->Address == m_Hotspots.back( ).Address) |
| 256 | { |
| 257 | if (m_Scroll.IsWindowEnabled( )) |
| 258 | m_Scroll.SetScrollPos( m_Scroll.GetScrollPos( ) + 1 ); |
| 259 | } |
nothing calls this directly
no test coverage detected