Scope
ScopeButtonCtrl.h
1 #pragma once
2 
3 #include "helpers/ScopeButton.h"
4 #include "helpers/Helpers.h"
5 
6 namespace scope {
7  namespace gui {
8 
12  public CWindowImpl<CScopeButtonCtrl, CButton> {
13 
14 protected:
16  bool created;
17 
20 
22  boost::signals2::connection stateconnection;
23 
25  mutable std::mutex mutex;
26 
28  bool shiftstate;
29 
30 public:
31  BEGIN_MSG_MAP_EX(CScopeButtonCtrl)
32  REFLECTED_COMMAND_CODE_HANDLER_EX(BN_CLICKED, OnClicked)
33  MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
34  MESSAGE_HANDLER(WM_KEYUP, OnKeyUp)
35  DEFAULT_REFLECTION_HANDLER()
36  END_MSG_MAP()
37 
39  CScopeButtonCtrl(ScopeButton* _butt, const bool& _connectcontrolstate = true);
40 
43 
47  LRESULT OnClicked(UINT uNotifyCode, int nID, CWindow wndCtl);
48 
51  LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
52 
54  LRESULT OnKeyUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
59  void Connect(ScopeButton* _butt, const bool& _connectcontrolstate = true);
60  void Disconnect();
64  bool AttachToDlgItem(HWND hWnd);
65 
67  void Enable(const bool& state);
68 };
69 
70 }
71 
72 }
bool shiftstate
stores state of shift key
std::mutex mutex
protect connection managment
LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Switches to next control on return or tab and updates ScopeValue scope_val Also sets state of shift k...
bool created
true after window creation
ScopeButton * scope_button
pointer to the underlying ScopeButton
LRESULT OnClicked(UINT uNotifyCode, int nID, CWindow wndCtl)
Call ScopeButton's click method.
An adapted CButton control around a ScopeButton.
void Enable(const bool &state)
Sets the enabled/disabled state of the control.
Mimicks a button, glue between the GUI and controller, used in ScopeController.
Definition: ScopeButton.h:7
boost::signals2::connection stateconnection
The connection object for the control state (connection to the scope_button)
Various helper functions and classes for Scope.
LRESULT OnKeyUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Resets state of shift key.
bool AttachToDlgItem(HWND hWnd)
Attach the control to a dialog item.