Modified:
trunk/src/main.cpp
Log:
add message flow
Modified: trunk/src/main.cpp
==============================================================================
--- trunk/src/main.cpp (original)
+++ trunk/src/main.cpp Tue Sep 11 20:51:38 2007
@@ -13,6 +13,7 @@
#include "ScenariosForm.h"
#include "OsipProcess.h"
#include <wx/wfstream.h>
+#include "wx/numdlg.h"
#include "wx/image.h"
#include "wx/splash.h"
#include "version.h"
@@ -56,7 +57,7 @@
splashtext=NULL;
event.Skip();
}
-
+
/*
class MyDebugReport : public wxDebugReportCompress
{
@@ -85,8 +86,8 @@
EVT_MENU(Minimal_Clear_Transaction, MyFrame::OnClearTrans)
EVT_MENU(Minimal_Force_Port, MyFrame::OnForcePort)
EVT_MENU(Minimal_Update_AllCase, MyFrame::OnUpdateAllCase)
- EVT_MENU(Minimal_GLOBAL_LANGUAGE_CHOOSE_CHINESE, MyFrame::OnLangChinese)
- EVT_MENU(Minimal_GLOBAL_LANGUAGE_CHOOSE_ENGLISH, MyFrame::OnLangEnglish)
+ EVT_MENU(Minimal_GLOBAL_LANGUAGE_CHOOSE_CHINESE, MyFrame::OnLangChinese)
+ EVT_MENU(Minimal_GLOBAL_LANGUAGE_CHOOSE_ENGLISH, MyFrame::OnLangEnglish)
EVT_MENU(Minimal_About, MyFrame::OnAbout)
EVT_MENU(Minimal_Conf, MyFrame::OnConfig)
EVT_MENU(Minimal_CHANGE_IDENT, MyFrame::OnChangeIdent)
@@ -574,9 +575,9 @@
bool MyApp::NeedStopForMemNotEnough(){
if (FreeMemWhenInit<0) return false;
- long nowfree=wxGetFreeMemory();
+ wxMemorySize nowfree=wxGetFreeMemory();
if (nowfree<0) return false;
- return ((double)nowfree)<((double)FreeMemWhenInit * 0.4);
+ return (nowfree<(double)FreeMemWhenInit * 0.4);
}
long ScenariosFormSeq=1;
@@ -589,8 +590,8 @@
wxLog::SetActiveTarget(new wxLogStderr());
m_locale.Init(/*wxLANGUAGE_CHINESE_SIMPLIFIED*/);
- wxLocale::AddCatalogLookupPathPrefix(wxT("."));
- wxLocale::AddCatalogLookupPathPrefix(wxT(".."));
+ wxLocale::AddCatalogLookupPathPrefix(wxT("."));
+ wxLocale::AddCatalogLookupPathPrefix(wxT(".."));
m_locale.AddCatalog (wxT("SipTestTool"));
wxImage::AddHandler(new wxPNGHandler);
@@ -718,10 +719,10 @@
InitOsipSendSock();
InitGlobalConfig();
- {
+ {
for (int i=0;i<STT_STATISITEM_NUMS;i++){
AllStatistics[i]=0;
- }
+ }
}
@@ -732,7 +733,7 @@
{
for (int i=0;i<MAX_SCENARIOS_NUM;i++){
AllScenariosForm[i] = NULL;
- }
+ }
}
m_traceForm = new TraceForm(frame, _("Global Trace Form"),
wxPoint(-1, -1), wxSize(-1, -1),
@@ -950,13 +951,13 @@
wxMenu *toolMenu = new wxMenu;
toolMenu->Append(Minimal_Conf, _("Global C&onfig\tAlt-O"), _("Config this program"));
- toolMenu->Append(Minimal_GLOBAL_TRACE_SET, _("Global &Trace\tAlt-T"), gtMenu, _("Global Trace Set"));
+ toolMenu->Append(Minimal_GLOBAL_TRACE_SET, _("Global &Trace\tAlt-T"), gtMenu, _("Global Trace Set"));
/*toolMenu->AppendSeparator();
- wxMenu *langMenu = new wxMenu;
- langMenu->Append(Minimal_GLOBAL_LANGUAGE_CHOOSE_CHINESE, _("Chinese"), _("Switch to chinese language"));
- langMenu->Append(Minimal_GLOBAL_LANGUAGE_CHOOSE_ENGLISH, wxT("English"), _("Switch to english language"));
- toolMenu->Append(wxNewId(), _("Language"), langMenu, _("Choose Language"));*/
-
+ wxMenu *langMenu = new wxMenu;
+ langMenu->Append(Minimal_GLOBAL_LANGUAGE_CHOOSE_CHINESE, _("Chinese"), _("Switch to chinese language"));
+ langMenu->Append(Minimal_GLOBAL_LANGUAGE_CHOOSE_ENGLISH, wxT("English"), _("Switch to english language"));
+ toolMenu->Append(wxNewId(), _("Language"), langMenu, _("Choose Language"));*/
+
/*toolMenu->Append(-1, wxT("-"), wxT(""));
toolMenu->Append(Minimal_Round_Test, _("&Round Test\tAlt-R"), _("Do Round Test"));
@@ -1084,13 +1085,13 @@
}
}
-void MyFrame::OnLangChinese(wxCommandEvent& WXUNUSED(event)){
- wxGetApp().m_locale.Init(wxLANGUAGE_CHINESE_SIMPLIFIED);
-}
-
-void MyFrame::OnLangEnglish(wxCommandEvent& WXUNUSED(event)){
- wxGetApp().m_locale.Init(wxLANGUAGE_ENGLISH);
-}
+void MyFrame::OnLangChinese(wxCommandEvent& WXUNUSED(event)){
+ wxGetApp().m_locale.Init(wxLANGUAGE_CHINESE_SIMPLIFIED);
+}
+
+void MyFrame::OnLangEnglish(wxCommandEvent& WXUNUSED(event)){
+ wxGetApp().m_locale.Init(wxLANGUAGE_ENGLISH);
+}
void MyFrame::OnConfig(wxCommandEvent& WXUNUSED(event))
{
@@ -1115,9 +1116,9 @@
}
void MyFrame::OnForcePort(wxCommandEvent& WXUNUSED(event))
-{
- long v = wxGetNumberFromUser( _("Enter the port number you want:"),
- _("Port Number:"), _T("Force Port"),
+{
+ long v = wxGetNumberFromUser( _("Enter the port number you want:"),\
+ _("Port Number:"), _T("Force Port"),\
ForcePort, 0, 65535, this );
if (v!=-1) ForcePort=v;
}
@@ -1149,7 +1150,9 @@
wxMDIChildFrame* p=GetActiveChild();
if (p){
if (wxT("TRACEFORM") == p->GetName()){
- ((TraceForm *)p)->Clear();
+ ((TraceForm *)p)->m_Text->Clear();
+ ((TraceForm *)p)->m_msgflow->m_msglist.Clear();
+ ((TraceForm *)p)->m_msgflow->Refresh();
}
}
}
@@ -1181,12 +1184,12 @@
{
Close(TRUE);
}
-
-#ifdef NoBuildTag
-std::string BuildTag="Not Present in VC6 version";
+
+#ifdef NoBuildTag
+std::string BuildTag="Not Present in VC6 version";
#else
-extern std::string BuildTag;
-#endif
+extern std::string BuildTag;
+#endif
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{