[994dbc]: ControlExtns.h  Maximize  Restore  History

Download this file

153 lines (124 with data), 3.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*
* Copyright (c) 2003-2007 Rony Shapiro <ronys@users.sourceforge.net>.
* All rights reserved. Use of the code is allowed under the
* Artistic License 2.0 terms, as specified in the LICENSE file
* distributed with this code, or available from
* http://www.opensource.org/licenses/artistic-license-2.0.php
*/
#pragma once
// ControlExtns.h : header file
// Extensions to standard Static, Edit, ListBox and Combobox Controls
// Pick a number at the end of the WM_USER range
#define EM_SELECTALL (WM_APP - 1)
class CStaticExtn : public CStatic
{
// Construction
public:
CStaticExtn();
void SetColour(COLORREF cfUser)
{m_bUserColour = TRUE; m_cfUser = cfUser;}
void ResetColour()
{m_bUserColour = FALSE;}
// Attributes
private:
BOOL m_bUserColour;
COLORREF m_cfUser;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEditEx)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CStaticExtn();
// Generated message map functions
protected:
//{{AFX_MSG(CEditExtn)
afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class CEditExtn : public CEdit
{
// Construction
public:
CEditExtn();
CEditExtn(int message_number, LPCTSTR szmenustring);
void ChangeColour() {m_bIsFocused = TRUE;}
// Attributes
private:
BOOL m_bIsFocused;
CBrush m_brInFocus;
CBrush m_brNoFocus;
int m_lastposition, m_nStartChar, m_nEndChar;
int m_message_number;
CString m_menustring;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEditEx)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CEditExtn();
// Generated message map functions
protected:
//{{AFX_MSG(CEditExtn)
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnKillFocus(CWnd* pNewWnd);
afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class CListBoxExtn : public CListBox
{
// Construction
public:
CListBoxExtn();
void ChangeColour() {m_bIsFocused = TRUE;}
// Attributes
private:
BOOL m_bIsFocused;
CBrush m_brInFocus;
CBrush m_brNoFocus;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEditEx)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CListBoxExtn();
// Generated message map functions
protected:
//{{AFX_MSG(CListBoxExtn)
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnKillFocus(CWnd* pNewWnd);
afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class CComboBoxExtn : public CComboBox
{
public:
CEditExtn m_edit;
CListBoxExtn m_listbox;
// Operations
public:
void ChangeColour();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CComboBoxExtn)
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CComboBoxExtn)
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks