OpenClonk
C4GUI::DlgKeyCBPassKey< TargetClass > Class Template Reference

#include <C4Gui.h>

Inheritance diagram for C4GUI::DlgKeyCBPassKey< TargetClass >:
[legend]
Collaboration diagram for C4GUI::DlgKeyCBPassKey< TargetClass >:
[legend]

Public Member Functions

 DlgKeyCBPassKey (TargetClass &rTarget, CallbackFunc pFuncDown, CallbackFunc pFuncUp=nullptr, CallbackFunc pFuncPressed=nullptr)
 
bool CheckCondition () override
 
void Ref ()
 
void Deref ()
 
bool IsOriginalKey (const class C4CustomKey *pCheckKey) const
 

Public Attributes

class C4CustomKeypOriginalKey {nullptr}
 

Protected Member Functions

bool OnKeyEvent (const C4KeyCodeEx &key, C4KeyEventType eEv) override
 

Protected Attributes

TargetClass & rTarget
 
CallbackFunc pFuncDown
 
CallbackFunc pFuncUp
 
CallbackFunc pFuncPressed
 
CallbackFunc pFuncMoved
 

Detailed Description

template<class TargetClass>
class C4GUI::DlgKeyCBPassKey< TargetClass >

Definition at line 2465 of file C4Gui.h.

Constructor & Destructor Documentation

◆ DlgKeyCBPassKey()

template<class TargetClass >
C4GUI::DlgKeyCBPassKey< TargetClass >::DlgKeyCBPassKey ( TargetClass &  rTarget,
CallbackFunc  pFuncDown,
CallbackFunc  pFuncUp = nullptr,
CallbackFunc  pFuncPressed = nullptr 
)
inline

Definition at line 2471 of file C4Gui.h.

2472  : Base(rTarget, pFuncDown, pFuncUp, pFuncPressed) {}
TargetClass & rTarget
CallbackFunc pFuncDown
CallbackFunc pFuncPressed
CallbackFunc pFuncUp

Member Function Documentation

◆ CheckCondition()

template<class TargetClass >
bool C4GUI::DlgKeyCBPassKey< TargetClass >::CheckCondition ( )
inlineoverridevirtual

Reimplemented from C4KeyCBPassKey< TargetClass >.

Definition at line 2474 of file C4Gui.h.

2474 { return Base::rTarget.IsInActiveDlg(true) && Base::rTarget.IsVisible(); }
TargetClass & rTarget

◆ Deref()

void C4KeyboardCallbackInterface::Deref ( )
inlineinherited

Definition at line 284 of file C4KeyboardInput.h.

Referenced by C4CustomKey::KillCallbacks().

284 { if (!--iRef) delete this; }
Here is the caller graph for this function:

◆ IsOriginalKey()

bool C4KeyboardCallbackInterface::IsOriginalKey ( const class C4CustomKey pCheckKey) const
inlineinherited

Definition at line 289 of file C4KeyboardInput.h.

Referenced by C4KeyboardCallbackInterfaceHasOriginalKey().

289 { return pCheckKey == pOriginalKey; }
class C4CustomKey * pOriginalKey
Here is the caller graph for this function:

◆ OnKeyEvent()

template<class TargetClass >
bool C4KeyCBPassKey< TargetClass >::OnKeyEvent ( const C4KeyCodeEx key,
C4KeyEventType  eEv 
)
inlineoverrideprotectedvirtualinherited

Implements C4KeyboardCallbackInterface.

Definition at line 334 of file C4KeyboardInput.h.

References KEYEV_Down, KEYEV_Moved, KEYEV_Pressed, and KEYEV_Up.

335  {
336  if (!CheckCondition()) return false;
337  switch (eEv)
338  {
339  case KEYEV_Down: return pFuncDown ? (rTarget.*pFuncDown)(key) : false;
340  case KEYEV_Up: return pFuncUp ? (rTarget.*pFuncUp)(key) : false;
341  case KEYEV_Pressed: return pFuncPressed ? (rTarget.*pFuncPressed)(key) : false;
342  case KEYEV_Moved: return pFuncMoved ? (rTarget.*pFuncMoved)(key) : false;
343  default: return false;
344  }
345  }
TargetClass & rTarget
CallbackFunc pFuncDown
CallbackFunc pFuncPressed
virtual bool CheckCondition()
CallbackFunc pFuncMoved
CallbackFunc pFuncUp

◆ Ref()

void C4KeyboardCallbackInterface::Ref ( )
inlineinherited

Definition at line 283 of file C4KeyboardInput.h.

Referenced by C4CustomKey::C4CustomKey().

283 { ++iRef; }
Here is the caller graph for this function:

Member Data Documentation

◆ pFuncDown

template<class TargetClass >
CallbackFunc C4KeyCBPassKey< TargetClass >::pFuncDown
protectedinherited

Definition at line 331 of file C4KeyboardInput.h.

◆ pFuncMoved

template<class TargetClass >
CallbackFunc C4KeyCBPassKey< TargetClass >::pFuncMoved
protectedinherited

Definition at line 331 of file C4KeyboardInput.h.

◆ pFuncPressed

template<class TargetClass >
CallbackFunc C4KeyCBPassKey< TargetClass >::pFuncPressed
protectedinherited

Definition at line 331 of file C4KeyboardInput.h.

◆ pFuncUp

template<class TargetClass >
CallbackFunc C4KeyCBPassKey< TargetClass >::pFuncUp
protectedinherited

Definition at line 331 of file C4KeyboardInput.h.

◆ pOriginalKey

class C4CustomKey* C4KeyboardCallbackInterface::pOriginalKey {nullptr}
inherited

Definition at line 275 of file C4KeyboardInput.h.

Referenced by C4CustomKey::C4CustomKey().

◆ rTarget

template<class TargetClass >
TargetClass& C4KeyCBPassKey< TargetClass >::rTarget
protectedinherited

Definition at line 330 of file C4KeyboardInput.h.


The documentation for this class was generated from the following file: