3 #include "helpers/ScopeNumber.h"
13 :
public CWindowImpl<CScopeUpDownCtrl<ValT>, CUpDownCtrl> {
34 DEFAULT_REFLECTION_HANDLER()
42 CScopeUpDownCtrl(
ScopeNumber<ValT>* _scopeval, const ValT& _increment, const
bool& _connectback = false, const
bool& _connectcontrolstate = false)
44 , increment(_increment) {
46 if ( _connectcontrolstate )
52 stateconnection.disconnect();
57 if ( SubclassWindow(hWnd) ) {
68 if ( pnmh->hwndFrom == m_hWnd ) {
69 if ( pnmh->code == UDN_DELTAPOS ) {
70 LPNMUPDOWN lpnmud = (LPNMUPDOWN)pnmh;
71 if ( lpnmud->iDelta > 0 )
LRESULT OnUpDown(int idCtrl, LPNMHDR pnmh)
Checks if the reflected notify is for this window and an UDN_DELTAPOS and calls UpdateVale accordingl...
virtual T Set(const T &_v, const bool &_callguisignal=true, const bool &_callothersignal=true, const bool &_callatnochange=false)
Sets the value and calls both change signals if the value actually changed.
const ValT increment
ScopeNumber is incremented/decremented by this value.
boost::signals2::connection stateconnection
The connection object for the control state (connection to the scopenum rw state change) ...
void SetState(const bool &state)
Sets the enabled/disabled control state.
bool created
true if window created
boost::signals2::connection ConnectState(signalstate_t::slot_type slot)
Connect signal to slot for state changes.
bool incdec
does the next OnUpdateControl increment (true) or decrement (false)
void UpdateValue()
Updates the ScopeValue by incrementing or decrementing.
~CScopeUpDownCtrl(void)
Disconnects everything.
ScopeNumber< ValT > *const scopeval
pointer to the underlying ScopeNumber
An adapted CUpDownCtrl control around a ScopeNumber.
bool AttachToDlgItem(HWND hWnd)
Attach the control to a dialog item.