OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4GUI::CallbackButton< CallbackDlg, Base > Class Template Reference

#include <C4Gui.h>

Inheritance diagram for C4GUI::CallbackButton< CallbackDlg, Base >:
[legend]
Collaboration diagram for C4GUI::CallbackButton< CallbackDlg, Base >:
[legend]

Public Member Functions

 CallbackButton (ArrowButton::ArrowFct eDir, const C4Rect &rtBounds, typename DlgCallback< CallbackDlg >::Func pFn, CallbackDlg *pCB=nullptr)
 
 CallbackButton (const char *szBtnText, C4Rect &rtBounds, typename DlgCallback< CallbackDlg >::Func pFn, CallbackDlg *pCB=nullptr)
 
 CallbackButton (Icons eUseIcon, const C4Rect &rtBounds, char cHotkey, typename DlgCallback< CallbackDlg >::Func pFn, CallbackDlg *pCB=nullptr)
 
 CallbackButton (Icons eUseIcon, const C4Rect &rtBounds, const char *tooltip_text, typename DlgCallback< CallbackDlg >::Func pFn, CallbackDlg *pCB=nullptr)
 
 CallbackButton (int32_t iID, const C4Rect &rtBounds, char cHotkey, typename DlgCallback< CallbackDlg >::Func pFn, CallbackDlg *pCB=nullptr)
 

Protected Member Functions

virtual void OnPress ()
 

Protected Attributes

CallbackDlg * pCB
 
DlgCallback< CallbackDlg >::Func pCallbackFn
 

Detailed Description

template<class CallbackDlg, class Base = Button>
class C4GUI::CallbackButton< CallbackDlg, Base >

Definition at line 183 of file C4Gui.h.

Constructor & Destructor Documentation

template<class CallbackDlg, class Base = Button>
C4GUI::CallbackButton< CallbackDlg, Base >::CallbackButton ( ArrowButton::ArrowFct  eDir,
const C4Rect rtBounds,
typename DlgCallback< CallbackDlg >::Func  pFn,
CallbackDlg *  pCB = nullptr 
)
inline

Definition at line 1214 of file C4Gui.h.

1215  : Base(eDir, rtBounds, 0), pCB(pCB), pCallbackFn(pFn) { }
DlgCallback< CallbackDlg >::Func pCallbackFn
Definition: C4Gui.h:1202
CallbackDlg * pCB
Definition: C4Gui.h:1200
template<class CallbackDlg, class Base = Button>
C4GUI::CallbackButton< CallbackDlg, Base >::CallbackButton ( const char *  szBtnText,
C4Rect rtBounds,
typename DlgCallback< CallbackDlg >::Func  pFn,
CallbackDlg *  pCB = nullptr 
)
inline

Definition at line 1216 of file C4Gui.h.

1217  : Base(szBtnText, rtBounds), pCB(pCB), pCallbackFn(pFn) { }
DlgCallback< CallbackDlg >::Func pCallbackFn
Definition: C4Gui.h:1202
CallbackDlg * pCB
Definition: C4Gui.h:1200
template<class CallbackDlg, class Base = Button>
C4GUI::CallbackButton< CallbackDlg, Base >::CallbackButton ( Icons  eUseIcon,
const C4Rect rtBounds,
char  cHotkey,
typename DlgCallback< CallbackDlg >::Func  pFn,
CallbackDlg *  pCB = nullptr 
)
inline

Definition at line 1218 of file C4Gui.h.

1219  : Base(eUseIcon, rtBounds, cHotkey), pCB(pCB), pCallbackFn(pFn) { }
DlgCallback< CallbackDlg >::Func pCallbackFn
Definition: C4Gui.h:1202
CallbackDlg * pCB
Definition: C4Gui.h:1200
template<class CallbackDlg, class Base = Button>
C4GUI::CallbackButton< CallbackDlg, Base >::CallbackButton ( Icons  eUseIcon,
const C4Rect rtBounds,
const char *  tooltip_text,
typename DlgCallback< CallbackDlg >::Func  pFn,
CallbackDlg *  pCB = nullptr 
)
inline

Definition at line 1220 of file C4Gui.h.

1221  : Base(eUseIcon, rtBounds, '\0', tooltip_text), pCB(pCB), pCallbackFn(pFn) { }
DlgCallback< CallbackDlg >::Func pCallbackFn
Definition: C4Gui.h:1202
CallbackDlg * pCB
Definition: C4Gui.h:1200
template<class CallbackDlg, class Base = Button>
C4GUI::CallbackButton< CallbackDlg, Base >::CallbackButton ( int32_t  iID,
const C4Rect rtBounds,
char  cHotkey,
typename DlgCallback< CallbackDlg >::Func  pFn,
CallbackDlg *  pCB = nullptr 
)
inline

Definition at line 1222 of file C4Gui.h.

1223  : Base(iID, rtBounds, cHotkey), pCB(pCB), pCallbackFn(pFn) { }
DlgCallback< CallbackDlg >::Func pCallbackFn
Definition: C4Gui.h:1202
CallbackDlg * pCB
Definition: C4Gui.h:1200

Member Function Documentation

template<class CallbackDlg, class Base = Button>
virtual void C4GUI::CallbackButton< CallbackDlg, Base >::OnPress ( )
inlineprotectedvirtual

Definition at line 1203 of file C4Gui.h.

1204  {
1205  if (pCallbackFn)
1206  {
1207  CallbackDlg *pC=pCB;
1208  if (!pC) if (!(pC=reinterpret_cast<CallbackDlg *>(Base::GetDlg()))) return;
1209  (pC->*pCallbackFn)(this);
1210  }
1211  }
DlgCallback< CallbackDlg >::Func pCallbackFn
Definition: C4Gui.h:1202
CallbackDlg * pCB
Definition: C4Gui.h:1200

Member Data Documentation

template<class CallbackDlg, class Base = Button>
DlgCallback<CallbackDlg>::Func C4GUI::CallbackButton< CallbackDlg, Base >::pCallbackFn
protected
template<class CallbackDlg, class Base = Button>
CallbackDlg* C4GUI::CallbackButton< CallbackDlg, Base >::pCB
protected

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