diff options
author | fcolin | 2007-02-01 13:08:39 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 13:08:39 +0000 |
commit | e89b6e7059789e5eb3b8396eaf1a060d7090b14e (patch) | |
tree | 32e44cce4f00a2ca91b72fe23f6a5bc6394c28fd | |
parent | 2c1660054c942745df387d0104f7de37908135b3 (diff) | |
download | ivy-cplusplus-e89b6e7059789e5eb3b8396eaf1a060d7090b14e.zip ivy-cplusplus-e89b6e7059789e5eb3b8396eaf1a060d7090b14e.tar.gz ivy-cplusplus-e89b6e7059789e5eb3b8396eaf1a060d7090b14e.tar.bz2 ivy-cplusplus-e89b6e7059789e5eb3b8396eaf1a060d7090b14e.tar.xz |
Utilisateur : Fcolin Date : 14/03/00 Heure : 14:07 Créé (vss 1)
-rw-r--r-- | Bus/IvyProbe/HistoryEdit.cpp | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/Bus/IvyProbe/HistoryEdit.cpp b/Bus/IvyProbe/HistoryEdit.cpp new file mode 100644 index 0000000..cdb1f0f --- /dev/null +++ b/Bus/IvyProbe/HistoryEdit.cpp @@ -0,0 +1,82 @@ +/*
+ * HistoryEdit.cpp
+ *
+ * Description:
+ * CHistoryEdit implementation
+ *
+ * A CEdit subclass that allows you to display a text history
+ * of events.
+ *
+ * Author:
+ * Ravi Bhavnani (ravib@datablast.net)
+ *
+ * Revision History:
+ * 15 Mar 1998 rab Original version
+ */
+
+#include "stdafx.h"
+#include "HistoryEdit.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CHistoryEdit
+
+CHistoryEdit::CHistoryEdit()
+{
+ m_bSelectable = FALSE;
+}
+
+CHistoryEdit::~CHistoryEdit()
+{
+}
+
+BEGIN_MESSAGE_MAP(CHistoryEdit, CEdit)
+ //{{AFX_MSG_MAP(CHistoryEdit)
+ ON_WM_SETFOCUS()
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CHistoryEdit operations
+
+void CHistoryEdit::AppendString
+ (CString str)
+//
+// Purpose:
+// Appends a text string to the history buffer.
+//
+// Returns:
+// None.
+//
+{
+CString strBuffer; // current contents of edit control
+
+ // Append string
+ GetWindowText (strBuffer);
+ if (!strBuffer.IsEmpty())
+ strBuffer += "\r\n";
+ strBuffer += str;
+ SetWindowText (strBuffer);
+
+ // Scroll the edit control
+ LineScroll (GetLineCount(), 0);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CHistoryEdit message handlers
+
+void CHistoryEdit::OnSetFocus(CWnd* pOldWnd)
+{
+ // Don't allow user to select text
+ if (m_bSelectable)
+ CEdit::OnSetFocus (pOldWnd);
+ else
+ pOldWnd->SetFocus();
+}
+
+// End EditHistroy.cpp
\ No newline at end of file |