summaryrefslogtreecommitdiff
path: root/IvyProbe
diff options
context:
space:
mode:
authorfcolin2007-02-01 13:10:41 +0000
committerfcolin2007-02-01 13:10:41 +0000
commit2a3f2940210bd608f129aec6fc1f40b1240db2ff (patch)
treef20a06e49832d6261794b125d8d6c8c8d42180d1 /IvyProbe
parent64762a94e5c9f1fd90a9ffd252908d27dc58da5a (diff)
downloadivy-cplusplus-2a3f2940210bd608f129aec6fc1f40b1240db2ff.zip
ivy-cplusplus-2a3f2940210bd608f129aec6fc1f40b1240db2ff.tar.gz
ivy-cplusplus-2a3f2940210bd608f129aec6fc1f40b1240db2ff.tar.bz2
ivy-cplusplus-2a3f2940210bd608f129aec6fc1f40b1240db2ff.tar.xz
Utilisateur : Fcolin Date : 14/03/00 Heure : 14:49 Archivé dans $/Bus/Test Commentaire: modif Text Scroll (vss 8)
Diffstat (limited to 'IvyProbe')
-rw-r--r--IvyProbe/IvyProbeDlg.cpp38
1 files changed, 17 insertions, 21 deletions
diff --git a/IvyProbe/IvyProbeDlg.cpp b/IvyProbe/IvyProbeDlg.cpp
index ff339c1..62fd7ac 100644
--- a/IvyProbe/IvyProbeDlg.cpp
+++ b/IvyProbe/IvyProbeDlg.cpp
@@ -80,7 +80,6 @@ void CTestDlg::DoDataExchange(CDataExchange* pDX)
//{{AFX_DATA_MAP(CTestDlg)
DDX_Control(pDX, IDC_REGEXP, m_expr);
DDX_Control(pDX, IDC_MSG, m_msg);
- DDX_Control(pDX, IDC_TEXT, m_text);
DDX_Control(pDX, IDC_SLIDER7, m_slider7);
DDX_Control(pDX, IDC_SLIDER6, m_slider6);
DDX_Control(pDX, IDC_SLIDER5, m_slider5);
@@ -165,7 +164,9 @@ BOOL CTestDlg::OnInitDialog()
);
UpdateLayout ();
- // TODO: Add extra initialization here
+ // extra initialization here
+ m_text.SubclassDlgItem (IDC_TEXT, this);
+
m_slider0.SetRange( 0, 127);
m_slider1.SetRange( 0, 127);
m_slider2.SetRange( 0, 127);
@@ -235,12 +236,10 @@ void CTestDlg::IvyCallback(IvyApplication *app, int argc, const char **argv)
int i;
CString text;
TRACE(" Called function args:");
- text.Format("Ivy callback %d args\r\n",argc );
- WriteMessage( text );
+ WriteMessage( "Ivy callback %d args",argc );
for ( i = 0; i < argc; i++ )
{
- text.Format("Ivy callback arg%d '%s'\r\n",i, argv[i] );
- WriteMessage( text );
+ WriteMessage( " arg%d='%s'",i, argv[i] );
TRACE(" '%s'",argv[i]);
}
TRACE("\n");
@@ -296,20 +295,21 @@ TRACE("Direct Msg Receive %d, %s\n",id,arg );
void CTestDlg::OnApplicationConnected(IvyApplication *app)
{
- CString text;
- text.Format("Application: %s ready\r\n",(LPCSTR)(app->GetName()) );
- WriteMessage( text );
+ WriteMessage( "Application: %s ready",(LPCSTR)(app->GetName()) );
}
void CTestDlg::OnApplicationDisconnected(IvyApplication *app)
{
- CString text;
- text.Format("Application: %s bye\r\n",(LPCSTR)(app->GetName()) );
- WriteMessage( text );
+ WriteMessage( "Application: %s bye",(LPCSTR)(app->GetName()) );
}
-void CTestDlg::WriteMessage(const CString & text)
+void CTestDlg::WriteMessage(LPCTSTR format, ...)
{
- m_text.SetSel( -1, -1, FALSE );
- m_text.ReplaceSel( text );
+ CString str;
+ // format and write the data we were given
+ va_list args;
+ va_start(args, format);
+ str.FormatV(format, args);
+
+ m_text.AppendString( str );
}
@@ -334,9 +334,7 @@ void CTestDlg::OnSend()
{
m_msg.AddString( buffer );
}
- CString mess;
- mess.Format("Sending %d message %s\r\n",count,buffer);
- WriteMessage( mess );
+ WriteMessage( "Sending %d message %s",count,(LPCSTR)buffer );
m_msg.Clear();
}
@@ -351,8 +349,6 @@ void CTestDlg::OnBind()
{
m_expr.AddString( buffer );
}
- CString mess;
- mess.Format("Binding to %s\r\n",buffer);
- WriteMessage( mess );
+ WriteMessage( "Binding to %s", (LPCSTR)buffer );
m_expr.Clear();
}