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

#include <C4Gui.h>

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

Public Member Functions

 DlgKeyCBEx (TargetClass &rTarget, const ParameterType &par, 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::DlgKeyCBEx< TargetClass, ParameterType >

Definition at line 2477 of file C4Gui.h.

Constructor & Destructor Documentation

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

Definition at line 2483 of file C4Gui.h.

2484  : Base(rTarget, par, pFuncDown, pFuncUp, pFuncPressed) {}
CallbackFunc pFuncUp
ParameterType par
CallbackFunc pFuncPressed
TargetClass & rTarget
CallbackFunc pFuncDown

Member Function Documentation

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

Reimplemented from C4KeyCBEx< TargetClass, ParameterType >.

Definition at line 2486 of file C4Gui.h.

References C4KeyCBEx< TargetClass, ParameterType >::rTarget.

2486 { return Base::rTarget.IsInActiveDlg(true) && Base::rTarget.IsVisible(); }
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 C4KeyCBEx< TargetClass, ParameterType >::OnKeyEvent ( const C4KeyCodeEx key,
C4KeyEventType  eEv 
)
inlineprotectedvirtualinherited

Implements C4KeyboardCallbackInterface.

Definition at line 371 of file C4KeyboardInput.h.

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

372  {
373  if (!CheckCondition()) return false;
374  switch (eEv)
375  {
376  case KEYEV_Down: return pFuncDown ? (rTarget.*pFuncDown)(par) : false;
377  case KEYEV_Up: return pFuncUp ? (rTarget.*pFuncUp)(par) : false;
378  case KEYEV_Pressed: return pFuncPressed ? (rTarget.*pFuncPressed)(par) : false;
379  case KEYEV_Moved: return pFuncMoved ? (rTarget.*pFuncMoved)(par) : false;
380  default: return false;
381  }
382  }
CallbackFunc pFuncUp
CallbackFunc pFuncMoved
ParameterType par
CallbackFunc pFuncPressed
virtual bool CheckCondition()
TargetClass & rTarget
CallbackFunc pFuncDown

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 C4KeyCBEx< TargetClass, ParameterType >::par
protectedinherited

Definition at line 368 of file C4KeyboardInput.h.

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

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