OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4GUI::ControlKeyCBExPassKey< TargetClass, ParameterType > Class Template Reference

#include <C4Gui.h>

Inheritance diagram for C4GUI::ControlKeyCBExPassKey< TargetClass, ParameterType >:
[legend]
Collaboration diagram for C4GUI::ControlKeyCBExPassKey< TargetClass, ParameterType >:
[legend]

Public Member Functions

 ControlKeyCBExPassKey (TargetClass &rTarget, const ParameterType &rPar, CallbackFunc pFuncDown, CallbackFunc pFuncUp=nullptr, CallbackFunc pFuncPressed=nullptr)
 
virtual bool CheckCondition ()
 
void Ref ()
 
void Deref ()
 
bool IsOriginalKey (const class C4CustomKey *pCheckKey) const
 

Public Attributes

class C4CustomKeypOriginalKey
 

Protected Member Functions

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

Protected Attributes

TargetClass & rTarget
 
CallbackFunc pFuncDown
 
CallbackFunc pFuncUp
 
CallbackFunc pFuncPressed
 
CallbackFunc pFuncMoved
 
ParameterType par
 

Detailed Description

template<class TargetClass, class ParameterType>
class C4GUI::ControlKeyCBExPassKey< TargetClass, ParameterType >

Definition at line 2502 of file C4Gui.h.

Constructor & Destructor Documentation

template<class TargetClass , class ParameterType >
C4GUI::ControlKeyCBExPassKey< TargetClass, ParameterType >::ControlKeyCBExPassKey ( TargetClass &  rTarget,
const ParameterType &  rPar,
CallbackFunc  pFuncDown,
CallbackFunc  pFuncUp = nullptr,
CallbackFunc  pFuncPressed = nullptr 
)
inline

Definition at line 2508 of file C4Gui.h.

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

Member Function Documentation

template<class TargetClass , class ParameterType >
virtual bool C4GUI::ControlKeyCBExPassKey< TargetClass, ParameterType >::CheckCondition ( )
inlinevirtual

Reimplemented from C4KeyCBExPassKey< TargetClass, ParameterType >.

Definition at line 2511 of file C4Gui.h.

References C4KeyCBExPassKey< TargetClass, ParameterType >::rTarget.

2511 { return Base::rTarget.HasDrawFocus(); }
TargetClass & rTarget
void C4KeyboardCallbackInterface::Deref ( )
inlineinherited

Definition at line 289 of file C4KeyboardInput.h.

Referenced by C4CustomKey::KillCallbacks().

289 { if (!--iRef) delete this; }

Here is the caller graph for this function:

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

Definition at line 294 of file C4KeyboardInput.h.

References C4KeyboardCallbackInterface::pOriginalKey.

Referenced by C4KeyboardCallbackInterfaceHasOriginalKey().

294 { return pCheckKey == pOriginalKey; }
class C4CustomKey * pOriginalKey

Here is the caller graph for this function:

template<class TargetClass , class ParameterType >
virtual bool C4KeyCBExPassKey< TargetClass, ParameterType >::OnKeyEvent ( const C4KeyCodeEx key,
C4KeyEventType  eEv 
)
inlineprotectedvirtualinherited

Implements C4KeyboardCallbackInterface.

Definition at line 402 of file C4KeyboardInput.h.

References C4KeyCBExPassKey< TargetClass, ParameterType >::CheckCondition(), KEYEV_Down, KEYEV_Moved, KEYEV_Pressed, KEYEV_Up, C4KeyCBExPassKey< TargetClass, ParameterType >::pFuncDown, C4KeyCBExPassKey< TargetClass, ParameterType >::pFuncMoved, C4KeyCBExPassKey< TargetClass, ParameterType >::pFuncPressed, and C4KeyCBExPassKey< TargetClass, ParameterType >::pFuncUp.

403  {
404  if (!CheckCondition()) return false;
405  switch (eEv)
406  {
407  case KEYEV_Down: return pFuncDown ? (rTarget.*pFuncDown)(key, par) : false;
408  case KEYEV_Up: return pFuncUp ? (rTarget.*pFuncUp)(key, par) : false;
409  case KEYEV_Pressed: return pFuncPressed ? (rTarget.*pFuncPressed)(key, par) : false;
410  case KEYEV_Moved: return pFuncMoved ? (rTarget.*pFuncMoved)(key, par) : false;
411  default: return false;
412  }
413  }
virtual bool CheckCondition()
ParameterType par
CallbackFunc pFuncDown
CallbackFunc pFuncMoved
CallbackFunc pFuncPressed
TargetClass & rTarget
CallbackFunc pFuncUp

Here is the call graph for this function:

void C4KeyboardCallbackInterface::Ref ( )
inlineinherited

Definition at line 288 of file C4KeyboardInput.h.

Referenced by C4CustomKey::C4CustomKey().

288 { ++iRef; }

Here is the caller graph for this function:

Member Data Documentation

template<class TargetClass , class ParameterType >
ParameterType C4KeyCBExPassKey< TargetClass, ParameterType >::par
protectedinherited

Definition at line 399 of file C4KeyboardInput.h.

template<class TargetClass , class ParameterType >
CallbackFunc C4KeyCBExPassKey< TargetClass, ParameterType >::pFuncDown
protectedinherited
template<class TargetClass , class ParameterType >
CallbackFunc C4KeyCBExPassKey< TargetClass, ParameterType >::pFuncMoved
protectedinherited
template<class TargetClass , class ParameterType >
CallbackFunc C4KeyCBExPassKey< TargetClass, ParameterType >::pFuncPressed
protectedinherited
template<class TargetClass , class ParameterType >
CallbackFunc C4KeyCBExPassKey< TargetClass, ParameterType >::pFuncUp
protectedinherited
class C4CustomKey* C4KeyboardCallbackInterface::pOriginalKey
inherited
template<class TargetClass , class ParameterType >
TargetClass& C4KeyCBExPassKey< TargetClass, ParameterType >::rTarget
protectedinherited

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