OpenClonk
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)
 
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
 
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

◆ DlgKeyCBEx()

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

◆ CheckCondition()

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

Reimplemented from C4KeyCBEx< TargetClass, ParameterType >.

Definition at line 2486 of file C4Gui.h.

2486 { 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 , class ParameterType >
bool C4KeyCBEx< TargetClass, ParameterType >::OnKeyEvent ( const C4KeyCodeEx key,
C4KeyEventType  eEv 
)
inlineoverrideprotectedvirtualinherited

Implements C4KeyboardCallbackInterface.

Definition at line 366 of file C4KeyboardInput.h.

References KEYEV_Down, KEYEV_Moved, KEYEV_Pressed, and KEYEV_Up.

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

◆ 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

◆ par

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

Definition at line 363 of file C4KeyboardInput.h.

◆ pFuncDown

template<class TargetClass , class ParameterType >
CallbackFunc C4KeyCBEx< TargetClass, ParameterType >::pFuncDown
protectedinherited

Definition at line 362 of file C4KeyboardInput.h.

◆ pFuncMoved

template<class TargetClass , class ParameterType >
CallbackFunc C4KeyCBEx< TargetClass, ParameterType >::pFuncMoved
protectedinherited

Definition at line 362 of file C4KeyboardInput.h.

◆ pFuncPressed

template<class TargetClass , class ParameterType >
CallbackFunc C4KeyCBEx< TargetClass, ParameterType >::pFuncPressed
protectedinherited

Definition at line 362 of file C4KeyboardInput.h.

◆ pFuncUp

template<class TargetClass , class ParameterType >
CallbackFunc C4KeyCBEx< TargetClass, ParameterType >::pFuncUp
protectedinherited

Definition at line 362 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 , class ParameterType >
TargetClass& C4KeyCBEx< TargetClass, ParameterType >::rTarget
protectedinherited

Definition at line 361 of file C4KeyboardInput.h.


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