tagging release
[dasher.git] / trunk / Src / Win32 / Widgets / StatusControl.h
blob4b6bc569b9a62869c7660ae694b3f6800213ef98
1 #ifndef __StatusControl_h__
2 #define __StatusControl_h__
4 #include "../Common/WinCommon.h"
5 #include "../../DasherCore/DasherInterfaceBase.h"
7 #include <atlbase.h>
8 #include <atlwin.h>
10 extern CONST UINT DASHER_SHOW_PREFS;
11 #define _DASHER_SHOW_PREFS (LPCWSTR)"dasher_show_prefs"
13 class CStatusControl : public ATL::CWindowImpl<CStatusControl> {
14 public:
15 CStatusControl(CDasherInterfaceBase *pDasherInterface);
17 // ATL boilerplate code
18 DECLARE_WND_SUPERCLASS(L"STATUSCONTROL", L"STATIC");
20 BEGIN_MSG_MAP(CStatusControl)
21 MESSAGE_HANDLER(WM_COMMAND, OnCommand)
22 MESSAGE_HANDLER(WM_NOTIFY, OnNotify)
23 MESSAGE_HANDLER(WM_SIZE, OnSize)
24 END_MSG_MAP()
26 // Message handlers:
27 LRESULT OnCommand(UINT message, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
28 LRESULT OnNotify(UINT message, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
29 LRESULT OnSize(UINT message, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
31 // Create the window, with children
32 HWND Create(HWND hParent);
34 private:
35 // Create the child windows of the control
36 void CreateChildren();
38 // Initial layout of child windows
39 void LayoutChildrenInitial();
41 // Incremental update of child windows
42 void LayoutChildrenUpdate();
44 // Update the contents of the alphabet seletion combo
45 void PopulateCombo();
47 // Update Dasher to reflect the new alphabet selection
48 void SelectAlphabet();
50 // Update the contents of the speed control
51 void PopulateSpeed();
53 // Update Dasher and the edit box to represent the current speed
54 void UpdateSpeed(int iPos, int iDelta);
56 // The Dasher interface with which this control communicates
57 CDasherInterfaceBase *m_pDasherInterface;
59 // Handles to child windows
60 HWND m_hEdit;
61 HWND m_hUpDown;
62 HWND m_hCombo;
63 HWND m_hSpeedLabel;
64 HWND m_hAlphabetLabel;
66 int m_iEditWidth;
69 #endif