From 4e5df866bd2b68efe3ba443a1cebf982db370c14 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 Sep 2014 22:30:21 +0200 Subject: [PATCH] CComponentsSignals: add signals for exec handlers --- src/gui/components/cc_signals.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_signals.h b/src/gui/components/cc_signals.h index e6fa0a98e..91bc79a5f 100644 --- a/src/gui/components/cc_signals.h +++ b/src/gui/components/cc_signals.h @@ -56,6 +56,15 @@ class CYourClass : sigc::trackable //<- not forget, requierd by destructor! //eg: class CNotACComponentClass : public CComponentSignals //this also handles the derivation of sigc::trackable + //simple example (find in CComponentsForm) + //this connects a member void execPageScroll(with 3 parameters) with signal OnExec + sigc::slot3 sl = sigc::mem_fun(*this, &CComponentsForm::execPageScroll); + OnExec.connect(sl); + + //assumed: would this function return a value int, slot must be switched to: + sigc::slot3 sl = sigc::mem_fun(*this, &CComponentsForm::execPageScroll); + OnExec.connect(sl); + // here we use a void* parameter, can be filled with any stuff you can cast, you can use also other types void *vptr = yourStuff; @@ -79,7 +88,7 @@ class CYourClass : sigc::trackable //<- not forget, requierd by destructor! #define __CC_SIGNALS_H____ #include - +#include class CComponentsSignals : public sigc::trackable { @@ -87,9 +96,25 @@ class CComponentsSignals : public sigc::trackable CComponentsSignals(){}; sigc::signal OnError; + ///signal on enter CComponentsForm::exec() + sigc::signal OnBeforeExec; + ///signal before leave CComponentsForm::exec(), before calls return + sigc::signal OnAfterExec; + + ///signal on execute of CComponentsForm::exec() + sigc::signal OnExec; + ///signal on received message in CComponentsForm::execKey() + sigc::signal OnExecMsg; + + ///signal on enter CComponentsForm::ScrollPage() + sigc::signal OnBeforeScrollPage; + ///signal on leave CComponentsForm::ScrollPage() + sigc::signal OnAfterScrollPage; + sigc::signal OnBeforePaint; sigc::signal OnAfterPaint; + ///signal on CComponentsForm::setSelectedItem() is completed sigc::signal OnSelect; };