Scope
scope::gui::CScopeEditCtrl< ValT > Class Template Reference

#include <ScopeEditCtrl.h>

Inherits CWindowImpl< CScopeEditCtrl< ValT >, CEdit >.

Public Member Functions

CScopeEditCtrl (ScopeValue< ValT > *_scopeval, const bool &_connectback=false, const bool &_connectcontrolstate=false)
 
 ~CScopeEditCtrl ()
 
bool AttachToDlgItem (HWND hWnd)
 
void UpdateControl ()
 
void UpdateValue ()
 
void SetState (const bool &state)
 
Called via Win32 messages
LRESULT OnChar (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnKeyDown (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnKeyUp (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnKillFocus (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnUpdateControl (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 

Protected Attributes

bool created
 
ScopeValue< ValT > *const scope_val
 
boost::signals2::connection stateconnection
 
boost::signals2::connection valueconnection
 
bool shiftstate
 

Detailed Description

template<class ValT>
class scope::gui::CScopeEditCtrl< ValT >

An adapted CEdit control around a ScopeValue.

Warning
Needs message reflection in containing (dialog) window via REFLECT_NOTIFICATIONS()

Definition at line 13 of file ScopeEditCtrl.h.

Constructor & Destructor Documentation

template<class ValT>
* scope::gui::CScopeEditCtrl< ValT >::CScopeEditCtrl ( ScopeValue< ValT > *  _scopeval,
const bool &  _connectback = false,
const bool &  _connectcontrolstate = false 
)
inline

()

Gets a pointer to the ScopeValue and connects for value changes and read/write status changes if desired

Parameters
[in]_scopevalScopeValue to which the edit control connects (taken by reference)
[in]_connectbackchange edit control displayed value/text when ScopeValue is changed
[in]_connectcontrolstatechange edit control enabled/disabled state when read/write state of the ScopeValue is changed

Definition at line 51 of file ScopeEditCtrl.h.

template<class ValT>
scope::gui::CScopeEditCtrl< ValT >::~CScopeEditCtrl ( )
inline

Disconnects everything.

Definition at line 62 of file ScopeEditCtrl.h.

Member Function Documentation

template<class ValT>
bool scope::gui::CScopeEditCtrl< ValT >::AttachToDlgItem ( HWND  hWnd)
inline

Attach the control to a dialog item.

Definition at line 68 of file ScopeEditCtrl.h.

template<class ValT>
LRESULT scope::gui::CScopeEditCtrl< ValT >::OnChar ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)
inline

For ignoring tab and return without beep.

Definition at line 81 of file ScopeEditCtrl.h.

template<class ValT>
LRESULT scope::gui::CScopeEditCtrl< ValT >::OnKeyDown ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)
inline

Switches to next control on return or tab and updates ScopeValue scope_val Also sets state of shift key.

Definition at line 94 of file ScopeEditCtrl.h.

template<class ValT>
LRESULT scope::gui::CScopeEditCtrl< ValT >::OnKeyUp ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)
inline

Resets state of shift key.

Definition at line 108 of file ScopeEditCtrl.h.

template<class ValT>
LRESULT scope::gui::CScopeEditCtrl< ValT >::OnKillFocus ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)
inline

Update scope_val when leaving focus.

Definition at line 117 of file ScopeEditCtrl.h.

template<class ValT>
LRESULT scope::gui::CScopeEditCtrl< ValT >::OnUpdateControl ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL &  bHandled 
)
inline

Worker for UpdateControl (explicit specialization for ScopeValue<CString> below).

Definition at line 123 of file ScopeEditCtrl.h.

template<class ValT>
void scope::gui::CScopeEditCtrl< ValT >::UpdateControl ( )
inline

Updates the string inside the control from the ScopeValues' value.

Do this asynchronously, thus Gui thread does the updating in OnUpdateControl and ScopeController (or whatever) thread can immediatly continue.

Definition at line 132 of file ScopeEditCtrl.h.

template<class ValT>
void scope::gui::CScopeEditCtrl< ValT >::UpdateValue ( )
inline

Updates the ScopeValue from the string inside the control.

Definition at line 137 of file ScopeEditCtrl.h.

template<class ValT>
void scope::gui::CScopeEditCtrl< ValT >::SetState ( const bool &  state)
inline

Sets the enabled/disabled state of the control.

Definition at line 147 of file ScopeEditCtrl.h.

Member Data Documentation

template<class ValT>
bool scope::gui::CScopeEditCtrl< ValT >::created
protected

true after window creation

Definition at line 18 of file ScopeEditCtrl.h.

template<class ValT>
ScopeValue<ValT>* const scope::gui::CScopeEditCtrl< ValT >::scope_val
protected

pointer to underlying ScopeValue

Definition at line 21 of file ScopeEditCtrl.h.

template<class ValT>
boost::signals2::connection scope::gui::CScopeEditCtrl< ValT >::stateconnection
protected

The connection object for the control state (connection to the scope_val rw state change)

Definition at line 24 of file ScopeEditCtrl.h.

template<class ValT>
boost::signals2::connection scope::gui::CScopeEditCtrl< ValT >::valueconnection
protected

The connection object for the control state (connection to the scope_val value change)

Definition at line 27 of file ScopeEditCtrl.h.

template<class ValT>
bool scope::gui::CScopeEditCtrl< ValT >::shiftstate
protected

stores state of shift key

Definition at line 30 of file ScopeEditCtrl.h.


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