MCPcopy Create free account
hub / github.com/cinience/RedisStudio / DoEvent

Method DoEvent

DuiLib/Control/UIList.cpp:266–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266void CListUI::DoEvent(TEventUI& event)
267{
268 if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) {
269 if( m_pParent != NULL ) m_pParent->DoEvent(event);
270 else CVerticalLayoutUI::DoEvent(event);
271 return;
272 }
273
274 if( event.Type == UIEVENT_SETFOCUS )
275 {
276 m_bFocused = true;
277 return;
278 }
279 if( event.Type == UIEVENT_KILLFOCUS )
280 {
281 m_bFocused = false;
282 return;
283 }
284
285 switch( event.Type ) {
286 case UIEVENT_KEYDOWN:
287 switch( event.chKey ) {
288 case VK_UP:
289 SelectItem(FindSelectable(m_iCurSel - 1, false), true);
290 return;
291 case VK_DOWN:
292 SelectItem(FindSelectable(m_iCurSel + 1, true), true);
293 return;
294 case VK_PRIOR:
295 PageUp();
296 return;
297 case VK_NEXT:
298 PageDown();
299 return;
300 case VK_HOME:
301 SelectItem(FindSelectable(0, false), true);
302 return;
303 case VK_END:
304 SelectItem(FindSelectable(GetCount() - 1, true), true);
305 return;
306 case VK_RETURN:
307 if( m_iCurSel != -1 ) GetItemAt(m_iCurSel)->Activate();
308 return;
309 }
310 break;
311 case UIEVENT_SCROLLWHEEL:
312 {
313 switch( LOWORD(event.wParam) ) {
314 case SB_LINEUP:
315 if( m_bScrollSelect ) SelectItem(FindSelectable(m_iCurSel - 1, false), true);
316 else LineUp();
317 return;
318 case SB_LINEDOWN:
319 if( m_bScrollSelect ) SelectItem(FindSelectable(m_iCurSel + 1, true), true);
320 else LineDown();
321 return;
322 }
323 }

Callers

nothing calls this directly

Calls 3

SendNotifyMethod · 0.80
NeedParentUpdateMethod · 0.80
ActivateMethod · 0.45

Tested by

no test coverage detected